databricks-mason 0.1.6.dev0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. databricks_mason-0.2.0/PKG-INFO +741 -0
  2. databricks_mason-0.2.0/README.md +706 -0
  3. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/pyproject.toml +3 -3
  4. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/_api_client.py +62 -13
  5. databricks_mason-0.2.0/src/databricks_mason/_pagination.py +25 -0
  6. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/agent_project.py +40 -7
  7. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/app_resources.py +30 -16
  8. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/app.py +0 -2
  9. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/deploy.py +65 -33
  10. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/dev.py +34 -6
  11. databricks_mason-0.2.0/src/databricks_mason/cli/endpoint_examples.py +33 -0
  12. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/help.py +22 -19
  13. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/init.py +19 -5
  14. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/mcp.py +15 -29
  15. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/memory.py +1 -1
  16. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/sessions.py +1 -1
  17. databricks_mason-0.2.0/src/databricks_mason/cli/tools.py +432 -0
  18. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/errors.py +1 -1
  19. databricks_mason-0.2.0/src/databricks_mason/lakebase_runtime_store.py +107 -0
  20. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/langgraph/__init__.py +3 -0
  21. databricks_mason-0.2.0/src/databricks_mason/langgraph/genie.py +24 -0
  22. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/langgraph/mcp.py +32 -10
  23. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/langgraph/memory.py +3 -3
  24. databricks_mason-0.1.6.dev0/src/databricks_mason/lakebase_runtime_store.py → databricks_mason-0.2.0/src/databricks_mason/legacy_lakebase_runtime_store.py +11 -16
  25. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/models.py +51 -1
  26. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/openai/__init__.py +3 -0
  27. databricks_mason-0.2.0/src/databricks_mason/openai/genie.py +24 -0
  28. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/openai/mcp.py +16 -3
  29. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/openai/memory.py +3 -3
  30. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/durability/lakebase_runtime_store.py +22 -1
  31. databricks_mason-0.2.0/src/databricks_mason/runtime/genie.py +187 -0
  32. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/session_store_client.py +2 -2
  33. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/store.py +52 -2
  34. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/tool_manifest.py +38 -2
  35. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/session_store.py +4 -1
  36. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/agent/agent.py +2 -1
  37. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/pyproject.toml +1 -1
  38. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/agent/agent.py +2 -1
  39. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/pyproject.toml +1 -1
  40. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/pyproject.toml +1 -1
  41. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/pyproject.toml +1 -1
  42. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-langgraph/CHAT_APP.md +6 -3
  43. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-langgraph/runtime/ui.py +53 -14
  44. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-langgraph/tests/test_demo_ui.py +47 -3
  45. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-langgraph/ui/app.js +646 -121
  46. databricks_mason-0.2.0/src/databricks_mason/templates/ui/agent-langgraph/ui/index.html +281 -0
  47. databricks_mason-0.2.0/src/databricks_mason/templates/ui/agent-langgraph/ui/mason-mark.png +0 -0
  48. databricks_mason-0.2.0/src/databricks_mason/templates/ui/agent-langgraph/ui/styles.css +1908 -0
  49. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-openai/CHAT_APP.md +6 -3
  50. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-openai/runtime/ui.py +53 -14
  51. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-openai/tests/test_demo_ui.py +47 -3
  52. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-openai/ui/app.js +646 -121
  53. databricks_mason-0.2.0/src/databricks_mason/templates/ui/agent-openai/ui/index.html +281 -0
  54. databricks_mason-0.2.0/src/databricks_mason/templates/ui/agent-openai/ui/mason-mark.png +0 -0
  55. databricks_mason-0.2.0/src/databricks_mason/templates/ui/agent-openai/ui/styles.css +1908 -0
  56. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/timefmt.py +1 -1
  57. databricks_mason-0.1.6.dev0/PKG-INFO +0 -466
  58. databricks_mason-0.1.6.dev0/README.md +0 -431
  59. databricks_mason-0.1.6.dev0/src/databricks_mason/_pagination.py +0 -15
  60. databricks_mason-0.1.6.dev0/src/databricks_mason/cli/tools.py +0 -274
  61. databricks_mason-0.1.6.dev0/src/databricks_mason/templates/ui/agent-langgraph/ui/index.html +0 -184
  62. databricks_mason-0.1.6.dev0/src/databricks_mason/templates/ui/agent-langgraph/ui/styles.css +0 -1139
  63. databricks_mason-0.1.6.dev0/src/databricks_mason/templates/ui/agent-openai/ui/index.html +0 -184
  64. databricks_mason-0.1.6.dev0/src/databricks_mason/templates/ui/agent-openai/ui/styles.css +0 -1139
  65. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/.gitignore +0 -0
  66. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/NOTICE +0 -0
  67. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/__init__.py +0 -0
  68. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/_group.py +0 -0
  69. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/__init__.py +0 -0
  70. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/auth.py +0 -0
  71. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/endpoint.py +0 -0
  72. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/endpoint_output.py +0 -0
  73. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/endpoint_request.py +0 -0
  74. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/endpoint_transport.py +0 -0
  75. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/sandbox.py +0 -0
  76. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/cli/tracing.py +0 -0
  77. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/client.py +0 -0
  78. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/databricks_cli.py +0 -0
  79. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/langgraph/session_store.py +0 -0
  80. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/memory_store.py +0 -0
  81. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/openai/sessions.py +0 -0
  82. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/project_config.py +0 -0
  83. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/project_types.py +0 -0
  84. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/py.typed +0 -0
  85. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/render.py +0 -0
  86. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/ARCHITECTURE.md +0 -0
  87. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/README.md +0 -0
  88. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/__init__.py +0 -0
  89. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/app.py +0 -0
  90. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/durability/__init__.py +0 -0
  91. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/durability/execution.py +0 -0
  92. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/durability/heartbeat.py +0 -0
  93. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/durability/recovery.py +0 -0
  94. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/durability/store.py +0 -0
  95. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/execution.py +0 -0
  96. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/runtime.py +0 -0
  97. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/tracing.py +0 -0
  98. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/types.py +0 -0
  99. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/runtime/workspace.py +0 -0
  100. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/.env.example +0 -0
  101. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/.gitignore +0 -0
  102. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/AGENTS.md +0 -0
  103. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/CLAUDE.md +0 -0
  104. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/README.md +0 -0
  105. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/agent/__init__.py +0 -0
  106. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/agent/mcps.py +0 -0
  107. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/agent/tools/__init__.py +0 -0
  108. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/agent/tools/sample_tool.py +0 -0
  109. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/agent/tools/send_message.py +0 -0
  110. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/app.yaml +0 -0
  111. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/runtime/__init__.py +0 -0
  112. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/runtime/adapter.py +0 -0
  113. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/runtime/main.py +0 -0
  114. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/tests/__init__.py +0 -0
  115. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/tests/test_agent.py +0 -0
  116. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/tests/test_runtime.py +0 -0
  117. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-langgraph/tests/test_workspace.py +0 -0
  118. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/.env.example +0 -0
  119. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/.gitignore +0 -0
  120. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/AGENTS.md +0 -0
  121. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/CLAUDE.md +0 -0
  122. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/README.md +0 -0
  123. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/agent/__init__.py +0 -0
  124. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/agent/mcps.py +0 -0
  125. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/agent/tools/__init__.py +0 -0
  126. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/agent/tools/sample_tool.py +0 -0
  127. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/agent/tools/send_message.py +0 -0
  128. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/app.yaml +0 -0
  129. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/runtime/__init__.py +0 -0
  130. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/runtime/adapter.py +0 -0
  131. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/runtime/main.py +0 -0
  132. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/tests/__init__.py +0 -0
  133. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/tests/test_agent.py +0 -0
  134. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/tests/test_runtime.py +0 -0
  135. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/agent-openai/tests/test_workspace.py +0 -0
  136. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/.env.example +0 -0
  137. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/.gitignore +0 -0
  138. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/README.md +0 -0
  139. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/agent/__init__.py +0 -0
  140. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/agent/agent.py +0 -0
  141. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/app.yaml +0 -0
  142. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/runtime/__init__.py +0 -0
  143. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/runtime/main.py +0 -0
  144. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-langgraph/tests/test_runtime.py +0 -0
  145. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/.env.example +0 -0
  146. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/.gitignore +0 -0
  147. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/README.md +0 -0
  148. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/agent/__init__.py +0 -0
  149. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/agent/agent.py +0 -0
  150. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/app.yaml +0 -0
  151. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/runtime/__init__.py +0 -0
  152. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/runtime/main.py +0 -0
  153. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/custom-agent-openai/tests/test_runtime.py +0 -0
  154. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/sandbox_mcp.py +0 -0
  155. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/sandbox_mcp_langgraph.py +0 -0
  156. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-langgraph/runtime/main.py +0 -0
  157. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/templates/ui/agent-openai/runtime/main.py +0 -0
  158. {databricks_mason-0.1.6.dev0 → databricks_mason-0.2.0}/src/databricks_mason/theme.py +0 -0
