chattice 0.14.0b1__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 (377) hide show
  1. chattice-0.14.0b1/.gitignore +17 -0
  2. chattice-0.14.0b1/.python-version +2 -0
  3. chattice-0.14.0b1/AGENTS.md +122 -0
  4. chattice-0.14.0b1/CHANGELOG.md +210 -0
  5. chattice-0.14.0b1/CODE_OF_CONDUCT.md +6 -0
  6. chattice-0.14.0b1/CONTRIBUTING.md +47 -0
  7. chattice-0.14.0b1/LICENSE +21 -0
  8. chattice-0.14.0b1/PKG-INFO +170 -0
  9. chattice-0.14.0b1/PUBLIC_API.md +26 -0
  10. chattice-0.14.0b1/README.md +141 -0
  11. chattice-0.14.0b1/SECURITY.md +30 -0
  12. chattice-0.14.0b1/THIRD_PARTY_NOTICES.md +66 -0
  13. chattice-0.14.0b1/docs/adr/ADR-001-event-domain-model.md +50 -0
  14. chattice-0.14.0b1/docs/adr/ADR-002-dispatcher-router.md +53 -0
  15. chattice-0.14.0b1/docs/adr/ADR-003-raw-google-models.md +46 -0
  16. chattice-0.14.0b1/docs/adr/ADR-004-transport-abstraction.md +42 -0
  17. chattice-0.14.0b1/docs/adr/ADR-005-authentication-abstraction.md +46 -0
  18. chattice-0.14.0b1/docs/adr/ADR-006-fsm-key-strategy.md +47 -0
  19. chattice-0.14.0b1/docs/adr/ADR-007-cards-builder.md +45 -0
  20. chattice-0.14.0b1/docs/adr/ADR-008-sync-async-responses.md +50 -0
  21. chattice-0.14.0b1/docs/adr/ADR-009-google-interaction-normalization.md +55 -0
  22. chattice-0.14.0b1/docs/adr/ADR-010-rename-to-chattice.md +30 -0
  23. chattice-0.14.0b1/docs/adr/ADR-011-versioning-policy.md +30 -0
  24. chattice-0.14.0b1/docs/adr/index.md +21 -0
  25. chattice-0.14.0b1/docs/adr/template.md +26 -0
  26. chattice-0.14.0b1/docs/agents/anti-patterns.md +20 -0
  27. chattice-0.14.0b1/docs/agents/api-map.md +30 -0
  28. chattice-0.14.0b1/docs/agents/canonical-patterns.md +90 -0
  29. chattice-0.14.0b1/docs/agents/capabilities.md +25 -0
  30. chattice-0.14.0b1/docs/agents/commands.md +25 -0
  31. chattice-0.14.0b1/docs/agents/context.md +24 -0
  32. chattice-0.14.0b1/docs/agents/google-semantics.md +24 -0
  33. chattice-0.14.0b1/docs/agents/identifiers.md +14 -0
  34. chattice-0.14.0b1/docs/agents/migration-from-aiogram.md +22 -0
  35. chattice-0.14.0b1/docs/agents/testing.md +35 -0
  36. chattice-0.14.0b1/docs/agents/versioning.md +13 -0
  37. chattice-0.14.0b1/docs/aiogram-comparison.md +112 -0
  38. chattice-0.14.0b1/docs/api.md +68 -0
  39. chattice-0.14.0b1/docs/architecture/ai-boundary.md +79 -0
  40. chattice-0.14.0b1/docs/architecture/authentication.md +109 -0
  41. chattice-0.14.0b1/docs/architecture/bot-api-client.md +92 -0
  42. chattice-0.14.0b1/docs/architecture/capabilities.md +159 -0
  43. chattice-0.14.0b1/docs/architecture/cards.md +104 -0
  44. chattice-0.14.0b1/docs/architecture/dependency-injection.md +44 -0
  45. chattice-0.14.0b1/docs/architecture/dialogs-app-home.md +179 -0
  46. chattice-0.14.0b1/docs/architecture/dispatcher-router.md +77 -0
  47. chattice-0.14.0b1/docs/architecture/event-model.md +103 -0
  48. chattice-0.14.0b1/docs/architecture/final-audit.md +130 -0
  49. chattice-0.14.0b1/docs/architecture/forms-vs-fsm-vs-scenes.md +124 -0
  50. chattice-0.14.0b1/docs/architecture/fsm.md +191 -0
  51. chattice-0.14.0b1/docs/architecture/google-interaction-adapter.md +124 -0
  52. chattice-0.14.0b1/docs/architecture/http-transport.md +50 -0
  53. chattice-0.14.0b1/docs/architecture/middleware.md +63 -0
  54. chattice-0.14.0b1/docs/architecture/observability.md +143 -0
  55. chattice-0.14.0b1/docs/architecture/overview.md +94 -0
  56. chattice-0.14.0b1/docs/architecture/post-phase-12-charter.md +223 -0
  57. chattice-0.14.0b1/docs/architecture/pubsub.md +85 -0
  58. chattice-0.14.0b1/docs/architecture/reliability.md +191 -0
  59. chattice-0.14.0b1/docs/architecture/security.md +165 -0
  60. chattice-0.14.0b1/docs/architecture/testing.md +145 -0
  61. chattice-0.14.0b1/docs/architecture/transports.md +71 -0
  62. chattice-0.14.0b1/docs/architecture/workspace-events.md +134 -0
  63. chattice-0.14.0b1/docs/common-mistakes.md +57 -0
  64. chattice-0.14.0b1/docs/concepts/mental-model.md +87 -0
  65. chattice-0.14.0b1/docs/cookbook/recipes.md +70 -0
  66. chattice-0.14.0b1/docs/examples.md +35 -0
  67. chattice-0.14.0b1/docs/getting-started/authentication.md +65 -0
  68. chattice-0.14.0b1/docs/getting-started/first-deployment.md +37 -0
  69. chattice-0.14.0b1/docs/getting-started/google-chat-setup.md +57 -0
  70. chattice-0.14.0b1/docs/getting-started/installation.md +44 -0
  71. chattice-0.14.0b1/docs/getting-started/project-structure.md +27 -0
  72. chattice-0.14.0b1/docs/getting-started/quickstart.md +86 -0
  73. chattice-0.14.0b1/docs/guides/advanced-apis.md +53 -0
  74. chattice-0.14.0b1/docs/guides/auth-capabilities.md +70 -0
  75. chattice-0.14.0b1/docs/guides/cards-forms-dialogs.md +131 -0
  76. chattice-0.14.0b1/docs/guides/commands.md +72 -0
  77. chattice-0.14.0b1/docs/guides/deployment.md +76 -0
  78. chattice-0.14.0b1/docs/guides/enterprise.md +83 -0
  79. chattice-0.14.0b1/docs/guides/messages.md +103 -0
  80. chattice-0.14.0b1/docs/guides/routing-state.md +78 -0
  81. chattice-0.14.0b1/docs/guides/transports.md +39 -0
  82. chattice-0.14.0b1/docs/guides/workspace-events.md +77 -0
  83. chattice-0.14.0b1/docs/index.md +59 -0
  84. chattice-0.14.0b1/docs/llms.txt +52 -0
  85. chattice-0.14.0b1/docs/policies.md +34 -0
  86. chattice-0.14.0b1/docs/public-api.md +377 -0
  87. chattice-0.14.0b1/docs/reference/compatibility.md +29 -0
  88. chattice-0.14.0b1/docs/reference/google-api-mapping.md +30 -0
  89. chattice-0.14.0b1/docs/release/sbom-chattice.spdx.json +1322 -0
  90. chattice-0.14.0b1/docs/stability.md +54 -0
  91. chattice-0.14.0b1/docs/troubleshooting.md +116 -0
  92. chattice-0.14.0b1/examples/README.md +34 -0
  93. chattice-0.14.0b1/examples/__init__.py +1 -0
  94. chattice-0.14.0b1/examples/bots/__init__.py +11 -0
  95. chattice-0.14.0b1/examples/bots/buttons_bot.py +87 -0
  96. chattice-0.14.0b1/examples/bots/command_bot.py +74 -0
  97. chattice-0.14.0b1/examples/bots/dialog_bot.py +78 -0
  98. chattice-0.14.0b1/examples/bots/echo_bot.py +38 -0
  99. chattice-0.14.0b1/examples/bots/fastapi_bot.py +48 -0
  100. chattice-0.14.0b1/examples/bots/form_bot.py +78 -0
  101. chattice-0.14.0b1/examples/bots/fsm_bot.py +85 -0
  102. chattice-0.14.0b1/examples/bots/pubsub_bot.py +60 -0
  103. chattice-0.14.0b1/examples/bots/workspace_events_bot.py +50 -0
  104. chattice-0.14.0b1/examples/docs/__init__.py +1 -0
  105. chattice-0.14.0b1/examples/docs/from_zero.py +310 -0
  106. chattice-0.14.0b1/examples/docs/quickstart_app.py +29 -0
  107. chattice-0.14.0b1/examples/live_http.py +95 -0
  108. chattice-0.14.0b1/examples/live_outbound.py +112 -0
  109. chattice-0.14.0b1/examples/live_pubsub.py +64 -0
  110. chattice-0.14.0b1/examples/phase1.py +37 -0
  111. chattice-0.14.0b1/examples/phase10.py +157 -0
  112. chattice-0.14.0b1/examples/phase11.py +90 -0
  113. chattice-0.14.0b1/examples/phase2.py +65 -0
  114. chattice-0.14.0b1/examples/phase3.py +29 -0
  115. chattice-0.14.0b1/examples/phase4.py +120 -0
  116. chattice-0.14.0b1/examples/phase5.py +81 -0
  117. chattice-0.14.0b1/examples/phase6.py +175 -0
  118. chattice-0.14.0b1/examples/phase7.py +88 -0
  119. chattice-0.14.0b1/examples/phase8.py +123 -0
  120. chattice-0.14.0b1/examples/phase9.py +102 -0
  121. chattice-0.14.0b1/examples/production/crm_workflow/__init__.py +1 -0
  122. chattice-0.14.0b1/examples/production/crm_workflow/main.py +252 -0
  123. chattice-0.14.0b1/examples/production/multi_space_notification.py +75 -0
  124. chattice-0.14.0b1/examples/scenarios/__init__.py +5 -0
  125. chattice-0.14.0b1/examples/scenarios/apphome_dashboard.py +66 -0
  126. chattice-0.14.0b1/examples/scenarios/buttons_menu.py +96 -0
  127. chattice-0.14.0b1/examples/scenarios/dynamic_employee_picker.py +51 -0
  128. chattice-0.14.0b1/examples/scenarios/link_preview.py +58 -0
  129. chattice-0.14.0b1/examples/scenarios/private_dialog_to_public_card.py +107 -0
  130. chattice-0.14.0b1/examples/scenarios/registration_dialog.py +112 -0
  131. chattice-0.14.0b1/examples/scenarios/registration_fsm.py +116 -0
  132. chattice-0.14.0b1/examples/scenarios/request_form.py +103 -0
  133. chattice-0.14.0b1/examples/scenarios/request_form_plus_fsm.py +161 -0
  134. chattice-0.14.0b1/examples/scenarios/text_triggers.py +64 -0
  135. chattice-0.14.0b1/examples/smoke_http.py +247 -0
  136. chattice-0.14.0b1/examples/stage_a_app.py +881 -0
  137. chattice-0.14.0b1/llms.txt +52 -0
  138. chattice-0.14.0b1/mkdocs.yml +69 -0
  139. chattice-0.14.0b1/pyproject.toml +125 -0
  140. chattice-0.14.0b1/scripts/gen_llms_txt.py +64 -0
  141. chattice-0.14.0b1/scripts/gen_sbom.py +85 -0
  142. chattice-0.14.0b1/scripts/serve_smoke.sh +36 -0
  143. chattice-0.14.0b1/scripts/verify_package.sh +71 -0
  144. chattice-0.14.0b1/src/chattice/__init__.py +8 -0
  145. chattice-0.14.0b1/src/chattice/_json_snapshot.py +35 -0
  146. chattice-0.14.0b1/src/chattice/actions.py +215 -0
  147. chattice-0.14.0b1/src/chattice/adapters/__init__.py +1 -0
  148. chattice-0.14.0b1/src/chattice/adapters/google_chat/__init__.py +19 -0
  149. chattice-0.14.0b1/src/chattice/adapters/google_chat/envelope.py +80 -0
  150. chattice-0.14.0b1/src/chattice/adapters/google_chat/exceptions.py +25 -0
  151. chattice-0.14.0b1/src/chattice/adapters/google_chat/inputs.py +107 -0
  152. chattice-0.14.0b1/src/chattice/adapters/google_chat/interaction.py +20 -0
  153. chattice-0.14.0b1/src/chattice/adapters/google_chat/models.py +97 -0
  154. chattice-0.14.0b1/src/chattice/adapters/google_chat/parser.py +361 -0
  155. chattice-0.14.0b1/src/chattice/auth/__init__.py +17 -0
  156. chattice-0.14.0b1/src/chattice/auth/providers.py +133 -0
  157. chattice-0.14.0b1/src/chattice/capabilities/__init__.py +25 -0
  158. chattice-0.14.0b1/src/chattice/capabilities/matrix.py +353 -0
  159. chattice-0.14.0b1/src/chattice/cards/__init__.py +44 -0
  160. chattice-0.14.0b1/src/chattice/cards/accessory.py +40 -0
  161. chattice-0.14.0b1/src/chattice/cards/actions.py +67 -0
  162. chattice-0.14.0b1/src/chattice/cards/card.py +367 -0
  163. chattice-0.14.0b1/src/chattice/cards/dialog.py +54 -0
  164. chattice-0.14.0b1/src/chattice/cards/raw.py +55 -0
  165. chattice-0.14.0b1/src/chattice/cards/serialization.py +26 -0
  166. chattice-0.14.0b1/src/chattice/cards/status.py +42 -0
  167. chattice-0.14.0b1/src/chattice/cards/validation.py +48 -0
  168. chattice-0.14.0b1/src/chattice/cards/widgets.py +251 -0
  169. chattice-0.14.0b1/src/chattice/client/__init__.py +28 -0
  170. chattice-0.14.0b1/src/chattice/client/bot.py +581 -0
  171. chattice-0.14.0b1/src/chattice/client/credentials.py +8 -0
  172. chattice-0.14.0b1/src/chattice/client/errors.py +119 -0
  173. chattice-0.14.0b1/src/chattice/dispatcher/__init__.py +8 -0
  174. chattice-0.14.0b1/src/chattice/dispatcher/dependency.py +189 -0
  175. chattice-0.14.0b1/src/chattice/dispatcher/dispatcher.py +290 -0
  176. chattice-0.14.0b1/src/chattice/dispatcher/handler.py +28 -0
  177. chattice-0.14.0b1/src/chattice/dispatcher/lifespan.py +87 -0
  178. chattice-0.14.0b1/src/chattice/dispatcher/middleware.py +57 -0
  179. chattice-0.14.0b1/src/chattice/dispatcher/observer.py +73 -0
  180. chattice-0.14.0b1/src/chattice/dispatcher/router.py +92 -0
  181. chattice-0.14.0b1/src/chattice/events/__init__.py +52 -0
  182. chattice-0.14.0b1/src/chattice/events/action.py +48 -0
  183. chattice-0.14.0b1/src/chattice/events/app_home.py +33 -0
  184. chattice-0.14.0b1/src/chattice/events/base.py +24 -0
  185. chattice-0.14.0b1/src/chattice/events/command.py +65 -0
  186. chattice-0.14.0b1/src/chattice/events/common.py +33 -0
  187. chattice-0.14.0b1/src/chattice/events/error.py +16 -0
  188. chattice-0.14.0b1/src/chattice/events/form.py +82 -0
  189. chattice-0.14.0b1/src/chattice/events/message.py +155 -0
  190. chattice-0.14.0b1/src/chattice/events/references.py +197 -0
  191. chattice-0.14.0b1/src/chattice/events/space.py +24 -0
  192. chattice-0.14.0b1/src/chattice/events/unknown.py +15 -0
  193. chattice-0.14.0b1/src/chattice/events/widget.py +26 -0
  194. chattice-0.14.0b1/src/chattice/exceptions/__init__.py +57 -0
  195. chattice-0.14.0b1/src/chattice/experimental/__init__.py +5 -0
  196. chattice-0.14.0b1/src/chattice/experimental/ai/__init__.py +35 -0
  197. chattice-0.14.0b1/src/chattice/experimental/ai/google.py +248 -0
  198. chattice-0.14.0b1/src/chattice/experimental/ai/models.py +168 -0
  199. chattice-0.14.0b1/src/chattice/filters/__init__.py +14 -0
  200. chattice-0.14.0b1/src/chattice/filters/base.py +65 -0
  201. chattice-0.14.0b1/src/chattice/filters/magic.py +196 -0
  202. chattice-0.14.0b1/src/chattice/forms.py +153 -0
  203. chattice-0.14.0b1/src/chattice/fsm/__init__.py +50 -0
  204. chattice-0.14.0b1/src/chattice/fsm/context.py +55 -0
  205. chattice-0.14.0b1/src/chattice/fsm/filter.py +39 -0
  206. chattice-0.14.0b1/src/chattice/fsm/record.py +399 -0
  207. chattice-0.14.0b1/src/chattice/fsm/redis.py +128 -0
  208. chattice-0.14.0b1/src/chattice/fsm/states.py +60 -0
  209. chattice-0.14.0b1/src/chattice/fsm/storage.py +132 -0
  210. chattice-0.14.0b1/src/chattice/idempotency.py +312 -0
  211. chattice-0.14.0b1/src/chattice/integrations/__init__.py +1 -0
  212. chattice-0.14.0b1/src/chattice/integrations/fastapi/__init__.py +13 -0
  213. chattice-0.14.0b1/src/chattice/integrations/fastapi/router.py +567 -0
  214. chattice-0.14.0b1/src/chattice/middleware.py +40 -0
  215. chattice-0.14.0b1/src/chattice/observability.py +25 -0
  216. chattice-0.14.0b1/src/chattice/py.typed +1 -0
  217. chattice-0.14.0b1/src/chattice/testing/__init__.py +16 -0
  218. chattice-0.14.0b1/src/chattice/testing/assertions.py +46 -0
  219. chattice-0.14.0b1/src/chattice/testing/event_factory.py +203 -0
  220. chattice-0.14.0b1/src/chattice/testing/fake_transport.py +168 -0
  221. chattice-0.14.0b1/src/chattice/testing/fsm.py +13 -0
  222. chattice-0.14.0b1/src/chattice/testing/mock_bot.py +132 -0
  223. chattice-0.14.0b1/src/chattice/transports/__init__.py +1 -0
  224. chattice-0.14.0b1/src/chattice/transports/http/__init__.py +29 -0
  225. chattice-0.14.0b1/src/chattice/transports/http/adapter.py +51 -0
  226. chattice-0.14.0b1/src/chattice/transports/http/errors.py +18 -0
  227. chattice-0.14.0b1/src/chattice/transports/http/request.py +46 -0
  228. chattice-0.14.0b1/src/chattice/transports/http/response.py +83 -0
  229. chattice-0.14.0b1/src/chattice/transports/http/verifier.py +154 -0
  230. chattice-0.14.0b1/src/chattice/transports/pubsub.py +159 -0
  231. chattice-0.14.0b1/src/chattice/transports/pubsub_runner.py +479 -0
  232. chattice-0.14.0b1/src/chattice/workspace_events/__init__.py +20 -0
  233. chattice-0.14.0b1/src/chattice/workspace_events/envelope.py +35 -0
  234. chattice-0.14.0b1/src/chattice/workspace_events/parser.py +227 -0
  235. chattice-0.14.0b1/src/chattice/workspace_events/runtime.py +340 -0
  236. chattice-0.14.0b1/tests/__init__.py +0 -0
  237. chattice-0.14.0b1/tests/auth/__init__.py +0 -0
  238. chattice-0.14.0b1/tests/auth/test_bot_auth.py +161 -0
  239. chattice-0.14.0b1/tests/auth/test_experimental_namespace.py +30 -0
  240. chattice-0.14.0b1/tests/auth/test_providers.py +72 -0
  241. chattice-0.14.0b1/tests/capabilities/__init__.py +0 -0
  242. chattice-0.14.0b1/tests/capabilities/test_gate.py +52 -0
  243. chattice-0.14.0b1/tests/capabilities/test_matrix.py +133 -0
  244. chattice-0.14.0b1/tests/capabilities/test_scope_hardening.py +155 -0
  245. chattice-0.14.0b1/tests/cards/__init__.py +0 -0
  246. chattice-0.14.0b1/tests/cards/test_actions.py +30 -0
  247. chattice-0.14.0b1/tests/cards/test_card.py +126 -0
  248. chattice-0.14.0b1/tests/cards/test_dialog.py +26 -0
  249. chattice-0.14.0b1/tests/cards/test_dialog_observers.py +90 -0
  250. chattice-0.14.0b1/tests/cards/test_form_roundtrip.py +65 -0
  251. chattice-0.14.0b1/tests/cards/test_form_widgets.py +68 -0
  252. chattice-0.14.0b1/tests/cards/test_gate.py +76 -0
  253. chattice-0.14.0b1/tests/cards/test_gate_apphome.py +66 -0
  254. chattice-0.14.0b1/tests/cards/test_gate_dialog.py +105 -0
  255. chattice-0.14.0b1/tests/cards/test_roundtrip.py +91 -0
  256. chattice-0.14.0b1/tests/cards/test_serialization.py +34 -0
  257. chattice-0.14.0b1/tests/cards/test_snapshots.py +56 -0
  258. chattice-0.14.0b1/tests/cards/test_status.py +27 -0
  259. chattice-0.14.0b1/tests/cards/test_validation.py +22 -0
  260. chattice-0.14.0b1/tests/cards/test_widgets.py +112 -0
  261. chattice-0.14.0b1/tests/client/__init__.py +0 -0
  262. chattice-0.14.0b1/tests/client/_fake_transport.py +5 -0
  263. chattice-0.14.0b1/tests/client/test_bot_close.py +121 -0
  264. chattice-0.14.0b1/tests/client/test_bot_crud.py +99 -0
  265. chattice-0.14.0b1/tests/client/test_bot_errors.py +67 -0
  266. chattice-0.14.0b1/tests/client/test_bot_lazy.py +57 -0
  267. chattice-0.14.0b1/tests/client/test_bot_lifecycle.py +158 -0
  268. chattice-0.14.0b1/tests/client/test_bot_privacy.py +167 -0
  269. chattice-0.14.0b1/tests/client/test_bot_send.py +123 -0
  270. chattice-0.14.0b1/tests/client/test_credentials.py +18 -0
  271. chattice-0.14.0b1/tests/client/test_errors.py +85 -0
  272. chattice-0.14.0b1/tests/client/test_fake_transport.py +49 -0
  273. chattice-0.14.0b1/tests/client/test_integration.py +74 -0
  274. chattice-0.14.0b1/tests/client/test_resource_names_f13.py +50 -0
  275. chattice-0.14.0b1/tests/fixtures/google_chat/conformance/README.md +23 -0
  276. chattice-0.14.0b1/tests/fixtures/google_chat/conformance/dm_card_click.json +29 -0
  277. chattice-0.14.0b1/tests/fixtures/google_chat/conformance/private_card_button.json +30 -0
  278. chattice-0.14.0b1/tests/fixtures/google_chat/conformance/private_card_form.json +37 -0
  279. chattice-0.14.0b1/tests/fixtures/google_chat/conformance/private_command.json +21 -0
  280. chattice-0.14.0b1/tests/fixtures/google_chat/conformance/shared_thread_card_click_alice.json +30 -0
  281. chattice-0.14.0b1/tests/fixtures/google_chat/conformance/shared_thread_card_click_bob.json +30 -0
  282. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/README.md +44 -0
  283. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/added_to_space.json +5 -0
  284. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/app_command.json +8 -0
  285. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/app_home.json +7 -0
  286. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/app_home_card_clicked.json +10 -0
  287. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/card_clicked.json +16 -0
  288. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/card_clicked_cancel_dialog.json +6 -0
  289. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/card_clicked_form.json +14 -0
  290. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/card_clicked_human_message.json +37 -0
  291. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/card_clicked_request_dialog.json +6 -0
  292. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/card_clicked_submit_dialog.json +9 -0
  293. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/malformed_conflict.json +1 -0
  294. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/malformed_missing_type.json +1 -0
  295. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/malformed_timestamp.json +1 -0
  296. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/malformed_type.json +1 -0
  297. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/message.json +12 -0
  298. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/message_action.json +15 -0
  299. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/message_matched_url.json +21 -0
  300. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/removed_from_space.json +5 -0
  301. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/slash_command.json +22 -0
  302. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/submit_form.json +12 -0
  303. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/unknown_event.json +5 -0
  304. chattice-0.14.0b1/tests/fixtures/google_chat/interactions/widget_updated.json +8 -0
  305. chattice-0.14.0b1/tests/fsm/__init__.py +0 -0
  306. chattice-0.14.0b1/tests/fsm/test_context.py +52 -0
  307. chattice-0.14.0b1/tests/fsm/test_dispatcher_integration.py +84 -0
  308. chattice-0.14.0b1/tests/fsm/test_filter.py +54 -0
  309. chattice-0.14.0b1/tests/fsm/test_gate.py +91 -0
  310. chattice-0.14.0b1/tests/fsm/test_memory_storage.py +58 -0
  311. chattice-0.14.0b1/tests/fsm/test_record.py +256 -0
  312. chattice-0.14.0b1/tests/fsm/test_redis_storage.py +80 -0
  313. chattice-0.14.0b1/tests/fsm/test_states.py +36 -0
  314. chattice-0.14.0b1/tests/fsm/test_storage_key.py +63 -0
  315. chattice-0.14.0b1/tests/integration/__init__.py +0 -0
  316. chattice-0.14.0b1/tests/integration/live/README.md +79 -0
  317. chattice-0.14.0b1/tests/integration/live/__init__.py +0 -0
  318. chattice-0.14.0b1/tests/integration/live/test_smoke.py +165 -0
  319. chattice-0.14.0b1/tests/integration/test_personal_shared_conformance.py +466 -0
  320. chattice-0.14.0b1/tests/reliability/__init__.py +0 -0
  321. chattice-0.14.0b1/tests/reliability/test_gate.py +206 -0
  322. chattice-0.14.0b1/tests/reliability/test_idempotency.py +134 -0
  323. chattice-0.14.0b1/tests/reliability/test_observability.py +79 -0
  324. chattice-0.14.0b1/tests/reliability/test_redaction.py +176 -0
  325. chattice-0.14.0b1/tests/reliability/test_redis_lifecycle_f09.py +119 -0
  326. chattice-0.14.0b1/tests/reliability/test_timeout_cancellation.py +64 -0
  327. chattice-0.14.0b1/tests/test_accessory_widgets.py +110 -0
  328. chattice-0.14.0b1/tests/test_actions.py +198 -0
  329. chattice-0.14.0b1/tests/test_ai.py +296 -0
  330. chattice-0.14.0b1/tests/test_ai_gemini_hardening.py +170 -0
  331. chattice-0.14.0b1/tests/test_apphome_integration.py +118 -0
  332. chattice-0.14.0b1/tests/test_architecture.py +236 -0
  333. chattice-0.14.0b1/tests/test_cards_integration.py +241 -0
  334. chattice-0.14.0b1/tests/test_codec_form_card_f11.py +154 -0
  335. chattice-0.14.0b1/tests/test_command_routing.py +122 -0
  336. chattice-0.14.0b1/tests/test_dependency.py +135 -0
  337. chattice-0.14.0b1/tests/test_dialog_envelope_truth_table.py +223 -0
  338. chattice-0.14.0b1/tests/test_dialog_integration.py +158 -0
  339. chattice-0.14.0b1/tests/test_dispatcher.py +192 -0
  340. chattice-0.14.0b1/tests/test_documentation_examples.py +45 -0
  341. chattice-0.14.0b1/tests/test_dx_enrichment.py +249 -0
  342. chattice-0.14.0b1/tests/test_events.py +55 -0
  343. chattice-0.14.0b1/tests/test_examples.py +673 -0
  344. chattice-0.14.0b1/tests/test_fastapi_integration.py +282 -0
  345. chattice-0.14.0b1/tests/test_filters.py +145 -0
  346. chattice-0.14.0b1/tests/test_forms.py +127 -0
  347. chattice-0.14.0b1/tests/test_gap_hardening.py +137 -0
  348. chattice-0.14.0b1/tests/test_google_interactions.py +420 -0
  349. chattice-0.14.0b1/tests/test_immutable_facades_f10.py +82 -0
  350. chattice-0.14.0b1/tests/test_lifespan.py +77 -0
  351. chattice-0.14.0b1/tests/test_log_redaction.py +140 -0
  352. chattice-0.14.0b1/tests/test_middleware.py +176 -0
  353. chattice-0.14.0b1/tests/test_persistent_actions.py +104 -0
  354. chattice-0.14.0b1/tests/test_pubsub_workspace_integration.py +423 -0
  355. chattice-0.14.0b1/tests/test_raw_and_validation.py +140 -0
  356. chattice-0.14.0b1/tests/test_router.py +198 -0
  357. chattice-0.14.0b1/tests/testing/__init__.py +0 -0
  358. chattice-0.14.0b1/tests/testing/test_assertions_fsm.py +56 -0
  359. chattice-0.14.0b1/tests/testing/test_event_factory.py +70 -0
  360. chattice-0.14.0b1/tests/testing/test_gate.py +23 -0
  361. chattice-0.14.0b1/tests/testing/test_mock_bot.py +74 -0
  362. chattice-0.14.0b1/tests/transports/__init__.py +0 -0
  363. chattice-0.14.0b1/tests/transports/http/__init__.py +0 -0
  364. chattice-0.14.0b1/tests/transports/http/_test_tokens.py +91 -0
  365. chattice-0.14.0b1/tests/transports/http/test_adapter.py +58 -0
  366. chattice-0.14.0b1/tests/transports/http/test_errors.py +22 -0
  367. chattice-0.14.0b1/tests/transports/http/test_pubsub.py +68 -0
  368. chattice-0.14.0b1/tests/transports/http/test_request.py +46 -0
  369. chattice-0.14.0b1/tests/transports/http/test_response.py +38 -0
  370. chattice-0.14.0b1/tests/transports/http/test_verifier.py +325 -0
  371. chattice-0.14.0b1/tests/transports/test_pubsub_runner.py +486 -0
  372. chattice-0.14.0b1/tests/transports/test_pubsub_verifier.py +97 -0
  373. chattice-0.14.0b1/tests/workspace_events/__init__.py +0 -0
  374. chattice-0.14.0b1/tests/workspace_events/test_gate.py +86 -0
  375. chattice-0.14.0b1/tests/workspace_events/test_observer.py +71 -0
  376. chattice-0.14.0b1/tests/workspace_events/test_parser.py +346 -0
  377. chattice-0.14.0b1/uv.lock +2043 -0
