{
  "version": 1,
  "generated": "2026-10-27",
  "blocks": [
    {
      "id": "text",
      "name": "Text",
      "category": "source",
      "description": "Type or paste text to start from",
      "keywords": [
        "input",
        "source",
        "paste",
        "scratch"
      ],
      "inputs": [],
      "outputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Text"
        }
      ],
      "params": [
        {
          "name": "value",
          "kind": "text",
          "default": ""
        }
      ],
      "examples": [
        {
          "label": "Start from some text",
          "params": {
            "value": "Hello World 42"
          },
          "expect": {
            "text": "Hello World 42"
          }
        },
        {
          "label": "Paste JSON to feed another block",
          "params": {
            "value": "{\"user\":{\"name\":\"ada\"}}"
          },
          "expect": {
            "text": "{\"user\":{\"name\":\"ada\"}}"
          }
        }
      ]
    },
    {
      "id": "markdown",
      "name": "Markdown",
      "category": "visual",
      "description": "Write Markdown, or render what's wired in",
      "keywords": [
        "markdown",
        "md",
        "editor",
        "preview",
        "render",
        "readme",
        "notes",
        "docs",
        "comment"
      ],
      "inputs": [
        {
          "id": "text",
          "type": "markdown",
          "label": "Markdown",
          "required": true
        }
      ],
      "outputs": [
        {
          "id": "text",
          "type": "markdown",
          "label": "Markdown"
        }
      ],
      "params": [
        {
          "name": "md",
          "kind": "hidden",
          "default": "## Notes\n\nThis is what makes a shared bode make sense to whoever opens it."
        }
      ],
      "page": "/blocks/markdown",
      "examples": [
        {
          "label": "Explain a bode to whoever opens it",
          "params": {
            "md": "## What this does\n\nPaste a JWT on the left; the QR code is the session token."
          }
        },
        {
          "label": "Keep a running list",
          "params": {
            "md": "- [x] decode\n- [ ] check expiry"
          }
        }
      ]
    },
    {
      "id": "todo",
      "name": "Todo",
      "category": "visual",
      "description": "A list you can add to, tick off and reorder",
      "keywords": [
        "todo",
        "to-do",
        "to do",
        "task",
        "tasks",
        "checklist",
        "check list",
        "list",
        "done",
        "tick",
        "check off",
        "chores",
        "shopping list",
        "packing",
        "steps",
        "punch list",
        "backlog"
      ],
      "inputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Items",
          "required": false
        }
      ],
      "outputs": [
        {
          "id": "text",
          "type": "markdown",
          "label": "List"
        },
        {
          "id": "open",
          "type": "text",
          "label": "Open"
        },
        {
          "id": "done",
          "type": "text",
          "label": "Done"
        },
        {
          "id": "count",
          "type": "json",
          "label": "Count"
        }
      ],
      "params": [
        {
          "name": "items",
          "kind": "hidden",
          "default": []
        }
      ],
      "page": "/blocks/todo-list",
      "examples": [
        {
          "label": "A release checklist",
          "params": {
            "items": [
              {
                "id": "a",
                "text": "Write the changelog entry",
                "done": true
              },
              {
                "id": "b",
                "text": "Take the screenshots",
                "done": false
              },
              {
                "id": "c",
                "text": "Deploy",
                "done": false
              }
            ]
          }
        },
        {
          "label": "A list that arrived from somewhere else",
          "params": {
            "items": []
          },
          "inputs": {
            "text": "- [x] book the room\n- [ ] send the invite\n- [ ] write the agenda"
          }
        }
      ]
    },
    {
      "id": "superscript",
      "name": "Super / Subscript",
      "category": "text",
      "description": "Turn text into ˣ or ₓ characters",
      "keywords": [
        "superscript",
        "subscript",
        "exponent",
        "unicode",
        "tiny text",
        "th",
        "nd"
      ],
      "inputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Text",
          "required": true
        }
      ],
      "outputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Styled"
        }
      ],
      "params": [
        {
          "name": "script",
          "kind": "enum",
          "label": "Script",
          "default": "super",
          "options": [
            "super",
            "sub"
          ]
        },
        {
          "name": "literal",
          "kind": "hidden",
          "default": ""
        }
      ],
      "page": "/blocks/superscript",
      "examples": [
        {
          "label": "Write an exponent",
          "params": {
            "literal": "x2 + n",
            "script": "super"
          },
          "expect": {
            "text": "ˣ² ⁺ ⁿ"
          }
        },
        {
          "label": "A chemical formula",
          "params": {
            "literal": "H2SO4",
            "script": "sub"
          },
          "expect": {
            "text": "H₂SO₄"
          }
        }
      ]
    },
    {
      "id": "symbols",
      "name": "Symbols",
      "category": "text",
      "description": "Find and copy a character you cannot type",
      "keywords": [
        "symbol",
        "symbols",
        "special characters",
        "unicode",
        "degree",
        "trademark",
        "copyright",
        "arrow",
        "currency",
        "greek",
        "maths",
        "glyph",
        "insert",
        "sign",
        "dash"
      ],
      "inputs": [],
      "outputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Character"
        }
      ],
      "params": [
        {
          "name": "picked",
          "kind": "hidden",
          "default": "°"
        }
      ],
      "page": "/blocks/special-characters",
      "examples": [
        {
          "label": "The degree sign",
          "params": {
            "picked": "°"
          },
          "expect": {
            "text": "°"
          }
        },
        {
          "label": "An arrow",
          "params": {
            "picked": "→"
          },
          "expect": {
            "text": "→"
          }
        }
      ]
    },
    {
      "id": "template",
      "name": "Template",
      "category": "text",
      "description": "Put values into text with {{ a }} and {{ b }}",
      "keywords": [
        "mustache",
        "handlebars",
        "interpolate",
        "fill",
        "format",
        "render",
        "placeholder"
      ],
      "inputs": [
        {
          "id": "a",
          "type": "any",
          "label": "A",
          "required": true
        },
        {
          "id": "b",
          "type": "any",
          "label": "B",
          "required": false
        }
      ],
      "outputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Text"
        }
      ],
      "params": [
        {
          "name": "body",
          "kind": "text",
          "label": "Template",
          "default": "{{ a }}"
        }
      ],
      "page": "/blocks/template",
      "examples": [
        {
          "label": "Build an Authorization header",
          "params": {
            "body": "Authorization: Basic {{ a }}"
          },
          "inputs": {
            "a": "dXNlcjpwYXNz"
          },
          "expect": {
            "text": "Authorization: Basic dXNlcjpwYXNz"
          }
        },
        {
          "label": "Fill fields from JSON",
          "params": {
            "body": "Hi {{ a.user.name }} (#{{ a.user.id }})"
          },
          "inputs": {
            "a": {
              "user": {
                "name": "ada",
                "id": 7
              }
            }
          },
          "expect": {
            "text": "Hi ada (#7)"
          }
        }
      ]
    },
    {
      "id": "json-query",
      "name": "JSON Query",
      "category": "data",
      "description": "Pull a value out of JSON",
      "keywords": [
        "jsonpath",
        "jq",
        "pluck",
        "extract",
        "select",
        "path",
        "grab value"
      ],
      "inputs": [
        {
          "id": "json",
          "type": "json",
          "label": "JSON",
          "required": true
        }
      ],
      "outputs": [
        {
          "id": "value",
          "type": "json",
          "label": "Value"
        },
        {
          "id": "matches",
          "type": "rows",
          "label": "All matches"
        }
      ],
      "params": [
        {
          "name": "path",
          "kind": "text",
          "label": "Path",
          "default": "$"
        },
        {
          "name": "unwrap",
          "kind": "bool",
          "label": "Unwrap single match",
          "default": true
        }
      ],
      "page": "/blocks/jsonpath",
      "examples": [
        {
          "label": "Pull one value out",
          "params": {
            "path": "$.user.name",
            "unwrap": true
          },
          "inputs": {
            "json": {
              "user": {
                "name": "ada"
              }
            }
          },
          "expect": {
            "value": "ada"
          }
        },
        {
          "label": "Collect every match into rows",
          "params": {
            "path": "$.data[*].name",
            "unwrap": true
          },
          "inputs": {
            "json": {
              "data": [
                {
                  "name": "a"
                },
                {
                  "name": "b"
                }
              ]
            }
          },
          "expect": {
            "value": [
              "a",
              "b"
            ]
          }
        }
      ]
    },
    {
      "id": "json-view",
      "name": "JSON Viewer",
      "category": "data",
      "description": "Explore JSON and copy any path",
      "keywords": [
        "json",
        "viewer",
        "explore",
        "tree",
        "pretty",
        "format",
        "beautify",
        "inspect",
        "browse"
      ],
      "inputs": [
        {
          "id": "json",
          "type": "json",
          "label": "JSON",
          "required": true
        }
      ],
      "outputs": [
        {
          "id": "json",
          "type": "json",
          "label": "JSON"
        }
      ],
      "params": [
        {
          "name": "raw",
          "kind": "bool",
          "label": "Show as text",
          "default": false
        },
        {
          "name": "text",
          "kind": "hidden",
          "default": ""
        }
      ],
      "page": "/blocks/json-viewer",
      "examples": [
        {
          "label": "Read an API response",
          "params": {
            "text": "{\"user\":{\"name\":\"ada\",\"tags\":[\"math\",\"engine\"]},\"active\":true}"
          },
          "expect": {
            "json": {
              "user": {
                "name": "ada",
                "tags": [
                  "math",
                  "engine"
                ]
              },
              "active": true
            }
          }
        },
        {
          "label": "Look through a list",
          "params": {
            "text": "[{\"id\":1,\"ok\":true},{\"id\":2,\"ok\":false}]"
          },
          "expect": {
            "json": [
              {
                "id": 1,
                "ok": true
              },
              {
                "id": 2,
                "ok": false
              }
            ]
          }
        }
      ]
    },
    {
      "id": "base64",
      "name": "Base64",
      "category": "encode",
      "description": "Encode or decode Base64",
      "keywords": [
        "b64",
        "encode",
        "decode",
        "atob",
        "btoa"
      ],
      "inputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Text",
          "required": true
        }
      ],
      "outputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Result"
        }
      ],
      "params": [
        {
          "name": "value",
          "kind": "inlet",
          "label": "Text",
          "default": "",
          "standsInFor": "text"
        },
        {
          "name": "mode",
          "kind": "enum",
          "label": "Mode",
          "default": "encode",
          "options": [
            "encode",
            "decode"
          ]
        },
        {
          "name": "urlSafe",
          "kind": "bool",
          "label": "URL-safe",
          "default": false
        }
      ],
      "page": "/blocks/base64",
      "examples": [
        {
          "label": "Encode some text",
          "params": {
            "mode": "encode"
          },
          "inputs": {
            "text": "hello"
          },
          "expect": {
            "text": "aGVsbG8="
          }
        },
        {
          "label": "Decode a URL-safe value",
          "params": {
            "mode": "decode",
            "urlSafe": true
          },
          "inputs": {
            "text": "aGVsbG8_d29ybGQ"
          },
          "expect": {
            "text": "hello?world"
          }
        }
      ]
    },
    {
      "id": "jwt-decode",
      "name": "JWT Decode",
      "category": "crypto",
      "description": "Read the claims inside a JWT",
      "keywords": [
        "jwt",
        "token",
        "bearer",
        "auth",
        "claims",
        "jws",
        "decode",
        "oauth",
        "oidc",
        "payload"
      ],
      "inputs": [
        {
          "id": "token",
          "type": "text",
          "label": "Token",
          "required": true
        }
      ],
      "outputs": [
        {
          "id": "payload",
          "type": "json",
          "label": "Claims"
        },
        {
          "id": "header",
          "type": "json",
          "label": "Header"
        },
        {
          "id": "expires",
          "type": "text",
          "label": "Expires",
          "of": "moment"
        },
        {
          "id": "signature",
          "type": "json",
          "label": "Signature"
        }
      ],
      "params": [
        {
          "name": "value",
          "kind": "inlet",
          "label": "Token",
          "default": "",
          "standsInFor": "token"
        },
        {
          "name": "show",
          "kind": "enum",
          "label": "Show",
          "default": "claims",
          "options": [
            "claims",
            "header"
          ]
        },
        {
          "name": "key",
          "kind": "hidden",
          "default": ""
        }
      ],
      "sessionParams": [
        "key"
      ],
      "page": "/blocks/jwt-decoder",
      "examples": [
        {
          "label": "Decode and verify a token",
          "params": {
            "key": "bode-demo-secret"
          },
          "inputs": {
            "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZGEiLCJuYW1lIjoiQWRhIExvdmVsYWNlIiwiYWRtaW4iOnRydWUsImlhdCI6MTcwMDAwMDAwMCwiZXhwIjoxNzAwMDAzNjAwfQ.1hWYey3aLbhQqUo8_lhujp-YMpTwGf_7I-XKTfk73RA"
          },
          "expect": {
            "expires": "2023-11-14T23:13:20.000Z"
          }
        },
        {
          "label": "Read a token that never expires",
          "inputs": {
            "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjIwMjQtMDYifQ.eyJpc3MiOiJodHRwczovL2F1dGguZXhhbXBsZS5jb20iLCJzdWIiOiJzZXJ2aWNlLWFjY291bnQiLCJhdWQiOiJhcGkuZXhhbXBsZS5jb20iLCJpYXQiOjE3MDAwMDAwMDB9.c2lnbmF0dXJl"
          },
          "expect": {}
        }
      ]
    },
    {
      "id": "case",
      "name": "Case",
      "category": "text",
      "description": "camelCase, snake_case, Title Case and more",
      "keywords": [
        "camel",
        "snake",
        "kebab",
        "pascal",
        "uppercase",
        "lowercase",
        "title"
      ],
      "inputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Text",
          "required": true
        }
      ],
      "outputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Result"
        }
      ],
      "params": [
        {
          "name": "value",
          "kind": "inlet",
          "label": "Text",
          "default": "",
          "standsInFor": "text"
        },
        {
          "name": "mode",
          "kind": "enum",
          "label": "Case",
          "default": "camel",
          "options": [
            "camel",
            "snake",
            "kebab",
            "pascal",
            "upper",
            "lower",
            "title"
          ]
        }
      ],
      "page": "/blocks/case-converter",
      "examples": [
        {
          "label": "Make an identifier",
          "params": {
            "mode": "camel"
          },
          "inputs": {
            "text": "user profile id"
          },
          "expect": {
            "text": "userProfileId"
          }
        },
        {
          "label": "Split an existing camelCase name",
          "params": {
            "mode": "kebab"
          },
          "inputs": {
            "text": "userProfileId"
          },
          "expect": {
            "text": "user-profile-id"
          }
        }
      ]
    },
    {
      "id": "lines",
      "name": "Lines",
      "category": "text",
      "description": "Sort, dedupe, number or shuffle lines",
      "keywords": [
        "sort",
        "dedupe",
        "unique",
        "reverse",
        "trim",
        "number",
        "shuffle"
      ],
      "inputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Text",
          "required": true
        }
      ],
      "outputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Lines"
        }
      ],
      "params": [
        {
          "name": "value",
          "kind": "inlet",
          "label": "Lines",
          "default": "",
          "standsInFor": "text"
        },
        {
          "name": "op",
          "kind": "enum",
          "label": "Operation",
          "default": "sort",
          "options": [
            "sort",
            "reverse",
            "dedupe",
            "trim",
            "number",
            "shuffle"
          ]
        }
      ],
      "page": "/blocks/sort-lines",
      "examples": [
        {
          "label": "Sort a list",
          "params": {
            "op": "sort"
          },
          "inputs": {
            "text": "pear\napple\nfig"
          },
          "expect": {
            "text": "apple\nfig\npear"
          }
        },
        {
          "label": "Remove duplicates",
          "params": {
            "op": "dedupe"
          },
          "inputs": {
            "text": "a\nb\na"
          },
          "expect": {
            "text": "a\nb"
          }
        }
      ]
    },
    {
      "id": "text-counter",
      "name": "Text Counter",
      "category": "text",
      "description": "Characters, words, lines and bytes",
      "keywords": [
        "character",
        "characters",
        "word",
        "words",
        "count",
        "character count",
        "char count",
        "word count",
        "wordcount",
        "line count",
        "length",
        "how many",
        "letters",
        "bytes",
        "size",
        "limit"
      ],
      "inputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Text",
          "required": false
        }
      ],
      "outputs": [
        {
          "id": "characters",
          "type": "text",
          "label": "Characters"
        },
        {
          "id": "words",
          "type": "text",
          "label": "Words"
        },
        {
          "id": "lines",
          "type": "text",
          "label": "Lines"
        },
        {
          "id": "bytes",
          "type": "text",
          "label": "Bytes"
        }
      ],
      "params": [
        {
          "name": "text",
          "kind": "hidden",
          "default": ""
        }
      ],
      "page": "/blocks/character-counter",
      "examples": [
        {
          "label": "Count a sentence",
          "inputs": {
            "text": "The quick brown fox."
          },
          "expect": {
            "characters": "20",
            "words": "4",
            "lines": "1",
            "bytes": "20"
          }
        },
        {
          "label": "Count an emoji as one character",
          "inputs": {
            "text": "👍🏽"
          },
          "expect": {
            "characters": "1",
            "bytes": "8"
          }
        }
      ]
    },
    {
      "id": "qrcode",
      "name": "QR Code",
      "category": "visual",
      "description": "QR codes for links, Wi-Fi and contacts",
      "keywords": [
        "qr",
        "barcode",
        "scan",
        "vcard",
        "wifi",
        "link",
        "sms",
        "whatsapp",
        "contact",
        "event"
      ],
      "inputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Content",
          "required": false
        },
        {
          "id": "evStart",
          "type": "text",
          "label": "Starts",
          "required": false,
          "of": "moment"
        },
        {
          "id": "evEnd",
          "type": "text",
          "label": "Ends",
          "required": false,
          "of": "moment"
        }
      ],
      "outputs": [
        {
          "id": "image",
          "type": "image",
          "label": "QR code"
        },
        {
          "id": "text",
          "type": "text",
          "label": "Encoded payload"
        }
      ],
      "params": [
        {
          "name": "kind",
          "kind": "enum",
          "label": "Type",
          "default": "link",
          "options": [
            "link",
            "text",
            "email",
            "call",
            "sms",
            "whatsapp",
            "wifi",
            "vcard",
            "event"
          ]
        },
        {
          "name": "url",
          "kind": "text",
          "label": "URL",
          "default": ""
        },
        {
          "name": "text",
          "kind": "text",
          "label": "Text",
          "default": ""
        },
        {
          "name": "emailTo",
          "kind": "text",
          "label": "To",
          "default": ""
        },
        {
          "name": "emailSubject",
          "kind": "text",
          "label": "Subject",
          "default": ""
        },
        {
          "name": "emailBody",
          "kind": "text",
          "label": "Body",
          "default": ""
        },
        {
          "name": "phone",
          "kind": "text",
          "label": "Phone",
          "default": ""
        },
        {
          "name": "message",
          "kind": "text",
          "label": "Message",
          "default": ""
        },
        {
          "name": "ssid",
          "kind": "text",
          "label": "Network name",
          "default": ""
        },
        {
          "name": "wifiAuth",
          "kind": "enum",
          "label": "Security",
          "default": "WPA",
          "options": [
            "WPA",
            "WEP",
            "nopass"
          ]
        },
        {
          "name": "wifiPassword",
          "kind": "text",
          "label": "Password",
          "default": ""
        },
        {
          "name": "wifiHidden",
          "kind": "bool",
          "label": "Hidden network",
          "default": false
        },
        {
          "name": "vcName",
          "kind": "text",
          "label": "Name",
          "default": ""
        },
        {
          "name": "vcOrg",
          "kind": "text",
          "label": "Organisation",
          "default": ""
        },
        {
          "name": "vcTitle",
          "kind": "text",
          "label": "Job title",
          "default": ""
        },
        {
          "name": "vcPhone",
          "kind": "text",
          "label": "Phone",
          "default": ""
        },
        {
          "name": "vcEmail",
          "kind": "text",
          "label": "E-mail",
          "default": ""
        },
        {
          "name": "vcUrl",
          "kind": "text",
          "label": "Website",
          "default": ""
        },
        {
          "name": "evTitle",
          "kind": "text",
          "label": "Event",
          "default": ""
        },
        {
          "name": "evLocation",
          "kind": "text",
          "label": "Location",
          "default": ""
        },
        {
          "name": "evStart",
          "kind": "text",
          "label": "Starts",
          "default": ""
        },
        {
          "name": "evEnd",
          "kind": "text",
          "label": "Ends",
          "default": ""
        },
        {
          "name": "evDesc",
          "kind": "text",
          "label": "Description",
          "default": ""
        },
        {
          "name": "ecc",
          "kind": "enum",
          "label": "Error correction",
          "default": "M",
          "options": [
            "L",
            "M",
            "Q",
            "H"
          ]
        },
        {
          "name": "scale",
          "kind": "number",
          "label": "Module size",
          "default": 6
        },
        {
          "name": "margin",
          "kind": "number",
          "label": "Quiet zone",
          "default": 2
        }
      ],
      "page": "/blocks/qrcode",
      "examples": [
        {
          "label": "A QR code for a link",
          "params": {
            "kind": "link",
            "url": "example.com"
          },
          "expect": {
            "text": "https://example.com"
          }
        },
        {
          "label": "Share a Wi-Fi network",
          "params": {
            "kind": "wifi",
            "ssid": "Cafe",
            "wifiPassword": "flatwhite",
            "wifiAuth": "WPA"
          },
          "expect": {
            "text": "WIFI:T:WPA;S:Cafe;P:flatwhite;;"
          }
        }
      ]
    },
    {
      "id": "http",
      "name": "HTTP Request",
      "category": "network",
      "description": "Call an API and use what comes back",
      "keywords": [
        "fetch",
        "http",
        "api",
        "request",
        "get",
        "post",
        "rest",
        "curl",
        "url",
        "endpoint",
        "webhook"
      ],
      "inputs": [
        {
          "id": "url",
          "type": "text",
          "label": "URL",
          "required": false
        },
        {
          "id": "body",
          "type": "any",
          "label": "Body",
          "required": false
        }
      ],
      "outputs": [
        {
          "id": "body",
          "type": "text",
          "label": "Response"
        },
        {
          "id": "info",
          "type": "json",
          "label": "Status & headers"
        }
      ],
      "params": [
        {
          "name": "method",
          "kind": "enum",
          "label": "Method",
          "default": "GET",
          "options": [
            "GET",
            "POST",
            "PUT",
            "PATCH",
            "DELETE",
            "HEAD"
          ]
        },
        {
          "name": "url",
          "kind": "text",
          "label": "URL",
          "default": ""
        },
        {
          "name": "headers",
          "kind": "text",
          "label": "Headers",
          "default": ""
        },
        {
          "name": "auth",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "body",
          "kind": "text",
          "label": "Body",
          "default": ""
        }
      ],
      "needs": [
        "network"
      ],
      "sessionParams": [
        "auth"
      ],
      "page": "/blocks/http-request",
      "examples": [
        {
          "label": "Fetch some JSON",
          "params": {
            "method": "GET",
            "url": "https://httpbin.org/json"
          }
        },
        {
          "label": "Post a payload",
          "params": {
            "method": "POST",
            "url": "https://httpbin.org/post",
            "body": "{\"hello\":\"world\"}",
            "headers": "Content-Type: application/json"
          }
        }
      ]
    },
    {
      "id": "file",
      "name": "File",
      "category": "media",
      "description": "Open a file from your device",
      "keywords": [
        "file",
        "upload",
        "open",
        "drop",
        "csv",
        "pdf",
        "zip",
        "document",
        "disk",
        "attach"
      ],
      "inputs": [],
      "outputs": [
        {
          "id": "bytes",
          "type": "bytes",
          "label": "File"
        },
        {
          "id": "text",
          "type": "text",
          "label": "Text"
        },
        {
          "id": "info",
          "type": "json",
          "label": "Name, size & type"
        }
      ],
      "params": [
        {
          "name": "data",
          "kind": "hidden",
          "default": null
        },
        {
          "name": "name",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "size",
          "kind": "hidden",
          "default": 0
        }
      ],
      "needs": [
        "file"
      ],
      "sessionParams": [
        "data",
        "name",
        "size"
      ]
    },
    {
      "id": "image",
      "name": "Image",
      "category": "media",
      "description": "A picture from a file or your camera",
      "keywords": [
        "image",
        "photo",
        "picture",
        "upload",
        "file",
        "camera",
        "webcam",
        "png",
        "jpg",
        "screenshot"
      ],
      "inputs": [],
      "outputs": [
        {
          "id": "image",
          "type": "image",
          "label": "Image"
        }
      ],
      "params": [
        {
          "name": "data",
          "kind": "hidden",
          "default": null
        },
        {
          "name": "name",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "size",
          "kind": "hidden",
          "default": 0
        }
      ],
      "needs": [
        "file",
        "permission"
      ],
      "sessionParams": [
        "data",
        "name",
        "size"
      ]
    },
    {
      "id": "audio",
      "name": "Audio",
      "category": "media",
      "description": "A sound from a file or your microphone",
      "keywords": [
        "audio",
        "sound",
        "record",
        "recording",
        "microphone",
        "mic",
        "voice",
        "upload",
        "mp3",
        "wav",
        "memo"
      ],
      "inputs": [],
      "outputs": [
        {
          "id": "audio",
          "type": "audio",
          "label": "Audio"
        }
      ],
      "params": [
        {
          "name": "data",
          "kind": "hidden",
          "default": null
        },
        {
          "name": "name",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "size",
          "kind": "hidden",
          "default": 0
        }
      ],
      "needs": [
        "file",
        "permission"
      ],
      "sessionParams": [
        "data",
        "name",
        "size"
      ]
    },
    {
      "id": "video",
      "name": "Video",
      "category": "media",
      "description": "A clip from a file or your camera",
      "keywords": [
        "video",
        "movie",
        "clip",
        "record",
        "screen",
        "camera",
        "webcam",
        "mp4",
        "webm",
        "upload"
      ],
      "inputs": [],
      "outputs": [
        {
          "id": "video",
          "type": "video",
          "label": "Video"
        }
      ],
      "params": [
        {
          "name": "data",
          "kind": "hidden",
          "default": null
        },
        {
          "name": "name",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "size",
          "kind": "hidden",
          "default": 0
        }
      ],
      "needs": [
        "file",
        "permission"
      ],
      "sessionParams": [
        "data",
        "name",
        "size"
      ]
    },
    {
      "id": "audio-monitor",
      "name": "Audio Monitor",
      "category": "media",
      "description": "Hear and see a live audio input",
      "keywords": [
        "audio",
        "monitor",
        "microphone",
        "mic",
        "input",
        "level",
        "meter",
        "live",
        "listen",
        "sound",
        "vu",
        "waveform",
        "interface",
        "device",
        "check"
      ],
      "inputs": [],
      "outputs": [],
      "params": [
        {
          "name": "deviceId",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "monitor",
          "kind": "hidden",
          "default": false
        }
      ],
      "needs": [
        "permission"
      ],
      "sessionParams": [
        "deviceId"
      ]
    },
    {
      "id": "id",
      "name": "ID Inspector",
      "category": "data",
      "description": "What kind of ID it is, and when it was made",
      "keywords": [
        "uuid",
        "guid",
        "ulid",
        "objectid",
        "ksuid",
        "snowflake",
        "cuid",
        "nanoid",
        "id",
        "identifier",
        "validate",
        "decode",
        "timestamp",
        "mongo",
        "discord"
      ],
      "inputs": [
        {
          "id": "id",
          "type": "text",
          "label": "ID",
          "required": true
        }
      ],
      "outputs": [
        {
          "id": "kind",
          "type": "text",
          "label": "Kind"
        },
        {
          "id": "created",
          "type": "text",
          "label": "Created",
          "of": "moment"
        },
        {
          "id": "info",
          "type": "json",
          "label": "Details"
        }
      ],
      "params": [
        {
          "name": "snowflake",
          "kind": "enum",
          "label": "Snowflakes are from",
          "default": "twitter",
          "options": [
            "twitter",
            "discord",
            "instagram",
            "unix"
          ]
        },
        {
          "name": "value",
          "kind": "hidden",
          "default": ""
        }
      ],
      "page": "/blocks/id-inspector",
      "examples": [
        {
          "label": "A UUID that knows when it was made",
          "inputs": {
            "id": "01912d8e-6f3a-7c4b-9d2e-5a8f1b3c7e90"
          },
          "expect": {
            "kind": "UUID v7"
          }
        },
        {
          "label": "Tell a ULID from the string it resembles",
          "inputs": {
            "id": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
          },
          "expect": {
            "kind": "ULID"
          }
        },
        {
          "label": "A Discord id, which is a Snowflake",
          "params": {
            "snowflake": "discord"
          },
          "inputs": {
            "id": "175928847299117063"
          },
          "expect": {
            "kind": "Snowflake"
          }
        }
      ]
    },
    {
      "id": "time",
      "name": "Time",
      "category": "time",
      "description": "The clock, a moment you pick, or one you paste",
      "keywords": [
        "time",
        "now",
        "date",
        "clock",
        "timestamp",
        "unix",
        "epoch",
        "utc",
        "today",
        "current",
        "iso",
        "live",
        "tick"
      ],
      "inputs": [
        {
          "id": "time",
          "type": "text",
          "label": "Time",
          "required": false,
          "of": "moment"
        },
        {
          "id": "zone",
          "type": "text",
          "label": "Zone",
          "required": false,
          "of": "zone"
        }
      ],
      "outputs": [
        {
          "id": "iso",
          "type": "text",
          "label": "ISO 8601",
          "of": "moment"
        },
        {
          "id": "unix",
          "type": "text",
          "label": "Unix",
          "of": "moment"
        },
        {
          "id": "display",
          "type": "text",
          "label": "Display",
          "of": "moment"
        }
      ],
      "params": [
        {
          "name": "mode",
          "kind": "enum",
          "label": "Time",
          "default": "now",
          "options": [
            "now",
            "fixed"
          ]
        },
        {
          "name": "at",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "now",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "precision",
          "kind": "enum",
          "label": "Precision",
          "default": "second",
          "options": [
            "second",
            "minute",
            "hour",
            "day",
            "month",
            "year"
          ]
        },
        {
          "name": "zone",
          "kind": "hidden",
          "default": ""
        }
      ],
      "needs": [
        "clock"
      ],
      "sessionParams": [
        "now"
      ],
      "page": "/blocks/unix-timestamp-converter",
      "examples": [
        {
          "label": "Read a Unix timestamp",
          "inputs": {
            "time": "1700000000"
          },
          "expect": {
            "iso": "2023-11-14T22:13:20.000Z"
          }
        },
        {
          "label": "Milliseconds, told apart by size",
          "inputs": {
            "time": "1700000000000"
          },
          "expect": {
            "iso": "2023-11-14T22:13:20.000Z"
          }
        },
        {
          "label": "A moment you pick",
          "params": {
            "mode": "fixed",
            "at": "2026-01-01T00:00:00Z"
          },
          "expect": {
            "iso": "2026-01-01T00:00:00.000Z",
            "unix": "1767225600"
          }
        },
        {
          "label": "Eleven in Berlin, in winter",
          "params": {
            "mode": "fixed",
            "at": "2026-01-15T11:00",
            "zone": "Europe/Berlin"
          },
          "expect": {
            "iso": "2026-01-15T10:00:00.000Z"
          }
        },
        {
          "label": "The same clock reading in summer, an hour off",
          "params": {
            "mode": "fixed",
            "at": "2026-07-15T11:00",
            "zone": "Europe/Berlin"
          },
          "expect": {
            "iso": "2026-07-15T09:00:00.000Z"
          }
        }
      ]
    },
    {
      "id": "timezone",
      "name": "Time Zones",
      "category": "time",
      "description": "One moment, shown in several time zones",
      "keywords": [
        "timezone",
        "time zone",
        "tz",
        "utc",
        "gmt",
        "convert",
        "meeting",
        "schedule",
        "across",
        "offset",
        "dst",
        "daylight",
        "world clock",
        "iana"
      ],
      "inputs": [
        {
          "id": "time",
          "type": "text",
          "label": "Time",
          "required": false,
          "of": "moment"
        }
      ],
      "outputs": [
        {
          "id": "rows",
          "type": "rows",
          "label": "Zones"
        },
        {
          "id": "text",
          "type": "text",
          "label": "As text"
        },
        {
          "id": "zone",
          "type": "text",
          "label": "Reference zone",
          "of": "zone"
        }
      ],
      "params": [
        {
          "name": "at",
          "kind": "inlet",
          "label": "Time",
          "default": "",
          "standsInFor": "time"
        },
        {
          "name": "clock",
          "kind": "hidden",
          "default": "24"
        },
        {
          "name": "zones",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "layout",
          "kind": "hidden",
          "default": "rows"
        },
        {
          "name": "now",
          "kind": "hidden",
          "default": ""
        }
      ],
      "needs": [
        "clock"
      ],
      "sessionParams": [
        "now"
      ],
      "page": "/blocks/time-zone-converter",
      "examples": [
        {
          "label": "A meeting, seen from three places",
          "params": {
            "zones": "Europe/London\nAmerica/New_York\nAsia/Tokyo"
          },
          "inputs": {
            "time": "2026-03-10T15:00:00Z"
          },
          "expect": {
            "text": "London — 15:00 Tue 10 Mar\nNew York — 11:00 Tue 10 Mar\nTokyo — 00:00 Wed 11 Mar (+1d)",
            "zone": "Europe/London"
          }
        },
        {
          "label": "The same pair, an hour further apart in January",
          "params": {
            "zones": "Europe/London\nAmerica/New_York"
          },
          "inputs": {
            "time": "2026-01-10T12:00:00Z"
          },
          "expect": {
            "text": "London — 12:00 Sat 10 Jan\nNew York — 07:00 Sat 10 Jan"
          }
        }
      ]
    },
    {
      "id": "timer",
      "name": "Timer",
      "category": "time",
      "description": "Time left on a timer, or until a deadline",
      "keywords": [
        "countdown",
        "timer",
        "stopwatch",
        "alarm",
        "remaining",
        "left",
        "until",
        "deadline",
        "expiry",
        "egg timer",
        "pomodoro",
        "elapsed"
      ],
      "inputs": [
        {
          "id": "until",
          "type": "text",
          "label": "Until",
          "required": false,
          "of": "moment"
        }
      ],
      "outputs": [
        {
          "id": "remaining",
          "type": "text",
          "label": "Remaining",
          "of": "length"
        },
        {
          "id": "seconds",
          "type": "text",
          "label": "Seconds",
          "of": "length"
        },
        {
          "id": "target",
          "type": "text",
          "label": "Target",
          "of": "moment"
        },
        {
          "id": "done",
          "type": "text",
          "label": "Done"
        }
      ],
      "params": [
        {
          "name": "mode",
          "kind": "hidden",
          "default": "for"
        },
        {
          "name": "length",
          "kind": "hidden",
          "default": "5m"
        },
        {
          "name": "until",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "endsAt",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "now",
          "kind": "hidden",
          "default": ""
        }
      ],
      "needs": [
        "clock"
      ],
      "sessionParams": [
        "now",
        "endsAt"
      ],
      "page": "/blocks/countdown-timer",
      "examples": [
        {
          "label": "Count down to a deadline",
          "params": {
            "now": "2025-12-31T23:30:00Z"
          },
          "inputs": {
            "until": "2026-01-01T00:00:00Z"
          },
          "expect": {
            "remaining": "30m left",
            "seconds": "1800"
          }
        },
        {
          "label": "A deadline that has gone by",
          "params": {
            "now": "2026-01-01T00:05:00Z"
          },
          "inputs": {
            "until": "2026-01-01T00:00:00Z"
          },
          "expect": {
            "remaining": "5m ago",
            "seconds": "-300"
          }
        }
      ]
    },
    {
      "id": "duration",
      "name": "Duration",
      "category": "time",
      "description": "A length of time, in every unit",
      "keywords": [
        "duration",
        "length",
        "elapsed",
        "how long",
        "convert",
        "seconds",
        "minutes",
        "hours",
        "days",
        "weeks",
        "milliseconds",
        "ms",
        "iso 8601",
        "pt1h30m",
        "humanize",
        "humanise",
        "1h30m",
        "timespan",
        "interval"
      ],
      "inputs": [
        {
          "id": "duration",
          "type": "text",
          "label": "Duration",
          "required": false,
          "of": "length"
        }
      ],
      "outputs": [
        {
          "id": "human",
          "type": "text",
          "label": "Readable",
          "of": "length"
        },
        {
          "id": "seconds",
          "type": "text",
          "label": "Seconds",
          "of": "length"
        },
        {
          "id": "iso",
          "type": "text",
          "label": "ISO 8601",
          "of": "length"
        },
        {
          "id": "rows",
          "type": "rows",
          "label": "Units"
        }
      ],
      "params": [
        {
          "name": "text",
          "kind": "hidden",
          "default": "1h 30m"
        }
      ],
      "page": "/blocks/duration-converter",
      "examples": [
        {
          "label": "An hour and a half",
          "inputs": {
            "duration": "1h30m"
          },
          "expect": {
            "human": "1h 30m",
            "seconds": "5400",
            "iso": "PT1H30M"
          }
        },
        {
          "label": "Said in words",
          "inputs": {
            "duration": "1.5 hours"
          },
          "expect": {
            "seconds": "5400",
            "human": "1h 30m"
          }
        },
        {
          "label": "ISO 8601 in",
          "inputs": {
            "duration": "PT2H15M"
          },
          "expect": {
            "seconds": "8100",
            "human": "2h 15m"
          }
        }
      ]
    },
    {
      "id": "time-math",
      "name": "Time Math",
      "category": "time",
      "description": "Add to a moment, or measure between two",
      "keywords": [
        "time math",
        "date math",
        "add",
        "subtract",
        "plus",
        "minus",
        "difference",
        "diff",
        "between",
        "gap",
        "elapsed",
        "since",
        "until",
        "age",
        "deadline",
        "days between",
        "date calculator",
        "how long",
        "from now",
        "ago"
      ],
      "inputs": [
        {
          "id": "from",
          "type": "text",
          "label": "From",
          "required": false,
          "of": "moment"
        },
        {
          "id": "to",
          "type": "text",
          "label": "To",
          "required": false,
          "of": "moment"
        },
        {
          "id": "by",
          "type": "text",
          "label": "By",
          "required": false,
          "of": "length"
        }
      ],
      "outputs": [
        {
          "id": "at",
          "type": "text",
          "label": "Moment",
          "of": "moment"
        },
        {
          "id": "length",
          "type": "text",
          "label": "Length",
          "of": "length"
        },
        {
          "id": "seconds",
          "type": "text",
          "label": "Seconds",
          "of": "length"
        }
      ],
      "params": [
        {
          "name": "mode",
          "kind": "hidden",
          "default": "shift"
        },
        {
          "name": "from",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "to",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "by",
          "kind": "hidden",
          "default": "30d"
        },
        {
          "name": "direction",
          "kind": "hidden",
          "default": "add"
        }
      ],
      "page": "/blocks/date-calculator",
      "examples": [
        {
          "label": "Ninety days from a date",
          "inputs": {
            "from": "2026-01-01T00:00:00Z",
            "by": "90d"
          },
          "expect": {
            "at": "2026-04-01T00:00:00Z"
          }
        },
        {
          "label": "Back up an hour and a half",
          "params": {
            "direction": "subtract"
          },
          "inputs": {
            "from": "2026-01-01T12:00:00Z",
            "by": "1h30m"
          },
          "expect": {
            "at": "2026-01-01T10:30:00Z"
          }
        },
        {
          "label": "How long between two moments",
          "params": {
            "mode": "between"
          },
          "inputs": {
            "from": "2026-01-01T00:00:00Z",
            "to": "2026-01-04T06:00:00Z"
          },
          "expect": {
            "length": "3d 6h after",
            "seconds": "280800"
          }
        }
      ]
    },
    {
      "id": "interval",
      "name": "Interval",
      "category": "time",
      "description": "Fire every so often, and count",
      "keywords": [
        "interval",
        "repeat",
        "every",
        "poll",
        "polling",
        "tick",
        "ticker",
        "refresh",
        "loop",
        "schedule",
        "heartbeat",
        "cron",
        "periodic",
        "timer"
      ],
      "inputs": [
        {
          "id": "every",
          "type": "text",
          "label": "Every",
          "required": false,
          "of": "length"
        }
      ],
      "outputs": [
        {
          "id": "count",
          "type": "text",
          "label": "Count"
        },
        {
          "id": "at",
          "type": "text",
          "label": "At",
          "of": "moment"
        }
      ],
      "params": [
        {
          "name": "every",
          "kind": "hidden",
          "default": "5s"
        },
        {
          "name": "startedAt",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "count",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "at",
          "kind": "hidden",
          "default": ""
        }
      ],
      "needs": [
        "clock"
      ],
      "sessionParams": [
        "startedAt",
        "count",
        "at"
      ],
      "page": "/blocks/interval-timer",
      "examples": [
        {
          "label": "Count the ticks",
          "params": {
            "count": "3",
            "at": "2026-01-01T00:00:15Z"
          },
          "expect": {
            "count": "3",
            "at": "2026-01-01T00:00:15Z"
          }
        },
        {
          "label": "Take the period from a wire",
          "params": {
            "count": "2",
            "at": "2026-01-01T03:00:00Z"
          },
          "inputs": {
            "every": "1h30m"
          },
          "expect": {
            "count": "2"
          }
        }
      ]
    },
    {
      "id": "format",
      "name": "Format",
      "category": "time",
      "description": "A moment, written how you want it",
      "keywords": [
        "format",
        "strftime",
        "date format",
        "datetime",
        "pattern",
        "render",
        "display",
        "human",
        "readable",
        "locale",
        "moment",
        "dayjs",
        "template"
      ],
      "inputs": [
        {
          "id": "time",
          "type": "text",
          "label": "Time",
          "required": false,
          "of": "moment"
        }
      ],
      "outputs": [
        {
          "id": "text",
          "type": "text",
          "label": "Text"
        }
      ],
      "params": [
        {
          "name": "at",
          "kind": "hidden",
          "default": ""
        },
        {
          "name": "pattern",
          "kind": "hidden",
          "default": "%Y-%m-%d %H:%M"
        }
      ],
      "page": "/blocks/date-formatter",
      "examples": [
        {
          "label": "Write a timestamp as a date",
          "params": {
            "pattern": "%Y-%m-%d"
          },
          "inputs": {
            "time": "2026-03-09T14:26:05Z"
          },
          "expect": {
            "text": "2026-03-09"
          }
        },
        {
          "label": "Spell the day out",
          "params": {
            "pattern": "%A %e %B %Y"
          },
          "inputs": {
            "time": "2026-03-09T14:26:05Z"
          },
          "expect": {
            "text": "Monday 9 March 2026"
          }
        }
      ]
    },
    {
      "id": "js",
      "name": "Code",
      "category": "data",
      "description": "Write a JavaScript function, run it on the wire",
      "keywords": [
        "code",
        "js",
        "javascript",
        "function",
        "custom",
        "script",
        "map",
        "filter",
        "transform",
        "lambda"
      ],
      "inputs": [
        {
          "id": "input",
          "type": "any",
          "label": "Input",
          "required": false
        }
      ],
      "outputs": [
        {
          "id": "output",
          "type": "any",
          "label": "Output"
        }
      ],
      "params": [
        {
          "name": "code",
          "kind": "hidden",
          "default": "// input is whatever is wired in.\nreturn input"
        }
      ],
      "needs": [
        "worker"
      ],
      "code": {
        "param": "code",
        "use": "The gap-filler, and the last resort. Prefer a named block from this catalogue — it is readable, configurable and testable, and this one is a page of code somebody has to re-read later. Reach for it only when nothing here does the job: grouping, totals, a reshape no block covers.",
        "consent": "Code a caller writes does NOT run when it lands. The person reads it and allows it, once, on the card. Say so in your reply or the bode looks broken."
      },
      "examples": [
        {
          "label": "Return whatever you work out",
          "params": {
            "code": "return [1, 2, 3].map(n => n * n)"
          },
          "expect": {
            "output": [
              1,
              4,
              9
            ]
          }
        },
        {
          "label": "Transform what is wired in",
          "params": {
            "code": "return input.map(row => row.name.toUpperCase())"
          },
          "inputs": {
            "input": [
              {
                "name": "ada"
              },
              {
                "name": "grace"
              }
            ]
          },
          "expect": {
            "output": [
              "ADA",
              "GRACE"
            ]
          }
        }
      ]
    },
    {
      "id": "protobuf",
      "name": "Protobuf",
      "category": "data",
      "description": "Read a protobuf payload without its .proto",
      "keywords": [
        "protobuf",
        "proto",
        "protocol buffers",
        "grpc",
        "decode",
        "binary",
        "wire",
        "protoscope",
        "varint",
        "blob",
        "payload"
      ],
      "inputs": [
        {
          "id": "data",
          "type": "any",
          "label": "Payload",
          "required": false
        },
        {
          "id": "schema",
          "type": "text",
          "label": ".proto",
          "required": false
        }
      ],
      "outputs": [
        {
          "id": "json",
          "type": "json",
          "label": "Fields"
        },
        {
          "id": "text",
          "type": "text",
          "label": "Readable"
        },
        {
          "id": "rows",
          "type": "rows",
          "label": "Every field"
        }
      ],
      "params": [
        {
          "name": "value",
          "kind": "inlet",
          "label": "Payload",
          "default": "",
          "standsInFor": "data"
        },
        {
          "name": "proto",
          "kind": "text",
          "label": "Schema (.proto)",
          "default": ""
        },
        {
          "name": "message",
          "kind": "text",
          "label": "Read it as",
          "default": ""
        },
        {
          "name": "how",
          "kind": "enum",
          "label": "Encoding",
          "default": "auto",
          "options": [
            "auto",
            "base64",
            "hex"
          ]
        }
      ],
      "page": "/blocks/protobuf-decoder",
      "examples": [
        {
          "label": "Read a payload you were handed",
          "inputs": {
            "data": "CgpvcmRfOHMxazI5Eg9hZGFAZXhhbXBsZS5jb20YAiEAAAAAALBiQCoDAQIEMgkKBUFCQy0xEAIyCQoFWFlaLTkQAToMCgZMb25kb24SAkdC"
          },
          "expect": {
            "json": {
              "1": "ord_8s1k29",
              "2": "ada@example.com",
              "3": 2,
              "4": "4639464080191520768",
              "5": "010204",
              "6": [
                {
                  "1": "ABC-1",
                  "2": 2
                },
                {
                  "1": "XYZ-9",
                  "2": 1
                }
              ],
              "7": {
                "1": "London",
                "2": "GB"
              }
            }
          }
        },
        {
          "label": "Give it the .proto and the fields take their names",
          "inputs": {
            "data": "CgpvcmRfOHMxazI5Eg9hZGFAZXhhbXBsZS5jb20YAiEAAAAAALBiQCoDAQIEMgkKBUFCQy0xEAIyCQoFWFlaLTkQAToMCgZMb25kb24SAkdC",
            "schema": "syntax = \"proto3\";\n\nmessage Order {\n  string id = 1;\n  string email = 2;\n  Status status = 3;\n  double total = 4;\n  repeated int32 quantities = 5;\n  map<string, int32> counts = 6;\n  Address shipping = 7;\n\n  message Address {\n    string city = 1;\n    string country = 2;\n  }\n}\n\nenum Status { OPEN = 0; PAID = 1; SHIPPED = 2; }"
          },
          "expect": {
            "json": {
              "id": "ord_8s1k29",
              "email": "ada@example.com",
              "status": "SHIPPED",
              "total": 149.5,
              "quantities": [
                1,
                2,
                4
              ],
              "counts": {
                "ABC-1": 2,
                "XYZ-9": 1
              },
              "shipping": {
                "city": "London",
                "country": "GB"
              }
            }
          }
        },
        {
          "label": "Read one written as hex",
          "params": {
            "how": "hex"
          },
          "inputs": {
            "data": "0a03616461102a"
          },
          "expect": {
            "json": {
              "1": "ada",
              "2": 42
            }
          }
        }
      ]
    }
  ],
  "portTypes": [
    "text",
    "markdown",
    "json",
    "rows",
    "bytes",
    "image",
    "audio",
    "video",
    "any"
  ],
  "coercion": [
    {
      "from": "text",
      "to": "text",
      "how": "exact"
    },
    {
      "from": "text",
      "to": "markdown",
      "how": "safe"
    },
    {
      "from": "text",
      "to": "json",
      "how": "risky"
    },
    {
      "from": "text",
      "to": "bytes",
      "how": "safe"
    },
    {
      "from": "text",
      "to": "any",
      "how": "safe"
    },
    {
      "from": "markdown",
      "to": "text",
      "how": "lossy"
    },
    {
      "from": "markdown",
      "to": "markdown",
      "how": "exact"
    },
    {
      "from": "markdown",
      "to": "json",
      "how": "risky"
    },
    {
      "from": "markdown",
      "to": "bytes",
      "how": "safe"
    },
    {
      "from": "markdown",
      "to": "any",
      "how": "safe"
    },
    {
      "from": "json",
      "to": "text",
      "how": "safe"
    },
    {
      "from": "json",
      "to": "markdown",
      "how": "safe"
    },
    {
      "from": "json",
      "to": "json",
      "how": "exact"
    },
    {
      "from": "json",
      "to": "rows",
      "how": "risky"
    },
    {
      "from": "json",
      "to": "any",
      "how": "safe"
    },
    {
      "from": "rows",
      "to": "text",
      "how": "safe"
    },
    {
      "from": "rows",
      "to": "markdown",
      "how": "safe"
    },
    {
      "from": "rows",
      "to": "json",
      "how": "exact"
    },
    {
      "from": "rows",
      "to": "rows",
      "how": "exact"
    },
    {
      "from": "rows",
      "to": "any",
      "how": "safe"
    },
    {
      "from": "bytes",
      "to": "text",
      "how": "lossy"
    },
    {
      "from": "bytes",
      "to": "markdown",
      "how": "lossy"
    },
    {
      "from": "bytes",
      "to": "bytes",
      "how": "exact"
    },
    {
      "from": "bytes",
      "to": "any",
      "how": "safe"
    },
    {
      "from": "image",
      "to": "bytes",
      "how": "safe"
    },
    {
      "from": "image",
      "to": "image",
      "how": "exact"
    },
    {
      "from": "image",
      "to": "any",
      "how": "safe"
    },
    {
      "from": "audio",
      "to": "bytes",
      "how": "safe"
    },
    {
      "from": "audio",
      "to": "audio",
      "how": "exact"
    },
    {
      "from": "audio",
      "to": "any",
      "how": "safe"
    },
    {
      "from": "video",
      "to": "bytes",
      "how": "safe"
    },
    {
      "from": "video",
      "to": "video",
      "how": "exact"
    },
    {
      "from": "video",
      "to": "any",
      "how": "safe"
    },
    {
      "from": "any",
      "to": "text",
      "how": "safe"
    },
    {
      "from": "any",
      "to": "markdown",
      "how": "safe"
    },
    {
      "from": "any",
      "to": "json",
      "how": "safe"
    },
    {
      "from": "any",
      "to": "rows",
      "how": "safe"
    },
    {
      "from": "any",
      "to": "bytes",
      "how": "safe"
    },
    {
      "from": "any",
      "to": "image",
      "how": "safe"
    },
    {
      "from": "any",
      "to": "audio",
      "how": "safe"
    },
    {
      "from": "any",
      "to": "video",
      "how": "safe"
    },
    {
      "from": "any",
      "to": "any",
      "how": "exact"
    }
  ],
  "templates": [
    {
      "id": "guest-wifi",
      "name": "Guest Wi-Fi card",
      "category": "everyday",
      "description": "A QR code guests scan to join your network",
      "page": "/explore/templates/guest-wifi",
      "blocks": [
        "markdown",
        "qrcode"
      ]
    },
    {
      "id": "basic-auth",
      "name": "Basic auth header",
      "category": "dev",
      "description": "A username and password as an Authorization header",
      "page": "/explore/templates/basic-auth",
      "blocks": [
        "markdown",
        "text",
        "base64",
        "template"
      ]
    },
    {
      "id": "api-explorer",
      "name": "API response explorer",
      "category": "dev",
      "description": "Call an API and pull one value out of the response",
      "page": "/explore/templates/api-explorer",
      "blocks": [
        "markdown",
        "http",
        "json-view",
        "json-query"
      ]
    },
    {
      "id": "jwt-inspector",
      "name": "JWT inspector",
      "category": "dev",
      "description": "Read a token: its claims, and when it expires",
      "page": "/explore/templates/jwt-inspector",
      "blocks": [
        "markdown",
        "text",
        "jwt-decode",
        "json-view",
        "format"
      ]
    },
    {
      "id": "protobuf-payload",
      "name": "Protobuf payload",
      "category": "dev",
      "description": "Read a protobuf blob you have no .proto for",
      "page": "/explore/templates/protobuf-payload",
      "blocks": [
        "markdown",
        "text",
        "text",
        "protobuf",
        "json-view",
        "template",
        "markdown"
      ]
    }
  ],
  "document": {
    "schema": "/bode.schema.json",
    "spec": "/docs/format",
    "theory": "/docs/theory",
    "file": ".bode",
    "kinds": {
      "document": "bode",
      "archive": "bode-archive"
    }
  },
  "vocabulary": {
    "ops": [
      {
        "op": "add",
        "cost": "writes",
        "about": [
          "Add a block.",
          "Placement is the interesting part, and it is three policies rather than one: `at` if you know where, else beside `connectFrom` (using that block's real width, not a constant), else to the right of everything. Whichever it is, the result is nudged clear of anything already there — a caller that cannot see the canvas must not be able to drop a block on top of another one.",
          "**Refuses** an unknown `blockId`, an `id` already in the graph, and a capability param (see `refusedParams`).",
          "`connectFrom` is best-effort about the WIRE and strict about the request. A port that does not exist is a mistake and is refused; nothing on the new block accepting that type is a fact about the two blocks, and the block is added unwired — which is what both shells already do and the honest outcome rather than a refusal. A caller that REQUIRES the wire says `add` then `connect`, which refuses loudly."
        ],
        "fields": [
          {
            "name": "blockId",
            "type": "string",
            "required": true,
            "means": "Which block, from the manifest — `text`, `jwt-decode`, `timer`."
          },
          {
            "name": "id",
            "type": "string",
            "required": false,
            "means": "The id to give it. Minted when absent; supply one when a later op in the same batch has to name this block before it exists."
          },
          {
            "name": "at",
            "type": "Pos",
            "required": false,
            "means": "Where to put it, before collision avoidance."
          },
          {
            "name": "connectFrom",
            "type": "Wire",
            "required": false,
            "means": "Wire this output into the new block's first input it can legally reach, and place the block beside its source. The chain-building gesture: it is what ⌘K does from the selected block and what the phone's Add does from the end of the chain. Left unwired when nothing on the new block accepts the type."
          },
          {
            "name": "params",
            "type": "Record<string, unknown>",
            "required": false,
            "means": "Params to set at birth, merged over the block's defaults like any other."
          }
        ]
      },
      {
        "op": "remove",
        "cost": "writes",
        "about": [
          "Delete a block, and every wire touching it.",
          "**Refuses** an id that is not in the graph. Both ends go together because a dangling wire is not a state the evaluator has — and undo restores both, since the snapshot is of the whole document."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The block to delete."
          }
        ]
      },
      {
        "op": "connect",
        "cost": "writes",
        "about": [
          "Wire one output to one input.",
          "**Refuses** a missing block or port, types that cannot connect at all (lossy connects and says so; impossible is refused), a loop, and — unless `replace` — an input that already has a wire."
        ],
        "fields": [
          {
            "name": "from",
            "type": "Wire",
            "required": true,
            "means": "The output end."
          },
          {
            "name": "to",
            "type": "Wire",
            "required": true,
            "means": "The input end."
          },
          {
            "name": "replace",
            "type": "boolean",
            "required": false,
            "means": "Take over an input that is already wired, dropping the old wire. Off by default, and the asymmetry is deliberate. Dragging onto an occupied port is an unambiguous instruction — you aimed at it — so the canvas passes this. A caller working from a description has no idea the port was taken, and silently discarding someone's wire on its behalf is the kind of edit you only notice later."
          }
        ]
      },
      {
        "op": "disconnect",
        "cost": "writes",
        "about": [
          "Remove a wire, by its id or by the input it feeds.",
          "Both, because both callers exist: the canvas has the edge in hand, and a caller reasoning about a bode knows \"whatever is feeding this input\" long before it knows an edge id.",
          "**Refuses** when neither is given, or when nothing matches."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": false,
            "means": "The wire's own id."
          },
          {
            "name": "to",
            "type": "Wire",
            "required": false,
            "means": "The input end instead — at most one wire can be there."
          }
        ]
      },
      {
        "op": "setParams",
        "cost": "writes",
        "about": [
          "Change a block's settings.",
          "A patch, merged over what is there; it does not replace the whole param object. Setting a key to `undefined` removes it, which is the §29 rule — a param is absent, never empty, because an empty string reaches downstream as something to parse.",
          "**Refuses** an unknown block and any capability param (see `refusedParams`)."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The block whose params to patch."
          },
          {
            "name": "params",
            "type": "Record<string, unknown>",
            "required": true,
            "means": "The keys to change. Everything else is left alone."
          }
        ]
      },
      {
        "op": "note",
        "cost": "writes",
        "about": [
          "Write a note on a block, in Markdown.",
          "Its own op rather than a `setParams` key, for the reason the note lives outside `params` in the first place: `compute` must never see it, and putting it in there would put it in the evaluator's fingerprint and invalidate a cached result on every keystroke. It is still part of the DOCUMENT — it travels in a share link and belongs in a version.",
          "**Refuses** an unknown block. An empty string clears the note."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The block to annotate."
          },
          {
            "name": "notes",
            "type": "string",
            "required": true,
            "means": "The note, in Markdown. Empty clears it."
          }
        ]
      },
      {
        "op": "chip",
        "cost": "writes",
        "about": [
          "Show a block as a chip, or as a card again — item 13.",
          "A chip is the block's name and its output, with the form put away: what the Display block used to be, available on every block instead of requiring a special one. Its own op rather than a `setParams` key for the same reason as `note`: `compute` must never see it, and it is not an input — it is how the block is ARRANGED, which is the document's business and nobody else's.",
          "**Refuses** an unknown block. `on: false` takes the chip off rather than storing one that says no — absent, never empty (§29)."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The block to fold up."
          },
          {
            "name": "on",
            "type": "boolean",
            "required": true,
            "means": "`true` folds it to name and output; `false` opens the card again."
          }
        ]
      },
      {
        "op": "move",
        "cost": "writes",
        "about": [
          "Put a block somewhere.",
          "Position is excluded from the evaluator's fingerprint, so this recomputes nothing — but it is part of the document, so it is saved and it is undoable.",
          "**Refuses** an unknown block."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The block to move."
          },
          {
            "name": "to",
            "type": "Pos",
            "required": true,
            "means": "Where to, exactly. No collision avoidance: a caller that said `move` meant that spot, and `layout` is the op that chooses spots."
          }
        ]
      },
      {
        "op": "resize",
        "cost": "writes",
        "about": [
          "Give a block a size.",
          "`h` is optional because a height only EXISTS once one has been imposed: a card that has merely been widened, as a template's note is, still grows to fit its content. Omitting it is how you hand a height back.",
          "This op exists because #111's boundary audit found it missing. `GBlock.size` is part of the document and `templates/index.ts` already sets `size: { w }` by hand, but React Flow's `dimensions` change was the only thing that could write it — so \"make that card wider\" was unsayable by anything that is not a mouse.",
          "**Refuses** an unknown block, and a width that is not a positive number."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The block to resize."
          },
          {
            "name": "size",
            "type": "{ w: number; h?: number }",
            "required": false,
            "means": "The imposed size. Omit `h` to let the card grow to fit its content again, and omit `size` entirely to take the imposed size off altogether — which is the only way to undo a resize, and was unsayable until a UI wanted it."
          }
        ]
      },
      {
        "op": "duplicate",
        "cost": "writes",
        "about": [
          "Copy blocks, with the wiring that makes the copy useful.",
          "**Incoming wires are copied, outgoing wires are not.** Duplicating a block whose input was fed should give you a copy that is also fed — that is the whole point of duplicating mid-chain. Copying its OUTPUT wires would propose a second wire into inputs that already have one, which is refused anyway, so the rule is the only coherent one rather than a preference.",
          "The copies move as a group, keeping the arrangement you made, and land below the originals rather than beside them: beside reads as a longer chain, below reads as a second copy.",
          "**Refuses** an unknown id. An empty list is a no-op, not an error."
        ],
        "fields": [
          {
            "name": "ids",
            "type": "string[]",
            "required": true,
            "means": "The blocks to copy. Wires between any two of them come along."
          },
          {
            "name": "as",
            "type": "string[]",
            "required": false,
            "means": "The ids to give the copies, one per entry in `ids`. Minted when absent, exactly like `add`'s — and absent for the same reason it is usually absent there: you rarely care. Supply them when a later verb has to NAME a copy, which until this existed was impossible: you could duplicate a block and then had no way to refer to what you had made."
          }
        ]
      },
      {
        "op": "layout",
        "cost": "writes",
        "about": [
          "Straighten the canvas: columns by depth in the DAG, sources on the left.",
          "This is #112's Tidy, reachable as an op because generated blocks cannot be allowed to land in a pile. Never refuses — a graph is always layout-able, and an unknown id in `ids` is simply not there to move."
        ],
        "fields": [
          {
            "name": "ids",
            "type": "string[]",
            "required": false,
            "means": "Lay out only these, leaving everything else where it is — Tidy on a selection. Absent means the whole bode."
          },
          {
            "name": "at",
            "type": "Pos",
            "required": false,
            "means": "Where the top-left of the result goes. Absent means \"where this lot already is\", which is what Tidy wants: it straightens without moving your work across the canvas. A caller BUILDING a bode has no existing position to preserve and does want to say, which is how a template places its chain below its note — the one thing layout cannot derive, because how tall a paragraph renders needs a browser."
          }
        ]
      },
      {
        "op": "rename",
        "cost": "writes",
        "about": [
          "Name the bode, or give it an icon.",
          "An empty string CLEARS the field rather than storing one, because §29's \"absent, never empty\" applies to the document too: an empty name is not a name, and a reader would have to decide what to display for it.",
          "Never refuses."
        ],
        "fields": [
          {
            "name": "name",
            "type": "string",
            "required": false,
            "means": "What to call it."
          },
          {
            "name": "icon",
            "type": "string",
            "required": false,
            "means": "One emoji."
          }
        ]
      },
      {
        "op": "open",
        "cost": "writes",
        "about": [
          "Replace the content with a document.",
          "One op for four things that were four code paths: a template, `core/demo.ts`, a share link and an import are all \"open this bode\". It ignores the graph it is handed and returns the document's, which `(Graph, Op[]) => Graph` takes without a special case.",
          "Validated by **`readDocument`** — the same reader a file goes through — so the document's own rules apply inside the op: a thing that is not a bode is **refused**, but a single bad block or wire is dropped and reported as a WARNING rather than failing the batch. Those are the file's problems, not the caller's, and half a bode you can look at beats a dialog saying no.",
          "It does not touch the bode's identity — its id, its versions, its save state. That is `openBode`, which is a command."
        ],
        "fields": [
          {
            "name": "document",
            "type": "unknown",
            "required": true,
            "means": "A `BodeDocument`, or anything claiming to be one. Unparsed: the op runs the reader, so a caller cannot skip the validation by pre-parsing."
          }
        ]
      },
      {
        "op": "clear",
        "cost": "writes",
        "about": [
          "Empty the bode, keeping its name and icon.",
          "Expressible as one `remove` per block, and earns its own op only because the label and the notification belong to the gesture rather than to N deletions — \"Cleared 9 blocks\" is what a person needs to read in an undo notice.",
          "Never refuses. Clearing an empty bode is a no-op, not an error."
        ],
        "fields": []
      },
      {
        "op": "setVar",
        "cost": "writes",
        "about": [
          "Declare one of the bode's variables, or change what the FILE says about it — item 157.",
          "A variable is a name a block writes as `<< name >>`. What this op can set is the half that travels: a static value the bode carries, and a `hint` saying what somebody opening it should put there.",
          "**It cannot bind one to a credential**, and that is not an omission. A binding lives in the browser, per bode, and is the one thing a bode that arrived from somewhere else must never be able to make — the same reason §33 refuses a caller a file param: a caller cannot honestly consent on your behalf. There is simply nothing here to bind with.",
          "`value: \"\"` clears the static value and leaves the variable declared and unset, which is §29's \"absent, never empty\" applied to a table that travels."
        ],
        "fields": [
          {
            "name": "name",
            "type": "string",
            "required": true,
            "means": "Lowercase letters, digits, `-` and `_`."
          },
          {
            "name": "value",
            "type": "string",
            "required": false,
            "means": "What the file carries. Empty unsets it, leaving the question."
          },
          {
            "name": "hint",
            "type": "string",
            "required": false,
            "means": "What to tell whoever opens this bode: \"a token with repo:read\"."
          }
        ]
      },
      {
        "op": "removeVar",
        "cost": "writes",
        "about": [
          "Forget a variable entirely. A block still naming it stops with \"not set\", which is the honest state rather than a silent empty string."
        ],
        "fields": [
          {
            "name": "name",
            "type": "string",
            "required": true,
            "means": ""
          }
        ]
      }
    ],
    "commands": [
      {
        "command": "select",
        "cost": "safe",
        "about": [
          "Select blocks.",
          "The verb that looked pointless and is not. *\"Select these three so the person can see what I mean\"* is the **preview** step of the pipeline — a builder needs it before it needs anything clever. It also matters mechanically: ⌘K wires from whatever is selected.",
          "**Refuses** an id that is not in the bode. An empty list clears the selection."
        ],
        "fields": [
          {
            "name": "ids",
            "type": "string[]",
            "required": true,
            "means": "The blocks to select. Empty selects nothing."
          }
        ]
      },
      {
        "command": "focus",
        "cost": "safe",
        "about": [
          "Put the camera on one block.",
          "The store cannot do this itself — the viewport belongs to React Flow, inside the canvas. So this records a REQUEST that the canvas answers, the same shape `fitView` and Save already use. A caller that is not on a canvas (the phone, a test, a prerender) simply has nobody listening, which is the correct outcome rather than an error.",
          "**Refuses** an id that is not in the bode."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The block to centre on."
          },
          {
            "name": "field",
            "type": "boolean",
            "required": false,
            "means": "Also put the text cursor in this block's first editable field — what arriving from a tool page does, so you can start typing."
          }
        ]
      },
      {
        "command": "fitView",
        "cost": "safe",
        "about": [
          "Frame the whole bode. Never refuses; an empty bode has nothing to frame and that is not an error."
        ],
        "fields": []
      },
      {
        "command": "run",
        "cost": "external",
        "about": [
          "Lift the run barrier and evaluate — #105.",
          "A block that `needs: ['network']` does not run just because something upstream changed; it holds its last value and reports `stale`. This is the only way past that, and it is one-shot: the permission is spent by the evaluation it triggers, so a later keystroke cannot ride through on it.",
          "With no `ids`, every stale block runs — the canvas's \"3 blocks are out of date · Run\". With `ids`, only those, which is Run on one card.",
          "**Never refuses.** Nothing stale is not an error, it is the ordinary state of a bode you have not edited, and a caller that ran it on a timer should not have to check first."
        ],
        "fields": [
          {
            "name": "ids",
            "type": "string[]",
            "required": false,
            "means": "Which blocks to run. Absent means every stale one."
          }
        ]
      },
      {
        "command": "undo",
        "cost": "writes",
        "about": [
          "Step back through history. **Refuses** when there is nothing to undo, and refused outright inside a batch that contains ops — the batch is itself one history entry, so undoing within it means undoing the thing being built."
        ],
        "fields": []
      },
      {
        "command": "redo",
        "cost": "writes",
        "about": [
          "Step forward again. **Refuses** when there is nothing to redo, and in a batch containing ops, for the same reason as `undo`."
        ],
        "fields": []
      },
      {
        "command": "saveVersion",
        "cost": "writes",
        "about": [
          "Save a named version of this bode.",
          "Versions are explicit and separate from autosave: autosave answers \"what was I doing?\", a version answers \"take me back to this\"."
        ],
        "fields": [
          {
            "name": "label",
            "type": "string",
            "required": false,
            "means": "What to call it. A timestamp stands in when absent."
          },
          {
            "name": "note",
            "type": "string",
            "required": false,
            "means": "Why you saved it."
          }
        ]
      },
      {
        "command": "restoreVersion",
        "cost": "writes",
        "about": [
          "Put a saved version back. **Refuses** an id this bode has no version for."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The version to restore."
          }
        ]
      },
      {
        "command": "deleteVersion",
        "cost": "destructive",
        "about": [
          "Forget a version. **Refuses** an unknown id. Undoable only in the sense that the version list itself is restorable for a few seconds."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The version to delete."
          }
        ]
      },
      {
        "command": "updateVersion",
        "cost": "writes",
        "about": [
          "Rename a saved version, or change its note.",
          "The inverse of the hole `emptyTrash` was: reachable from the Versions dialog and not from the vocabulary, so a caller could save and delete a version but not correct the name it gave one.",
          "**Refuses** an id this bode has no version for. A blank label falls back to unnamed rather than storing whitespace (§29)."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "The version to change."
          },
          {
            "name": "label",
            "type": "string",
            "required": false,
            "means": "What to call it."
          },
          {
            "name": "note",
            "type": "string",
            "required": false,
            "means": "Why you saved it."
          }
        ]
      },
      {
        "command": "newBode",
        "cost": "writes",
        "about": [
          "Start an empty bode, with its own id, versions and save state. The current one is autosaved first, so nothing is lost. Never refuses."
        ],
        "fields": []
      },
      {
        "command": "openBode",
        "cost": "writes",
        "about": [
          "Open a saved bode. **Refuses** an id that is not in storage."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "Which saved bode, from `bodes()`."
          }
        ]
      },
      {
        "command": "openDocument",
        "cost": "writes",
        "about": [
          "Open a document as a NEW bode.",
          "The hole the §135 review found. The `open` OP replaces a bode's content and deliberately leaves its identity alone — same id, same versions, same save state. `loadGraph` resets all of that and validated nothing, which is how every caller that actually wanted \"open this file\" ended up bypassing the reader: a template, the example bode, a share link and an import all took the second door.",
          "So this is the first door, and it runs **`readDocument`** like the op does. A caller cannot skip §110's validation by pre-parsing, which is exactly what `JsonModal` was doing.",
          "**Refuses** anything that is not a bode. A single bad block or wire is dropped and reported as a warning, because that is the file's problem and the readable part still opens."
        ],
        "fields": [
          {
            "name": "document",
            "type": "unknown",
            "required": true,
            "means": "A `BodeDocument`, or anything claiming to be one. Unparsed on purpose."
          },
          {
            "name": "draft",
            "type": "boolean",
            "required": false,
            "means": "Open it as a DRAFT — it works across a refresh without joining All bodes, which is what a template or a shared link should do until you keep it."
          },
          {
            "name": "from",
            "type": "string",
            "required": false,
            "means": "What it came from, shown on the draft banner: a template's name, a URL."
          }
        ]
      },
      {
        "command": "renameBode",
        "cost": "writes",
        "about": [
          "Rename a saved bode.",
          "**One verb with a documented branch, not two verbs** — which is what the §39 inventory asked for. Renaming the bode you have OPEN goes through the document and is undoable; renaming one you do not goes straight to storage and is not. The branch belongs here rather than in every caller, because a caller that has to know which case it is in will eventually get it wrong.",
          "**Refuses** an id that is neither open nor in storage."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "Which bode."
          },
          {
            "name": "name",
            "type": "string",
            "required": false,
            "means": "What to call it. Empty clears it back to untitled."
          },
          {
            "name": "icon",
            "type": "string",
            "required": false,
            "means": "One emoji."
          }
        ]
      },
      {
        "command": "trashBode",
        "cost": "writes",
        "about": [
          "Move a bode to the trash, where it stays recoverable. **Refuses** an id that is not in storage."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "Which bode."
          }
        ]
      },
      {
        "command": "restoreBode",
        "cost": "writes",
        "about": [
          "Take one back out of the trash. **Refuses** an id that is not in it."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "Which bode."
          }
        ]
      },
      {
        "command": "deleteBode",
        "cost": "destructive",
        "about": [
          "Delete a bode for good. **Refuses** nothing — an id that is already gone is the outcome you asked for."
        ],
        "fields": [
          {
            "name": "id",
            "type": "string",
            "required": true,
            "means": "Which bode."
          }
        ]
      },
      {
        "command": "emptyTrash",
        "cost": "destructive",
        "about": [
          "Delete everything in the trash.",
          "The one the §39 sweep found with **no function at all** — an inline loop in `CanvasesModal`, which is how a destructive action ends up with no name, no test and no way to call it from anywhere else."
        ],
        "fields": []
      },
      {
        "command": "keepBode",
        "cost": "writes",
        "about": [
          "Turn the draft into a real bode in All bodes. **Refuses** when what is open is not a draft."
        ],
        "fields": [
          {
            "name": "name",
            "type": "string",
            "required": false,
            "means": "What to call it. Falls back to the draft's current name."
          }
        ]
      },
      {
        "command": "setSetting",
        "cost": "writes",
        "about": [
          "Change a setting.",
          "Settings are in the language because the first draft of §39 left them out as \"a developer's A/B harness\", and `proxyUrl` is the counterexample: a string that decides what network a bode can reach, sitting in the same object as `background: 'dots'`. Operational configuration was already mixed in with cosmetics, so the exclusion was drawn around the wrong thing.",
          "**Refuses** an unknown key, and a value the setting does not allow — `SETTING_SPEC` is what makes the second one checkable rather than a cast."
        ],
        "fields": [
          {
            "name": "key",
            "type": "string",
            "required": true,
            "means": "Which setting, from `SETTING_SPEC`."
          },
          {
            "name": "value",
            "type": "unknown",
            "required": true,
            "means": "The new value. Checked against that setting's kind and choices."
          }
        ]
      },
      {
        "command": "setFlag",
        "cost": "writes",
        "about": [
          "Switch a Labs flag. **Refuses** an unknown key, and a variant that flag does not offer."
        ],
        "fields": [
          {
            "name": "key",
            "type": "string",
            "required": true,
            "means": "The flag, from `flags()`."
          },
          {
            "name": "variant",
            "type": "string",
            "required": true,
            "means": "Which variant."
          }
        ]
      },
      {
        "command": "resetFlags",
        "cost": "destructive",
        "about": [
          "Put every flag back to its default. `destructive`, because it discards choices with no history entry to undo."
        ],
        "fields": []
      },
      {
        "command": "wipeEverything",
        "cost": "destructive",
        "about": [
          "Erase every bode, version, draft and setting this browser holds.",
          "In the language precisely BECAUSE it is the most dangerous thing here: an absent verb cannot be discovered, and a caller that needs to reset a browser would otherwise go looking for localStorage itself."
        ],
        "fields": []
      },
      {
        "command": "setCredential",
        "cost": "writes",
        "about": [
          "Add or replace a credential in this browser — items 103 and 157.",
          "In the language because the Builder has to be able to finish the job: a bode it writes that calls an API needs somewhere for the key to go, and a caller that cannot put one there would hand back a bode that cannot run and no way to fix it but a dialog it cannot open.",
          "**It is a command, not an op**, and that is the whole shape of it. Ops edit the document and travel with it; this touches the browser, is `destructive` because it silently replaces a key of the same name, and is in nothing that is ever saved, shared or exported.",
          "No query ever returns a value, so a caller can write one and never read one."
        ],
        "fields": [
          {
            "name": "name",
            "type": "string",
            "required": true,
            "means": "Lowercase letters, digits, `-` and `_`."
          },
          {
            "name": "value",
            "type": "string",
            "required": true,
            "means": "The key itself."
          }
        ]
      },
      {
        "command": "removeCredential",
        "cost": "destructive",
        "about": [
          "Forget a credential. Every bode bound to it stops, saying which key it wanted — which is the honest outcome of revoking something."
        ],
        "fields": [
          {
            "name": "name",
            "type": "string",
            "required": true,
            "means": ""
          }
        ]
      },
      {
        "command": "bindVar",
        "cost": "writes",
        "about": [
          "Point one of THIS bode's variables at one of this browser's credentials.",
          "The one gesture that is deliberately not an op: a binding is not in the document — a document that could carry one could name a stranger's keys — so it is a command, and it applies to the bode that is open."
        ],
        "fields": [
          {
            "name": "name",
            "type": "string",
            "required": true,
            "means": "The variable. It does not have to exist yet; binding declares it."
          },
          {
            "name": "credential",
            "type": "string",
            "required": false,
            "means": "The credential to answer it with, or omitted to take the answer back."
          }
        ]
      },
      {
        "command": "setLocalVar",
        "cost": "writes",
        "about": [
          "Answer one of this bode's variables with a value kept in THIS BROWSER.",
          "The unshared half of a variable: `setVar` writes what the file carries, and this writes what it does not. A caller filling in a bode somebody else wrote wants this one, because the alternative publishes the answer."
        ],
        "fields": [
          {
            "name": "name",
            "type": "string",
            "required": true,
            "means": ""
          },
          {
            "name": "value",
            "type": "string",
            "required": false,
            "means": "Omitted clears it, leaving whatever the file says."
          }
        ]
      }
    ],
    "queries": [
      {
        "query": "results",
        "cost": "safe",
        "about": [
          "What every block computed: its status, what came out, what went in, and what went wrong.",
          "**The most important query there is.** It is the only way a caller learns whether the thing it just built actually computes, or what came out of it. Without this an agent wires blind and reports a success it never checked.",
          "Use `settle` after an edit. Evaluation is debounced by 120ms so that typing never waits on the graph, which means a caller that applies ops and asks immediately is reading the results from BEFORE its own edit. `settle` waits for the pending evaluation instead, and resolves at once when there is none."
        ],
        "fields": [
          {
            "name": "ids",
            "type": "string[]",
            "required": false,
            "means": "Only these blocks. Absent means every one."
          },
          {
            "name": "settle",
            "type": "boolean",
            "required": false,
            "means": "Wait for the pending evaluation to finish first."
          }
        ]
      },
      {
        "query": "document",
        "cost": "safe",
        "about": [
          "The open bode as a `BodeDocument` — #110's writer, as a read. Session-only params are stripped, exactly as they are on the way to a file."
        ],
        "fields": []
      },
      {
        "query": "shareUrl",
        "cost": "safe",
        "about": [
          "A link that carries the whole bode in its fragment.",
          "Side-effect-free by design — the share dialog rebuilds it on every keystroke — which is precisely what makes this a query rather than a command.",
          "Answers with the payload always and the URL only where there is one: a caller outside a browser has no origin to build a link against, and the payload is the part that carries the bode."
        ],
        "fields": [
          {
            "name": "password",
            "type": "string",
            "required": false,
            "means": "Encrypt the payload. Without one the bode travels in the clear, readable by anyone holding the link."
          }
        ]
      },
      {
        "query": "selection",
        "cost": "safe",
        "about": [
          "Which blocks and wires are selected. The View row's read gap, which is what made `select` look pointless: a caller could set it and never see it."
        ],
        "fields": []
      },
      {
        "query": "viewport",
        "cost": "safe",
        "about": [
          "Where the camera is, and whether a bode has been framed yet. Answered by the canvas; a caller with no canvas gets `null`, which is the truth rather than a zero that looks like a position."
        ],
        "fields": []
      },
      {
        "query": "bodes",
        "cost": "safe",
        "about": [
          "Every saved bode, newest first — id, name, icon, block count, when it changed. Trashed ones are excluded; `trash` is its own query."
        ],
        "fields": [
          {
            "name": "search",
            "type": "string",
            "required": false,
            "means": "Filter by name, the way the Bodes dialog does."
          }
        ]
      },
      {
        "query": "trash",
        "cost": "safe",
        "about": [
          "What is in the trash, most recently binned first."
        ],
        "fields": []
      },
      {
        "query": "versions",
        "cost": "safe",
        "about": [
          "The open bode's saved versions, newest first."
        ],
        "fields": []
      },
      {
        "query": "storage",
        "cost": "safe",
        "about": [
          "How much room is left.",
          "The thing a caller has to know BEFORE a save, because `saveCanvas` answers a full localStorage by returning `false` — and a caller that never asked has no way to tell a refused write from a successful one."
        ],
        "fields": []
      },
      {
        "query": "settings",
        "cost": "safe",
        "about": [
          "Every setting, its current value, and what it accepts — so a caller can discover `background`'s three choices rather than guess at them."
        ],
        "fields": []
      },
      {
        "query": "flags",
        "cost": "safe",
        "about": [
          "Every Labs flag, its variants, its current value, and whether a `?flag=` override is masking the stored one."
        ],
        "fields": []
      },
      {
        "query": "vars",
        "cost": "safe",
        "about": [
          "The bode's variables: what each one is, and whether it would resolve — item 157.",
          "Every name the blocks reference plus anything the file declares, each with its source — `shared` (a value the file carries), `local` (a value this browser holds), `bound` (a credential answers it) or `unset` — and whether it would resolve right now. The names of this browser's credentials come with it, so a caller can offer one; **no value is ever returned**, by this or by any other verb.",
          "It is the query that answers \"can this bode run, and if not, what is missing\" — which is the question a caller actually has."
        ],
        "fields": []
      },
      {
        "query": "catalogue",
        "cost": "safe",
        "about": [
          "Everything a caller that is not a person needs — **item 134**.",
          "Every block with its ports, every port type with the coercion table between them, the templates, and all three vocabularies with their costs. It turned out to be a query rather than a separate artefact, which is the whole of why #134 dissolved into #135.",
          "Loaded on demand: it is generated data measured in tens of kilobytes, and a caller that never asks must not pay for it. Hence `store.ask` being async."
        ],
        "fields": []
      },
      {
        "query": "check",
        "cost": "safe",
        "about": [
          "Run the bode against sample values, and say what breaks — item 159.",
          "**The gap this fills.** A bode somebody has just built is EMPTY: the sources are blank on purpose, because the data is yours. So `results` immediately after a build says \"waiting\" for every block, and a caller that checked its work would be told everything is fine right up until you paste something in — which is exactly how a JSON Query with a guessed path reached a person with `no match for $.email` in it.",
          "So: hand it the sample, get back what fails. The sample is applied to a COPY, evaluated by a throwaway evaluator, and thrown away — nothing is written to the document, nothing appears on the canvas, and nothing is in the undo history. It is a read, which is why it is a query.",
          "**It cannot be used to run what you are not allowed to run.** A costly block stays behind the run barrier (#105) and a block carrying code nobody has allowed stays behind the consent gate (§41) — both are reported as held rather than quietly executed, because a dry run is not a person pressing a button."
        ],
        "fields": [
          {
            "name": "with",
            "type": "Record<string, Record<string, unknown>>",
            "required": false,
            "means": "Sample params, by block id — `{ \"src\": { \"value\": \"[{…}]\" } }`. The same rules an op obeys: a block's session-only params are refused (§33), because a caller cannot honestly produce somebody's photo even for a rehearsal."
          },
          {
            "name": "ids",
            "type": "string[]",
            "required": false,
            "means": "Only report on these blocks. Absent means all of them."
          }
        ]
      }
    ],
    "batch": {
      "schema": "/bode.ops.json"
    }
  }
}
