walidsobhie-code Claude Opus 4.6 commited on
Commit Β·
65888d5
1
Parent(s): 99a7be2
refactor: Squeeze folders further - cleaner structure
Browse filesChanges:
- Combined stack-2.9-* into stack/ folder
- Shortened names: deploy, training, eval, voice, docs
- Combined examples + tests into samples/
- Renamed training-data to data/
- Moved TOOLS.md to stack/docs/
- Updated directory structure docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This view is limited to 50 files because it contains too many changes. Β See raw diff
- DIRECTORY_STRUCTURE.md +44 -106
- docs/tools.md +0 -206
- {tests β samples}/benchmarks/test_latency.py +0 -0
- {tests β samples}/benchmarks/test_memory_usage.py +0 -0
- {tests β samples}/benchmarks/test_throughput.py +0 -0
- {tests β samples}/benchmarks/test_token_efficiency.py +0 -0
- {tests β samples}/conftest.py +0 -0
- {examples β samples}/demo_stack.py +0 -0
- {examples β samples}/inference_examples.py +0 -0
- {tests β samples}/integration/__init__.py +0 -0
- {tests β samples}/integration/test_agent_cli.py +0 -0
- {tests β samples}/integration/test_cli.py +0 -0
- {tests β samples}/integration/test_self_evolution.py +0 -0
- {tests β samples}/integration/test_tool_chains.py +0 -0
- {tests β samples}/pytest.ini +0 -0
- {tests β samples}/run_tests.py +0 -0
- {tests β samples}/unit/__init__.py +0 -0
- {tests β samples}/unit/test_agent.py +0 -0
- {tests β samples}/unit/test_config.py +0 -0
- {tests β samples}/unit/test_context.py +0 -0
- {tests β samples}/unit/test_memory.py +0 -0
- {tests β samples}/unit/test_together_client.py +0 -0
- {tests β samples}/unit/test_tools.py +0 -0
- {tests β samples}/unit/test_utils.py +0 -0
- {stack-2.9-deploy β stack/deploy}/.gitignore +0 -0
- {stack-2.9-deploy β stack/deploy}/Dockerfile +0 -0
- {stack-2.9-deploy β stack/deploy}/Makefile +0 -0
- {stack-2.9-deploy β stack/deploy}/README.md +0 -0
- {stack-2.9-deploy β stack/deploy}/TROUBLESHOOTING.md +0 -0
- {stack-2.9-deploy β stack/deploy}/app.py +0 -0
- {stack-2.9-deploy β stack/deploy}/config.yaml +0 -0
- {stack-2.9-deploy β stack/deploy}/deploy.sh +0 -0
- {stack-2.9-deploy β stack/deploy}/docker-compose.yaml +0 -0
- {stack-2.9-deploy β stack/deploy}/docker-compose.yml +0 -0
- {stack-2.9-deploy β stack/deploy}/kubernetes/deployment.yaml +0 -0
- {stack-2.9-deploy β stack/deploy}/kubernetes/hpa.yaml +0 -0
- {stack-2.9-deploy β stack/deploy}/kubernetes/pvc.yaml +0 -0
- {stack-2.9-deploy β stack/deploy}/kubernetes/service.yaml +0 -0
- {stack-2.9-deploy β stack/deploy}/local_deploy.sh +0 -0
- {stack-2.9-deploy β stack/deploy}/prometheus.yml +0 -0
- {stack-2.9-deploy β stack/deploy}/requirements.txt +0 -0
- {stack-2.9-deploy β stack/deploy}/runpod-template.json +0 -0
- {stack-2.9-deploy β stack/deploy}/runpod_deploy.sh +0 -0
- {stack-2.9-deploy β stack/deploy}/start.sh +0 -0
- {stack-2.9-deploy β stack/deploy}/validate.sh +0 -0
- {stack-2.9-deploy β stack/deploy}/vastai-template.json +0 -0
- {stack-2.9-deploy β stack/deploy}/vastai_deploy.sh +0 -0
- {stack-2.9-deploy β stack/deploy}/vllm_server.py +0 -0
- {docs β stack/docs}/archive/CONTEXT_UPDATE_SUMMARY.md +0 -0
- {docs β stack/docs}/archive/DATA_SCALING_PLAN.md +0 -0
DIRECTORY_STRUCTURE.md
CHANGED
|
@@ -1,120 +1,58 @@
|
|
| 1 |
# Stack 2.9 Directory Structure
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
## Directory Overview
|
| 6 |
|
| 7 |
```
|
| 8 |
stack-2.9/
|
| 9 |
-
βββ src/
|
| 10 |
-
βββ
|
| 11 |
-
βββ
|
| 12 |
-
βββ scripts/
|
| 13 |
-
βββ
|
| 14 |
-
βββ
|
| 15 |
-
β
|
| 16 |
-
βββ stack-2.9-training/ # Model training code
|
| 17 |
-
βββ stack-2.9-deploy/ # Deployment configurations
|
| 18 |
-
βββ stack-2.9-eval/ # Evaluation and benchmarking
|
| 19 |
-
βββ stack-2.9-voice/ # Voice API server (Python)
|
| 20 |
-
βββ stack-2.9-docs/ # Generated documentation
|
| 21 |
β
|
| 22 |
-
βββ
|
| 23 |
-
βββ
|
| 24 |
-
|
|
|
|
|
|
|
| 25 |
```
|
| 26 |
|
| 27 |
-
##
|
| 28 |
-
|
| 29 |
-
### `src/` - TypeScript Source Code
|
| 30 |
-
|
| 31 |
-
Core modules for Stack 2.9 AI assistant:
|
| 32 |
-
|
| 33 |
-
- **src/voice/** - Voice integration (recording, synthesis, cloning)
|
| 34 |
-
- **src/llm/** - Multi-provider LLM client (OpenAI, Anthropic, Ollama)
|
| 35 |
-
- **src/mcp/** - Model Context Protocol client
|
| 36 |
-
- **src/indexing/** - Code indexing for semantic search (RAG)
|
| 37 |
-
- **src/tools/** - Tool implementations
|
| 38 |
-
- **src/agent/** - Agent logic
|
| 39 |
-
- **src/providers/** - Provider integrations
|
| 40 |
-
|
| 41 |
-
### `docs/` - Documentation
|
| 42 |
-
|
| 43 |
-
- ARCHITECTURE.md - System architecture
|
| 44 |
-
- SETUP.md - Setup instructions
|
| 45 |
-
- API.md - API documentation
|
| 46 |
-
- TOOLS.md - Tool reference
|
| 47 |
-
- BENCHMARKS.md - Performance benchmarks
|
| 48 |
-
- guides/ - Usage guides
|
| 49 |
-
|
| 50 |
-
### `training-data/` - Training Datasets
|
| 51 |
-
|
| 52 |
-
- training-data/tools/catalog.json - Tool schemas (46 tools)
|
| 53 |
-
- training-data/synthetic/ - Synthetic training examples
|
| 54 |
-
- training-data/code-pairs/ - Code-comment pairs
|
| 55 |
-
- training-data/src-derived/ - RTMP-extracted examples
|
| 56 |
-
- training-data/final/ - Final merged datasets
|
| 57 |
-
|
| 58 |
-
### `scripts/` - Utility Scripts
|
| 59 |
-
|
| 60 |
-
- scripts/extract_rtmp_tools.ts - Extract tool schemas from RTMP
|
| 61 |
-
- scripts/generate_from_rtmp.ts - Generate training data from RTMP
|
| 62 |
-
- scripts/combine_datasets.py - Merge training datasets
|
| 63 |
-
- scripts/download_public_datasets.py - Download public datasets
|
| 64 |
-
|
| 65 |
-
### `stack-2.9-*` - Component Directories
|
| 66 |
-
|
| 67 |
-
- **stack-2.9-training/** - Model fine-tuning code (LoRA, quantization)
|
| 68 |
-
- **stack-2.9-deploy/** - Docker and deployment configs
|
| 69 |
-
- **stack-2.9-eval/** - Human eval and benchmarks
|
| 70 |
-
- **stack-2.9-voice/** - Python FastAPI voice server
|
| 71 |
-
- **stack-2.9-docs/** - Auto-generated docs
|
| 72 |
-
|
| 73 |
-
## Configuration Files
|
| 74 |
|
|
|
|
| 75 |
| File | Purpose |
|
| 76 |
|------|---------|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
| package.json | npm dependencies |
|
| 78 |
-
|
|
| 79 |
-
|
|
| 80 |
-
|
|
| 81 |
-
| .env.example | Environment variables template |
|
| 82 |
| Makefile | Build targets |
|
|
|
|
| 83 |
|
| 84 |
-
##
|
| 85 |
-
|
| 86 |
-
-
|
| 87 |
-
-
|
| 88 |
-
-
|
| 89 |
-
-
|
| 90 |
-
-
|
| 91 |
-
|
| 92 |
-
##
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
-
|
| 97 |
-
-
|
| 98 |
-
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
-
|
| 102 |
-
-
|
| 103 |
-
|
| 104 |
-
## Getting Started
|
| 105 |
-
|
| 106 |
-
1. **Install dependencies**: `npm install && pip install -r requirements.txt`
|
| 107 |
-
2. **Configure environment**: Copy `.env.example` to `.env`
|
| 108 |
-
3. **Run voice server**: `cd stack-2.9-voice && uvicorn voice_server:app`
|
| 109 |
-
4. **Use TypeScript modules**: Import from `src/`
|
| 110 |
-
|
| 111 |
-
## Adding New Modules
|
| 112 |
-
|
| 113 |
-
New TypeScript modules should follow this structure:
|
| 114 |
-
|
| 115 |
-
```
|
| 116 |
-
src/<module-name>/
|
| 117 |
-
βββ index.ts # Main exports
|
| 118 |
-
βββ <ModuleName>.ts # Main implementation
|
| 119 |
-
βββ <ModuleName>Tool.ts # Tool implementation (if applicable)
|
| 120 |
-
```
|
|
|
|
| 1 |
# Stack 2.9 Directory Structure
|
| 2 |
|
| 3 |
+
## Quick Overview
|
|
|
|
|
|
|
| 4 |
|
| 5 |
```
|
| 6 |
stack-2.9/
|
| 7 |
+
βββ src/ # Core source code (voice, LLM, MCP, indexing)
|
| 8 |
+
βββ stack/ # Components (deploy, training, eval, voice, docs)
|
| 9 |
+
βββ data/ # Training datasets
|
| 10 |
+
βββ scripts/ # Utility scripts
|
| 11 |
+
βββ samples/ # Examples & tests
|
| 12 |
+
βββ docs/ # Documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
β
|
| 14 |
+
βββ README.md # Main docs
|
| 15 |
+
βββ LICENSE # Apache 2.0
|
| 16 |
+
βββ package.json # npm config
|
| 17 |
+
βββ pyproject.toml # Python config
|
| 18 |
+
βββ .env.example # Environment template
|
| 19 |
```
|
| 20 |
|
| 21 |
+
## Structure Details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
### Root Files (User-Facing)
|
| 24 |
| File | Purpose |
|
| 25 |
|------|---------|
|
| 26 |
+
| README.md | Main documentation |
|
| 27 |
+
| LICENSE | Apache 2.0 license |
|
| 28 |
+
| CHANGELOG.md | Version history |
|
| 29 |
+
| CONTRIBUTING.md | Contribution guide |
|
| 30 |
+
| SECURITY.md | Security policy |
|
| 31 |
+
| .env.example | Environment variables |
|
| 32 |
| package.json | npm dependencies |
|
| 33 |
+
| pyproject.toml | Python project |
|
| 34 |
+
| requirements.txt | Python deps |
|
| 35 |
+
| Dockerfile | Container config |
|
|
|
|
| 36 |
| Makefile | Build targets |
|
| 37 |
+
| colab_train_stack29.ipynb | Colab training |
|
| 38 |
|
| 39 |
+
### Core Modules (`src/`)
|
| 40 |
+
- **src/voice/** - Voice integration (recording, synthesis, cloning)
|
| 41 |
+
- **src/llm/** - Multi-provider LLM client
|
| 42 |
+
- **src/mcp/** - Model Context Protocol client
|
| 43 |
+
- **src/indexing/** - Code indexing (RAG)
|
| 44 |
+
- **src/cli/** - CLI tools
|
| 45 |
+
- **src/utils/** - Utilities
|
| 46 |
+
|
| 47 |
+
### Components (`stack/`)
|
| 48 |
+
- **stack/deploy/** - Docker & deployment configs
|
| 49 |
+
- **stack/training/** - Model fine-tuning code
|
| 50 |
+
- **stack/eval/** - Evaluation & benchmarks
|
| 51 |
+
- **stack/voice/** - Python voice API server
|
| 52 |
+
- **stack/docs/** - API documentation
|
| 53 |
+
- **stack/internal/** - Internal docs (archive)
|
| 54 |
+
|
| 55 |
+
### Data & Scripts
|
| 56 |
+
- **data/** - Training datasets
|
| 57 |
+
- **scripts/** - Build & utility scripts
|
| 58 |
+
- **samples/** - Examples & test files
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/tools.md
DELETED
|
@@ -1,206 +0,0 @@
|
|
| 1 |
-
# Stack 2.9 Tools Reference
|
| 2 |
-
|
| 3 |
-
Stack 2.9 provides **37 built-in tools** for file operations, system commands, git, web search, and more. Tools are selected automatically based on user intent, or can be called explicitly via the agent API.
|
| 4 |
-
|
| 5 |
-
## Tool Calling Format
|
| 6 |
-
|
| 7 |
-
Tools use a **function schema** format similar to OpenAI's function calling:
|
| 8 |
-
|
| 9 |
-
```python
|
| 10 |
-
{
|
| 11 |
-
"name": "tool_name",
|
| 12 |
-
"description": "What the tool does",
|
| 13 |
-
"parameters": {
|
| 14 |
-
"type": "object",
|
| 15 |
-
"properties": {
|
| 16 |
-
"param1": {"type": "string", "description": "Parameter description"},
|
| 17 |
-
"param2": {"type": "integer", "description": "Another parameter"}
|
| 18 |
-
},
|
| 19 |
-
"required": ["param1"]
|
| 20 |
-
}
|
| 21 |
-
}
|
| 22 |
-
```
|
| 23 |
-
|
| 24 |
-
The agent determines which tools to call and with what arguments based on the user query.
|
| 25 |
-
|
| 26 |
-
---
|
| 27 |
-
|
| 28 |
-
## Complete Tool List
|
| 29 |
-
|
| 30 |
-
### File Operations
|
| 31 |
-
|
| 32 |
-
| Tool | Description | Parameters |
|
| 33 |
-
|------|-------------|------------|
|
| 34 |
-
| `read` | Read file contents | `path` (string, required) |
|
| 35 |
-
| `write` | Write content to file | `path` (string, required), `content` (string, required) |
|
| 36 |
-
| `edit` | Edit file with sed-like replacements | `path` (string, required), `old_text` (string, required), `new_text` (string, required) |
|
| 37 |
-
| `create_directory` | Create a new directory | `path` (string, required) |
|
| 38 |
-
| `list_directory` | List contents of a directory | `path` (string, default: ".") |
|
| 39 |
-
| `search` | Search for files matching a pattern | `pattern` (string, required), `path` (string, default: ".") |
|
| 40 |
-
| `get_file_info` | Get file metadata (size, timestamps, permissions) | `path` (string, required) |
|
| 41 |
-
| `move_file` | Move or rename a file/directory | `source` (string, required), `destination` (string, required) |
|
| 42 |
-
| `copy_file` | Copy a file (implementation pending) | `source` (string, required), `destination` (string, required) |
|
| 43 |
-
| `delete_file` | Delete a file | `path` (string, required) |
|
| 44 |
-
|
| 45 |
-
### Git Operations
|
| 46 |
-
|
| 47 |
-
| Tool | Description | Parameters |
|
| 48 |
-
|------|-------------|------------|
|
| 49 |
-
| `git_status` | Get git repository status | (no parameters) |
|
| 50 |
-
| `git_log` | View commit history | `max_count` (integer, default: 10), `path` (string, optional) |
|
| 51 |
-
| `git_diff` | Show changes between commits or working tree | `commit` (string, optional), `path` (string, optional) |
|
| 52 |
-
| `git_commit` | Commit staged changes | `message` (string, required), `all` (boolean, default: false) |
|
| 53 |
-
| `git_add` | Stage files for commit | `paths` (array of strings, required) |
|
| 54 |
-
| `git_push` | Push commits to remote | `remote` (string, default: "origin"), `branch` (string, optional) |
|
| 55 |
-
| `git_pull` | Pull from remote | `remote` (string, default: "origin"), `branch` (string, optional) |
|
| 56 |
-
| `git_branch` | List or create branches | `create` (string, optional), `delete` (string, optional), `checkout` (string, optional) |
|
| 57 |
-
| `git_clone` | Clone a repository | `url` (string, required), `path` (string, optional) |
|
| 58 |
-
| `git_remote` | Manage remotes | `action` (string, required: "add|remove|list"), `name` (string), `url` (string) |
|
| 59 |
-
|
| 60 |
-
### Shell & Execution
|
| 61 |
-
|
| 62 |
-
| Tool | Description | Parameters |
|
| 63 |
-
|------|-------------|------------|
|
| 64 |
-
| `run` | Execute shell command | `command` (string, required), `timeout` (integer, default: 30), `cwd` (string, optional) |
|
| 65 |
-
| `run_background` | Run command in background | `command` (string, required), `yield_ms` (integer, default: 10000) |
|
| 66 |
-
| `test` | Run tests (pytest, unittest) | `path` (string, default: "."), `pattern` (string, default: "test_*.py") |
|
| 67 |
-
| `lint` | Lint code (flake8, pylint, eslint) | `path` (string, default: "."), `tool` (string, default: "auto") |
|
| 68 |
-
| `format` | Format code (black, prettier, gofmt) | `path` (string, default: "."), `tool` (string, default: "auto") |
|
| 69 |
-
|
| 70 |
-
### Web & Search
|
| 71 |
-
|
| 72 |
-
| Tool | Description | Parameters |
|
| 73 |
-
|------|-------------|------------|
|
| 74 |
-
| `web_search` | Search the web via Brave | `query` (string, required), `count` (integer, default: 10) |
|
| 75 |
-
| `fetch` | Fetch and extract content from URL | `url` (string, required), `max_chars` (integer, default: 5000) |
|
| 76 |
-
| `download` | Download a file | `url` (string, required), `output_path` (string, required) |
|
| 77 |
-
|
| 78 |
-
### Memory & Knowledge
|
| 79 |
-
|
| 80 |
-
| Tool | Description | Parameters |
|
| 81 |
-
|------|-------------|------------|
|
| 82 |
-
| `memory_recall` | Search memory for relevant entries | `query` (string, required), `limit` (integer, default: 10) |
|
| 83 |
-
| `memory_save` | Store observation in memory | `content` (string, required), `entity` (string, optional) |
|
| 84 |
-
| `memory_list` | List all memory entities | (no parameters) |
|
| 85 |
-
| `context_load` | Load conversation context | `session_id` (string, optional) |
|
| 86 |
-
| `context_save` | Save conversation context | `session_id` (string, optional) |
|
| 87 |
-
|
| 88 |
-
### Project Management
|
| 89 |
-
|
| 90 |
-
| Tool | Description | Parameters |
|
| 91 |
-
|------|-------------|------------|
|
| 92 |
-
| `create_task` | Create a new task | `title` (string, required), `description` (string, optional), `priority` (string: low/medium/high) |
|
| 93 |
-
| `list_tasks` | List tasks | `status` (string: pending|done|all, default: "pending") |
|
| 94 |
-
| `update_task` | Update task status or details | `task_id` (string, required), `status` (string, optional), `title` (string, optional), `description` (string, optional) |
|
| 95 |
-
| `project_scan` | Scan project structure and dependencies | (no parameters) |
|
| 96 |
-
|
| 97 |
-
### System & Utilities
|
| 98 |
-
|
| 99 |
-
| Tool | Description | Parameters |
|
| 100 |
-
|------|-------------|------------|
|
| 101 |
-
| `get_system_info` | Get OS, CPU, memory, disk info | (no parameters) |
|
| 102 |
-
| `list_processes` | List running processes | `filter` (string, optional) |
|
| 103 |
-
| `kill_process` | Terminate a process | `pid` (integer, required) |
|
| 104 |
-
| `environment` | Get environment variables | `names` (array of strings, optional) |
|
| 105 |
-
| `set_environment` | Set environment variable (current session) | `name` (string, required), `value` (string, required) |
|
| 106 |
-
| `whoami` | Get current user | (no parameters) |
|
| 107 |
-
| `pwd` | Print working directory | (no parameters) |
|
| 108 |
-
|
| 109 |
-
### Data & Serialization
|
| 110 |
-
|
| 111 |
-
| Tool | Description | Parameters |
|
| 112 |
-
|------|-------------|------------|
|
| 113 |
-
| `json_parse` | Parse JSON string to dict | `json_string` (string, required) |
|
| 114 |
-
| `json_format` | Format dict/object to pretty JSON | `data` (object, required), `indent` (integer, default: 2) |
|
| 115 |
-
| `yaml_parse` | Parse YAML to dict | `yaml_string` (string, required) |
|
| 116 |
-
| `yaml_format` | Format dict to YAML | `data` (object, required) |
|
| 117 |
-
| `csv_parse` | Parse CSV to list of dicts | `csv_string` (string, required), `delimiter` (string, default: ",") |
|
| 118 |
-
| `csv_format` | Format list of dicts to CSV | `data` (array, required), `columns` (array, optional) |
|
| 119 |
-
|
| 120 |
-
### Time & Scheduling
|
| 121 |
-
|
| 122 |
-
| Tool | Description | Parameters |
|
| 123 |
-
|------|-------------|------------|
|
| 124 |
-
| `current_time` | Get current date/time | `timezone` (string, optional) |
|
| 125 |
-
| `sleep` | Sleep for N seconds | `seconds` (integer, required) |
|
| 126 |
-
| `schedule` | Schedule a future task (requires background runner) | `delay_seconds` (integer, required), `action` (string, required), `params` (object, optional) |
|
| 127 |
-
|
| 128 |
-
### Image & Media
|
| 129 |
-
|
| 130 |
-
| Tool | Description | Parameters |
|
| 131 |
-
|------|-------------|------------|
|
| 132 |
-
| `image_info` | Get image metadata (dimensions, format, size) | `path` (string, required) |
|
| 133 |
-
| `image_resize` | Resize an image | `path` (string, required), `width` (integer), `height` (integer), `output_path` (string, required) |
|
| 134 |
-
| `image_convert` | Convert image format | `path` (string, required), `format` (string: png|jpg|webp|gif), `output_path` (string, required) |
|
| 135 |
-
| `generate_image` | Generate image from text (requires image generation model) | `prompt` (string, required), `size` (string: 1024x1024), `output_path` (string) |
|
| 136 |
-
|
| 137 |
-
---
|
| 138 |
-
|
| 139 |
-
## Return Format
|
| 140 |
-
|
| 141 |
-
All tools return a JSON-serializable dict with at least:
|
| 142 |
-
|
| 143 |
-
```json
|
| 144 |
-
{
|
| 145 |
-
"success": true|false,
|
| 146 |
-
"result": <tool-specific result data>,
|
| 147 |
-
"error": <error message if failed>
|
| 148 |
-
}
|
| 149 |
-
```
|
| 150 |
-
|
| 151 |
-
Example success:
|
| 152 |
-
```json
|
| 153 |
-
{
|
| 154 |
-
"success": true,
|
| 155 |
-
"result": "File content here...",
|
| 156 |
-
"error": null
|
| 157 |
-
}
|
| 158 |
-
```
|
| 159 |
-
|
| 160 |
-
Example error:
|
| 161 |
-
```json
|
| 162 |
-
{
|
| 163 |
-
"success": false,
|
| 164 |
-
"result": null,
|
| 165 |
-
"error": "File not found: /path/to/file"
|
| 166 |
-
}
|
| 167 |
-
```
|
| 168 |
-
|
| 169 |
-
---
|
| 170 |
-
|
| 171 |
-
## Schema Access
|
| 172 |
-
|
| 173 |
-
Tools can be introspected programmatically:
|
| 174 |
-
|
| 175 |
-
```python
|
| 176 |
-
from stack_cli.tools import get_tool_schemas, get_tool
|
| 177 |
-
|
| 178 |
-
# Get all tool schemas for LLM function calling
|
| 179 |
-
schemas = get_tool_schemas()
|
| 180 |
-
|
| 181 |
-
# Get a specific tool
|
| 182 |
-
read_tool = get_tool("read")
|
| 183 |
-
result = read_tool(path="/path/to/file")
|
| 184 |
-
```
|
| 185 |
-
|
| 186 |
-
---
|
| 187 |
-
|
| 188 |
-
## Extending
|
| 189 |
-
|
| 190 |
-
To add a new tool, define a function and register it in `stack_cli/tools.py`:
|
| 191 |
-
|
| 192 |
-
```python
|
| 193 |
-
def my_tool(param1: str, param2: int = 5) -> dict:
|
| 194 |
-
"""Tool description for LLM."""
|
| 195 |
-
try:
|
| 196 |
-
# Do work
|
| 197 |
-
result = do_something(param1, param2)
|
| 198 |
-
return {"success": True, "result": result}
|
| 199 |
-
except Exception as e:
|
| 200 |
-
return {"success": False, "error": str(e)}
|
| 201 |
-
|
| 202 |
-
# Register
|
| 203 |
-
register_tool("my_tool", my_tool, "Description for LLM")
|
| 204 |
-
```
|
| 205 |
-
|
| 206 |
-
The system automatically generates JSON schemas from type hints and docstrings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{tests β samples}/benchmarks/test_latency.py
RENAMED
|
File without changes
|
{tests β samples}/benchmarks/test_memory_usage.py
RENAMED
|
File without changes
|
{tests β samples}/benchmarks/test_throughput.py
RENAMED
|
File without changes
|
{tests β samples}/benchmarks/test_token_efficiency.py
RENAMED
|
File without changes
|
{tests β samples}/conftest.py
RENAMED
|
File without changes
|
{examples β samples}/demo_stack.py
RENAMED
|
File without changes
|
{examples β samples}/inference_examples.py
RENAMED
|
File without changes
|
{tests β samples}/integration/__init__.py
RENAMED
|
File without changes
|
{tests β samples}/integration/test_agent_cli.py
RENAMED
|
File without changes
|
{tests β samples}/integration/test_cli.py
RENAMED
|
File without changes
|
{tests β samples}/integration/test_self_evolution.py
RENAMED
|
File without changes
|
{tests β samples}/integration/test_tool_chains.py
RENAMED
|
File without changes
|
{tests β samples}/pytest.ini
RENAMED
|
File without changes
|
{tests β samples}/run_tests.py
RENAMED
|
File without changes
|
{tests β samples}/unit/__init__.py
RENAMED
|
File without changes
|
{tests β samples}/unit/test_agent.py
RENAMED
|
File without changes
|
{tests β samples}/unit/test_config.py
RENAMED
|
File without changes
|
{tests β samples}/unit/test_context.py
RENAMED
|
File without changes
|
{tests β samples}/unit/test_memory.py
RENAMED
|
File without changes
|
{tests β samples}/unit/test_together_client.py
RENAMED
|
File without changes
|
{tests β samples}/unit/test_tools.py
RENAMED
|
File without changes
|
{tests β samples}/unit/test_utils.py
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/.gitignore
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/Dockerfile
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/Makefile
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/README.md
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/TROUBLESHOOTING.md
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/app.py
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/config.yaml
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/deploy.sh
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/docker-compose.yaml
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/docker-compose.yml
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/kubernetes/deployment.yaml
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/kubernetes/hpa.yaml
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/kubernetes/pvc.yaml
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/kubernetes/service.yaml
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/local_deploy.sh
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/prometheus.yml
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/requirements.txt
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/runpod-template.json
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/runpod_deploy.sh
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/start.sh
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/validate.sh
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/vastai-template.json
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/vastai_deploy.sh
RENAMED
|
File without changes
|
{stack-2.9-deploy β stack/deploy}/vllm_server.py
RENAMED
|
File without changes
|
{docs β stack/docs}/archive/CONTEXT_UPDATE_SUMMARY.md
RENAMED
|
File without changes
|
{docs β stack/docs}/archive/DATA_SCALING_PLAN.md
RENAMED
|
File without changes
|