File size: 3,514 Bytes
fbf3c28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
"""
id: capabilities
title: Capabilities Overview
author: admin
description: Returns a comprehensive, categorized list of available tools and functions.
version: 0.1.0
license: Proprietary
"""

CAPS = """
Here’s a comprehensive list of all available tools and functions organized by category, along with their capabilities and how they contribute to autonomy:

---

1. System Management
- update: Update package lists (Debian/Ubuntu).
- install: Install packages (Debian/Ubuntu).
- remove / purge / autoremove: Uninstall packages.
- uname / os_release / meminfo / disk_usage: System diagnostics.
- set_cwd: Set working directory for subsequent commands.
- set_env: Set environment variables for future processes.
- kill: Send signals to processes (e.g., SIGKILL, SIGTERM).
- ps: List running processes (customizable args).

Purpose: Full control over system updates, package management, and diagnostics.

---

2. File & Directory Operations
- list: List directory contents.
- find: Glob search (e.g., /data/**/*.py).
- mkdir: Create directories (recursive).
- read / write: Read/write files (with mode: w/a).
- copy / move / delete: File manipulation.
- ensure_line / replace / insert_after: Text editing in files.
- pwd: Get current working directory.

Purpose: Complete file system management, including text editing and automation.

---

3. Process & Networking
- bash: Run arbitrary shell commands.
- get / post: Make HTTP requests (custom headers/body).
- run: Execute Python code snippets.
- tail_logs: View log files (e.g., /var/log/syslog).

Purpose: Interact with external services, automate workflows, and debug processes.

---

4. Version Control (Git)
- clone / checkout / commit / push / pull: Git operations.
- create_branch / status: Branch and repo management.

Purpose: Full Git integration for code management and collaboration.

---

5. Database Tools
- query: Execute SQL SELECT queries.
- exec: Run SQL UPDATE/DELETE commands.

Purpose: Direct database interaction for data manipulation.

---

6. Automation & Scripting
- list_tools / list_functions: Inventory available tools.
- check: Generic check tool (customizable).
- disk_usage: Monitor disk space.

Purpose: Meta-management for toolchain autonomy and system health.

---

7. Advanced Tools
- set_state: Save/restore environment state (e.g., cwd, env vars).
- restart_openwebui: Restart specific services (if applicable).

Purpose: Persistent state management and service control.

---

8. Customizable Functions
- run: Execute Python scripts (e.g., for custom logic).
- bash: Run shell scripts for complex workflows.

Purpose: Flexibility for user-defined automation.

---

How to Use These Tools Autonomously
1. Scripting: Chain commands via bash or run for automation.
2. Integration: Use get/post to interface with APIs/web services.
3. State Management: Use set_cwd/set_env to maintain context.
4. Monitoring: Combine ps/disk_usage/meminfo for system health checks.
5. Deployment: Use install/update for reproducible environments.

---

Example Workflow
1. set_cwd /project → Set working directory.
2. list . → Check files.
3. run python setup.py install → Install dependencies.
4. get https://api.example.com/data → Fetch external data.
5. write config.json → Save results.
"""


class Tools:
    def overview(self) -> str:
        return CAPS


"""
Note: File modifications are limited to allowed roots (/data, /workspace, /data/adaptai, /tmp). System paths are protected. DB writes require OUI_DB_ADMIN_WRITE=1.
"""