tina4-python 3.10.42__tar.gz → 3.10.43__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.
Files changed (143) hide show
  1. {tina4_python-3.10.42 → tina4_python-3.10.43}/PKG-INFO +1 -1
  2. {tina4_python-3.10.42 → tina4_python-3.10.43}/pyproject.toml +4 -1
  3. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/__init__.py +1 -1
  4. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/ai/__init__.py +264 -115
  5. {tina4_python-3.10.42 → tina4_python-3.10.43}/.gitignore +0 -0
  6. {tina4_python-3.10.42 → tina4_python-3.10.43}/README.md +0 -0
  7. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/CLAUDE.md +0 -0
  8. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/HtmlElement.py +0 -0
  9. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/Testing.py +0 -0
  10. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/api/__init__.py +0 -0
  11. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/auth/__init__.py +0 -0
  12. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/cache/__init__.py +0 -0
  13. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/cli/__init__.py +0 -0
  14. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/container/__init__.py +0 -0
  15. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/core/__init__.py +0 -0
  16. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/core/cache.py +0 -0
  17. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/core/constants.py +0 -0
  18. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/core/events.py +0 -0
  19. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/core/middleware.py +0 -0
  20. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/core/request.py +0 -0
  21. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/core/response.py +0 -0
  22. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/core/router.py +0 -0
  23. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/core/server.py +0 -0
  24. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/crud/__init__.py +0 -0
  25. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/database/__init__.py +0 -0
  26. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/database/adapter.py +0 -0
  27. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/database/connection.py +0 -0
  28. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/database/firebird.py +0 -0
  29. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/database/mssql.py +0 -0
  30. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/database/mysql.py +0 -0
  31. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/database/odbc.py +0 -0
  32. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/database/postgres.py +0 -0
  33. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/database/sqlite.py +0 -0
  34. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/debug/__init__.py +0 -0
  35. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/debug/error_overlay.py +0 -0
  36. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/dev_admin/__init__.py +0 -0
  37. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/dev_admin/metrics.py +0 -0
  38. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/dev_reload.py +0 -0
  39. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/dotenv/__init__.py +0 -0
  40. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/frond/FROND.md +0 -0
  41. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/frond/__init__.py +0 -0
  42. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/frond/engine.py +0 -0
  43. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/auth/meta.json +0 -0
  44. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/auth/src/routes/api/gallery_auth.py +0 -0
  45. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/database/meta.json +0 -0
  46. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/database/src/routes/api/gallery_db.py +0 -0
  47. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/error-overlay/meta.json +0 -0
  48. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/error-overlay/src/routes/api/gallery_crash.py +0 -0
  49. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/orm/meta.json +0 -0
  50. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/orm/src/orm/Product.py +0 -0
  51. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/orm/src/routes/api/gallery_products.py +0 -0
  52. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/queue/meta.json +0 -0
  53. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/queue/src/routes/api/gallery_queue.py +0 -0
  54. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/rest-api/meta.json +0 -0
  55. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/rest-api/src/routes/api/gallery_hello.py +0 -0
  56. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/templates/meta.json +0 -0
  57. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/templates/src/routes/gallery_page.py +0 -0
  58. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/gallery/templates/src/templates/gallery_page.twig +0 -0
  59. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/graphql/__init__.py +0 -0
  60. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/i18n/__init__.py +0 -0
  61. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/mcp/__init__.py +0 -0
  62. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/mcp/protocol.py +0 -0
  63. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/mcp/tools.py +0 -0
  64. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/messenger/__init__.py +0 -0
  65. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/migration/__init__.py +0 -0
  66. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/migration/runner.py +0 -0
  67. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/orm/__init__.py +0 -0
  68. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/orm/fields.py +0 -0
  69. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/orm/model.py +0 -0
  70. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/css/tina4.css +0 -0
  71. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/css/tina4.min.css +0 -0
  72. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/favicon.ico +0 -0
  73. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/images/logo.svg +0 -0
  74. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/images/tina4-logo-icon.webp +0 -0
  75. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/js/frond.min.js +0 -0
  76. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/js/tina4-dev-admin.min.js +0 -0
  77. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/js/tina4.min.js +0 -0
  78. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/js/tina4js.min.js +0 -0
  79. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/swagger/index.html +0 -0
  80. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
  81. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/query_builder/__init__.py +0 -0
  82. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/queue/__init__.py +0 -0
  83. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/queue_backends/__init__.py +0 -0
  84. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/queue_backends/kafka_backend.py +0 -0
  85. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/queue_backends/mongo_backend.py +0 -0
  86. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/queue_backends/rabbitmq_backend.py +0 -0
  87. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/__init__.py +0 -0
  88. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_alerts.scss +0 -0
  89. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_badges.scss +0 -0
  90. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_buttons.scss +0 -0
  91. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_cards.scss +0 -0
  92. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_forms.scss +0 -0
  93. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_grid.scss +0 -0
  94. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_modals.scss +0 -0
  95. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_nav.scss +0 -0
  96. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_reset.scss +0 -0
  97. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_tables.scss +0 -0
  98. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_typography.scss +0 -0
  99. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_utilities.scss +0 -0
  100. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_variables.scss +0 -0
  101. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/base.scss +0 -0
  102. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/colors.scss +0 -0
  103. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/scss/tina4css/tina4.scss +0 -0
  104. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/seeder/__init__.py +0 -0
  105. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/service/__init__.py +0 -0
  106. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/session/__init__.py +0 -0
  107. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/session_handlers/__init__.py +0 -0
  108. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/session_handlers/mongodb_handler.py +0 -0
  109. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/session_handlers/redis_handler.py +0 -0
  110. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/session_handlers/valkey_handler.py +0 -0
  111. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/swagger/__init__.py +0 -0
  112. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/components/crud.twig +0 -0
  113. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/docker/distroless/Dockerfile +0 -0
  114. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/docker/poetry/Dockerfile +0 -0
  115. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/docker/python/Dockerfile +0 -0
  116. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/docker/uv/Dockerfile +0 -0
  117. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/errors/302.twig +0 -0
  118. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/errors/401.twig +0 -0
  119. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/errors/403.twig +0 -0
  120. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/errors/404.twig +0 -0
  121. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/errors/500.twig +0 -0
  122. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/errors/502.twig +0 -0
  123. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/errors/503.twig +0 -0
  124. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/errors/base.twig +0 -0
  125. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/frontend/README.md +0 -0
  126. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/templates/readme.md +0 -0
  127. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/test_client/__init__.py +0 -0
  128. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/af/LC_MESSAGES/messages.mo +0 -0
  129. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/af/LC_MESSAGES/messages.po +0 -0
  130. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
  131. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
  132. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/es/LC_MESSAGES/messages.mo +0 -0
  133. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/es/LC_MESSAGES/messages.po +0 -0
  134. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
  135. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
  136. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/ja/LC_MESSAGES/messages.mo +0 -0
  137. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/ja/LC_MESSAGES/messages.po +0 -0
  138. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/zh/LC_MESSAGES/messages.mo +0 -0
  139. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/translations/zh/LC_MESSAGES/messages.po +0 -0
  140. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/validator/__init__.py +0 -0
  141. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/websocket/__init__.py +0 -0
  142. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/websocket/backplane.py +0 -0
  143. {tina4_python-3.10.42 → tina4_python-3.10.43}/tina4_python/wsdl/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tina4-python
