{
  "openapi": "3.1.0",
  "info": {
    "title": "DingDawg.com Workflow Marketplace API",
    "version": "1.4.0",
    "description": "Free agent-discoverable capability metadata and moderated submissions. Contract v1 workflows remain supported; v2 and v3 passports describe packages, workflows, agents, MCP servers, connectors, model services, skills, evaluation suites, and device skills. MCP discovery is read-only and returns untrusted publisher data. Strict schemas match server normalization and report typed pending/error responses. Evidence references, scenarios, and v3 connection details are publisher declarations, not verified evidence. No binary uploads or remote code execution. Capability Passports v2 and v3 are available as standalone JSON Schema Draft 2020-12 documents at versioned well-known endpoints."
  },
  "servers": [
    {
      "url": "https://dingdawg.com"
    }
  ],
  "paths": {
    "/.well-known/agent-marketplace": {
      "get": {
        "operationId": "discoverMarketplace",
        "summary": "Discover marketplace APIs and schemas",
        "responses": {
          "200": {
            "description": "Machine-readable marketplace discovery document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryDocument"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "List public marketplace and DingDawg package records",
        "responses": {
          "200": {
            "description": "Package records are always returned. Community records are moderated and published unverified; communityStatus explicitly tells clients whether that list is complete.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid, duplicate, or unsupported query parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Unexpected directory error; storage outages alone return the package catalog with communityStatus UNAVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque continuation token returned in communityPage.nextCursor. Do not construct or alter it.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Requested number of community listings. Defaults to 100; bounded from 1 to 100. First-party package records remain a separate complete list on each page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ]
      }
    },
    "/api/marketplace/{handle}": {
      "get": {
        "operationId": "getWorkflow",
        "summary": "Read a public workflow and approved comments",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public listing detail and approved comments. First-party package details remain available when only community comment storage is unavailable; commentsStatus makes that partial response explicit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingDetailResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown, pending, rejected, or suspended listing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Community listing lookup or an unexpected storage error is unavailable; no stale community listing is served.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/submit": {
      "post": {
        "operationId": "submitWorkflow",
        "summary": "Submit a free workflow listing for human moderation",
        "description": "Maximum request body 16 KB; maximum five combined listing/comment posts per client IP per hour. If the response is uncertain, retry the exact same normalized request: it receives the same 202 receipt only while the matching row remains PENDING_REVIEW and NOT_EVALUATED, even when the retry reaches the IP rate limit. Changed payloads and transitioned rows return 409; a nonmatching request denied by the quota returns 429. A lookup outage returns a recoverable 503. A 202 means stored pending moderation, not public, tested, endorsed, or verified.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Submission"
              },
              "example": {
                "handle": "invoice-review",
                "displayName": "Invoice Review",
                "category": "Finance",
                "packageUrl": "https://github.com/acme/invoice-review",
                "description": "Compare invoice lines with an approved purchase order.",
                "contactEmail": "owner@example.com",
                "contract": {
                  "version": 1,
                  "purpose": "Review an invoice",
                  "inputs": [
                    "invoice",
                    "purchase order"
                  ],
                  "expectedOutcome": "MATCH, MISMATCH, or NEEDS_REVIEW",
                  "permissions": [
                    "read invoice",
                    "read purchase order"
                  ],
                  "sideEffects": [],
                  "testCases": [
                    {
                      "name": "valid invoice",
                      "expected": "returns a result"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Stored pending moderation or an idempotent replay of the same still-pending submission, including after IP quota exhaustion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Invalid submission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Handle exists with a different submission or a row that is no longer pending",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Storage or trusted client identity unavailable; submission not confirmed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/comments": {
      "post": {
        "operationId": "submitComment",
        "summary": "Submit a plain-text comment for moderation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Comment"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Stored pending moderation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Invalid comment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Target listing is not public",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Storage or trusted client identity unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace/mcp/": {
      "post": {
        "operationId": "marketplaceMcp",
        "summary": "Use the read-only marketplace MCP server",
        "description": "MCP Streamable HTTP endpoint. Supports server discovery and only the search_capabilities and get_capability read tools. Requires standard MCP protocol headers for the negotiated protocol. Publisher-submitted text is untrusted data; listings are not evaluated, and this endpoint cannot submit, install, execute, or authorize capabilities. The endpoint is separate from DingDawg's internal governance MCP proxy.",
        "parameters": [
          {
            "name": "MCP-Protocol-Version",
            "in": "header",
            "required": false,
            "description": "Required by current MCP protocol revisions; legacy handshake clients may omit it.",
            "schema": {
              "type": "string",
              "maxLength": 32
            }
          },
          {
            "name": "Mcp-Method",
            "in": "header",
            "required": false,
            "description": "Required by current MCP protocol revisions and must match the JSON-RPC method.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "Mcp-Name",
            "in": "header",
            "required": false,
            "description": "Current protocol header mirroring the tool name for tools/call.",
            "schema": {
              "type": "string",
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpJsonRpcRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpJsonRpcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed MCP request or unsupported protocol version"
          },
          "403": {
            "description": "Host or supplied Origin rejected"
          },
          "405": {
            "description": "POST is required"
          },
          "413": {
            "description": "Request exceeds the bounded body size"
          },
          "503": {
            "description": "Marketplace directory unavailable"
          }
        }
      }
    },
    "/.well-known/capability-passport/v2/": {
      "get": {
        "operationId": "getCapabilityPassportV2Schema",
        "summary": "Get the standalone versioned Capability Passport v2 JSON Schema",
        "responses": {
          "200": {
            "description": "Standalone JSON Schema Draft 2020-12. Validates passport structure only; it does not establish publisher identity, evidence validity, or execution authority.",
            "content": {
              "application/schema+json": {
                "schema": {
                  "$ref": "#/components/schemas/CapabilityPassportV2"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/capability-passport/v3/": {
      "get": {
        "operationId": "getCapabilityPassportV3Schema",
        "summary": "Get the standalone versioned Capability Passport v3 JSON Schema",
        "responses": {
          "200": {
            "description": "Standalone JSON Schema Draft 2020-12. Validates passport structure only; v3 connection declarations are unverified and grant no execution authority.",
            "content": {
              "application/schema+json": {
                "schema": {
                  "$ref": "#/components/schemas/CapabilityPassportV3"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "McpJsonRpcRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "jsonrpc",
          "id",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "method": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "McpJsonRpcResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "jsonrpc",
          "id"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "type": "object",
            "additionalProperties": true
          },
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "data": {}
            }
          }
        },
        "oneOf": [
          {
            "required": [
              "result"
            ],
            "not": {
              "required": [
                "error"
              ]
            }
          },
          {
            "required": [
              "error"
            ],
            "not": {
              "required": [
                "result"
              ]
            }
          }
        ]
      },
      "DirectoryResponse": {
        "type": "object",
        "required": [
          "marketplace",
          "schemaVersion",
          "supportedContractVersions",
          "communityStatus",
          "listings",
          "communityPage",
          "capabilityPassportV2Schema",
          "capabilityPassportV3Schema"
        ],
        "properties": {
          "marketplace": {
            "const": "DingDawg.com"
          },
          "schemaVersion": {
            "const": 2
          },
          "supportedContractVersions": {
            "const": [
              1,
              2,
              3
            ]
          },
          "communityStatus": {
            "$ref": "#/components/schemas/CommunityDirectoryStatus"
          },
          "listings": {
            "type": "object",
            "required": [
              "community",
              "dingdawgPackages"
            ],
            "properties": {
              "community": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CommunityListing"
                },
                "maxItems": 100
              },
              "dingdawgPackages": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/FirstPartyPackage"
                }
              }
            }
          },
          "communityPage": {
            "$ref": "#/components/schemas/CommunityPage"
          },
          "capabilityPassportV2Schema": {
            "type": "string",
            "format": "uri",
            "const": "https://dingdawg.com/.well-known/capability-passport/v2/"
          },
          "capabilityPassportV3Schema": {
            "type": "string",
            "format": "uri",
            "const": "https://dingdawg.com/.well-known/capability-passport/v3/"
          }
        }
      },
      "CommunityDirectoryStatus": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "state",
              "reason"
            ],
            "properties": {
              "state": {
                "const": "AVAILABLE"
              },
              "reason": {
                "type": "null"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "state",
              "reason"
            ],
            "properties": {
              "state": {
                "const": "UNAVAILABLE"
              },
              "reason": {
                "const": "STORAGE_UNCONFIGURED_OR_UNAVAILABLE"
              }
            }
          }
        ]
      },
      "FirstPartyPackage": {
        "type": "object",
        "required": [
          "name",
          "kind",
          "packageUrl",
          "glamaUrl",
          "evaluationStatus",
          "artifactReview"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "MCP server",
              "CLI",
              "Setup CLI",
              "SDK",
              "MCP policy evaluator"
            ]
          },
          "packageUrl": {
            "type": "string",
            "format": "uri"
          },
          "glamaUrl": {
            "oneOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "evaluationStatus": {
            "const": "NOT_EVALUATED"
          },
          "artifactReview": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PackageArtifactReviewNote"
              },
              {
                "type": "null"
              }
            ],
            "description": "A code-owned, version- and digest-bound internal static-review note. Not independent evaluation or certification; null when no note exists. Current registry version is not checked at request time."
          }
        },
        "additionalProperties": false
      },
      "StringList": {
        "type": "array",
        "minItems": 0,
        "maxItems": 24,
        "items": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S",
          "maxLength": 160
        }
      },
      "TestCaseV1": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "expected"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 120
          },
          "expected": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 240
          }
        }
      },
      "WorkflowContractV1": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "purpose",
          "inputs",
          "expectedOutcome",
          "permissions",
          "sideEffects",
          "testCases"
        ],
        "properties": {
          "version": {
            "const": 1
          },
          "purpose": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 500
          },
          "inputs": {
            "$ref": "#/components/schemas/StringList"
          },
          "expectedOutcome": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 500
          },
          "permissions": {
            "$ref": "#/components/schemas/StringList"
          },
          "sideEffects": {
            "$ref": "#/components/schemas/StringList"
          },
          "testCases": {
            "type": "array",
            "minItems": 1,
            "maxItems": 30,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "name",
                "expected"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 120
                },
                "expected": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 240
                }
              }
            }
          }
        }
      },
      "CapabilityPassportV2": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "kind",
          "capabilityId",
          "publisherId",
          "purpose",
          "inputs",
          "outputs",
          "expectedOutcome",
          "permissions",
          "sideEffects",
          "dataHandling",
          "compatibility",
          "release",
          "evidenceRefs",
          "lifecycle",
          "testCases"
        ],
        "properties": {
          "version": {
            "const": 2
          },
          "kind": {
            "type": "string",
            "enum": [
              "package",
              "workflow",
              "agent",
              "mcp-server",
              "connector",
              "model-service",
              "skill",
              "evaluation-suite",
              "device-skill"
            ]
          },
          "capabilityId": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 63,
            "description": "Must equal the normalized listing handle."
          },
          "publisherId": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 100,
            "description": "Publisher-declared, unverified identity."
          },
          "purpose": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 500
          },
          "inputs": {
            "$ref": "#/components/schemas/StringList"
          },
          "outputs": {
            "$ref": "#/components/schemas/StringList"
          },
          "expectedOutcome": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 500
          },
          "permissions": {
            "$ref": "#/components/schemas/StringList"
          },
          "sideEffects": {
            "$ref": "#/components/schemas/StringList"
          },
          "dataHandling": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "reads",
              "writes",
              "sharesWith",
              "retention"
            ],
            "properties": {
              "reads": {
                "$ref": "#/components/schemas/StringList"
              },
              "writes": {
                "$ref": "#/components/schemas/StringList"
              },
              "sharesWith": {
                "$ref": "#/components/schemas/StringList"
              },
              "retention": {
                "type": "string",
                "minLength": 1,
                "pattern": "\\S",
                "maxLength": 300
              }
            }
          },
          "compatibility": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "protocols",
              "clients"
            ],
            "properties": {
              "status": {
                "enum": [
                  "DECLARED",
                  "UNSPECIFIED"
                ]
              },
              "protocols": {
                "type": "array",
                "minItems": 0,
                "maxItems": 12,
                "items": {
                  "type": "string",
                  "pattern": "^(?:[mM][cC][pP]|[aA]2[aA]|[oO][pP][eE][nN][aA][pP][iI]|[cC][lL][iI]|[hH][tT][tT][pP][sS]?)$"
                }
              },
              "clients": {
                "type": "array",
                "minItems": 0,
                "maxItems": 24,
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 160
                }
              }
            },
            "allOf": [
              {
                "if": {
                  "properties": {
                    "status": {
                      "const": "DECLARED"
                    }
                  }
                },
                "then": {
                  "anyOf": [
                    {
                      "properties": {
                        "protocols": {
                          "minItems": 1
                        }
                      }
                    },
                    {
                      "properties": {
                        "clients": {
                          "minItems": 1
                        }
                      }
                    }
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "status": {
                      "const": "UNSPECIFIED"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "protocols": {
                      "maxItems": 0
                    },
                    "clients": {
                      "maxItems": 0
                    }
                  }
                }
              }
            ]
          },
          "release": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "version",
              "sha256"
            ],
            "properties": {
              "version": {
                "type": "string",
                "minLength": 1,
                "pattern": "\\S",
                "maxLength": 80
              },
              "sha256": {
                "type": "string",
                "pattern": "^sha256:[a-f0-9]{64}$",
                "description": "Publisher-declared immutable release digest; not independently verified at submission."
              }
            }
          },
          "evidenceRefs": {
            "type": "array",
            "minItems": 0,
            "maxItems": 24,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "kind",
                "url"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 40
                },
                "url": {
                  "type": "string",
                  "maxLength": 500,
                  "pattern": "^https://[^\\s]+$",
                  "format": "uri"
                }
              }
            }
          },
          "lifecycle": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "enum": [
                  "ACTIVE",
                  "DEPRECATED",
                  "REVOKED"
                ]
              }
            }
          },
          "testCases": {
            "type": "array",
            "minItems": 1,
            "maxItems": 30,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "name",
                "expected"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 120
                },
                "expected": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 240
                }
              }
            }
          }
        }
      },
      "Contract": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/WorkflowContractV1"
          },
          {
            "$ref": "#/components/schemas/CapabilityPassportV2"
          },
          {
            "$ref": "#/components/schemas/CapabilityPassportV3"
          }
        ]
      },
      "Submission": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "handle",
          "displayName",
          "category",
          "packageUrl",
          "description",
          "contactEmail",
          "contract"
        ],
        "properties": {
          "handle": {
            "type": "string",
            "pattern": "^@?[a-z0-9]+(?:-[a-z0-9]+)*$",
            "maxLength": 64,
            "description": "Optional leading @ is normalized away."
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 80
          },
          "category": {
            "type": "string",
            "enum": [
              "Development",
              "Finance",
              "Healthcare",
              "Legal",
              "Marketing",
              "Operations",
              "Security",
              "Support",
              "Education",
              "Other"
            ]
          },
          "packageUrl": {
            "type": "string",
            "maxLength": 500,
            "description": "HTTPS listing URL on npm, GitHub, PyPI, or Glama; no credentials, query, fragment, or non-default port.",
            "pattern": "^https://(?:(?:www\\.)?npmjs\\.com/package/[\\w@%./-]+/?|github\\.com/[\\w.-]+/[\\w.-]+/?|pypi\\.org/project/[\\w.-]+/?|glama\\.ai/mcp/servers/[\\w@%./-]+/?)$"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 280
          },
          "contactEmail": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "Private moderation contact; never returned in public records."
          },
          "contract": {
            "$ref": "#/components/schemas/Contract"
          }
        }
      },
      "Comment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "listingHandle",
          "author",
          "body"
        ],
        "properties": {
          "listingHandle": {
            "type": "string",
            "pattern": "^@?[a-z0-9]+(?:-[a-z0-9]+)*$",
            "maxLength": 64
          },
          "author": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 60
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 2000
          }
        }
      },
      "DiscoveryDocument": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "protocolVersion",
          "listingSchemaVersion",
          "supportedContractVersions",
          "pricing",
          "trustPolicy",
          "discoveryUrl",
          "openApiUrl",
          "mcpEndpoint",
          "submissionUrl",
          "commentUrl",
          "detailPattern",
          "capabilityPassportV2",
          "capabilityPassportV3"
        ],
        "properties": {
          "name": {
            "const": "DingDawg.com Agent Capability Marketplace"
          },
          "protocolVersion": {
            "const": 1
          },
          "listingSchemaVersion": {
            "const": 2
          },
          "supportedContractVersions": {
            "const": [
              1,
              2,
              3
            ]
          },
          "pricing": {
            "const": "free"
          },
          "trustPolicy": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 1000
          },
          "discoveryUrl": {
            "type": "string",
            "format": "uri"
          },
          "openApiUrl": {
            "type": "string",
            "format": "uri"
          },
          "mcpEndpoint": {
            "type": "string",
            "format": "uri",
            "description": "Canonical POST MCP Streamable HTTP endpoint on https://dingdawg.com; include the trailing slash because the production site enforces trailingSlash: true. All absolute URLs in the discovery document use the fixed canonical DingDawg origin."
          },
          "submissionUrl": {
            "type": "string",
            "format": "uri"
          },
          "commentUrl": {
            "type": "string",
            "format": "uri"
          },
          "detailPattern": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 500
          },
          "capabilityPassportV2": {
            "type": "string",
            "format": "uri",
            "const": "https://dingdawg.com/.well-known/capability-passport/v2/"
          },
          "capabilityPassportV3": {
            "type": "string",
            "format": "uri",
            "const": "https://dingdawg.com/.well-known/capability-passport/v3/"
          }
        }
      },
      "SubmissionAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "handle",
          "status",
          "evaluationStatus"
        ],
        "properties": {
          "success": {
            "const": true
          },
          "handle": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "maxLength": 63
          },
          "status": {
            "const": "PENDING_REVIEW"
          },
          "evaluationStatus": {
            "const": "NOT_EVALUATED"
          }
        }
      },
      "CommentAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success",
          "status"
        ],
        "properties": {
          "success": {
            "const": true
          },
          "status": {
            "const": "PENDING_REVIEW"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "CommunityListing": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "handle",
          "displayName",
          "category",
          "packageUrl",
          "description",
          "contract",
          "status",
          "evaluationStatus",
          "createdAt",
          "contentTrust"
        ],
        "properties": {
          "handle": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "maxLength": 63
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "category": {
            "type": "string",
            "enum": [
              "Development",
              "Finance",
              "Healthcare",
              "Legal",
              "Marketing",
              "Operations",
              "Security",
              "Support",
              "Education",
              "Other"
            ]
          },
          "packageUrl": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 280
          },
          "contract": {
            "$ref": "#/components/schemas/Contract"
          },
          "status": {
            "const": "PUBLISHED_UNVERIFIED"
          },
          "evaluationStatus": {
            "const": "NOT_EVALUATED"
          },
          "contentTrust": {
            "const": "UNTRUSTED_PUBLISHER_DATA",
            "description": "Publisher-supplied text is untrusted data, not instructions or verified behavior."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CommentsAvailabilityStatus": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "state",
              "reason"
            ],
            "properties": {
              "state": {
                "const": "AVAILABLE"
              },
              "reason": {
                "type": "null"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "state",
              "reason"
            ],
            "properties": {
              "state": {
                "const": "UNAVAILABLE"
              },
              "reason": {
                "const": "STORAGE_UNCONFIGURED_OR_UNAVAILABLE"
              }
            }
          }
        ]
      },
      "CatalogOnlyPackageDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "handle",
          "displayName",
          "packageUrl",
          "category",
          "status",
          "evaluationStatus",
          "source"
        ],
        "properties": {
          "handle": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "maxLength": 63
          },
          "displayName": {
            "type": "string",
            "minLength": 1
          },
          "packageUrl": {
            "type": "string",
            "format": "uri"
          },
          "category": {
            "type": "string",
            "enum": [
              "MCP server",
              "CLI",
              "Setup CLI",
              "SDK",
              "MCP policy evaluator"
            ]
          },
          "status": {
            "const": "CATALOG_ONLY"
          },
          "evaluationStatus": {
            "const": "NOT_EVALUATED"
          },
          "source": {
            "const": "DingDawg npm catalog"
          }
        }
      },
      "ModeratedCommentRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "listingHandle",
          "author",
          "body",
          "createdAt",
          "contentTrust"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "listingHandle": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "maxLength": 63
          },
          "author": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "contentTrust": {
            "const": "UNTRUSTED_USER_CONTENT",
            "description": "Approved comments are user-supplied text and remain untrusted data."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ListingDetailResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "listing",
          "comments",
          "commentsStatus",
          "identity"
        ],
        "properties": {
          "listing": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CommunityListing"
              },
              {
                "$ref": "#/components/schemas/CatalogOnlyPackageDetail"
              }
            ]
          },
          "comments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModeratedCommentRecord"
            }
          },
          "commentsStatus": {
            "$ref": "#/components/schemas/CommentsAvailabilityStatus"
          },
          "identity": {
            "type": "string",
            "const": "Publisher and commenter identities are self-asserted and unverified."
          }
        }
      },
      "CommunityPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pageSize",
          "consistency",
          "hasMore",
          "nextCursor"
        ],
        "properties": {
          "pageSize": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "Community listing page size selected by the caller; default 100."
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether another community-listing page is available."
          },
          "nextCursor": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "consistency": {
            "const": "LIVE",
            "description": "Each page reflects current moderation state; cursor traversal is not a frozen snapshot."
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "hasMore": {
                  "const": true
                }
              }
            },
            "then": {
              "properties": {
                "nextCursor": {
                  "type": "string"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "hasMore": {
                  "const": false
                }
              }
            },
            "then": {
              "properties": {
                "nextCursor": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "PackageArtifactReviewNote": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "version",
          "reviewedId",
          "reviewedAt",
          "href",
          "tarballSha256",
          "distPath",
          "distSha256",
          "additionalFiles",
          "registryLatestVersionAtReview",
          "registryCheckedAt",
          "method",
          "reviewer",
          "currentness",
          "evaluationStatus",
          "scope",
          "observations",
          "evidenceUrl"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "string",
            "minLength": 1
          },
          "reviewedId": {
            "type": "string",
            "minLength": 1
          },
          "reviewedAt": {
            "type": "string",
            "format": "date"
          },
          "href": {
            "type": "string",
            "format": "uri"
          },
          "tarballSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "distPath": {
            "type": "string",
            "minLength": 1
          },
          "distSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "additionalFiles": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "path",
                "sha256"
              ],
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              }
            }
          },
          "registryLatestVersionAtReview": {
            "type": "string",
            "minLength": 1
          },
          "registryCheckedAt": {
            "type": "string",
            "format": "date"
          },
          "method": {
            "const": "ANONYMOUS_STATIC_INSPECTION_NOT_INSTALLED_OR_EXECUTED"
          },
          "reviewer": {
            "const": "DINGDAWG_INTERNAL_NOTE_NOT_INDEPENDENT"
          },
          "currentness": {
            "const": "REGISTRY_VERSION_NOT_CHECKED_AT_REQUEST_TIME"
          },
          "evaluationStatus": {
            "const": "NOT_EVALUATED"
          },
          "scope": {
            "type": "string",
            "minLength": 1
          },
          "observations": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "evidenceUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "CapabilityConnectionV3": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "transport",
          "endpoint",
          "authentication",
          "egressHosts",
          "discovery",
          "operations"
        ],
        "properties": {
          "transport": {
            "type": "string",
            "enum": [
              "REMOTE_MCP_HTTP",
              "REMOTE_A2A_HTTP",
              "OPENAPI_HTTP",
              "LINK_ONLY"
            ]
          },
          "endpoint": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "pattern": "^https://(?!(?:localhost|(?:[a-z0-9-]+\\.)*(?:local|internal|localhost)|(?:[0-9]{1,3}\\.){3}[0-9]{1,3})(?:/|$))(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:/[^?#\\s]*)?$"
          },
          "authentication": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "mode",
              "credentialLocation",
              "scopes"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "NONE",
                  "OAUTH2",
                  "API_KEY",
                  "DELEGATED_TOKEN",
                  "UNSPECIFIED"
                ]
              },
              "credentialLocation": {
                "type": "string",
                "enum": [
                  "NONE",
                  "LOCAL_KEYCHAIN",
                  "REMOTE_SERVICE",
                  "UNCONFIGURED"
                ]
              },
              "scopes": {
                "type": "array",
                "maxItems": 24,
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 160
                }
              }
            }
          },
          "egressHosts": {
            "type": "array",
            "maxItems": 16,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$",
              "maxLength": 253
            }
          },
          "discovery": {
            "type": "string",
            "enum": [
              "NONE",
              "DECLARED",
              "DYNAMIC_REQUIRES_LOCAL_APPROVAL"
            ]
          },
          "operations": {
            "type": "array",
            "maxItems": 64,
            "uniqueItems": true,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "effect"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"
                },
                "effect": {
                  "type": "string",
                  "enum": [
                    "READ_ONLY",
                    "WRITE",
                    "EXTERNAL_SIDE_EFFECT"
                  ]
                }
              }
            }
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "transport": {
                  "const": "LINK_ONLY"
                }
              }
            },
            "then": {
              "properties": {
                "endpoint": {
                  "type": "null"
                },
                "egressHosts": {
                  "maxItems": 0
                },
                "discovery": {
                  "const": "NONE"
                },
                "operations": {
                  "maxItems": 0
                },
                "authentication": {
                  "properties": {
                    "mode": {
                      "const": "UNSPECIFIED"
                    },
                    "credentialLocation": {
                      "const": "UNCONFIGURED"
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "discovery": {
                  "const": "DECLARED"
                }
              }
            },
            "then": {
              "properties": {
                "operations": {
                  "minItems": 1
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "transport": {
                  "enum": [
                    "REMOTE_MCP_HTTP",
                    "REMOTE_A2A_HTTP",
                    "OPENAPI_HTTP"
                  ]
                }
              }
            },
            "then": {
              "properties": {
                "endpoint": {
                  "type": "string"
                },
                "egressHosts": {
                  "minItems": 1
                },
                "discovery": {
                  "enum": [
                    "DECLARED",
                    "DYNAMIC_REQUIRES_LOCAL_APPROVAL"
                  ]
                }
              }
            }
          }
        ]
      },
      "CapabilityPassportV3": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "kind",
          "capabilityId",
          "publisherId",
          "purpose",
          "inputs",
          "outputs",
          "expectedOutcome",
          "permissions",
          "sideEffects",
          "dataHandling",
          "compatibility",
          "release",
          "evidenceRefs",
          "lifecycle",
          "testCases",
          "connection"
        ],
        "properties": {
          "version": {
            "const": 3
          },
          "kind": {
            "type": "string",
            "enum": [
              "package",
              "workflow",
              "agent",
              "mcp-server",
              "connector",
              "model-service",
              "skill",
              "evaluation-suite",
              "device-skill"
            ]
          },
          "capabilityId": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 63,
            "description": "Must equal the normalized listing handle."
          },
          "publisherId": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 100,
            "description": "Publisher-declared, unverified identity."
          },
          "purpose": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 500
          },
          "inputs": {
            "$ref": "#/components/schemas/StringList"
          },
          "outputs": {
            "$ref": "#/components/schemas/StringList"
          },
          "expectedOutcome": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "maxLength": 500
          },
          "permissions": {
            "$ref": "#/components/schemas/StringList"
          },
          "sideEffects": {
            "$ref": "#/components/schemas/StringList"
          },
          "dataHandling": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "reads",
              "writes",
              "sharesWith",
              "retention"
            ],
            "properties": {
              "reads": {
                "$ref": "#/components/schemas/StringList"
              },
              "writes": {
                "$ref": "#/components/schemas/StringList"
              },
              "sharesWith": {
                "$ref": "#/components/schemas/StringList"
              },
              "retention": {
                "type": "string",
                "minLength": 1,
                "pattern": "\\S",
                "maxLength": 300
              }
            }
          },
          "compatibility": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "protocols",
              "clients"
            ],
            "properties": {
              "status": {
                "enum": [
                  "DECLARED",
                  "UNSPECIFIED"
                ]
              },
              "protocols": {
                "type": "array",
                "minItems": 0,
                "maxItems": 12,
                "items": {
                  "type": "string",
                  "pattern": "^(?:[mM][cC][pP]|[aA]2[aA]|[oO][pP][eE][nN][aA][pP][iI]|[cC][lL][iI]|[hH][tT][tT][pP][sS]?)$"
                }
              },
              "clients": {
                "type": "array",
                "minItems": 0,
                "maxItems": 24,
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 160
                }
              }
            },
            "allOf": [
              {
                "if": {
                  "properties": {
                    "status": {
                      "const": "DECLARED"
                    }
                  }
                },
                "then": {
                  "anyOf": [
                    {
                      "properties": {
                        "protocols": {
                          "minItems": 1
                        }
                      }
                    },
                    {
                      "properties": {
                        "clients": {
                          "minItems": 1
                        }
                      }
                    }
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "status": {
                      "const": "UNSPECIFIED"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "protocols": {
                      "maxItems": 0
                    },
                    "clients": {
                      "maxItems": 0
                    }
                  }
                }
              }
            ]
          },
          "release": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "version",
              "sha256"
            ],
            "properties": {
              "version": {
                "type": "string",
                "minLength": 1,
                "pattern": "\\S",
                "maxLength": 80
              },
              "sha256": {
                "type": "string",
                "pattern": "^sha256:[a-f0-9]{64}$",
                "description": "Publisher-declared immutable release digest; not independently verified at submission."
              }
            }
          },
          "evidenceRefs": {
            "type": "array",
            "minItems": 0,
            "maxItems": 24,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "kind",
                "url"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 40
                },
                "url": {
                  "type": "string",
                  "maxLength": 500,
                  "pattern": "^https://[^\\s]+$",
                  "format": "uri"
                }
              }
            }
          },
          "lifecycle": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "enum": [
                  "ACTIVE",
                  "DEPRECATED",
                  "REVOKED"
                ]
              }
            }
          },
          "testCases": {
            "type": "array",
            "minItems": 1,
            "maxItems": 30,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "name",
                "expected"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 120
                },
                "expected": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S",
                  "maxLength": 240
                }
              }
            }
          },
          "connection": {
            "$ref": "#/components/schemas/CapabilityConnectionV3"
          }
        },
        "description": "Capability Passport v3 adds explicit connection transport, endpoint, authentication custody, egress, and operation discovery declarations. These remain unverified publisher claims and do not grant runtime permission."
      }
    }
  }
}
