imbi-api 2.65.0__tar.gz → 2.67.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 (511) hide show
  1. {imbi_api-2.65.0 → imbi_api-2.67.0}/PKG-INFO +4 -3
  2. {imbi_api-2.65.0 → imbi_api-2.67.0}/pyproject.toml +4 -3
  3. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/agent_tools.py +9 -9
  4. imbi_api-2.67.0/src/imbi/api/ai_catalog_orgs.py +264 -0
  5. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/app.py +2 -0
  6. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/agent_api.py +90 -69
  7. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/agent_api_routes.py +45 -14
  8. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/authorization_codes.py +30 -17
  9. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/internal_services.py +18 -3
  10. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/organizations.py +3 -4
  11. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/seed.py +66 -11
  12. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/commit_sync/queue.py +12 -0
  13. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/commit_sync/service.py +18 -2
  14. imbi_api-2.67.0/src/imbi/api/component_governance_orgs.py +364 -0
  15. imbi_api-2.67.0/src/imbi/api/conversation_orgs.py +63 -0
  16. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/deployment_sweeper.py +8 -3
  17. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/deployment_sync/queue.py +12 -0
  18. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/deployment_sync/service.py +13 -5
  19. imbi_api-2.67.0/src/imbi/api/document_orgs.py +66 -0
  20. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/drift.py +41 -20
  21. imbi_api-2.67.0/src/imbi/api/drift_classifier.py +474 -0
  22. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/__init__.py +9 -7
  23. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_document_reads.py +31 -6
  24. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_helpers.py +53 -37
  25. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/admin_plugins.py +2 -1
  26. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/agent_platform.py +1 -7
  27. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/agents.py +203 -41
  28. imbi_api-2.67.0/src/imbi/api/endpoints/ai_model_defaults.py +281 -0
  29. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/ai_models.py +193 -137
  30. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/ai_providers.py +443 -149
  31. imbi_api-2.67.0/src/imbi/api/endpoints/ai_proxy.py +617 -0
  32. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/auth.py +105 -12
  33. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/client_credentials.py +2 -0
  34. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/components.py +269 -178
  35. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/document_analytics.py +5 -1
  36. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/documents.py +5 -9
  37. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/environments.py +20 -1
  38. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/harness.py +154 -28
  39. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/iggy_connectors.py +2 -2
  40. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/integration_workflow_steps.py +25 -5
  41. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/maintenance.py +115 -1
  42. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/mcp_servers.py +259 -25
  43. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/operations_log.py +15 -54
  44. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/organizations.py +139 -4
  45. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_analysis.py +114 -27
  46. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_deployments.py +69 -149
  47. imbi_api-2.67.0/src/imbi/api/endpoints/project_stars.py +96 -0
  48. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/projects.py +487 -35
  49. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/prompts.py +820 -303
  50. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/pull_requests.py +106 -44
  51. imbi_api-2.67.0/src/imbi/api/endpoints/release_periods.py +773 -0
  52. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/releases.py +69 -220
  53. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/sa_api_keys.py +2 -1
  54. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/secret_broker.py +106 -3
  55. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/service_accounts.py +15 -3
  56. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/ticket_harness.py +93 -25
  57. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/tickets.py +137 -26
  58. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/uploads.py +20 -2
  59. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/workflow_runs.py +162 -12
  60. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/workflows.py +29 -22
  61. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/entrypoint.py +5 -2
  62. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/__init__.py +2 -1
  63. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/platform.py +55 -35
  64. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/store.py +47 -7
  65. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/lifespans.py +3 -14
  66. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/llm/generate.py +99 -32
  67. imbi_api-2.67.0/src/imbi/api/llm/prompted.py +103 -0
  68. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/llm/tokens.py +8 -5
  69. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/maintenance/log.py +93 -6
  70. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/maintenance/operations.py +232 -230
  71. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/maintenance/registry.py +161 -90
  72. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/maintenance/worker.py +3 -1
  73. imbi_api-2.67.0/src/imbi/api/mcp_server_orgs.py +62 -0
  74. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/mcp_test.py +5 -107
  75. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/model_calls/__init__.py +12 -4
  76. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/model_calls/schemata.toml +37 -0
  77. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/models.py +0 -1
  78. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/pr_sync/queue.py +12 -0
  79. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/pr_sync/service.py +20 -3
  80. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/preferences/__init__.py +0 -1
  81. imbi_api-2.67.0/src/imbi/api/prompt_orgs.py +96 -0
  82. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/prompts/seed.py +3 -1
  83. imbi_api-2.67.0/src/imbi/api/release_periods.py +275 -0
  84. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/release_promote/service.py +17 -0
  85. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/secret_broker/broker.py +284 -68
  86. imbi_api-2.67.0/src/imbi/api/secret_broker/model_key.py +141 -0
  87. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/secret_broker/schemata.toml +28 -3
  88. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/secret_broker/store.py +27 -17
  89. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/settings.py +84 -7
  90. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/tickets/__init__.py +4 -0
  91. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/tickets/schemata.toml +96 -0
  92. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/tickets/store.py +284 -83
  93. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/workflows/__init__.py +3 -1
  94. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/workflows/runs.py +98 -20
  95. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/workflows/runtime_schemata.toml +10 -0
  96. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/workflows/sweeper.py +8 -0
  97. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_internal_services.py +25 -0
  98. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_oauth_server.py +191 -5
  99. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_organizations.py +139 -0
  100. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_seed.py +8 -4
  101. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_admin_plugins.py +29 -0
  102. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_agent_api.py +126 -15
  103. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_agent_platform.py +18 -18
  104. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_agent_task_actions.py +4 -0
  105. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_agent_task_harness.py +292 -6
  106. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_agent_task_log.py +6 -4
  107. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_agent_task_relations.py +1 -0
  108. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_agent_tasks.py +13 -0
  109. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_agents.py +205 -3
  110. imbi_api-2.67.0/tests/endpoints/test_ai_model_defaults.py +160 -0
  111. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_ai_models.py +112 -10
  112. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_ai_providers.py +683 -82
  113. imbi_api-2.67.0/tests/endpoints/test_ai_proxy.py +541 -0
  114. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_auth.py +49 -0
  115. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_components.py +37 -11
  116. imbi_api-2.67.0/tests/endpoints/test_components_graph.py +400 -0
  117. imbi_api-2.67.0/tests/endpoints/test_cross_org_reads.py +381 -0
  118. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_document_likes.py +1 -0
  119. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_document_presence.py +1 -0
  120. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_document_reads.py +33 -1
  121. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_document_reads_sql.py +10 -0
  122. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_document_templates.py +1 -0
  123. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_document_versions.py +1 -0
  124. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_documents.py +1 -0
  125. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_environments.py +84 -0
  126. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_harness.py +364 -20
  127. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_harness_egress.py +1 -0
  128. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_harness_secrets.py +97 -3
  129. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_iggy_connectors.py +1 -1
  130. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_integration_workflow_steps.py +74 -0
  131. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_integrations.py +1 -0
  132. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_link_definitions.py +1 -0
  133. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_maintenance.py +98 -1
  134. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_mcp_servers.py +161 -34
  135. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_operations_log.py +29 -230
  136. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_organizations.py +109 -2
  137. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_person_tickets.py +1 -0
  138. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_analysis.py +167 -0
  139. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_deployments.py +283 -247
  140. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_deployments_autonomous.py +7 -0
  141. imbi_api-2.67.0/tests/endpoints/test_project_stars.py +90 -0
  142. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_types.py +1 -0
  143. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_projects.py +233 -19
  144. imbi_api-2.67.0/tests/endpoints/test_projects_bulk_graph.py +122 -0
  145. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_projects_helpers.py +1 -1
  146. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_prompt_decisions.py +70 -50
  147. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_prompt_generative.py +120 -43
  148. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_prompts.py +537 -47
  149. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_pull_requests.py +105 -0
  150. imbi_api-2.67.0/tests/endpoints/test_release_periods_graph.py +460 -0
  151. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_releases.py +301 -711
  152. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_search.py +1 -0
  153. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_secret_broker.py +245 -0
  154. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_service_accounts.py +39 -0
  155. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_service_writeback.py +8 -1
  156. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_tags.py +1 -0
  157. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_teams.py +2 -0
  158. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_ticket_handoff.py +114 -0
  159. imbi_api-2.67.0/tests/endpoints/test_ticket_links.py +94 -0
  160. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_ticket_reopen.py +5 -0
  161. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_ticket_waiting.py +1 -0
  162. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_uploads.py +23 -0
  163. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_webhooks.py +2 -0
  164. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_workflow_run_history.py +11 -6
  165. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_workflow_runs.py +305 -3
  166. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_workflows.py +29 -5
  167. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/support.py +9 -0
  168. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_agent_platform.py +49 -39
  169. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_agent_tools.py +6 -6
  170. imbi_api-2.67.0/tests/test_ai_catalog_orgs.py +345 -0
  171. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_ai_provider_tokens.py +7 -4
  172. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_clickhouse_project_ids.py +1 -11
  173. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_commit_sync_queue.py +25 -0
  174. imbi_api-2.67.0/tests/test_deployment_array_drop.py +89 -0
  175. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_deployment_sweeper.py +11 -0
  176. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_deployment_sync_queue.py +26 -0
  177. imbi_api-2.67.0/tests/test_document_orgs.py +100 -0
  178. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_drift.py +37 -10
  179. imbi_api-2.67.0/tests/test_drift_classifier.py +407 -0
  180. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_entrypoint.py +17 -0
  181. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_maintenance_log.py +77 -0
  182. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_maintenance_operations.py +4 -118
  183. imbi_api-2.67.0/tests/test_mcp_server_orgs.py +80 -0
  184. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_model_calls.py +1 -0
  185. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_openapi.py +50 -0
  186. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_pr_sync_queue.py +25 -0
  187. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_pr_sync_service.py +10 -0
  188. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_projects_drift_ranges.py +1 -1
  189. imbi_api-2.67.0/tests/test_prompt_orgs.py +82 -0
  190. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_prompt_seed.py +4 -1
  191. imbi_api-2.67.0/tests/test_prompted.py +36 -0
  192. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_pull_requests_pending_deploy.py +87 -34
  193. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_release_promote_service.py +19 -0
  194. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_secret_broker.py +228 -1
  195. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_secret_identity.py +4 -0
  196. imbi_api-2.67.0/tests/test_secret_mcp_credential.py +160 -0
  197. imbi_api-2.65.0/src/imbi/api/backfill_embeddings.py +0 -136
  198. imbi_api-2.65.0/src/imbi/api/commit_pushed_at_repair.py +0 -249
  199. imbi_api-2.65.0/src/imbi/api/deployment_status_repair.py +0 -180
  200. imbi_api-2.65.0/src/imbi/api/graph_ids.py +0 -60
  201. imbi_api-2.65.0/src/imbi/api/llm/prompted.py +0 -47
  202. imbi_api-2.65.0/src/imbi/api/user_document_orgs.py +0 -100
  203. imbi_api-2.65.0/tests/endpoints/test_cross_org_reads.py +0 -302
  204. imbi_api-2.65.0/tests/test_backfill_embeddings.py +0 -181
  205. imbi_api-2.65.0/tests/test_commit_pushed_at_repair.py +0 -294
  206. imbi_api-2.65.0/tests/test_deployment_status_repair.py +0 -187
  207. imbi_api-2.65.0/tests/test_graph_ids.py +0 -82
  208. {imbi_api-2.65.0 → imbi_api-2.67.0}/.gitignore +0 -0
  209. {imbi_api-2.65.0 → imbi_api-2.67.0}/README.md +0 -0
  210. {imbi_api-2.65.0 → imbi_api-2.67.0}/moon.yml +0 -0
  211. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/README.md +0 -0
  212. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/__init__.py +0 -0
  213. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/__init__.py +0 -0
  214. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/autonomous.py +0 -0
  215. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/local_auth.py +0 -0
  216. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/login_providers.py +0 -0
  217. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/membership.py +0 -0
  218. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/models.py +0 -0
  219. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/oauth_clients.py +0 -0
  220. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/password.py +0 -0
  221. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/permissions.py +0 -0
  222. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/principals.py +0 -0
  223. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/sessions.py +0 -0
  224. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/tokens.py +0 -0
  225. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/auth/totp.py +0 -0
  226. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/blueprint_attributes.py +0 -0
  227. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/blueprint_compliance.py +0 -0
  228. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/blueprint_sections.py +0 -0
  229. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/blueprint_values.py +0 -0
  230. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/commit_sync/__init__.py +0 -0
  231. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/component_facts.py +0 -0
  232. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/cves.py +0 -0
  233. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/deployment_sync/__init__.py +0 -0
  234. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/documents/__init__.py +0 -0
  235. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/documents/read_sweeper.py +0 -0
  236. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/domain/__init__.py +0 -0
  237. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/domain/models.py +0 -0
  238. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/domain/scoring.py +0 -0
  239. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/__init__.py +0 -0
  240. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/client.py +0 -0
  241. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/dependencies.py +0 -0
  242. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/models.py +0 -0
  243. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/templates/base.html +0 -0
  244. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/templates/base.txt +0 -0
  245. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/templates/password_reset.html +0 -0
  246. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/templates/password_reset.txt +0 -0
  247. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/templates/welcome.html +0 -0
  248. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/templates/welcome.txt +0 -0
  249. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/email/templates.py +0 -0
  250. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_credentials.py +0 -0
  251. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_document_events.py +0 -0
  252. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_document_history.py +0 -0
  253. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_document_scope.py +0 -0
  254. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_json_fields.py +0 -0
  255. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_local_time.py +0 -0
  256. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_pagination.py +0 -0
  257. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_request_urls.py +0 -0
  258. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/_search_index.py +0 -0
  259. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/admin.py +0 -0
  260. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/agent_usage.py +0 -0
  261. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/api_keys.py +0 -0
  262. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/auth_providers.py +0 -0
  263. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/blueprints.py +0 -0
  264. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/comments.py +0 -0
  265. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/cves.py +0 -0
  266. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/dashboard.py +0 -0
  267. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/document_likes.py +0 -0
  268. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/document_presence.py +0 -0
  269. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/document_templates.py +0 -0
  270. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/document_versions.py +0 -0
  271. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/events.py +0 -0
  272. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/graph_query.py +0 -0
  273. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/integrations.py +0 -0
  274. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/link_definitions.py +0 -0
  275. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/local_auth.py +0 -0
  276. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/mfa.py +0 -0
  277. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/oauth_metadata.py +0 -0
  278. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/plugin_edges.py +0 -0
  279. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/plugin_entities.py +0 -0
  280. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/plugins.py +0 -0
  281. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_commit_sync.py +0 -0
  282. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_configuration.py +0 -0
  283. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_incidents.py +0 -0
  284. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_integrations.py +0 -0
  285. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_lifecycle.py +0 -0
  286. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_logs.py +0 -0
  287. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_plugins.py +0 -0
  288. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_pr_sync.py +0 -0
  289. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/project_types.py +0 -0
  290. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/roles.py +0 -0
  291. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/scoring.py +0 -0
  292. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/scoring_policies.py +0 -0
  293. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/search.py +0 -0
  294. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/status.py +0 -0
  295. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/tags.py +0 -0
  296. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/teams.py +0 -0
  297. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/user_activity.py +0 -0
  298. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/users.py +0 -0
  299. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/endpoints/webhooks.py +0 -0
  300. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/graph_sql.py +0 -0
  301. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/auth.py +0 -0
  302. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/egress.py +0 -0
  303. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/marketplaces.py +0 -0
  304. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/metrics.py +0 -0
  305. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/schemata.toml +0 -0
  306. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/sweeper.py +0 -0
  307. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/harness/tokens.py +0 -0
  308. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/__init__.py +0 -0
  309. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/attribution.py +0 -0
  310. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/endpoints.py +0 -0
  311. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/errors.py +0 -0
  312. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/flows.py +0 -0
  313. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/host_integration.py +0 -0
  314. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/models.py +0 -0
  315. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/repository.py +0 -0
  316. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/resolution.py +0 -0
  317. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/state.py +0 -0
  318. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/identity/sweeper.py +0 -0
  319. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/iggy_metrics.py +0 -0
  320. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/llm/__init__.py +0 -0
  321. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/llm/dependencies.py +0 -0
  322. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/maintenance/__init__.py +0 -0
  323. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/maintenance/state.py +0 -0
  324. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/middleware/__init__.py +0 -0
  325. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/middleware/rate_limit.py +0 -0
  326. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/openapi.py +0 -0
  327. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/orphan_releases.py +0 -0
  328. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/__init__.py +0 -0
  329. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/assignment_writer.py +0 -0
  330. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/assignments.py +0 -0
  331. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/credentials.py +0 -0
  332. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/installer.py +0 -0
  333. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/lifecycle.py +0 -0
  334. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/lifecycle_dispatch.py +0 -0
  335. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/release_dispatch.py +0 -0
  336. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/reload.py +0 -0
  337. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/resolution.py +0 -0
  338. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/plugins/schemas.py +0 -0
  339. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/pr_sync/__init__.py +0 -0
  340. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/preferences/schemata.toml +0 -0
  341. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/prompts/__init__.py +0 -0
  342. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/prompts/release_notes_system.md +0 -0
  343. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/py.typed +0 -0
  344. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/relationships.py +0 -0
  345. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/release_promote/__init__.py +0 -0
  346. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/release_promote/queue.py +0 -0
  347. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/sbom.py +0 -0
  348. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/scoring/__init__.py +0 -0
  349. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/scoring/queue.py +0 -0
  350. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/secret_broker/__init__.py +0 -0
  351. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/secret_broker/audit.py +0 -0
  352. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/secret_broker/identity.py +0 -0
  353. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/secret_broker/providers.py +0 -0
  354. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/storage/__init__.py +0 -0
  355. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/storage/client.py +0 -0
  356. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/storage/dependencies.py +0 -0
  357. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/storage/thumbnails.py +0 -0
  358. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/storage/validation.py +0 -0
  359. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/tags.py +0 -0
  360. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/teams.py +0 -0
  361. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/tickets/announce.py +0 -0
  362. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/tickets/custom_fields.py +0 -0
  363. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/tickets/log.py +0 -0
  364. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/tickets/sweeper.py +0 -0
  365. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/workflows/plugin_calls.py +0 -0
  366. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/workflows/schemata.toml +0 -0
  367. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/workflows/store.py +0 -0
  368. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/workflows/ticket_trigger.py +0 -0
  369. {imbi_api-2.65.0 → imbi_api-2.67.0}/src/imbi/api/workflows/tickets.py +0 -0
  370. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/__init__.py +0 -0
  371. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/__init__.py +0 -0
  372. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_authentication.py +0 -0
  373. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_authorization.py +0 -0
  374. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_encryption.py +0 -0
  375. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_login_providers.py +0 -0
  376. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_membership.py +0 -0
  377. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_permissions.py +0 -0
  378. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_sessions.py +0 -0
  379. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/auth/test_totp.py +0 -0
  380. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/clickhouse/__init__.py +0 -0
  381. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/clickhouse/test_client.py +0 -0
  382. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/clickhouse/test_init.py +0 -0
  383. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/clickhouse/test_privacy.py +0 -0
  384. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/email/__init__.py +0 -0
  385. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/email/test_audit_clickhouse.py +0 -0
  386. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/email/test_client.py +0 -0
  387. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/email/test_init.py +0 -0
  388. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/email/test_integration.py +0 -0
  389. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/email/test_models.py +0 -0
  390. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/email/test_templates.py +0 -0
  391. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/__init__.py +0 -0
  392. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_admin.py +0 -0
  393. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_agent_usage.py +0 -0
  394. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_api_keys.py +0 -0
  395. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_auth_providers.py +0 -0
  396. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_blueprints.py +0 -0
  397. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_caller_org_slugs.py +0 -0
  398. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_client_credentials.py +0 -0
  399. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_comments.py +0 -0
  400. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_comments_attention.py +0 -0
  401. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_credentials.py +0 -0
  402. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_cves.py +0 -0
  403. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_dashboard.py +0 -0
  404. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_document_analytics.py +0 -0
  405. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_events.py +0 -0
  406. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_github_app_repository.py +0 -0
  407. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_graph_query.py +0 -0
  408. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_init.py +0 -0
  409. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_integration_workflow_steps_choices.py +0 -0
  410. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_json_fields.py +0 -0
  411. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_local_auth.py +0 -0
  412. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_mfa.py +0 -0
  413. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_pagination.py +0 -0
  414. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_plugin_label_validation.py +0 -0
  415. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_plugins.py +0 -0
  416. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_commit_sync.py +0 -0
  417. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_configuration.py +0 -0
  418. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_incidents.py +0 -0
  419. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_integrations.py +0 -0
  420. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_lifecycle.py +0 -0
  421. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_logs.py +0 -0
  422. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_plugins.py +0 -0
  423. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_project_response_surfacing.py +0 -0
  424. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_request_urls.py +0 -0
  425. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_roles.py +0 -0
  426. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_sa_api_keys.py +0 -0
  427. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_scoring.py +0 -0
  428. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_scoring_policies.py +0 -0
  429. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_search_index.py +0 -0
  430. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_shared_identifier.py +0 -0
  431. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_status.py +0 -0
  432. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_ticket_agent_activity.py +0 -0
  433. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_ticket_attributes.py +0 -0
  434. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_ticket_custom_fields.py +0 -0
  435. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_ticket_units.py +0 -0
  436. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_user_activity.py +0 -0
  437. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_user_preferences.py +0 -0
  438. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_users.py +0 -0
  439. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/endpoints/test_workflow_triggers.py +0 -0
  440. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/marketplaces/claude-code.json +0 -0
  441. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_2_58/harness_schemata.toml +0 -0
  442. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_2_58/tickets_schemata.toml +0 -0
  443. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_a/harness_schemata.toml +0 -0
  444. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_a/tickets_schemata.toml +0 -0
  445. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_a_minus_1/agent_runtime_schemata.toml +0 -0
  446. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_a_minus_1/harness_schemata.toml +0 -0
  447. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_b/harness_schemata.toml +0 -0
  448. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_b/tickets_schemata.toml +0 -0
  449. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_b1/harness_schemata.toml +0 -0
  450. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/release_b1/tickets_schemata.toml +0 -0
  451. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/sbom/npm-realistic.json +0 -0
  452. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/sbom/pypi-realistic.json +0 -0
  453. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/fixtures/sbom/tiny.json +0 -0
  454. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/identity/__init__.py +0 -0
  455. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/identity/test_endpoints.py +0 -0
  456. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/identity/test_errors.py +0 -0
  457. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/identity/test_flows.py +0 -0
  458. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/identity/test_host_integration.py +0 -0
  459. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/identity/test_repository.py +0 -0
  460. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/identity/test_resolution.py +0 -0
  461. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/identity/test_state.py +0 -0
  462. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/identity/test_sweeper.py +0 -0
  463. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/marketplace_support.py +0 -0
  464. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/middleware/test_rate_limit.py +0 -0
  465. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/secret_support.py +0 -0
  466. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/storage/__init__.py +0 -0
  467. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/storage/test_client.py +0 -0
  468. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/storage/test_init.py +0 -0
  469. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/storage/test_thumbnails.py +0 -0
  470. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/storage/test_validation.py +0 -0
  471. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_agent_task_events_e2e.py +0 -0
  472. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_app.py +0 -0
  473. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_assignment_writer.py +0 -0
  474. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_auth_settings.py +0 -0
  475. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_blueprint_attributes.py +0 -0
  476. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_blueprint_compliance.py +0 -0
  477. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_blueprint_values.py +0 -0
  478. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_blueprints.py +0 -0
  479. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_commit_sync_service.py +0 -0
  480. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_component_facts.py +0 -0
  481. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_cves.py +0 -0
  482. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_deployment_sync_service.py +0 -0
  483. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_graph_sql.py +0 -0
  484. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_identity_attribution.py +0 -0
  485. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_iggy_metrics.py +0 -0
  486. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_init.py +0 -0
  487. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_installer.py +0 -0
  488. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_lifecycle_dispatch.py +0 -0
  489. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_lifespans.py +0 -0
  490. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_maintenance_state.py +0 -0
  491. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_maintenance_worker.py +0 -0
  492. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_models.py +0 -0
  493. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_orphan_releases.py +0 -0
  494. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_plugin_schemas.py +0 -0
  495. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_plugins.py +0 -0
  496. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_plugins_assignments.py +0 -0
  497. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_plugins_credentials.py +0 -0
  498. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_pull_request_resync_clickhouse.py +0 -0
  499. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_pull_request_reviews_clickhouse.py +0 -0
  500. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_release_dispatch.py +0 -0
  501. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_sbom.py +0 -0
  502. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_scoring_queue.py +0 -0
  503. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_scoring_triggers.py +0 -0
  504. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_secret_github_app.py +0 -0
  505. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_secret_providers.py +0 -0
  506. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_settings.py +0 -0
  507. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_tags.py +0 -0
  508. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_ticket_state_trigger.py +0 -0
  509. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_tickets_rename.py +0 -0
  510. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_workflow_reconcile.py +0 -0
  511. {imbi_api-2.65.0 → imbi_api-2.67.0}/tests/test_workflow_tickets.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: imbi-api
