Renames: - platform/ → workspace-server/ (Go module path stays as "platform" for external dep compat — will update after plugin module republish) - workspace-template/ → workspace/ Removed (moved to separate repos or deleted): - PLAN.md — internal roadmap (move to private project board) - HANDOFF.md, AGENTS.md — one-time internal session docs - .claude/ — gitignored entirely (local agent config) - infra/cloudflare-worker/ → Molecule-AI/molecule-tenant-proxy - org-templates/molecule-dev/ → standalone template repo - .mcp-eval/ → molecule-mcp-server repo - test-results/ — ephemeral, gitignored Security scrubbing: - Cloudflare account/zone/KV IDs → placeholders - Real EC2 IPs → <EC2_IP> in all docs - CF token prefix, Neon project ID, Fly app names → redacted - Langfuse dev credentials → parameterized - Personal runner username/machine name → generic Community files: - CONTRIBUTING.md — build, test, branch conventions - CODE_OF_CONDUCT.md — Contributor Covenant 2.1 All Dockerfiles, CI workflows, docker-compose, railway.toml, render.yaml, README, CLAUDE.md updated for new directory names. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.2 KiB
3.2 KiB
Workspace Runtime PyPI Package
Overview
The shared workspace runtime infrastructure lives in two places:
- Source of truth (monorepo):
workspace/— this is where all development happens - Published package:
molecule-ai-workspace-runtimeon PyPI
What's in the package
Everything in workspace/ except adapter-specific code:
molecule_runtime/— all shared.pyfiles (main.py, config.py, heartbeat.py, etc.)molecule_runtime/adapters/—BaseAdapter,AdapterConfig,SetupResult,shared_runtimemolecule_runtime/builtin_tools/— delegation, memory, approvals, sandbox, telemetrymolecule_runtime/skill_loader/— skill loading + hot-reloadmolecule_runtime/plugins_registry/— plugin discovery and install pipelinemolecule_runtime/policies/— namespace routing policies- Console script:
molecule-runtime→molecule_runtime.main:main_sync
Adapter repos
Each of the 8 adapter repos now contains:
adapter.py— runtime-specificAdapterclassrequirements.txt—molecule-ai-workspace-runtime>=0.1.0+ adapter depsDockerfile— standalone image (no longer extends workspace-template:base)
Adapter discovery (ADAPTER_MODULE)
Standalone adapter repos set ENV ADAPTER_MODULE=adapter in their Dockerfile.
The runtime's get_adapter() checks this env var first:
# In molecule_runtime/adapters/__init__.py
def get_adapter(runtime: str) -> type[BaseAdapter]:
adapter_module = os.environ.get("ADAPTER_MODULE")
if adapter_module:
mod = importlib.import_module(adapter_module)
return getattr(mod, "Adapter")
# Fall back to built-in subdirectory scan (monorepo local dev)
...
Publishing a new version
cd workspace-template
# 1. Bump version in pyproject.toml
# 2. Sync to molecule-ai-workspace-runtime repo
# 3. Tag and push — CI publishes to PyPI via PYPI_TOKEN secret
Or manually:
cd workspace-template
python -m build
python -m twine upload dist/*
Writing a new adapter
- Create a new standalone repo
molecule-ai-workspace-template-<runtime> - Copy
adapter.pypattern from any existing adapter repo - Change imports:
from molecule_runtime.adapters.base import BaseAdapter, AdapterConfig - Create
requirements.txtwithmolecule-ai-workspace-runtime>=0.1.0+ your deps - Create
DockerfilewithENV ADAPTER_MODULE=adapterandENTRYPOINT ["molecule-runtime"] - Register the runtime name in the platform's known runtimes list