reactifact 0.21.0__tar.gz → 0.22.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {reactifact-0.21.0/reactifact.egg-info → reactifact-0.22.0}/PKG-INFO +33 -2
- {reactifact-0.21.0 → reactifact-0.22.0}/README.md +31 -1
- {reactifact-0.21.0 → reactifact-0.22.0}/pyproject.toml +22 -3
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/__init__.py +22 -4
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/a2a/remote.py +1 -1
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/agents.py +29 -1
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/artifacts.py +20 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/branching/__init__.py +2 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/branching/ops.py +38 -5
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/chat.py +37 -15
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cli/__init__.py +37 -14
- reactifact-0.22.0/reactifact/cli/doctor.py +159 -0
- reactifact-0.22.0/reactifact/cli/graph.py +48 -0
- reactifact-0.22.0/reactifact/cli/new.py +97 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cli/replay.py +14 -2
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/commit.py +31 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/context/context.py +110 -19
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/context/pending.py +18 -5
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/effects.py +45 -11
- reactifact-0.22.0/reactifact/experiments.py +240 -0
- reactifact-0.22.0/reactifact/interrupt.py +143 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/operations.py +8 -1
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/patches.py +27 -4
- reactifact-0.22.0/reactifact/policy.py +65 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/produce.py +2 -1
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/__init__.py +25 -0
- reactifact-0.22.0/reactifact/recipes/map_reduce.py +262 -0
- reactifact-0.22.0/reactifact/recipes/memory_store.py +448 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/supervisor.py +1 -1
- reactifact-0.22.0/reactifact/recipes/swarm.py +186 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/replay.py +107 -1
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/resources.py +10 -0
- reactifact-0.22.0/reactifact/runtime/events.py +196 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/runtime/patch.py +44 -1
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/runtime/runtime.py +344 -48
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/session.py +60 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/step/core.py +13 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/step/decorator.py +2 -0
- reactifact-0.22.0/reactifact/streaming.py +352 -0
- reactifact-0.22.0/reactifact/subflow.py +142 -0
- reactifact-0.22.0/reactifact/templates/__init__.py +0 -0
- reactifact-0.22.0/reactifact/templates/daemon/.env.example +32 -0
- reactifact-0.22.0/reactifact/templates/daemon/.gitignore +7 -0
- reactifact-0.22.0/reactifact/templates/daemon/Dockerfile +12 -0
- reactifact-0.22.0/reactifact/templates/daemon/README.md +47 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/__init__.py +0 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/config.py +96 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/llm.py +64 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/llm_presets.py +63 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/main.py +55 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/models.py +22 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/monitor.py +53 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/prompts.py +10 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/resources.py +19 -0
- reactifact-0.22.0/reactifact/templates/daemon/app/runner.py +46 -0
- reactifact-0.22.0/reactifact/templates/daemon/pyproject.toml +40 -0
- reactifact-0.22.0/reactifact/templates/daemon/tests/__init__.py +0 -0
- reactifact-0.22.0/reactifact/templates/daemon/tests/test_daemon.py +41 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/.env.example +60 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/.gitignore +7 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/Dockerfile +14 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/README.md +120 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/__init__.py +0 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/agent/__init__.py +0 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/agent/pipeline.py +83 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/agent/prompts.py +14 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/agent/resources.py +29 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/agent/steps/__init__.py +3 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/agent/steps/answer.py +35 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/api/__init__.py +0 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/api/deps.py +21 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/api/routes/__init__.py +0 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/api/routes/chat.py +86 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/authz.py +28 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/bootstrap.py +88 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/config.py +135 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/llm.py +60 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/llm_presets.py +63 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/main.py +71 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/models.py +33 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/app/security.py +74 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/pyproject.toml +48 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/tests/__init__.py +0 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/tests/conftest.py +32 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/tests/test_auth_sessions.py +36 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/tests/test_chat_sse.py +52 -0
- reactifact-0.22.0/reactifact/templates/fastapi_chat/tests/test_settings.py +75 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tools/base.py +103 -24
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tools/use/hitl.py +8 -15
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/_shared.py +3 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/models.py +7 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/postgres.py +48 -20
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/store.py +49 -20
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/tracer.py +278 -11
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/web.py +6 -1
- reactifact-0.22.0/reactifact/validate.py +273 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/viz.py +29 -25
- {reactifact-0.21.0 → reactifact-0.22.0/reactifact.egg-info}/PKG-INFO +33 -2
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact.egg-info/SOURCES.txt +72 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact.egg-info/requires.txt +1 -0
- reactifact-0.22.0/tests/test_agent_policy.py +312 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_audit.py +3 -3
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_branching.py +25 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_chat_web.py +39 -7
- reactifact-0.22.0/tests/test_checkpoints.py +163 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_cli.py +33 -0
- reactifact-0.22.0/tests/test_cli_doctor.py +72 -0
- reactifact-0.22.0/tests/test_cli_new.py +37 -0
- reactifact-0.22.0/tests/test_code_review.py +38 -0
- reactifact-0.22.0/tests/test_conflict.py +92 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_determinism.py +4 -4
- reactifact-0.22.0/tests/test_devops_auth.py +194 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_devops_web.py +66 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_effects.py +50 -0
- reactifact-0.22.0/tests/test_experiments.py +143 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_friendly_api.py +2 -2
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_golden.py +2 -2
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_hitl.py +73 -1
- reactifact-0.22.0/tests/test_map_reduce.py +116 -0
- reactifact-0.22.0/tests/test_memory_store.py +262 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_produce_styles.py +7 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_produce_trigger.py +2 -3
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_public_api.py +24 -3
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_quick.py +3 -3
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_reacts_to.py +2 -3
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_redaction.py +2 -2
- reactifact-0.22.0/tests/test_replay_tools.py +226 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_request.py +29 -4
- reactifact-0.22.0/tests/test_stream_events.py +200 -0
- reactifact-0.22.0/tests/test_subflow.py +213 -0
- reactifact-0.22.0/tests/test_swarm.py +170 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_testing_lab.py +2 -2
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_testing_mock.py +2 -2
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_tools.py +1 -1
- reactifact-0.22.0/tests/test_tour.py +195 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_tracing.py +337 -1
- reactifact-0.22.0/tests/test_validate.py +130 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_viz.py +26 -0
- reactifact-0.21.0/reactifact/cli/graph.py +0 -21
- reactifact-0.21.0/reactifact/interrupt.py +0 -65
- reactifact-0.21.0/reactifact/streaming.py +0 -69
- reactifact-0.21.0/tests/test_tour.py +0 -55
- {reactifact-0.21.0 → reactifact-0.22.0}/LICENSE +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/__main__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/_extras.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/_httpx.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/_persistence.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/a2a/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/a2a/client.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/a2a/models.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/a2a/server.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/agent_tool.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/audit.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/authz.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/branching/store.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/budget.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cache.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/checkpoints.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cli/branch.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cli/common.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cli/context.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cli/eval.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cli/scenario.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cli/skills.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/cli/trace.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/commit_log.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/consume.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/context/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/context/index.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/context/serialization.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/context_builder.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/eval/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/eval/dataset.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/eval/evaluators.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/eval/judge.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/eval/online.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/eval/runner.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/eval/scoring.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/events.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/guardrails.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/_closers.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/bridge.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/chunk.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/connectors.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/docstore.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/embed.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/errors.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/extract.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/http.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/acl.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/base.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/chroma.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/fusion.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/keyword.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/math.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/memory.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/pgvector.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/qdrant.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/indexes/sqlite.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/models.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/pipeline.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/rerank.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/templates/knowledge.html +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/knowledge/web.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/llm_agent.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/logging.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/mcp/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/mcp/client.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/mcp/oauth.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/mcp/server.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/metrics.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/native_tool_use.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/pricing.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/prompts.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/_retry.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/anthropic.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/azure.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/cerebras.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/chat.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/contracts.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/deepseek.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/fake.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/fireworks.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/gemini.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/github_models.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/groq.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/image.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/mistral.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/nvidia.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/ollama.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/openai.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/openrouter.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/perplexity.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/qwen.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/speech.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/together.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/video.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/xai.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/providers/zai.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/py.typed +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/quick/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/quick/_shared.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/quick/agent.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/quick/chat.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/quick/models.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/quick/rag.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/quick/tools_agent.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/quota.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/cleanup.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/conversation.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/identity.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/inputs.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/memory.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/plan_execute.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/reflection.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/resolve.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/rollback.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/search.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/skills.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/status.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/text.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/recipes/tool_loop.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/redaction.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/relations.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/request.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/routing.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/runtime/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/runtime/budget.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/runtime/loop.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/runtime/outbox.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/scheduler.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact/SKILL.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact/references/effects-and-state.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact/references/trust-and-safety.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-agents/SKILL.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-agents/references/consume.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-agents/references/effects.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-eval/SKILL.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-eval/references/online.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-from-langchain/SKILL.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-llm/SKILL.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-llm/references/providers.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-llm/references/tools.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-observability/SKILL.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-rag/SKILL.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-rag/references/sources.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/skills/reactifact-testing/SKILL.md +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/sources.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/step/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/step/annotations.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/step/call.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/step/resolve.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/structured.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/assertions.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/exceptions.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/fault.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/golden.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/lab.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/mock.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/pytest_plugin.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/record.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/testing/registry.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tool_use.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tools/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tools/agent.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tools/native.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tools/use/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tools/use/base.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tools/use/blocking.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/__init__.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/_otlp.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/columns.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/langfuse.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/otlp.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/templates/app.css +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/templates/sessions.html +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/templates/ui.html +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/tracing/templates/ui_run.html +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/triggers.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/types.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/verify.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact/web.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact.egg-info/dependency_links.txt +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact.egg-info/entry_points.txt +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/reactifact.egg-info/top_level.txt +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/setup.cfg +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_a2a.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_a2a_interop.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_absent_consume.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_agent_tool.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_anthropic_provider.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_artifact_store.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_artifacts.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_authz.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_backbone.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_budget.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_cache.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_chat_example.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_chat_memory.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_chat_outbox.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_checkpoint.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_checkpoints_concurrency.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_cli_scenario.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_commit_dag.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_commit_log.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_compaction.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_concurrency.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_consumes_produces.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_context_at.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_context_builder.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_correlated_consume.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_debounce.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_devops.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_devops_online.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_eval.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_eval_dataset.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_eval_judge.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_eval_online.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_eval_trajectory.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_fintech_audit.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_forklab.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_forklab_web.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_gemini_provider.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_guardrails.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_image_provider.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_invalidation.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_join_consume.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_knowledge.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_knowledge_web.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_lazy_providers.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_logging.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_loop_bound_client.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_mcp.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_medic_lab.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_medic_lab_web.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_metrics.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_multisource.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_native_tool_use.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_openai_provider.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_outbox.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_patches.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_pending_actions.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_prompts.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_provider_auth.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_provider_retry.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_providers_integration.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_quota.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_recipe_conversation.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_recipe_plan_execute.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_recipe_reflection.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_recipe_supervisor.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_recipe_tool_loop.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_recipes.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_recipes_inputs.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_recipes_memory.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_recipes_skills.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_relation_graph.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_relations.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_repair.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_repair_web.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_replay.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_repo_agent.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_resources.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_retry.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_routing.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_runtime.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_runtime_errors.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_scheduler_semantics.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_session_append.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_sessions.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_shutdown.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_skills.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_sources.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_sources_search.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_sources_vector.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_speech_provider.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_starter_app.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_step_annotated.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_step_scope.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_step_watermark.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_streaming.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_structured.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_testing_assertions.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_testing_golden.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_testing_provenance.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_testing_pytest_plugin.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_testing_registry.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_token_budget.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_trace_columns.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_trace_limits.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_trace_tags.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_trace_ui.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_type_registry.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_vendor_factories.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_vendor_multimodal_factories.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_verify.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_version.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_video_provider.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_view.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_web_source.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_workspace.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/test_workspace_with_sources.py +0 -0
- {reactifact-0.21.0 → reactifact-0.22.0}/tests/tests_checkpoints_sqlite.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reactifact
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.22.0
|
|
4
4
|
Summary: Reactive, artifact-driven agent runtime: agents transform versioned, typed, provenance-aware artifacts inside an evolving context
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/bzdvdn/reactifact
|
|
@@ -30,6 +30,7 @@ Requires-Dist: mypy>=1.11; extra == "dev"
|
|
|
30
30
|
Requires-Dist: pytest>=9.1.1; extra == "dev"
|
|
31
31
|
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
|
|
32
32
|
Requires-Dist: import-linter>=2.0; extra == "dev"
|
|
33
|
+
Requires-Dist: httpx2; extra == "dev"
|
|
33
34
|
Provides-Extra: knowledge
|
|
34
35
|
Provides-Extra: knowledge-chroma
|
|
35
36
|
Requires-Dist: chromadb>=0.5; extra == "knowledge-chroma"
|
|
@@ -65,6 +66,35 @@ Dynamic: license-file
|
|
|
65
66
|
> **Is:** a Python library (3 core deps) · single-process · typed, versioned artifacts with provenance · deterministic replay · optional code-first knowledge base (SQLite/Qdrant) · runs offline, no API key
|
|
66
67
|
> **Isn't:** a managed platform · a distributed task queue · a pre-built agent/tool marketplace
|
|
67
68
|
|
|
69
|
+
## Start here
|
|
70
|
+
|
|
71
|
+
**Build an app**
|
|
72
|
+
```bash
|
|
73
|
+
uv init my-agent && cd my-agent
|
|
74
|
+
uv add reactifact # core + CLI; FastAPI stays optional
|
|
75
|
+
uv run reactifact new app my-app # FastAPI: auth, sessions, SSE, traces
|
|
76
|
+
# or: uv run reactifact new daemon my-worker
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The generated FastAPI project declares `reactifact[web]` itself; installing
|
|
80
|
+
`reactifact` alone never pulls FastAPI. The template and the code review
|
|
81
|
+
example are the best starting points; see [Examples](docs/en/examples.md).
|
|
82
|
+
|
|
83
|
+
**Use it in existing code**
|
|
84
|
+
```bash
|
|
85
|
+
uv add reactifact
|
|
86
|
+
uv run reactifact skills install # teach your coding agent the mental model
|
|
87
|
+
```
|
|
88
|
+
Then start with `reactifact.quick` in [Quickstart](docs/en/quickstart.md), or
|
|
89
|
+
read [Concepts](docs/en/concepts.md) before designing artifacts.
|
|
90
|
+
|
|
91
|
+
**Inspect what a run actually did**
|
|
92
|
+
```bash
|
|
93
|
+
reactifact graph my_app.agents
|
|
94
|
+
reactifact trace traces.db
|
|
95
|
+
reactifact replay sessions.sqlite3
|
|
96
|
+
```
|
|
97
|
+
|
|
68
98
|
A question like *"why did infra costs jump in Q2?"* needs a spreadsheet, a policy doc and a page off the web — and the *next* question needs a different subset. That is not one graph you can draw up front. You declare what artifacts exist and what agents can do with them; the runtime derives the order — and the dependency graph — from state. You don't draw the graph.
|
|
69
99
|
|
|
70
100
|
Every derived artifact then links to what produced it
|
|
@@ -415,6 +445,7 @@ Prefer a notebook? [.
|
|
419
450
|
- `chat` — minimal offline single-model multi-turn conversation (`Conversation` + bounded `ChatMemory`).
|
|
420
451
|
- `forklab` — deterministic branch & merge: two strategies on their own forks, three-way merge.
|
|
@@ -447,7 +478,7 @@ npx --yes pyright # static check with the repo's pyproject config
|
|
|
447
478
|
|
|
448
479
|
## Status & contributing
|
|
449
480
|
|
|
450
|
-
Active, `0.
|
|
481
|
+
Active, `0.22.0`, pre-1.0 — the API is stabilizing and `1.0` will freeze it
|
|
451
482
|
(see the [roadmap](docs/roadmap.md)); releases follow
|
|
452
483
|
[Keep a Changelog](CHANGELOG.md). Questions and design discussion live in
|
|
453
484
|
[GitHub Discussions](https://github.com/bzdvdn/reactifact/discussions); a star,
|
|
@@ -15,6 +15,35 @@
|
|
|
15
15
|
> **Is:** a Python library (3 core deps) · single-process · typed, versioned artifacts with provenance · deterministic replay · optional code-first knowledge base (SQLite/Qdrant) · runs offline, no API key
|
|
16
16
|
> **Isn't:** a managed platform · a distributed task queue · a pre-built agent/tool marketplace
|
|
17
17
|
|
|
18
|
+
## Start here
|
|
19
|
+
|
|
20
|
+
**Build an app**
|
|
21
|
+
```bash
|
|
22
|
+
uv init my-agent && cd my-agent
|
|
23
|
+
uv add reactifact # core + CLI; FastAPI stays optional
|
|
24
|
+
uv run reactifact new app my-app # FastAPI: auth, sessions, SSE, traces
|
|
25
|
+
# or: uv run reactifact new daemon my-worker
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The generated FastAPI project declares `reactifact[web]` itself; installing
|
|
29
|
+
`reactifact` alone never pulls FastAPI. The template and the code review
|
|
30
|
+
example are the best starting points; see [Examples](docs/en/examples.md).
|
|
31
|
+
|
|
32
|
+
**Use it in existing code**
|
|
33
|
+
```bash
|
|
34
|
+
uv add reactifact
|
|
35
|
+
uv run reactifact skills install # teach your coding agent the mental model
|
|
36
|
+
```
|
|
37
|
+
Then start with `reactifact.quick` in [Quickstart](docs/en/quickstart.md), or
|
|
38
|
+
read [Concepts](docs/en/concepts.md) before designing artifacts.
|
|
39
|
+
|
|
40
|
+
**Inspect what a run actually did**
|
|
41
|
+
```bash
|
|
42
|
+
reactifact graph my_app.agents
|
|
43
|
+
reactifact trace traces.db
|
|
44
|
+
reactifact replay sessions.sqlite3
|
|
45
|
+
```
|
|
46
|
+
|
|
18
47
|
A question like *"why did infra costs jump in Q2?"* needs a spreadsheet, a policy doc and a page off the web — and the *next* question needs a different subset. That is not one graph you can draw up front. You declare what artifacts exist and what agents can do with them; the runtime derives the order — and the dependency graph — from state. You don't draw the graph.
|
|
19
48
|
|
|
20
49
|
Every derived artifact then links to what produced it
|
|
@@ -365,6 +394,7 @@ Prefer a notebook? [.
|
|
369
399
|
- `chat` — minimal offline single-model multi-turn conversation (`Conversation` + bounded `ChatMemory`).
|
|
370
400
|
- `forklab` — deterministic branch & merge: two strategies on their own forks, three-way merge.
|
|
@@ -397,7 +427,7 @@ npx --yes pyright # static check with the repo's pyproject config
|
|
|
397
427
|
|
|
398
428
|
## Status & contributing
|
|
399
429
|
|
|
400
|
-
Active, `0.
|
|
430
|
+
Active, `0.22.0`, pre-1.0 — the API is stabilizing and `1.0` will freeze it
|
|
401
431
|
(see the [roadmap](docs/roadmap.md)); releases follow
|
|
402
432
|
[Keep a Changelog](CHANGELOG.md). Questions and design discussion live in
|
|
403
433
|
[GitHub Discussions](https://github.com/bzdvdn/reactifact/discussions); a star,
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "reactifact"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.22.0"
|
|
8
8
|
description = "Reactive, artifact-driven agent runtime: agents transform versioned, typed, provenance-aware artifacts inside an evolving context"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -42,6 +42,7 @@ dev = [
|
|
|
42
42
|
"pytest>=9.1.1",
|
|
43
43
|
"pytest-cov>=7.1.0",
|
|
44
44
|
"import-linter>=2.0",
|
|
45
|
+
"httpx2",
|
|
45
46
|
]
|
|
46
47
|
knowledge = [] # code-first knowledge layer; no extra runtime deps
|
|
47
48
|
knowledge-chroma = ["chromadb>=0.5"]
|
|
@@ -77,6 +78,7 @@ dev = [
|
|
|
77
78
|
"pytest>=9.1.1",
|
|
78
79
|
"pytest-cov>=7.1.0",
|
|
79
80
|
"import-linter>=2.0",
|
|
81
|
+
"httpx2",
|
|
80
82
|
]
|
|
81
83
|
knowledge-chroma = ["chromadb>=0.5"]
|
|
82
84
|
web = [
|
|
@@ -111,6 +113,22 @@ packages = { find = { where = ["."], include = ["reactifact*"], exclude = ["exam
|
|
|
111
113
|
|
|
112
114
|
[tool.setuptools.package-data]
|
|
113
115
|
reactifact = ["py.typed", "skills/*/SKILL.md", "skills/*/references/*.md"]
|
|
116
|
+
"reactifact.templates" = [
|
|
117
|
+
"fastapi_chat/*",
|
|
118
|
+
"fastapi_chat/.env.example",
|
|
119
|
+
"fastapi_chat/.gitignore",
|
|
120
|
+
"fastapi_chat/app/*.py",
|
|
121
|
+
"fastapi_chat/app/api/*.py",
|
|
122
|
+
"fastapi_chat/app/api/routes/*.py",
|
|
123
|
+
"fastapi_chat/app/agent/*.py",
|
|
124
|
+
"fastapi_chat/app/agent/steps/*.py",
|
|
125
|
+
"fastapi_chat/tests/*.py",
|
|
126
|
+
"daemon/*",
|
|
127
|
+
"daemon/.env.example",
|
|
128
|
+
"daemon/.gitignore",
|
|
129
|
+
"daemon/app/*.py",
|
|
130
|
+
"daemon/tests/*.py",
|
|
131
|
+
]
|
|
114
132
|
"reactifact.tracing" = ["templates/*.html", "templates/*.css"]
|
|
115
133
|
"reactifact.knowledge" = ["templates/*.html"]
|
|
116
134
|
|
|
@@ -132,7 +150,7 @@ line-length = 88
|
|
|
132
150
|
src = ["reactifact", "examples"]
|
|
133
151
|
# Notebooks are Colab artifacts (IPython magics, top-level await) — not package
|
|
134
152
|
# code; don't lint/format them.
|
|
135
|
-
extend-exclude = ["*.ipynb"]
|
|
153
|
+
extend-exclude = ["*.ipynb", "templates", "reactifact/templates"]
|
|
136
154
|
|
|
137
155
|
[tool.ruff.lint]
|
|
138
156
|
select = [
|
|
@@ -164,6 +182,7 @@ python_version = "3.11"
|
|
|
164
182
|
packages = ["reactifact", "examples"]
|
|
165
183
|
strict = true
|
|
166
184
|
warn_unused_ignores = true
|
|
185
|
+
exclude = ["reactifact/templates"]
|
|
167
186
|
|
|
168
187
|
# pyright defaults its target to the interpreter it finds, which can resolve
|
|
169
188
|
# below the 3.11 floor this package requires — making `StrEnum`/`datetime.UTC`
|
|
@@ -173,7 +192,7 @@ pythonVersion = "3.11"
|
|
|
173
192
|
include = ["reactifact", "examples"]
|
|
174
193
|
venvPath = "."
|
|
175
194
|
venv = ".venv"
|
|
176
|
-
exclude = ["build", "dist", ".venv", ".scratch", "**/__pycache__"]
|
|
195
|
+
exclude = ["build", "dist", ".venv", ".scratch", "reactifact/templates", "templates", "**/__pycache__"]
|
|
177
196
|
|
|
178
197
|
|
|
179
198
|
[tool.importlinter]
|
|
@@ -25,9 +25,10 @@ from importlib.metadata import PackageNotFoundError as _PackageNotFoundError
|
|
|
25
25
|
from importlib.metadata import version as _distribution_version
|
|
26
26
|
|
|
27
27
|
from .agents import Agent, create_agent
|
|
28
|
-
from .artifacts import Artifact
|
|
28
|
+
from .artifacts import Artifact, ArtifactConflict
|
|
29
29
|
from .branching import MergeConflict
|
|
30
30
|
from .budget import Budget, BudgetTracker, RunOutcome, RunStats
|
|
31
|
+
from .commit import ContextCheckpoint
|
|
31
32
|
from .consume import Consume, consume
|
|
32
33
|
from .context import Context, View
|
|
33
34
|
from .effects import Effects, Handle
|
|
@@ -35,6 +36,10 @@ from .events import Event, EventType
|
|
|
35
36
|
from .interrupt import PendingAction, PendingQuestion
|
|
36
37
|
from .logging import bind, configure_logging, get_logger
|
|
37
38
|
from .patches import Create, Delete, Link, Patch, Relation, Unlink, Update
|
|
39
|
+
from .policy import RetryPolicy
|
|
40
|
+
|
|
41
|
+
# Deprecated 0.1.x aliases: importable for the compatibility window, but kept
|
|
42
|
+
# out of `__all__` (the public surface) until their removal.
|
|
38
43
|
from .produce import Produce, ProduceCall, produce
|
|
39
44
|
from .providers import (
|
|
40
45
|
EmbeddingProvider,
|
|
@@ -51,9 +56,16 @@ from .resources import ResourceKey, ResourceScope, RuntimeResources
|
|
|
51
56
|
from .runtime import Runtime
|
|
52
57
|
from .session import Session, SessionStore
|
|
53
58
|
from .step import Latest, Scope, Step, StepCall, Wakes, When, step
|
|
59
|
+
from .subflow import SubflowResult, run_subflow
|
|
54
60
|
from .tools import FunctionTool, Tool, ToolError, ToolOutput, tool
|
|
55
61
|
from .triggers import Trigger
|
|
56
62
|
from .types import register as register_type
|
|
63
|
+
from .validate import (
|
|
64
|
+
ValidationError,
|
|
65
|
+
ValidationIssue,
|
|
66
|
+
ValidationReport,
|
|
67
|
+
validate_agents,
|
|
68
|
+
)
|
|
57
69
|
|
|
58
70
|
try:
|
|
59
71
|
__version__ = _distribution_version("reactifact")
|
|
@@ -63,10 +75,12 @@ except _PackageNotFoundError: # source checkout without an installed distributi
|
|
|
63
75
|
__all__ = [
|
|
64
76
|
"Agent",
|
|
65
77
|
"Artifact",
|
|
78
|
+
"ArtifactConflict",
|
|
66
79
|
"Budget",
|
|
67
80
|
"BudgetTracker",
|
|
68
81
|
"Consume",
|
|
69
82
|
"Context",
|
|
83
|
+
"ContextCheckpoint",
|
|
70
84
|
"Create",
|
|
71
85
|
"Delete",
|
|
72
86
|
"EmbeddingProvider",
|
|
@@ -84,13 +98,13 @@ __all__ = [
|
|
|
84
98
|
"Patch",
|
|
85
99
|
"PendingAction",
|
|
86
100
|
"PendingQuestion",
|
|
87
|
-
"Produce",
|
|
88
|
-
"ProduceCall",
|
|
89
101
|
"Step",
|
|
90
102
|
"StepCall",
|
|
103
|
+
"SubflowResult",
|
|
91
104
|
"Relation",
|
|
92
105
|
"ResourceKey",
|
|
93
106
|
"ResourceScope",
|
|
107
|
+
"RetryPolicy",
|
|
94
108
|
"RunOutcome",
|
|
95
109
|
"RunStats",
|
|
96
110
|
"Scope",
|
|
@@ -108,6 +122,9 @@ __all__ = [
|
|
|
108
122
|
"Trigger",
|
|
109
123
|
"Unlink",
|
|
110
124
|
"Update",
|
|
125
|
+
"ValidationError",
|
|
126
|
+
"ValidationIssue",
|
|
127
|
+
"ValidationReport",
|
|
111
128
|
"View",
|
|
112
129
|
"Wakes",
|
|
113
130
|
"When",
|
|
@@ -117,8 +134,9 @@ __all__ = [
|
|
|
117
134
|
"create_agent",
|
|
118
135
|
"current_request",
|
|
119
136
|
"get_logger",
|
|
120
|
-
"produce",
|
|
121
137
|
"register_type",
|
|
138
|
+
"run_subflow",
|
|
122
139
|
"step",
|
|
123
140
|
"tool",
|
|
141
|
+
"validate_agents",
|
|
124
142
|
]
|
|
@@ -115,7 +115,7 @@ class A2ARemoteProduce(Step[Any]):
|
|
|
115
115
|
)
|
|
116
116
|
source = original.data if original is not None else data
|
|
117
117
|
result = await self._client.send(
|
|
118
|
-
data.
|
|
118
|
+
data.answer_text(),
|
|
119
119
|
task_id=notes.get("a2a_task_id"),
|
|
120
120
|
context_id=notes.get("a2a_context_id"),
|
|
121
121
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import asyncio
|
|
3
4
|
import time
|
|
4
5
|
from abc import ABC
|
|
5
6
|
from collections.abc import Callable, Sequence
|
|
@@ -13,6 +14,7 @@ from .context import Context
|
|
|
13
14
|
from .effects import current_effects
|
|
14
15
|
from .events import Event, EventType
|
|
15
16
|
from .patches import Patch
|
|
17
|
+
from .policy import RetryPolicy
|
|
16
18
|
from .step import (
|
|
17
19
|
Step,
|
|
18
20
|
StepCall,
|
|
@@ -83,6 +85,12 @@ class Agent(ABC): # noqa: B024 — interface without abstract methods, run() ha
|
|
|
83
85
|
# the runtime default (max_concurrency). Use it to throttle LLM-bound
|
|
84
86
|
# producers (rate limits) independently of cheap I/O (file reads).
|
|
85
87
|
concurrency_limit: int | None = None
|
|
88
|
+
#: Retry policy for this agent's execution (class or instance level).
|
|
89
|
+
#: A retry gets a fresh `Effects` slot; only the successful patch commits.
|
|
90
|
+
retry: RetryPolicy | None = None
|
|
91
|
+
#: Hard per-execution deadline, in seconds. The runtime cancels the agent
|
|
92
|
+
#: when it passes; `asyncio.TimeoutError` then follows the retry policy.
|
|
93
|
+
timeout: float | None = None
|
|
86
94
|
#: Whether the runtime auto-schedules this agent from matching events.
|
|
87
95
|
#: `False` keeps it out of reactive scheduling (run it explicitly).
|
|
88
96
|
wakes: bool | Callable[[Event, Context | None], bool] = True
|
|
@@ -101,12 +109,24 @@ class Agent(ABC): # noqa: B024 — interface without abstract methods, run() ha
|
|
|
101
109
|
*,
|
|
102
110
|
steps: Sequence[Step[Any]] | None = None,
|
|
103
111
|
wakes: bool | Callable[[Event, Context | None], bool] | None = None,
|
|
112
|
+
retry: RetryPolicy | None = None,
|
|
113
|
+
timeout: float | None = None,
|
|
104
114
|
):
|
|
105
115
|
self.name = name or self.name or self.__class__.__name__
|
|
106
116
|
|
|
107
117
|
self.priority = (
|
|
108
118
|
priority if priority is not None else getattr(self.__class__, "priority", 0)
|
|
109
119
|
)
|
|
120
|
+
self.retry = (
|
|
121
|
+
retry if retry is not None else getattr(self.__class__, "retry", None)
|
|
122
|
+
)
|
|
123
|
+
self.timeout = (
|
|
124
|
+
timeout if timeout is not None else getattr(self.__class__, "timeout", None)
|
|
125
|
+
)
|
|
126
|
+
if self.retry is not None and not isinstance(self.retry, RetryPolicy):
|
|
127
|
+
raise TypeError("Agent.retry must be a RetryPolicy or None")
|
|
128
|
+
if self.timeout is not None and self.timeout <= 0:
|
|
129
|
+
raise ValueError("Agent.timeout must be > 0")
|
|
110
130
|
|
|
111
131
|
existing_steps = self.__dict__.get("steps")
|
|
112
132
|
existing_produces = self.__dict__.get("produces")
|
|
@@ -307,7 +327,11 @@ class Agent(ABC): # noqa: B024 — interface without abstract methods, run() ha
|
|
|
307
327
|
context_token = set_step_context(context)
|
|
308
328
|
call_token = set_step_call(call)
|
|
309
329
|
try:
|
|
310
|
-
|
|
330
|
+
if p.timeout is not None:
|
|
331
|
+
async with asyncio.timeout(p.timeout):
|
|
332
|
+
result = await invoke_step(p, call)
|
|
333
|
+
else:
|
|
334
|
+
result = await invoke_step(p, call)
|
|
311
335
|
p._apply_result(result, call.effects)
|
|
312
336
|
if trigger_cursor:
|
|
313
337
|
context._step_cursors[cursor_key] = trigger_cursor
|
|
@@ -392,6 +416,8 @@ def create_agent(
|
|
|
392
416
|
concurrency_limit: int | None = None,
|
|
393
417
|
triggers: list[Trigger] | None = None,
|
|
394
418
|
wakes: bool | Callable[[Event, Context | None], bool] = True,
|
|
419
|
+
retry: RetryPolicy | None = None,
|
|
420
|
+
timeout: float | None = None,
|
|
395
421
|
) -> Agent:
|
|
396
422
|
"""Builds an Agent instance without subclassing.
|
|
397
423
|
|
|
@@ -423,6 +449,8 @@ def create_agent(
|
|
|
423
449
|
priority=priority,
|
|
424
450
|
steps=resolved_steps,
|
|
425
451
|
wakes=wakes,
|
|
452
|
+
retry=retry,
|
|
453
|
+
timeout=timeout,
|
|
426
454
|
)
|
|
427
455
|
if consumes is not None:
|
|
428
456
|
agent.consumes = consumes
|
|
@@ -36,6 +36,26 @@ def blob_key(data_type: str, content_hash: str) -> str:
|
|
|
36
36
|
return f"{data_type}:{content_hash}"
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
class ArtifactConflict(RuntimeError):
|
|
40
|
+
"""An optimistic-concurrency update expected a different artifact version.
|
|
41
|
+
|
|
42
|
+
Raised by `effects.update(..., expected_version=...)`, `Context.update`, or
|
|
43
|
+
the runtime before a commit when a patch would overwrite a version another
|
|
44
|
+
writer already moved. The runtime validates the whole generation first, so
|
|
45
|
+
no patch from that generation is applied.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
def __init__(self, artifact_id: str, expected: int, actual: int | None) -> None:
|
|
49
|
+
self.artifact_id = artifact_id
|
|
50
|
+
self.expected = expected
|
|
51
|
+
self.actual = actual
|
|
52
|
+
actual_text = actual if actual is not None else "absent"
|
|
53
|
+
super().__init__(
|
|
54
|
+
f"artifact {artifact_id!r} version conflict: expected {expected}, "
|
|
55
|
+
f"actual {actual_text}"
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
39
59
|
@dataclass(frozen=True)
|
|
40
60
|
class ArtifactVersion:
|
|
41
61
|
"""One immutable artifact revision, addressed by content hash.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from .ops import (
|
|
4
4
|
MergeConflict,
|
|
5
|
+
MergePolicy,
|
|
5
6
|
clone_context,
|
|
6
7
|
fork_context,
|
|
7
8
|
merge_context_from,
|
|
@@ -12,6 +13,7 @@ from .store import BranchStore
|
|
|
12
13
|
__all__ = [
|
|
13
14
|
"BranchStore",
|
|
14
15
|
"MergeConflict",
|
|
16
|
+
"MergePolicy",
|
|
15
17
|
"clone_context",
|
|
16
18
|
"fork_context",
|
|
17
19
|
"merge_context_from",
|
|
@@ -25,6 +25,7 @@ backend (matching the constitution: semantics live in Context operations).
|
|
|
25
25
|
|
|
26
26
|
from __future__ import annotations
|
|
27
27
|
|
|
28
|
+
from collections.abc import Callable, Mapping
|
|
28
29
|
from typing import TYPE_CHECKING, Any
|
|
29
30
|
|
|
30
31
|
from pydantic import BaseModel
|
|
@@ -50,6 +51,12 @@ class MergeConflict(Exception):
|
|
|
50
51
|
self.conflicts = conflicts or []
|
|
51
52
|
|
|
52
53
|
|
|
54
|
+
#: Resolves a diverged artifact in `Context.merge`: given the target and the
|
|
55
|
+
#: incoming data, return the merged data (same model type). Opt-in, per type;
|
|
56
|
+
#: without a policy the merge stays fail-loud with `MergeConflict`.
|
|
57
|
+
MergePolicy = Callable[[Any, Any], BaseModel]
|
|
58
|
+
|
|
59
|
+
|
|
53
60
|
def clone_context(source: Context) -> Context:
|
|
54
61
|
"""Deep copy of `source`'s live state (artifacts, log, relations)."""
|
|
55
62
|
new_ws = source.__class__()
|
|
@@ -142,7 +149,11 @@ def _kind_short(signature: Any) -> str:
|
|
|
142
149
|
|
|
143
150
|
|
|
144
151
|
def merge_contexts(
|
|
145
|
-
target: Context,
|
|
152
|
+
target: Context,
|
|
153
|
+
other: Context,
|
|
154
|
+
*,
|
|
155
|
+
message: str = "Merged branch",
|
|
156
|
+
policies: Mapping[type[BaseModel], MergePolicy] | None = None,
|
|
146
157
|
) -> None:
|
|
147
158
|
"""Merges `other` into `target` with explicit conflicts, atomically (§40).
|
|
148
159
|
|
|
@@ -157,6 +168,9 @@ def merge_contexts(
|
|
|
157
168
|
|
|
158
169
|
So a change adopted from `other` never silently overwrites a change made
|
|
159
170
|
on `target` since the fork (§40: the framework must not choose silently).
|
|
171
|
+
`policies` can opt a specific model type into a deterministic resolution:
|
|
172
|
+
the callable receives `(target_data, other_data)` and returns merged data of
|
|
173
|
+
the same type; a policy that raises or returns a wrong type still fails.
|
|
160
174
|
"""
|
|
161
175
|
base = other._base if other._base is not None else target._base
|
|
162
176
|
if base is None:
|
|
@@ -204,10 +218,28 @@ def merge_contexts(
|
|
|
204
218
|
else Update(artifact_id, other_art.data)
|
|
205
219
|
)
|
|
206
220
|
else:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
221
|
+
policy = None
|
|
222
|
+
if (
|
|
223
|
+
policies is not None
|
|
224
|
+
and target_art is not None
|
|
225
|
+
and other_art is not None
|
|
226
|
+
):
|
|
227
|
+
policy = policies.get(type(target_art.data))
|
|
228
|
+
if policy is not None:
|
|
229
|
+
assert target_art is not None and other_art is not None
|
|
230
|
+
merged = policy(target_art.data, other_art.data)
|
|
231
|
+
if not isinstance(merged, type(target_art.data)):
|
|
232
|
+
raise TypeError(
|
|
233
|
+
f"merge policy for {type(target_art.data).__name__} "
|
|
234
|
+
f"returned {type(merged).__name__}"
|
|
235
|
+
)
|
|
236
|
+
pending[artifact_id] = merged
|
|
237
|
+
operations.append(Update(artifact_id, merged))
|
|
238
|
+
else:
|
|
239
|
+
conflicts.append(
|
|
240
|
+
f"{artifact_id} diverged since the fork "
|
|
241
|
+
f"(target={_kind_short(st)}, other={_kind_short(so)})"
|
|
242
|
+
)
|
|
211
243
|
|
|
212
244
|
if conflicts:
|
|
213
245
|
raise MergeConflict(
|
|
@@ -258,6 +290,7 @@ def merge_contexts(
|
|
|
258
290
|
|
|
259
291
|
__all__ = [
|
|
260
292
|
"MergeConflict",
|
|
293
|
+
"MergePolicy",
|
|
261
294
|
"clone_context",
|
|
262
295
|
"fork_context",
|
|
263
296
|
"merge_context_from",
|
|
@@ -217,18 +217,22 @@ def _accepts_arg(func: Callable[..., Any], count: int) -> bool:
|
|
|
217
217
|
return len(params) >= count
|
|
218
218
|
|
|
219
219
|
|
|
220
|
-
def _resolve_with_session(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
220
|
+
def _resolve_with_session(
|
|
221
|
+
value: Any,
|
|
222
|
+
session_id: str,
|
|
223
|
+
request: Mapping[str, Any] | None = None,
|
|
224
|
+
) -> Any:
|
|
225
|
+
"""Like `_resolve`, but passes `session_id` (and optionally `request`) when
|
|
226
|
+
the factory declares the extra parameters — the per-request resource shape
|
|
227
|
+
(`resources=lambda session_id, request: build_resources(...)`) alongside
|
|
228
|
+
the pre-existing one-arg (`resources=lambda session_id: ...`) and zero-arg
|
|
229
|
+
forms, which keep working unchanged. `ChatAssistant` already knows the
|
|
230
|
+
session and turn request at this point; a factory can opt into either.
|
|
229
231
|
"""
|
|
230
232
|
if not callable(value):
|
|
231
233
|
return value
|
|
234
|
+
if _accepts_arg(value, 2):
|
|
235
|
+
return value(session_id, request or {})
|
|
232
236
|
return value(session_id) if _accepts_arg(value, 1) else value()
|
|
233
237
|
|
|
234
238
|
|
|
@@ -461,14 +465,26 @@ class ChatAssistant:
|
|
|
461
465
|
self._lock_refs.pop(session_id, None)
|
|
462
466
|
self._session_locks.pop(session_id, None)
|
|
463
467
|
|
|
464
|
-
async def _open(
|
|
465
|
-
|
|
468
|
+
async def _open(
|
|
469
|
+
self,
|
|
470
|
+
session_id: str,
|
|
471
|
+
request: Mapping[str, Any] | None = None,
|
|
472
|
+
*,
|
|
473
|
+
build_resources: bool = True,
|
|
474
|
+
) -> Session:
|
|
475
|
+
resources: RuntimeResources | None = None
|
|
476
|
+
if build_resources:
|
|
477
|
+
resources = _resolve_with_session(self._resources, session_id, request)
|
|
478
|
+
elif not callable(self._resources):
|
|
479
|
+
# A shared instance is harmless to attach; a per-turn factory is
|
|
480
|
+
# deliberately not invoked for a read-only open (history()).
|
|
481
|
+
resources = self._resources
|
|
466
482
|
try:
|
|
467
483
|
return await self.store.open(session_id, resources=resources)
|
|
468
484
|
except Exception:
|
|
469
485
|
# A callable `resources=` built a fresh per-turn instance; if the
|
|
470
486
|
# store fails to open the session nothing else will close it.
|
|
471
|
-
if callable(self._resources):
|
|
487
|
+
if build_resources and callable(self._resources) and resources is not None:
|
|
472
488
|
with suppress(Exception):
|
|
473
489
|
await resources.aclose()
|
|
474
490
|
raise
|
|
@@ -560,7 +576,7 @@ class ChatAssistant:
|
|
|
560
576
|
async with self._locked_session(session_id):
|
|
561
577
|
session: Session | None = None
|
|
562
578
|
try:
|
|
563
|
-
session = await self._open(session_id)
|
|
579
|
+
session = await self._open(session_id, request)
|
|
564
580
|
runtime = self._build_runtime(session)
|
|
565
581
|
except Exception:
|
|
566
582
|
logger.exception(
|
|
@@ -631,9 +647,15 @@ class ChatAssistant:
|
|
|
631
647
|
return message
|
|
632
648
|
|
|
633
649
|
async def history(self, session_id: str = "") -> dict[str, Any]:
|
|
634
|
-
"""Reconstruct the chat thread of a persisted session.
|
|
650
|
+
"""Reconstruct the chat thread of a persisted session.
|
|
651
|
+
|
|
652
|
+
Read-only: a per-turn `resources=` factory is not invoked (no provider
|
|
653
|
+
or user scope is built just to read artifacts). A shared
|
|
654
|
+
`RuntimeResources` instance is attached as usual, so a custom
|
|
655
|
+
`session_state` can still read it.
|
|
656
|
+
"""
|
|
635
657
|
try:
|
|
636
|
-
session = await self._open(session_id)
|
|
658
|
+
session = await self._open(session_id, build_resources=False)
|
|
637
659
|
except Exception:
|
|
638
660
|
logger.exception("chat.ChatAssistant: history open failed %r", session_id)
|
|
639
661
|
return {"messages": []}
|