{
  "openapi": "3.1.1",
  "info": {
    "title": "Parley API",
    "version": "1.0.0",
    "summary": "Deterministic tools for people and AI agents.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://parley.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "Catalog of all tools",
        "responses": {
          "200": {
            "description": "Tool list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/{id}": {
      "get": {
        "operationId": "getTool",
        "summary": "Definition of one tool",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "parley-transcript",
                "parley-message-check",
                "safe-markdown-preview"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/parley-transcript/calculate": {
      "post": {
        "operationId": "calculateParleyTranscript",
        "summary": "Turn a Parley channel export into a readable Markdown, HTML or text transcript.",
        "description": "Converts a Parley channel export (JSON, format “parley-channel”) into a clean transcript: messages grouped by day, replies nested under their thread or in time order, mentions shown as @names, links kept, edited/pinned marks, reactions, attachments and linked items listed. Also counts messages, threads, replies and messages per person. Deterministic: times use a fixed UTC offset you choose.\n\nMethodology:\n- The export is validated first: format “parley-channel” version 1, unique message ids, ISO times, replies only to earlier messages, at most 20,000 messages and 4,000 characters per message.\n- Each message body is parsed with Parley’s chat Markdown subset (bold, italic, code, links, lists, quotes, code blocks). Raw HTML is never passed through: in the HTML transcript every character is escaped and links are limited to http(s) and mailto.\n- Mentions are stored as user ids and printed as @name from the export’s member list; unknown ids print as “@former member”.\n- Times are formatted from the stored UTC times plus the fixed offset you give, so the same export always gives the same transcript (no daylight-saving guess).",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "parley_transcript",
        "x-owner-app": "parley",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ParleyTranscriptInput"
              },
              "examples": {
                "example1": {
                  "summary": "Launch channel as Markdown (CET)",
                  "value": {
                    "export": "{\"format\":\"parley-channel\",\"version\":1,\"exportedAt\":\"2026-12-02T10:00:00Z\",\"workspace\":{\"id\":\"ws_demo01\",\"name\":\"Studio Nord\"},\"channel\":{\"id\":\"ch_launch1\",\"name\":\"launch\",\"kind\":\"public\",\"topic\":\"Website relaunch on 15 December\"},\"members\":[{\"id\":\"u_ana0001\",\"name\":\"Ana\"},{\"id\":\"u_ben0002\",\"name\":\"Ben\"},{\"id\":\"u_cleo003\",\"name\":\"Cleo\"}],\"messages\":[{\"id\":\"m1\",\"threadId\":null,\"author\":\"u_ana0001\",\"authorName\":\"Ana\",\"at\":\"2026-12-01T08:58:00Z\",\"body\":\"Morning! Staging is up: https://staging.example.com\\n**Please test** the checkout before noon.\",\"pinned\":true,\"reactions\":[{\"emoji\":\"👍\",\"users\":[\"Ben\",\"Cleo\"]}]},{\"id\":\"m2\",\"threadId\":\"m1\",\"author\":\"u_ben0002\",\"authorName\":\"Ben\",\"at\":\"2026-12-01T09:12:00Z\",\"body\":\"Found one bug: the coupon field accepts `-10`. \u003c@u_ana0001\u003e shall I file it?\"},{\"id\":\"m3\",\"threadId\":\"m1\",\"author\":\"u_ana0001\",\"authorName\":\"Ana\",\"at\":\"2026-12-01T09:15:00Z\",\"body\":\"Yes please, and assign it to \u003c@u_cleo003\u003e.\",\"editedAt\":\"2026-12-01T09:16:00Z\"},{\"id\":\"m4\",\"threadId\":null,\"author\":\"u_cleo003\",\"authorName\":\"Cleo\",\"at\":\"2026-12-01T13:40:00Z\",\"body\":\"Checklist for go-live:\\n- DNS switch\\n- redirects for old URLs\\n- *announce* in @channel\"},{\"id\":\"m5\",\"threadId\":null,\"author\":\"u_ben0002\",\"authorName\":\"Ben\",\"at\":\"2026-12-02T07:05:00Z\",\"body\":\"Coupon bug fixed ✅\"}]}",
                    "format": "markdown",
                    "threads": "nested",
                    "utcOffset": 1
                  }
                },
                "example2": {
                  "summary": "Same channel as an HTML page",
                  "value": {
                    "export": "{\"format\":\"parley-channel\",\"version\":1,\"exportedAt\":\"2026-12-02T10:00:00Z\",\"workspace\":{\"id\":\"ws_demo01\",\"name\":\"Studio Nord\"},\"channel\":{\"id\":\"ch_launch1\",\"name\":\"launch\",\"kind\":\"public\",\"topic\":\"Website relaunch on 15 December\"},\"members\":[{\"id\":\"u_ana0001\",\"name\":\"Ana\"},{\"id\":\"u_ben0002\",\"name\":\"Ben\"},{\"id\":\"u_cleo003\",\"name\":\"Cleo\"}],\"messages\":[{\"id\":\"m1\",\"threadId\":null,\"author\":\"u_ana0001\",\"authorName\":\"Ana\",\"at\":\"2026-12-01T08:58:00Z\",\"body\":\"Morning! Staging is up: https://staging.example.com\\n**Please test** the checkout before noon.\",\"pinned\":true,\"reactions\":[{\"emoji\":\"👍\",\"users\":[\"Ben\",\"Cleo\"]}]},{\"id\":\"m2\",\"threadId\":\"m1\",\"author\":\"u_ben0002\",\"authorName\":\"Ben\",\"at\":\"2026-12-01T09:12:00Z\",\"body\":\"Found one bug: the coupon field accepts `-10`. \u003c@u_ana0001\u003e shall I file it?\"},{\"id\":\"m3\",\"threadId\":\"m1\",\"author\":\"u_ana0001\",\"authorName\":\"Ana\",\"at\":\"2026-12-01T09:15:00Z\",\"body\":\"Yes please, and assign it to \u003c@u_cleo003\u003e.\",\"editedAt\":\"2026-12-01T09:16:00Z\"},{\"id\":\"m4\",\"threadId\":null,\"author\":\"u_cleo003\",\"authorName\":\"Cleo\",\"at\":\"2026-12-01T13:40:00Z\",\"body\":\"Checklist for go-live:\\n- DNS switch\\n- redirects for old URLs\\n- *announce* in @channel\"},{\"id\":\"m5\",\"threadId\":null,\"author\":\"u_ben0002\",\"authorName\":\"Ben\",\"at\":\"2026-12-02T07:05:00Z\",\"body\":\"Coupon bug fixed ✅\"}]}",
                    "format": "html",
                    "threads": "nested",
                    "utcOffset": 0
                  }
                },
                "example3": {
                  "summary": "Plain text in time order",
                  "value": {
                    "export": "{\"format\":\"parley-channel\",\"version\":1,\"exportedAt\":\"2026-12-02T10:00:00Z\",\"workspace\":{\"id\":\"ws_demo01\",\"name\":\"Studio Nord\"},\"channel\":{\"id\":\"ch_launch1\",\"name\":\"launch\",\"kind\":\"public\",\"topic\":\"Website relaunch on 15 December\"},\"members\":[{\"id\":\"u_ana0001\",\"name\":\"Ana\"},{\"id\":\"u_ben0002\",\"name\":\"Ben\"},{\"id\":\"u_cleo003\",\"name\":\"Cleo\"}],\"messages\":[{\"id\":\"m1\",\"threadId\":null,\"author\":\"u_ana0001\",\"authorName\":\"Ana\",\"at\":\"2026-12-01T08:58:00Z\",\"body\":\"Morning! Staging is up: https://staging.example.com\\n**Please test** the checkout before noon.\",\"pinned\":true,\"reactions\":[{\"emoji\":\"👍\",\"users\":[\"Ben\",\"Cleo\"]}]},{\"id\":\"m2\",\"threadId\":\"m1\",\"author\":\"u_ben0002\",\"authorName\":\"Ben\",\"at\":\"2026-12-01T09:12:00Z\",\"body\":\"Found one bug: the coupon field accepts `-10`. \u003c@u_ana0001\u003e shall I file it?\"},{\"id\":\"m3\",\"threadId\":\"m1\",\"author\":\"u_ana0001\",\"authorName\":\"Ana\",\"at\":\"2026-12-01T09:15:00Z\",\"body\":\"Yes please, and assign it to \u003c@u_cleo003\u003e.\",\"editedAt\":\"2026-12-01T09:16:00Z\"},{\"id\":\"m4\",\"threadId\":null,\"author\":\"u_cleo003\",\"authorName\":\"Cleo\",\"at\":\"2026-12-01T13:40:00Z\",\"body\":\"Checklist for go-live:\\n- DNS switch\\n- redirects for old URLs\\n- *announce* in @channel\"},{\"id\":\"m5\",\"threadId\":null,\"author\":\"u_ben0002\",\"authorName\":\"Ben\",\"at\":\"2026-12-02T07:05:00Z\",\"body\":\"Coupon bug fixed ✅\"}]}",
                    "format": "text",
                    "threads": "flat",
                    "utcOffset": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ParleyTranscriptResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/parley-message-check/calculate": {
      "post": {
        "operationId": "calculateParleyMessageCheck",
        "summary": "See how a chat message renders: formatting, safe links, @mentions and what gets notified.",
        "description": "Checks a chat message the way Parley does before sending it: the Markdown subset (bold, italic, code, links, lists, quotes, code blocks), which links are kept (only http(s) and mailto), which @mentions match a member list, whether @channel or @here notifies everybody, and the length limit. Shows the safe HTML and the plain text a notification would use.\n\nMethodology:\n- @Name mentions are matched against the member names (longest name first, case-insensitive, must end at a word boundary); a matched name becomes a \u003c@id\u003e token. In this tool the id is “member-\u003cline number\u003e”.\n- The body is split into blocks with the platform’s shared Markdown parser (Deckwright); single line breaks are kept like in a chat. Headings become bold lines, tables and code blocks stay code, images become links.\n- Only http(s) and mailto links become links; other link targets (javascript:, data:, relative) stay visible text. Raw HTML is escaped, never interpreted.\n- Mentions inside code are not notifications. @channel and @here notify every member of the conversation.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "parley_message_check",
        "x-owner-app": "parley",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ParleyMessageCheckInput"
              },
              "examples": {
                "example1": {
                  "summary": "Mentions, list and a link",
                  "value": {
                    "body": "Hi @Ana, the **release notes** are ready: https://example.com/notes\n- check the `v2` links\n- tell @channel when done",
                    "members": "Ana\nBen Okafor\nCleo"
                  }
                },
                "example2": {
                  "summary": "Unsafe link and raw HTML stay text",
                  "value": {
                    "body": "Click [here](javascript:alert(1)) \u003cimg src=x onerror=alert(1)\u003e",
                    "members": ""
                  }
                },
                "example3": {
                  "summary": "Code block keeps mentions literal",
                  "value": {
                    "body": "```\n@Ben is not notified here\n```\nbut @Ben Okafor is",
                    "members": "Ben Okafor"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ParleyMessageCheckResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/safe-markdown-preview/calculate": {
      "post": {
        "operationId": "calculateSafeMarkdownPreview",
        "summary": "Render Markdown with GFM tables and footnotes to sanitised HTML and see what was removed.",
        "description": "Renders Markdown with headings, emphasis, lists, task lists, code, GFM tables, links, images, blockquotes and footnotes into HTML built from a strict allow-list. Raw HTML can be escaped, stripped or sanitised; scripts, event handlers, style attributes and javascript:/vbscript:/data: URLs are removed and listed in a security report. Shows a preview, the sanitised HTML source and a plain-text version.\n\nMethodology:\n- A two-pass parser written for this tool: link-reference and footnote definitions are collected first, then blocks (ATX/setext headings, fenced and indented code, blockquotes, nested bullet/ordered lists with task items, GFM tables with alignment, thematic breaks, HTML blocks, paragraphs) and inline syntax (code spans, emphasis, strikethrough, links, images, autolinks, hard breaks, backslash escapes). It follows CommonMark closely but is not a full conformance implementation; rare edge cases (complex emphasis nesting, lazy continuation inside nested lists) can differ.\n- All output HTML is generated by the renderer from an allow-list (p, h1–h6, lists, tables, code, a, img, blockquote, …). Text and attribute values are always escaped. Raw HTML is escaped, stripped or passed through a tokenizer that rebuilds only allow-listed tags with allow-listed attributes; script/style/iframe/object/svg and similar elements are removed with their content; on* handlers, style, id and class attributes are dropped.\n- URLs (Markdown links, images, href/src attributes) are decoded (entities, escapes) and stripped of control and whitespace characters before the scheme check, so obfuscations like “java\u0026#x09;script:” are caught. Allowed: http, https, mailto, tel and relative URLs; data: only for base64 raster images when enabled. Links get rel=\"nofollow noopener noreferrer\".\n- Finally the HTML is balanced (stray closing tags dropped, open tags closed) so raw HTML cannot break out of the preview container. The page’s Content-Security-Policy blocks scripts and external images anyway; the preview is rendered from the sanitised HTML only.",
        "tags": [
          "developer"
        ],
        "x-mcp-tool": "safe_markdown_preview",
        "x-owner-app": "paperwell",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SafeMarkdownPreviewInput"
              },
              "examples": {
                "example1": {
                  "summary": "Release notes with table, tasks and footnote",
                  "value": {
                    "markdown": "# Release notes\n\nVersion **2.4** brings _faster_ parsing, `inline code` and ~~old bugs~~ fixes.[^perf]\n\n- [x] Tables (GFM)\n- [ ] Footnotes\n- Links: [docs](https://example.com/docs \"Documentation\") and \u003chttps://usefulweb.site\u003e\n\n| Feature | Status | Notes |\n|:--------|:------:|------:|\n| Tables  | ✓      | GFM   |\n| Images  | ✓      | allow-listed |\n\n\u003e Quote with a [reference link][ref].\n\n```js\nconsole.log(\"code is escaped: \u003cb\u003e\");\n```\n\n[ref]: https://commonmark.org/\n[^perf]: Measured on a 1 MB document.\n"
                  }
                },
                "example2": {
                  "summary": "XSS attempts are removed and reported",
                  "value": {
                    "markdown": "# Hello \u003cimg src=x onerror=alert(1)\u003e\n\n\u003cscript\u003ealert('xss')\u003c/script\u003e\n\nClick [me](javascript:alert(document.cookie)) or [this](JaVaScRiPt\u0026#58;alert(1)) or ![pixel](data:image/svg+xml;base64,PHN2Zz4=).\n\n\u003cdiv onclick=\"steal()\" style=\"position:fixed\"\u003eA \u003cb\u003ebold\u003c/b\u003e div with \u003ca href=\"vbscript:msgbox(1)\"\u003ea link\u003c/a\u003e\u003c/div\u003e\n\n\u003ciframe src=\"https://evil.example\"\u003e\u003c/iframe\u003e\n\n\u003ca href=\"https://example.com\" onmouseover=\"x()\"\u003esafe link, unsafe handler\u003c/a\u003e\n"
                  }
                },
                "example3": {
                  "summary": "Same input with raw HTML escaped",
                  "value": {
                    "markdown": "# Hello \u003cimg src=x onerror=alert(1)\u003e\n\n\u003cscript\u003ealert('xss')\u003c/script\u003e\n\nClick [me](javascript:alert(document.cookie)) or [this](JaVaScRiPt\u0026#58;alert(1)) or ![pixel](data:image/svg+xml;base64,PHN2Zz4=).\n\n\u003cdiv onclick=\"steal()\" style=\"position:fixed\"\u003eA \u003cb\u003ebold\u003c/b\u003e div with \u003ca href=\"vbscript:msgbox(1)\"\u003ea link\u003c/a\u003e\u003c/div\u003e\n\n\u003ciframe src=\"https://evil.example\"\u003e\u003c/iframe\u003e\n\n\u003ca href=\"https://example.com\" onmouseover=\"x()\"\u003esafe link, unsafe handler\u003c/a\u003e\n",
                    "rawHtml": "escape"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SafeMarkdownPreviewResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "Multi-tool workflows",
        "responses": {
          "200": {
            "description": "Workflow list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ParleyTranscriptInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "export": {
            "title": "Channel export (JSON)",
            "description": "In Parley: channel menu → Export channel (JSON). The file is read, not uploaded anywhere else.",
            "type": "string",
            "maxLength": 5000000,
            "default": "{\n  \"format\": \"parley-channel\",\n  \"version\": 1,\n  \"exportedAt\": \"2026-12-02T10:00:00Z\",\n  \"workspace\": {\n    \"id\": \"ws_demo01\",\n    \"name\": \"Studio Nord\"\n  },\n  \"channel\": {\n    \"id\": \"ch_launch1\",\n    \"name\": \"launch\",\n    \"kind\": \"public\",\n    \"topic\": \"Website relaunch on 15 December\"\n  },\n  \"members\": [\n    {\n      \"id\": \"u_ana0001\",\n      \"name\": \"Ana\"\n    },\n    {\n      \"id\": \"u_ben0002\",\n      \"name\": \"Ben\"\n    },\n    {\n      \"id\": \"u_cleo003\",\n      \"name\": \"Cleo\"\n    }\n  ],\n  \"messages\": [\n    {\n      \"id\": \"m1\",\n      \"threadId\": null,\n      \"author\": \"u_ana0001\",\n      \"authorName\": \"Ana\",\n      \"at\": \"2026-12-01T08:58:00Z\",\n      \"body\": \"Morning! Staging is up: https://staging.example.com\\n**Please test** the checkout before noon.\",\n      \"pinned\": true,\n      \"reactions\": [\n        {\n          \"emoji\": \"👍\",\n          \"users\": [\n            \"Ben\",\n            \"Cleo\"\n          ]\n        }\n      ]\n    },\n    {\n      \"id\": \"m2\",\n      \"threadId\": \"m1\",\n      \"author\": \"u_ben0002\",\n      \"authorName\": \"Ben\",\n      \"at\": \"2026-12-01T09:12:00Z\",\n      \"body\": \"Found one bug: the coupon field accepts `-10`. \u003c@u_ana0001\u003e shall I file it?\"\n    },\n    {\n      \"id\": \"m3\",\n      \"threadId\": \"m1\",\n      \"author\": \"u_ana0001\",\n      \"authorName\": \"Ana\",\n      \"at\": \"2026-12-01T09:15:00Z\",\n      \"body\": \"Yes please, and assign it to \u003c@u_cleo003\u003e.\",\n      \"editedAt\": \"2026-12-01T09:16:00Z\"\n    },\n    {\n      \"id\": \"m4\",\n      \"threadId\": null,\n      \"author\": \"u_cleo003\",\n      \"authorName\": \"Cleo\",\n      \"at\": \"2026-12-01T13:40:00Z\",\n      \"body\": \"Checklist for go-live:\\n- DNS switch\\n- redirects for old URLs\\n- *announce* in @channel\"\n    },\n    {\n      \"id\": \"m5\",\n      \"threadId\": null,\n      \"author\": \"u_ben0002\",\n      \"authorName\": \"Ben\",\n      \"at\": \"2026-12-02T07:05:00Z\",\n      \"body\": \"Coupon bug fixed ✅\"\n    }\n  ]\n}"
          },
          "format": {
            "title": "Transcript format",
            "type": "string",
            "enum": [
              "markdown",
              "html",
              "text"
            ],
            "default": "markdown"
          },
          "threads": {
            "title": "Thread replies",
            "type": "string",
            "enum": [
              "nested",
              "flat",
              "skip"
            ],
            "default": "nested"
          },
          "utcOffset": {
            "title": "Time zone offset (hours from UTC)",
            "description": "For example 1 for CET, -5 for New York in winter. Times are printed with this fixed offset.",
            "type": "number",
            "minimum": -14,
            "maximum": 14,
            "default": 0
          },
          "includeDeleted": {
            "title": "Show deleted messages as “Message deleted”",
            "type": "boolean",
            "default": false
          }
        },
        "required": []
      },
      "ParleyTranscriptResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "required": [
              "format",
              "filename",
              "mime",
              "content",
              "stats"
            ],
            "properties": {
              "format": {
                "enum": [
                  "markdown",
                  "html",
                  "text"
                ]
              },
              "filename": {
                "type": "string"
              },
              "mime": {
                "type": "string"
              },
              "content": {
                "type": "string"
              },
              "stats": {
                "type": "object",
                "properties": {
                  "messages": {
                    "type": "integer"
                  },
                  "topLevel": {
                    "type": "integer"
                  },
                  "replies": {
                    "type": "integer"
                  },
                  "threads": {
                    "type": "integer"
                  },
                  "participants": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "messages": {
                          "type": "integer"
                        }
                      }
                    }
                  },
                  "first": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "last": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "days": {
                    "type": "integer"
                  },
                  "pinned": {
                    "type": "integer"
                  },
                  "reactions": {
                    "type": "integer"
                  },
                  "links": {
                    "type": "integer"
                  },
                  "mentions": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "ParleyMessageCheckInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "title": "Message",
            "description": "Up to 4000 characters. Mentions: @Name of a member (list below), @channel or @here.",
            "type": "string",
            "maxLength": 20000,
            "default": "Hi @Ana, the **release notes** are ready: https://example.com/notes\n- check the `v2` links\n- tell @channel when done"
          },
          "members": {
            "title": "Members (one name per line, optional)",
            "description": "Used to resolve @Name mentions like Parley does with the workspace members.",
            "type": "string",
            "maxLength": 5000,
            "default": "Ana\nBen Okafor\nCleo"
          }
        },
        "required": []
      },
      "ParleyMessageCheckResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "required": [
              "blocks",
              "mentions",
              "broadcast",
              "links",
              "text",
              "warnings",
              "characters",
              "limit",
              "html"
            ],
            "properties": {
              "blocks": {
                "type": "array"
              },
              "mentions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "broadcast": {
                "enum": [
                  "channel",
                  "here",
                  null
                ]
              },
              "links": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "text": {
                "type": "string"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "characters": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "html": {
                "type": "string"
              },
              "markdown": {
                "type": "string"
              },
              "resolved": {
                "type": "string",
                "description": "The body with @Name mentions replaced by \u003c@id\u003e tokens, as Parley stores it."
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "SafeMarkdownPreviewInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "markdown": {
            "title": "Markdown",
            "type": "string",
            "maxLength": 1000000
          },
          "file": {
            "title": "Or upload a Markdown file",
            "type": "object",
            "description": "Upload as {filename, contentType?, contentBase64}. Max 977 KiB. Accepts .md,.markdown,.txt,text/markdown,text/plain.",
            "additionalProperties": false,
            "required": [
              "filename",
              "contentBase64"
            ],
            "properties": {
              "filename": {
                "type": "string"
              },
              "contentType": {
                "type": "string"
              },
              "contentBase64": {
                "type": "string"
              }
            }
          },
          "rawHtml": {
            "title": "Raw HTML in the Markdown",
            "type": "string",
            "enum": [
              "sanitize",
              "escape",
              "strip"
            ],
            "default": "sanitize"
          },
          "gfm": {
            "title": "GitHub extensions (tables, task lists, strikethrough, bare URLs)",
            "type": "boolean",
            "default": true
          },
          "footnotes": {
            "title": "Footnotes ([^1])",
            "type": "boolean",
            "default": true
          },
          "allowDataImages": {
            "title": "Allow base64 data: images (PNG/JPEG/GIF/WebP/AVIF; never SVG)",
            "type": "boolean",
            "default": false
          }
        },
        "required": []
      },
      "SafeMarkdownPreviewResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "html",
              "text",
              "removed",
              "removedCounts",
              "stats",
              "toc",
              "policy"
            ],
            "properties": {
              "html": {
                "type": "string",
                "description": "Sanitised HTML (allow-listed elements and attributes only)"
              },
              "text": {
                "type": "string"
              },
              "removed": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "kind",
                    "detail"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              },
              "removedCounts": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "stats": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "toc": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "level",
                    "text",
                    "id"
                  ],
                  "properties": {
                    "level": {
                      "type": "integer"
                    },
                    "text": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              },
              "policy": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "rawHtml",
                  "gfm",
                  "footnotes",
                  "allowDataImages",
                  "allowedTags"
                ],
                "properties": {
                  "rawHtml": {
                    "type": "string"
                  },
                  "gfm": {
                    "type": "boolean"
                  },
                  "footnotes": {
                    "type": "boolean"
                  },
                  "allowDataImages": {
                    "type": "boolean"
                  },
                  "allowedTags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}