3
- Version: 2.65.0
3
+ Version: 2.67.0
4
4
  Summary: Imbi is the open-source service catalog that tracks every service's ownership, deployments, and health, and runs the AI agents and workflows that fix them.
5
5
  Author-email: Alex Campbell <alexc@aweber.com>, Dave Shawley <daves@aweber.com>, "Gavin M. Roy" <gavinr@aweber.com>
6
6
  License-Expression: BSD-3-Clause
@@ -18,14 +18,15 @@ Requires-Dist: authlib>=1.6.11
18
18
  Requires-Dist: cyclonedx-python-lib<12,>=11.7
19
19
  Requires-Dist: fastapi
20
20
  Requires-Dist: filetype
21
+ Requires-Dist: httpx2>=2.16.2
21
22
  Requires-Dist: httpx<1,>=0.28.1
22
23
  Requires-Dist: idna>=3.18
23
- Requires-Dist: imbi-common[databases,llm,mcp,script,sentry,server]==2.65.0
24
+ Requires-Dist: imbi-common[databases,llm,mcp,script,sentry,server]==2.67.0
24
25
  Requires-Dist: jinja2
25
26
  Requires-Dist: jsonpatch>=1.33
26
27
  Requires-Dist: jsonschema>=4.26
27
28
  Requires-Dist: limits<6,>=5
