Skip to content

Commit bb557e8

Browse files
committed
Update GitHub API logic and plugin schema
1 parent df468b1 commit bb557e8

File tree

1,903 files changed

+344054
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,903 files changed

+344054
-33
lines changed

.well-known/ai-plugin.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
},
1010
"api": {
1111
"type": "openapi",
12-
"url": "https://gpt-gateway-cigu.onrender.com/openapi.yaml",
12+
"url": "https://nomena-gpt.xyz/openapi.yaml",
1313
"has_user_authentication": false
1414
},
15-
"logo_url": "https://gpt-gateway-cigu.onrender.com/logo.png",
15+
"logo_url": "https://nomena-gpt.xyz/logo.png",
1616
"contact_email": "nomenaarison@gmail.com",
17-
"legal_info_url": "https://gpt-gateway-cigu.onrender.com/legal"
17+
"legal_info_url": "https://nomena-gpt.xyz/legal"
1818
}

.well-known/openapi.yaml

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
openapi: 3.1.0
2+
info:
3+
title: GPT Gateway
4+
description: FastAPI middleware to list, read, write, and recursively scan GitHub repositories. Enables GPT to navigate file structures and edit code.
5+
version: 1.0.1
6+
servers:
7+
- url: https://nomena-gpt.xyz/
8+
description: GPT Gateway API root
9+
10+
paths:
11+
/list-files/:
12+
get:
13+
operationId: listFiles
14+
summary: List files in a GitHub repository path
15+
description: Return a flat list of files and folders in a given path of a GitHub repository.
16+
parameters:
17+
- name: owner
18+
in: query
19+
required: true
20+
description: GitHub username or organization
21+
schema:
22+
type: string
23+
- name: repo
24+
in: query
25+
required: true
26+
description: Repository name
27+
schema:
28+
type: string
29+
- name: path
30+
in: query
31+
required: false
32+
description: Path inside the repository (default: root)
33+
schema:
34+
type: string
35+
- name: branch
36+
in: query
37+
required: false
38+
description: Git branch name (default: main)
39+
schema:
40+
type: string
41+
responses:
42+
"200":
43+
description: List of file and folder objects
44+
content:
45+
application/json:
46+
schema:
47+
type: object
48+
properties:
49+
status:
50+
type: string
51+
path:
52+
type: string
53+
files:
54+
type: array
55+
items:
56+
type: object
57+
properties:
58+
name:
59+
type: string
60+
path:
61+
type: string
62+
type:
63+
type: string
64+
required:
65+
- name
66+
- path
67+
- type
68+
69+
/read-file/:
70+
get:
71+
operationId: readFile
72+
summary: Read contents of a file from a GitHub repository
73+
parameters:
74+
- name: owner
75+
in: query
76+
required: true
77+
description: GitHub username or organization
78+
schema:
79+
type: string
80+
- name: repo
81+
in: query
82+
required: true
83+
description: Repository name
84+
schema:
85+
type: string
86+
- name: path
87+
in: query
88+
required: true
89+
description: Full path to the file in the repo
90+
schema:
91+
type: string
92+
- name: branch
93+
in: query
94+
required: false
95+
description: Branch name (default: main)
96+
schema:
97+
type: string
98+
responses:
99+
"200":
100+
description: File content
101+
content:
102+
application/json:
103+
schema:
104+
type: object
105+
properties:
106+
status:
107+
type: string
108+
path:
109+
type: string
110+
content:
111+
type: string
112+
113+
/write-file/:
114+
put:
115+
operationId: writeFile
116+
summary: Write or update a file in a GitHub repository
117+
requestBody:
118+
required: true
119+
content:
120+
application/json:
121+
schema:
122+
type: object
123+
required:
124+
- owner
125+
- repo
126+
- path
127+
- branch
128+
- content
129+
- message
130+
properties:
131+
owner:
132+
type: string
133+
repo:
134+
type: string
135+
branch:
136+
type: string
137+
path:
138+
type: string
139+
content:
140+
type: string
141+
message:
142+
type: string
143+
author_name:
144+
type: string
145+
author_email:
146+
type: string
147+
responses:
148+
"200":
149+
description: File written successfully
150+
content:
151+
application/json:
152+
schema:
153+
type: object
154+
properties:
155+
status:
156+
type: string
157+
result:
158+
type: object
159+
160+
/scan-repo/:
161+
post:
162+
operationId: scanRepo
163+
summary: Recursively scan a GitHub repository and return its file tree
164+
description: Returns the full recursive structure of a GitHub repository starting from the given path.
165+
requestBody:
166+
required: true
167+
content:
168+
application/json:
169+
schema:
170+
type: object
171+
required:
172+
- owner
173+
- repo
174+
properties:
175+
owner:
176+
type: string
177+
example: nomenarkt
178+
repo:
179+
type: string
180+
example: lamina
181+
path:
182+
type: string
183+
example: ""
184+
branch:
185+
type: string
186+
example: main
187+
depth:
188+
type: integer
189+
example: 2
190+
responses:
191+
"200":
192+
description: Recursive file tree
193+
content:
194+
application/json:
195+
schema:
196+
type: object
197+
properties:
198+
status:
199+
type: string
200+
tree:
201+
type: array
202+
items:
203+
$ref: "#/components/schemas/TreeNode"
204+
205+
components:
206+
schemas:
207+
TreeNode:
208+
type: object
209+
properties:
210+
name:
211+
type: string
212+
path:
213+
type: string
214+
type:
215+
type: string
216+
children:
217+
type: array
218+
items:
219+
$ref: "#/components/schemas/TreeNode"

__pycache__/main.cpython-312.pyc

4.02 KB
Binary file not shown.
1.25 KB
Binary file not shown.
1.22 KB
Binary file not shown.
1.49 KB
Binary file not shown.
2.17 KB
Binary file not shown.

actions/list_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
router = APIRouter()
77

8-
@router.get("/")
8+
@router.get("")
99
async def list_files(
1010
owner: str = Query(..., description="GitHub username or organization"),
1111
repo: str = Query(..., description="GitHub repository name"),

actions/read_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
router = APIRouter()
77

8-
@router.get("/")
8+
@router.get("")
99
async def read_file(
1010
owner: str = Query(..., description="GitHub username or organization"),
1111
repo: str = Query(..., description="GitHub repository name"),

actions/scan_repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ScanRepoPayload(BaseModel):
1313
branch: str = "main"
1414
depth: int = 5 # Max depth to recurse
1515

16-
@router.post("/")
16+
@router.post("")
1717
async def scan_repo(payload: ScanRepoPayload):
1818
try:
1919
tree = await scan_repo_tree(

0 commit comments

Comments
 (0)