diff --git a/.gitignore b/.gitignore index b7faf40..cb423c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,207 +1,24 @@ -# Byte-compiled / optimized / DLL files +# Python __pycache__/ -*.py[codz] +*.py[cod] *$py.class - -# C extensions *.so - -# Distribution / packaging .Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py.cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# UV -# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -#uv.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock -#poetry.toml - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python. -# https://pdm-project.org/en/latest/usage/project/#working-with-version-control -#pdm.lock -#pdm.toml -.pdm-python -.pdm-build/ - -# pixi -# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control. -#pixi.lock -# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one -# in the .venv directory. It is recommended not to include this directory in version control. -.pixi - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.envrc -.venv env/ venv/ +.venv/ ENV/ -env.bak/ -venv.bak/ -# Spyder project settings -.spyderproject -.spyproject +# Secrets & config +agentserver/config/organism_identity/private.pem +agentserver/config/*.signed.xml -# Rope project settings -.ropeproject +# IDE +.idea/ +.vscode/ +*.swp +*.swo -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ - -# Abstra -# Abstra is an AI-powered process automation framework. -# Ignore directories containing user credentials, local state, and settings. -# Learn more at https://abstra.io/docs -.abstra/ - -# Visual Studio Code -# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore -# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore -# and can be added to the global gitignore or merged into this file. However, if you prefer, -# you could uncomment the following to ignore the entire vscode folder -# .vscode/ - -# Ruff stuff: -.ruff_cache/ - -# PyPI configuration file -.pypirc - -# Cursor -# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to -# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data -# refer to https://docs.cursor.com/context/ignore-files -.cursorignore -.cursorindexingignore - -# Marimo -marimo/_static/ -marimo/_lsp/ -__marimo__/ +# OS +Thumbs.db +.DS_Store diff --git a/agentserver/__init__.py b/agentserver/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/agents/__init__.py b/agentserver/agents/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/agents/base.py b/agentserver/agents/base.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/agents/examples/__init__.py b/agentserver/agents/examples/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/agents/examples/echo_chamber.py b/agentserver/agents/examples/echo_chamber.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/agentserver.py b/agentserver/agentserver.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/auth/__init__.py b/agentserver/auth/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/auth/totp.py b/agentserver/auth/totp.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/config/__init__.py b/agentserver/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/config/organism_identity/README.txt b/agentserver/config/organism_identity/README.txt new file mode 100644 index 0000000..ba7b31f --- /dev/null +++ b/agentserver/config/organism_identity/README.txt @@ -0,0 +1,2 @@ +Place your permanent Ed25519 private.pem and public.pem here. +Private key must be tightly guarded - never commit it. \ No newline at end of file diff --git a/agentserver/llm_connection.py b/agentserver/llm_connection.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/main.py b/agentserver/main.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/message_bus.py b/agentserver/message_bus.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/privileged/__init__.py b/agentserver/privileged/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/privileged/commands.py b/agentserver/privileged/commands.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/utils/__init__.py b/agentserver/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/utils/logging_setup.py b/agentserver/utils/logging_setup.py new file mode 100644 index 0000000..e69de29 diff --git a/agentserver/utils/xml_tools.py b/agentserver/utils/xml_tools.py new file mode 100644 index 0000000..e69de29 diff --git a/scripts/generate_organism_key.py b/scripts/generate_organism_key.py new file mode 100644 index 0000000..f478b64 --- /dev/null +++ b/scripts/generate_organism_key.py @@ -0,0 +1,2 @@ +# One-time tool to generate the permanent Ed25519 organism identity +# Run once, store private key offline/safely \ No newline at end of file diff --git a/setup-project.ps1 b/setup-project.ps1 new file mode 100644 index 0000000..3e52c7d --- /dev/null +++ b/setup-project.ps1 @@ -0,0 +1,93 @@ +# setup-project.ps1 +# Run this from the root of your AgentServer repo to create the full directory structure + +Write-Host "Creating AgentServer project structure..." -ForegroundColor Green + +# Main package and core files +New-Item -ItemType Directory -Force -Path "agentserver" | Out-Null +New-Item -ItemType File -Force -Path "agentserver\__init__.py" +New-Item -ItemType File -Force -Path "agentserver\main.py" +New-Item -ItemType File -Force -Path "agentserver\agentserver.py" +New-Item -ItemType File -Force -Path "agentserver\message_bus.py" +New-Item -ItemType File -Force -Path "agentserver\llm_connection.py" + +# Privileged commands +New-Item -ItemType Directory -Force -Path "agentserver\privileged" | Out-Null +New-Item -ItemType File -Force -Path "agentserver\privileged\__init__.py" +New-Item -ItemType File -Force -Path "agentserver\privileged\commands.py" + +# Authentication +New-Item -ItemType Directory -Force -Path "agentserver\auth" | Out-Null +New-Item -ItemType File -Force -Path "agentserver\auth\__init__.py" +New-Item -ItemType File -Force -Path "agentserver\auth\totp.py" + +# Agents +New-Item -ItemType Directory -Force -Path "agentserver\agents" | Out-Null +New-Item -ItemType File -Force -Path "agentserver\agents\__init__.py" +New-Item -ItemType File -Force -Path "agentserver\agents\base.py" + +New-Item -ItemType Directory -Force -Path "agentserver\agents\examples" | Out-Null +New-Item -ItemType File -Force -Path "agentserver\agents\examples\__init__.py" +New-Item -ItemType File -Force -Path "agentserver\agents\examples\echo_chamber.py" + +# Config +New-Item -ItemType Directory -Force -Path "agentserver\config" | Out-Null +New-Item -ItemType File -Force -Path "agentserver\config\__init__.py" + +New-Item -ItemType Directory -Force -Path "agentserver\config\organism_identity" | Out-Null +New-Item -ItemType File -Force -Path "agentserver\config\organism_identity\README.txt" -Value "Place your permanent Ed25519 private.pem and public.pem here.`nPrivate key must be tightly guarded - never commit it." + +New-Item -ItemType File -Force -Path "agentserver\config\initial_config.signed.xml" -Value "" + +# Utils +New-Item -ItemType Directory -Force -Path "agentserver\utils" | Out-Null +New-Item -ItemType File -Force -Path "agentserver\utils\__init__.py" +New-Item -ItemType File -Force -Path "agentserver\utils\xml_tools.py" +New-Item -ItemType File -Force -Path "agentserver\utils\logging_setup.py" + +# Top-level supporting folders +New-Item -ItemType Directory -Force -Path "tests" | Out-Null +New-Item -ItemType File -Force -Path "tests\__init__.py" + +New-Item -ItemType Directory -Force -Path "scripts" | Out-Null +New-Item -ItemType File -Force -Path "scripts\generate_organism_key.py" -Value "# One-time tool to generate the permanent Ed25519 organism identity`n# Run once, store private key offline/safely" + +# .gitignore +$gitignoreContent = @' +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +env/ +venv/ +.venv/ +ENV/ + +# Secrets & config +agentserver/config/organism_identity/private.pem +agentserver/config/*.signed.xml + +# IDE +.idea/ +.vscode/ +*.swp +*.swo + +# OS +Thumbs.db +.DS_Store +'@ + +Set-Content -Path ".gitignore" -Value $gitignoreContent + +Write-Host "Directory structure created successfully!" -ForegroundColor Green +Write-Host "" +Write-Host "Next steps:" -ForegroundColor Cyan +Write-Host "1. git add ." +Write-Host "2. git commit -m 'chore: initial project skeleton with modular structure'" +Write-Host "3. git push" +Write-Host "4. In PyCharm: right-click 'agentserver' folder -> Mark Directory as -> Sources Root" +Write-Host "" +Write-Host "The organism now has its full skeletal system. Ready to breathe." diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29