3
- Version: 3.10.42
3
+ Version: 3.10.43
4
4
  Summary: Tina4 for Python — 54 built-in features, zero dependencies
5
5
  Author-email: Andre van Zuydam <andrevanzuydam@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tina4-python"
3
- version = "3.10.42"
3
+ dynamic = ["version"]
4
4
  description = "Tina4 for Python — 54 built-in features, zero dependencies"
5
5
  authors = [
6
6
  {name = "Andre van Zuydam", email = "andrevanzuydam@gmail.com"}
@@ -55,6 +55,9 @@ dev = [
55
55
  requires = ["hatchling"]
56
56
  build-backend = "hatchling.build"
57
57
 
58
+ [tool.hatch.version]
59
+ path = "tina4_python/__init__.py"
60
+
58
61
  [tool.hatch.build]
59
62
  include = ["tina4_python/**/*"]
60
63
 
@@ -8,7 +8,7 @@ Tina4 Python v3.0 — Zero-dependency, lightweight web framework.
8
8
 
9
9
  One import, everything works.
10
10
  """
11
- __version__ = "3.10.40"
11
+ __version__ = "3.10.43"
12
12
 
13
13
  # ── HTTP Constants ──
14
14
  from tina4_python.core.constants import ( # noqa: E402, F401
@@ -74,10 +74,9 @@ def install_selected(root: str, selection: str) -> list[str]:
74
74
  except ValueError:
75
75
  pass
76
76
 
77
- context = generate_context()
78
-
79
77
  for idx in indices:
80
78
  tool = AI_TOOLS[idx]
79
+ context = generate_context(tool["name"])
81
80
  files = _install_for_tool(root_path, tool, context)
82
81
  created.extend(files)
83
82
 
@@ -173,139 +172,289 @@ def _install_claude_skills(root: Path) -> list[str]:
173
172
  return created
174
173
 
175
174
 
176
- def generate_context() -> str:
177
- """Generate the universal Tina4 context document for any AI assistant."""
178
- return f"""# Tina4 Python — AI Context
175
+ def generate_context(tool_name: str = "claude-code") -> str:
176
+ """Generate tool-specific Tina4 context. Each tool gets content suited to its format."""
177
+ from tina4_python import __version__
178
+ v = __version__
179
179
 
180
- This project uses **Tina4 Python**, a lightweight, batteries-included web framework
181
- with zero third-party dependencies for core features.
180
+ # Shared building blocks
181
+ _route_example = '''from tina4_python.core.router import get, post, noauth, secured
182
182
 
183
- **Documentation:** https://tina4.com
183
+ @get("/api/users")
184
+ async def list_users(request, response):
185
+ return response({{"users": []}})
184
186
 
185
- ## Quick Start
187
+ @post("/api/users")
188
+ @noauth()
189
+ async def create_user(request, response):
190
+ return response({{"created": request.body["name"]}}, 201)'''
186
191
 
187
- ```bash
188
- tina4python init . # Scaffold project
189
- tina4python serve # Start dev server on port 7145
190
- tina4python migrate # Run database migrations
191
- tina4python test # Run test suite
192
- tina4python routes # List all registered routes
192
+ _orm_example = '''from tina4_python.orm import ORM, IntegerField, StringField
193
+
194
+ class User(ORM):
195
+ table_name = "users"
196
+ id = IntegerField(primary_key=True, auto_increment=True)
197
+ name = StringField(required=True)
198
+ email = StringField()'''
199
+
200
+ _conventions = """1. Routes return response() — always response(data) not response.json()
201
+ 2. GET routes are public, POST/PUT/PATCH/DELETE require auth by default
202
+ 3. Use @noauth() to make write routes public, @secured() to protect GET routes
203
+ 4. Decorator order: @noauth/@secured then @description/@tags then @get/@post (route innermost)
204
+ 5. Every template extends base.twig
205
+ 6. All schema changes via migrations — never create tables in route code
206
+ 7. Use built-in features — never install packages for things Tina4 already provides"""
207
+
208
+ _features_compact = (
209
+ "Router, ORM, Database (SQLite/PostgreSQL/MySQL/MSSQL/Firebird), "
210
+ "Frond templates (Twig-compatible), JWT auth, Sessions (File/Redis/Valkey/MongoDB/DB), "
211
+ "GraphQL + GraphiQL, WebSocket + Redis backplane, WSDL/SOAP, Queue (File/RabbitMQ/Kafka/MongoDB), "
212
+ "HTTP client, Messenger (SMTP/IMAP), FakeData/Seeder, Migrations, SCSS compiler, "
213
+ "Swagger/OpenAPI, i18n, Events, Container/DI, HtmlElement, Inline testing, "
214
+ "Error overlay, Dev dashboard, Rate limiter, Response cache, Logging, MCP server"
215
+ )
216
+
217
+ _project_structure = """src/routes/ — Route handlers (auto-discovered)
218
+ src/orm/ — ORM models
219
+ src/templates/ — Twig templates
220
+ src/app/ — Service classes
221
+ src/scss/ — SCSS (auto-compiled)
222
+ src/public/ — Static assets
223
+ src/seeds/ — Database seeders
224
+ migrations/ — SQL migration files
225
+ tests/ — pytest tests"""
226
+
227
+ # ── Cursor: compact key patterns ──
228
+ if tool_name == "cursor":
229
+ return f"""# tina4-python — Cursor Rules
230
+
231
+ Tina4 Python v{v}. 54 built-in features, zero dependencies. Python 3.12+.
232
+
233
+ ## Key Patterns
234
+
235
+ ```python
236
+ {_route_example}
237
+ ```
238
+
239
+ ```python
240
+ {_orm_example}
241
+ ```
242
+
243
+ ## Critical Rules
244
+
245
+ {_conventions}
246
+
247
+ ## Built-in Features
248
+
249
+ {_features_compact}
250
+
251
+ ## Docs
252
+
253
+ https://tina4.com
254
+ """
255
+
256
+ # ── Copilot: short instructions ──
257
+ if tool_name == "copilot":
258
+ return f"""# tina4-python Copilot Instructions
259
+
260
+ Tina4 Python v{v}. 54 features, zero dependencies.
261
+
262
+ ## Route Pattern
263
+
264
+ ```python
265
+ {_route_example}
266
+ ```
267
+
268
+ ## Critical Rules
269
+
270
+ {_conventions}
271
+
272
+ ## Built-in (use these, don't install alternatives)
273
+
274
+ {_features_compact}
275
+ """
276
+
277
+ # ── Windsurf: same format as Cursor ──
278
+ if tool_name == "windsurf":
279
+ return f"""# tina4-python — Windsurf Rules
280
+
281
+ Tina4 Python v{v}. 54 built-in features, zero dependencies. Python 3.12+.
282
+
283
+ ## Key Patterns
284
+
285
+ ```python
286
+ {_route_example}
287
+ ```
288
+
289
+ ```python
290
+ {_orm_example}
193
291
  ```
194
292
 
293
+ ## Conventions
294
+
295
+ {_conventions}
296
+
297
+ ## Built-in Features
298
+
299
+ {_features_compact}
300
+
195
301
  ## Project Structure
196
302
 
197
303
  ```
198
- src/routes/ — Route handlers (auto-discovered, one per resource)
199
- src/orm/ — ORM models (one per file, filename = class name)
200
- src/templates/ — Twig/Jinja2 templates (extends base.twig)
201
- src/app/ — Shared helpers and service classes
202
- src/scss/ — SCSS files (auto-compiled to public/css/)
203
- src/public/ — Static assets served at /
204
- src/locales/ — Translation JSON files
205
- src/seeds/ — Database seeder scripts
206
- migrations/ — SQL migration files (sequential numbered)
207
- tests/ — pytest test files
304
+ {_project_structure}
305
+ ```
306
+
307
+ ## Docs
308
+
309
+ https://tina4.com
310
+ """
311
+
312
+ # ── Aider (CONVENTIONS.md): concise conventions ──
313
+ if tool_name == "aider":
314
+ return f"""# Tina4 Python — Conventions
315
+
316
+ v{v} — 54 built-in features, zero dependencies.
317
+
318
+ ## Rules
319
+
320
+ {_conventions}
321
+
322
+ ## Route Pattern
323
+
324
+ ```python
325
+ {_route_example}
208
326
  ```
209
327
 
210
- ## Built-in Features (No External Packages Needed)
211
-
212
- | Feature | Module | Import |
213
- |---------|--------|--------|
214
- | Routing | router | `from tina4_python.core.router import get, post, put, delete` |
215
- | ORM | orm | `from tina4_python.orm import ORM, IntegerField, StringField` |
216
- | Database | database | `from tina4_python.database import Database` |
217
- | Templates | template | `response.render("page.twig", data)` |
218
- | JWT Auth | auth | `from tina4_python.auth import Auth, hash_password, check_password` |
219
- | REST API Client | api | `from tina4_python.api import Api` |
220
- | GraphQL | graphql | `from tina4_python.graphql import GraphQL, Schema` |
221
- | WebSocket | websocket | `from tina4_python.websocket import WebSocketServer` |
222
- | SOAP/WSDL | wsdl | `from tina4_python.wsdl import WSDL, wsdl_operation` |
223
- | Email (SMTP+IMAP) | messenger | `from tina4_python.messenger import Messenger` |
224
- | Background Queue | queue | `from tina4_python.queue import Queue` |
225
- | SCSS Compilation | scss | Auto-compiled from src/scss/ |
226
- | Migrations | migration | `tina4python migrate` CLI command |
227
- | Seeder | seeder | `from tina4_python.seeder import FakeData, seed_table` |
228
- | i18n | localization | `from tina4_python.localization import Localization` |
229
- | Swagger/OpenAPI | swagger | Auto-generated at /swagger |
230
- | Sessions | session | `request.session.get(key)` / `.set(key, value)` |
231
- | Middleware | middleware | `@middleware(MyMiddleware)` decorator |
232
- | HTML Builder | html_element | `from tina4_python.html_element import HTMLElement` |
233
- | Form Tokens | template | `{{{{ form_token() }}}}` in Twig |
234
-
235
- ## Key Conventions
236
-
237
- 1. **Routes return `response()`** — always use `response(data)` not `response.json()`
238
- 2. **GET routes are public**, POST/PUT/PATCH/DELETE require auth by default
239
- 3. **Use `@noauth()`** to make write routes public, `@secured()` to protect GET routes
240
- 4. **Decorator order**: `@noauth/@secured` → `@description/@tags` → `@get/@post` (route decorator innermost)
241
- 5. **Every template extends `base.twig`** — no standalone HTML pages
242
- 6. **No inline styles** — use SCSS in `src/scss/` with CSS variables
243
- 7. **No hardcoded colors** — use `var(--primary)`, `var(--text)`, etc.
244
- 8. **All schema changes via migrations** — never create tables in route code
245
- 9. **Service pattern** — complex logic goes in `src/app/` service classes, routes stay thin
246
- 10. **Use built-in features** — never install packages for things Tina4 already provides
247
-
248
- ## AI Workflow — Available Skills
249
-
250
- When using an AI coding assistant with Tina4, these skills are available:
251
-
252
- | Skill | Description |
253
- |-------|-------------|
254
- | `/tina4-route` | Create a new route with proper decorators and auth |
255
- | `/tina4-orm` | Create an ORM model with migration |
256
- | `/tina4-crud` | Generate complete CRUD (migration, ORM, routes, template, tests) |
257
- | `/tina4-auth` | Set up JWT authentication with login/register |
258
- | `/tina4-api` | Create an external API integration |
259
- | `/tina4-queue` | Set up background job processing |
260
- | `/tina4-template` | Create a server-rendered template page |
261
- | `/tina4-graphql` | Set up a GraphQL endpoint |
262
- | `/tina4-websocket` | Set up WebSocket communication |
263
- | `/tina4-wsdl` | Create a SOAP/WSDL service |
264
- | `/tina4-messenger` | Set up email send/receive |
265
- | `/tina4-test` | Write tests for a feature |
266
- | `/tina4-migration` | Create a database migration |
267
- | `/tina4-seed` | Generate fake data for development |
268
- | `/tina4-i18n` | Set up internationalization |
269
- | `/tina4-scss` | Set up SCSS stylesheets |
270
- | `/tina4-frontend` | Set up a frontend framework |
271
-
272
- ## Common Patterns
273
-
274
- ### Route
328
+ ## ORM Pattern
329
+
275
330
  ```python
276
- from tina4_python.core.router import get, post, noauth
277
- from tina4_python.swagger import description, tags
331
+ {_orm_example}
332
+ ```
333
+
334
+ ## Structure
278
335
 
279
- @noauth()
280
- @description("Create a widget")
281
- @tags(["widgets"])
282
- @post("/api/widgets")
283
- async def create_widget(request, response):
284
- data = request.body
285
- return response({{"created": True}}, 201)
286
336
  ```
337
+ {_project_structure}
338
+ ```
339
+
340
+ ## Built-in Features
341
+
342
+ {_features_compact}
343
+ """
344
+
345
+ # ── Cline: same as Cursor ──
346
+ if tool_name == "cline":
347
+ return f"""# tina4-python — Cline Rules
348
+
349
+ Tina4 Python v{v}. 54 built-in features, zero dependencies. Python 3.12+.
350
+
351
+ ## Key Patterns
287
352
 
288
- ### ORM Model
289
353
  ```python
290
- from tina4_python.orm import ORM, IntegerField, StringField
354
+ {_route_example}
355
+ ```
291
356
 
292
- class Widget(ORM):
293
- id = IntegerField(primary_key=True, auto_increment=True)
294
- name = StringField()
357
+ ```python
358
+ {_orm_example}
359
+ ```
360
+
361
+ ## Conventions
362
+
363
+ {_conventions}
364
+
365
+ ## Built-in Features
366
+
367
+ {_features_compact}
368
+ """
369
+
370
+ # ── Codex (AGENTS.md): task-oriented ──
371
+ if tool_name == "codex":
372
+ return f"""# Tina4 Python — Agent Instructions
373
+
374
+ v{v}. 54 built-in features, zero dependencies. Python 3.12+.
375
+
376
+ ## Framework
377
+
378
+ This project uses Tina4 Python. All features are built in — do not install external packages for routing, ORM, auth, templates, GraphQL, WebSocket, email, queues, or any other feature listed below.
379
+
380
+ ## Conventions
381
+
382
+ {_conventions}
383
+
384
+ ## Route Pattern
385
+
386
+ ```python
387
+ {_route_example}
295
388
  ```
296
389
 
297
- ### Template
298
- ```twig
299
- {{% extends "base.twig" %}}
300
- {{% block content %}}
301
- <div class="container">
302
- <h1>{{{{ title }}}}</h1>
303
- {{% for item in items %}}
304
- <p>{{{{ item.name }}}}</p>
305
- {{% endfor %}}
306
- </div>
307
- {{% endblock %}}
390
+ ## ORM Pattern
391
+
392
+ ```python
393
+ {_orm_example}
394
+ ```
395
+
396
+ ## Available Features
397
+
398
+ {_features_compact}
399
+
400
+ ## Project Structure
401
+
308
402
  ```
403
+ {_project_structure}
404
+ ```
405
+
406
+ ## CLI
407
+
408
+ ```bash
409
+ tina4python serve # Dev server on port 7145
410
+ tina4python migrate # Run migrations
411
+ tina4python test # Run tests
412
+ tina4python routes # List routes
413
+ ```
414
+ """
415
+
416
+ # ── Claude Code (CLAUDE.md): full developer guide — defer to existing CLAUDE.md ──
417
+ # For claude-code, read the existing CLAUDE.md from the framework repo
418
+ # as it's the most detailed and maintained file
419
+ if tool_name == "claude-code":
420
+ framework_claude = Path(__file__).parent.parent.parent / "CLAUDE.md"
421
+ if framework_claude.exists():
422
+ return framework_claude.read_text(encoding="utf-8")
423
+
424
+ # Fallback: universal context
425
+ return f"""# Tina4 Python — AI Context
426
+
427
+ Tina4 Python v{v}. 54 built-in features, zero dependencies.
428
+
429
+ ## Conventions
430
+
431
+ {_conventions}
432
+
433
+ ## Route Pattern
434
+
435
+ ```python
436
+ {_route_example}
437
+ ```
438
+
439
+ ## ORM Pattern
440
+
441
+ ```python
442
+ {_orm_example}
443
+ ```
444
+
445
+ ## Built-in Features
446
+
447
+ {_features_compact}
448
+
449
+ ## Project Structure
450
+
451
+ ```
452
+ {_project_structure}
453
+ ```
454
+
455
+ ## Docs
456
+
457
+ https://tina4.com
309
458
  """
310
459
 
311
460
 
File without changes