Python package — TS parity port (framework_agents)
The TypeScript package (packages/typescript) is the reference implementation.
This port targets API parity with the fixed TS semantics — every behavior
that was a real bug during the TS line (and is regression-pinned there) is
encoded here from day one:
| Pinned semantic | Why |
|---|---|
reasoning_tokens is a SUBSET of output_tokens |
never double-billed in budgets/cost |
cost_usd only when a price is known |
unknown models → None, never a fake $0 |
save() APPENDS; the loop does clear-then-save |
history never duplicates across runs |
Structured 'auto' resolves by capability |
unresolved auto never throws STRUCTURED_NO_MATCH |
finish_reason=length + zero content → loud MODEL_ERROR |
a thinking model burning its whole budget is not a silent empty answer |
| Tool parameter schemas ride the wire | models see real argument shapes |
| HITL decisions: exact key THEN bare tool name | resume converges even when models regenerate arg text |
Local ollama: pricing wins over name collisions |
never bill cloud prices for free local models |
Storage keys/threadIds reject traversal (..) |
no writes outside the root |
| Remote SPARQL: descriptive UA + 429/5xx retry honoring Retry-After | public endpoints reject and rate-limit otherwise |
No personal or brand names appear anywhere in this package.
Port status (mirroring the TS module map)
| TS module | Python | State |
|---|---|---|
| types (messages/blocks/usage) | types.py |
✅ |
| errors + retryable verdicts | errors.py |
✅ |
| tools (define_tool/registry/schemas) | tools.py |
✅ |
| memory (+compaction) | memory.py, memory_compaction.py |
✅ (MEMORY_CORRUPT loud, atomic unique-tmp writes) |
| conversation managers | conversation.py |
✅ (order-preserving pin; model or fn summarizer) |
| sessions + snapshots | sessions.py |
✅ (validated keys, TS-tested preset semantics) |
| checkpoint + file locks | checkpoint.py |
✅ (O_EXCL + stale reclaim, threadId validation) |
| runtime (abort/timeout) | runtime.py |
✅ |
| models (mock + OpenAI-compatible + Anthropic + Ollama) | models/ |
✅ (Together+OpenAI field unions, native Anthropic Messages API w/ thinking budgets + SSE machine, vision capability fail-fast, stream usage, truncation guard) |
| state (AgentState + invocation) | state.py, agent.py |
✅ (validated JSON KV, custom-prototype rejection, snapshots/session restore, pause/resume, edit/branch/timelines, v1 reasoning blocks, with_tools) |
| pricing | pricing.py |
✅ |
| config + factory | config.py |
✅ (together/openai/ollama/custom) |
| agent loop (budgets/structured/streaming) | agent.py |
✅ (calls stream via drain; budget price refusal; synthesized final answer) |
| middleware (hooks, HITL, retries, limits, policy, todos, pii) | middleware.py |
✅ |
| orchestration | orchestration.py |
✅ (sequential/parallel/router; routed result semantics) |
| workflows | workflows.py |
✅ (dedup'd indegree, retries, propagation) |
| swarm | swarm.py |
✅ (handoff tool + stream events + loop detection default) |
| evals | evals.py |
✅ (JSONL + pass-rate reporter) |
| skills + TF-IDF routing | skills.py |
✅ ($mention word-boundary wins) |
| prompts (+A/B) | prompts.py |
✅ (CRLF/BOM tolerance) |
| rag (tf-idf retriever + tool) | rag.py |
✅ |
| semantic (store/SHACL/rules/graph memory/linking/JSON-LD/evolution) | semantic.py, ontology_review.py |
✅ (version graphs under urn:framework:ontology:*) |
| remote SPARQL | remote_sparql.py |
✅ (UA + Retry-After retry) |
| A2A clients (SSE + JSON-RPC) | a2a_client.py |
✅ (envelope + contextId chain + retry) |
| A2A server (contexts/LRU/disconnect/SSE) | a2a_server.py |
✅ (stdio-of-asyncio raw HTTP, body caps, CORS) |
| MCP clients + bridging | mcp_client.py |
✅ (stdio child lifecycle, no-id notification, per-tool degrade) |
| observability + tracing sinks | observability.py, tracing.py |
✅ |
| sandbox (JS + shell) | sandbox.py |
✅ (caveat: exec timeouts abandon a thread, no hard kill) |
| serve (framework.json + CLI) | serve.py |
✅ (lazy model init, argparse CLI, per-context isolated agents) |
| React SDK | — | n/a (React-specific; browser clients use A2A/SSE) |
Batch-2 middleware (model_fallback, summarization, context_editing +
ClearToolUsesEdit, llm_tool_selector, tool_emulator, filesystem,
create_sub_agent, pii tool-results) is ported with deviations pinned in
middleware.py's docstring (feedback-strings instead of raises on escape
misses; older_than_steps interpreted as a step gate).
Running
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytest tests -q # offline parity suite (233 tests)
E2E_MODEL=1 .venv/bin/python -m pytest tests -q -m live
# live Together parity runs; OpenAI + Anthropic suites skip cleanly and go
# live as soon as OPENAI_API_KEY / ANTHROPIC_API_KEY appear in framework/.env
Known deviations (documented in module docstrings)
Agent.stream()yields adoneevent and stores the result (generators can't return values); run() drains — wire contracts identical.- Async file IO runs via
asyncio.to_threadin filesystem tools; storage classes use blocking IO inside async methods (single-process locality). - Sandbox JS cannot hard-interrupt a thread mid-statement (node:vm can) — the timeout surfaces per contract, the abandoned thread dies at exit.
- Semantic version graphs use
urn:framework:ontology:<version>(the TS defaulturn:fabisch:*embeds a personal name; both are configurable). - Cross-language conformance: the Python A2A client speaks the exact wire
contract of the TS A2A server (envelope, SSE frames, [DONE]) and vice
versa — see
tests/test_servers_and_clients.py.
Metadata
Release files for framework-agents 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| framework_agents-0.2.0.tar.gz | 197.1 kB | Without provenance | Details for framework_agents-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| framework_agents-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for framework_agents-0.2.0-py3-none-any.whl |
Total release size: 339.9 kB
Release files / framework_agents-0.2.0.tar.gz
| Download URL | framework_agents-0.2.0.tar.gz |
|---|---|
| Size | 197.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2be548c824abe8e9032bddb181f6b7e95c5b812a1efa616e5c8f755537e45131
|
|
BLAKE2b-256 checksum How to use checksums |
56b2aa213802229fc20a45bbf224f2486b23afa7a65d4b0a4b3080d0d311b885
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / framework_agents-0.2.0-py3-none-any.whl
| Download URL | framework_agents-0.2.0-py3-none-any.whl |
|---|---|
| Size | 142.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06f2a643dd62dc8aacafa311b125b0756c2429db8d2768ba5faa21a150598a49
|
|
BLAKE2b-256 checksum How to use checksums |
f727a656e569942e7138e8b63145e04e167d123322b58cc081f3212526c1f1bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Security for framework-agents 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.