@@ -0,0 +1,741 @@
1
+ Metadata-Version: 2.5
2
+ Name: databricks-mason
3
+ Version: 0.2.0
4
+ Summary: Databricks integration for Mason
5
+ Author-email: Databricks <agent-feedback@databricks.com>
6
+ License-File: NOTICE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: click>=8.4
9
+ Requires-Dist: databricks-ai-bridge[memory]>=0.22.0
10
+ Requires-Dist: databricks-sdk>=0.94.0
11
+ Requires-Dist: fastapi>=0.129.0
12
+ Requires-Dist: mlflow-skinny>=3.10.1
13
+ Requires-Dist: psycopg[binary]>=3.1
14
+ Requires-Dist: pyyaml>=6.0
15
+ Requires-Dist: rich>=13.7
16
+ Requires-Dist: sqlalchemy[asyncio]>=2.0
17
+ Requires-Dist: tomli>=2.0
18
+ Requires-Dist: tomlkit>=0.13
19
+ Requires-Dist: uvicorn>=0.20.0
20
+ Provides-Extra: langgraph
21
+ Requires-Dist: databricks-agents>=1.9.3; extra == 'langgraph'
22
+ Requires-Dist: databricks-langchain>=0.17.0; extra == 'langgraph'
23
+ Requires-Dist: langchain-mcp-adapters>=0.2.1; extra == 'langgraph'
24
+ Requires-Dist: langchain>=1.0.0; extra == 'langgraph'
25
+ Requires-Dist: langgraph>=1.1.0; extra == 'langgraph'
26
+ Requires-Dist: mlflow>=3.10.1; extra == 'langgraph'
27
+ Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.25.0; extra == 'langgraph'
28
+ Provides-Extra: openai
29
+ Requires-Dist: databricks-agents>=1.9.3; extra == 'openai'
30
+ Requires-Dist: databricks-openai>=0.13.0; extra == 'openai'
31
+ Requires-Dist: mlflow>=3.10.1; extra == 'openai'
32
+ Requires-Dist: openai-agents>=0.7.0; extra == 'openai'
33
+ Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.25.0; extra == 'openai'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # `databricks-mason`
37
+
38
+ Mason is an experimental CLI for Databricks custom agent preview APIs and
39
+ deployments. It manages memory, sessions, tracing, and deployments from one
40
+ authenticated command.
41
+
42
+ > The underlying APIs are in preview and may need workspace enablement.
43
+
44
+ ## Overview
45
+
46
+ A managed path from your custom agent code to a production-ready, scalable, durable agent hosted on
47
+ Databricks in minutes - with no server framework to build, no infrastructure to provision, and no
48
+ invocation protocol to design yourself. Bring your own agent, or start from a template.
49
+
50
+ - **Deployment** - a guided lifecycle (scaffold, run locally, deploy) that turns an agent project
51
+ into a hosted endpoint. Databricks provisions the compute, the stores your agent binds (session,
52
+ memory), and the access grants, so you ship application code and get a running endpoint.
53
+ - **Runtime** - a managed HTTP invocation contract (synchronous, streaming, background) plus optional
54
+ durable execution (persistence, heartbeats, crash recovery) backed by Databricks Lakebase, with no
55
+ database or job queue to operate. Use the opinionated `AgentApp` server to get it out of the box,
56
+ or bring your own server for full control.
57
+
58
+ **Deployment**
59
+
60
+ ![Deployment: from a blank directory to a running service](docs/deployment.svg)
61
+
62
+ - **Agent project** - `mason init` scaffolds a deployable project from a framework template
63
+ (LangGraph or OpenAI Agents) with the runtime, tests, and an optional chat UI wired up; you edit
64
+ the application code (model, tools, prompts).
65
+ - **`agent.toml`** - the declarative source of truth for the Databricks-managed infrastructure your
66
+ agent depends on: tool bindings (data sandbox, managed MCP services, Unity Catalog functions) and
67
+ memory, session, and durability resources. `mason deploy` reads it to provision and wire everything
68
+ up (detailed under [Agent tools](#agent-tools)).
69
+ - **`mason deploy`** - provisions the bound stores, grants the app's service principal access to
70
+ them, provisions the durable-runtime database when durability is on, configures tracing, and rolls
71
+ out the app. `mason deployments` covers the lifecycle (list, get, logs, start, stop, delete).
72
+ - **`mason dev`** - runs your agent from the same manifest the deployment uses, so local behavior
73
+ matches what ships.
74
+
75
+ **Runtime**
76
+
77
+ ![Runtime: one FastAPI server, run as AgentApp or your own implementation](docs/runtime.svg)
78
+
79
+ The two ways to run an agent:
80
+
81
+ - **`AgentApp` - opinionated, batteries included.** Register one handler and get Mason's full
82
+ invocation contract (synchronous, streaming, background). Enable the durable runtime so
83
+ long-running and background work survives restarts, redeploys, and crashes. The framework
84
+ templates are thin layers over `AgentApp` (HTTP contract detailed under [Runtime](#runtime)).
85
+ - **Custom server - generic, full control.** `mason init --server custom` scaffolds a minimal FastAPI
86
+ server with no `AgentApp`: you define your own endpoints, request/response shapes, and protocol.
87
+ `mason dev` and `mason deploy` run and ship it the same way.
88
+
89
+ ## Prerequisites
90
+
91
+ - **Python ≥3.10** — the mason CLI installs and runs on any Python 3.10+. The
92
+ `memory`, `sessions`, `tracing`, and `tools` commands need nothing else.
93
+ - **[`uv`](https://docs.astral.sh/uv/)** — needed to scaffold, run, and deploy an
94
+ agent (`mason init` → `mason dev` → `mason deploy`): the scaffolded project builds
95
+ its environment and launches with `uv run`, both locally and in the deployed Apps
96
+ runtime. Not needed for the store/session/tracing/tools commands above.
97
+ - **[Databricks CLI](https://docs.databricks.com/dev-tools/cli/)** — needed for
98
+ browser-based `mason login`. If a profile is already authenticated, Mason uses it
99
+ directly and the Databricks CLI is optional.
100
+
101
+ ## Installation
102
+
103
+ From PyPI:
104
+
105
+ ```sh
106
+ pip install databricks-mason
107
+ ```
108
+
109
+ From source:
110
+
111
+ ```sh
112
+ pip install 'git+https://github.com/databricks/databricks-ai-bridge.git#subdirectory=integrations/mason'
113
+ ```
114
+
115
+ The base package includes the CLI, store SDK, and `AgentApp` HTTP runtime. Generated projects
116
+ declare their framework dependencies automatically.
117
+
118
+ ## Shell completion
119
+ Add this to `~/.zshrc`:
120
+ ```sh
121
+ eval "$(_MASON_COMPLETE=zsh_source mason)"
122
+ ```
123
+
124
+ ## Authentication
125
+
126
+ Mason uses [Databricks authentication](https://docs.databricks.com/aws/en/dev-tools/cli/authentication).
127
+ Ask Mason to authenticate and remember a named profile:
128
+
129
+ ```sh
130
+ mason login --profile <profile>
131
+ mason sessions stores list
132
+ ```
133
+
134
+ `mason login` validates existing credentials first. If credentials are missing or rejected in
135
+ an interactive terminal, Mason runs `databricks auth login --profile <profile>`, revalidates the
136
+ profile, and stores the selection in `~/.mason/config.json`. This browser-based setup requires
137
+ the Databricks CLI. In non-interactive environments, authenticate the profile before running
138
+ Mason. `mason logout` forgets the saved selection without revoking the underlying credentials.
139
+
140
+ If Databricks SDK default authentication is already configured, you can skip `mason login`.
141
+ You can also pass the global `--profile/-p` option before an individual command, for example
142
+ `mason --profile <profile> tools list`. Use `--output json` for scripting.
143
+
144
+ ## Quickstart
145
+
146
+ The shortest path from a blank directory to a running and deployed agent:
147
+
148
+ ```sh
149
+ mason login --profile <profile>
150
+ mason init my-agent
151
+ cd my-agent
152
+ mason dev # run locally
153
+ mason deploy my-agent # deploy to Databricks
154
+ ```
155
+
156
+ `mason dev` runs the agent locally on `http://localhost:8000`, wrapping the Databricks Apps
157
+ local runtime so local behavior matches a deployment.
158
+
159
+ `mason deploy my-agent` deploys a Databricks App named `agent-mason-my-agent`, provisions the
160
+ stores declared in `agent.toml`, and grants the app's service principal access to them. `mason
161
+ deployments list` shows what you have deployed, and `mason deployments get my-agent` prints its
162
+ URL and status.
163
+
164
+ `mason init` declares default memory and session stores in `agent.toml`, so the deployed agent has
165
+ long-term memory and durable conversation history. It creates `<name>-<6-letter-token>-memory` and
166
+ `<name>-<6-letter-token>-sessions`, and records both names in `agent.toml`.
167
+ `mason deploy` creates them if they don't exist yet. Point the agent at stores you already have with
168
+ `mason memory bind <name>` / `mason sessions bind <name>`, or scaffold without stores using
169
+ `mason init --server custom` (see [Initialize the chat app demo](#initialize-the-chat-app-demo)).
170
+
171
+ To exercise the agent — locally under `mason dev` or once deployed — `mason endpoint invoke` sends
172
+ it an HTTP request. MLflow tracing is on by default; `mason tracing list` shows the traces it
173
+ produces.
174
+
175
+ ## Python SDK
176
+
177
+ `MasonClient` adds a small resource-oriented layer over the Mason API. Pass it an
178
+ authenticated Databricks `WorkspaceClient`, or omit the argument to use the
179
+ Databricks SDK's default authentication resolution:
180
+
181
+ ```python
182
+ from databricks.sdk import WorkspaceClient
183
+ from databricks_mason import MasonClient
184
+
185
+ mason = MasonClient(WorkspaceClient(profile="my-workspace"))
186
+
187
+ session_store = mason.session_stores.create("support-agent-sessions")
188
+ session = session_store.add(actor_id="customer-123", session_id="case-456")
189
+ session.append_items(
190
+ [
191
+ {"type": "message", "role": "user", "content": "I need help with my cluster."},
192
+ {"type": "message", "role": "assistant", "content": "Let's take a look."},
193
+ ]
194
+ )
195
+
196
+ memory_store = mason.memory_stores.create("coding-agent-memory")
197
+ memory = memory_store.add(
198
+ actor_id="alice",
199
+ path="/preferences/style.md",
200
+ content="The user prefers concise answers.",
201
+ )
202
+ results = memory_store.search(
203
+ actor_id="alice",
204
+ query="response preferences",
205
+ limit=10,
206
+ )
207
+ memory = memory.update(content="The user prefers very concise answers.")
208
+ memory.delete()
209
+ ```
210
+
211
+ The root collections manage stores: `mason.memory_stores.create/get/list` and
212
+ `mason.session_stores.create/get/list`. A returned store owns operations on its
213
+ contents, such as `memory_store.add()`, `memory_store.get("memory-id")`,
214
+ `memory_store.list()`, and `memory_store.search()`, or `session_store.add()`,
215
+ `session_store.get("session-id")`, and `session_store.list()`. Returned memories,
216
+ sessions, and stores own their `update()` and `delete()` operations.
217
+
218
+ All `list()` methods return iterators that automatically consume server pages. List
219
+ `page_size` and search `limit` values must be between 1 and 100. `session.list_items()`
220
+ also auto-pages. `session.fork(...)` creates an independent copy, optionally through
221
+ a specific item. Deleting a session with descendants requires
222
+ `session.delete(force=True)` to cascade the deletion.
223
+
224
+ The resource layer intentionally does not mirror every API method. Its private
225
+ transport will be replaced by the generated `WorkspaceClient.mason` service when that
226
+ is released, without changing this public surface. Deployment, sandbox, tracing, and
227
+ the existing CLI commands remain separate.
228
+
229
+ ## Runtime
230
+
231
+ `AgentApp` runs your agent through one HTTP API for synchronous, streaming, and background
232
+ invocations. Register an `@app.invoke` handler, publish progress with `await context.emit(event)`,
233
+ and return a JSON result. You can also add your own FastAPI endpoints.
234
+
235
+ Start from a template, edit the agent code in `agent/`, and run it locally before deploying:
236
+
237
+ ```sh
238
+ mason init my-agent --framework langgraph --server mason --profile <profile>
239
+ cd my-agent
240
+ mason dev
241
+ # Stop the local server when ready to deploy.
242
+ mason --profile <profile> deploy my-agent
243
+ ```
244
+
245
+ Use `--framework openai` for OpenAI Agents. Templates keep agent code separate from the runtime
246
+ adapter and declare default Session and Memory Store bindings in `agent.toml`.
247
+
248
+ Each managed run is an **invocation**. Send a client-generated UUID `id` and your agent's `input`:
249
+
250
+ ```json
251
+ {
252
+ "id": "550e8400-e29b-41d4-a716-446655440000",
253
+ "input": {"messages": [{"role": "user", "content": "Hello"}]},
254
+ "background": true,
255
+ "stream": true
256
+ }
257
+ ```
258
+
259
+ | Endpoint | Behavior |
260
+ | --- | --- |
261
+ | `POST /api/invocations` | Defaults to synchronous execution: `200` with the result under `output`. `stream: true` returns SSE events. `background: true` returns `202` with a status URL; adding `stream: true` also includes an events URL. |
262
+ | `GET /api/invocations/{id}` | Returns the invocation status and, when completed, its output. |
263
+ | `GET /api/invocations/{id}/events?after={cursor}` | Streams events after the last received event ID, allowing clients to reconnect. |
264
+
265
+ The UUID also acts as an idempotency key: repeating the same request reuses the existing invocation
266
+ while its record is retained; using the ID for a different request returns `409`.
267
+
268
+ `mason dev` keeps execution state in process and loses it on restart. For projects with
269
+ `[agent].server = "mason"`, `mason deploy` provisions a persistent Runtime Store for requests,
270
+ status, events, and results. Register `@app.recover` to restart interrupted work after worker
271
+ failures. Recovery is at-least-once, so external side effects must be idempotent. Session and
272
+ Memory Stores separately preserve the state used by your agent.
273
+
274
+ The managed path uses the internal Runtime Store API to create a dedicated database in the
275
+ workspace's shared Lakebase project and give the app SP ownership. Mason initializes its schema and
276
+ tables; no manual Lakebase grant or Postgres app-resource attachment is needed. Backend selection
277
+ is an internal rollout detail, not a user-facing setting; Mason currently retains the legacy
278
+ per-app Lakebase project by default. Once enabled, redeploy reads the stored backend and verifies
279
+ the app identity, and `mason deployments delete` removes the managed store before deleting the app.
280
+ The switch does not migrate existing deployments between backends. Managed cleanup errors retain
281
+ the app for retry. Direct app deletion bypasses managed store cleanup.
282
+
283
+ Use `server = "custom"` to deploy your own HTTP server without provisioning a Runtime Store.
284
+ Changing the server type of an existing deployment is not supported. To use a different server,
285
+ scaffold a new project with the desired `mason init --server` option and deploy it under a new name.
286
+ See the [runtime guide](src/databricks_mason/runtime/README.md) for agent hooks, full API examples,
287
+ and recovery behavior.
288
+
289
+ ## Memory and sessions
290
+
291
+ To hold context, an agent needs two kinds of state: the state of the interaction it is handling right
292
+ now, and the durable knowledge it carries from one conversation to the next. Databricks provides a
293
+ fully managed store for each, both backed by Lakebase and usable from agents built on any framework:
294
+
295
+ - **Managed agent sessions** store an agent's session state: the state an agent or framework keeps
296
+ for one interaction. Most commonly this is the conversation history (the ordered transcript of
297
+ messages, tool calls, and results), but it can be any state a framework persists, such as a
298
+ LangGraph graph. The agent reads it at the start of a turn and appends to it as the interaction
299
+ runs.
300
+ - **Managed agent memory** stores durable facts, preferences, and decisions that an agent recalls in
301
+ later, separate conversations, retrieved by semantic search.
302
+
303
+ The examples below use the [`MasonClient` Python SDK](#python-sdk); the same operations are available
304
+ as `mason sessions` / `mason memory` CLI commands.
305
+
306
+ ![Sessions and memory: the agent reads and appends one conversation's transcript in the session store, and recalls and saves durable facts in the memory store, which outlive any single conversation.](docs/sessions_and_memory.png)
307
+
308
+ ### Sessions
309
+
310
+ A **session store** holds **sessions**, and each session holds an ordered list of **session items**. A
311
+ session is one interaction — typically a conversation thread — grouped under an `actor_id` (who it
312
+ belongs to; set this from trusted application context, never a model- or user-supplied value) and
313
+ identified by a caller-chosen `session_id` (the service generates one if you omit it). Each item is an
314
+ opaque, JSON-compatible `data` value — a message, tool call, result, or reasoning block — that
315
+ Databricks stores and returns verbatim, in order, and never mutates once appended.
316
+
317
+ Create a store, start a session, append the conversation's turns, and read the history back on a later
318
+ request:
319
+
320
+ ```python
321
+ from databricks.sdk import WorkspaceClient
322
+ from databricks_mason import MasonClient
323
+
324
+ mason = MasonClient(WorkspaceClient())
325
+
326
+ session_store = mason.session_stores.create("support-agent-sessions")
327
+ session = session_store.add(actor_id="customer-123", session_id="case-456")
328
+
329
+ session.append_items(
330
+ [
331
+ {"type": "message", "role": "user", "content": "I need help with my cluster."},
332
+ {"type": "message", "role": "assistant", "content": "Let's take a look."},
333
+ ]
334
+ )
335
+
336
+ # On a later turn, reload the session and read its full history in order.
337
+ session = session_store.get("case-456")
338
+ history = [item.data for item in session.list_items()] # list_items auto-pages
339
+ ```
340
+
341
+ A session can be **forked** into an independent branch: a new session seeded with the original's
342
+ history, linked back to its origin by `parent_session_id`. Fork the full history, or only up to a
343
+ specific item, to explore an alternate continuation without disturbing the original thread:
344
+
345
+ ```python
346
+ branch = session.fork(actor_id="customer-123") # add up_to_item_id=... to branch up to one item
347
+ ```
348
+
349
+ Deleting a session that has such descendants requires `session.delete(force=True)` to cascade.
350
+
351
+ In a Mason-server agent you don't call these directly — the framework adapter reads and appends
352
+ session state for you. With LangGraph, pass `checkpointer()` when you build the agent and scope each
353
+ run with `thread_config(session_id)`; the OpenAI Agents adapter exposes the same as
354
+ `session_store(session_id)`:
355
+
356
+ ```python
357
+ from databricks_mason.langgraph import checkpointer, thread_config
358
+
359
+ agent = create_agent(model=..., tools=[...], checkpointer=checkpointer())
360
+ result = await agent.ainvoke(inputs, config=thread_config(session_id))
361
+ ```
362
+
363
+ ### Memory
364
+
365
+ A **memory store** holds **memory entries**. Each entry is a free-form `content` string plus a short
366
+ `description` used for retrieval, keyed by three fields: `actor_id` (whose memory it is — set from
367
+ trusted application context, never a model- or user-supplied value), `path` (a filesystem-like key
368
+ within an actor, such as `/preferences/response-style.md`), and an optional `session_id` (the session
369
+ an entry came from, for provenance). An entry is uniquely identified by its `actor_id`, `path`, and
370
+ optional `session_id`.
371
+
372
+ Write an entry when the agent learns something durable, then recall it in a later, separate
373
+ conversation with a natural-language search — results are ranked by full-text (BM25) relevance, up to
374
+ 100 entries, with no pagination or vector similarity:
375
+
376
+ ```python
377
+ from databricks.sdk import WorkspaceClient
378
+ from databricks_mason import MasonClient
379
+
380
+ mason = MasonClient(WorkspaceClient())
381
+
382
+ memory_store = mason.memory_stores.create("support-agent-memory")
383
+ memory_store.add(
384
+ actor_id="user-123",
385
+ path="/preferences/communication.md",
386
+ content="Prefers email over phone. Timezone: PST.",
387
+ description="User 123 communication preferences",
388
+ )
389
+
390
+ # In a later, separate conversation, recall what the agent knows about this user.
391
+ results = memory_store.search(actor_id="user-123", query="communication preferences", limit=10)
392
+ ```
393
+
394
+ To browse rather than search, `memory_store.list(actor_id=..., path_prefix=...)` returns entries
395
+ directly.
396
+
397
+ In a Mason-server agent, add the memory tools so the model can read and write memory during a run.
398
+ `memory_tools(actor)` exposes `remember` and `recall` bound to one actor's partition; it resolves the
399
+ store from the `[memory_store]` binding — carried to the runtime by the `AGENT_MEMORY_STORE` env var
400
+ that `deploy` and `mason dev` inject — and returns no tools when no store is bound, so the agent runs
401
+ unchanged. The OpenAI Agents adapter exposes the same as `memory_tools()`:
402
+
403
+ ```python
404
+ from databricks_mason.langgraph import memory_tools
405
+
406
+ agent = create_agent(model=..., tools=[*your_tools, *memory_tools(actor)])
407
+ ```
408
+
409
+ > **`actor_id` partitions data; it is not access control.** Both stores are workspace-scoped and
410
+ > authorized at the store level, so any principal that can reach a store can read and write every
411
+ > actor's entries. For strict isolation between tenants or users, use a separate store per boundary.
412
+ > Grant another principal — such as your app's service principal — access with
413
+ > `session_store.grant_permission(principal_id)` or `memory_store.grant_permission(principal_id)`;
414
+ > `mason deploy` does this for the deployed app automatically.
415
+
416
+ ### Declaring and provisioning stores
417
+
418
+ For a deployed agent, `agent.toml` declares which stores it uses and `mason deploy` provisions them —
419
+ you don't create stores by hand. `mason init` declares a default memory and session store named from
420
+ the project; override those names, point at stores you already have, or let `deploy` create them:
421
+
422
+ ```sh
423
+ # Scaffold a project with default memory and session stores declared in agent.toml.
424
+ mason init my-agent
425
+
426
+ # Override the declared store names at init time.
427
+ mason init my-agent --memory-store support-agent-memory --session-store support-agent-sessions
428
+
429
+ # Or point an existing project at specific stores (edits agent.toml only; creates nothing).
430
+ mason sessions bind support-agent-sessions
431
+ mason memory bind support-agent-memory
432
+
433
+ # deploy creates any declared-but-missing store and grants the app's service principal access.
434
+ mason deploy my-agent
435
+ ```
436
+
437
+ Memory and session stores are independent resources: deleting one never affects the other.
438
+
439
+ ## Commands
440
+
441
+ For the full command reference - every command, subcommand, argument, and option, in table form -
442
+ see [`cli.md`](cli.md). The tree below is a quick overview.
443
+
444
+ ```text
445
+ mason [-p <profile>] [-o text|json]
446
+ login [--profile P]
447
+ logout
448
+ init [--framework openai|langgraph] [--server mason|custom]
449
+ [--disable-chat-app]
450
+ [--memory-store NAME] [--session-store NAME]
451
+ [--profile P] [directory]
452
+ dev [--source PATH] [--prepare-environment] [--app-port PORT]
453
+ [--with-traces C.S]
454
+ memory
455
+ bind STORE [--source PATH]
456
+ unbind [--source PATH]
457
+ stores create | list | get | update | delete
458
+ entries create | get | list | search | update | delete
459
+ sessions create | list | get | update | delete | fork
460
+ bind STORE [--source PATH]
461
+ unbind [--source PATH]
462
+ stores create | list | get | update | delete
463
+ items list | append | pop | clear
464
+ tracing
465
+ configure [--experiment E] [--source PATH]
466
+ disable [--source PATH]
467
+ list | get
468
+ tools
469
+ add sandbox --scope SCOPE [--scope SCOPE ...] [--source PATH]
470
+ add mcp SERVICE [--name NAME] [--source PATH]
471
+ add uc-function FUNCTION [--name NAME] [--source PATH]
472
+ add genie-one [--name NAME] [--source PATH]
473
+ add genie-agent SPACE_ID [--name NAME] [--source PATH]
474
+ list [--kind sandbox|mcp|uc-function|genie-one|genie-agent]
475
+ [--schema CATALOG.SCHEMA]
476
+ remove TOOL_ID [MCP_SERVICE] [--source PATH]
477
+ deploy <name> --source PATH [--with-traces C.S] [--instances N]
478
+ deployments list | get | logs | start | stop | delete
479
+ endpoint
480
+ invoke [APP] --path PATH [--url URL] [--json JSON] [--sse]
481
+ ```
482
+
483
+ ## Invoke HTTP endpoints
484
+
485
+ `mason endpoint invoke` is a low-level HTTP command. It resolves and authenticates a deployed
486
+ Databricks App, or targets localhost and arbitrary servers through `--url`. It does not assume an
487
+ agent protocol: provide the method, path, query parameters, and complete JSON body required by the
488
+ server.
489
+
490
+ ```sh
491
+ mason --profile <profile> endpoint invoke mason-my-agent \
492
+ --path /api/invocations \
493
+ --json '{"id":"00000000-0000-4000-8000-000000000001","input":[{"role":"user","content":"Hello"}]}'
494
+
495
+ mason endpoint invoke --url http://localhost:8000 \
496
+ --path /api/invocations \
497
+ --json '{"id":"00000000-0000-4000-8000-000000000001","input":[{"role":"user","content":"Hello"}]}'
498
+ ```
499
+
500
+ The JSON body remains explicit even for Mason-generated agents. For example, Mason Runtime agents require
501
+ a client-generated invocation ID, and streaming servers require their own streaming field plus
502
+ `--sse` so the CLI consumes the response as Server-Sent Events.
503
+
504
+ ```sh
505
+ INVOCATION_ID=$(uuidgen)
506
+ mason --profile <profile> endpoint invoke mason-my-agent \
507
+ --path /api/invocations \
508
+ --json "{\"id\":\"$INVOCATION_ID\",\"input\":[{\"role\":\"user\",\"content\":\"Run the report\"}]}"
509
+
510
+ mason --profile <profile> endpoint invoke mason-my-agent \
511
+ --path /api/invocations \
512
+ --sse \
513
+ --json "{\"id\":\"$INVOCATION_ID\",\"input\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true}"
514
+ ```
515
+
516
+ `--session-id` preserves one application session across calls by setting the Databricks Apps routing
517
+ cookie. This also works with a direct App URL and with the generated runtime on localhost. OAuth and
518
+ session headers are managed by Mason; arbitrary custom request headers are intentionally not exposed
519
+ by this command.
520
+
521
+ ## Command help
522
+
523
+ Use the conventional help flag at any command level. Every command's help includes runnable
524
+ examples:
525
+
526
+ ```sh
527
+ mason --help
528
+ mason deploy --help
529
+ mason sessions items append --help
530
+ ```
531
+
532
+ ## Agent tools
533
+
534
+ For projects with `[agent].server = "mason"` (the default from `mason init`), `agent.toml` is the
535
+ declarative source of truth for Databricks-managed infrastructure: the Runtime Store, sandbox,
536
+ managed MCP, Genie and Unity Catalog function bindings, plus memory and session resources. `mason tools
537
+ add` updates only this file; direct TOML edits have the same behavior. Both Mason-server framework
538
+ adapters read the managed bindings at runtime without generating or patching agent source:
539
+
540
+ ```sh
541
+ mason tools add sandbox --scope table:samples.nyctaxi.trips
542
+ mason tools add mcp system.ai.web_search
543
+ mason tools add uc-function catalog.schema.lookup_ticket
544
+ mason tools add genie-one
545
+ mason tools add genie-agent SPACE_ID
546
+ mason tools remove mcp system.ai.web_search
547
+ mason tools list
548
+ ```
549
+
550
+ For MCP services, the remove command accepts the same service name as the add command. You can also
551
+ remove any binding by its `id` in `agent.toml`, for example `mason tools remove web_search`.
552
+ Every successful add (including an already-configured no-op) points you to the target project's
553
+ `agent.toml` to review configured managed tools and MCP bindings. With `--source`, the message
554
+ points to that project's file. JSON add output includes its path in `manifest`.
555
+
556
+ `mason tools list` discovers **available integrations to add**, not configured bindings. By default
557
+ it shows built-in add recipes and caller-visible MCP Services in `system.ai`. A recipe may still
558
+ need your resources: sandbox scopes, a concrete UC function name, or a Genie Space ID. Genie One
559
+ needs no additional argument. `system.ai.sandbox` is represented by its scoped recipe rather than
560
+ a second unscoped add command. The list does not enumerate every workspace schema, individual
561
+ operations inside MCP services, or custom Python tools.
562
+
563
+ `mason tools add mcp` looks up the service in the selected workspace before writing `agent.toml`.
564
+ Use `mason --profile <profile> tools add mcp <service>` to select a workspace. A missing service or
565
+ failed lookup (including authentication or permission errors) leaves the project unchanged. This
566
+ checks service metadata access, not whether every tool can be executed at runtime. Removing local
567
+ bindings does not require workspace access.
568
+
569
+ ```sh
570
+ mason tools list
571
+ mason tools list --kind mcp
572
+ mason tools list --kind mcp --schema main.tools
573
+ mason tools list --kind sandbox
574
+ mason tools list --kind genie-one
575
+ mason tools list --kind genie-agent
576
+ mason --output json tools list
577
+ ```
578
+
579
+ No agent project is required for discovery. MCP discovery uses your Databricks profile; the
580
+ `sandbox`, `uc-function`, `genie-one`, and `genie-agent` kind filters show local recipes without
581
+ authentication. `--schema` requires `--kind mcp` and replaces the default `system.ai` scope. An
582
+ API/authentication failure returns nonzero and marks discovery incomplete, while retaining local
583
+ recipes; it is not reported as an empty successful discovery. Listing metadata does not verify
584
+ runtime execution permissions.
585
+
586
+ **Migration:** the former configured `tools list` view and its `--source` option are removed.
587
+ Read `agent.toml` (its `[[tools]]` entries) to inspect configured bindings. Discovery JSON uses
588
+ `schema_version: 2`, with `available_tools` (`name`, `kind`, `add_command`), `mcp_schema` (null for
589
+ local-only recipes), `complete`, and `errors`. Replace old scripts that read configured-list JSON
590
+ with TOML inspection. Replace `mason mcp list [--schema catalog.schema]` with
591
+ `mason tools list --kind mcp [--schema catalog.schema]`; the former command is removed. Use
592
+ `mason tools list --help` for the new discovery contract.
593
+
594
+ Read-only live discovery can be checked against the installed wheel without creating a project
595
+ or deploying an agent:
596
+
597
+ ```sh
598
+ MASON_E2E_PROFILE=<profile> .venv-functional/bin/pytest tests/e2e/tool_discovery_test.py -v
599
+ ```
600
+
601
+ The live checks compare default and MCP-filtered discovery with the compatibility service list.
602
+ Set `MASON_E2E_SCHEMA=catalog.schema` to exercise an additional schema. The installed CLI's local
603
+ add/review/remove flows and all updated help pages are covered by `tests/functional/cli_smoke_test.py`.
604
+
605
+ In Mason-server templates, custom Python tools are code-first. Write them with the framework's native
606
+ decorator in `agent/tools/`: LangGraph uses `@tool`, while OpenAI Agents uses `@function_tool`. The
607
+ templates auto-discover decorated tools from that package and add them to the agent; there is no CLI
608
+ command or `agent.toml` entry to keep in sync. Customer-managed MCP servers are likewise ordinary
609
+ code in `agent/mcps.py` and are joined with the managed bindings by `mcp_tools(...)` or
610
+ `mcp_servers(...)`.
611
+
612
+ Projects created with `--server custom` do not auto-discover `agent/tools/` or load managed tool
613
+ bindings from `agent.toml`, so `mason tools add` rejects those projects. Wire framework-native Python
614
+ tools and MCP servers directly in `agent/agent.py` instead.
615
+
616
+ If an older Mason-server manifest contains `source = { kind = "python", ... }`, remove that
617
+ `[[tools]]` entry; the decorated tool in `agent/tools/` remains active. `mason dev` and `mason deploy`
618
+ do not generate or patch Python tool code, and do not alter the manifest's `[[tools]]` bindings.
619
+
620
+ Sandbox scopes default to read-only access. Repeat `--scope` to allow more than one resource, use
621
+ `volume:` or `workspace:` for those resource types, and use `--permission read_write` only when the
622
+ agent needs writes. Every sandbox call carries this fixed downscope in MCP `_meta`, outside the tool
623
+ arguments controlled by the model.
624
+
625
+ ### Genie tools
626
+
627
+ Genie One and Genie Agent support ship with Mason, but bindings are opt-in, like sandbox tools.
628
+ Installing Mason does not configure a Genie Space ID or enable a Genie binding. Add only the
629
+ capabilities your agent needs:
630
+
631
+ ```sh
632
+ mason tools add genie-one --name genie_one
633
+ mason tools add genie-agent SPACE_ID --name genie_agent
634
+ mason tools list --kind genie-one
635
+ mason tools list --kind genie-agent
636
+ mason tools remove genie_one
637
+ mason tools remove genie_agent
638
+ ```
639
+
640
+ `--name` is optional and defaults to `genie_one` or `genie_agent`, respectively. Both add commands
641
+ and `remove` accept `--source PATH` to select a project instead of the current directory. Discovery
642
+ needs no project; read that project's `agent.toml` to inspect configured bindings. For scripted
643
+ output, put the global `-o json` option before `tools`, as in
644
+ `mason -o json tools add genie-one --source ./my-agent`. Adding a binding is offline: it updates
645
+ `agent.toml` without contacting Genie or checking permissions. The corresponding sources are:
646
+
647
+ ```toml
648
+ [[tools]]
649
+ id = "genie_one"
650
+ source = { kind = "genie_one" }
651
+
652
+ [[tools]]
653
+ id = "genie_agent"
654
+ source = { kind = "genie_agent", space_id = "<your-space-id>" }
655
+ ```
656
+
657
+ Replace `SPACE_ID` or `<your-space-id>` with an existing space's 32-character lowercase hexadecimal
658
+ ID. `genie-one` connects to the workspace-wide MCP endpoint
659
+ `https://<workspace-hostname>/api/2.0/mcp/genie`, without a space suffix. `genie-agent` uses the
660
+ native Genie **Chat-mode** conversation API through the Databricks SDK, not the streaming
661
+ Agent-mode API or the per-space MCP endpoint.
662
+
663
+ Each native binding exposes `{id}_ask`, `{id}_poll`, and `{id}_query_result`, where `{id}` is its
664
+ binding name. Ask accepts an optional `conversation_id` for follow-ups. Ask and poll share a
665
+ 120-second budget per call, including client setup and submission. If the response is still
666
+ running, they return `timed_out` with the conversation and message IDs so the caller can poll
667
+ again. If submission times out before a message ID is received, ask returns
668
+ `INDETERMINATE_SUBMISSION`: the request may still complete, so do not resubmit automatically.
669
+ `NOT_SUBMITTED` means client setup timed out before sending the question. Query results include
670
+ the first 100 rows, column schema, a truncation indicator, and a deep link to the conversation.
671
+
672
+ Both framework modules, `databricks_mason.langgraph` and `databricks_mason.openai`, export
673
+ `genie_tools()`. New Mason-server templates use it automatically for native Genie Agent bindings;
674
+ Genie One uses the existing managed MCP helpers. In an existing Mason-server project, import
675
+ `genie_tools` from your framework module and add `*genie_tools()` to the agent's existing tool list.
676
+ The CLI does not patch existing Python code.
677
+
678
+ Both paths use Mason's existing authentication and routed workspace. Genie One requires the
679
+ Managed MCP Servers workspace preview; delegated access requires the `genie` OAuth scope.
680
+ The effective caller needs access to the data, the SQL warehouse, and the selected Genie space
681
+ where applicable. Mason does not grant permissions or promise a service-principal fallback when
682
+ caller credentials lack access. An offline add succeeding does not establish runtime access.
683
+
684
+ The opt-in live tests exercise both frameworks against the configured workspace and an existing
685
+ Genie space. From `integrations/mason`, with both framework extras installed:
686
+
687
+ ```sh
688
+ DATABRICKS_CONFIG_PROFILE=my-workspace RUN_MASON_GENIE_TESTS=1 \
689
+ MASON_GENIE_SPACE_ID=SPACE_ID \
690
+ uv run pytest tests/integration_tests/genie_tools_test.py
691
+ ```
692
+
693
+ By default they ask for the row count of `samples.nyctaxi.trips`. Set `MASON_GENIE_QUESTION` for
694
+ another dataset and `MASON_GENIE_EXPECTED_VALUE` to assert a known result cell.
695
+
696
+ ## Initialize the chat app demo
697
+
698
+ The chat app is a LangGraph-specific init overlay, not a command that mutates an existing project.
699
+ It is included by default for `--framework langgraph`; pass `--disable-chat-app` to scaffold the
700
+ API-only backend instead.
701
+
702
+ ```sh
703
+ mason init --framework langgraph \
704
+ --profile <profile> \
705
+ ./my-agent
706
+ cd ./my-agent
707
+ mason dev
708
+ ```
709
+
710
+ The chat app includes synchronous, SSE streaming, background polling, Session Store, Memory Store,
711
+ and HITL resume UI. The framework-specific overlay adds `ui/`, `runtime/ui.py`, the UI-enabled
712
+ `runtime/main.py`, and UI tests.
713
+
714
+ For the full deployed demo, bind both managed stores, then deploy:
715
+
716
+ ```sh
717
+ mason sessions bind mason-demo-sessions
718
+ mason memory bind mason-demo-memory
719
+ mason --profile <profile> deploy mason-agent-demo --source .
720
+ ```
721
+
722
+ (`bind` declares the store name in `agent.toml`; `mason deploy` creates any declared-but-missing
723
+ store and grants the app's service principal access to it. The memory store id flows to the runtime
724
+ via the `AGENT_MEMORY_STORE` env var, injected by `deploy` and `mason dev` — it is not persisted
725
+ in `agent.toml`.)
726
+
727
+ The chat UI generates a stable application session UUID in browser local storage, places it inside
728
+ the invocation's opaque `input`, and creates a fresh invocation UUID per turn. The
729
+ `__Host-databricks-app-router` cookie remains independent: API clients may reuse it for sticky
730
+ replica routing, but it is neither authentication nor the template's application session state.
731
+
732
+ The generated `README.md` documents every request the client makes: config discovery, sync and SSE
733
+ invocations, background submission and polling, session transcript loading, HITL resume, and memory
734
+ entry operations. Capability colors are automatic from `/api/demo/config`; only the
735
+ sync/streaming/background transport selector is manual.
736
+
737
+ ## Contributing
738
+
739
+ Developing Mason itself - the CLI, SDK/runtime, and templates - plus the local dev loop and how to
740
+ test unreleased changes on `mason dev` and `mason deploy`, is covered in
741
+ [CONTRIBUTING.md](CONTRIBUTING.md).