Skip to content

Self-hosted AI workspace.

Python
31.1 KB
Raw Blame
{
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "SkillAddRequest": {
        "properties": {
          "category": {
            "default": "general",
            "maxLength": 40,
            "title": "Category",
            "type": "string"
          },
          "confidence": {
            "default": 0.8,
            "title": "Confidence",
            "type": "number"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "fallback_for_toolsets": {
            "items": {
              "type": "string"
            },
            "title": "Fallback For Toolsets",
            "type": "array"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 80,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "pitfalls": {
            "items": {
              "type": "string"
            },
            "title": "Pitfalls",
            "type": "array"
          },
          "platforms": {
            "items": {
              "type": "string"
            },
            "title": "Platforms",
            "type": "array"
          },
          "problem": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Problem"
          },
          "procedure": {
            "items": {
              "type": "string"
            },
            "title": "Procedure",
            "type": "array"
          },
          "requires_toolsets": {
            "items": {
              "type": "string"
            },
            "title": "Requires Toolsets",
            "type": "array"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "solution": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Solution"
          },
          "source": {
            "default": "user",
            "title": "Source",
            "type": "string"
          },
          "status": {
            "default": "draft",
            "title": "Status",
            "type": "string"
          },
          "steps": {
            "items": {
              "type": "string"
            },
            "title": "Steps",
            "type": "array"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "teacher_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Teacher Model"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "verification": {
            "items": {
              "type": "string"
            },
            "title": "Verification",
            "type": "array"
          },
          "version": {
            "default": "1.0.0",
            "title": "Version",
            "type": "string"
          },
          "when_to_use": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "When To Use"
          }
        },
        "title": "SkillAddRequest",
        "type": "object"
      },
      "SkillImportUrlRequest": {
        "properties": {
          "url": {
            "maxLength": 2000,
            "minLength": 8,
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "SkillImportUrlRequest",
        "type": "object"
      },
      "SkillUpdateRequest": {
        "properties": {
          "body_extra": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body Extra"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "fallback_for_toolsets": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallback For Toolsets"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "pitfalls": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pitfalls"
          },
          "platforms": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platforms"
          },
          "problem": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Problem"
          },
          "procedure": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Procedure"
          },
          "requires_toolsets": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requires Toolsets"
          },
          "solution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Solution"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "steps": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "verification": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verification"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "when_to_use": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "When To Use"
          }
        },
        "title": "SkillUpdateRequest",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    }
  },
  "info": {
    "title": "FastAPI",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/skills": {
      "get": {
        "operationId": "list_skills_api_skills_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Skills",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/add": {
      "post": {
        "operationId": "add_skill_api_skills_add_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillAddRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/audit-all": {
      "post": {
        "description": "Kick off a background audit of skills: each is tested + judged; if it\nneeds work the model self-edits and retries; if a teacher model is\nconfigured it escalates; a skill that still fails is demoted to draft\n(never deleted). Poll GET /audit-status. Body:\n{scope: 'drafts'|'unchecked'|'all', names?: [...], skip_audited?: bool}. Default 'all'\nmeans every visible skill, including already-published skills, so audit\ncan publish or demote according to the confidence threshold.",
        "operationId": "audit_all_skills_api_skills_audit_all_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Audit All Skills",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/audit-all/cancel": {
      "post": {
        "operationId": "audit_cancel_api_skills_audit_all_cancel_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Audit Cancel",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/audit-all/status": {
      "get": {
        "operationId": "audit_status_api_skills_audit_all_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Audit Status",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/builtin": {
      "get": {
        "description": "Read-only list of the agent's built-in tool capabilities (research,\nsessions, tasks, email, etc.) \u2014 the things it natively knows how to do.\nSurfaced so the Skills tab can show them in a separate \"Built-in\"\nsection alongside the user's learned SKILL.md skills. Sourced from\nagent_loop.TOOL_SECTIONS (the same descriptions the model is given).",
        "operationId": "list_builtin_skills_api_skills_builtin_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Builtin Skills",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/builtin/{name}": {
      "delete": {
        "description": "Revert a built-in tool to its shipped instruction block.",
        "operationId": "reset_builtin_override_api_skills_builtin__name__delete",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reset Builtin Override",
        "tags": [
          "skills"
        ]
      },
      "get": {
        "description": "Full text of a built-in tool's instruction block \u2014 the override\nif one is set, plus the shipped default (for the revert button).",
        "operationId": "get_builtin_skill_api_skills_builtin__name__get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Builtin Skill",
        "tags": [
          "skills"
        ]
      },
      "put": {
        "description": "Save a user override for a built-in tool's instruction block.\nWARNING surfaced in the UI \u2014 this changes how the assistant is\ntold to use a native tool.",
        "operationId": "set_builtin_override_api_skills_builtin__name__put",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Builtin Override",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/import-from-url": {
      "post": {
        "description": "Install a SKILL.md bundle from a public GitHub URL (skills.sh links supported).",
        "operationId": "import_skill_from_url_api_skills_import_from_url_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillImportUrlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Skill From Url",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/index": {
      "get": {
        "description": "The lightweight `[{name, description, category}]` list that the\nagent's system prompt sees. Useful for the UI's \"what does the model\nactually have access to?\" view.",
        "operationId": "get_index_api_skills_index_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Index",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/search": {
      "post": {
        "operationId": "search_skills_api_skills_search_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Search Skills",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/slash-catalog": {
      "get": {
        "description": "Return skills that are available as slash commands.\n\nMirrors the agent prompt's published-skill index so the UI never offers\na slash command the model would not normally be allowed to discover.",
        "operationId": "get_slash_catalog_api_skills_slash_catalog_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Slash Catalog",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/{skill_id}": {
      "delete": {
        "operationId": "delete_skill_api_skills__skill_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Skill",
        "tags": [
          "skills"
        ]
      },
      "get": {
        "operationId": "get_skill_api_skills__skill_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Skill",
        "tags": [
          "skills"
        ]
      },
      "put": {
        "operationId": "update_skill_api_skills__skill_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/{skill_id}/invoke": {
      "post": {
        "description": "Build a skill-pinned prompt for slash-command invocation.\n\nThis is intentionally server-side so availability, ownership, and usage\naccounting use the same rules as the SkillsManager.",
        "operationId": "invoke_skill_api_skills__skill_id__invoke_post",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Invoke Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/{skill_id}/markdown": {
      "get": {
        "description": "Return the raw SKILL.md text \u2014 used by the slash-invocation flow\nand the editor's 'view source' affordance.",
        "operationId": "get_skill_markdown_api_skills__skill_id__markdown_get",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Skill Markdown",
        "tags": [
          "skills"
        ]
      },
      "post": {
        "description": "Replace SKILL.md with new raw content. Parses + validates first.",
        "operationId": "save_skill_markdown_api_skills__skill_id__markdown_post",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Save Skill Markdown",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/{skill_id}/test": {
      "post": {
        "description": "Kick off a background skill test (agent run + LLM judge). Returns\nimmediately; the run executes server-side so it survives the modal being\nclosed. Poll GET /{skill_id}/test-status for progress + verdict.\nOn completion it records the verdict and nudges the skill's confidence\nto match (pass\u21920.95, needs_work\u21920.6, fail\u21920.4; inconclusive/unknown leave\nit untouched). It never changes the skill's published/draft STATUS.",
        "operationId": "test_skill_api_skills__skill_id__test_post",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Test Skill",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/{skill_id}/test-approval": {
      "post": {
        "description": "Resume a manual skill test with one exact server-sealed action.",
        "operationId": "approve_skill_test_action_api_skills__skill_id__test_approval_post",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Approve Skill Test Action",
        "tags": [
          "skills"
        ]
      }
    },
    "/api/skills/{skill_id}/test-status": {
      "get": {
        "description": "Current background-test state for a skill (status / log / verdict).",
        "operationId": "test_skill_status_api_skills__skill_id__test_status_get",
        "parameters": [
          {
            "in": "path",
            "name": "skill_id",
            "required": true,
            "schema": {
              "title": "Skill Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Test Skill Status",
        "tags": [
          "skills"
        ]
      }
    }
  }
}