{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/repowise-dev/json-schema/repowise-dev-chat-session-open-request-schema.json",
  "title": "ChatSessionOpenRequest",
  "description": "Open a session, or resume the one ``(namespace, external_ref)`` names.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/repowise-dev-chat-api-openapi.yml#/components/schemas/ChatSessionOpenRequest",
  "properties": {
    "repo_id": {
      "type": "string",
      "title": "Repo Id"
    },
    "scope": {
      "type": "string",
      "enum": [
        "repo",
        "workspace"
      ],
      "title": "Scope",
      "default": "repo"
    },
    "namespace": {
      "type": "string",
      "maxLength": 128,
      "minLength": 1,
      "title": "Namespace",
      "default": "default"
    },
    "external_ref": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 512,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "External Ref"
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    },
    "policy": {
      "anyOf": [
        {
          "$ref": "#/$defs/ChatSessionPolicyRequest"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "repo_id"
  ],
  "$defs": {
    "ChatSessionPolicyRequest": {
      "properties": {
        "tool_allowlist": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Allowlist"
        },
        "max_tool_loops": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Tool Loops"
        },
        "max_turns": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Turns"
        },
        "max_output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Output Tokens"
        },
        "max_turn_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Turn Tokens"
        },
        "max_session_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Session Tokens"
        },
        "audience": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "engineer",
                "business"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Audience"
        }
      },
      "type": "object",
      "title": "ChatSessionPolicyRequest",
      "description": "Limits a caller asks for. Each may only narrow the server's default\nsession policy; a wider value is refused."
    }
  }
}