P1: host-agnostic quercus-core with agent loop, providers, and tool schemas

- Core types: Rational time, EntityId, ActionBatch, PngBytes (no Pillow dep)
- Config: ~/.quercus/config.toml with 0600 perms, env var override for CI
- LLMProvider: Claude (anthropic SDK) and OpenAI-compatible endpoint
  (covers custom gateways and llama.cpp server mode); graceful degradation
  without API keys
- Tool schemas: 26 curated tools with JSON Schema and read_only flags
- AgentLoop: sync dialogue loop with confirmation gate (read-only batches
  bypass, rejected mutations are reported back to the LLM), PNG frame
  feedback for multimodal providers
- Session log: JSONL recording with frame sha256 hashes, replayable
- HostAdapter ABC (signatures only, aligned with OPP/1 method families)
- Mock LLM provider (scripted/replay/record) for network-free CI

Tests: 69 passed via uv run pytest (no network access)
This commit is contained in:
2026-08-25 02:06:10 +08:00
parent c9870b4faf
commit e0db5ab2cf
33 changed files with 3957 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
[project]
name = "quercus"
version = "0.1.0"
description = "Quercus AI 剪辑助手 — monorepo(workspace 根,虚拟包)"
requires-python = ">=3.11"
dependencies = [
"quercus-core",
]
[dependency-groups]
dev = [
"pytest>=8.0",
]
[tool.uv]
# 根目录不是可安装包,仅作 workspace 锚点
package = false
[tool.uv.sources]
quercus-core = { workspace = true }
[tool.uv.workspace]
members = ["core"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q"