{
  "components": {
    "securitySchemes": {
      "NamespaceBearer": {
        "description": "Send Authorization: Bearer <namespace token>.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "cue-bump API",
    "version": "0.1.0"
  },
  "openapi": "3.0.1",
  "paths": {
    "/for-agents": {
      "get": {
        "operationId": "getForAgents",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "bundle_helper": {
                      "properties": {
                        "language": {
                          "type": "string"
                        },
                        "post_example": {
                          "type": "string"
                        },
                        "source": {
                          "description": "Reviewable Python source that converts a directory to bundle JSON.",
                          "type": "string"
                        },
                        "usage": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "language",
                        "source",
                        "usage",
                        "post_example"
                      ],
                      "type": "object"
                    },
                    "environment": {
                      "type": "string"
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "project": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "resource_content": {
                      "properties": {
                        "accepted_fields": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "applies_to": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "format": {
                          "description": "Text and bundle format guidance.",
                          "type": "string"
                        },
                        "max_content_bytes": {
                          "description": "Maximum decoded bytes in content or across all bundle files.",
                          "type": "integer"
                        },
                        "max_description_characters": {
                          "type": "integer"
                        },
                        "max_directory_depth": {
                          "type": "integer"
                        },
                        "max_files": {
                          "type": "integer"
                        },
                        "max_path_bytes": {
                          "type": "integer"
                        },
                        "max_request_body_bytes": {
                          "description": "Maximum UTF-8 byte length of the JSON request envelope.",
                          "type": "integer"
                        },
                        "request_media_type": {
                          "description": "Send a JSON object with exactly one of content or files.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "applies_to",
                        "request_media_type",
                        "accepted_fields",
                        "format",
                        "max_description_characters",
                        "max_content_bytes",
                        "max_request_body_bytes",
                        "max_files",
                        "max_path_bytes",
                        "max_directory_depth"
                      ],
                      "type": "object"
                    },
                    "resource_listing": {
                      "properties": {
                        "authorization": {
                          "type": "string"
                        },
                        "filters": {
                          "type": "string"
                        },
                        "pagination": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "service": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok",
                    "service",
                    "resource_content",
                    "bundle_helper"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Guidance for agents, including content restrictions for cues, skills, rules, and prompts."
          }
        },
        "security": [],
        "summary": "For agents"
      }
    },
    "/health": {
      "get": {
        "operationId": "getHealth",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "environment": {
                      "type": "string"
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "project": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "service": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok",
                    "service"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The service is responding."
          }
        },
        "security": [],
        "summary": "Service health."
      }
    },
    "/mcp": {
      "get": {
        "operationId": "getMcp",
        "responses": {
          "405": {
            "description": "GET is not supported; use POST."
          }
        },
        "security": [],
        "summary": "MCP server does not offer a GET event stream."
      },
      "post": {
        "description": "Each POST carries an MCP JSON-RPC request and returns one JSON response; tool calls do not stream over SSE. MCP clients discover tools with tools/list and invoke them with tools/call. Protected tools accept the existing namespace-scoped Bearer token in the Authorization header.",
        "operationId": "postMcp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object"
                }
              }
            },
            "description": "MCP JSON-RPC response."
          },
          "202": {
            "description": "MCP notification accepted."
          },
          "400": {
            "description": "Invalid MCP request."
          },
          "405": {
            "description": "Unsupported HTTP method."
          },
          "406": {
            "description": "Unsupported response media type."
          },
          "415": {
            "description": "Unsupported request media type."
          },
          "429": {
            "description": "Request throttled."
          },
          "500": {
            "description": "MCP server error."
          }
        },
        "security": [],
        "summary": "MCP Streamable HTTP endpoint using JSON responses."
      }
    },
    "/namespaces/{namespace}": {
      "delete": {
        "description": "Requires a current writer token and no request body. The namespace name can be reused. Historical data and credential versions may be retained.",
        "operationId": "deleteNamespace",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The namespace is logically deleted and its credentials are revoked."
          },
          "400": {
            "description": "Invalid namespace name or unexpected request body."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "409": {
            "description": "The namespace contains resources or changed during deletion."
          },
          "503": {
            "description": "Deletion is unavailable or its outcome could not be confirmed."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Delete an empty namespace and revoke its credentials."
      },
      "get": {
        "operationId": "getNamespace",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "namespace": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The authenticated namespace identity."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "503": {
            "description": "Namespace storage is unavailable."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Namespace details"
      },
      "post": {
        "operationId": "postNamespace",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "namespace": {
                      "type": "string"
                    },
                    "reader_token": {
                      "type": "string"
                    },
                    "writer_token": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace",
                    "reader_token",
                    "writer_token"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Namespace created. Both bearer tokens are returned only once.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "enum": [
                    "no-store"
                  ],
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The namespace URL segment does not match the path parameter pattern, or a request body was sent."
          },
          "409": {
            "description": "Namespace already exists."
          },
          "429": {
            "description": "Namespace creation was throttled."
          },
          "503": {
            "description": "Namespace creation is disabled or credential storage is unavailable."
          }
        },
        "security": [],
        "summary": "Create a namespace."
      }
    },
    "/namespaces/{namespace}/credentials/{role}/rotate": {
      "post": {
        "description": "No request body or client ETag. The other role's token stays valid.",
        "operationId": "rotateNamespaceCredential",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "role",
            "required": true,
            "schema": {
              "enum": [
                "reader",
                "writer"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "oneOf": [
                    {
                      "required": [
                        "reader_token"
                      ]
                    },
                    {
                      "required": [
                        "writer_token"
                      ]
                    }
                  ],
                  "properties": {
                    "reader_token": {
                      "type": "string"
                    },
                    "writer_token": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The replacement token is returned once, under the selected role's token field.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "enum": [
                    "no-store"
                  ],
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid namespace or role, or unexpected request body."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "A current writer credential with rotation permission is required."
          },
          "409": {
            "description": "A concurrent rotation changed the namespace manifest."
          },
          "503": {
            "description": "Credential rotation could not be confirmed."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Rotate one namespace token using a current writer token."
      }
    },
    "/namespaces/{namespace}/cues/{cue}": {
      "delete": {
        "operationId": "deleteCue",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "cue",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A single strong ETag from GET.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Resource logically deleted; historical versions may be retained."
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "409": {
            "description": "Deletion conflicted with a concurrent operation."
          },
          "412": {
            "description": "The update target is missing or its version no longer matches."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Delete a cue at its current version."
      },
      "get": {
        "operationId": "getCue",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "cue",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "required": [
                        "content"
                      ]
                    },
                    {
                      "required": [
                        "files"
                      ]
                    }
                  ],
                  "properties": {
                    "content": {
                      "description": "Opaque UTF-8 text, when saved as a single document.",
                      "type": "string"
                    },
                    "description": {
                      "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                      "maxLength": 256,
                      "type": "string"
                    },
                    "files": {
                      "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "content": {
                            "description": "UTF-8 text or canonical base64-encoded bytes.",
                            "type": "string"
                          },
                          "encoding": {
                            "enum": [
                              "utf-8",
                              "base64"
                            ],
                            "type": "string"
                          },
                          "executable": {
                            "default": false,
                            "type": "boolean"
                          },
                          "path": {
                            "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "encoding",
                          "content"
                        ],
                        "type": "object"
                      },
                      "maxItems": 256,
                      "minItems": 1,
                      "type": "array"
                    },
                    "name": {
                      "type": "string"
                    },
                    "namespace": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace",
                    "name"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stored resource and its current version.",
            "headers": {
              "ETag": {
                "description": "Opaque quoted version to send unchanged in If-Match.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "404": {
            "description": "Cue not found."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Cue details"
      },
      "post": {
        "operationId": "postCue",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "cue",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Omit for create-only. For updates, send a single strong ETag from GET.",
            "in": "header",
            "name": "If-Match",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "description": "Send either content or files, not both. POST replaces content or files; an omitted description is preserved on update and an empty string clears it.",
                "oneOf": [
                  {
                    "required": [
                      "content"
                    ]
                  },
                  {
                    "required": [
                      "files"
                    ]
                  }
                ],
                "properties": {
                  "content": {
                    "description": "Opaque UTF-8 text, at most 524288 UTF-8 bytes.",
                    "type": "string"
                  },
                  "description": {
                    "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                    "maxLength": 256,
                    "type": "string"
                  },
                  "files": {
                    "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "content": {
                          "description": "UTF-8 text or canonical base64-encoded bytes.",
                          "type": "string"
                        },
                        "encoding": {
                          "enum": [
                            "utf-8",
                            "base64"
                          ],
                          "type": "string"
                        },
                        "executable": {
                          "default": false,
                          "type": "boolean"
                        },
                        "path": {
                          "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "encoding",
                        "content"
                      ],
                      "type": "object"
                    },
                    "maxItems": 256,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "required": [
                        "content"
                      ]
                    },
                    {
                      "required": [
                        "files"
                      ]
                    }
                  ],
                  "properties": {
                    "content": {
                      "description": "Opaque UTF-8 text, when saved as a single document.",
                      "type": "string"
                    },
                    "description": {
                      "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                      "maxLength": 256,
                      "type": "string"
                    },
                    "files": {
                      "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "content": {
                            "description": "UTF-8 text or canonical base64-encoded bytes.",
                            "type": "string"
                          },
                          "encoding": {
                            "enum": [
                              "utf-8",
                              "base64"
                            ],
                            "type": "string"
                          },
                          "executable": {
                            "default": false,
                            "type": "boolean"
                          },
                          "path": {
                            "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "encoding",
                          "content"
                        ],
                        "type": "object"
                      },
                      "maxItems": 256,
                      "minItems": 1,
                      "type": "array"
                    },
                    "name": {
                      "type": "string"
                    },
                    "namespace": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace",
                    "name"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stored resource and its current version.",
            "headers": {
              "ETag": {
                "description": "Opaque quoted version to send unchanged in If-Match.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "409": {
            "description": "The create conflicts with an existing resource, or the namespace changed concurrently."
          },
          "412": {
            "description": "The update target is missing or its version no longer matches."
          },
          "413": {
            "description": "The content or JSON request envelope is too large."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Create or conditionally update a cue."
      }
    },
    "/namespaces/{namespace}/prompts/{prompt}": {
      "delete": {
        "operationId": "deletePrompt",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "prompt",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A single strong ETag from GET.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Resource logically deleted; historical versions may be retained."
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "409": {
            "description": "Deletion conflicted with a concurrent operation."
          },
          "412": {
            "description": "The update target is missing or its version no longer matches."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Delete a prompt at its current version."
      },
      "get": {
        "operationId": "getPrompt",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "prompt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "required": [
                        "content"
                      ]
                    },
                    {
                      "required": [
                        "files"
                      ]
                    }
                  ],
                  "properties": {
                    "content": {
                      "description": "Opaque UTF-8 text, when saved as a single document.",
                      "type": "string"
                    },
                    "description": {
                      "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                      "maxLength": 256,
                      "type": "string"
                    },
                    "files": {
                      "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "content": {
                            "description": "UTF-8 text or canonical base64-encoded bytes.",
                            "type": "string"
                          },
                          "encoding": {
                            "enum": [
                              "utf-8",
                              "base64"
                            ],
                            "type": "string"
                          },
                          "executable": {
                            "default": false,
                            "type": "boolean"
                          },
                          "path": {
                            "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "encoding",
                          "content"
                        ],
                        "type": "object"
                      },
                      "maxItems": 256,
                      "minItems": 1,
                      "type": "array"
                    },
                    "name": {
                      "type": "string"
                    },
                    "namespace": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace",
                    "name"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stored resource and its current version.",
            "headers": {
              "ETag": {
                "description": "Opaque quoted version to send unchanged in If-Match.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "404": {
            "description": "Prompt not found."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Prompt details"
      },
      "post": {
        "operationId": "postPrompt",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "prompt",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Omit for create-only. For updates, send a single strong ETag from GET.",
            "in": "header",
            "name": "If-Match",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "description": "Send either content or files, not both. POST replaces content or files; an omitted description is preserved on update and an empty string clears it.",
                "oneOf": [
                  {
                    "required": [
                      "content"
                    ]
                  },
                  {
                    "required": [
                      "files"
                    ]
                  }
                ],
                "properties": {
                  "content": {
                    "description": "Opaque UTF-8 text, at most 524288 UTF-8 bytes.",
                    "type": "string"
                  },
                  "description": {
                    "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                    "maxLength": 256,
                    "type": "string"
                  },
                  "files": {
                    "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "content": {
                          "description": "UTF-8 text or canonical base64-encoded bytes.",
                          "type": "string"
                        },
                        "encoding": {
                          "enum": [
                            "utf-8",
                            "base64"
                          ],
                          "type": "string"
                        },
                        "executable": {
                          "default": false,
                          "type": "boolean"
                        },
                        "path": {
                          "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "encoding",
                        "content"
                      ],
                      "type": "object"
                    },
                    "maxItems": 256,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "required": [
                        "content"
                      ]
                    },
                    {
                      "required": [
                        "files"
                      ]
                    }
                  ],
                  "properties": {
                    "content": {
                      "description": "Opaque UTF-8 text, when saved as a single document.",
                      "type": "string"
                    },
                    "description": {
                      "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                      "maxLength": 256,
                      "type": "string"
                    },
                    "files": {
                      "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "content": {
                            "description": "UTF-8 text or canonical base64-encoded bytes.",
                            "type": "string"
                          },
                          "encoding": {
                            "enum": [
                              "utf-8",
                              "base64"
                            ],
                            "type": "string"
                          },
                          "executable": {
                            "default": false,
                            "type": "boolean"
                          },
                          "path": {
                            "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "encoding",
                          "content"
                        ],
                        "type": "object"
                      },
                      "maxItems": 256,
                      "minItems": 1,
                      "type": "array"
                    },
                    "name": {
                      "type": "string"
                    },
                    "namespace": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace",
                    "name"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stored resource and its current version.",
            "headers": {
              "ETag": {
                "description": "Opaque quoted version to send unchanged in If-Match.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "409": {
            "description": "The create conflicts with an existing resource, or the namespace changed concurrently."
          },
          "412": {
            "description": "The update target is missing or its version no longer matches."
          },
          "413": {
            "description": "The content or JSON request envelope is too large."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Create or conditionally update a prompt."
      }
    },
    "/namespaces/{namespace}/resources": {
      "get": {
        "description": "Requires a reader or writer token. Results use deterministic hash order and best-effort pagination; concurrent changes may cause skips or repeats. A page may be empty even when next_cursor is present.",
        "operationId": "listResources",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "entity",
            "schema": {
              "enum": [
                "cue",
                "skill",
                "rule",
                "prompt"
              ],
              "type": "string"
            }
          },
          {
            "description": "Case-insensitive substring of the resource name or description, not its content.",
            "in": "query",
            "name": "query",
            "schema": {
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque next_cursor from a previous page with the same namespace and filters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "next_cursor": {
                      "nullable": true,
                      "type": "string"
                    },
                    "resources": {
                      "items": {
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "entity": {
                            "enum": [
                              "cue",
                              "skill",
                              "rule",
                              "prompt"
                            ],
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "entity",
                          "name"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "resources",
                    "next_cursor"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "A page of resources and a nullable continuation cursor."
          },
          "400": {
            "description": "Invalid parameters or cursor."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "503": {
            "description": "Resource index is unavailable or not ready."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "List resource names and optional descriptions."
      }
    },
    "/namespaces/{namespace}/rules/{rule}": {
      "delete": {
        "operationId": "deleteRule",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "rule",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A single strong ETag from GET.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Resource logically deleted; historical versions may be retained."
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "409": {
            "description": "Deletion conflicted with a concurrent operation."
          },
          "412": {
            "description": "The update target is missing or its version no longer matches."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Delete a rule at its current version."
      },
      "get": {
        "operationId": "getRule",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "rule",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "required": [
                        "content"
                      ]
                    },
                    {
                      "required": [
                        "files"
                      ]
                    }
                  ],
                  "properties": {
                    "content": {
                      "description": "Opaque UTF-8 text, when saved as a single document.",
                      "type": "string"
                    },
                    "description": {
                      "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                      "maxLength": 256,
                      "type": "string"
                    },
                    "files": {
                      "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "content": {
                            "description": "UTF-8 text or canonical base64-encoded bytes.",
                            "type": "string"
                          },
                          "encoding": {
                            "enum": [
                              "utf-8",
                              "base64"
                            ],
                            "type": "string"
                          },
                          "executable": {
                            "default": false,
                            "type": "boolean"
                          },
                          "path": {
                            "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "encoding",
                          "content"
                        ],
                        "type": "object"
                      },
                      "maxItems": 256,
                      "minItems": 1,
                      "type": "array"
                    },
                    "name": {
                      "type": "string"
                    },
                    "namespace": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace",
                    "name"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stored resource and its current version.",
            "headers": {
              "ETag": {
                "description": "Opaque quoted version to send unchanged in If-Match.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "404": {
            "description": "Rule not found."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Rule details"
      },
      "post": {
        "operationId": "postRule",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "rule",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Omit for create-only. For updates, send a single strong ETag from GET.",
            "in": "header",
            "name": "If-Match",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "description": "Send either content or files, not both. POST replaces content or files; an omitted description is preserved on update and an empty string clears it.",
                "oneOf": [
                  {
                    "required": [
                      "content"
                    ]
                  },
                  {
                    "required": [
                      "files"
                    ]
                  }
                ],
                "properties": {
                  "content": {
                    "description": "Opaque UTF-8 text, at most 524288 UTF-8 bytes.",
                    "type": "string"
                  },
                  "description": {
                    "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                    "maxLength": 256,
                    "type": "string"
                  },
                  "files": {
                    "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "content": {
                          "description": "UTF-8 text or canonical base64-encoded bytes.",
                          "type": "string"
                        },
                        "encoding": {
                          "enum": [
                            "utf-8",
                            "base64"
                          ],
                          "type": "string"
                        },
                        "executable": {
                          "default": false,
                          "type": "boolean"
                        },
                        "path": {
                          "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "encoding",
                        "content"
                      ],
                      "type": "object"
                    },
                    "maxItems": 256,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "required": [
                        "content"
                      ]
                    },
                    {
                      "required": [
                        "files"
                      ]
                    }
                  ],
                  "properties": {
                    "content": {
                      "description": "Opaque UTF-8 text, when saved as a single document.",
                      "type": "string"
                    },
                    "description": {
                      "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                      "maxLength": 256,
                      "type": "string"
                    },
                    "files": {
                      "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "content": {
                            "description": "UTF-8 text or canonical base64-encoded bytes.",
                            "type": "string"
                          },
                          "encoding": {
                            "enum": [
                              "utf-8",
                              "base64"
                            ],
                            "type": "string"
                          },
                          "executable": {
                            "default": false,
                            "type": "boolean"
                          },
                          "path": {
                            "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "encoding",
                          "content"
                        ],
                        "type": "object"
                      },
                      "maxItems": 256,
                      "minItems": 1,
                      "type": "array"
                    },
                    "name": {
                      "type": "string"
                    },
                    "namespace": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace",
                    "name"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stored resource and its current version.",
            "headers": {
              "ETag": {
                "description": "Opaque quoted version to send unchanged in If-Match.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "409": {
            "description": "The create conflicts with an existing resource, or the namespace changed concurrently."
          },
          "412": {
            "description": "The update target is missing or its version no longer matches."
          },
          "413": {
            "description": "The content or JSON request envelope is too large."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Create or conditionally update a rule."
      }
    },
    "/namespaces/{namespace}/skills/{skill}": {
      "delete": {
        "operationId": "deleteSkill",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A single strong ETag from GET.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Resource logically deleted; historical versions may be retained."
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "409": {
            "description": "Deletion conflicted with a concurrent operation."
          },
          "412": {
            "description": "The update target is missing or its version no longer matches."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Delete a skill at its current version."
      },
      "get": {
        "operationId": "getSkill",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "required": [
                        "content"
                      ]
                    },
                    {
                      "required": [
                        "files"
                      ]
                    }
                  ],
                  "properties": {
                    "content": {
                      "description": "Opaque UTF-8 text, when saved as a single document.",
                      "type": "string"
                    },
                    "description": {
                      "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                      "maxLength": 256,
                      "type": "string"
                    },
                    "files": {
                      "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "content": {
                            "description": "UTF-8 text or canonical base64-encoded bytes.",
                            "type": "string"
                          },
                          "encoding": {
                            "enum": [
                              "utf-8",
                              "base64"
                            ],
                            "type": "string"
                          },
                          "executable": {
                            "default": false,
                            "type": "boolean"
                          },
                          "path": {
                            "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "encoding",
                          "content"
                        ],
                        "type": "object"
                      },
                      "maxItems": 256,
                      "minItems": 1,
                      "type": "array"
                    },
                    "name": {
                      "type": "string"
                    },
                    "namespace": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace",
                    "name"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stored resource and its current version.",
            "headers": {
              "ETag": {
                "description": "Opaque quoted version to send unchanged in If-Match.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "404": {
            "description": "Skill not found."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Skill details"
      },
      "post": {
        "operationId": "postSkill",
        "parameters": [
          {
            "in": "path",
            "name": "namespace",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "skill",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Omit for create-only. For updates, send a single strong ETag from GET.",
            "in": "header",
            "name": "If-Match",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "description": "Send either content or files, not both. POST replaces content or files; an omitted description is preserved on update and an empty string clears it.",
                "oneOf": [
                  {
                    "required": [
                      "content"
                    ]
                  },
                  {
                    "required": [
                      "files"
                    ]
                  }
                ],
                "properties": {
                  "content": {
                    "description": "Opaque UTF-8 text, at most 524288 UTF-8 bytes.",
                    "type": "string"
                  },
                  "description": {
                    "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                    "maxLength": 256,
                    "type": "string"
                  },
                  "files": {
                    "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "content": {
                          "description": "UTF-8 text or canonical base64-encoded bytes.",
                          "type": "string"
                        },
                        "encoding": {
                          "enum": [
                            "utf-8",
                            "base64"
                          ],
                          "type": "string"
                        },
                        "executable": {
                          "default": false,
                          "type": "boolean"
                        },
                        "path": {
                          "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "encoding",
                        "content"
                      ],
                      "type": "object"
                    },
                    "maxItems": 256,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "required": [
                        "content"
                      ]
                    },
                    {
                      "required": [
                        "files"
                      ]
                    }
                  ],
                  "properties": {
                    "content": {
                      "description": "Opaque UTF-8 text, when saved as a single document.",
                      "type": "string"
                    },
                    "description": {
                      "description": "Optional single-line description. Omit it on an update to preserve it; send an empty string to clear it.",
                      "maxLength": 256,
                      "type": "string"
                    },
                    "files": {
                      "description": "Complete bundle. Total decoded content is at most 524288 bytes.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "content": {
                            "description": "UTF-8 text or canonical base64-encoded bytes.",
                            "type": "string"
                          },
                          "encoding": {
                            "enum": [
                              "utf-8",
                              "base64"
                            ],
                            "type": "string"
                          },
                          "executable": {
                            "default": false,
                            "type": "boolean"
                          },
                          "path": {
                            "description": "Relative slash-separated path; at most 1024 UTF-8 bytes and 32 directory levels. No traversal, backslashes, colons, control characters, or duplicate or conflicting paths.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "encoding",
                          "content"
                        ],
                        "type": "object"
                      },
                      "maxItems": 256,
                      "minItems": 1,
                      "type": "array"
                    },
                    "name": {
                      "type": "string"
                    },
                    "namespace": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "namespace",
                    "name"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stored resource and its current version.",
            "headers": {
              "ETag": {
                "description": "Opaque quoted version to send unchanged in If-Match.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body, version header, or name. Names must contain 1–63 lowercase ASCII letters, digits, or hyphens and start with a letter or digit."
          },
          "401": {
            "description": "The Authorization header is missing or empty."
          },
          "403": {
            "description": "The bearer credential is invalid or does not grant access."
          },
          "409": {
            "description": "The create conflicts with an existing resource, or the namespace changed concurrently."
          },
          "412": {
            "description": "The update target is missing or its version no longer matches."
          },
          "413": {
            "description": "The content or JSON request envelope is too large."
          },
          "503": {
            "description": "Resource storage is unavailable or the write outcome is unknown."
          }
        },
        "security": [
          {
            "NamespaceBearer": []
          }
        ],
        "summary": "Create or conditionally update a skill."
      }
    }
  },
  "servers": [
    {
      "url": "https://qa0u24a215.execute-api.us-east-1.amazonaws.com"
    }
  ]
}
