mcts-agent 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcts_agent-0.1.0/.github/workflows/ci.yml +52 -0
- mcts_agent-0.1.0/.github/workflows/release.yml +82 -0
- mcts_agent-0.1.0/.gitignore +49 -0
- mcts_agent-0.1.0/CONTRIBUTING.md +92 -0
- mcts_agent-0.1.0/LICENSE +21 -0
- mcts_agent-0.1.0/PKG-INFO +415 -0
- mcts_agent-0.1.0/README.md +380 -0
- mcts_agent-0.1.0/agent/__init__.py +0 -0
- mcts_agent-0.1.0/agent/_version.py +24 -0
- mcts_agent-0.1.0/agent/cli.py +1146 -0
- mcts_agent-0.1.0/agent/config.py +231 -0
- mcts_agent-0.1.0/agent/execution.py +196 -0
- mcts_agent-0.1.0/agent/logger.py +150 -0
- mcts_agent-0.1.0/agent/mcts.py +994 -0
- mcts_agent-0.1.0/agent/node.py +116 -0
- mcts_agent-0.1.0/agent/primitives.py +428 -0
- mcts_agent-0.1.0/agent/providers.py +627 -0
- mcts_agent-0.1.0/agent/research/__init__.py +6 -0
- mcts_agent-0.1.0/agent/research/cli.py +73 -0
- mcts_agent-0.1.0/agent/research/harness.py +276 -0
- mcts_agent-0.1.0/agent/research/models.py +231 -0
- mcts_agent-0.1.0/agent/research/runner.py +254 -0
- mcts_agent-0.1.0/agent/research/storage.py +178 -0
- mcts_agent-0.1.0/agent/research/validation.py +93 -0
- mcts_agent-0.1.0/agent/system_one.py +131 -0
- mcts_agent-0.1.0/agent/updates.py +234 -0
- mcts_agent-0.1.0/agent/visualizer.html +32 -0
- mcts_agent-0.1.0/antigravity.toml +25 -0
- mcts_agent-0.1.0/docs/releasing.md +31 -0
- mcts_agent-0.1.0/docs/research-mode.md +296 -0
- mcts_agent-0.1.0/main.py +210 -0
- mcts_agent-0.1.0/mcts_agent.egg-info/PKG-INFO +415 -0
- mcts_agent-0.1.0/mcts_agent.egg-info/SOURCES.txt +51 -0
- mcts_agent-0.1.0/mcts_agent.egg-info/dependency_links.txt +1 -0
- mcts_agent-0.1.0/mcts_agent.egg-info/entry_points.txt +2 -0
- mcts_agent-0.1.0/mcts_agent.egg-info/requires.txt +16 -0
- mcts_agent-0.1.0/mcts_agent.egg-info/scm_file_list.json +46 -0
- mcts_agent-0.1.0/mcts_agent.egg-info/scm_version.json +8 -0
- mcts_agent-0.1.0/mcts_agent.egg-info/top_level.txt +1 -0
- mcts_agent-0.1.0/prompts/rubrics.txt +22 -0
- mcts_agent-0.1.0/pyproject.toml +76 -0
- mcts_agent-0.1.0/requirements.txt +10 -0
- mcts_agent-0.1.0/run_pure_mcts.py +69 -0
- mcts_agent-0.1.0/run_test.py +48 -0
- mcts_agent-0.1.0/setup.cfg +4 -0
- mcts_agent-0.1.0/tests/__init__.py +1 -0
- mcts_agent-0.1.0/tests/test_cli.py +170 -0
- mcts_agent-0.1.0/tests/test_execution.py +287 -0
- mcts_agent-0.1.0/tests/test_mcts.py +797 -0
- mcts_agent-0.1.0/tests/test_plugins.py +136 -0
- mcts_agent-0.1.0/tests/test_providers.py +173 -0
- mcts_agent-0.1.0/tests/test_research.py +416 -0
- mcts_agent-0.1.0/tests/test_updates.py +158 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test & Lint (Python ${{ matrix.python-version }})
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
env:
|
|
14
|
+
MCTS_AGENT_DISABLE_UPDATE_CHECK: "1"
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: Check out repository
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
cache: "pip"
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip
|
|
33
|
+
pip install -r requirements.txt
|
|
34
|
+
pip install -e .
|
|
35
|
+
pip install pytest
|
|
36
|
+
|
|
37
|
+
- name: Run unit tests
|
|
38
|
+
env:
|
|
39
|
+
USE_MOCK_PRIMITIVES: "true"
|
|
40
|
+
run: |
|
|
41
|
+
python -m pytest tests -v
|
|
42
|
+
|
|
43
|
+
- name: Verify CLI Mock Run
|
|
44
|
+
env:
|
|
45
|
+
USE_MOCK_PRIMITIVES: "true"
|
|
46
|
+
run: |
|
|
47
|
+
python main.py --mock --max-steps 1 --iterations 2
|
|
48
|
+
|
|
49
|
+
- name: Verify research CLI offline
|
|
50
|
+
run: |
|
|
51
|
+
mcts_research_workspace=$(mktemp -d)
|
|
52
|
+
mcts-agent research --query "Investigate a test question" --workspace "$mcts_research_workspace" --mock --max-steps 1 --json
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test-and-build:
|
|
13
|
+
name: Test and build distributions
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
env:
|
|
16
|
+
MCTS_AGENT_DISABLE_UPDATE_CHECK: "1"
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
- uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.12"
|
|
24
|
+
cache: pip
|
|
25
|
+
- name: Install project and test dependencies
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
python -m pip install -e ".[dev]"
|
|
29
|
+
- name: Run tests
|
|
30
|
+
env:
|
|
31
|
+
USE_MOCK_PRIMITIVES: "true"
|
|
32
|
+
run: python -m pytest tests -v
|
|
33
|
+
- name: Verify tag and package version match
|
|
34
|
+
run: |
|
|
35
|
+
TAG_VERSION="${GITHUB_REF_NAME#v}"
|
|
36
|
+
PACKAGE_VERSION="$(python -c 'from importlib.metadata import version; print(version("mcts-agent"))')"
|
|
37
|
+
test "$TAG_VERSION" = "$PACKAGE_VERSION"
|
|
38
|
+
- name: Build wheel and source distribution
|
|
39
|
+
run: |
|
|
40
|
+
python -m pip install build
|
|
41
|
+
python -m build
|
|
42
|
+
- uses: actions/upload-artifact@v4
|
|
43
|
+
with:
|
|
44
|
+
name: python-distributions
|
|
45
|
+
path: dist/*
|
|
46
|
+
if-no-files-found: error
|
|
47
|
+
|
|
48
|
+
github-release:
|
|
49
|
+
name: Create GitHub Release
|
|
50
|
+
needs: test-and-build
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
permissions:
|
|
53
|
+
contents: write
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/download-artifact@v4
|
|
56
|
+
with:
|
|
57
|
+
name: python-distributions
|
|
58
|
+
path: dist
|
|
59
|
+
- uses: softprops/action-gh-release@v2
|
|
60
|
+
with:
|
|
61
|
+
tag_name: ${{ github.ref_name }}
|
|
62
|
+
generate_release_notes: true
|
|
63
|
+
files: dist/*
|
|
64
|
+
|
|
65
|
+
publish-pypi:
|
|
66
|
+
name: Publish to PyPI
|
|
67
|
+
needs: github-release
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
environment:
|
|
70
|
+
name: pypi
|
|
71
|
+
url: https://pypi.org/p/mcts-agent
|
|
72
|
+
permissions:
|
|
73
|
+
id-token: write
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/download-artifact@v4
|
|
76
|
+
with:
|
|
77
|
+
name: python-distributions
|
|
78
|
+
path: dist
|
|
79
|
+
- name: Publish distributions to PyPI
|
|
80
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
81
|
+
with:
|
|
82
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Virtual environments
|
|
7
|
+
.venv
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
ENV/
|
|
11
|
+
env/
|
|
12
|
+
env.bak/
|
|
13
|
+
venv.bak/
|
|
14
|
+
|
|
15
|
+
# Environment variables & secrets
|
|
16
|
+
.env
|
|
17
|
+
.env.*
|
|
18
|
+
!.env.example
|
|
19
|
+
|
|
20
|
+
# Distribution / packaging
|
|
21
|
+
dist/
|
|
22
|
+
build/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
*.egg
|
|
25
|
+
agent/_version.py
|
|
26
|
+
|
|
27
|
+
# Testing & linting caches
|
|
28
|
+
.pytest_cache/
|
|
29
|
+
.coverage
|
|
30
|
+
htmlcov/
|
|
31
|
+
.mypy_cache/
|
|
32
|
+
.ruff_cache/
|
|
33
|
+
|
|
34
|
+
# IDE / Editor files
|
|
35
|
+
.vscode/
|
|
36
|
+
.idea/
|
|
37
|
+
*.swp
|
|
38
|
+
*.swo
|
|
39
|
+
*~
|
|
40
|
+
|
|
41
|
+
# Operating system files
|
|
42
|
+
.DS_Store
|
|
43
|
+
Thumbs.db
|
|
44
|
+
|
|
45
|
+
# Workspace / runtime scratch
|
|
46
|
+
scratch/
|
|
47
|
+
logs/
|
|
48
|
+
.mcts-research/
|
|
49
|
+
mock-observation-*.txt
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Contributing to MCTS-Agent
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to **MCTS-Agent**! We welcome bug reports, feature suggestions, documentation enhancements, and code contributions.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Code of Conduct
|
|
8
|
+
|
|
9
|
+
Please be respectful, collaborative, and constructive when engaging in this project. Treat fellow contributors with kindness.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Development Setup
|
|
14
|
+
|
|
15
|
+
### 1. Clone the Repository
|
|
16
|
+
```bash
|
|
17
|
+
git clone https://github.com/<your-username>/mcts-agent.git
|
|
18
|
+
cd mcts-agent
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Create and Activate a Virtual Environment
|
|
22
|
+
```bash
|
|
23
|
+
python3 -m venv .venv
|
|
24
|
+
source .venv/bin/activate
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 3. Install Dependencies
|
|
28
|
+
```bash
|
|
29
|
+
pip install --upgrade pip
|
|
30
|
+
pip install -r requirements.txt
|
|
31
|
+
pip install -e ".[dev]"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Running Tests
|
|
37
|
+
|
|
38
|
+
Tests run using Python's standard `unittest` framework or `pytest` with mock primitives enabled by default (`USE_MOCK_PRIMITIVES=true`):
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Run via unittest
|
|
42
|
+
python3 -m unittest discover tests
|
|
43
|
+
|
|
44
|
+
# Or run via pytest
|
|
45
|
+
pytest -v
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
All test cases in `tests/` execute hermetically and require no external API keys.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Running the Agent Locally
|
|
53
|
+
|
|
54
|
+
### Mock Mode (Zero API Keys)
|
|
55
|
+
Verify that the full search and execution loop functions:
|
|
56
|
+
```bash
|
|
57
|
+
python3 main.py --mock
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Pure MCTS Tree Search
|
|
61
|
+
To run tree search with deep iterations:
|
|
62
|
+
```bash
|
|
63
|
+
python3 run_pure_mcts.py 10
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Live Mode
|
|
67
|
+
Set your environment variables in `.env`:
|
|
68
|
+
```bash
|
|
69
|
+
TYPESAFE_API_KEY=your_typesafe_api_key
|
|
70
|
+
```
|
|
71
|
+
And ensure your Gemini environment (or `agy` CLI) is available:
|
|
72
|
+
```bash
|
|
73
|
+
python3 main.py
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Pull Request Guidelines
|
|
79
|
+
|
|
80
|
+
1. **Create a branch**: Use a descriptive branch name (e.g. `feature/parallel-eval` or `fix/puct-fpu-calc`).
|
|
81
|
+
2. **Follow style guidelines**:
|
|
82
|
+
- Write clean, type-annotated Python (`typing` / Python 3.10+ annotations).
|
|
83
|
+
- Maintain docstrings for modules, classes, and public functions.
|
|
84
|
+
3. **Add tests**: Any new feature or bug fix must include tests in `tests/`.
|
|
85
|
+
4. **Ensure clean CI**: Verify that all tests pass locally before opening a pull request.
|
|
86
|
+
5. **Write clear commit messages**: Describe the *what* and *why* of the change.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Questions & Discussions
|
|
91
|
+
|
|
92
|
+
Feel free to open an Issue on GitHub for any architecture questions, bug reports, or feature proposals.
|
mcts_agent-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MCTS-Agent Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|