refactor: move RuntimeState to state/, add async checkpoint with provider pattern

- Move runtime_state.py to state/runtime.py
- Add acheckpoint async method using aiofiles
- Introduce BaseProvider protocol and JsonProvider for pluggable storage
- Add aiofiles dependency to crewai package
- Use PrivateAttr for provider on RootModel
This commit is contained in:
Greyson LaLonde
2026-04-03 21:29:27 +08:00
parent 1ed6646eae
commit de9300705d
10 changed files with 175 additions and 23 deletions

2
uv.lock generated
View File

@@ -1138,6 +1138,7 @@ wheels = [
name = "crewai"
source = { editable = "lib/crewai" }
dependencies = [
{ name = "aiofiles" },
{ name = "aiosqlite" },
{ name = "appdirs" },
{ name = "chromadb" },
@@ -1234,6 +1235,7 @@ requires-dist = [
{ name = "a2a-sdk", marker = "extra == 'a2a'", specifier = "~=0.3.10" },
{ name = "aiobotocore", marker = "extra == 'aws'", specifier = "~=2.25.2" },
{ name = "aiocache", extras = ["memcached", "redis"], marker = "extra == 'a2a'", specifier = "~=0.12.3" },
{ name = "aiofiles", specifier = "~=24.1.0" },
{ name = "aiosqlite", specifier = "~=0.21.0" },
{ name = "anthropic", marker = "extra == 'anthropic'", specifier = "~=0.73.0" },
{ name = "appdirs", specifier = "~=1.4.4" },