swiftpy-framework 0.2.2__tar.gz → 0.3.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.
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/.env.example +2 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/.github/workflows/ci.yml +0 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/CHANGELOG.md +19 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/PKG-INFO +16 -12
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/README.md +15 -11
- swiftpy_framework-0.3.0/app/ai/agents/assistant_agent.py +43 -0
- swiftpy_framework-0.3.0/app/ai/pipelines/.gitkeep +1 -0
- swiftpy_framework-0.3.0/app/ai/providers/.gitkeep +1 -0
- swiftpy_framework-0.3.0/app/ai/tools/system_status_tool.py +33 -0
- swiftpy_framework-0.3.0/app/ai/vectorstores/.gitkeep +1 -0
- swiftpy_framework-0.3.0/app/http/controllers/user_controller.py +23 -0
- swiftpy_framework-0.3.0/app/http/middleware/admin_middleware.py +67 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/http/middleware/auth_middleware.py +4 -0
- swiftpy_framework-0.3.0/app/http/resources/user_resource.py +32 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/schemas/user_schema.py +10 -1
- swiftpy_framework-0.3.0/app/services/user_service.py +44 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/ai.py +5 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-14-installation-quick-start.md +21 -9
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-ai-subsystem.md +36 -20
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-authentication-and-security.md +2 -2
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-filesystem-storage-and-mail.md +1 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-http-routing-middleware-and-exceptions.md +10 -5
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-websockets-and-admin.md +3 -111
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-19-application-schemas.md +2 -2
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-19-cli-and-testing.md +3 -0
- swiftpy_framework-0.3.0/documentations/2026-11-21-application-architecture-and-project-structure.md +397 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-21-cors.md +2 -2
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/main.py +2 -6
- swiftpy_framework-0.3.0/prompts/classify.py +17 -0
- swiftpy_framework-0.3.0/prompts/summarise.py +17 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/pyproject.toml +1 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/routes/api.py +2 -11
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/__init__.py +14 -12
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/__init__.py +4 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/client.py +57 -8
- swiftpy_framework-0.3.0/swiftpy/ai/prompts/__init__.py +6 -0
- swiftpy_framework-0.3.0/swiftpy/ai/prompts/loader.py +617 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/auth/api_key_guard.py +6 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/auth/auth_manager.py +43 -13
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/auth/token_blacklist.py +21 -6
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/auth/user_context.py +1 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/commands/make.py +256 -27
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/commands/new.py +285 -219
- swiftpy_framework-0.3.0/swiftpy/console/stubs/agent.stub +40 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/controller.stub +3 -1
- swiftpy_framework-0.3.0/swiftpy/console/stubs/prompt.stub +14 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/repository.stub +0 -2
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/resource.stub +7 -4
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/schema.stub +1 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/service.stub +1 -3
- swiftpy_framework-0.3.0/swiftpy/console/stubs/tool.stub +35 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/core/application.py +334 -24
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/http/router.py +755 -117
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_observability.py +11 -51
- swiftpy_framework-0.3.0/tests/ai/test_prompts.py +413 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_prompts_security.py +56 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/app/test_application_providers.py +13 -5
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/app/test_starter_auth.py +78 -1
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_refresh_and_logout.py +60 -25
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/console/test_new_command.py +112 -58
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/console/test_phase9_cli_remediation.py +1 -13
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/console/test_stubs_and_make.py +66 -4
- swiftpy_framework-0.3.0/tests/http/test_controller_routing.py +416 -0
- swiftpy_framework-0.3.0/tests/logging/__init__.py +1 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/uv.lock +1 -1
- swiftpy_framework-0.2.2/app/http/middleware/admin_middleware.py +0 -45
- swiftpy_framework-0.2.2/app/services/user_service.py +0 -27
- swiftpy_framework-0.2.2/swiftpy/admin/__init__.py +0 -50
- swiftpy_framework-0.2.2/swiftpy/admin/auth.py +0 -538
- swiftpy_framework-0.2.2/swiftpy/admin/registry.py +0 -567
- swiftpy_framework-0.2.2/swiftpy/admin/views.py +0 -1583
- swiftpy_framework-0.2.2/swiftpy/ai/prompts/__init__.py +0 -6
- swiftpy_framework-0.2.2/swiftpy/ai/prompts/loader.py +0 -343
- swiftpy_framework-0.2.2/tests/admin/test_admin.py +0 -899
- swiftpy_framework-0.2.2/tests/ai/test_prompts.py +0 -147
- swiftpy_framework-0.2.2/tests/websockets/__init__.py +0 -0
- swiftpy_framework-0.2.2/views/admin/dashboard.html +0 -102
- swiftpy_framework-0.2.2/views/admin/login.html +0 -87
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/.dockerignore +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/.github/workflows/publish.yml +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/.gitignore +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/CONTRIBUTING.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/Dockerfile +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/LICENSE +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/__init__.py +0 -0
- /swiftpy_framework-0.2.2/tests/logging/__init__.py → /swiftpy_framework-0.3.0/app/ai/observers/.gitkeep +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/events/user_registered.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/http/handler/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/http/middleware/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/http/middleware/test_middleware.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/http/requests/create_user_request.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/jobs/send_notification_job.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/listeners/send_welcome_notification.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/mail/welcome_email.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/models/user.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/providers/app_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/providers/auth_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/providers/cache_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/providers/database_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/providers/event_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/providers/filesystem_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/providers/mail_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/providers/queue_service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/app/repositories/user_repository.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/bootstrap/cache/.gitkeep +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/app.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/auth.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/cache.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/cors.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/database.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/events.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/filesystems.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/logging.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/mail.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/config/queue.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/database/migrations/2026_01_01_000000_create_users_table.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/database/seeders/database_seeder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/docker-compose.yml +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-cache-events-and-queues.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-core-application-di-and-config.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-database-query-builder-and-migrations.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-orm-models-and-relationships.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-15-validation-and-form-requests.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-19-database-schema-and-blueprint.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-20-error-handling.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-20-logging.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/documentations/2026-11-20-request-and-responses.md +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/red-black.png +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/routes/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/.gitignore +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/_deterministic.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/agents/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/agents/base_agent.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/agents/memory.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/conversation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/embeddings.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/history_strategies.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/middleware.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/observability/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/observability/drivers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/observability/observer.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/pool.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/pricing.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/providers/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/providers/anthropic_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/providers/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/providers/openai_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/rag/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/rag/context_formatter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/rag/pipeline_builder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/rag/reranker.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/rag/result.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/rag/retriever.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/redis_store.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/streaming.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/tools/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/tools/base_tool.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/tools/first_party.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/tools/tool_loop.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/vectorstore/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/vectorstore/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/vectorstore/chroma_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/vectorstore/in_memory_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/vectorstore/lancedb_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/vectorstore/pgvector_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/vectorstore/pinecone_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/ai/vectorstore/qdrant_adapter.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/auth/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/auth/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/auth/jwt_guard.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/auth/jwt_issuer.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/auth_manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/cache/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/cache/cache.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/cache/driver.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/cache/drivers/memory.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/cache/drivers/redis.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/cli.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/commands/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/commands/cache.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/commands/migrate.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/commands/queue.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/commands/seed.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/commands/start.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/commands/storage.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/loader.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/event.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/job.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/listener.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/mail.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/middleware.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/migration.alter.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/migration.api_keys.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/migration.blank.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/migration.create.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/migration.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/migration.update.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/model.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/provider.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/request.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/console/stubs/seeder.stub +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/core/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/core/bootstrap.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/core/config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/core/container.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/core/container_exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/core/context.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/core/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/core/providers/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/identifiers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/migrations/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/migrations/blueprint.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/migrations/lock.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/migrations/migration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/migrations/migrator.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/migrations/schema.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/orm/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/orm/fields.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/orm/model.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/orm/registry.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/orm/relationships.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/pagination/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/pagination/contracts.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/pagination/paginator.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/pagination/simple_paginator.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/pool.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/query_builder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/seeder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/database/transaction.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/events/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/events/dispatcher.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/events/redis_bus.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/disk.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/drivers/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/drivers/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/drivers/local.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/drivers/s3.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/events.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/metadata.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/paths.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/uploads/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/uploads/handlers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/uploads/uploaded_file.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/uploads/validators.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/filesystem/visibility.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/helpers/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/helpers/helper.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/http/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/http/middleware.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/http/request.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/http/response.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/logging/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/logging/channels.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/logging/log.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/logging/manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/attachments.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/envelope.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/facade.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/mailable.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/message.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/models.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/queue/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/queue/job.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/service_provider.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/templates/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/templates/renderer.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/api/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/api/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/api/mailgun.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/api/resend.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/api/sendgrid.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/base.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/console.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/sendmail.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/mail/transports/smtp.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/queue/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/queue/dispatcher.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/queue/job.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/queue/worker.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/support/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/support/hashing.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/support/keys.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/support/redis_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/support/strings.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/testing/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/testing/fakes/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/testing/fakes/ai_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/testing/fakes/vectorstore_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/testing/fixtures.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/testing/http_client.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/testing/test_case.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/form_request.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/protocols.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/rules/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/rules/builtin.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/rules/exists.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/rules/registry.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/rules/required.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/rules/unique.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/validation/validator.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/websockets/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/websockets/connection.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/swiftpy/websockets/manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/__init__.py +0 -0
- {swiftpy_framework-0.2.2/tests/admin → swiftpy_framework-0.3.0/tests/ai}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/conftest.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/integration/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/integration/test_chroma.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/integration/test_lancedb.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/integration/test_pinecone.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/integration/test_qdrant.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/integration/test_rag_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_agents.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_ai_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_ai_fake_isolation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_client.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_conversation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_embeddings.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_middleware.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_middleware_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_observability_resilience.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_phase7_ai_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_phase8_agents_tools_prompts_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_phase8_rag_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_phase8_vectorstore_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_providers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_rag.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_streaming.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_tools.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_vectorstore.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/ai/test_vectorstore_adapters.py +0 -0
- {swiftpy_framework-0.2.2/tests/ai → swiftpy_framework-0.3.0/tests/app}/__init__.py +0 -0
- {swiftpy_framework-0.2.2/tests/app → swiftpy_framework-0.3.0/tests/auth}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_api_key_guard.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_auth_context_on_issue.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_auth_manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_auth_proxy.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_auth_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_auth_security.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_jwt_defaults.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_jwt_issuer.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_password_hashing.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/auth/test_token_blacklist.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/benchmarks.py +0 -0
- {swiftpy_framework-0.2.2/tests/auth → swiftpy_framework-0.3.0/tests/cache}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/cache/test_cache_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/cache/test_cache_manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/cache/test_driver_correctness.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/cache/test_memory_cache.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/cache/test_redis_cache.py +0 -0
- {swiftpy_framework-0.2.2/tests/cache → swiftpy_framework-0.3.0/tests/concurrency}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/concurrency/test_circular_dependency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/concurrency/test_container_semantics.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/concurrency/test_resolution.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/concurrency/test_resolution2.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/conftest.py +0 -0
- {swiftpy_framework-0.2.2/tests/concurrency → swiftpy_framework-0.3.0/tests/console}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/console/test_cache_commands.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/console/test_cli.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/console/test_start.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/console/test_storage_command.py +0 -0
- {swiftpy_framework-0.2.2/tests/console → swiftpy_framework-0.3.0/tests/core}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/core/test_application_config_isolation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/core/test_core_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/core/test_exceptions.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/core/test_helpers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/core/test_instance_singletons.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/core/test_lifespan.py +0 -0
- {swiftpy_framework-0.2.2/tests/core → swiftpy_framework-0.3.0/tests/database}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_orm_expansion.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_orm_vector.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_pagination_and_grouping.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_pagination_pg_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_pgvector_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_phase4_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_query_expansion.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_query_expansion_pg_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_seeder.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/database/test_sequence_gaps.py +0 -0
- {swiftpy_framework-0.2.2/tests/database → swiftpy_framework-0.3.0/tests/db}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/db/load_test_database.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/db/load_test_database2.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/db/test_arbitrary_primary_keys.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/db/test_identifiers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/db/test_mass_writes.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/db/test_pool_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/db/test_query_builder_terminals.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/db/test_sql_injections.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/db/test_transaction_isolation.py +0 -0
- {swiftpy_framework-0.2.2/tests/db → swiftpy_framework-0.3.0/tests/docs}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/docs/test_readme_examples.py +0 -0
- {swiftpy_framework-0.2.2/tests/docs → swiftpy_framework-0.3.0/tests/e2e}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/e2e/test_concurrent_auth.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/e2e/test_crud_auth_e2e.py +0 -0
- {swiftpy_framework-0.2.2/tests/e2e → swiftpy_framework-0.3.0/tests/events}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/events/test_event_dispatcher.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/events/test_model_events.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/events/test_redis_bus.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/events/test_redis_bus_reliability.py +0 -0
- {swiftpy_framework-0.2.2/tests/events → swiftpy_framework-0.3.0/tests/filesystem}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_cli_storage_link.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_disk.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_filesystem_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_filesystem_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_http_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_local_driver.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_multipart.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_paths.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_phase6_filesystem_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_s3_driver.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_signed_urls.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_storage_facade.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_uploaded_file.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/filesystem/test_validation.py +0 -0
- {swiftpy_framework-0.2.2/tests/filesystem → swiftpy_framework-0.3.0/tests/http}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/http/test_error_pipeline.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/http/test_http_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/http/test_include_router.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/http/test_request.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/http/test_request_router_abort.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/http/test_response.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/http/test_route_groups.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/http/test_router.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/http/test_router_405_and_has_file.py +0 -0
- {swiftpy_framework-0.2.2/tests/http → swiftpy_framework-0.3.0/tests/integration}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/integration/test_queue_event_websocket.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/logging/test_logging.py +0 -0
- {swiftpy_framework-0.2.2/tests/integration → swiftpy_framework-0.3.0/tests/mail}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_api_transports.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_attachments.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_cli_make_mail.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_console_transport.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_envelope.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_facade_and_fake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_mailable.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_manager_and_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_message.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_phase6_mail_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_queue_integration.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_service_provider_and_helpers.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_smtp_and_sendmail.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/mail/test_templates.py +0 -0
- {swiftpy_framework-0.2.2/tests/mail → swiftpy_framework-0.3.0/tests/migrations}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/migrations/test_migrations.py +0 -0
- {swiftpy_framework-0.2.2/tests/migrations → swiftpy_framework-0.3.0/tests/orm}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/orm/test_defaults_dirty.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/orm/test_eager_loading.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/orm/test_hidden.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/orm/test_instance_update.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/orm/test_mass_assignment.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/orm/test_model_events_transaction.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/orm/test_relationships_hardening.py +0 -0
- {swiftpy_framework-0.2.2/tests/orm → swiftpy_framework-0.3.0/tests/queue}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/queue/test_after_commit.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/queue/test_phase5_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/queue/test_poison_messages.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/queue/test_queue.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/queue/test_reliability.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/queue/test_signing.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/queue/test_worker_behavior.py +0 -0
- {swiftpy_framework-0.2.2/tests/queue → swiftpy_framework-0.3.0/tests/security}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/security/test_security_audit.py +0 -0
- {swiftpy_framework-0.2.2/tests/security → swiftpy_framework-0.3.0/tests/stress}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/stress/test_context_isolation.py +0 -0
- {swiftpy_framework-0.2.2/tests/stress → swiftpy_framework-0.3.0/tests/support}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/support/test_redis_config.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/support/test_strings.py +0 -0
- {swiftpy_framework-0.2.2/tests/support → swiftpy_framework-0.3.0/tests/testing}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/testing/test_fixtures.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/testing/test_phase9_testing_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/testing/test_test_client.py +0 -0
- {swiftpy_framework-0.2.2/tests/testing → swiftpy_framework-0.3.0/tests/typing}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/typing/test_orm_typing.py +0 -0
- {swiftpy_framework-0.2.2/tests/typing → swiftpy_framework-0.3.0/tests/validation}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/validation/test_db_rules.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/validation/test_form_request_fail_closed.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/validation/test_form_request_pipeline.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/validation/test_phase6_validation_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/validation/test_rules_hardening.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/validation/test_validation_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/validation/test_validation_ergonomics.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/validation/test_validator_rules.py +0 -0
- {swiftpy_framework-0.2.2/tests/validation → swiftpy_framework-0.3.0/tests/websockets}/__init__.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/websockets/test_broadcast.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/websockets/test_handshake.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/websockets/test_lifecycle.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/websockets/test_websocket_concurrency.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/websockets/test_websocket_connection.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/websockets/test_websocket_manager.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/websockets/test_websocket_remediation.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/tests/websockets/test_websocket_routing_and_lifecycle.py +0 -0
- {swiftpy_framework-0.2.2 → swiftpy_framework-0.3.0}/views/mail/template.html +0 -0
|
@@ -102,7 +102,6 @@ jobs:
|
|
|
102
102
|
cd /tmp && /tmp/swiftpy-wheel-smoke/bin/python -c '
|
|
103
103
|
import asyncio
|
|
104
104
|
import swiftpy
|
|
105
|
-
import swiftpy.admin
|
|
106
105
|
import swiftpy.testing
|
|
107
106
|
from swiftpy import Application, Request, json_response
|
|
108
107
|
from swiftpy.ai.client import AI, AIClient
|
|
@@ -4,6 +4,25 @@ All notable changes to SwiftPY will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.3.0] - 2026-11-22
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Routing & Controller DI Ergonomics (`swiftpy.http.router`, `swiftpy.core.application`):** Added dual decorator + direct handler binding across `Router`, `RouteGroup`, and `Application` (`router.get("/posts", PostController.index)`, `@router.get("/posts")`, `app.get("/posts", PostController.index)`), plus automatic per-request container resolution for unbound controller methods (`controller_cls` resolved once cleanly at compile/dispatch and instantiated isolated per request). Rejects passing raw controller classes directly with `RouteRegistrationError`.
|
|
11
|
+
- **Prompt Versioning & `messages` Templates (`swiftpy.ai.prompts`, `swiftpy.ai.client`):** Added `Prompt` facade (`Prompt.load("summarise.v2", ...)`, `await Prompt.aload(...)`, `Prompt.load_messages(...)`, `Prompt.aload_messages(...)`), module-level `messages` list support (`.py` sequences or zero-arg callables of role/content dicts or `Message` objects), `ai.prompts.path` config resolution, multi-message appending in `AIClient.prompt()` / `AIClient.aprompt()`, compiled cache round-tripping for `messages` lists and dotted versioned names, and exports via `swiftpy.ai.prompts`, `swiftpy.ai`, and top-level `swiftpy`.
|
|
12
|
+
- **CLI AI Generators (`make:agent`, `make:tool`, `make:prompt`):** Added `agent.stub`, `tool.stub`, `prompt.stub` and `swiftpy make:agent`, `swiftpy make:tool`, and `swiftpy make:prompt` (supporting nested folders and versioned `.v2` filenames such as `summarise.v2` with strict path-traversal and extension guards).
|
|
13
|
+
- **Starter Scaffolding Alignment (`swiftpy new`):** Scaffolded `app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/` (`AssistantAgent` and `SystemStatusTool`), `prompts/{summarise.py,classify.py}`, `UserController` + `UserResource` + `UserResponseSchema` -> `routes/api.py` (`router.get("/users", UserController.index)`), and `config/ai.py` (`prompts.path`, `prompts.cache`, `http`).
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- **Stubs & Resource Invariance (`swiftpy/console/stubs/`):** Refined `controller.stub`, `service.stub`, `repository.stub`, `schema.stub`, and `resource.stub` (typing `collection(cls, items: Iterable[Any])` for `mypy --strict` variance compatibility and removing unused imports).
|
|
17
|
+
- **Packaging:** Bumped `swiftpy-framework` package version and `swiftpy new` dependency floor to `0.3.0`.
|
|
18
|
+
|
|
19
|
+
### Removed
|
|
20
|
+
- **Admin Dashboard (`swiftpy.admin`, `views/admin/`):** Completely removed the built-in HTML Admin Dashboard package (`swiftpy/admin/`), admin HTML templates (`views/admin/`), `AdminSite`/`ModelAdmin`/`AdminSessionStore` exports and scaffolding references, while preserving `app/http/middleware/admin_middleware.py` (`is_admin` API guard) and `views/mail/template.html`.
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
- Added [`documentations/2026-11-21-application-architecture-and-project-structure.md`](documentations/2026-11-21-application-architecture-and-project-structure.md) covering the full layered `app/` architecture, `Request` vs. `Schema` vs. `Resource` vs. `Model`, Patterns A–D + feature grouping, `app/ai/` and `prompts/`, decision table, Golden Rule, and verified CRUD walkthrough.
|
|
24
|
+
- Updated Installation Quick Start, HTTP Routing, Application Schemas, AI Subsystem, CLI & Testing, Authentication, Filesystem/Mail, CORS, WebSockets, `README.md`, and `docs/2026-11-14_documentation_plan.md` for `v0.3.0`.
|
|
25
|
+
|
|
7
26
|
## [0.2.2] - 2026-11-21
|
|
8
27
|
|
|
9
28
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: swiftpy-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: SwiftPY is a new generation async-first Python framework purpose built for the modern API and AI economy.
|
|
5
5
|
Project-URL: Homepage, https://github.com/obrainwave/swiftpy
|
|
6
6
|
Project-URL: Repository, https://github.com/obrainwave/swiftpy
|
|
@@ -55,9 +55,9 @@ SwiftPY brings the joy and productivity of Laravel to the modern asynchronous Py
|
|
|
55
55
|
- **Query Builder, GROUP BY & Dynamic Pagination**: Full length-aware `paginate()` and lightweight `simple_paginate()`, `limit()`/`offset()` (with `take()`/`skip()`), group-aware subquery counting, and aggregate selectors (`select_count`, `select_sum`, etc.) with `having` and `or_having` logical filtering.
|
|
56
56
|
- **Multi-Disk Storage & Streaming Engine**: Flysystem-inspired `Storage` abstraction supporting local and S3 disks, high-throughput streaming uploads/downloads, magic-byte validation, and `storage:link`.
|
|
57
57
|
- **Validation Ergonomics & Input Hardening**: `FormRequest` and `await validate(request, rules)` returning `ValidatedData` (supporting both dict and dot attribute access), `stop_on_first_error`, `ValidationException.single()`, automatic 422 JSON errors, configurable body streaming limits, Content-Length checks, and JSON recursion depth caps.
|
|
58
|
-
- **Authentication, Refresh Rotation & Session Revocation**: `JWTIssuer` with `refresh_token_pair()` rotation and reuse rejection, `auth().logout()` / `auth().logout_all()`, `TokenBlacklist`,
|
|
58
|
+
- **Authentication, Refresh Rotation & Session Revocation**: `JWTIssuer` with `refresh_token_pair()` rotation and reuse rejection, `auth().logout()` / `auth().logout_all()`, `TokenBlacklist`, and `ApiKeyGuard`.
|
|
59
59
|
- **Structured Asynchronous Logging**: Non-blocking `Log` facade and `LogManager` (`single`, `daily`, `stderr`, `stack`) backed by bounded `QueueHandler` / `QueueListener` with clean ASGI startup/shutdown flushing and per-application isolation.
|
|
60
|
-
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops
|
|
60
|
+
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops (`app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/`), versioned `messages`-list prompt templates (`Prompt.load("summarise.v2")`, `prompts/`), moderation/rate-limit/budget middlewares, observability telemetry, and `AIFake` / `VectorStoreFake` test doubles.
|
|
61
61
|
- **Database Engine & Native Transactions**: Connection pool management, automatic transaction propagation across context variables, nested transaction savepoints, and strict SQL injection prevention with full identifier quoting for reserved words.
|
|
62
62
|
- **Fluent Migration DSL & Schema Builder**: Laravel-inspired `Blueprint` table definitions, safe statement ordering (drops executed before adds), column comments, unsigned checks, composite keys, and distributed PostgreSQL advisory locks.
|
|
63
63
|
- **At-Least-Once Queues & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, and a cryptographically protected cross-worker event bus.
|
|
@@ -91,8 +91,9 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
91
91
|
| **Release v0.2.0: DX, Logging, Auth Refresh & Docs** | `ValidatedData` & `validate(request)`, `Request.input()` & `abort()`, `Router(prefix, middleware)`, `Blueprint.enum`/`medium_text`/`long_text`, `swiftpy.logging` (`Log`), `refresh_token_pair()` & `auth().logout()`, 17 user guides in `documentations/` | ✅ Completed |
|
|
92
92
|
| **Release v0.2.1: Auth Context on Token Issue** | `CurrentUser` / `auth()` available when an access token is issued, `user=` / `Model` subjects, opt-in `auth.hydrate_user` & `auth.passive_resolution` | ✅ Completed |
|
|
93
93
|
| **Release v0.2.2: Model `.update()`, `isset()`, `has_file()`, & Auth TTL** | `Model.update()` / `force_update()`, `JWT_ACCESS_TTL=3600`, 405 `"for route"` detail, `isset()` helper, `request.has_file()` (sync & `await`), CORS guide | ✅ Completed |
|
|
94
|
+
| **Release v0.3.0: Project Structure, AI/Prompts & Controller Routing** | Standardized `app/` + `app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/` + `prompts/` scaffolding, `Prompt.load("summarise.v2")` & `messages` lists, direct unbound controller method DI (`router.get(..., Controller.index)`), `make:agent`/`make:tool`/`make:prompt`, Admin Dashboard removal | ✅ Completed |
|
|
94
95
|
|
|
95
|
-
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) for the complete
|
|
96
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) and [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
96
97
|
|
|
97
98
|
---
|
|
98
99
|
|
|
@@ -595,7 +596,7 @@ Across the hardening and audit remediation phases, architectural decisions (`D-1
|
|
|
595
596
|
- **D-8 (Config Environment Variable Coercion)**: Coercion preserves strings unless the default type is known (e.g. `"0012"` is not silently cast to integer `12`).
|
|
596
597
|
- **D-9 (`FormRequest` Fail-Closed Validation)**: If `rules()` raises `TypeError` or any exception, the request fails closed with `ConfigurationError` (HTTP 500) rather than falling back to unvalidated `{}`.
|
|
597
598
|
- **D-10 (`update()`/`delete()` Without `WHERE`)**: Mass write/delete queries without a `WHERE` clause raise `QueryError` unless `.allow_all()` is explicitly chained.
|
|
598
|
-
- **G-1 (`swiftpy/ai` & Wheel Packaging)**: `swiftpy/ai` (LLM clients, embeddings, vector stores, RAG pipelines, agents, tools, prompt templates, observability), `swiftpy/
|
|
599
|
+
- **G-1 (`swiftpy/ai` & Wheel Packaging)**: `swiftpy/ai` (LLM clients, embeddings, vector stores, RAG pipelines, agents, tools, prompt templates, observability), `swiftpy/mail`, `swiftpy/filesystem`, and `swiftpy/validation` are fully implemented and distributed in the main `swiftpy-framework` wheel (dev test utilities remain in `swiftpy/testing`). `swiftpy/__init__.py` uses PEP 562 lazy exports so lightweight CLI/app imports avoid heavy optional subpackages until accessed.
|
|
599
600
|
- **G-16 (`dict` Auto-JSON & Cache Cleanup)**: Route handlers returning plain `dict` or `list` values are automatically serialized to JSON; legacy unbootstrapped `RouteCache` was removed (`swiftpy cache:build` compiles `config.json` and `prompts.json`); `/docs/` and `AGENTS.md` remain gitignored.
|
|
600
601
|
- **D-12 (Repository Hygiene)**: `.coverage` and cache artifacts untracked from git; `docs/`, `AGENTS.md`, and `DEVLOG.md` maintained untracked at repo root.
|
|
601
602
|
- **D-13 (Default `max_body_size`)**: Default 2 MiB request body limit (`413 Payload Too Large`) enforced across all buffered and streaming HTTP requests, configurable per app and per route.
|
|
@@ -606,16 +607,19 @@ Across the hardening and audit remediation phases, architectural decisions (`D-1
|
|
|
606
607
|
|
|
607
608
|
## Project Structure
|
|
608
609
|
|
|
609
|
-
SwiftPY follows a clean, intuitive layout inspired by modern application architectures:
|
|
610
|
+
SwiftPY follows a clean, intuitive layout inspired by modern application architectures (see [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md)):
|
|
610
611
|
|
|
611
612
|
```text
|
|
612
613
|
├── app/
|
|
613
|
-
│ ├──
|
|
614
|
-
│ ├──
|
|
614
|
+
│ ├── ai/ # AI agents, tools, pipelines, custom providers/vectorstores/observers
|
|
615
|
+
│ ├── events/ # Domain events
|
|
616
|
+
│ ├── http/ # Controllers, resources, middleware, requests, exception handlers
|
|
617
|
+
│ ├── jobs/ # Background queue jobs
|
|
618
|
+
│ ├── listeners/ # Event listeners
|
|
619
|
+
│ ├── mail/ # Mailables
|
|
615
620
|
│ ├── models/ # Active Record ORM models
|
|
616
621
|
│ ├── providers/ # Service providers (auto-discovered on boot)
|
|
617
|
-
│
|
|
618
|
-
│ │ └── database_service_provider.py
|
|
622
|
+
│ ├── repositories/ # Data access repositories
|
|
619
623
|
│ ├── schemas/ # Typed dataclasses & request/response DTOs
|
|
620
624
|
│ └── services/ # Domain business logic
|
|
621
625
|
├── config/ # Environment & framework configuration
|
|
@@ -632,9 +636,9 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
632
636
|
│ └── queue.py
|
|
633
637
|
├── database/
|
|
634
638
|
│ └── migrations/ # Timestamped database migrations
|
|
635
|
-
├──
|
|
639
|
+
├── prompts/ # Named & versioned AI prompt templates (summarise.py, classify.py)
|
|
640
|
+
├── views/ # Sandboxed Jinja2 HTML templates (mail/)
|
|
636
641
|
├── swiftpy/ # SwiftPY framework core
|
|
637
|
-
│ ├── admin/ # Auto-introspecting admin site, RBAC & session auth
|
|
638
642
|
│ ├── ai/ # AI client, embeddings, vectorstores, RAG, agents, tools, prompts
|
|
639
643
|
│ ├── auth/ # JWT issuer, API key guards, token blacklist
|
|
640
644
|
│ ├── cache/ # Redis and memory cache drivers
|
|
@@ -25,9 +25,9 @@ SwiftPY brings the joy and productivity of Laravel to the modern asynchronous Py
|
|
|
25
25
|
- **Query Builder, GROUP BY & Dynamic Pagination**: Full length-aware `paginate()` and lightweight `simple_paginate()`, `limit()`/`offset()` (with `take()`/`skip()`), group-aware subquery counting, and aggregate selectors (`select_count`, `select_sum`, etc.) with `having` and `or_having` logical filtering.
|
|
26
26
|
- **Multi-Disk Storage & Streaming Engine**: Flysystem-inspired `Storage` abstraction supporting local and S3 disks, high-throughput streaming uploads/downloads, magic-byte validation, and `storage:link`.
|
|
27
27
|
- **Validation Ergonomics & Input Hardening**: `FormRequest` and `await validate(request, rules)` returning `ValidatedData` (supporting both dict and dot attribute access), `stop_on_first_error`, `ValidationException.single()`, automatic 422 JSON errors, configurable body streaming limits, Content-Length checks, and JSON recursion depth caps.
|
|
28
|
-
- **Authentication, Refresh Rotation & Session Revocation**: `JWTIssuer` with `refresh_token_pair()` rotation and reuse rejection, `auth().logout()` / `auth().logout_all()`, `TokenBlacklist`,
|
|
28
|
+
- **Authentication, Refresh Rotation & Session Revocation**: `JWTIssuer` with `refresh_token_pair()` rotation and reuse rejection, `auth().logout()` / `auth().logout_all()`, `TokenBlacklist`, and `ApiKeyGuard`.
|
|
29
29
|
- **Structured Asynchronous Logging**: Non-blocking `Log` facade and `LogManager` (`single`, `daily`, `stderr`, `stack`) backed by bounded `QueueHandler` / `QueueListener` with clean ASGI startup/shutdown flushing and per-application isolation.
|
|
30
|
-
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops
|
|
30
|
+
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops (`app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/`), versioned `messages`-list prompt templates (`Prompt.load("summarise.v2")`, `prompts/`), moderation/rate-limit/budget middlewares, observability telemetry, and `AIFake` / `VectorStoreFake` test doubles.
|
|
31
31
|
- **Database Engine & Native Transactions**: Connection pool management, automatic transaction propagation across context variables, nested transaction savepoints, and strict SQL injection prevention with full identifier quoting for reserved words.
|
|
32
32
|
- **Fluent Migration DSL & Schema Builder**: Laravel-inspired `Blueprint` table definitions, safe statement ordering (drops executed before adds), column comments, unsigned checks, composite keys, and distributed PostgreSQL advisory locks.
|
|
33
33
|
- **At-Least-Once Queues & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, and a cryptographically protected cross-worker event bus.
|
|
@@ -61,8 +61,9 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
61
61
|
| **Release v0.2.0: DX, Logging, Auth Refresh & Docs** | `ValidatedData` & `validate(request)`, `Request.input()` & `abort()`, `Router(prefix, middleware)`, `Blueprint.enum`/`medium_text`/`long_text`, `swiftpy.logging` (`Log`), `refresh_token_pair()` & `auth().logout()`, 17 user guides in `documentations/` | ✅ Completed |
|
|
62
62
|
| **Release v0.2.1: Auth Context on Token Issue** | `CurrentUser` / `auth()` available when an access token is issued, `user=` / `Model` subjects, opt-in `auth.hydrate_user` & `auth.passive_resolution` | ✅ Completed |
|
|
63
63
|
| **Release v0.2.2: Model `.update()`, `isset()`, `has_file()`, & Auth TTL** | `Model.update()` / `force_update()`, `JWT_ACCESS_TTL=3600`, 405 `"for route"` detail, `isset()` helper, `request.has_file()` (sync & `await`), CORS guide | ✅ Completed |
|
|
64
|
+
| **Release v0.3.0: Project Structure, AI/Prompts & Controller Routing** | Standardized `app/` + `app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/` + `prompts/` scaffolding, `Prompt.load("summarise.v2")` & `messages` lists, direct unbound controller method DI (`router.get(..., Controller.index)`), `make:agent`/`make:tool`/`make:prompt`, Admin Dashboard removal | ✅ Completed |
|
|
64
65
|
|
|
65
|
-
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) for the complete
|
|
66
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) and [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
66
67
|
|
|
67
68
|
---
|
|
68
69
|
|
|
@@ -565,7 +566,7 @@ Across the hardening and audit remediation phases, architectural decisions (`D-1
|
|
|
565
566
|
- **D-8 (Config Environment Variable Coercion)**: Coercion preserves strings unless the default type is known (e.g. `"0012"` is not silently cast to integer `12`).
|
|
566
567
|
- **D-9 (`FormRequest` Fail-Closed Validation)**: If `rules()` raises `TypeError` or any exception, the request fails closed with `ConfigurationError` (HTTP 500) rather than falling back to unvalidated `{}`.
|
|
567
568
|
- **D-10 (`update()`/`delete()` Without `WHERE`)**: Mass write/delete queries without a `WHERE` clause raise `QueryError` unless `.allow_all()` is explicitly chained.
|
|
568
|
-
- **G-1 (`swiftpy/ai` & Wheel Packaging)**: `swiftpy/ai` (LLM clients, embeddings, vector stores, RAG pipelines, agents, tools, prompt templates, observability), `swiftpy/
|
|
569
|
+
- **G-1 (`swiftpy/ai` & Wheel Packaging)**: `swiftpy/ai` (LLM clients, embeddings, vector stores, RAG pipelines, agents, tools, prompt templates, observability), `swiftpy/mail`, `swiftpy/filesystem`, and `swiftpy/validation` are fully implemented and distributed in the main `swiftpy-framework` wheel (dev test utilities remain in `swiftpy/testing`). `swiftpy/__init__.py` uses PEP 562 lazy exports so lightweight CLI/app imports avoid heavy optional subpackages until accessed.
|
|
569
570
|
- **G-16 (`dict` Auto-JSON & Cache Cleanup)**: Route handlers returning plain `dict` or `list` values are automatically serialized to JSON; legacy unbootstrapped `RouteCache` was removed (`swiftpy cache:build` compiles `config.json` and `prompts.json`); `/docs/` and `AGENTS.md` remain gitignored.
|
|
570
571
|
- **D-12 (Repository Hygiene)**: `.coverage` and cache artifacts untracked from git; `docs/`, `AGENTS.md`, and `DEVLOG.md` maintained untracked at repo root.
|
|
571
572
|
- **D-13 (Default `max_body_size`)**: Default 2 MiB request body limit (`413 Payload Too Large`) enforced across all buffered and streaming HTTP requests, configurable per app and per route.
|
|
@@ -576,16 +577,19 @@ Across the hardening and audit remediation phases, architectural decisions (`D-1
|
|
|
576
577
|
|
|
577
578
|
## Project Structure
|
|
578
579
|
|
|
579
|
-
SwiftPY follows a clean, intuitive layout inspired by modern application architectures:
|
|
580
|
+
SwiftPY follows a clean, intuitive layout inspired by modern application architectures (see [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md)):
|
|
580
581
|
|
|
581
582
|
```text
|
|
582
583
|
├── app/
|
|
583
|
-
│ ├──
|
|
584
|
-
│ ├──
|
|
584
|
+
│ ├── ai/ # AI agents, tools, pipelines, custom providers/vectorstores/observers
|
|
585
|
+
│ ├── events/ # Domain events
|
|
586
|
+
│ ├── http/ # Controllers, resources, middleware, requests, exception handlers
|
|
587
|
+
│ ├── jobs/ # Background queue jobs
|
|
588
|
+
│ ├── listeners/ # Event listeners
|
|
589
|
+
│ ├── mail/ # Mailables
|
|
585
590
|
│ ├── models/ # Active Record ORM models
|
|
586
591
|
│ ├── providers/ # Service providers (auto-discovered on boot)
|
|
587
|
-
│
|
|
588
|
-
│ │ └── database_service_provider.py
|
|
592
|
+
│ ├── repositories/ # Data access repositories
|
|
589
593
|
│ ├── schemas/ # Typed dataclasses & request/response DTOs
|
|
590
594
|
│ └── services/ # Domain business logic
|
|
591
595
|
├── config/ # Environment & framework configuration
|
|
@@ -602,9 +606,9 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
602
606
|
│ └── queue.py
|
|
603
607
|
├── database/
|
|
604
608
|
│ └── migrations/ # Timestamped database migrations
|
|
605
|
-
├──
|
|
609
|
+
├── prompts/ # Named & versioned AI prompt templates (summarise.py, classify.py)
|
|
610
|
+
├── views/ # Sandboxed Jinja2 HTML templates (mail/)
|
|
606
611
|
├── swiftpy/ # SwiftPY framework core
|
|
607
|
-
│ ├── admin/ # Auto-introspecting admin site, RBAC & session auth
|
|
608
612
|
│ ├── ai/ # AI client, embeddings, vectorstores, RAG, agents, tools, prompts
|
|
609
613
|
│ ├── auth/ # JWT issuer, API key guards, token blacklist
|
|
610
614
|
│ ├── cache/ # Redis and memory cache drivers
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from app.ai.tools.system_status_tool import SystemStatusTool
|
|
6
|
+
from swiftpy.ai.agents import AgentMemory, BaseAgent
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from collections.abc import Sequence
|
|
10
|
+
|
|
11
|
+
from swiftpy.ai.agents import BaseMemoryBackend
|
|
12
|
+
from swiftpy.ai.client import AIClient
|
|
13
|
+
from swiftpy.ai.tools import BaseTool
|
|
14
|
+
from swiftpy.core.config import Config
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AssistantAgent(BaseAgent):
|
|
18
|
+
"""Default conversational assistant agent wired with starter tools."""
|
|
19
|
+
|
|
20
|
+
def __init__(
|
|
21
|
+
self,
|
|
22
|
+
*,
|
|
23
|
+
model: str | None = None,
|
|
24
|
+
system_prompt: str = (
|
|
25
|
+
"You are a helpful, concise SwiftPY application assistant."
|
|
26
|
+
),
|
|
27
|
+
tools: Sequence[BaseTool | type[BaseTool]] | None = None,
|
|
28
|
+
memory: AgentMemory | BaseMemoryBackend | None = None,
|
|
29
|
+
client: AIClient | None = None,
|
|
30
|
+
config: Config | None = None,
|
|
31
|
+
) -> None:
|
|
32
|
+
default_tools: list[BaseTool | type[BaseTool]] = (
|
|
33
|
+
list(tools) if tools is not None else [SystemStatusTool()]
|
|
34
|
+
)
|
|
35
|
+
super().__init__(
|
|
36
|
+
name="AssistantAgent",
|
|
37
|
+
model=model,
|
|
38
|
+
system_prompt=system_prompt,
|
|
39
|
+
tools=default_tools,
|
|
40
|
+
memory=memory if memory is not None else AgentMemory(),
|
|
41
|
+
client=client,
|
|
42
|
+
config=config,
|
|
43
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from datetime import UTC, datetime
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from swiftpy.ai.tools import BaseTool
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class SystemStatusTool(BaseTool):
|
|
10
|
+
"""Function-calling tool reporting basic application runtime status."""
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def name(self) -> str:
|
|
14
|
+
return "system_status"
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def description(self) -> str:
|
|
18
|
+
return "Return the current UTC timestamp and application health status."
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def parameters(self) -> dict[str, Any]:
|
|
22
|
+
return {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {},
|
|
25
|
+
"required": [],
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async def handle(self, *args: Any, **kwargs: Any) -> Any:
|
|
29
|
+
"""Return structured UTC timestamp and ok status."""
|
|
30
|
+
return {
|
|
31
|
+
"status": "ok",
|
|
32
|
+
"utc_time": datetime.now(tz=UTC).isoformat(),
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from app.http.resources.user_resource import UserResource
|
|
4
|
+
from app.services.user_service import UserService
|
|
5
|
+
from swiftpy.http.request import Request
|
|
6
|
+
from swiftpy.http.response import Response, json_response
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UserController:
|
|
10
|
+
"""
|
|
11
|
+
HTTP controller for user API endpoints.
|
|
12
|
+
|
|
13
|
+
Resolves constructor dependencies via the SwiftPY DI container and delegates
|
|
14
|
+
domain logic to UserService before formatting responses with UserResource.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, user_service: UserService) -> None:
|
|
18
|
+
self.user_service = user_service
|
|
19
|
+
|
|
20
|
+
async def index(self, request: Request) -> Response:
|
|
21
|
+
"""List users serialized through UserResource."""
|
|
22
|
+
users = await self.user_service.list_users()
|
|
23
|
+
return json_response(UserResource.collection(users))
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from swiftpy.core.context import Context
|
|
7
|
+
from swiftpy.core.exceptions import HttpException
|
|
8
|
+
from swiftpy.http.middleware import Handler, Middleware
|
|
9
|
+
from swiftpy.http.request import Request
|
|
10
|
+
from swiftpy.http.response import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _resolve_authenticated_user(request: Request) -> Any:
|
|
14
|
+
"""Resolve the active authenticated user across Context and request.state, respecting logout state."""
|
|
15
|
+
if Context.get("__swiftpy_logged_out__") or request.state.get(
|
|
16
|
+
"__swiftpy_logged_out__"
|
|
17
|
+
):
|
|
18
|
+
return None
|
|
19
|
+
user = Context.get("auth.user")
|
|
20
|
+
if user is None:
|
|
21
|
+
user = Context.get("__swiftpy_current_user__")
|
|
22
|
+
if user is None:
|
|
23
|
+
user = Context.get("__swiftpy_current_user_model__")
|
|
24
|
+
if user is None:
|
|
25
|
+
user = request.state.get("user")
|
|
26
|
+
return user
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _is_admin_user(user: Any) -> bool:
|
|
30
|
+
"""Return True only when user carries an explicit boolean `is_admin is True` in a mapping or model."""
|
|
31
|
+
if isinstance(user, Mapping):
|
|
32
|
+
raw_flag = user.get("is_admin")
|
|
33
|
+
if raw_flag is not None:
|
|
34
|
+
return raw_flag is True
|
|
35
|
+
if getattr(user, "is_admin", None) is True:
|
|
36
|
+
return True
|
|
37
|
+
model = getattr(user, "model", None) or Context.get(
|
|
38
|
+
"__swiftpy_current_user_model__"
|
|
39
|
+
)
|
|
40
|
+
return getattr(model, "is_admin", None) is True
|
|
41
|
+
return getattr(user, "is_admin", None) is True
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class AdminMiddleware(Middleware):
|
|
45
|
+
"""
|
|
46
|
+
Authorization ASGI middleware for administrative access control.
|
|
47
|
+
|
|
48
|
+
Retrieves the authenticated user from task-isolated `Context` or `request.state`.
|
|
49
|
+
Verifies that the user exists and has administrative privileges (`user.is_admin` is True).
|
|
50
|
+
Raises HTTP 401 Unauthorized if unauthenticated, or HTTP 403 Forbidden if not an administrator.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
async def handle(self, request: Request, next_handler: Handler) -> Response:
|
|
54
|
+
user = _resolve_authenticated_user(request)
|
|
55
|
+
if user is None:
|
|
56
|
+
raise HttpException(
|
|
57
|
+
status_code=401,
|
|
58
|
+
message="Unauthenticated: Please authenticate first",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
if not _is_admin_user(user):
|
|
62
|
+
raise HttpException(
|
|
63
|
+
status_code=403,
|
|
64
|
+
message="Forbidden: Administrator access required",
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return await next_handler(request)
|
|
@@ -32,8 +32,12 @@ class AuthMiddleware(Middleware):
|
|
|
32
32
|
message="Unauthenticated: Missing or invalid credentials",
|
|
33
33
|
)
|
|
34
34
|
|
|
35
|
+
Context.set("__swiftpy_logged_out__", False)
|
|
35
36
|
Context.set("auth.user", user)
|
|
36
37
|
Context.set("__swiftpy_current_user__", user)
|
|
38
|
+
if hasattr(user, "__table__"):
|
|
39
|
+
Context.set("__swiftpy_current_user_model__", user)
|
|
40
|
+
request.state.pop("__swiftpy_logged_out__", None)
|
|
37
41
|
request.state["user"] = user
|
|
38
42
|
|
|
39
43
|
return await next_handler(request)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, Any
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
from collections.abc import Iterable
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UserResource:
|
|
10
|
+
"""HTTP API resource transformer for User entities and schemas."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, resource: Any) -> None:
|
|
13
|
+
self.resource = resource
|
|
14
|
+
|
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
|
16
|
+
"""Transform a User model or UserResponseSchema into an HTTP-safe dictionary."""
|
|
17
|
+
if isinstance(self.resource, dict):
|
|
18
|
+
return {
|
|
19
|
+
"id": self.resource.get("id"),
|
|
20
|
+
"name": self.resource.get("name"),
|
|
21
|
+
"email": self.resource.get("email"),
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
"id": getattr(self.resource, "id", None),
|
|
25
|
+
"name": getattr(self.resource, "name", None),
|
|
26
|
+
"email": getattr(self.resource, "email", None),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def collection(cls, items: Iterable[Any]) -> list[dict[str, Any]]:
|
|
31
|
+
"""Transform a collection of user items into HTTP-safe dictionaries."""
|
|
32
|
+
return [cls(item).to_dict() for item in items]
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import asdict, dataclass
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import TYPE_CHECKING, Any
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from app.models.user import User
|
|
5
8
|
|
|
6
9
|
|
|
7
10
|
@dataclass(slots=True)
|
|
@@ -21,6 +24,12 @@ class UserResponseSchema:
|
|
|
21
24
|
name: str
|
|
22
25
|
email: str
|
|
23
26
|
|
|
27
|
+
@classmethod
|
|
28
|
+
def from_model(cls, user: User) -> UserResponseSchema:
|
|
29
|
+
return cls(id=user.id, name=user.name, email=user.email)
|
|
30
|
+
|
|
24
31
|
def to_dict(self) -> dict[str, Any]:
|
|
25
32
|
return asdict(self)
|
|
26
33
|
|
|
34
|
+
|
|
35
|
+
UserSchema = UserResponseSchema
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from app.models.user import User
|
|
4
|
+
from app.repositories.user_repository import UserRepository
|
|
5
|
+
from app.schemas.user_schema import UserResponseSchema
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UserService:
|
|
9
|
+
"""
|
|
10
|
+
Domain business logic layer for user entity management.
|
|
11
|
+
Coordinates between repositories, schemas, transactions, events, and background notifications.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, repository: UserRepository | None = None) -> None:
|
|
15
|
+
self.repository = repository or UserRepository()
|
|
16
|
+
|
|
17
|
+
async def list_users(self) -> list[UserResponseSchema]:
|
|
18
|
+
"""Return starter user response DTOs."""
|
|
19
|
+
return [
|
|
20
|
+
UserResponseSchema(
|
|
21
|
+
id=1,
|
|
22
|
+
name="Alice Doe",
|
|
23
|
+
email="alice@example.com",
|
|
24
|
+
)
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
async def create_user(
|
|
28
|
+
self, name: str, email: str, password_hash: str
|
|
29
|
+
) -> User:
|
|
30
|
+
"""Create a new user account with hashed credentials."""
|
|
31
|
+
user = await self.repository.create(
|
|
32
|
+
name=name,
|
|
33
|
+
email=email,
|
|
34
|
+
password=password_hash,
|
|
35
|
+
is_admin=False,
|
|
36
|
+
)
|
|
37
|
+
return user
|
|
38
|
+
|
|
39
|
+
async def create_user_schema(
|
|
40
|
+
self, name: str, email: str, password_hash: str
|
|
41
|
+
) -> UserResponseSchema:
|
|
42
|
+
"""Create a new user account and return an explicit response schema."""
|
|
43
|
+
user = await self.create_user(name, email, password_hash)
|
|
44
|
+
return UserResponseSchema.from_model(user)
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from swiftpy import env
|
|
3
|
+
from swiftpy import env, env_bool
|
|
4
4
|
|
|
5
5
|
CONFIG: dict[str, object] = {
|
|
6
6
|
"enabled": env("AI_ENABLED", "true").lower() in ("true", "1", "yes"),
|
|
7
7
|
"default": env("AI_DEFAULT_PROVIDER", "openai"),
|
|
8
|
+
"prompts": {
|
|
9
|
+
"path": env("AI_PROMPTS_PATH", "prompts"),
|
|
10
|
+
"cache": env_bool("AI_PROMPTS_CACHE", False),
|
|
11
|
+
},
|
|
8
12
|
"providers": {
|
|
9
13
|
"openai": {
|
|
10
14
|
"api_key": env("OPENAI_API_KEY", ""),
|
|
@@ -16,7 +16,7 @@ This guide covers two ways to get started with SwiftPY:
|
|
|
16
16
|
- **For Full Project Scaffolding:**
|
|
17
17
|
- **Option A (Fully Dockerized):** Docker Engine / Docker Desktop with Compose v2, plus `uv` (`uvx`) or Python `>= 3.12` only to run `swiftpy new`.
|
|
18
18
|
- **Option B (Without Docker at All):** Python `>= 3.12`, **PostgreSQL 16** (with `pgvector` if using AI vector stores), and **Redis 7** running natively on your machine.
|
|
19
|
-
- Optional extras if needed later: `jinja2` (HTML mail
|
|
19
|
+
- Optional extras if needed later: `jinja2` (HTML mail templates) and `aiosmtplib` (`smtp` mail transport).
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
@@ -131,11 +131,20 @@ Pass `--force` only if overwriting an existing non-empty directory (existing `.e
|
|
|
131
131
|
```text
|
|
132
132
|
my_api/
|
|
133
133
|
├── app/
|
|
134
|
+
│ ├── ai/
|
|
135
|
+
│ │ ├── agents/ # AI agent classes (AssistantAgent starter)
|
|
136
|
+
│ │ ├── tools/ # Function-calling tool classes (SystemStatusTool starter)
|
|
137
|
+
│ │ ├── pipelines/ # RAG pipeline configurations
|
|
138
|
+
│ │ ├── providers/ # Custom LLM provider adapters
|
|
139
|
+
│ │ ├── vectorstores/ # Custom vector store adapters
|
|
140
|
+
│ │ └── observers/ # Custom AI observability hooks
|
|
134
141
|
│ ├── events/ # Domain events
|
|
135
142
|
│ ├── http/
|
|
143
|
+
│ │ ├── controllers/ # HTTP controllers (UserController starter)
|
|
136
144
|
│ │ ├── handler/ # Exception handlers (exceptions.py -> register_exception_handlers)
|
|
137
|
-
│ │ ├── middleware/ # Auth &
|
|
138
|
-
│ │
|
|
145
|
+
│ │ ├── middleware/ # Auth & role/admin API guard middleware templates
|
|
146
|
+
│ │ ├── requests/ # Typed FormRequest classes
|
|
147
|
+
│ │ └── resources/ # API response serializers (UserResource starter)
|
|
139
148
|
│ ├── jobs/ # Background Queue jobs
|
|
140
149
|
│ ├── listeners/ # Event listeners
|
|
141
150
|
│ ├── mail/ # Mailables (WelcomeEmail)
|
|
@@ -143,23 +152,26 @@ my_api/
|
|
|
143
152
|
│ ├── providers/ # Auto-discovered service providers
|
|
144
153
|
│ ├── repositories/ # Data access layer
|
|
145
154
|
│ ├── schemas/ # Typed dataclasses/schemas (see Application Schemas guide)
|
|
146
|
-
│ └── services/ # Business logic services
|
|
155
|
+
│ └── services/ # Business logic services (UserService starter)
|
|
147
156
|
├── config/ # Configuration files loading .env via env() / env_bool()
|
|
148
157
|
├── database/
|
|
149
158
|
│ ├── migrations/ # Timestamped schema migrations (initial users table included)
|
|
150
159
|
│ └── seeders/ # DatabaseSeeders
|
|
160
|
+
├── prompts/
|
|
161
|
+
│ ├── summarise.py # Named prompt (module-level `messages` list)
|
|
162
|
+
│ └── classify.py # Named classification prompt
|
|
151
163
|
├── public/ # Public web assets (storage symlink target)
|
|
152
164
|
├── routes/
|
|
153
|
-
│ └── api.py # Starter /api/health and /api/users routes
|
|
165
|
+
│ └── api.py # Starter /api/health and /api/users (UserController.index) routes
|
|
154
166
|
├── storage/ # Private, public, framework cache, and log directories
|
|
155
|
-
├── views/ # Jinja2 HTML templates (
|
|
167
|
+
├── views/ # Jinja2 HTML templates (mail/)
|
|
156
168
|
├── tests/ # pytest conftest.py & starter API test
|
|
157
169
|
├── .env # Generated APP_KEY & JWT_SECRET, DB_DATABASE=my_api
|
|
158
170
|
├── .env.example
|
|
159
171
|
├── docker-compose.yml # name: my_api; app, postgres (pgvector:pg16), & redis services
|
|
160
172
|
├── Dockerfile
|
|
161
173
|
├── main.py # Entrypoint: GET /, /api router, register_exception_handlers(app)
|
|
162
|
-
└── pyproject.toml # Configured with swiftpy-framework>=0.
|
|
174
|
+
└── pyproject.toml # Configured with swiftpy-framework>=0.3.0, setuptools, & mypy strict settings
|
|
163
175
|
```
|
|
164
176
|
|
|
165
177
|
What `swiftpy new my_api` configures automatically:
|
|
@@ -313,7 +325,7 @@ The scaffolded `Dockerfile` reads `[project].dependencies` from your project's `
|
|
|
313
325
|
name = "my_api"
|
|
314
326
|
version = "0.1.0"
|
|
315
327
|
dependencies = [
|
|
316
|
-
"swiftpy-framework>=0.
|
|
328
|
+
"swiftpy-framework>=0.3.0",
|
|
317
329
|
# ...
|
|
318
330
|
]
|
|
319
331
|
```
|
|
@@ -343,7 +355,7 @@ If running without Docker, upgrade inside your activated `.venv`:
|
|
|
343
355
|
uv sync --upgrade-package swiftpy-framework
|
|
344
356
|
|
|
345
357
|
# Or with pip
|
|
346
|
-
python -m pip install --upgrade "swiftpy-framework>=0.
|
|
358
|
+
python -m pip install --upgrade "swiftpy-framework>=0.3.0"
|
|
347
359
|
swiftpy --version
|
|
348
360
|
```
|
|
349
361
|
|