Skip to content

Commit 1150a38

Browse files
authored
Merge pull request #66 from sandeepkhot/CLOUD_REPO_CONNECTOR
CLOUD_REPO_CONNECTOR
2 parents a272994 + 7a80806 commit 1150a38

File tree

9 files changed

+4552
-34
lines changed

9 files changed

+4552
-34
lines changed
Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
# Select AI - Cloud Repo Connector Agent (DBMS_CLOUD_REPO)
2+
3+
## Overview
4+
5+
Cloud Repo Connector turns `DBMS_CLOUD_REPO` capabilities into Select AI tools so users can run repository operations conversationally from Oracle Autonomous AI Database.
6+
7+
It supports GitHub, AWS CodeCommit, and Azure Repos through one common toolset and one runtime configuration model.
8+
9+
Core runtime objects:
10+
- Task: `CLOUD_REPO_TASKS`
11+
- Agent: `CLOUD_REPO_CONNECTOR`
12+
- Team: `CLOUD_REPO_CONNECTOR_TEAM`
13+
14+
How this works:
15+
- `cloud_repo_connector_tools.sql` installs packages and registers all AI tools.
16+
- `cloud_repo_connector_agent.sql` creates task/agent/team and binds the AI profile.
17+
- Tools resolve provider/repo context from `SELECTAI_AGENT_CONFIG` first, so repeated prompts for owner/repo/credential/branch are avoided.
18+
- Users can still override repo context in prompts when needed.
19+
20+
For definitions of **Tool**, **Task**, **Agent**, and **Agent Team**, see the top-level guide: [README](../README.md#simple-agent-execution-flow).
21+
22+
---
23+
24+
## Architecture Overview
25+
26+
```text
27+
User Request
28+
29+
CLOUD_REPO_TASKS
30+
31+
CLOUD_REPO_CONNECTOR Reasoning & Tool Selection
32+
├── Initialization tools (INIT_*_REPO_TOOL)
33+
├── Repository lifecycle tools
34+
├── Branch tools
35+
├── File tools
36+
├── Metadata export tools
37+
└── SQL install tools
38+
39+
Formatted Repository/SQL Operation Response
40+
```
41+
42+
---
43+
44+
## Feature Areas
45+
46+
The implementation maps directly to `DBMS_CLOUD_REPO` feature areas:
47+
48+
1. Repository initialization
49+
- Generic repository handle: `INIT_REPO`
50+
- GitHub handle: `INIT_GITHUB_REPO`
51+
- AWS CodeCommit handle: `INIT_AWS_REPO`
52+
- Azure Repos handle: `INIT_AZURE_REPO`
53+
54+
2. Repository management
55+
- Create repository
56+
- Update repository
57+
- List repositories
58+
- Delete repository
59+
60+
3. Repository file management
61+
- Upload file from Oracle Database
62+
- Download file to Oracle Database
63+
- Delete file
64+
- List files
65+
66+
4. Database object export
67+
- Export object metadata/DDL to repository files (`EXPORT_OBJECT`)
68+
69+
---
70+
71+
## Repository Contents
72+
73+
```text
74+
.
75+
├── cloud_repo_connector_tools.sql
76+
│ ├── Configuration bootstrap (SELECTAI_AGENT_CONFIG)
77+
│ ├── DBMS_CLOUD_REPO wrapper package (github_repo_selectai)
78+
│ ├── Agent package (select_ai_github_connector)
79+
│ └── Tool registrations
80+
81+
├── cloud_repo_connector_agent.sql
82+
│ ├── Task definition (CLOUD_REPO_TASKS)
83+
│ ├── Agent creation (CLOUD_REPO_CONNECTOR)
84+
│ ├── Team creation (CLOUD_REPO_CONNECTOR_TEAM)
85+
│ └── AI profile binding
86+
87+
└── README.md
88+
```
89+
90+
---
91+
92+
## Prerequisites
93+
94+
- Oracle Autonomous AI Database (26ai recommended)
95+
- Select AI / `DBMS_CLOUD_AI_AGENT` enabled
96+
- `DBMS_CLOUD_REPO` available in your database version
97+
- `ADMIN` (or equivalent privileged user) for installation
98+
- Required credentials for GitHub/AWS/Azure repo access
99+
100+
---
101+
102+
## Installation - Tools
103+
104+
From `autonomous-ai-agents/cloud_repo_connector`:
105+
106+
```sql
107+
sqlplus admin@<adb_connect_string> @cloud_repo_connector_tools.sql
108+
```
109+
110+
### Optional Configuration JSON
111+
112+
```json
113+
{
114+
"credential_name": "GITHUB_CRED",
115+
"provider": "GITHUB",
116+
"default_owner": "your-org",
117+
"default_repo": "your-repo",
118+
"default_branch": "main",
119+
"aws_region": "us-east-1",
120+
"azure_organization": "your-org",
121+
"azure_project": "your-project"
122+
}
123+
```
124+
125+
Supported config keys in `SELECTAI_AGENT_CONFIG` for `AGENT='CLOUD_REPO_CONNECTOR'`:
126+
- `CREDENTIAL_NAME`
127+
- `PROVIDER`
128+
- `DEFAULT_REPO`
129+
- `DEFAULT_OWNER`
130+
- `DEFAULT_BRANCH`
131+
- `AWS_REGION`
132+
- `AZURE_ORGANIZATION`
133+
- `AZURE_PROJECT`
134+
135+
Backward compatibility:
136+
- Legacy config rows for `AGENT='GITHUB_CONNECTOR'` and `AGENT='GITHUB'` are still read as fallback.
137+
138+
---
139+
140+
## Installation - Agent & Team
141+
142+
```sql
143+
sqlplus admin@<adb_connect_string> @cloud_repo_connector_agent.sql
144+
```
145+
146+
Objects created:
147+
- Task: `CLOUD_REPO_TASKS`
148+
- Agent: `CLOUD_REPO_CONNECTOR`
149+
- Team: `CLOUD_REPO_CONNECTOR_TEAM`
150+
151+
---
152+
153+
## Available AI Tools (Complete)
154+
155+
Registered by `initialize_cloud_repo_tools` in `cloud_repo_connector_tools.sql`: **22 tools**.
156+
157+
Initialization:
158+
- `INIT_GENERIC_REPO_TOOL`
159+
- `INIT_GITHUB_REPO_TOOL`
160+
- `INIT_AWS_REPO_TOOL`
161+
- `INIT_AZURE_REPO_TOOL`
162+
163+
Repository management:
164+
- `CREATE_REPOSITORY_TOOL`
165+
- `UPDATE_REPOSITORY_TOOL`
166+
- `LIST_REPOSITORIES_TOOL`
167+
- `GET_REPOSITORY_TOOL`
168+
- `DELETE_REPOSITORY_TOOL`
169+
170+
Branch management:
171+
- `CREATE_BRANCH_TOOL`
172+
- `DELETE_BRANCH_TOOL`
173+
- `LIST_BRANCHES_TOOL`
174+
- `LIST_COMMITS_TOOL`
175+
- `MERGE_BRANCH_TOOL`
176+
177+
File management:
178+
- `PUT_REPO_FILE_TOOL`
179+
- `GET_REPO_FILE_TOOL`
180+
- `LIST_REPO_FILES_TOOL`
181+
- `DELETE_REPO_FILE_TOOL`
182+
183+
Export:
184+
- `EXPORT_DB_OBJECT_REPO_TOOL`
185+
- `EXPORT_SCHEMA_REPO_TOOL`
186+
187+
SQL install operations:
188+
- `INSTALL_REPO_FILE_TOOL`
189+
- `INSTALL_SQL_BUFFER_TOOL`
190+
191+
### Tool-to-Function Mapping (from `cloud_repo_connector_tools.sql`)
192+
193+
| Tool | Function | Purpose |
194+
|------|----------|---------|
195+
| `INIT_GENERIC_REPO_TOOL` | `select_ai_github_connector.init_repo` | Initialize generic repository handle |
196+
| `INIT_GITHUB_REPO_TOOL` | `select_ai_github_connector.init_github_repo` | Initialize GitHub repository handle |
197+
| `INIT_AWS_REPO_TOOL` | `select_ai_github_connector.init_aws_repo` | Initialize AWS CodeCommit repository handle |
198+
| `INIT_AZURE_REPO_TOOL` | `select_ai_github_connector.init_azure_repo` | Initialize Azure Repos repository handle |
199+
| `CREATE_REPOSITORY_TOOL` | `select_ai_github_connector.create_repository` | Create repository |
200+
| `UPDATE_REPOSITORY_TOOL` | `select_ai_github_connector.update_repository` | Update repository |
201+
| `LIST_REPOSITORIES_TOOL` | `select_ai_github_connector.list_repositories` | List repositories |
202+
| `GET_REPOSITORY_TOOL` | `select_ai_github_connector.get_repository` | Get repository metadata |
203+
| `DELETE_REPOSITORY_TOOL` | `select_ai_github_connector.delete_repository` | Delete repository |
204+
| `CREATE_BRANCH_TOOL` | `select_ai_github_connector.create_branch` | Create repository branch |
205+
| `DELETE_BRANCH_TOOL` | `select_ai_github_connector.delete_branch` | Delete repository branch |
206+
| `LIST_BRANCHES_TOOL` | `select_ai_github_connector.list_branches` | List repository branches |
207+
| `LIST_COMMITS_TOOL` | `select_ai_github_connector.list_commits` | List repository commits |
208+
| `MERGE_BRANCH_TOOL` | `select_ai_github_connector.merge_branch` | Merge repository branches |
209+
| `PUT_REPO_FILE_TOOL` | `select_ai_github_connector.put_file` | Upload repository file |
210+
| `GET_REPO_FILE_TOOL` | `select_ai_github_connector.get_file` | Download repository file |
211+
| `LIST_REPO_FILES_TOOL` | `select_ai_github_connector.list_files` | List repository files |
212+
| `DELETE_REPO_FILE_TOOL` | `select_ai_github_connector.delete_file` | Delete repository file |
213+
| `EXPORT_DB_OBJECT_REPO_TOOL` | `select_ai_github_connector.export_object` | Export DB object metadata to repository |
214+
| `EXPORT_SCHEMA_REPO_TOOL` | `select_ai_github_connector.export_schema` | Export schema metadata to repository |
215+
| `INSTALL_REPO_FILE_TOOL` | `select_ai_github_connector.install_file` | Install SQL from repository file |
216+
| `INSTALL_SQL_BUFFER_TOOL` | `select_ai_github_connector.install_sql` | Install SQL from buffer |
217+
218+
---
219+
220+
## Example Prompts
221+
222+
Initialization:
223+
- "Initialize GitHub repo handle for repo `my-repo` owner `my-org`."
224+
- "Initialize AWS CodeCommit repo handle for `app-repo` in `us-east-1`."
225+
226+
Repository management:
227+
- "Create repository using defaults with description `Demo repo`."
228+
- "List repositories."
229+
- "Delete repository `old-repo`."
230+
231+
Branch management:
232+
- "Create branch `feature/checkout-v2` from `main`."
233+
- "List branches for the configured repository."
234+
- "List commits for branch `feature/checkout-v2`."
235+
- "Merge `feature/checkout-v2` into `main`."
236+
- "Delete branch `feature/checkout-v2`."
237+
238+
File management:
239+
- "Upload `docs/readme.md` with this content and commit message `add docs`."
240+
- "List files under `src/` on branch `main`."
241+
- "Get file `src/app.sql` from branch `main`."
242+
- "Delete file `tmp/test.sql` with commit message `cleanup`."
243+
244+
Export metadata:
245+
- "Export package `HR.EMP_PKG` to `ddl/hr/emp_pkg.sql`."
246+
- "Export table `SALES.ORDERS` to `ddl/sales/orders.sql` on branch `main`."
247+
248+
SQL install operations:
249+
- "Export schema `HR` metadata to `ddl/hr/schema.sql`."
250+
- "Install SQL from repository file `install/release_2026_02.sql` on branch `main`."
251+
- "Install this SQL buffer: `CREATE TABLE demo_t(id NUMBER); /`"
252+
253+
---
254+
255+
## Notes
256+
257+
- `LIST_REPOSITORIES` still needs a repository handle context; set `DEFAULT_REPO` for no-arg usage.
258+
- For GitHub provider, `owner` is required (directly or via `DEFAULT_OWNER`).
259+
- For AWS provider, `region` is required.
260+
- For Azure provider, `organization` and `project` are required.
261+
262+
---
263+
264+
## License
265+
266+
Universal Permissive License (UPL) 1.0
267+
https://oss.oracle.com/licenses/upl/

0 commit comments

Comments
 (0)