{"openapi":"3.0.1","info":{"title":"AskTheCode Plugin","description":"Plugin to explain the code from Github and assist with its usage. Works with the provided Github file link.","version":"v1"},"paths":{"/api/repository/structure":{"post":{"tags":["Repository"],"summary":"Retrieves the Github repository file structure to analyze it and be able to query only relevant files. If the provided URL contains specific branch and directory information, prioritize using that over querying the entire repository structure.","operationId":"GetRepositoryStructure","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructureRequestDto"}}}},"responses":{"200":{"description":"Returns the github repository structure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructureResponseDto"}}}}},"security":[{"Bearer":[]}]}},"/api/repository/content":{"post":{"tags":["Repository"],"summary":"Retrieves github repository file contents, possibly filtered by file names. Never query this endpoint without previously querying GetRepositoryStructure endpoint and when the next step is set to GetRepositoryStructure.","operationId":"GetRepositoryContent","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentRequestDto"}}}},"responses":{"200":{"description":"Returns the contents of the requested files","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryContentResponseDto"}}}}},"security":[{"Bearer":[]}]}},"/api/repository/search":{"post":{"tags":["Repository"],"summary":"Search by user specified keywords. Use when user explicitly asked to search for something. Otherwise Prefer to fetch the repository structure first. Invoke only with user-specified, specific keywords (e.g., file, class, method names). Avoid generic terms.","operationId":"SearchRepository","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRepositoryRequestDto"}}}},"responses":{"200":{"description":"Returns the contents of the requested files","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponseDto"}}}}},"security":[{"Bearer":[]}]}},"/api/repository/commit/overview":{"post":{"tags":["RepositoryCommits"],"summary":"Retrieves github commit overview by the commit SHA","operationId":"GetRepositoryCommitOverview","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitOverviewRequestDto"}}}},"responses":{"200":{"description":"Returns the commit overview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitOverviewResponseDto"}}}}},"security":[{"Bearer":[]}]}},"/api/repository/commit/changes":{"post":{"tags":["RepositoryCommits"],"summary":"Retrieves github commit file changes by the commit SHA","operationId":"GetRepositoryCommitChanges","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitChangesRequestDto"}}}},"responses":{"200":{"description":"Returns the commit overview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitChangesResponseDto"}}}}},"security":[{"Bearer":[]}]}},"/api/repository/issue":{"post":{"tags":["RepositoryIssues"],"summary":"Retrieves github issue and its comments by the issue URL","operationId":"GetRepositoryIssue","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueRequestDto"}}}},"responses":{"200":{"description":"Returns the issue with its comments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueResponseDto"}}}}},"security":[{"Bearer":[]}]}},"/api/repository/issue/comment/post":{"post":{"tags":["RepositoryIssues"],"summary":"Posts the comment under the github issue specified by the issue URL","operationId":"PostRepositoryIssueComment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostIssueCommentRequestDto"}}}},"responses":{"200":{"description":"Returns the issue with its comments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostIssueCommentResponseDto"}}}}},"security":[{"Bearer":[]}]}}},"components":{"schemas":{"CommitChangesRequestDto":{"required":["commitUrl"],"type":"object","properties":{"commitUrl":{"minLength":1,"type":"string","description":"Github commit URL. The relative part is in form ///commit/"},"fromFileName":{"type":"string","description":"Name of the file to start grabbing changes from. Pass it when you want to query the continuation of the commit changes","nullable":true}},"additionalProperties":false},"CommitChangesResponseDto":{"type":"object","properties":{"assistantHint":{"type":"string","nullable":true},"usefulUrls":{"$ref":"#/components/schemas/UsefulUrlsDto"},"commit":{"$ref":"#/components/schemas/RepositoryCommitChangesDto"}},"additionalProperties":false},"CommitOverviewRequestDto":{"required":["commitUrl"],"type":"object","properties":{"commitUrl":{"minLength":1,"type":"string","description":"Github commit URL. The relative part is in form ///commit/"}},"additionalProperties":false},"CommitOverviewResponseDto":{"type":"object","properties":{"assistantHint":{"type":"string","nullable":true},"usefulUrls":{"$ref":"#/components/schemas/UsefulUrlsDto"},"commit":{"$ref":"#/components/schemas/RepositoryCommitOverviewDto"}},"additionalProperties":false},"ContentRequestDto":{"required":["filePaths","url"],"type":"object","properties":{"url":{"minLength":1,"type":"string","description":"Full Github repository URL provided by the user. For example: https://github.com/[owner]/[repo]/blob/[branch]/[file-path]"},"branch":{"type":"string","description":"Repository branch. Provide only if user has explicitly specified it or the previous plugin response contains it. When requesting file from commit, use commit SHA.","nullable":true},"relativePath":{"type":"string","description":"Relative paths to the directory. Provide only if user has explicitly specified it or the previous plugin response contains it.","nullable":true},"filePaths":{"type":"array","items":{"type":"string"},"description":"Files to query the content of. Order them by relevance descendant. This should NEVER contain the repository branch. First determine the branch if possible, and only then the file paths. Path only if you are sure about the file path, call GetRepositoryStructure otherwise"}},"additionalProperties":false},"FileContentDto":{"type":"object","properties":{"path":{"type":"string","description":"Relative path to the file. The path is always relative to the root folder","nullable":true,"readOnly":true},"content":{"type":"string","description":"The content of the file. If null or missing, this means that the file content overflowed the allowed maximum and should be queried separately in the next request. Please explain the user why not all files where returned and ask if he wants to proceed.","nullable":true,"readOnly":true},"error":{"type":"string","description":"An error that occurred when getting the file content","nullable":true,"readOnly":true}},"additionalProperties":false},"GithubIssueCommentDto":{"type":"object","properties":{"body":{"type":"string","nullable":true,"readOnly":true}},"additionalProperties":false},"GithubIssueDto":{"type":"object","properties":{"title":{"type":"string","nullable":true,"readOnly":true},"body":{"type":"string","nullable":true,"readOnly":true},"comments":{"type":"array","items":{"$ref":"#/components/schemas/GithubIssueCommentDto"},"nullable":true,"readOnly":true}},"additionalProperties":false},"IssueRequestDto":{"required":["issueUrl"],"type":"object","properties":{"issueUrl":{"minLength":1,"type":"string","description":"Github issue URL"},"comment":{"type":"string","description":"The message of the comment you want to request. Provide only when you want to request some specific comment.","nullable":true},"lastComment":{"type":"string","description":"The message of last comment you know about. Provide only when you want to request more issue comments. Never set both comment and lastComment fields.","nullable":true}},"additionalProperties":false},"IssueResponseDto":{"type":"object","properties":{"assistantHint":{"type":"string","nullable":true},"usefulUrls":{"$ref":"#/components/schemas/UsefulUrlsDto"},"issue":{"$ref":"#/components/schemas/GithubIssueDto"}},"additionalProperties":false},"PostIssueCommentRequestDto":{"required":["comment","issueUrl"],"type":"object","properties":{"issueUrl":{"minLength":1,"type":"string","description":"Github issue URL"},"comment":{"minLength":1,"type":"string","description":"The message of the comment to post under the issue"},"isApprovedByUser":{"type":"boolean","description":"Has user approved the comment. If user asked you to post some comment you should first present him the issue URL you want to post comment to and the comment body. Set this to true only if you have explicitly asked for confirmation and user has approved it."}},"additionalProperties":false},"PostIssueCommentResponseDto":{"type":"object","properties":{"assistantHint":{"type":"string","nullable":true},"usefulUrls":{"$ref":"#/components/schemas/UsefulUrlsDto"}},"additionalProperties":false},"RepositoryCommitChangesDto":{"type":"object","properties":{"sha":{"type":"string","description":"SHA of the commit. When getting full content of the file, use it as the branch name until other branch is explicitly specified by user","nullable":true,"readOnly":true},"parentCommitSha":{"type":"string","description":"SHA of the parent commit. Use it in URL to query the full content of the file that was before the commit when requesting GetRepositoryContent","nullable":true,"readOnly":true},"changes":{"type":"array","items":{"$ref":"#/components/schemas/RepositoryCommitFileDto"},"nullable":true},"otherFilesInCommit":{"type":"array","items":{"type":"string"},"nullable":true},"nextFileToQuery":{"type":"string","description":"Name of the next file to query. Pass it as FromFileName when you want to query the continuation of the commit changes. If not null, empty or missing, this means that commit changes were not fully analyzed. Ask user if he want to proceed before querying.","nullable":true},"totals":{"$ref":"#/components/schemas/RepositoryCommitTotalsDto"}},"additionalProperties":false},"RepositoryCommitFileDto":{"type":"object","properties":{"fileName":{"type":"string","nullable":true,"readOnly":true},"status":{"type":"string","nullable":true,"readOnly":true},"patch":{"type":"string","nullable":true,"readOnly":true}},"additionalProperties":false},"RepositoryCommitOverviewDto":{"type":"object","properties":{"sha":{"type":"string","description":"SHA of the commit. When getting full content of the file, use it as the branch name until other branch is explicitly specified by user","nullable":true,"readOnly":true},"parentCommitSha":{"type":"string","description":"SHA of the parent commit. Use it in URL to query the full content of the file that was before the commit when requesting GetRepositoryContent","nullable":true,"readOnly":true},"message":{"type":"string","nullable":true,"readOnly":true},"commitDate":{"type":"string","format":"date-time","readOnly":true},"author":{"type":"string","nullable":true,"readOnly":true},"changedFiles":{"type":"array","items":{"type":"string"},"nullable":true},"totalFiles":{"type":"integer","format":"int32"}},"additionalProperties":false},"RepositoryCommitTotalsDto":{"type":"object","properties":{"totalFiles":{"type":"integer","format":"int32","readOnly":true},"analyzedFiles":{"type":"integer","format":"int32","readOnly":true}},"additionalProperties":false},"RepositoryContentResponseDto":{"type":"object","properties":{"assistantHint":{"type":"string","nullable":true},"usefulUrls":{"$ref":"#/components/schemas/UsefulUrlsDto"},"branchName":{"type":"string","description":"Requested Github repository branch","nullable":true},"files":{"type":"array","items":{"$ref":"#/components/schemas/FileContentDto"},"description":"File contents","nullable":true},"adv":{"type":"string","description":"Display it only when you are not planning to send more requests. Separate Adv from the main response with a line","nullable":true}},"additionalProperties":false},"RepositorySearchFoundFileDto":{"type":"object","properties":{"path":{"type":"string","description":"Path to the file relative to the repository root","nullable":true,"readOnly":true},"matches":{"type":"array","items":{"type":"string"},"description":"Lines of code within the file that matched the search","nullable":true,"readOnly":true},"totals":{"$ref":"#/components/schemas/RepositorySearchMatchesTotalsDto"}},"additionalProperties":false},"RepositorySearchMatchesTotalsDto":{"type":"object","properties":{"total":{"type":"integer","format":"int32","readOnly":true},"analyzed":{"type":"integer","format":"int32","readOnly":true}},"additionalProperties":false},"SearchRepositoryRequestDto":{"required":["searchKeywords","url"],"type":"object","properties":{"url":{"minLength":1,"type":"string","description":"Full Github repository URL provided by the user. For example: https://github.com/[owner]/[repo]/blob/[branch]/[file-path]"},"branch":{"type":"string","description":"Repository branch. Provide only if user has explicitly specified it or the previous plugin response contains it. When requesting file from commit, use commit SHA.","nullable":true},"relativePath":{"type":"string","description":"Relative path to the file or directory to search in. Provide only if user has explicitly specified it or the previous plugin response contains it.","nullable":true},"searchKeywords":{"type":"array","items":{"type":"string"},"description":"Search keywords. Invoke only with user-specified keywords. Never use keywords that are not part of the user prompt. When user asks to search for function definitions in a specific file (not directory) and you cannot parse them from file content, pass function keyword relevant for the file language."},"searchHitLinesCount":{"type":"integer","description":"Number of lines to retrieve. Set only when explicitly asked to retrieve the specified amount of lines by the user.","format":"int32","nullable":true},"skipMatchesCount":{"type":"integer","description":"Number of matches to skip in the file. use only when user is searching over file and you need to search for matches that were omitted from the previous search request","format":"int32","nullable":true}},"additionalProperties":false},"SearchResponseDto":{"type":"object","properties":{"assistantHint":{"type":"string","nullable":true},"usefulUrls":{"$ref":"#/components/schemas/UsefulUrlsDto"},"branchName":{"type":"string","nullable":true},"searchResults":{"type":"array","items":{"$ref":"#/components/schemas/RepositorySearchFoundFileDto"},"nullable":true},"adv":{"type":"string","description":"Display it only when you are not planning to send more requests. Separate Adv from the main response with a line","nullable":true}},"additionalProperties":false},"StructureRequestDto":{"required":["url"],"type":"object","properties":{"url":{"minLength":1,"type":"string","description":"Full Github repository URL provided by the user. For example: https://github.com/[owner]/[repo]/blob/[branch]/[file-path]"},"branch":{"type":"string","description":"Repository branch. Provide only if user has explicitly specified it or the previous plugin response contains it.","nullable":true},"relativePaths":{"type":"array","items":{"type":"string"},"description":"Relative paths to retrieve. If the provided URL contains a specific directory path, extract and use it. Otherwise, this should be a directory path or pattern only. Patterns accept * symbol as \"any substring\"","nullable":true}},"additionalProperties":false},"StructureResponseDto":{"type":"object","properties":{"assistantHint":{"type":"string","nullable":true},"usefulUrls":{"$ref":"#/components/schemas/UsefulUrlsDto"},"branchName":{"type":"string","nullable":true},"nextStep":{"type":"string","nullable":true},"files":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false},"UsefulUrlsDto":{"type":"object","properties":{"websiteUrl":{"type":"string","nullable":true},"documentationUrl":{"type":"string","nullable":true},"githubUrl":{"type":"string","nullable":true},"twitterUrl":{"type":"string","nullable":true}},"additionalProperties":false}},"securitySchemes":{"Bearer":{"type":"http","description":"Please enter a valid token","scheme":"Bearer","bearerFormat":"JWT"}}},"servers":[{"url":"https://pluginlab.askthecode.dsomok.online"}]}