28
- Requires-Dist: mcp>=1.26.0
29
+ Requires-Dist: mcp>=2.3.0
29
30
  Requires-Dist: nanoid>=2.0.0
30
31
  Requires-Dist: orjson>=3.11.6
31
32
  Requires-Dist: pillow>=13.0.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "imbi-api"
3
- version = "2.65.0"
3
+ version = "2.67.0"
4
4
  description = "Imbi is the open-source service catalog that tracks every service's ownership, deployments, and health, and runs the AI agents and workflows that fix them."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.14"
@@ -28,13 +28,14 @@ dependencies = [
28
28
  "fastapi",
29
29
  "filetype",
30
30
  "httpx>=0.28.1,<1",
31
+ "httpx2>=2.16.2",
31
32
  "idna>=3.18",
32
- "imbi-common[databases,llm,mcp,script,sentry,server]==2.65.0",
33
+ "imbi-common[databases,llm,mcp,script,sentry,server]==2.67.0",
33
34
  "jinja2",
34
35
  "jsonpatch>=1.33",
35
36
  "jsonschema>=4.26",
36
37
  "limits>=5,<6",
37
- "mcp>=1.26.0",
38
+ "mcp>=2.3.0",
38
39
  "nanoid>=2.0.0",
39
40
  "orjson>=3.11.6",
40
41
  "pydantic[email]",
@@ -28,7 +28,7 @@ import typing
28
28
 
29
29
  import fastapi
30
30
  import fastmcp
31
- import httpx
31
+ import httpx2
32
32
  import pydantic
33
33
  from mcp import types as mcp_types
34
34
  from valkey import asyncio as valkey
@@ -216,13 +216,13 @@ def capability(annotations: mcp_types.ToolAnnotations | None) -> Capability:
216
216
  ``write``. A tool without the two hints gives ``unknown``.
217
217
  """
218
218
  if annotations is None or (
219
- annotations.readOnlyHint is None
220
- and annotations.destructiveHint is None
219
+ annotations.read_only_hint is None
220
+ and annotations.destructive_hint is None
221
221
  ):
222
222
  return 'unknown'
223
- if annotations.readOnlyHint:
223
+ if annotations.read_only_hint:
224
224
  return 'read'
225
- if annotations.destructiveHint:
225
+ if annotations.destructive_hint:
226
226
  return 'destructive'
227
227
  return 'write'
228
228
 
@@ -261,11 +261,11 @@ def _error_code(err: BaseException) -> ErrorCode:
261
261
  pending: list[BaseException] = [err]
262
262
  while pending:
263
263
  item = pending.pop()
264
- if isinstance(item, httpx.HTTPStatusError) and (
264
+ if isinstance(item, httpx2.HTTPStatusError) and (
265
265
  item.response.status_code in {401, 403}
266
266
  ):
267
267
  return 'auth_failed'
268
- if isinstance(item, TimeoutError | httpx.TimeoutException):
268
+ if isinstance(item, TimeoutError | httpx2.TimeoutException):
269
269
  return 'timeout'
270
270
  if isinstance(item, BaseExceptionGroup):
271
271
  group = typing.cast('BaseExceptionGroup[BaseException]', item)
@@ -276,7 +276,7 @@ def _error_code(err: BaseException) -> ErrorCode:
276
276
 
277
277
 
278
278
  def _imbi_server(
279
- spec: dict[str, typing.Any], client: httpx.AsyncClient
279
+ spec: dict[str, typing.Any], client: httpx2.AsyncClient
280
280
  ) -> fastmcp.FastMCP[typing.Any]:
281
281
  """Make the Imbi tools as imbi-mcp and imbi-assistant do."""
282
282
  return fastmcp.FastMCP.from_openapi(
@@ -296,7 +296,7 @@ async def build_catalog(spec: dict[str, typing.Any]) -> AgentToolCatalog:
296
296
  )
297
297
  try:
298
298
  # The client is not used: no tool is called.
299
- async with httpx.AsyncClient() as client:
299
+ async with httpx2.AsyncClient() as client:
300
300
  # The parse of a large document blocks, so do it in a
301
301
  # thread.
302
302
  server = await asyncio.to_thread(_imbi_server, spec, client)
@@ -0,0 +1,264 @@
1
+ """Move the global AI model catalog into the organizations (ADR 0018).
2
+
3
+ Before 2.66, ``AIProvider`` and ``AIModel`` nodes were global. Now each
4
+ one belongs to one organization. :func:`migrate` copies each global
5
+ provider (with its timestamps) and each global model to every
6
+ organization, as new nodes with new ids, then deletes the global nodes.
7
+ Only the copy in the owner organization keeps the stored key and its
8
+ hint: a key that each organization holds is a key that each
9
+ organization admin can spend and send elsewhere. The same holds for
10
+ the AWS credentials of the process: a Bedrock provider with no key and
11
+ no workload identity gets ``use_platform_credentials`` in the owner
12
+ organization only. The owner is the organization that
13
+ :data:`OWNER_ENV` names, or the only organization.
14
+ A copy of a model keeps only the ``ALLOWED_FOR`` edges to the teams of
15
+ its organization. Only the copy in the organization of a workload
16
+ identity keeps it: each other organization sets up its own. Slugs do
17
+ not change.
18
+
19
+ The ``ai-catalog-org-copy`` maintenance operation runs it, in one
20
+ transaction under an advisory lock, so two runs do not copy twice.
21
+ When no global node is left, it does nothing. With no organization, it
22
+ keeps the global nodes.
23
+ """
24
+
25
+ import json
26
+ import logging
27
+ import os
28
+ import typing
29
+
30
+ import nanoid
31
+
32
+ from imbi.api.graph_sql import props_template
33
+ from imbi.common import graph
34
+ from imbi.common.llm import drivers
35
+
36
+ LOGGER = logging.getLogger(__name__)
37
+
38
+ _LOCK = 'imbi.api.ai_catalog_orgs'
39
+
40
+ #: The slug of the organization whose copy of each provider keeps the
41
+ #: stored key. Needed when more than one organization exists.
42
+ OWNER_ENV = 'IMBI_AI_CATALOG_OWNER_ORG'
43
+
44
+ #: The provider properties that hold the stored key.
45
+ _KEY_PROPS: dict[str, None] = {
46
+ 'credentials_encrypted': None,
47
+ 'credential_hint': None,
48
+ 'credential_updated_at': None,
49
+ }
50
+
51
+ _ORGS_QUERY: typing.LiteralString = """
52
+ MATCH (o:Organization)
53
+ RETURN o.id AS id, o.slug AS slug
54
+ """
55
+
56
+ _GLOBAL_PROVIDERS_QUERY: typing.LiteralString = """
57
+ MATCH (p:AIProvider)
58
+ WHERE p.org_id IS NULL
59
+ RETURN p
60
+ """
61
+
62
+ _GLOBAL_MODELS_QUERY: typing.LiteralString = """
63
+ MATCH (m:AIModel)
64
+ WHERE m.org_id IS NULL
65
+ OPTIONAL MATCH (m)-[:SERVED_BY]->(p:AIProvider)
66
+ RETURN m, p.id AS provider_id
67
+ """
68
+
69
+ _MODEL_TEAMS_QUERY: typing.LiteralString = """
70
+ MATCH (:AIModel {{id: {id}}})-[:ALLOWED_FOR]->(t:Team)
71
+ -[:BELONGS_TO]->(o:Organization)
72
+ RETURN t.id AS team_id, o.id AS org_id
73
+ """
74
+
75
+ _ADD_TEAM_QUERY: typing.LiteralString = """
76
+ MATCH (m:AIModel {{id: {id}}})
77
+ MATCH (t:Team {{id: {team_id}}})
78
+ CREATE (m)-[:ALLOWED_FOR]->(t)
79
+ RETURN t.id AS id
80
+ """
81
+
82
+ _DELETE_GLOBAL_MODELS_QUERY: typing.LiteralString = """
83
+ MATCH (m:AIModel)
84
+ WHERE m.org_id IS NULL
85
+ DETACH DELETE m
86
+ """
87
+
88
+ _DELETE_GLOBAL_PROVIDERS_QUERY: typing.LiteralString = """
89
+ MATCH (p:AIProvider)
90
+ WHERE p.org_id IS NULL
91
+ DETACH DELETE p
92
+ """
93
+
94
+
95
+ class OwnerUnknown(ValueError):
96
+ """No owner organization is known. The message is user-safe."""
97
+
98
+
99
+ def _value(record: dict[str, typing.Any], key: str) -> typing.Any:
100
+ return graph.parse_agtype(record[key])
101
+
102
+
103
+ async def migrate(db: graph.Graph, owner: str | None = None) -> int:
104
+ """Copy the global AI catalog to every organization.
105
+
106
+ Parameters:
107
+ owner: The slug of the organization whose copies keep the
108
+ stored keys. Default: :data:`OWNER_ENV`. Optional when only
109
+ one organization exists.
110
+
111
+ Returns:
112
+ The number of global nodes that were replaced.
113
+
114
+ Raises:
115
+ OwnerUnknown: Global nodes exist, and ``owner`` is not set with
116
+ more than one organization, or names no organization.
117
+ Nothing is copied.
118
+
119
+ """
120
+ owner = owner or os.environ.get(OWNER_ENV) or None
121
+ return await db.locked(_LOCK, lambda execute: _copy(execute, owner))
122
+
123
+
124
+ def _owner_id(orgs: dict[str, str], owner: str | None) -> str:
125
+ """The id of the owner organization, from ``{slug: id}``."""
126
+ if owner:
127
+ if owner not in orgs:
128
+ raise OwnerUnknown(f'{OWNER_ENV}: no organization {owner!r}')
129
+ return orgs[owner]
130
+ if len(orgs) == 1:
131
+ return next(iter(orgs.values()))
132
+ raise OwnerUnknown(
133
+ f'Set {OWNER_ENV} to the slug of the organization that keeps the '
134
+ 'stored AI provider keys'
135
+ )
136
+
137
+
138
+ async def _copy(execute: graph.CypherExecute, owner: str | None) -> int:
139
+ providers = [
140
+ _value(r, 'p')
141
+ for r in await execute(_GLOBAL_PROVIDERS_QUERY, {}, ['p'])
142
+ ]
143
+ found = await execute(_GLOBAL_MODELS_QUERY, {}, ['m', 'provider_id'])
144
+ if not providers and not found:
145
+ return 0
146
+ orgs = {
147
+ str(_value(r, 'slug')): str(_value(r, 'id'))
148
+ for r in await execute(_ORGS_QUERY, {}, ['id', 'slug'])
149
+ }
150
+ if not orgs:
151
+ LOGGER.warning(
152
+ 'No organization exists; the global AI catalog stays global'
153
+ )
154
+ return 0
155
+ owner_id = _owner_id(orgs, owner)
156
+ org_ids = list(orgs.values())
157
+
158
+ # (global provider id, org id) -> id of the copy
159
+ copies: dict[tuple[str, str], str] = {}
160
+ for props in providers:
161
+ for org_id in org_ids:
162
+ copies[props['id'], org_id] = await _create(
163
+ execute,
164
+ 'AIProvider',
165
+ _provider_in(props, org_id, owner_id),
166
+ org_id,
167
+ )
168
+ for record in found:
169
+ props = _value(record, 'm')
170
+ provider_id = _value(record, 'provider_id')
171
+ if not provider_id:
172
+ LOGGER.warning(
173
+ 'AI model %s has no provider; it is not copied', props['id']
174
+ )
175
+ continue
176
+ teams = await execute(
177
+ _MODEL_TEAMS_QUERY, {'id': props['id']}, ['team_id', 'org_id']
178
+ )
179
+ for org_id in org_ids:
180
+ model_id = await _create(
181
+ execute,
182
+ 'AIModel',
183
+ props,
184
+ org_id,
185
+ copies[str(provider_id), org_id],
186
+ )
187
+ for team in teams:
188
+ if str(_value(team, 'org_id')) == org_id:
189
+ await execute(
190
+ _ADD_TEAM_QUERY,
191
+ {'id': model_id, 'team_id': _value(team, 'team_id')},
192
+ ['id'],
193
+ )
194
+ await execute(_DELETE_GLOBAL_MODELS_QUERY, {})
195
+ await execute(_DELETE_GLOBAL_PROVIDERS_QUERY, {})
196
+ total = len(providers) + len(found)
197
+ LOGGER.info(
198
+ 'Copied %d global AI providers and models to %d organizations',
199
+ total,
200
+ len(org_ids),
201
+ )
202
+ return total
203
+
204
+
205
+ def _provider_in(
206
+ props: dict[str, typing.Any], org_id: str, owner_id: str
207
+ ) -> dict[str, typing.Any]:
208
+ """The properties of the copy of a provider in ``org_id``.
209
+
210
+ Only the copy in the owner organization keeps the stored key, and
211
+ only the copy in the organization of a workload identity keeps it.
212
+ A provider that used the AWS credentials of the process (Bedrock
213
+ with no key and no workload identity) keeps them only in the owner
214
+ organization, with ``use_platform_credentials``.
215
+ """
216
+ copy = dict(props)
217
+ if org_id != owner_id:
218
+ copy.update(_KEY_PROPS)
219
+ else:
220
+ info = drivers.get_driver(str(props.get('driver')))
221
+ copy['use_platform_credentials'] = bool(
222
+ info is not None
223
+ and info.ambient_auth
224
+ and not props.get('credentials_encrypted')
225
+ and not props.get('workload_identity')
226
+ )
227
+ raw = props.get('workload_identity')
228
+ if raw:
229
+ wif = json.loads(raw) if isinstance(raw, str) else raw
230
+ if wif.get('organization_id') != org_id:
231
+ copy['workload_identity'] = None
232
+ return copy
233
+
234
+
235
+ async def _create(
236
+ execute: graph.CypherExecute,
237
+ label: typing.Literal['AIModel', 'AIProvider'],
238
+ props: dict[str, typing.Any],
239
+ org_id: str,
240
+ provider_id: str | None = None,
241
+ ) -> str:
242
+ """Create a copy of a global node in the organization ``org_id``.
243
+
244
+ A model copy is served by ``provider_id``, the copy of its provider.
245
+ """
246
+ new_id = nanoid.generate()
247
+ copy = {**props, 'id': new_id, 'org_id': org_id}
248
+ served_by: typing.LiteralString = (
249
+ ''
250
+ if provider_id is None
251
+ else (
252
+ ' WITH n, o MATCH (p:AIProvider {{id: {provider_id}}})'
253
+ ' CREATE (n)-[:SERVED_BY]->(p)'
254
+ )
255
+ )
256
+ query: typing.LiteralString = (
257
+ 'MATCH (o:Organization {{id: {org_id}}})'
258
+ f' CREATE (n:{label} {props_template(copy)})'
259
+ ' CREATE (n)-[:BELONGS_TO]->(o)'
260
+ f'{served_by}'
261
+ ' RETURN n.id AS id'
262
+ )
263
+ await execute(query, {**copy, 'provider_id': provider_id}, ['id'])
264
+ return new_id
@@ -24,6 +24,7 @@ from imbi.api import (
24
24
  workflows,
25
25
  )
26
26
  from imbi.api.auth import agent_api
27
+ from imbi.api.endpoints import ai_proxy
27
28
  from imbi.api.middleware import rate_limit
28
29
  from imbi.common import (
29
30
  access_log,
@@ -68,6 +69,7 @@ def create_app() -> fastapi.FastAPI:
68
69
  harness.store_lifespan,
69
70
  workflows.store_lifespan,
70
71
  model_calls.store_lifespan,
72
+ ai_proxy.vendor_client_lifespan,
71
73
  preferences.schema_lifespan,
72
74
  prompt_pool.pool_lifespan,
73
75
  lifespans.script_preview_hook,
@@ -27,9 +27,15 @@ route and refuses it:
27
27
  organization parameter must be in :data:`GLOBAL_SAFE`, with the
28
28
  reason that it gives no data of another organization.
29
29
 
30
- Only an agent API token request reads the database (the project
31
- check); other requests pay nothing. A renamed organization refuses the
32
- token until the next heartbeat renews it.
30
+ A user token with an ``org_slug`` claim (imbi-slackbot mints one per
31
+ Slack workspace organization, #1027) gets the same organization and
32
+ project checks, on every route: a route with no organization in its
33
+ path must be in :data:`GLOBAL_SAFE`. The other route rules apply only
34
+ to agent API tokens; the user's own permissions still apply.
35
+
36
+ Only these two token kinds read the database (the project check);
37
+ other requests pay nothing. A renamed organization refuses the token
38
+ until a new one is minted.
33
39
 
34
40
  The check uses the endpoint that the router matched, not the URL, so
35
41
  an encoded path cannot slip past it.
@@ -43,7 +49,7 @@ from fastapi import routing
43
49
 
44
50
  from imbi.api.auth.agent_api_routes import ALLOWED_ROUTES, REFUSED_ROUTES
45
51
  from imbi.common import graph, lifespan
46
- from imbi.common.auth import core, permissions
52
+ from imbi.common.auth import core
47
53
 
48
54
  #: Every route of these endpoint modules refuses the token.
49
55
  REFUSED_MODULES = frozenset(
@@ -52,6 +58,8 @@ REFUSED_MODULES = frozenset(
52
58
  'imbi.api.endpoints.admin_plugins',
53
59
  'imbi.api.endpoints.ticket_harness',
54
60
  'imbi.api.endpoints.ai_providers',
61
+ # Model calls with the credentials of AI providers (#1046).
62
+ 'imbi.api.endpoints.ai_proxy',
55
63
  'imbi.api.endpoints.api_keys',
56
64
  'imbi.api.endpoints.auth',
57
65
  'imbi.api.endpoints.auth_providers',
@@ -90,10 +98,6 @@ GLOBAL_SAFE: dict[str, str] = {
90
98
  'GET /status': 'service status',
91
99
  'GET /users/me': 'the caller itself',
92
100
  'GET /users/me/permissions': 'the caller itself',
93
- 'POST /operations-log/': (
94
- 'the handler refuses an agent entry for a project of another '
95
- 'organization (require_own_project)'
96
- ),
97
101
  'GET /scores/history-by-team': (
98
102
  'the required org query parameter is checked'
99
103
  ),
@@ -113,13 +117,6 @@ MATCH (p:Project {{id: {project_id}}})
113
117
  RETURN p.id AS id
114
118
  LIMIT 1
115
119
  """
116
- _PROJECT_IN_ORG_ID: typing.LiteralString = """
117
- MATCH (p:Project {{id: {project_id}}})
118
- -[:OWNED_BY]->(:Team)
119
- -[:BELONGS_TO]->(:Organization {{id: {org_id}}})
120
- RETURN p.id AS id
121
- LIMIT 1
122
- """
123
120
 
124
121
 
125
122
  def refused(module: str, method: str, key: str | None = None) -> bool:
@@ -152,13 +149,27 @@ def index(app: fastapi.FastAPI, prefix: str) -> None:
152
149
  app.state.agent_api_routes = route_keys(app, prefix)
153
150
 
154
151
 
155
- def _forbidden(message: str) -> fastapi.HTTPException:
152
+ def _forbidden(
153
+ message: str, error: str = 'agent_api_forbidden'
154
+ ) -> fastapi.HTTPException:
156
155
  return fastapi.HTTPException(
157
- status_code=403,
158
- detail={'error': 'agent_api_forbidden', 'message': message},
156
+ status_code=403, detail={'error': error, 'message': message}
159
157
  )
160
158
 
161
159
 
160
+ def _user_token_org(token: str) -> str | None:
161
+ """The ``org_slug`` claim of a valid user access token, if any. An
162
+ invalid token (or an ``ik_`` API key) gives ``None``: the
163
+ authentication decides."""
164
+ try:
165
+ claims = core.verify_token(token)
166
+ except jwt.InvalidTokenError:
167
+ return None
168
+ if claims.get('type') != 'access':
169
+ return None
170
+ return claims.get('org_slug') or None
171
+
172
+
162
173
  def _bearer(request: fastapi.Request) -> str | None:
163
174
  scheme, _, token = request.headers.get('authorization', '').partition(' ')
164
175
  return token.strip() if scheme.lower() == 'bearer' else None
@@ -188,46 +199,60 @@ async def _project_in(
188
199
  )
189
200
 
190
201
 
191
- async def require_own_project(
192
- db: graph.Graph | None,
193
- auth: permissions.AuthContext,
194
- project_id: str | None,
195
- ) -> None:
196
- """For an agent API token: ``project_id`` must name a project of
197
- the token's organization. For a handler whose project is in the
198
- body. Other callers pass.
202
+ def _org_scoped(key: str | None) -> bool:
203
+ """Whether the route names the organization in its path."""
204
+ return key is not None and (
205
+ '{org_slug}' in key or ' /organizations/{slug}' in key
206
+ )
199
207
 
200
- Raises:
201
- 403: An agent entry without a project.
202
- 404: The project is not in the token's organization.
203
208
 
204
- """
205
- if auth.auth_method != 'agent_api':
206
- return
207
- if not project_id:
208
- raise _forbidden('An agent API token needs a project here')
209
- await _project_in(
210
- db,
211
- _PROJECT_IN_ORG_ID,
212
- {'project_id': project_id, 'org_id': str(auth.organization_id)},
213
- )
209
+ async def _require_org(
210
+ request: fastapi.Request,
211
+ db: graph.Graph | None,
212
+ module: str,
213
+ org_slug: str,
214
+ error: str,
215
+ ) -> None:
216
+ """The path and ``org`` query organization must be ``org_slug``,
217
+ and a path project must be in it."""
218
+ params = request.path_params
219
+ for slug in (
220
+ params.get('org_slug'),
221
+ params.get('slug')
222
+ if module == 'imbi.api.endpoints.organizations'
223
+ else None,
224
+ request.query_params.get('org'),
225
+ ):
226
+ if slug is not None and slug != org_slug:
227
+ raise _forbidden(
228
+ f'The token is not for organization {slug!r}', error
229
+ )
230
+ if 'project_id' in params:
231
+ await _project_in(
232
+ db,
233
+ _PROJECT_IN_ORG,
234
+ {'project_id': str(params['project_id']), 'org_slug': org_slug},
235
+ )
214
236
 
215
237
 
216
238
  async def guard(
217
239
  request: fastapi.Request,
218
240
  db: typing.Annotated[graph.Graph | None, fastapi.Depends(graph_for)],
219
241
  ) -> None:
220
- """Refuse an agent API token where it must not work.
242
+ """Refuse an agent API token where it must not work, and a user
243
+ token of one organization outside that organization.
221
244
 
222
245
  Raises:
223
- 401: The token is not valid or has expired.
246
+ 401: The agent API token is not valid or has expired.
224
247
  403: ``agent_api_forbidden``: a refused route, or another
225
- organization.
248
+ organization. ``organization_forbidden``: a user token of
249
+ one organization on another organization, or on a route
250
+ with no organization that is not in :data:`GLOBAL_SAFE`.
226
251
  404: The path's project is not in the token's organization.
227
252
 
228
253
  """
229
254
  token = _bearer(request)
230
- if not token or not core.is_agent_api_token(token):
255
+ if not token:
231
256
  return
232
257
  endpoint = request.scope.get('endpoint')
233
258
  module = str(getattr(endpoint, '__module__', ''))
@@ -235,30 +260,26 @@ async def guard(
235
260
  request.app.state, 'agent_api_routes', {}
236
261
  )
237
262
  key = keys.get((endpoint, request.method))
238
- if refused(module, request.method, key) or key not in ALLOWED_ROUTES:
239
- raise _forbidden('An agent API token cannot use this route')
240
- try:
241
- claims = core.verify_agent_api_token(token)
242
- except jwt.InvalidTokenError as err:
243
- raise fastapi.HTTPException(
244
- status_code=401, detail='Invalid token'
245
- ) from err
246
- params = request.path_params
247
- for slug in (
248
- params.get('org_slug'),
249
- params.get('slug')
250
- if module == 'imbi.api.endpoints.organizations'
251
- else None,
252
- request.query_params.get('org'),
253
- ):
254
- if slug is not None and slug != claims['org_slug']:
255
- raise _forbidden(f'The token is not for organization {slug!r}')
256
- if 'project_id' in params:
257
- await _project_in(
258
- db,
259
- _PROJECT_IN_ORG,
260
- {
261
- 'project_id': str(params['project_id']),
262
- 'org_slug': str(claims['org_slug']),
263
- },
263
+ org_slug: str | None
264
+ if core.is_agent_api_token(token):
265
+ error = 'agent_api_forbidden'
266
+ if refused(module, request.method, key) or key not in ALLOWED_ROUTES:
267
+ raise _forbidden('An agent API token cannot use this route')
268
+ try:
269
+ org_slug = str(core.verify_agent_api_token(token)['org_slug'])
270
+ except jwt.InvalidTokenError as err:
271
+ raise fastapi.HTTPException(
272
+ status_code=401, detail='Invalid token'
273
+ ) from err
274
+ else:
275
+ error = 'organization_forbidden'
276
+ org_slug = _user_token_org(token)
277
+ if org_slug is None:
278
+ return
279
+ # The tests keep every allowed agent route that has no organization
280
+ # in GLOBAL_SAFE, so this refuses only user tokens.
281
+ if not _org_scoped(key) and key not in GLOBAL_SAFE:
282
+ raise _forbidden(
283
+ f'This token works only in organization {org_slug!r}', error
264
284
  )
285
+ await _require_org(request, db, module, org_slug, error)