{
  "openapi": "3.1.0",
  "info": {
    "title": "WS Commander Public API",
    "version": "1.0.10",
    "description": "Zero-authentication, read-only public REST and NLWeb API for WS Commander on macOS. Exposes release metadata, SHA-256 verification checksums, verified Apple Silicon benchmarks, the 30 local wsc mcp desktop tools, client setup guides, and searchable documentation. Authentication: none required for any endpoint (open sandbox). Rate limits: standard RFC RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, and RateLimit-Policy headers are returned on every response, with Retry-After on HTTP 429. Versioning policy: breaking schema or envelope changes increment the URL major path segment (/api/v1/ -> /api/v2/); every response includes API-Version (YYYY-MM-DD). Deprecation policy: endpoints or versions scheduled for removal advertise RFC 9745 Deprecation and RFC 8594 Sunset headers at least 90 days before retirement alongside migration notes at /docs. Errors use RFC 9457 application/problem+json with code, title, status, detail, and hint.",
    "contact": {
      "name": "WEB solutions Ltd (WS Agency)",
      "url": "https://wscommander.com/contact",
      "email": "hello@ws.agency"
    },
    "license": {
      "name": "MIT License",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "servers": [
    {
      "url": "https://wscommander.com",
      "description": "Production public read-only API and sandbox (no API key required)"
    }
  ],
  "tags": [
    { "name": "Release", "description": "Latest notarized macOS build, download URL, and SHA-256 checksum" },
    { "name": "Benchmarks", "description": "Reproducible Apple Silicon performance measurements" },
    { "name": "MCP Tools", "description": "Local 30-tool wsc mcp catalog and client setup templates" },
    { "name": "Documentation", "description": "Searchable technical guides and NLWeb v0.55 evidence retrieval" }
  ],
  "paths": {
    "/api/v1/release": {
      "get": {
        "tags": ["Release"],
        "operationId": "getReleaseManifest",
        "summary": "Get latest WS Commander macOS release metadata and SHA-256 checksum",
        "description": "Returns the current version, build number, minimum supported macOS version, Universal notarized ZIP download URL, SHA-256 checksum, MIT license info, and local CLI/socket paths.",
        "responses": {
          "200": {
            "description": "Current release metadata.",
            "headers": {
              "API-Version": { "$ref": "#/components/headers/API-Version" },
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimit-Limit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimit-Remaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimit-Reset" },
              "RateLimit-Policy": { "$ref": "#/components/headers/RateLimit-Policy" },
              "Deprecation": { "$ref": "#/components/headers/Deprecation" },
              "Sunset": { "$ref": "#/components/headers/Sunset" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ReleaseInfo" }
              }
            }
          },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/api/v1/benchmarks": {
      "get": {
        "tags": ["Benchmarks"],
        "operationId": "listBenchmarks",
        "summary": "List verified Apple Silicon performance benchmarks",
        "description": "Returns paginated benchmark rows measured via Benchmarks/ harnesses on Mac17,2 (arm64, macOS 27.2.1, APFS, swiftc -O), optionally filtered by operation category.",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Filter benchmarks by engine category.",
            "schema": {
              "type": "string",
              "enum": ["all", "listing", "copy", "search", "checksum", "archive", "compare"],
              "default": "all"
            }
          },
          { "$ref": "#/components/parameters/CursorParam" },
          { "$ref": "#/components/parameters/LimitParam" }
        ],
        "responses": {
          "200": {
            "description": "Paginated benchmark entries.",
            "headers": {
              "API-Version": { "$ref": "#/components/headers/API-Version" },
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimit-Limit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimit-Remaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimit-Reset" },
              "Deprecation": { "$ref": "#/components/headers/Deprecation" },
              "Sunset": { "$ref": "#/components/headers/Sunset" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/BenchmarkPage" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/api/v1/tools": {
      "get": {
        "tags": ["MCP Tools"],
        "operationId": "listLocalMcpTools",
        "summary": "List the 30 local desktop MCP tools exposed by wsc mcp",
        "description": "Returns paginated definitions for the 30 local macOS desktop MCP tools, filtered by permission switch group (read, view, change) or search substring.",
        "parameters": [
          {
            "name": "group",
            "in": "query",
            "required": false,
            "description": "Filter by permission switch group.",
            "schema": {
              "type": "string",
              "enum": ["all", "read", "view", "change"],
              "default": "all"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search against tool name and description.",
            "schema": { "type": "string" }
          },
          { "$ref": "#/components/parameters/CursorParam" },
          { "$ref": "#/components/parameters/LimitParam" }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of local desktop MCP tools.",
            "headers": {
              "API-Version": { "$ref": "#/components/headers/API-Version" },
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimit-Limit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimit-Remaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimit-Reset" },
              "Deprecation": { "$ref": "#/components/headers/Deprecation" },
              "Sunset": { "$ref": "#/components/headers/Sunset" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ToolsPage" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/api/v1/docs": {
      "get": {
        "tags": ["Documentation"],
        "operationId": "searchDocumentation",
        "summary": "Search WS Commander documentation articles",
        "description": "Searches structured documentation guides covering installation, SHA-256 verification, wsc CLI, local MCP security, benchmarks, and privacy policy.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Optional search keywords.",
            "schema": { "type": "string" }
          },
          { "$ref": "#/components/parameters/CursorParam" },
          { "$ref": "#/components/parameters/LimitParam" }
        ],
        "responses": {
          "200": {
            "description": "Paginated documentation articles.",
            "headers": {
              "API-Version": { "$ref": "#/components/headers/API-Version" },
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimit-Limit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimit-Remaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimit-Reset" },
              "Deprecation": { "$ref": "#/components/headers/Deprecation" },
              "Sunset": { "$ref": "#/components/headers/Sunset" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/DocsPage" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/api/v1/docs/{slug}": {
      "get": {
        "tags": ["Documentation"],
        "operationId": "getDocumentationBySlug",
        "summary": "Get a single documentation article by slug",
        "description": "Fetches full structured documentation for one topic slug (e.g. overview, install-and-verify, local-mcp-server, public-api-and-docs-mcp, benchmarks, pricing-and-license, privacy-and-company).",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Documentation article slug identifier.",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Documentation article details.",
            "headers": {
              "API-Version": { "$ref": "#/components/headers/API-Version" },
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimit-Limit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimit-Remaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimit-Reset" },
              "Deprecation": { "$ref": "#/components/headers/Deprecation" },
              "Sunset": { "$ref": "#/components/headers/Sunset" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/DocArticle" }
              }
            }
          },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/api/v1/setup/{client}": {
      "get": {
        "tags": ["MCP Tools"],
        "operationId": "getClientSetupGuide",
        "summary": "Get wsc mcp setup snippet for a specific AI client or CLI",
        "description": "Returns copy-paste installation commands and security guidance for connecting Claude Code, Claude Desktop, OpenAI Codex, Terminal CLI, or raw Unix socket IPC to WS Commander.",
        "parameters": [
          {
            "name": "client",
            "in": "path",
            "required": true,
            "description": "Target client identifier.",
            "schema": {
              "type": "string",
              "enum": ["claude-code", "claude-desktop", "codex", "cli", "guard-claude", "guard-codex", "socket"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Client configuration guide.",
            "headers": {
              "API-Version": { "$ref": "#/components/headers/API-Version" },
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimit-Limit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimit-Remaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimit-Reset" },
              "Deprecation": { "$ref": "#/components/headers/Deprecation" },
              "Sunset": { "$ref": "#/components/headers/Sunset" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SetupConfig" }
              }
            }
          },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/ask": {
      "get": {
        "tags": ["Documentation"],
        "operationId": "askNlwebGet",
        "summary": "Search WS Commander documentation using NLWeb v0.55 GET adapter",
        "description": "Query published WS Commander evidence via GET query string, returning ranked Schema.org-grounded passages or SSE stream.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "Natural language question.",
            "schema": { "type": "string", "minLength": 1 }
          },
          {
            "name": "streaming",
            "in": "query",
            "required": false,
            "description": "Return text/event-stream SSE events when true.",
            "schema": { "type": "boolean", "default": false }
          }
        ],
        "responses": {
          "200": {
            "description": "NLWeb v0.55 response payload.",
            "headers": {
              "API-Version": { "$ref": "#/components/headers/API-Version" },
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimit-Limit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimit-Remaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimit-Reset" },
              "Deprecation": { "$ref": "#/components/headers/Deprecation" },
              "Sunset": { "$ref": "#/components/headers/Sunset" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/NlwebAskResponse" }
              },
              "text/event-stream": {
                "schema": { "type": "string" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      },
      "post": {
        "tags": ["Documentation"],
        "operationId": "askNlwebPost",
        "summary": "Query WS Commander documentation via NLWeb v0.55 POST envelope",
        "description": "Accepts query.text and optional prefer.streaming boolean to retrieve ranked documentation evidence as JSON or NLWeb v0.55 SSE stream.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional client request correlation/idempotency token for safe retries.",
            "schema": { "type": "string" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/NlwebAskRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "NLWeb v0.55 answer or SSE event stream.",
            "headers": {
              "API-Version": { "$ref": "#/components/headers/API-Version" },
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimit-Limit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimit-Remaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimit-Reset" },
              "Deprecation": { "$ref": "#/components/headers/Deprecation" },
              "Sunset": { "$ref": "#/components/headers/Sunset" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/NlwebAskResponse" }
              },
              "text/event-stream": {
                "schema": { "type": "string" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    }
  },
  "components": {
    "headers": {
      "API-Version": {
        "description": "Dated API contract version (YYYY-MM-DD).",
        "schema": { "type": "string", "example": "2026-12-04" }
      },
      "RateLimit-Limit": {
        "description": "Maximum requests permitted per 60-second window.",
        "schema": { "type": "integer", "example": 600 }
      },
      "RateLimit-Remaining": {
        "description": "Remaining quota in the current window.",
        "schema": { "type": "integer", "example": 599 }
      },
      "RateLimit-Reset": {
        "description": "Seconds until the current window resets.",
        "schema": { "type": "integer", "example": 60 }
      },
      "RateLimit-Policy": {
        "description": "Structured rate-limit policy quota.",
        "schema": { "type": "string", "example": "600;w=60" }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying after HTTP 429.",
        "schema": { "type": "integer", "example": 60 }
      },
      "Deprecation": {
        "description": "RFC 9745 deprecation notice header emitted at least 90 days before removing an endpoint or version.",
        "schema": { "type": "string" }
      },
      "Sunset": {
        "description": "RFC 8594 HTTP date when a deprecated endpoint stops serving traffic.",
        "schema": { "type": "string", "format": "date-time" }
      }
    },
    "parameters": {
      "CursorParam": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "description": "Opaque cursor returned by pagination.nextCursor on the previous page.",
        "schema": { "type": "string" }
      },
      "LimitParam": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Maximum number of items per page (1 to 50).",
        "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 20 }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid query parameter or malformed JSON payload.",
        "content": {
          "application/problem+json": {
            "schema": { "$ref": "#/components/schemas/ProblemDetails" }
          }
        }
      },
      "NotFound": {
        "description": "Requested resource or slug was not found.",
        "content": {
          "application/problem+json": {
            "schema": { "$ref": "#/components/schemas/ProblemDetails" }
          }
        }
      },
      "RateLimited": {
        "description": "Too many requests; honor Retry-After before retrying.",
        "headers": {
          "Retry-After": { "$ref": "#/components/headers/Retry-After" }
        },
        "content": {
          "application/problem+json": {
            "schema": { "$ref": "#/components/schemas/ProblemDetails" }
          }
        }
      },
      "InternalError": {
        "description": "Unexpected server error.",
        "content": {
          "application/problem+json": {
            "schema": { "$ref": "#/components/schemas/ProblemDetails" }
          }
        }
      }
    },
    "schemas": {
      "Pagination": {
        "type": "object",
        "properties": {
          "cursor": { "type": ["string", "null"], "description": "Cursor used for the current page, or null for page 1." },
          "nextCursor": { "type": ["string", "null"], "description": "Pass as ?cursor= to retrieve the next page, or null when no more items exist." },
          "hasMore": { "type": "boolean", "description": "True when more items follow this page." },
          "limit": { "type": "integer", "description": "Effective page size limit." },
          "total": { "type": "integer", "description": "Total matching records." }
        },
        "required": ["cursor", "nextCursor", "hasMore", "limit", "total"]
      },
      "ProblemDetails": {
        "type": "object",
        "description": "RFC 9457 machine-readable error payload with corrective hint.",
        "properties": {
          "type": { "type": "string", "format": "uri" },
          "title": { "type": "string" },
          "status": { "type": "integer" },
          "code": { "type": "string" },
          "detail": { "type": "string" },
          "hint": { "type": "string" },
          "instance": { "type": "string" }
        },
        "required": ["type", "title", "status", "code", "detail"]
      },
      "ReleaseInfo": {
        "type": "object",
        "properties": {
          "product": { "type": "string" },
          "version": { "type": "string" },
          "stage": { "type": "string" },
          "versionLabel": { "type": "string" },
          "build": { "type": "string" },
          "releaseDate": { "type": "string" },
          "minMacOS": { "type": "string" },
          "testedThroughMacOS": { "type": "string" },
          "architecture": { "type": "array", "items": { "type": "string" } },
          "license": { "type": "string" },
          "priceUsd": { "type": "number" },
          "signedAndNotarized": { "type": "boolean" },
          "developerId": { "type": "string" },
          "notaryStatus": { "type": "string" },
          "downloadUrl": { "type": "string", "format": "uri" },
          "downloadFile": { "type": "string" },
          "sha256": { "type": "string" },
          "releaseNotesUrl": { "type": "string", "format": "uri" },
          "repositoryUrl": { "type": "string", "format": "uri" },
          "websiteUrl": { "type": "string", "format": "uri" },
          "designSystemUrl": { "type": "string", "format": "uri" },
          "wscBinaryPath": { "type": "string" },
          "ipcSocketPath": { "type": "string" }
        },
        "required": ["product", "version", "stage", "downloadUrl", "sha256", "license", "priceUsd"]
      },
      "BenchmarkEntry": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "category": { "type": "string", "enum": ["listing", "copy", "search", "checksum", "archive", "compare"] },
          "title": { "type": "string" },
          "unit": { "type": "string" },
          "better": { "type": "string", "enum": ["lower", "higher"] },
          "before": { "type": ["number", "null"] },
          "after": { "type": "number" },
          "beforeLabel": { "type": "string" },
          "afterLabel": { "type": "string" },
          "gain": { "type": "string" },
          "baselineImplementation": { "type": "string" },
          "environment": { "type": "string" }
        },
        "required": ["id", "category", "title", "unit", "better", "after", "afterLabel", "gain"]
      },
      "BenchmarkPage": {
        "type": "object",
        "properties": {
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/BenchmarkEntry" } },
          "pagination": { "$ref": "#/components/schemas/Pagination" },
          "category": { "type": "string" },
          "methodology": { "type": "string" }
        },
        "required": ["items", "pagination", "category", "methodology"]
      },
      "LocalMcpTool": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "group": { "type": "string", "enum": ["read", "view", "change"] },
          "requiresPermissionSwitch": { "type": "string" },
          "description": { "type": "string" }
        },
        "required": ["name", "group", "requiresPermissionSwitch", "description"]
      },
      "ToolsPage": {
        "type": "object",
        "properties": {
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/LocalMcpTool" } },
          "pagination": { "$ref": "#/components/schemas/Pagination" },
          "group": { "type": "string" },
          "query": { "type": ["string", "null"] },
          "bridgeCommand": { "type": "string" },
          "ipcSocketPath": { "type": "string" }
        },
        "required": ["items", "pagination", "group", "bridgeCommand"]
      },
      "DocArticle": {
        "type": "object",
        "properties": {
          "slug": { "type": "string" },
          "title": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "markdownUrl": { "type": "string", "format": "uri" },
          "summary": { "type": "string" },
          "tags": { "type": "array", "items": { "type": "string" } },
          "body": { "type": "string" }
        },
        "required": ["slug", "title", "url", "markdownUrl", "summary", "body"]
      },
      "DocsPage": {
        "type": "object",
        "properties": {
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/DocArticle" } },
          "pagination": { "$ref": "#/components/schemas/Pagination" },
          "query": { "type": ["string", "null"] }
        },
        "required": ["items", "pagination"]
      },
      "SetupConfig": {
        "type": "object",
        "properties": {
          "client": { "type": "string" },
          "title": { "type": "string" },
          "instructions": { "type": "string" },
          "configFormat": { "type": "string" },
          "snippet": { "type": "string" }
        },
        "required": ["client", "title", "instructions", "configFormat", "snippet"]
      },
      "NlwebAskRequest": {
        "type": "object",
        "properties": {
          "query": {
            "type": "object",
            "properties": {
              "text": { "type": "string", "description": "Natural language question to answer from published WS Commander evidence." }
            },
            "required": ["text"]
          },
          "prefer": {
            "type": "object",
            "properties": {
              "streaming": { "type": "boolean", "description": "Request SSE streaming response." }
            }
          }
        },
        "required": ["query"]
      },
      "NlwebAskResponse": {
        "type": "object",
        "properties": {
          "_meta": {
            "type": "object",
            "properties": {
              "response_type": { "type": "string" },
              "version": { "type": "string" },
              "query": { "type": "string" },
              "site": { "type": "string" }
            },
            "required": ["response_type", "version"]
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "@type": { "type": "string" },
                "url": { "type": "string", "format": "uri" },
                "name": { "type": "string" },
                "description": { "type": "string" },
                "score": { "type": "number" }
              },
              "required": ["url", "name", "description"]
            }
          }
        },
        "required": ["_meta", "results"]
      }
    }
  }
}
