tina4-python 3.13.162__tar.gz → 3.13.163__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.
- {tina4_python-3.13.162 → tina4_python-3.13.163}/PKG-INFO +1 -1
- {tina4_python-3.13.162 → tina4_python-3.13.163}/pyproject.toml +1 -1
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/Testing.py +52 -17
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/__init__.py +1 -1
- tina4_python-3.13.163/tina4_python/_testing_async.py +173 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/ai/__init__.py +2 -2
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/middleware.py +19 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/server.py +25 -1
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/dev_admin/__init__.py +25 -10
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/mcp/__init__.py +179 -43
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue_backends/kafka_backend.py +87 -55
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/test_client/__init__.py +4 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/.gitignore +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/COMMERCIAL-LICENSE.md +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/LICENSE +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/NOTICE +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/README.md +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/.tina4-metrics.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/CLAUDE.md +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/HtmlElement.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/_import_helper.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/ai/client.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/api/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/auth/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/cache/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/cli/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/container/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/context/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/context/chunker.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/cache.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/constants.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/csp.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/events.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/port_takeover.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/rate_limiter.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/request.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/response.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/core/router.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/crud/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/crud/page.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/crud/page_render.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/adapter.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/async_api.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/connection.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/database_url.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/firebird.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/mongodb.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/mssql.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/mysql.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/odbc.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/pool.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/postgres.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/sql_translator.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/database/sqlite.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/debug/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/debug/error_overlay.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/dev_admin/metrics.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/dev_admin/plan.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/dev_admin/project_index.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/docs.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/docstore/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/dotenv/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/env.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/frond/FROND.md +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/frond/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/frond/compiler.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/frond/engine.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/frond/parser.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/auth/meta.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/auth/src/routes/api/gallery_auth.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/database/meta.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/database/src/routes/api/gallery_db.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/error-overlay/meta.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/error-overlay/src/routes/api/gallery_crash.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/orm/meta.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/orm/src/orm/Product.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/orm/src/routes/api/gallery_products.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/queue/meta.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/queue/src/routes/api/gallery_queue.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/rest-api/meta.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/rest-api/src/routes/api/gallery_hello.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/templates/meta.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/templates/src/routes/gallery_page.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/gallery/templates/src/templates/gallery_page.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/graph/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/graph/adapter.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/graph/adapters/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/graph/adapters/arango.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/graph/adapters/bolt.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/graph/adapters/ultipa.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/graph/graph_url.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/graphql/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/i18n/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/mcp/protocol.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/mcp/tools.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/messenger/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/migration/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/migration/runner.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/mqtt/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/mqtt/message.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/orm/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/orm/async_api.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/orm/collection.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/orm/fields.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/orm/model.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/orm/point.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/THIRD-PARTY-NOTICES.md +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/__feedback/widget.js +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/bundled-component-provenance.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/css/tina4.css +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/css/tina4.min.css +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/favicon.ico +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/images/logo.svg +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/images/tina4-logo-icon.webp +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/js/frond.js +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/js/frond.min.js +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/js/tina4-dev-admin-split.html +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/js/tina4-dev-admin.min.js +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/js/tina4.min.js +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/js/tina4js.min.js +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/licenses/swagger-ui-3.10.0-original-notice.txt +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/licenses/swagger-ui-5.17.14-NOTICE.txt +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/licenses/swagger-ui-Apache-2.0.txt +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/licenses/tina4-css-MIT.txt +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/licenses/tina4-dev-admin-components.json +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/licenses/tina4-dev-admin-third-party.txt +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/licenses/tina4-js-MIT.txt +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/swagger/index.html +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/push/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/push/_base.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/push/_cryptography.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/push/_libcrypto.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/query_builder/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue/amqp_url.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue/job.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue/kafka_backend.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue/lite_backend.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue/mongo_backend.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue/rabbitmq_backend.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue/topic_dead_letter.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue_backends/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue_backends/mongo_backend.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/queue_backends/rabbitmq_backend.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/realtime/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/realtime/models/Attachment.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/realtime/models/Channel.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/realtime/models/ChannelMember.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/realtime/models/Message.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/realtime/models/Workspace.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/realtime/models/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/realtime/s3_client.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/realtime/storage.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/seeder/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/service/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/session/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/session_handlers/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/session_handlers/memcached_handler.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/session_handlers/mongodb_handler.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/session_handlers/redis_handler.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/session_handlers/valkey_handler.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/sso.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/ssrf.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/swagger/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/tcp/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/components/crud.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/crud/form.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/crud/modals.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/crud/page.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/crud/table.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/docker/distroless/Dockerfile +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/docker/poetry/Dockerfile +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/docker/python/Dockerfile +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/docker/uv/Dockerfile +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/errors/302.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/errors/401.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/errors/403.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/errors/404.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/errors/500.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/errors/502.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/errors/503.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/errors/base.twig +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/frontend/README.md +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/templates/readme.md +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/test/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/af/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/af/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/es/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/es/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/ja/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/ja/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/zh/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/translations/zh/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/validator/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/websocket/__init__.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/websocket/backplane.py +0 -0
- {tina4_python-3.13.162 → tina4_python-3.13.163}/tina4_python/wsdl/__init__.py +0 -0
|
@@ -37,6 +37,7 @@ the wrong one is a loud ``ImportError``/``AttributeError``, never a silent
|
|
|
37
37
|
change of call semantics.
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
|
+
from tina4_python._testing_async import _AsyncRunner, _AsyncRunnerError, _RunAborted
|
|
40
41
|
import sys
|
|
41
42
|
import traceback
|
|
42
43
|
|
|
@@ -88,12 +89,40 @@ def tests(*assertions):
|
|
|
88
89
|
|
|
89
90
|
# ── Runner ──────────────────────────────────────────────────────────
|
|
90
91
|
|
|
91
|
-
def run_all(quiet: bool = False, failfast: bool = False) -> dict:
|
|
92
|
+
def run_all(quiet: bool = False, failfast: bool = False, timeout: float | None = 30.0) -> dict:
|
|
92
93
|
"""Discover and run every ``@tests``-decorated function.
|
|
93
94
|
|
|
94
95
|
Returns a dict with keys ``passed``, ``failed``, ``errors``, ``details``.
|
|
96
|
+
|
|
97
|
+
An ``async def`` test function is awaited, and judged on what it returns;
|
|
98
|
+
so is any test function whose call returns an awaitable (a coroutine, a
|
|
99
|
+
Future, an object with ``__await__``).
|
|
100
|
+
Every async test in one run shares ONE event loop, created here and closed
|
|
101
|
+
when the run ends, so an object bound to a loop (an ``asyncio.Queue``, a
|
|
102
|
+
pooled connection) works across assertions. Called from inside a running
|
|
103
|
+
event loop, an async test cannot be awaited without blocking that loop, so
|
|
104
|
+
it is reported as an error asking for a synchronous caller. An async test
|
|
105
|
+
still awaiting after ``timeout`` seconds (``None``: no limit) is cancelled
|
|
106
|
+
and reported as an error, after up to one second for its cleanup. The
|
|
107
|
+
timeout cannot pre-empt code that never yields (``time.sleep`` inside an
|
|
108
|
+
``async def``). A test that is still running after that second (it ignored
|
|
109
|
+
its cancellation) is abandoned: anything it raises afterwards, such as a
|
|
110
|
+
``SystemExit``, is no longer attributed to it and ends the run as it would
|
|
111
|
+
from a sync test; the same holds for a task a test leaves running. A test
|
|
112
|
+
that tampers with the runner's own loop internals is outside these
|
|
113
|
+
guarantees.
|
|
95
114
|
"""
|
|
96
115
|
results = {"passed": 0, "failed": 0, "errors": 0, "details": []}
|
|
116
|
+
runner = _AsyncRunner(timeout)
|
|
117
|
+
try:
|
|
118
|
+
return _run_all(results, runner, quiet, failfast)
|
|
119
|
+
except _RunAborted as stop:
|
|
120
|
+
raise stop.args[0] from None
|
|
121
|
+
finally:
|
|
122
|
+
runner.close()
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _run_all(results: dict, runner: "_AsyncRunner", quiet: bool, failfast: bool) -> dict:
|
|
97
126
|
|
|
98
127
|
for entry in _registry:
|
|
99
128
|
fn = entry["fn"]
|
|
@@ -106,7 +135,7 @@ def run_all(quiet: bool = False, failfast: bool = False) -> dict:
|
|
|
106
135
|
for assertion in entry["assertions"]:
|
|
107
136
|
label = _assertion_label(assertion, name)
|
|
108
137
|
try:
|
|
109
|
-
_run_assertion(fn, assertion)
|
|
138
|
+
_run_assertion(fn, assertion, runner)
|
|
110
139
|
results["passed"] += 1
|
|
111
140
|
results["details"].append({"name": label, "status": "passed"})
|
|
112
141
|
if not quiet:
|
|
@@ -135,36 +164,27 @@ def run_all(quiet: bool = False, failfast: bool = False) -> dict:
|
|
|
135
164
|
|
|
136
165
|
# ── Internals ───────────────────────────────────────────────────────
|
|
137
166
|
|
|
138
|
-
|
|
167
|
+
|
|
168
|
+
def _run_assertion(fn, assertion: dict, runner: _AsyncRunner):
|
|
139
169
|
atype = assertion["type"]
|
|
140
170
|
args = assertion["args"]
|
|
141
171
|
|
|
142
172
|
if atype == "equal":
|
|
143
|
-
result = fn
|
|
173
|
+
result = runner.call(fn, args)
|
|
144
174
|
expected = assertion["expected"]
|
|
145
175
|
if result != expected:
|
|
146
176
|
raise AssertionError(f"expected {expected!r}, got {result!r}")
|
|
147
177
|
|
|
148
178
|
elif atype == "raises":
|
|
149
|
-
|
|
150
|
-
try:
|
|
151
|
-
fn(*args)
|
|
152
|
-
except exc_class:
|
|
153
|
-
return # success
|
|
154
|
-
except Exception as other:
|
|
155
|
-
raise AssertionError(
|
|
156
|
-
f"expected {exc_class.__name__}, got {type(other).__name__}: {other}"
|
|
157
|
-
)
|
|
158
|
-
else:
|
|
159
|
-
raise AssertionError(f"expected {exc_class.__name__} to be raised")
|
|
179
|
+
_run_raises(fn, args, assertion["exception"], runner)
|
|
160
180
|
|
|
161
181
|
elif atype == "true":
|
|
162
|
-
result = fn
|
|
182
|
+
result = runner.call(fn, args)
|
|
163
183
|
if not result:
|
|
164
184
|
raise AssertionError(f"expected truthy, got {result!r}")
|
|
165
185
|
|
|
166
186
|
elif atype == "false":
|
|
167
|
-
result = fn
|
|
187
|
+
result = runner.call(fn, args)
|
|
168
188
|
if result:
|
|
169
189
|
raise AssertionError(f"expected falsy, got {result!r}")
|
|
170
190
|
|
|
@@ -172,6 +192,21 @@ def _run_assertion(fn, assertion: dict):
|
|
|
172
192
|
raise ValueError(f"unknown assertion type: {atype!r}")
|
|
173
193
|
|
|
174
194
|
|
|
195
|
+
def _run_raises(fn, args, exc_class: type, runner: _AsyncRunner):
|
|
196
|
+
try:
|
|
197
|
+
runner.call(fn, args)
|
|
198
|
+
except (_AsyncRunnerError, _RunAborted):
|
|
199
|
+
raise # the runner failed or the run is ending: never a pass
|
|
200
|
+
except exc_class:
|
|
201
|
+
return # success
|
|
202
|
+
except Exception as other:
|
|
203
|
+
raise AssertionError(
|
|
204
|
+
f"expected {exc_class.__name__}, got {type(other).__name__}: {other}"
|
|
205
|
+
)
|
|
206
|
+
else:
|
|
207
|
+
raise AssertionError(f"expected {exc_class.__name__} to be raised")
|
|
208
|
+
|
|
209
|
+
|
|
175
210
|
def _assertion_label(assertion: dict, fn_name: str) -> str:
|
|
176
211
|
atype = assertion["type"]
|
|
177
212
|
args = assertion["args"]
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Copyright (c) 2026 Code Infinity
|
|
2
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
3
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
6
|
+
"""Awaiting async inline tests for :mod:`tina4_python.Testing`.
|
|
7
|
+
|
|
8
|
+
One event loop per ``run_all()``; every test's awaitable runs as a task the
|
|
9
|
+
runner watches from outside the loop, so nothing a test does can cancel, hang
|
|
10
|
+
or abort the runner itself.
|
|
11
|
+
"""
|
|
12
|
+
import asyncio
|
|
13
|
+
import inspect
|
|
14
|
+
import numbers
|
|
15
|
+
|
|
16
|
+
# How long a cancelled test task gets to finish before the runner moves on.
|
|
17
|
+
_CANCEL_GRACE = 1.0
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class _AsyncRunnerError(RuntimeError):
|
|
21
|
+
"""The runner could not run a test, which is never the test's own exception."""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class _RunAborted(BaseException):
|
|
25
|
+
"""A SystemExit / KeyboardInterrupt that did not come from the test being
|
|
26
|
+
judged (a Ctrl-C, or a task an earlier test left running). It ends the run,
|
|
27
|
+
as it would from a sync test, and no assertion can catch it as its own."""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _check_timeout(timeout):
|
|
31
|
+
"""Seconds as a float (infinity allowed), or None for no limit."""
|
|
32
|
+
if timeout is None:
|
|
33
|
+
return None
|
|
34
|
+
if isinstance(timeout, bool) or not isinstance(timeout, numbers.Real):
|
|
35
|
+
raise TypeError(f"timeout must be a number of seconds or None, got {timeout!r}")
|
|
36
|
+
try:
|
|
37
|
+
seconds = float(timeout)
|
|
38
|
+
except OverflowError:
|
|
39
|
+
return None # larger than any float: no limit
|
|
40
|
+
if seconds != seconds or seconds < 0:
|
|
41
|
+
raise ValueError(f"timeout must be zero or more seconds, got {timeout!r}")
|
|
42
|
+
return seconds
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _run_for(loop, tasks, timeout) -> None:
|
|
46
|
+
"""Run ``loop`` until every task in ``tasks`` is done or ``timeout`` passes.
|
|
47
|
+
|
|
48
|
+
It waits on a plain future, not a task, so nothing a test does through
|
|
49
|
+
``asyncio.all_tasks()`` (a "cancel every other task" teardown) can reach the
|
|
50
|
+
runner itself. An ordinary exception out of the loop (a test stopped it) is
|
|
51
|
+
the runner's failure, never the test's own exception.
|
|
52
|
+
"""
|
|
53
|
+
pending = [t for t in tasks if not t.done()]
|
|
54
|
+
if not pending:
|
|
55
|
+
return
|
|
56
|
+
waiter = loop.create_future()
|
|
57
|
+
|
|
58
|
+
def wake(_=None, expired=False):
|
|
59
|
+
if not waiter.done() and (expired or all(t.done() for t in pending)):
|
|
60
|
+
waiter.set_result(None)
|
|
61
|
+
|
|
62
|
+
for t in pending:
|
|
63
|
+
t.add_done_callback(wake)
|
|
64
|
+
handle = loop.call_later(timeout, wake, None, True) if timeout is not None else None
|
|
65
|
+
try:
|
|
66
|
+
loop.run_until_complete(waiter)
|
|
67
|
+
except (Exception, asyncio.CancelledError) as exc:
|
|
68
|
+
raise _AsyncRunnerError(f"the test runner's event loop failed: {exc!r}") from exc
|
|
69
|
+
finally:
|
|
70
|
+
if handle is not None:
|
|
71
|
+
handle.cancel()
|
|
72
|
+
for t in pending:
|
|
73
|
+
t.remove_done_callback(wake)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _settle(loop, tasks) -> None:
|
|
77
|
+
"""Give ``tasks`` the cancel grace while the run is closing. Results are
|
|
78
|
+
already in: a SystemExit from a task an earlier test abandoned must not turn
|
|
79
|
+
a failed run into exit status 0, nor skip the cleanup of the others."""
|
|
80
|
+
try:
|
|
81
|
+
_run_for(loop, tasks, _CANCEL_GRACE)
|
|
82
|
+
except (_AsyncRunnerError, SystemExit):
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class _AsyncRunner:
|
|
87
|
+
"""Runs awaitable test results to completion on one loop per run_all()."""
|
|
88
|
+
|
|
89
|
+
def __init__(self, timeout: float | None = 30.0):
|
|
90
|
+
self._timeout = _check_timeout(timeout)
|
|
91
|
+
self._loop = None
|
|
92
|
+
|
|
93
|
+
def call(self, fn, args):
|
|
94
|
+
"""Call ``fn(*args)``; an awaitable result is awaited and its value returned."""
|
|
95
|
+
result = fn(*args)
|
|
96
|
+
if not inspect.isawaitable(result):
|
|
97
|
+
return result
|
|
98
|
+
try:
|
|
99
|
+
asyncio.get_running_loop()
|
|
100
|
+
except RuntimeError:
|
|
101
|
+
pass
|
|
102
|
+
else:
|
|
103
|
+
if inspect.iscoroutine(result):
|
|
104
|
+
result.close() # never started: no "was never awaited" warning
|
|
105
|
+
raise _AsyncRunnerError(
|
|
106
|
+
"async test function: run_all() was called from inside a running "
|
|
107
|
+
"event loop and cannot await it; call run_all() from synchronous code"
|
|
108
|
+
)
|
|
109
|
+
return self._await(result)
|
|
110
|
+
|
|
111
|
+
def _await(self, result):
|
|
112
|
+
if self._loop is None:
|
|
113
|
+
self._loop = asyncio.new_event_loop()
|
|
114
|
+
# A task watched from outside, not wait_for: a TimeoutError the test
|
|
115
|
+
# raises itself must reach the assertion as the test's own exception.
|
|
116
|
+
try:
|
|
117
|
+
task = asyncio.ensure_future(result, loop=self._loop)
|
|
118
|
+
except Exception as exc: # a foreign-loop future, a broken task factory
|
|
119
|
+
raise _AsyncRunnerError(f"could not schedule the async test: {exc!r}") from exc
|
|
120
|
+
try:
|
|
121
|
+
_run_for(self._loop, [task], self._timeout)
|
|
122
|
+
except _AsyncRunnerError:
|
|
123
|
+
self._stop(task) # e.g. the test stopped the loop: it must not run on
|
|
124
|
+
raise
|
|
125
|
+
except BaseException as exc:
|
|
126
|
+
# A SystemExit / KeyboardInterrupt out of the loop is the test's own
|
|
127
|
+
# only when its task finished with exactly that exception.
|
|
128
|
+
if task.done() and not task.cancelled() and task.exception() is exc:
|
|
129
|
+
raise
|
|
130
|
+
self._stop(task)
|
|
131
|
+
raise _RunAborted(exc) from None
|
|
132
|
+
return self._judge(task)
|
|
133
|
+
|
|
134
|
+
def _stop(self, task):
|
|
135
|
+
if not task.done():
|
|
136
|
+
task.cancel()
|
|
137
|
+
try:
|
|
138
|
+
_run_for(self._loop, [task], _CANCEL_GRACE)
|
|
139
|
+
except _AsyncRunnerError:
|
|
140
|
+
pass
|
|
141
|
+
|
|
142
|
+
def _judge(self, task):
|
|
143
|
+
if not task.done():
|
|
144
|
+
# Bounded: a test that swallows CancelledError must not hang the run.
|
|
145
|
+
self._stop(task)
|
|
146
|
+
raise _AsyncRunnerError(f"async test function did not finish within {self._timeout}s")
|
|
147
|
+
if task.cancelled():
|
|
148
|
+
# The test cancelled itself (raised CancelledError). That is a
|
|
149
|
+
# BaseException and would abort the whole run; report it instead.
|
|
150
|
+
raise _AsyncRunnerError("async test function was cancelled")
|
|
151
|
+
return task.result()
|
|
152
|
+
|
|
153
|
+
def close(self):
|
|
154
|
+
if self._loop is None:
|
|
155
|
+
return
|
|
156
|
+
loop, self._loop = self._loop, None
|
|
157
|
+
try:
|
|
158
|
+
loop.set_task_factory(None) # a test may have installed a broken one
|
|
159
|
+
pending = asyncio.all_tasks(loop)
|
|
160
|
+
for task in pending:
|
|
161
|
+
task.cancel()
|
|
162
|
+
# Twice: a SystemExit from one abandoned task stops the loop before
|
|
163
|
+
# the others have run their cleanup.
|
|
164
|
+
_settle(loop, pending)
|
|
165
|
+
_settle(loop, pending)
|
|
166
|
+
# Bounded the same way: a generator whose cleanup swallows
|
|
167
|
+
# CancelledError must not hang the run.
|
|
168
|
+
shutdown = loop.create_task(loop.shutdown_asyncgens())
|
|
169
|
+
_settle(loop, [shutdown])
|
|
170
|
+
shutdown.cancel()
|
|
171
|
+
_settle(loop, [shutdown])
|
|
172
|
+
finally:
|
|
173
|
+
loop.close()
|
|
@@ -495,12 +495,12 @@ def generate_context(tool_name: str = "claude-code") -> str:
|
|
|
495
495
|
|
|
496
496
|
@get("/api/users")
|
|
497
497
|
async def list_users(request, response):
|
|
498
|
-
return response({
|
|
498
|
+
return response({"users": []})
|
|
499
499
|
|
|
500
500
|
@post("/api/users")
|
|
501
501
|
@noauth()
|
|
502
502
|
async def create_user(request, response):
|
|
503
|
-
return response({
|
|
503
|
+
return response({"created": request.body["name"]}, 201)'''
|
|
504
504
|
|
|
505
505
|
_orm_example = '''from tina4_python.orm import ORM, IntegerField, StringField
|
|
506
506
|
|
|
@@ -317,6 +317,18 @@ def _cors_warn_once(reason: str, message: str) -> None:
|
|
|
317
317
|
logging.getLogger("tina4").warning(message)
|
|
318
318
|
|
|
319
319
|
|
|
320
|
+
_CORS_ENV_KEYS = (
|
|
321
|
+
"TINA4_CORS_ORIGINS", "TINA4_CORS_METHODS", "TINA4_CORS_HEADERS",
|
|
322
|
+
"TINA4_CORS_MAX_AGE", "TINA4_CORS_CREDENTIALS",
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
def cors_env() -> tuple:
|
|
327
|
+
"""The TINA4_CORS_* settings ``CorsMiddleware`` reads, as they stand now."""
|
|
328
|
+
return tuple(os.environ.get(key) for key in _CORS_ENV_KEYS)
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
320
332
|
class CorsMiddleware:
|
|
321
333
|
"""CORS handler — reads config from env, injects headers.
|
|
322
334
|
|
|
@@ -360,6 +372,10 @@ class CorsMiddleware:
|
|
|
360
372
|
return request, response
|
|
361
373
|
|
|
362
374
|
def __init__(self):
|
|
375
|
+
# What this instance was built from; the server's singleton is rebuilt
|
|
376
|
+
# in place when the environment no longer matches it (a policy set
|
|
377
|
+
# only in .env).
|
|
378
|
+
self._env_read = cors_env()
|
|
363
379
|
# Default is EMPTY, not "*" — deny by default (ADR-0018).
|
|
364
380
|
self.origins = os.environ.get("TINA4_CORS_ORIGINS", "")
|
|
365
381
|
self.methods = os.environ.get(
|
|
@@ -373,6 +389,9 @@ class CorsMiddleware:
|
|
|
373
389
|
self.credentials = os.environ.get(
|
|
374
390
|
"TINA4_CORS_CREDENTIALS", "false"
|
|
375
391
|
).lower() in ("true", "1", "yes")
|
|
392
|
+
# Everything as built, so a refresh can tell the instance was changed
|
|
393
|
+
# by hand (a policy field, or an override set on it) and leave it be.
|
|
394
|
+
self._as_built = dict(vars(self))
|
|
376
395
|
|
|
377
396
|
@property
|
|
378
397
|
def allowed_origins(self) -> list:
|
|
@@ -33,7 +33,9 @@ from tina4_python.core.request import (
|
|
|
33
33
|
)
|
|
34
34
|
from tina4_python.core.response import Response, unsafe_header_reason
|
|
35
35
|
from tina4_python.core.router import Router
|
|
36
|
-
from tina4_python.core.middleware import
|
|
36
|
+
from tina4_python.core.middleware import (
|
|
37
|
+
CorsMiddleware, RateLimiter, SecurityHeadersMiddleware, cors_env,
|
|
38
|
+
)
|
|
37
39
|
from tina4_python.debug import Log, set_request_id, get_request_id, sanitize_request_id, clear_request_id
|
|
38
40
|
from tina4_python import __version__
|
|
39
41
|
|
|
@@ -42,6 +44,27 @@ _cors = CorsMiddleware()
|
|
|
42
44
|
_rate_limiter = RateLimiter()
|
|
43
45
|
|
|
44
46
|
|
|
47
|
+
def _refresh_cors_from_env() -> None:
|
|
48
|
+
"""Re-read TINA4_CORS_* into the CORS singleton if they changed since it was built.
|
|
49
|
+
|
|
50
|
+
``_cors`` is built at import, before any entry point loads ``.env``, so a
|
|
51
|
+
policy set only in ``.env`` was never applied. Every entry point that loads
|
|
52
|
+
``.env`` (``run()``/``asgi()`` via ``_load_project_env``, and ``TestClient``)
|
|
53
|
+
calls this afterwards. The instance is updated in place, so a reference
|
|
54
|
+
held elsewhere stays current. Only a plain ``CorsMiddleware`` that
|
|
55
|
+
is exactly as it was built is touched; anything else is left as it is: a
|
|
56
|
+
subclass, a test double, or an instance changed by hand.
|
|
57
|
+
"""
|
|
58
|
+
if type(_cors) is not CorsMiddleware:
|
|
59
|
+
return
|
|
60
|
+
if getattr(_cors, "_env_read", None) == cors_env():
|
|
61
|
+
return
|
|
62
|
+
as_built = getattr(_cors, "_as_built", None)
|
|
63
|
+
if as_built is None or {k: v for k, v in vars(_cors).items() if k != "_as_built"} != as_built:
|
|
64
|
+
return
|
|
65
|
+
_cors.__dict__.update(vars(CorsMiddleware()))
|
|
66
|
+
|
|
67
|
+
|
|
45
68
|
# ContextVar to signal that the current request is being served on the AI dev port
|
|
46
69
|
_ai_port_ctx: contextvars.ContextVar[bool] = contextvars.ContextVar("_ai_port_ctx", default=False)
|
|
47
70
|
|
|
@@ -3144,6 +3167,7 @@ def _load_project_env() -> None:
|
|
|
3144
3167
|
from tina4_python.dotenv import load_env
|
|
3145
3168
|
load_env(override=False)
|
|
3146
3169
|
_apply_health_path_from_env()
|
|
3170
|
+
_refresh_cors_from_env()
|
|
3147
3171
|
|
|
3148
3172
|
|
|
3149
3173
|
|
|
@@ -721,6 +721,27 @@ def get_api_handlers() -> dict:
|
|
|
721
721
|
}
|
|
722
722
|
|
|
723
723
|
|
|
724
|
+
# sys.platform values on Apple's kernel, as the stdlib lists them (ctypes.util).
|
|
725
|
+
_APPLE_PLATFORMS = ("darwin", "ios", "tvos", "watchos")
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
def _peak_rss_mb() -> float:
|
|
729
|
+
"""Peak resident set size of this process, in MB.
|
|
730
|
+
|
|
731
|
+
``ru_maxrss`` is in bytes on Apple's kernel (macOS, and the ``ios``,
|
|
732
|
+
``tvos`` and ``watchos`` values newer Pythons report) and in kilobytes
|
|
733
|
+
everywhere else (Linux, Android, the BSDs), so it is divided by 1024 twice
|
|
734
|
+
there and once elsewhere. Raises ImportError where there is no
|
|
735
|
+
``resource`` module (Windows).
|
|
736
|
+
"""
|
|
737
|
+
import resource
|
|
738
|
+
import sys
|
|
739
|
+
|
|
740
|
+
peak = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
|
|
741
|
+
divisor = 1024.0 * 1024.0 if sys.platform in _APPLE_PLATFORMS else 1024.0
|
|
742
|
+
return round(peak / divisor, 2)
|
|
743
|
+
|
|
744
|
+
|
|
724
745
|
async def _api_status(request, response):
|
|
725
746
|
"""System status overview."""
|
|
726
747
|
import sys
|
|
@@ -740,11 +761,7 @@ async def _api_status(request, response):
|
|
|
740
761
|
memory_usage_mb = 0.0
|
|
741
762
|
peak_memory_mb = 0.0
|
|
742
763
|
try:
|
|
743
|
-
|
|
744
|
-
usage = resource.getrusage(resource.RUSAGE_SELF)
|
|
745
|
-
# ru_maxrss is KB on Linux, bytes on macOS
|
|
746
|
-
scale = 1024.0 if sys.platform == "darwin" else 1.0
|
|
747
|
-
peak_memory_mb = round(usage.ru_maxrss * scale / 1024.0 / 1024.0, 2)
|
|
764
|
+
peak_memory_mb = _peak_rss_mb()
|
|
748
765
|
memory_usage_mb = peak_memory_mb # resource has no current-rss field
|
|
749
766
|
except Exception:
|
|
750
767
|
pass
|
|
@@ -1373,9 +1390,7 @@ async def _api_system(request, response):
|
|
|
1373
1390
|
|
|
1374
1391
|
# Memory info
|
|
1375
1392
|
try:
|
|
1376
|
-
|
|
1377
|
-
usage = resource.getrusage(resource.RUSAGE_SELF)
|
|
1378
|
-
info["memory_mb"] = round(usage.ru_maxrss / 1024 / 1024, 2) if sys.platform == "linux" else round(usage.ru_maxrss / 1024 / 1024, 2)
|
|
1393
|
+
info["memory_mb"] = _peak_rss_mb()
|
|
1379
1394
|
except (ImportError, AttributeError):
|
|
1380
1395
|
info["memory_mb"] = None
|
|
1381
1396
|
|
|
@@ -3221,7 +3236,7 @@ async def _api_mcp_endpoint(request, response):
|
|
|
3221
3236
|
method = (getattr(request, "method", "") or "GET").upper()
|
|
3222
3237
|
|
|
3223
3238
|
if method == "POST":
|
|
3224
|
-
outcome = server.
|
|
3239
|
+
outcome = await server.dispatch_http_async(request.body, _mcp_session_header(request))
|
|
3225
3240
|
return _mcp_apply(response, outcome)
|
|
3226
3241
|
|
|
3227
3242
|
if method == "DELETE":
|
|
@@ -3246,7 +3261,7 @@ async def _api_mcp_message(request, response):
|
|
|
3246
3261
|
server = _get_default_server()
|
|
3247
3262
|
params = getattr(request, "params", None) or {}
|
|
3248
3263
|
session_id = params.get("sessionId") or _mcp_session_header(request)
|
|
3249
|
-
outcome = server.
|
|
3264
|
+
outcome = await server.dispatch_sse_message_async(request.body, session_id)
|
|
3250
3265
|
return _mcp_apply(response, outcome)
|
|
3251
3266
|
|
|
3252
3267
|
|