@@ -0,0 +1,17 @@
1
+ .venv/
2
+ .coverage
3
+ .mypy_cache/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ __pycache__/
7
+ *.py[cod]
8
+ build/
9
+ dist/
10
+ site/
11
+ *.egg-info/
12
+ .DS_Store
13
+
14
+ .coverage*
15
+
16
+ # Local development credentials (dogfood service-account keys)
17
+ .secrets/
@@ -0,0 +1,2 @@
1
+ 3.11
2
+
@@ -0,0 +1,122 @@
1
+ # Repository instructions
2
+
3
+ ## Source of truth
4
+
5
+ - The current stable official Google Chat API documentation, v1 schema, and
6
+ official `google-apps-chat` client are the source of truth for Google
7
+ behavior. Samples clarify documented behavior but do not override the API.
8
+ - Never invent an event type, field, method, scope, capability, deadline, or
9
+ authentication mode. Link an official source in research or architecture
10
+ documentation before implementing it.
11
+ - Keep stable behavior separate from Preview or Developer Preview behavior.
12
+ Experimental support must live behind an explicitly experimental namespace
13
+ or capability.
14
+ - aiogram and the archived Google Node toolkit are architecture references,
15
+ not Google Chat specifications. Do not copy their source into this project.
16
+
17
+ ## Architecture rules
18
+
19
+ - Maintain the boundary: transport -> parser/adapter -> domain event ->
20
+ dispatcher/router -> handler -> interaction context or Bot API client.
21
+ - Raw transport envelopes and framework domain events are different types.
22
+ Preserve raw Google data through `.raw`, but do not require handlers to parse
23
+ raw dictionaries.
24
+ - Core routing must not depend on FastAPI, Starlette, Google credentials,
25
+ networking, Cards, or FSM. Web integrations adapt ASGI requests to the core.
26
+ - Transport code must not contain business routing. Routers must not know about
27
+ FastAPI. FSM must not depend on the Google SDK. Cards must not depend on the
28
+ dispatcher.
29
+ - Synchronous interaction responses and authenticated Chat API calls are
30
+ distinct operations. Never hide a second network call behind an already-used
31
+ interaction response.
32
+ - Use a capabilities value object for transport/auth feature differences; do
33
+ not scatter string comparisons such as `transport == "pubsub"`.
34
+ - Keep mutable state instance-scoped. Async handlers and concurrent event feeds
35
+ must not rely on module-global mutable state.
36
+
37
+ ## Module map
38
+
39
+ - `src/chattice/events/`: framework-owned event models.
40
+ - `src/chattice/dispatcher/`: dispatcher, routers, observers, handler plans,
41
+ middleware execution, and context DI.
42
+ - `src/chattice/adapters/google_chat/`: stable Google payload parsing and mapping.
43
+ - `src/chattice/transports/`: transport-neutral ingress contracts and concrete
44
+ HTTP/Pub/Sub adapters.
45
+ - `src/chattice/integrations/`: optional web-framework integrations.
46
+ - `src/chattice/client/`: high-level async Chat API client and raw client
47
+ escape hatch.
48
+ - `src/chattice/auth/`: incoming verification and outgoing credential
49
+ provider contracts.
50
+ - `src/chattice/cards/`, `fsm/`, `capabilities/`, and `testing/`: isolated
51
+ subsystems described in the architecture docs.
52
+ - `docs/research/`: dated, sourced facts and unknowns. `docs/architecture/`:
53
+ intended boundaries. `docs/adr/`: decisions and their status.
54
+ - `tests/fixtures/google_chat/`: only documented official payload shapes or sanitized
55
+ real payloads with provenance recorded beside the fixture.
56
+
57
+ Directories may be introduced only when their phase starts; this map is a
58
+ boundary contract, not a demand for empty modules.
59
+
60
+ ## Naming and public API
61
+
62
+ - Use Google-native terms: `space`, `thread`, `message`, `interaction`,
63
+ `action`, and `membership`. Do not use Telegram `chat_id` terminology.
64
+ - Public classes use `PascalCase`; functions, parameters, and modules use
65
+ `snake_case`; constants use `UPPER_SNAKE_CASE`.
66
+ - Internal modules or symbols begin with `_` when importability could otherwise
67
+ imply support. Export public surfaces deliberately with `__all__`.
68
+ - Keep the working distribution/import name isolated to packaging and the top
69
+ package so a later rename does not change domain terminology.
70
+
71
+ ## Compatibility and dependencies
72
+
73
+ - Python 3.11+; CI covers 3.11, 3.12, and 3.13 unless an official dependency
74
+ incompatibility is documented.
75
+ - Follow Semantic Versioning. Breaking public API changes are allowed before
76
+ 1.0 but must be documented in `CHANGELOG.md`.
77
+ - Core dependencies stay minimal. FastAPI, Redis, Pub/Sub, docs, and testing
78
+ integrations remain optional development groups or extras.
79
+ - Do not add aiogram as a runtime dependency.
80
+
81
+ ## Workflow and commands
82
+
83
+ Read the current ExecPlan before a substantial phase and update its Progress,
84
+ Decisions, and Validation sections while working.
85
+
86
+ ```bash
87
+ uv sync
88
+ uv run ruff check .
89
+ uv run ruff format --check .
90
+ uv run pytest --cov=chattice --cov-report=term-missing
91
+ uv run mypy src tests
92
+ uv run python -m compileall -q src tests examples
93
+ uv build
94
+ uv run mkdocs build --strict
95
+ ```
96
+
97
+ ## Tests and documentation
98
+
99
+ - Every bug fix includes a regression test.
100
+ - Every public API change updates the API documentation and an executable or
101
+ type-checked example.
102
+ - Parser fixtures must cite their official or sanitized-real provenance. Never
103
+ fabricate Google wire fields for a test.
104
+ - Unit and integration tests must run without Google credentials. Live tests
105
+ live under `tests/integration/live/` and use the `google_live` marker.
106
+ - Preserve exception chaining and never log tokens, credentials,
107
+ `Authorization` headers, or private form values by default.
108
+
109
+ ## Definition of done
110
+
111
+ A change is done when its documented behavior matches stable official Google
112
+ sources, boundaries remain intact, tests cover happy and relevant negative
113
+ paths, public docs and changelog are current, Ruff/format/pytest/mypy pass, the
114
+ package builds, and the active ExecPlan records validation and remaining risks.
115
+
116
+
117
+ ## Rule provenance
118
+
119
+ WHAT is written here. WHY lives in `.agent/rationale/` (one file per
120
+ non-obvious constraint); failure records live in `.agent/incidents/`.
121
+ Prefer machine enforcement (tests/lint) over new permanent rules —
122
+ if a test can catch it, write the test instead.
@@ -0,0 +1,210 @@
1
+ # Changelog
2
+
3
+ All notable changes will be documented here. The project follows Semantic
4
+ Versioning after the first public release; pre-1.0 APIs may change.
5
+
6
+ ## [0.14.0b1] — 2026-08-16 — first public beta release
7
+
8
+ (0.14.0 was the internal release candidate; the public beta ships as
9
+ 0.14.0b1 per ADR-011.)
10
+
11
+ ## [0.14.0] — 2026-08-15 — first public beta candidate
12
+
13
+ ### Added
14
+
15
+ - Core-boundary remediation: independent Workspace Events runtime, typed
16
+ command kinds and action sources, explicit preview enrollment, transport-
17
+ uniform response-capability DI, and lossless unknown Cards JSON fallback.
18
+ - The optional AI integration moved from `chattice.ai` to
19
+ `chattice.experimental.ai`; it remains in the distribution but is explicitly
20
+ outside the stable core API.
21
+ - Additive DX enrichment: zero-fetch contextual sends, direct ActionData
22
+ button binding, and immutable read-side message metadata accessors. The
23
+ imperative `Bot.send_message()` API remains fully supported and unchanged.
24
+ - Scope-aware outbound local preflight: known user/app credential scopes now
25
+ filter message capabilities through documented any-of rules without hidden
26
+ network calls; unknown scopes preserve backward-compatible behavior.
27
+ - Project rename to **Chattice** (ADR-010) and the versioning policy
28
+ (ADR-011): this is the FIRST PUBLIC BETA CANDIDATE.
29
+ - Owner-safe push idempotency state machine (claim/complete/release,
30
+ 429 on active, atomic expired-lease takeover, bounded completed
31
+ retention).
32
+ - Race-safe FSM lazy expiry (compare-and-delete) and the full FSM
33
+ record/CAS storage model.
34
+ - Class-only framework error logging — handler exception messages
35
+ (potentially secret-bearing) never reach logs; runtime redaction
36
+ regression test.
37
+ - Human documentation product (troubleshooting, enterprise and
38
+ deployment guides, mkdocstrings API reference, aiogram side-by-side,
39
+ mental models), coding-agent documentation (docs/agents, PUBLIC_API),
40
+ OSS repository hardening (CONTRIBUTING/SECURITY/CoC/templates/
41
+ policies), license & provenance audit, curated sdist policy.
42
+
43
+ ### Status
44
+
45
+ **Pre-1.0 beta / release candidate.** The documented stable beta surface is
46
+ frozen against incompatible change; additions remain possible. Experimental
47
+ and raw/advanced surfaces carry their separate contracts. Not published to
48
+ PyPI.
49
+
50
+ ## [0.13.0] — 2026-08-15 — development release
51
+
52
+ ### Added
53
+
54
+ - Phase 14 gap closure: Workspace Events official Pub/Sub binding,
55
+ slash commands / link previews / sender-aware card responses,
56
+ dedupe claim/complete/release, secure-by-default push verification,
57
+ capability-model split, off-loop verification and Bot.close(),
58
+ ActionData, AccessoryWidget, FSM records, FormModel, lifespan,
59
+ RawWidget, response validation.
60
+ - Phase 15 dogfooding scenarios + CRM workflow; post-review
61
+ reconciliation (8 blockers); selective gap audit (argument_text,
62
+ notification options, private viewer, card updates, poll recipe).
63
+
64
+ ## [0.12.0] — 2026-08-15
65
+
66
+ ### Added
67
+
68
+ - Value-first README and Getting Started; honest aiogram comparison;
69
+ public API audit.
70
+ - Named example bots (echo/command/buttons/form/dialog/fsm/fastapi/pubsub/
71
+ workspace_events), each executable and test-covered.
72
+ - Reproducible fresh-venv package verification script.
73
+
74
+ ### Status
75
+
76
+ **Pre-1.0 beta / release candidate.** The public API may still change
77
+ before 1.0.0 (semver applies to post-1.0 releases only). Not published
78
+ to PyPI.
79
+
80
+ ## [0.11.0] — 2026-08-15
81
+
82
+ ### Added
83
+
84
+ - `chattice.testing`: MockBot (call recorder with message assertions),
85
+ EventFactory (typed event builders — no raw Google JSON in unit tests),
86
+ FakeChatTransport (migrated; compat re-export), card assertions,
87
+ FSM seeding helper.
88
+ - Live integration suite skeleton (`tests/integration/live`) with an
89
+ honest skip and full setup instructions.
90
+
91
+ ## [0.10.0] — 2026-08-15
92
+
93
+ ### Added
94
+
95
+ - `chattice.idempotency`: IdempotencyStorage protocol, Memory +
96
+ Redis implementations (SET NX EX — single-command atomicity);
97
+ Pub/Sub push-router dedupe by messageId.
98
+ - `chattice.observability`: ObservabilityHooks + Dispatcher
99
+ observability_hooks (additive, failure-isolated).
100
+ - Bot: per-call `timeout` on all operations.
101
+ - Architecture docs: reliability (retry classification, verified quotas,
102
+ backoff guidance), observability (OTel bridge example), security audit
103
+ with a source-scan redaction test.
104
+
105
+ ## [0.9.0] — 2026-08-15
106
+
107
+ ### Added
108
+
109
+ - Pub/Sub push ingress: PubSubPushAdapter (documented envelope ->
110
+ interaction event), create_pubsub_router (204 ack, no sync responses);
111
+ capability rows for transport="pubsub".
112
+ - Workspace Events ingress family: WorkspaceEvent model, CloudEvent
113
+ parser, workspace_event observer, create_workspace_events_router.
114
+ - SubscriptionManager protocol skeleton (implementation deferred).
115
+
116
+ ## [0.8.0] — 2026-08-15
117
+
118
+ ### Added
119
+
120
+ - `chattice.auth`: CredentialsProvider (canonical home), lazy
121
+ ServiceAccountCredentialsProvider (file/info), UserCredentialsProvider
122
+ with lazy refresh; AuthMode; CHAT_BOT_SCOPE. Client re-exports the
123
+ protocol for Phase 4 compatibility.
124
+ - `chattice.capabilities`: Capability matrix (single source of truth,
125
+ verified Google facts), Capabilities.require() guards that fail BEFORE
126
+ network calls; capabilities injected into handler context.
127
+ - `chattice.experimental`: preview-feature namespace marker.
128
+
129
+ ## [0.7.0] — 2026-08-14
130
+
131
+ ### Added
132
+
133
+ - `chattice.fsm`: State/StatesGroup, FSMContext (name-based DI via
134
+ `data["state"]`), StorageKey + FSMStrategy on Google refs (default
135
+ USER_IN_SPACE), MemoryStorage, StateFilter, FSMError.
136
+ - Dispatcher(fsm_storage=..., fsm_strategy=...) pre-injects the FSM
137
+ context before filter evaluation (additive; unconfigured behavior
138
+ unchanged).
139
+ - `chattice[redis]` extra: RedisStorage (per-command atomicity only —
140
+ update_data is not cross-process, documented honestly).
141
+
142
+ ## [0.6.0] — 2026-08-14
143
+
144
+ ### Added
145
+
146
+ - Dialogs: Button/Action `interaction=OPEN_DIALOG`, `Dialog` facade,
147
+ `ActionStatus.ok/.invalid`; DIALOG/actionStatus sync responses;
148
+ `router.dialog_submit` / `router.dialog_cancel` observers.
149
+ - Forms: full TextInput/SelectionInput/DateTimePicker fields, `Validation`
150
+ facade (character limit + input type); Section.from_proto rebuilds form
151
+ widgets (Phase 5 debt closed).
152
+ - App Home: RenderActions pushCard (APP_HOME) and updateCard (SUBMIT_FORM)
153
+ sync responses.
154
+
155
+ ## [0.5.0] — 2026-08-14
156
+
157
+ ### Added
158
+
159
+ - `chattice.cards`: typed facade builders over the official
160
+ google-apps-card SDK — Card, CardHeader, Section, TextParagraph,
161
+ Divider, ButtonList, Button (action/parameters or open link), Action,
162
+ OpenLink, TextInput, SelectionInput, DateTimePicker; serialization to
163
+ documented Cards v2 JSON; raw proto escape hatch.
164
+ - FastAPI integration: handlers may return a Card — MESSAGE replies with
165
+ `cardsV2`; CARD_CLICKED replies with `actionResponse UPDATE_MESSAGE`
166
+ (documented bot-message card replacement).
167
+
168
+ ## [0.4.0] — 2026-08-14
169
+
170
+ ### Added
171
+
172
+ - `chattice.client`: `Bot` — async outgoing Chat API operations
173
+ (`send_message`, `get_message`, `update_message`, `delete_message`,
174
+ `get_space`) over the official `google-apps-chat` SDK with a lazy
175
+ grpc_asyncio client; `raw_client` escape hatch; `MessageReplyOption`
176
+ thread semantics; `request_id` idempotency passthrough.
177
+ - `ChatAPIError` hierarchy wrapping SDK errors with preserved code/details
178
+ and chaining; `CredentialsProvider` protocol.
179
+
180
+ ## [0.3.0] — 2026-08-14
181
+
182
+ ### Added
183
+
184
+ - `chattice.transports.http`: web-framework-neutral HTTP interaction core —
185
+ `IncomingRequest`, `InteractionResponse` with double-response guard,
186
+ `InteractionContext` with the documented 30-second sync deadline,
187
+ `HTTPInteractionAdapter`, `GoogleTokenVerifier` (google-auth based,
188
+ both documented audience strategies), `MockVerifier`.
189
+ - `chattice.integrations.fastapi`: `create_chat_router()` for FastAPI
190
+ (optional extra `chattice[fastapi]`), also usable under plain Starlette.
191
+ - Verification failures map to HTTP 401 per the official docs; malformed
192
+ payloads to 400; handler failures to 500.
193
+
194
+ ## Unreleased
195
+
196
+ - Added the pure Google Chat interaction adapter for all eight stable event
197
+ types, direct/App Home envelopes, typed common/form data, and explicit parser
198
+ exceptions.
199
+ - Added immutable actor/space/thread/message references, lifecycle, command,
200
+ widget, App Home, form-submit, and dialog metadata domain values.
201
+ - Added dedicated routing observers and provenance-recorded Google fixtures.
202
+ - Added immutable synthetic domain events.
203
+ - Added the Phase 1 dispatcher, nested routers, observers, filters, middleware,
204
+ dependency injection, routing control, and error routing.
205
+ - Added comprehensive core-engine tests, executable examples, and architecture
206
+ documentation.
207
+
208
+ ## 0.0.0 - 2026-08-13
209
+
210
+ - Added Phase 0 research, architecture, ADRs, and repository scaffold.
@@ -0,0 +1,6 @@
1
+ # Code of Conduct
2
+
3
+ Be respectful, constructive, and honest. No harassment, discrimination,
4
+ or hostile behavior. Maintainers may remove contributions or
5
+ participation that violates this. If you experience or witness a
6
+ problem, contact the maintainers privately.
@@ -0,0 +1,47 @@
1
+ # Contributing to Chattice
2
+
3
+ Chattice is an async Python framework for Google Chat apps. Contributions
4
+ that are naturally additive are the most welcome:
5
+
6
+ - new Google UI support (widgets, cards)
7
+ - Google API wrappers behind the raw escape hatch pattern
8
+ - tests, examples, docs, bug fixes
9
+
10
+ ## Workflow
11
+
12
+ 1. Open an issue describing the problem or idea (no PR-first for
13
+ architectural changes — see the RFC rule below).
14
+ 2. Branch off `main`; implement with tests.
15
+ 3. Run the full gate suite:
16
+
17
+ ```bash
18
+ uv sync --all-groups
19
+ uv run pytest -q
20
+ uv run mypy src tests
21
+ uv run ruff check . && uv run ruff format --check .
22
+ uv run mkdocs build --strict
23
+ bash scripts/verify_package.sh
24
+ ```
25
+
26
+ 4. Open a PR. The description must state: the problem, public API
27
+ impact, compatibility impact, tests/docs added, risk level, and
28
+ whether core changed.
29
+
30
+ ## Rules
31
+
32
+ - New examples must expose a `main()` executed from
33
+ `tests/test_examples.py` (docs can never drift).
34
+ - Fixtures must be official payload shapes with provenance recorded in
35
+ `tests/fixtures/google_chat/interactions/README.md`.
36
+ - Public API changes require the public-API rule (charter §7): typing,
37
+ tests, docs, deliberate export, compatibility review.
38
+ - Architectural changes (Dispatcher/Router/FSM contracts, new workflow
39
+ engines, package splits, breaking API) require a lightweight design
40
+ proposal first: Problem · Current behavior · Proposed API · Why the
41
+ current API is insufficient · Alternatives · Compatibility ·
42
+ Migration · Maintenance cost · Simpler solutions rejected.
43
+
44
+ ## License
45
+
46
+ MIT. By contributing you agree your contributions are licensed
47
+ under it. No CLA required.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Chattice contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,170 @@
1
+ Metadata-Version: 2.5
2
+ Name: chattice
3
+ Version: 0.14.0b1
4
+ Summary: Async typed event framework for Google Chat apps
5
+ Author: chattice contributors
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Framework :: AsyncIO
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Typing :: Typed
16
+ Requires-Python: >=3.11
17
+ Requires-Dist: google-apps-chat<1.0.0,>=0.10.4
18
+ Requires-Dist: google-auth<3,>=2.30
19
+ Requires-Dist: pydantic<3.0,>=2.10
20
+ Provides-Extra: fastapi
21
+ Requires-Dist: fastapi<1,>=0.115; extra == 'fastapi'
22
+ Provides-Extra: gemini
23
+ Requires-Dist: google-genai<3,>=1; extra == 'gemini'
24
+ Provides-Extra: pubsub
25
+ Requires-Dist: google-cloud-pubsub<3,>=2.21; extra == 'pubsub'
26
+ Provides-Extra: redis
27
+ Requires-Dist: redis<7,>=5; extra == 'redis'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # Chattice
31
+
32
+ Async, typed event framework for Google Chat apps — aiogram-quality DX, Google-native semantics.
33
+
34
+ [![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue)](https://pypi.org/project/chattice/)
35
+ [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
36
+ [![Status](https://img.shields.io/badge/status-public%20beta-orange)](#status)
37
+
38
+ ```python
39
+ from chattice import Dispatcher, F, Router
40
+ from chattice.events import MessageEvent
41
+
42
+ router = Router()
43
+
44
+
45
+ @router.message(F.text == "ping")
46
+ async def ping(message: MessageEvent) -> str:
47
+ return "pong" # synchronous interaction response (no auth, 30 s deadline)
48
+
49
+
50
+ dispatcher = Dispatcher()
51
+ dispatcher.include_router(router)
52
+ ```
53
+
54
+ ## What this is
55
+
56
+ - **Google Chat-native.** Space, Thread, Message, Command, Action, Card,
57
+ Dialog, App Home, Workspace Events are first-class typed objects. No
58
+ Telegram concepts leak into the domain model.
59
+ - **aiogram ergonomics.** Routers, magic filters (`F`), middleware,
60
+ dependency injection, FSM — the DX you know, without Telegram
61
+ semantics.
62
+ - **Explicit response model.** A handler RETURN is the synchronous
63
+ interaction response (30 s deadline); outbound `Bot` calls are
64
+ separate authenticated operations. Contextual `message.reply()` /
65
+ `thread.send()` / `space.send()` methods are zero-fetch adapters over
66
+ that same Bot, never a hidden second channel.
67
+ - **Secure by default.** Incoming verification is fail-closed, push
68
+ endpoints require a verifier, outbound privacy gates (private
69
+ messages, notifications, preview features) fail closed before any
70
+ network call.
71
+ - **Core is small.** Core abstracts Google Chat platform primitives and
72
+ technical boilerplate ONLY. Business scenarios (polls, approvals,
73
+ tickets) are assembled from the primitives in your
74
+ application code — never added to core (doctrine §16).
75
+
76
+ ## What this is not
77
+
78
+ - **Not a Telegram framework.** No `chat_id`, no `CallbackQuery`, no
79
+ `Update` hierarchy, no Telegram-style long polling (see the
80
+ [aiogram comparison](docs/aiogram-comparison.md)).
81
+ - **Not a Google product.** Independent open-source project, not
82
+ endorsed by Google.
83
+
84
+ ## Capabilities
85
+
86
+ | Area | Support |
87
+ | --- | --- |
88
+ | Events | MESSAGE, CARD_CLICKED, APP_COMMAND (slash/quick/message actions), ADDED/REMOVED_FROM_SPACE, APP_HOME, SUBMIT_FORM, WIDGET_UPDATED |
89
+ | Routing | Routers, observers, magic filters, middleware, DI |
90
+ | Cards | Typed facades (buttons, forms, validation), sync updates (UPDATE_MESSAGE / UPDATE_USER_MESSAGE_CARDS, sender-derived) |
91
+ | Dialogs | OPEN_DIALOG, submit/cancel observers, action status; capability-gated per transport |
92
+ | FSM | State/StatesGroup, Memory + Redis record storage (compare-and-set) |
93
+ | Ingress | HTTP (verified), Pub/Sub push (verified), Pub/Sub streaming pull, Workspace Events CloudEvents |
94
+ | Auth | App (service account), user (OAuth refresh), incoming verification |
95
+ | Testing | MockBot, EventFactory, assertions, fake transport |
96
+
97
+ ## Install
98
+
99
+ Python 3.11+ (3.11–3.13 tested). MIT-licensed.
100
+
101
+ ```bash
102
+ uv add chattice # core
103
+ uv add "chattice[fastapi]" # FastAPI integration
104
+ uv add "chattice[redis]" # Redis FSM/idempotency storage
105
+ uv add "chattice[pubsub]" # Pub/Sub push + streaming pull
106
+ ```
107
+
108
+ ## Quickstart
109
+
110
+ 1. Parse a documented interaction payload:
111
+
112
+ ```python
113
+ from chattice.adapters.google_chat import parse_interaction
114
+
115
+ event = parse_interaction(payload)
116
+ result = await dispatcher.feed_update(event)
117
+ ```
118
+
119
+ 2. Serve HTTP interactions (FastAPI):
120
+
121
+ ```python
122
+ from fastapi import FastAPI
123
+ from chattice.integrations.fastapi import create_chat_router
124
+ from chattice.transports.http import GoogleTokenVerifier
125
+
126
+ app = FastAPI()
127
+ app.include_router(create_chat_router(dispatcher, GoogleTokenVerifier(audience="...")))
128
+ ```
129
+
130
+ 3. Send messages:
131
+
132
+ ```python
133
+ from chattice.client import Bot
134
+
135
+ bot = Bot(credentials=...)
136
+ await bot.send_message("spaces/AAA", text="hello")
137
+ ```
138
+
139
+ Inside an interaction handler, configure the same Bot once and use the known
140
+ Google context without extra fetches:
141
+
142
+ ```python
143
+ dispatcher = Dispatcher(bot=bot)
144
+
145
+
146
+ @router.message()
147
+ async def reply(message: MessageEvent) -> None:
148
+ await message.reply("hello in this thread")
149
+ ```
150
+
151
+ ## Docs
152
+
153
+ Start with [Installation](docs/getting-started/installation.md), the
154
+ [5-minute Quickstart](docs/getting-started/quickstart.md), and the
155
+ [Space → Thread → Message mental model](docs/concepts/mental-model.md). The
156
+ [public API reference](docs/public-api.md), [Google mapping](docs/reference/google-api-mapping.md),
157
+ and [aiogram comparison](docs/aiogram-comparison.md) are linked from the docs site.
158
+ Runnable examples live in [`examples/`](examples/README.md); LLM agents get
159
+ [`llms.txt`](llms.txt).
160
+
161
+ ## Status
162
+
163
+ Pre-1.0 **public beta** (current version 0.14.0b1) — see
164
+ [CHANGELOG](CHANGELOG.md). The documented stable beta
165
+ surface is frozen: pre-1.0 work may add APIs but does not incompatibly
166
+ rename, remove, or change existing contracts. `chattice.experimental`
167
+ has no compatibility promise. `Bot.raw_client` and raw event payloads
168
+ follow Google's SDK and wire schema rather than the stable facade
169
+ promise. **Not an official Google product** — independent open-source
170
+ software, not endorsed by Google. MIT License, see [LICENSE](LICENSE).
@@ -0,0 +1,26 @@
1
+ # PUBLIC_API — machine-readable index
2
+
3
+ This file is the thin generated-style index for coding agents. The full
4
+ human reference: `docs/public-api.md`; rendered signatures:
5
+ `docs/api.md`. Architecture test `tests/test_architecture.py::test_every_public_export_is_importable` pins every package's `__all__`; the canonical entry-point rule lives in `docs/public-api.md`.
6
+
7
+ - chattice: Dispatcher · Router · F · __version__
8
+ - chattice.actions: ActionData (`function=` discriminator binding) · ActionDataDecodeError · ActionDataFilter
9
+ - chattice.auth: AuthMode · CredentialsProvider · ServiceAccountCredentialsProvider · UserCredentialsProvider · CHAT_BOT_SCOPE
10
+ - chattice.capabilities: ResponseCapabilities · ResponseCapability · OutboundCapabilities · OutboundCapability · PreviewCapabilities · PreviewFeature · PREVIEW_APP_COMMAND_TYPES · CapabilityNotSupported
11
+ - chattice.cards: Card · CardHeader · Section · Button (string or ActionData binding) · ButtonList · TextParagraph · Divider · TextInput · SelectionInput · DateTimePicker · Action · OpenLink · Dialog · ActionStatus · ActionStatusCode · Validation · TextInputType · AccessoryWidget · RawWidget
12
+ - chattice.client: Bot · MessageReplyOption · ChatAPIError + wrapped error classes · wrap_api_error · CredentialsProvider (compat re-export)
13
+ - chattice.dispatcher: Dispatcher (`bot=` contextual binding) · Router · EventObserver · Lifespan · LifespanResource
14
+ - chattice.events: Event · MessageEvent (`reply`, lossless read metadata) · CommandEvent · CommandKind · ActionEvent · ActionSource · AddedToSpaceEvent · RemovedFromSpaceEvent · UnknownEvent · ErrorEvent · AppHomeEvent · FormSubmitEvent · WidgetUpdatedEvent · SpaceRef.send · ThreadRef.send · refs · form input values · DialogEventType · TimeZone
15
+ - chattice.filters: F · MagicExpression · MagicField · Filter · BaseFilter · FilterLike · FilterValue
16
+ - chattice.forms: FormModel · FormDecodeError · FormFilter
17
+ - chattice.fsm: State · StatesGroup · FSMContext · FSMStrategy · StorageKey · BaseStorage · MemoryStorage · RedisStorage (lazy) · StateFilter · FSMError · FSMRecord · FSMRecordConflict · FSMRecordStorage · MemoryFSMRecordStorage · RedisFSMRecordStorage (lazy) · BaseStorageFromRecord
18
+ - chattice.idempotency: IdempotencyStorage · MemoryIdempotencyStorage · RedisIdempotencyStorage · ClaimResult · new_owner
19
+ - chattice.integrations.fastapi: create_chat_router · create_pubsub_router · create_workspace_events_router
20
+ - chattice.middleware: Middleware · BaseMiddleware · MiddlewareLike · NextHandler
21
+ - chattice.observability: ObservabilityHooks
22
+ - chattice.testing: MockBot · EventFactory · FakeChatTransport · assert_card_has_button · assert_card_header · set_state_for
23
+ - chattice.transports.http: SYNC_RESPONSE_DEADLINE · HTTPInteractionAdapter · InteractionContext · IncomingRequest · IncomingRequestVerifier · GoogleTokenVerifier · MockVerifier · InteractionResponse · ResponseState · WidgetAutocomplete · RawInteractionResponse · VerificationError · DoubleResponseError
24
+ - chattice.transports.pubsub: PubSubPushAdapter · PubSubEnvelopeError · decode_message_data · PubSubPushVerifier · GooglePubSubVerifier · MockPubSubVerifier
25
+ - chattice.workspace_events: EventsDispatcher · EventsRouter · WorkspaceEvent · WorkspaceEventType · WorkspaceEventError · parse_workspace_event · parse_workspace_envelope
26
+ - chattice.experimental: marker has no direct exports; chattice.experimental.ai is distributed but explicitly unstable and outside the stable API