Fast onboarding path for contributors and junior devs.
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"Optional for full runtime validation:
- install/auth at least one provider CLI (
claude,codex,gemini) - set up a messaging transport:
- Telegram: bot token from @BotFather + user ID (
allowed_user_ids) - Matrix: account on any homeserver (homeserver URL, user ID, password,
allowed_users)
- Telegram: bot token from @BotFather + user ID (
- for Telegram group support, also set
allowed_group_ids
ductorFirst run starts onboarding and writes config to ~/.ductor/config/config.json.
Primary runtime files/directories:
~/.ductor/sessions.json~/.ductor/named_sessions.json~/.ductor/tasks.json~/.ductor/chat_activity.json~/.ductor/cron_jobs.json~/.ductor/webhooks.json~/.ductor/startup_state.json~/.ductor/inflight_turns.json~/.ductor/SHAREDMEMORY.md~/.ductor/agents.json~/.ductor/agents/~/.ductor/workspace/~/.ductor/logs/agent.log
pytest
ruff format .
ruff check .
mypy ductor_botExpected: zero warnings, zero errors.
Telegram / Matrix / API input
-> ingress layer (TelegramBot / MatrixBot / ApiServer)
-> orchestrator flow
-> provider CLI subprocess
-> response delivery (transport-specific)
background/async results
-> Envelope adapters
-> MessageBus
-> optional session injection
-> transport delivery (Telegram or Matrix)
Entry + command layer:
ductor_bot/__main__.pyductor_bot/cli_commands/
Runtime hot path:
ductor_bot/multiagent/supervisor.pyductor_bot/messenger/telegram/app.pyductor_bot/messenger/telegram/startup.pyductor_bot/orchestrator/core.pyductor_bot/orchestrator/lifecycle.pyductor_bot/orchestrator/flows.py
Delivery/task/session core:
ductor_bot/bus/ductor_bot/session/manager.pyductor_bot/tasks/hub.pyductor_bot/tasks/registry.py
Provider/API/workspace core:
ductor_bot/cli/service.py+ provider wrappersductor_bot/api/server.pyductor_bot/workspace/init.pyductor_bot/workspace/rules_selector.pyductor_bot/workspace/skill_sync.py
If command behavior is wrong:
ductor_bot/__main__.pyductor_bot/cli_commands/*
If Telegram routing is wrong:
ductor_bot/messenger/telegram/middleware.pyductor_bot/messenger/telegram/app.pyductor_bot/orchestrator/commands.pyductor_bot/orchestrator/flows.py
If Matrix routing is wrong:
ductor_bot/messenger/matrix/bot.pyductor_bot/messenger/matrix/transport.pyductor_bot/orchestrator/flows.py
If background results look wrong:
ductor_bot/bus/adapters.pyductor_bot/bus/bus.pyductor_bot/messenger/telegram/transport.py(orductor_bot/messenger/matrix/transport.py)
If tasks are wrong:
ductor_bot/tasks/hub.pyductor_bot/tasks/registry.pyductor_bot/multiagent/internal_api.pyductor_bot/_home_defaults/workspace/tools/task_tools/*.py
If API is wrong:
ductor_bot/api/server.pyductor_bot/orchestrator/lifecycle.py(API startup wiring)ductor_bot/files/*(allowed roots, MIME, prompt building)
/stopand/stop_allare pre-routing abort paths in middleware/bot./newresets only active provider bucket for the activeSessionKey.- session identity is transport-aware:
SessionKey(transport, chat_id, topic_id). /modelinside a topic updates only that topic session (not global config).- task tools now support permanent single-task removal via
delete_task.py(/tasks/delete). - task routing is topic-aware via
thread_idandDUCTOR_TOPIC_ID. - API auth accepts optional
channel_idfor per-channel session isolation. - startup recovery uses
inflight_turns.json+ recovered named sessions. - auth allowlists (
allowed_user_ids,allowed_group_ids) are hot-reloadable. ductor agents addis a Telegram-focused scaffold; Matrix sub-agents are supported throughagents.jsonor the bundled agent tool scripts.
Continue with docs/system_overview.md and docs/architecture.md for complete runtime detail.