Demiurge 0.4.0
Demiurge 是 alpha / developer-preview 软件。APIs、runtime layout 和 authoring contracts 之后仍可能变化。
概述
这个版本新增了一个 host-owned background job runtime,用于处理长时间运行的 terminal commands、spawn 出来的 child agents,以及后台 evolution runs。同时也扩展了 package system,加入了 repository-backed packages、provider-owned STT 和 web search packages, 以及更易用的 package wizard。
用户可见变化
- 新增一个内存中的
JobRuntime用于 background work,提供共享 job ids、status、 summaries、log tails、cancellation、write-scope conflict checks 和 completion events。 - 新增
jobtool,用于list、poll、log、wait和cancel。 terminal(background=true)现在会返回job_id;process_id仍然保留作为 terminal jobs 的 compatibility alias。- Background jobs 默认
notify_on_complete=true。已 完成的 jobs 会在原始 session 中排队 一个 synthetic model turn;user input 优先,待处理的 completion summaries 会合并进该 user turn。 ctx.agents.spawn(...)现在会创建一个agentbackend background job,而不再维护单 独的 runner-owned background state。evolve_core(background=true)现在会创建一个evolvebackend job,产出 candidate 和 report,但不会自动 promote 或切换 active core。- 新增 package repository support,并改进了 package install flow。
- 重新设计了 package wizard 输出,包括更清晰的 table rendering。
- 新增 provider-owned speech-to-text packages。
- 新增 provider-owned web search packages。
- 新增 schedule management tooling 和显式默认 schedule fields。
- 新增 candidate-core evolver runs 和 manifest checks。
- 重新构建并重组了 public manual,包括中文 manual pages。
修复
- 防止 background completion turns 在 TUI、text 和 Telegram channels 中与 user turns 并发 运行。
- 保持
/stop只作为 foreground-turn cancellation;background jobs 只有在通过job显式取消时才会继续停止。 - 保持 terminal background log retrieval 默认是有界的,同时通过
job(action="log")仍可读取完整的内存日志。 - 让 release checks 与当前的 GitHub Actions release workflow 对齐,包括 website build 和 release-note publication checks。
破坏性变更
- 后台 terminal execution 现在由
JobRuntimejob ids 表示。process_id仍然会为了 terminal compatibility 返回,process也仍然是 terminal-job compatibility view, 但job才是后台工作的 owning control API。 - 后台
evolve_core不再自动 promote。它只会创建 candidate 和 report;promotion 或 active-core switching 必须通过后续正常的 host-owned action 完成。
已知限制
- background jobs、logs 和 pending completion events 只存在于内存中,host process 退出后 会丢失。
blocked_needs_userjobs 会通知用户,并需要后续用户操作;它们不会自动批准危险动作。- code slots 默认运行在 host-shared Python environment 中。
- candidate Agent Core evolution 不能自动添加 dependencies。
- external gateway channels 默认禁用,需要显式的认证相关环境变量或 token。
- Telegram 仍然只是 long-polling。
- package repositories 可以是 local、built-in 或显式 trusted 的 Git/path sources;安装时 的信任仍然由 host 负责。
- Provider profile tests 只有在显式调用时才会进行 live network calls。
- GitHub Releases 目前不会默认附加 wheel 或 sdist artifacts;alpha release 请使用 source checkout 或 managed checkout install path。
验证
uv run python -m compileall demiurge testsuv run pytest -vv --durations=20 -o faulthandler_timeout=60uv run demiurge --helpuv run demiurge init --help(cd ui-tui && npm ci && npm run typecheck && npm test -- --run && npm run build)cmp ui-tui/dist/entry.js demiurge/ui/tui_dist/entry.js(cd website && npm ci && npm run build)git diff --check -- ':!demiurge/ui/tui_dist/entry.js'uv run python -c 'import tomllib, demiurge; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"]); print(demiurge.__version__)'rg -n "0\\.4\\.0|docs/releases/0\\.4\\.0" pyproject.toml demiurge/__init__.py uv.lock README.md README.zh-CN.md docs website