tina4-python 3.13.149__tar.gz → 3.13.150__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.149 → tina4_python-3.13.150}/PKG-INFO +1 -1
- {tina4_python-3.13.149 → tina4_python-3.13.150}/pyproject.toml +1 -1
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/__init__.py +1 -1
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/cli/__init__.py +125 -2
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/server.py +10 -2
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/dev_admin/__init__.py +153 -117
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/dev_admin/plan.py +1 -1
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/bundled-component-provenance.json +2 -2
- tina4_python-3.13.150/tina4_python/public/js/tina4-dev-admin-split.html +202 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/js/tina4-dev-admin.min.js +147 -138
- {tina4_python-3.13.149 → tina4_python-3.13.150}/.gitignore +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/COMMERCIAL-LICENSE.md +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/LICENSE +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/NOTICE +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/README.md +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/.tina4-metrics.json +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/CLAUDE.md +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/HtmlElement.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/Testing.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/_import_helper.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/ai/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/ai/client.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/api/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/auth/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/cache/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/container/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/context/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/context/chunker.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/cache.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/constants.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/csp.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/events.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/middleware.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/port_takeover.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/rate_limiter.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/request.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/response.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/core/router.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/crud/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/crud/page.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/crud/page_render.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/adapter.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/async_api.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/connection.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/database_url.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/firebird.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/mongodb.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/mssql.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/mysql.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/odbc.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/pool.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/postgres.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/sql_translator.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/database/sqlite.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/debug/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/debug/error_overlay.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/dev_admin/metrics.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/dev_admin/project_index.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/docs.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/docstore/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/dotenv/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/env.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/frond/FROND.md +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/frond/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/frond/compiler.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/frond/engine.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/frond/parser.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/auth/meta.json +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/auth/src/routes/api/gallery_auth.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/database/meta.json +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/database/src/routes/api/gallery_db.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/error-overlay/meta.json +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/error-overlay/src/routes/api/gallery_crash.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/orm/meta.json +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/orm/src/orm/Product.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/orm/src/routes/api/gallery_products.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/queue/meta.json +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/queue/src/routes/api/gallery_queue.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/rest-api/meta.json +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/rest-api/src/routes/api/gallery_hello.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/templates/meta.json +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/templates/src/routes/gallery_page.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/gallery/templates/src/templates/gallery_page.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/graph/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/graph/adapter.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/graph/adapters/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/graph/adapters/arango.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/graph/adapters/bolt.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/graph/adapters/ultipa.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/graph/graph_url.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/graphql/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/i18n/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/mcp/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/mcp/protocol.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/mcp/tools.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/messenger/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/migration/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/migration/runner.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/mqtt/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/mqtt/message.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/orm/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/orm/async_api.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/orm/collection.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/orm/fields.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/orm/model.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/orm/point.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/THIRD-PARTY-NOTICES.md +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/__feedback/widget.js +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/css/tina4.css +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/css/tina4.min.css +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/favicon.ico +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/images/logo.svg +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/images/tina4-logo-icon.webp +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/js/frond.js +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/js/frond.min.js +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/js/tina4.min.js +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/js/tina4js.min.js +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/licenses/swagger-ui-3.10.0-original-notice.txt +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/licenses/swagger-ui-5.17.14-NOTICE.txt +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/licenses/swagger-ui-Apache-2.0.txt +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/licenses/tina4-css-MIT.txt +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/licenses/tina4-dev-admin-components.json +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/licenses/tina4-dev-admin-third-party.txt +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/licenses/tina4-js-MIT.txt +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/swagger/index.html +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/push/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/push/_base.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/push/_cryptography.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/push/_libcrypto.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/query_builder/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue/amqp_url.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue/job.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue/kafka_backend.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue/lite_backend.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue/mongo_backend.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue/rabbitmq_backend.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue/topic_dead_letter.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue_backends/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue_backends/kafka_backend.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue_backends/mongo_backend.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/queue_backends/rabbitmq_backend.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/realtime/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/realtime/models/Attachment.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/realtime/models/Channel.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/realtime/models/ChannelMember.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/realtime/models/Message.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/realtime/models/Workspace.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/realtime/models/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/realtime/storage.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/seeder/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/service/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/session/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/session_handlers/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/session_handlers/memcached_handler.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/session_handlers/mongodb_handler.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/session_handlers/redis_handler.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/session_handlers/valkey_handler.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/sso.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/ssrf.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/swagger/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/components/crud.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/crud/form.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/crud/modals.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/crud/page.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/crud/table.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/docker/distroless/Dockerfile +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/docker/poetry/Dockerfile +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/docker/python/Dockerfile +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/docker/uv/Dockerfile +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/errors/302.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/errors/401.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/errors/403.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/errors/404.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/errors/500.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/errors/502.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/errors/503.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/errors/base.twig +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/frontend/README.md +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/templates/readme.md +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/test/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/test_client/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/af/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/af/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/es/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/es/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/ja/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/ja/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/zh/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/translations/zh/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/validator/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/websocket/__init__.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/websocket/backplane.py +0 -0
- {tina4_python-3.13.149 → tina4_python-3.13.150}/tina4_python/wsdl/__init__.py +0 -0
|
@@ -1652,8 +1652,8 @@ def _generate(args):
|
|
|
1652
1652
|
|
|
1653
1653
|
what = args[0].lower()
|
|
1654
1654
|
|
|
1655
|
-
#
|
|
1656
|
-
no_name_generators = {"auth"}
|
|
1655
|
+
# These generators take no name argument.
|
|
1656
|
+
no_name_generators = {"auth", "base"}
|
|
1657
1657
|
if what not in no_name_generators and len(args) < 2:
|
|
1658
1658
|
print(f"Usage: tina4python generate {what} <name> [options]")
|
|
1659
1659
|
sys.exit(1)
|
|
@@ -3352,6 +3352,127 @@ def _gen_form(name: str, flags: dict = None):
|
|
|
3352
3352
|
print(f" ✓ Created {path}")
|
|
3353
3353
|
|
|
3354
3354
|
|
|
3355
|
+
_BASE_TWIG = '''<!DOCTYPE html>
|
|
3356
|
+
<html lang="en">
|
|
3357
|
+
<head>
|
|
3358
|
+
<meta charset="UTF-8">
|
|
3359
|
+
<title>{% block title %}{{ APP_NAME }}{% endblock %}</title>
|
|
3360
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3361
|
+
<link rel="stylesheet" href="/css/tina4.min.css">
|
|
3362
|
+
<link rel="stylesheet" href="/css/default.css">
|
|
3363
|
+
{% block stylesheets %}{% endblock %}
|
|
3364
|
+
</head>
|
|
3365
|
+
<body>
|
|
3366
|
+
{% block nav %}{% include "partials/nav.twig" ignore missing %}{% endblock %}
|
|
3367
|
+
<main>{% block content %}{% endblock %}</main>
|
|
3368
|
+
{% block javascripts %}
|
|
3369
|
+
<script src="/js/tina4.min.js"></script>
|
|
3370
|
+
<script src="/js/frond.min.js"></script>
|
|
3371
|
+
{% endblock %}
|
|
3372
|
+
</body>
|
|
3373
|
+
</html>
|
|
3374
|
+
'''
|
|
3375
|
+
|
|
3376
|
+
|
|
3377
|
+
def _ensure_base_template():
|
|
3378
|
+
"""Create src/templates/base.twig and the src/templates/pages/ folder if
|
|
3379
|
+
missing. Returns the paths created (empty when everything already existed).
|
|
3380
|
+
Shared by `generate base` and `generate page` so a page can be scaffolded
|
|
3381
|
+
into a fresh project and still inherit from a real base."""
|
|
3382
|
+
created = []
|
|
3383
|
+
templates = Path("src/templates")
|
|
3384
|
+
templates.mkdir(parents=True, exist_ok=True)
|
|
3385
|
+
(templates / "pages").mkdir(parents=True, exist_ok=True)
|
|
3386
|
+
base = templates / "base.twig"
|
|
3387
|
+
if not base.exists():
|
|
3388
|
+
base.write_text(_BASE_TWIG, encoding="utf-8")
|
|
3389
|
+
created.append(str(base))
|
|
3390
|
+
return created
|
|
3391
|
+
|
|
3392
|
+
|
|
3393
|
+
def _page_twig(title: str) -> str:
|
|
3394
|
+
"""A Frond page template that extends base.twig (Twig braces kept literal)."""
|
|
3395
|
+
return (
|
|
3396
|
+
'{% extends "base.twig" %}\n'
|
|
3397
|
+
'{% block title %}' + title + '{% endblock %}\n'
|
|
3398
|
+
'{% block content %}\n'
|
|
3399
|
+
'<div class="container mt-4">\n'
|
|
3400
|
+
' <h1>' + title + '</h1>\n'
|
|
3401
|
+
' {# tina4:edit page content goes here #}\n'
|
|
3402
|
+
'</div>\n'
|
|
3403
|
+
'{% endblock %}\n'
|
|
3404
|
+
)
|
|
3405
|
+
|
|
3406
|
+
|
|
3407
|
+
def _page_route(url_path: str, template_name: str, fn_name: str, title: str) -> str:
|
|
3408
|
+
"""A route that renders a page template through the @template decorator."""
|
|
3409
|
+
return (
|
|
3410
|
+
"from tina4_python.core.router import get, template\n\n\n"
|
|
3411
|
+
'@get("' + url_path + '")\n'
|
|
3412
|
+
'@template("' + template_name + '")\n'
|
|
3413
|
+
"async def " + fn_name + "(request, response):\n"
|
|
3414
|
+
' return {"title": "' + title + '"}\n'
|
|
3415
|
+
)
|
|
3416
|
+
|
|
3417
|
+
|
|
3418
|
+
def _gen_base(name: str = None, flags: dict = None):
|
|
3419
|
+
"""Scaffold a Frond base template + an index page that extends it.
|
|
3420
|
+
|
|
3421
|
+
tina4python generate base
|
|
3422
|
+
|
|
3423
|
+
Creates src/templates/base.twig (if missing), the src/templates/pages/
|
|
3424
|
+
folder, src/templates/pages/index.twig (extends base), and the `/` route
|
|
3425
|
+
that renders it. Subsequent `generate page <name>` pages inherit from base.
|
|
3426
|
+
"""
|
|
3427
|
+
created = _ensure_base_template()
|
|
3428
|
+
index_tpl = Path("src/templates/pages/index.twig")
|
|
3429
|
+
if not index_tpl.exists():
|
|
3430
|
+
index_tpl.write_text(_page_twig("Home"), encoding="utf-8")
|
|
3431
|
+
created.append(str(index_tpl))
|
|
3432
|
+
routes = Path("src/routes")
|
|
3433
|
+
routes.mkdir(parents=True, exist_ok=True)
|
|
3434
|
+
index_route = routes / "index.py"
|
|
3435
|
+
if not index_route.exists():
|
|
3436
|
+
index_route.write_text(_page_route("/", "pages/index.twig", "index_page", "Home"), encoding="utf-8")
|
|
3437
|
+
created.append(str(index_route))
|
|
3438
|
+
if created:
|
|
3439
|
+
for p in created:
|
|
3440
|
+
print(f" ✓ Created {p}")
|
|
3441
|
+
else:
|
|
3442
|
+
print(" ✓ base template + index page already present")
|
|
3443
|
+
|
|
3444
|
+
|
|
3445
|
+
def _gen_page(name: str, flags: dict = None):
|
|
3446
|
+
"""Scaffold a page that inherits from the Frond base template.
|
|
3447
|
+
|
|
3448
|
+
tina4python generate page about
|
|
3449
|
+
|
|
3450
|
+
Creates src/templates/pages/<name>.twig (extends base.twig) and a route that
|
|
3451
|
+
renders it. Auto-creates the pages/ folder and bootstraps base.twig when they
|
|
3452
|
+
do not exist yet, so a page always inherits from a real base.
|
|
3453
|
+
"""
|
|
3454
|
+
slug = _to_snake(name or "").strip("/")
|
|
3455
|
+
if not slug:
|
|
3456
|
+
print(" ✗ page needs a name (e.g. generate page about)")
|
|
3457
|
+
return
|
|
3458
|
+
title = slug.replace("_", " ").title()
|
|
3459
|
+
created = _ensure_base_template()
|
|
3460
|
+
tpl = Path("src/templates/pages") / f"{slug}.twig"
|
|
3461
|
+
if tpl.exists():
|
|
3462
|
+
print(f" ✗ File already exists: {tpl}")
|
|
3463
|
+
return
|
|
3464
|
+
tpl.write_text(_page_twig(title), encoding="utf-8")
|
|
3465
|
+
created.append(str(tpl))
|
|
3466
|
+
routes = Path("src/routes")
|
|
3467
|
+
routes.mkdir(parents=True, exist_ok=True)
|
|
3468
|
+
route = routes / f"{slug}.py"
|
|
3469
|
+
if not route.exists():
|
|
3470
|
+
route.write_text(_page_route(f"/{slug}", f"pages/{slug}.twig", f"{slug}_page", title), encoding="utf-8")
|
|
3471
|
+
created.append(str(route))
|
|
3472
|
+
for p in created:
|
|
3473
|
+
print(f" ✓ Created {p}")
|
|
3474
|
+
|
|
3475
|
+
|
|
3355
3476
|
def _gen_view(name: str, flags: dict = None):
|
|
3356
3477
|
"""Generate list + detail view templates.
|
|
3357
3478
|
|
|
@@ -3912,6 +4033,8 @@ def _commands(args=None):
|
|
|
3912
4033
|
GENERATORS = {
|
|
3913
4034
|
"model": {"handler": _gen_model, "usage": '<Name> [--fields "name:string,price:float"] [--table-name <name>]', "summary": "ORM model + matching migration"},
|
|
3914
4035
|
"route": {"handler": _gen_route, "usage": "<name> [--model Name] [--public]", "summary": "CRUD route file, secure by default (--public opens writes)"},
|
|
4036
|
+
"base": {"handler": _gen_base, "usage": "", "summary": "Frond base template + index page + pages/ folder"},
|
|
4037
|
+
"page": {"handler": _gen_page, "usage": "<name>", "summary": "Page that extends base.twig (auto-creates pages/ + base)"},
|
|
3915
4038
|
"crud": {"handler": _gen_crud, "usage": '<Name> [--fields "..."] [--public] [--no-templates]', "summary": "Model + migration + AutoCrud-backed admin page (to_crud) + editable crud/ templates + gate test"},
|
|
3916
4039
|
"migration": {"handler": _gen_migration, "usage": "<description>", "summary": "Timestamped migration file (UP/DOWN)"},
|
|
3917
4040
|
"middleware": {"handler": _gen_middleware, "usage": "<Name>", "summary": "Middleware with before/after hooks"},
|
|
@@ -1654,7 +1654,7 @@ def _handle_rate_limit(request: Request, response: Response) -> Response | None:
|
|
|
1654
1654
|
|
|
1655
1655
|
async def _handle_dev_admin(request: Request, response: Response) -> Response:
|
|
1656
1656
|
"""Serve the /__dev dashboard and API routes."""
|
|
1657
|
-
from tina4_python.dev_admin import get_api_handlers, _dev_request_denial
|
|
1657
|
+
from tina4_python.dev_admin import get_api_handlers, _dev_request_denial, split_view_html
|
|
1658
1658
|
# ADR-0082: ONE gate for every /__dev request, reads and writes alike -
|
|
1659
1659
|
# Host allow-list (DNS rebinding), same-origin (CSRF and cross-site reads)
|
|
1660
1660
|
# and loopback peer. Scoped to /__dev so the deliberately cross-origin
|
|
@@ -1665,7 +1665,15 @@ async def _handle_dev_admin(request: Request, response: Response) -> Response:
|
|
|
1665
1665
|
response.status(_denial[0]).json({"ok": False, "error": _denial[1]})
|
|
1666
1666
|
_cors.apply(request, response)
|
|
1667
1667
|
return response
|
|
1668
|
-
if request.path in ("/__dev/", "/__dev
|
|
1668
|
+
if request.path in ("/__dev/split", "/__dev/split/"):
|
|
1669
|
+
# Detached split view: dashboard/editor LEFT, live app preview RIGHT.
|
|
1670
|
+
# A plain page (no toolbar, no reload) hosting two iframes that each
|
|
1671
|
+
# keep their own reload behaviour - so the editor stays put while the
|
|
1672
|
+
# preview updates on a change.
|
|
1673
|
+
response.html(split_view_html())
|
|
1674
|
+
response.header("cache-control", "no-store, must-revalidate")
|
|
1675
|
+
response.header("pragma", "no-cache")
|
|
1676
|
+
elif request.path in ("/__dev/", "/__dev", "/__dev/v2", "/__dev/v2/"):
|
|
1669
1677
|
# Unified SPA dev admin. The bundle derives its WS URL from
|
|
1670
1678
|
# `location.host` directly, so no environment shim is needed —
|
|
1671
1679
|
# the framework serves /__dev_reload on its own port and the
|
|
@@ -1406,19 +1406,19 @@ async def _api_system(request, response):
|
|
|
1406
1406
|
|
|
1407
1407
|
|
|
1408
1408
|
async def _api_service_ai(request, response):
|
|
1409
|
-
return response({"service": "ai", "url": os.environ.get("TINA4_AI_URL", "http://localhost:
|
|
1409
|
+
return response({"service": "ai", "url": os.environ.get("TINA4_AI_URL", "http://localhost:11435/api/chat"), "ok": True})
|
|
1410
1410
|
|
|
1411
1411
|
|
|
1412
1412
|
async def _api_service_vision(request, response):
|
|
1413
|
-
return response({"service": "vision", "url": os.environ.get("TINA4_VISION_URL", "http://localhost:
|
|
1413
|
+
return response({"service": "vision", "url": os.environ.get("TINA4_VISION_URL", "http://localhost:11435/api/chat"), "ok": True})
|
|
1414
1414
|
|
|
1415
1415
|
|
|
1416
1416
|
async def _api_service_embed(request, response):
|
|
1417
|
-
return response({"service": "embed", "url": os.environ.get("TINA4_EMBED_URL", "http://localhost:
|
|
1417
|
+
return response({"service": "embed", "url": os.environ.get("TINA4_EMBED_URL", "http://localhost:11435/api/embeddings"), "ok": True})
|
|
1418
1418
|
|
|
1419
1419
|
|
|
1420
1420
|
async def _api_service_image(request, response):
|
|
1421
|
-
return response({"service": "image", "url": os.environ.get("TINA4_IMAGE_URL", "http://localhost:
|
|
1421
|
+
return response({"service": "image", "url": os.environ.get("TINA4_IMAGE_URL", "http://localhost:11435/api/generate"), "ok": True})
|
|
1422
1422
|
|
|
1423
1423
|
|
|
1424
1424
|
async def _api_service_rag(request, response):
|
|
@@ -1457,57 +1457,95 @@ def _supervisor_base_url() -> str:
|
|
|
1457
1457
|
|
|
1458
1458
|
|
|
1459
1459
|
async def _api_ai_proxy(request, response):
|
|
1460
|
-
"""
|
|
1461
|
-
|
|
1462
|
-
Accepts the ollama-native body (``{model, messages, stream,
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1460
|
+
"""Pass-through to the Tina4 AI GATEWAY (never a model directly).
|
|
1461
|
+
|
|
1462
|
+
Accepts the ollama-native body (``{model, messages, stream, options}``)
|
|
1463
|
+
the dev-admin SPA sends for FIM completion and supervisor chat, and
|
|
1464
|
+
forwards it VERBATIM to ``TINA4_AI_URL`` - the local gateway
|
|
1465
|
+
(``tina4 ai serve`` on :11435), NOT a model. The gateway enforces the
|
|
1466
|
+
profile sign-in and routes to Ollama or the Tina4 model server, so
|
|
1467
|
+
dev-admin holds no model endpoint.
|
|
1468
|
+
|
|
1469
|
+
The caller's ``stream`` flag is honoured, never overridden. When it is
|
|
1470
|
+
true the upstream NDJSON is relayed line by line to the SPA (the
|
|
1471
|
+
built-in server chunks reliably), so the stream is unbroken model ->
|
|
1472
|
+
gateway -> here -> SPA; otherwise a single JSON reply is returned.
|
|
1469
1473
|
"""
|
|
1470
|
-
import
|
|
1474
|
+
import asyncio
|
|
1475
|
+
import threading
|
|
1471
1476
|
import urllib.error
|
|
1477
|
+
import urllib.request
|
|
1472
1478
|
|
|
1473
1479
|
raw_body = request.body if hasattr(request, "body") else None
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1480
|
+
wants_stream = False
|
|
1481
|
+
if isinstance(raw_body, dict):
|
|
1482
|
+
wants_stream = bool(raw_body.get("stream"))
|
|
1483
|
+
raw_bytes = json.dumps(raw_body).encode()
|
|
1484
|
+
elif isinstance(raw_body, list):
|
|
1485
|
+
raw_bytes = json.dumps(raw_body).encode()
|
|
1479
1486
|
elif isinstance(raw_body, str) and raw_body.strip():
|
|
1480
1487
|
try:
|
|
1481
1488
|
decoded = json.loads(raw_body)
|
|
1482
1489
|
if isinstance(decoded, dict):
|
|
1483
|
-
decoded
|
|
1484
|
-
raw_bytes = json.dumps(decoded).encode()
|
|
1490
|
+
wants_stream = bool(decoded.get("stream"))
|
|
1491
|
+
raw_bytes = json.dumps(decoded).encode() if isinstance(decoded, (dict, list)) else raw_body.encode()
|
|
1485
1492
|
except Exception:
|
|
1486
1493
|
raw_bytes = raw_body.encode()
|
|
1487
1494
|
else:
|
|
1488
1495
|
return response({"error": "empty body"}, 400)
|
|
1489
1496
|
|
|
1490
|
-
ai_url = os.environ.get("TINA4_AI_URL", "http://localhost:
|
|
1491
|
-
try:
|
|
1492
|
-
req = urllib.request.Request(
|
|
1493
|
-
ai_url,
|
|
1494
|
-
data=raw_bytes,
|
|
1495
|
-
headers={"Content-Type": "application/json"},
|
|
1496
|
-
)
|
|
1497
|
-
with urllib.request.urlopen(req, timeout=120) as r:
|
|
1498
|
-
body = r.read()
|
|
1499
|
-
except urllib.error.HTTPError as e:
|
|
1500
|
-
err_body = e.read().decode() if e.fp else str(e)
|
|
1501
|
-
return response({"error": f"AI backend {e.code}: {err_body[:200]}"}, 502)
|
|
1502
|
-
except Exception as e:
|
|
1503
|
-
return response({"error": f"AI backend unreachable: {e}"}, 502)
|
|
1497
|
+
ai_url = os.environ.get("TINA4_AI_URL", "http://localhost:11435/api/chat")
|
|
1504
1498
|
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1499
|
+
def _make_request():
|
|
1500
|
+
return urllib.request.Request(ai_url, data=raw_bytes,
|
|
1501
|
+
headers={"Content-Type": "application/json"})
|
|
1502
|
+
|
|
1503
|
+
# Single-shot: buffer and return one JSON.
|
|
1504
|
+
if not wants_stream:
|
|
1505
|
+
try:
|
|
1506
|
+
with urllib.request.urlopen(_make_request(), timeout=120) as r:
|
|
1507
|
+
body = r.read()
|
|
1508
|
+
except urllib.error.HTTPError as e:
|
|
1509
|
+
err_body = e.read().decode() if e.fp else str(e)
|
|
1510
|
+
return response({"error": f"AI backend {e.code}: {err_body[:200]}"}, 502)
|
|
1511
|
+
except Exception as e:
|
|
1512
|
+
return response({"error": f"AI backend unreachable: {e}"}, 502)
|
|
1513
|
+
try:
|
|
1514
|
+
return response(json.loads(body))
|
|
1515
|
+
except Exception:
|
|
1516
|
+
return response(body.decode("utf-8", errors="replace"))
|
|
1517
|
+
|
|
1518
|
+
# Streaming: relay the gateway's NDJSON line by line. urllib is blocking, so
|
|
1519
|
+
# read it on a worker thread and hand each line to the async generator through
|
|
1520
|
+
# a queue (zero extra dependency - the same bridge the gateway and ai-server use).
|
|
1521
|
+
loop = asyncio.get_running_loop()
|
|
1522
|
+
queue: asyncio.Queue = asyncio.Queue()
|
|
1523
|
+
|
|
1524
|
+
def _pump():
|
|
1525
|
+
try:
|
|
1526
|
+
with urllib.request.urlopen(_make_request(), timeout=120) as r:
|
|
1527
|
+
for line in r: # each NDJSON line as it arrives
|
|
1528
|
+
loop.call_soon_threadsafe(queue.put_nowait, line)
|
|
1529
|
+
except urllib.error.HTTPError as e:
|
|
1530
|
+
err = e.read().decode() if e.fp else str(e)
|
|
1531
|
+
loop.call_soon_threadsafe(queue.put_nowait,
|
|
1532
|
+
(json.dumps({"error": f"AI backend {e.code}: {err[:200]}"}) + "\n").encode())
|
|
1533
|
+
except Exception as e:
|
|
1534
|
+
loop.call_soon_threadsafe(queue.put_nowait,
|
|
1535
|
+
(json.dumps({"error": f"AI backend unreachable: {e}"}) + "\n").encode())
|
|
1536
|
+
finally:
|
|
1537
|
+
loop.call_soon_threadsafe(queue.put_nowait, None)
|
|
1538
|
+
|
|
1539
|
+
threading.Thread(target=_pump, daemon=True).start()
|
|
1540
|
+
|
|
1541
|
+
async def _relay():
|
|
1542
|
+
while True:
|
|
1543
|
+
chunk = await queue.get()
|
|
1544
|
+
if chunk is None:
|
|
1545
|
+
return
|
|
1546
|
+
yield chunk.decode("utf-8", errors="replace") if isinstance(chunk, (bytes, bytearray)) else chunk
|
|
1547
|
+
|
|
1548
|
+
return response.stream(_relay(), content_type="application/x-ndjson")
|
|
1511
1549
|
|
|
1512
1550
|
|
|
1513
1551
|
# ── Customer feedback widget — server-side plumbing ─────────────────
|
|
@@ -2360,37 +2398,17 @@ def toolbar_js() -> str:
|
|
|
2360
2398
|
var barClose = document.getElementById('tina4-bar-close');
|
|
2361
2399
|
if (barClose) { barClose.addEventListener('click', function () { bar.style.display = 'none'; }); }
|
|
2362
2400
|
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
var f = document.createElement('iframe');
|
|
2368
|
-
f.src = '/__dev';
|
|
2369
|
-
c.appendChild(f);
|
|
2370
|
-
document.body.appendChild(c);
|
|
2371
|
-
return c;
|
|
2372
|
-
}
|
|
2373
|
-
function toggleOverlay(e) {
|
|
2374
|
-
if (e) { e.preventDefault(); }
|
|
2375
|
-
var p = document.getElementById('tina4-dev-panel');
|
|
2376
|
-
if (p) {
|
|
2377
|
-
var hide = p.style.display !== 'none';
|
|
2378
|
-
p.style.display = hide ? 'none' : 'block';
|
|
2379
|
-
try { localStorage.setItem(STATE_KEY, hide ? '0' : '1'); } catch (_) {}
|
|
2380
|
-
return;
|
|
2381
|
-
}
|
|
2382
|
-
buildOverlay();
|
|
2383
|
-
try { localStorage.setItem(STATE_KEY, '1'); } catch (_) {}
|
|
2384
|
-
}
|
|
2401
|
+
// Replace the old in-app iframe overlay: clicking Dashboard navigates to
|
|
2402
|
+
// the detached split view (editor/dashboard LEFT, live preview RIGHT) as
|
|
2403
|
+
// its own page. The app page reloading on a change no longer stomps the
|
|
2404
|
+
// dashboard, because the dashboard is no longer embedded in it.
|
|
2385
2405
|
var dash = document.getElementById('tina4-dash-link');
|
|
2386
|
-
if (dash) {
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
}
|
|
2393
|
-
} catch (_) {}
|
|
2406
|
+
if (dash) {
|
|
2407
|
+
dash.addEventListener('click', function (e) {
|
|
2408
|
+
e.preventDefault();
|
|
2409
|
+
window.location.href = '/__dev/split';
|
|
2410
|
+
});
|
|
2411
|
+
}
|
|
2394
2412
|
|
|
2395
2413
|
if (bar.getAttribute('data-reload') !== '1') { return; }
|
|
2396
2414
|
var cssExts = ['.css', '.scss'], debounce = null, interval = parseInt('__POLL_INTERVAL__') || 3000;
|
|
@@ -2437,6 +2455,21 @@ def toolbar_js() -> str:
|
|
|
2437
2455
|
""".replace("__POLL_INTERVAL__", str(poll_interval_ms))
|
|
2438
2456
|
|
|
2439
2457
|
|
|
2458
|
+
def split_view_html() -> str:
|
|
2459
|
+
"""The detached dev split view, served from the SHARED asset
|
|
2460
|
+
``public/js/tina4-dev-admin-split.html`` - one source across all four
|
|
2461
|
+
frameworks (PHP/Ruby/Node serve the same file). A plain page: dashboard/
|
|
2462
|
+
editor LEFT, live app preview RIGHT; no toolbar injected, never reloads."""
|
|
2463
|
+
import tina4_python
|
|
2464
|
+
asset = Path(tina4_python.__file__).parent / "public" / "js" / "tina4-dev-admin-split.html"
|
|
2465
|
+
try:
|
|
2466
|
+
return asset.read_text(encoding="utf-8")
|
|
2467
|
+
except OSError:
|
|
2468
|
+
return ("<!DOCTYPE html><html><body><h1>Split view asset missing</h1>"
|
|
2469
|
+
"<p>Reinstall tina4-python or redeploy the dev-admin bundle.</p></body></html>")
|
|
2470
|
+
|
|
2471
|
+
|
|
2472
|
+
|
|
2440
2473
|
# ── Editor API endpoints ──────────────────────────────────────
|
|
2441
2474
|
|
|
2442
2475
|
async def _api_files(request, response):
|
|
@@ -3252,10 +3285,28 @@ _SCAFFOLD_KINDS = [
|
|
|
3252
3285
|
async def _api_scaffold_list(request, response):
|
|
3253
3286
|
"""GET — list the scaffold kinds this framework knows how to emit.
|
|
3254
3287
|
|
|
3255
|
-
|
|
3256
|
-
|
|
3288
|
+
Data-driven from the CLI's GENERATORS registry (the single source of truth),
|
|
3289
|
+
so every generator the framework has - not a hardcoded subset - appears as a
|
|
3290
|
+
button, and a new generator shows up with no dashboard change. Each item
|
|
3291
|
+
carries the `kind` the /scaffold/run endpoint expects, a human `label`, and
|
|
3292
|
+
whether it `needs_name`.
|
|
3257
3293
|
"""
|
|
3258
|
-
|
|
3294
|
+
try:
|
|
3295
|
+
from tina4_python.cli import GENERATORS
|
|
3296
|
+
except Exception:
|
|
3297
|
+
return response({"kinds": _SCAFFOLD_KINDS})
|
|
3298
|
+
no_name = {"auth", "base"}
|
|
3299
|
+
kinds = [
|
|
3300
|
+
{
|
|
3301
|
+
"kind": k,
|
|
3302
|
+
"label": k.replace("_", " ").title(),
|
|
3303
|
+
"needs_name": k not in no_name,
|
|
3304
|
+
"summary": spec.get("summary", ""),
|
|
3305
|
+
"usage": spec.get("usage", ""),
|
|
3306
|
+
}
|
|
3307
|
+
for k, spec in GENERATORS.items()
|
|
3308
|
+
]
|
|
3309
|
+
return response({"kinds": kinds})
|
|
3259
3310
|
|
|
3260
3311
|
|
|
3261
3312
|
async def _api_scaffold_run(request, response):
|
|
@@ -3276,55 +3327,40 @@ async def _api_scaffold_run(request, response):
|
|
|
3276
3327
|
name = (body.get("name") or "").strip()
|
|
3277
3328
|
if not kind:
|
|
3278
3329
|
return response({"ok": False, "error": "missing 'kind'"}, 400)
|
|
3279
|
-
if not name and kind != "auth":
|
|
3280
|
-
return response({"ok": False, "error": "missing 'name'"}, 400)
|
|
3281
3330
|
|
|
3282
|
-
#
|
|
3283
|
-
# the
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
"migration": "generate_migration",
|
|
3292
|
-
"middleware": "generate_middleware",
|
|
3293
|
-
}
|
|
3294
|
-
fn_name = generator_map.get(kind)
|
|
3295
|
-
if fn_name is None:
|
|
3331
|
+
# Dispatch through the CLI's GENERATORS registry - the same single source of
|
|
3332
|
+
# truth the list endpoint reads, so ANY generator (incl. page/base) runs.
|
|
3333
|
+
try:
|
|
3334
|
+
from tina4_python.cli import GENERATORS
|
|
3335
|
+
except Exception as exc:
|
|
3336
|
+
return response({"ok": False, "error": f"generators unavailable: {exc}"}, 500)
|
|
3337
|
+
|
|
3338
|
+
spec = GENERATORS.get(kind)
|
|
3339
|
+
if spec is None:
|
|
3296
3340
|
return response({"ok": False, "error": f"unknown scaffold kind: {kind}"}, 400)
|
|
3297
3341
|
|
|
3342
|
+
no_name = {"auth", "base"}
|
|
3343
|
+
if not name and kind not in no_name:
|
|
3344
|
+
return response({"ok": False, "error": "missing 'name'"}, 400)
|
|
3345
|
+
|
|
3346
|
+
# Guard against path traversal / shell-metacharacter injection in the name -
|
|
3347
|
+
# generator functions pass it into file paths. (A no-name generator skips it.)
|
|
3348
|
+
if name:
|
|
3349
|
+
import re
|
|
3350
|
+
if not re.match(r"^[A-Za-z][A-Za-z0-9_\-]*$", name):
|
|
3351
|
+
return response({"ok": False, "error": "name must match [A-Za-z][A-Za-z0-9_-]*"}, 400)
|
|
3352
|
+
|
|
3353
|
+
import io
|
|
3354
|
+
import contextlib
|
|
3355
|
+
buf = io.StringIO()
|
|
3298
3356
|
try:
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
if fn is None:
|
|
3302
|
-
# Fall back to shelling out — keeps the endpoint useful
|
|
3303
|
-
# even if the generator function names drift.
|
|
3304
|
-
import subprocess
|
|
3305
|
-
cp = subprocess.run(
|
|
3306
|
-
["tina4python", "generate", kind, name],
|
|
3307
|
-
capture_output=True, text=True, timeout=30,
|
|
3308
|
-
)
|
|
3309
|
-
if cp.returncode != 0:
|
|
3310
|
-
return response({"ok": False, "error": cp.stderr.strip() or cp.stdout.strip()}, 500)
|
|
3311
|
-
return response({"ok": True, "output": cp.stdout.strip()})
|
|
3312
|
-
|
|
3313
|
-
# Invoke the generator directly. The CLI functions typically
|
|
3314
|
-
# print to stdout + write files; we don't capture their
|
|
3315
|
-
# output here — the file tree will refresh and show the new
|
|
3316
|
-
# files, which is what the user actually cares about.
|
|
3317
|
-
result = fn(name) if fn.__code__.co_argcount == 1 else fn(name, None)
|
|
3318
|
-
|
|
3319
|
-
# Most generators return a path or list of paths; normalise.
|
|
3320
|
-
files: list[str] = []
|
|
3321
|
-
if isinstance(result, str):
|
|
3322
|
-
files = [result]
|
|
3323
|
-
elif isinstance(result, list):
|
|
3324
|
-
files = [str(p) for p in result]
|
|
3325
|
-
return response({"ok": True, "kind": kind, "name": name, "files": files})
|
|
3357
|
+
with contextlib.redirect_stdout(buf):
|
|
3358
|
+
spec["handler"](name, {})
|
|
3326
3359
|
except Exception as exc:
|
|
3327
3360
|
return response({"ok": False, "error": str(exc)}, 500)
|
|
3361
|
+
# Generators print their "Created X" lines and refresh the file tree; we
|
|
3362
|
+
# return the captured output so the chip can show what happened.
|
|
3363
|
+
return response({"ok": True, "kind": kind, "name": name, "output": buf.getvalue().strip()})
|
|
3328
3364
|
|
|
3329
3365
|
|
|
3330
3366
|
# ─── Run-chip endpoints (migrate / test / seed-all) ────────────────
|
|
@@ -510,7 +510,7 @@ def flesh(name: str = "", prompt: str = "") -> dict:
|
|
|
510
510
|
user_parts.append(f"Extra context from caller: {prompt}")
|
|
511
511
|
user_parts.append("Reply with ONLY the JSON array — no explanation, no markdown fences.")
|
|
512
512
|
|
|
513
|
-
ai_url = _os.environ.get("TINA4_AI_URL", "http://localhost:
|
|
513
|
+
ai_url = _os.environ.get("TINA4_AI_URL", "http://localhost:11435/api/chat")
|
|
514
514
|
ai_model = _os.environ.get("TINA4_AI_MODEL", "qwen2.5-coder:14b")
|
|
515
515
|
try:
|
|
516
516
|
req = _urlreq.Request(
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "js/tina4-dev-admin.min.js",
|
|
44
|
-
"component": "tina4-dev-admin-
|
|
45
|
-
"sha256": "
|
|
44
|
+
"component": "tina4-dev-admin-8c4617d",
|
|
45
|
+
"sha256": "6b05be06b5d76ee4126a11f019d104d3920c1e3234250cfe1966a33f34c1a234"
|
|
46
46
|
}
|
|
47
47
|
]
|
|
48
48
|
}
|