abt-core 0.0.1__py3-none-any.whl

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 (613) hide show
  1. abt/__init__.py +111 -0
  2. abt/_tool.py +161 -0
  3. abt/adapters/README.md +11 -0
  4. abt/adapters/__init__.py +5 -0
  5. abt/adapters/_config.py +24 -0
  6. abt/adapters/confluence/__init__.py +404 -0
  7. abt/adapters/confluence/client.py +73 -0
  8. abt/adapters/confluence/context_fetch.py +36 -0
  9. abt/adapters/confluence/context_provider.py +35 -0
  10. abt/adapters/email/__init__.py +166 -0
  11. abt/adapters/github/__init__.py +225 -0
  12. abt/adapters/github/client.py +393 -0
  13. abt/adapters/github/context_fetch.py +28 -0
  14. abt/adapters/github/context_provider.py +43 -0
  15. abt/adapters/jira/__init__.py +144 -0
  16. abt/adapters/jira/_common.py +573 -0
  17. abt/adapters/jira/approvals_comment.py +400 -0
  18. abt/adapters/jira/approvals_status.py +461 -0
  19. abt/adapters/local/__init__.py +73 -0
  20. abt/adapters/slack/__init__.py +349 -0
  21. abt/adapters/slack/approvals.py +764 -0
  22. abt/artifacts/__init__.py +73 -0
  23. abt/artifacts/agent_wire.py +107 -0
  24. abt/artifacts/compile.py +232 -0
  25. abt/artifacts/compile_cache.py +88 -0
  26. abt/artifacts/compile_workflow/__init__.py +30 -0
  27. abt/artifacts/compile_workflow/phase_agents.py +397 -0
  28. abt/artifacts/compile_workflow/phase_context.py +96 -0
  29. abt/artifacts/compile_workflow/phase_discovery.py +204 -0
  30. abt/artifacts/compile_workflow/phase_finalize.py +615 -0
  31. abt/artifacts/compile_workflow/phase_mcp_validation.py +243 -0
  32. abt/artifacts/compile_workflow/phase_selective.py +164 -0
  33. abt/artifacts/compile_workflow/phase_template_vars.py +205 -0
  34. abt/artifacts/compile_workflow/phase_wire.py +173 -0
  35. abt/artifacts/compile_workflow/required_scope.py +251 -0
  36. abt/artifacts/compile_workflow/template_sources.py +66 -0
  37. abt/artifacts/compile_workflow/types.py +121 -0
  38. abt/artifacts/compile_workflow/workflow.py +142 -0
  39. abt/artifacts/compiled_writer.py +122 -0
  40. abt/artifacts/context_files.py +75 -0
  41. abt/artifacts/context_workflow.py +339 -0
  42. abt/artifacts/discovery.py +330 -0
  43. abt/artifacts/io.py +49 -0
  44. abt/artifacts/models.py +298 -0
  45. abt/artifacts/partial_parse.py +648 -0
  46. abt/artifacts/prompts.py +181 -0
  47. abt/artifacts/run_config.py +72 -0
  48. abt/artifacts/selective_local_context_bfs.py +107 -0
  49. abt/bench/__init__.py +19 -0
  50. abt/bench/baseline.py +130 -0
  51. abt/bench/changed.py +94 -0
  52. abt/bench/checks.py +46 -0
  53. abt/bench/execute.py +153 -0
  54. abt/bench/export.py +40 -0
  55. abt/bench/loader.py +166 -0
  56. abt/bench/models.py +119 -0
  57. abt/bench/report.py +602 -0
  58. abt/bench/results.py +184 -0
  59. abt/bench/run.py +648 -0
  60. abt/bench/stats.py +267 -0
  61. abt/bootstrap.py +234 -0
  62. abt/checkpoint/__init__.py +33 -0
  63. abt/checkpoint/backends/__init__.py +1 -0
  64. abt/checkpoint/backends/bedrock_agentcore.py +118 -0
  65. abt/checkpoint/backends/dynamodb.py +241 -0
  66. abt/checkpoint/backends/memory.py +30 -0
  67. abt/checkpoint/backends/sqlite.py +62 -0
  68. abt/checkpoint/execute_context.py +261 -0
  69. abt/checkpoint/protocols.py +41 -0
  70. abt/checkpoint/registry.py +204 -0
  71. abt/checkpoint/spec.py +145 -0
  72. abt/checkpoint/thread_id.py +47 -0
  73. abt/cli/__init__.py +101 -0
  74. abt/cli/_abt_errors.py +20 -0
  75. abt/cli/_flags.py +154 -0
  76. abt/cli/_lazy_group.py +86 -0
  77. abt/cli/_logging.py +19 -0
  78. abt/cli/_options.py +247 -0
  79. abt/cli/_render/__init__.py +1 -0
  80. abt/cli/_render/discover_render.py +125 -0
  81. abt/cli/_render/dry_run_render.py +108 -0
  82. abt/cli/_reporter.py +185 -0
  83. abt/cli/_routing_preview.py +35 -0
  84. abt/cli/_run_common.py +68 -0
  85. abt/cli/_scaffold_prompts.py +195 -0
  86. abt/cli/_shim.py +134 -0
  87. abt/cli/_stateless.py +32 -0
  88. abt/cli/_ui.py +113 -0
  89. abt/cli/approvals.py +188 -0
  90. abt/cli/bench.py +135 -0
  91. abt/cli/chat.py +195 -0
  92. abt/cli/clean.py +55 -0
  93. abt/cli/compile.py +262 -0
  94. abt/cli/config.py +160 -0
  95. abt/cli/create.py +128 -0
  96. abt/cli/debug.py +72 -0
  97. abt/cli/deps.py +67 -0
  98. abt/cli/discover.py +147 -0
  99. abt/cli/dispatch.py +291 -0
  100. abt/cli/docs.py +290 -0
  101. abt/cli/doctor.py +262 -0
  102. abt/cli/graph.py +36 -0
  103. abt/cli/init.py +232 -0
  104. abt/cli/lint.py +62 -0
  105. abt/cli/list.py +286 -0
  106. abt/cli/modify.py +119 -0
  107. abt/cli/project_root.py +7 -0
  108. abt/cli/publish.py +64 -0
  109. abt/cli/run.py +272 -0
  110. abt/cli/test.py +140 -0
  111. abt/cli/watch/__init__.py +26 -0
  112. abt/cli/watch/_service.py +222 -0
  113. abt/cli/watch/consume.py +322 -0
  114. abt/cli/watch/dlq.py +96 -0
  115. abt/cli/watch/list.py +77 -0
  116. abt/cli/watch/produce.py +140 -0
  117. abt/cli/watch/run.py +152 -0
  118. abt/commands/__init__.py +22 -0
  119. abt/commands/_run_lifecycle.py +218 -0
  120. abt/commands/approvals.py +162 -0
  121. abt/commands/chat/__init__.py +0 -0
  122. abt/commands/chat/session.py +351 -0
  123. abt/commands/chat/sources.py +143 -0
  124. abt/commands/chat/state.py +188 -0
  125. abt/commands/chat/turn.py +144 -0
  126. abt/commands/clean.py +387 -0
  127. abt/commands/compile.py +272 -0
  128. abt/commands/config_show.py +344 -0
  129. abt/commands/create.py +76 -0
  130. abt/commands/debug.py +215 -0
  131. abt/commands/discover.py +252 -0
  132. abt/commands/dispatch_flags.py +66 -0
  133. abt/commands/dispatch_run/__init__.py +19 -0
  134. abt/commands/dispatch_run/compose_phase.py +323 -0
  135. abt/commands/dispatch_run/confirmation_wiring.py +80 -0
  136. abt/commands/dispatch_run/coordinator.py +95 -0
  137. abt/commands/dispatch_run/exposure_dispatch.py +53 -0
  138. abt/commands/dispatch_run/node_lifecycle.py +125 -0
  139. abt/commands/dispatch_run/pause_state.py +125 -0
  140. abt/commands/dispatch_run/resume.py +313 -0
  141. abt/commands/dispatch_run/types.py +11 -0
  142. abt/commands/dispatch_run/workflow_phase.py +727 -0
  143. abt/commands/docs.py +94 -0
  144. abt/commands/doctor.py +73 -0
  145. abt/commands/dry_run.py +223 -0
  146. abt/commands/flags.py +538 -0
  147. abt/commands/graph_render.py +637 -0
  148. abt/commands/init.py +265 -0
  149. abt/commands/init_templates/__init__.py +27 -0
  150. abt/commands/init_templates/_common.py +162 -0
  151. abt/commands/init_templates/advanced.py +503 -0
  152. abt/commands/init_templates/basic.py +93 -0
  153. abt/commands/init_templates/intermediate.py +302 -0
  154. abt/commands/invocation_prep.py +71 -0
  155. abt/commands/lint.py +109 -0
  156. abt/commands/list.py +279 -0
  157. abt/commands/manifest_file.py +60 -0
  158. abt/commands/modify.py +61 -0
  159. abt/commands/package_template.py +53 -0
  160. abt/commands/provider_scaffold.py +107 -0
  161. abt/commands/publish.py +326 -0
  162. abt/commands/routing.py +243 -0
  163. abt/commands/run.py +232 -0
  164. abt/commands/scaffold/__init__.py +36 -0
  165. abt/commands/scaffold/edits.py +46 -0
  166. abt/commands/scaffold/engine.py +485 -0
  167. abt/commands/scaffold/layout_spec.md +298 -0
  168. abt/commands/scaffold/model.py +150 -0
  169. abt/commands/scaffold/plan.py +246 -0
  170. abt/commands/scaffold/providers_spec.md +28 -0
  171. abt/commands/scaffold/spec.py +234 -0
  172. abt/commands/scaffold/stage.py +321 -0
  173. abt/commands/scaffold/tools.py +186 -0
  174. abt/commands/show_request.py +300 -0
  175. abt/commands/stateless_guard.py +153 -0
  176. abt/commands/test.py +108 -0
  177. abt/context/__init__.py +61 -0
  178. abt/context/builtin_providers.py +31 -0
  179. abt/context/io_config_template.py +320 -0
  180. abt/context/jinja_refs.py +360 -0
  181. abt/context/namespace.py +577 -0
  182. abt/context/providers/__init__.py +1 -0
  183. abt/context/providers/s3.py +45 -0
  184. abt/context/refs.py +18 -0
  185. abt/context/registry.py +91 -0
  186. abt/context/resolver.py +215 -0
  187. abt/contracts/__init__.py +122 -0
  188. abt/contracts/bench.py +62 -0
  189. abt/contracts/confirmation.py +97 -0
  190. abt/contracts/credentials.py +46 -0
  191. abt/contracts/events.py +291 -0
  192. abt/contracts/flags.py +87 -0
  193. abt/contracts/handlers.py +128 -0
  194. abt/contracts/protocols.py +144 -0
  195. abt/contracts/registry.py +358 -0
  196. abt/contracts/sinks.py +146 -0
  197. abt/contracts/steering.py +223 -0
  198. abt/contracts/tools.py +255 -0
  199. abt/contracts/types.py +182 -0
  200. abt/contracts/workspace.py +60 -0
  201. abt/core/__init__.py +28 -0
  202. abt/core/components/__init__.py +44 -0
  203. abt/core/components/artifact_writer.py +263 -0
  204. abt/core/components/dependency_executor.py +117 -0
  205. abt/core/components/output_schema_step.py +68 -0
  206. abt/core/components/policies.py +74 -0
  207. abt/core/components/retriever_executor.py +38 -0
  208. abt/core/components/run_logger.py +61 -0
  209. abt/core/components/stream_processor.py +520 -0
  210. abt/core/components/types.py +19 -0
  211. abt/core/components/workspace_manager.py +76 -0
  212. abt/core/components/workspace_phase.py +258 -0
  213. abt/core/compose.py +436 -0
  214. abt/core/handlers/api.py +113 -0
  215. abt/core/handlers/builtins.py +229 -0
  216. abt/core/handlers/context.py +149 -0
  217. abt/core/handlers/discovery.py +160 -0
  218. abt/core/handlers/dispatcher.py +257 -0
  219. abt/core/handlers/kwargs.py +150 -0
  220. abt/core/handlers/manifest_build.py +140 -0
  221. abt/core/handlers/merge.py +44 -0
  222. abt/core/handlers/records.py +38 -0
  223. abt/core/handlers/refs.py +88 -0
  224. abt/core/handlers/registry.py +138 -0
  225. abt/core/handlers/resolve.py +55 -0
  226. abt/core/handlers/runtime.py +354 -0
  227. abt/core/orchestrator/__init__.py +24 -0
  228. abt/core/orchestrator/_shared.py +7 -0
  229. abt/core/orchestrator/agent_run.py +266 -0
  230. abt/core/orchestrator/coordinator.py +71 -0
  231. abt/core/orchestrator/guardrails.py +66 -0
  232. abt/core/orchestrator/handler_dispatch.py +106 -0
  233. abt/core/orchestrator/head_execution.py +337 -0
  234. abt/core/orchestrator/resume_builder.py +68 -0
  235. abt/core/orchestrator/workflow_executor/__init__.py +118 -0
  236. abt/core/orchestrator/workflow_executor/execute.py +524 -0
  237. abt/core/orchestrator/workflow_executor/graph.py +164 -0
  238. abt/core/orchestrator/workflow_executor/scheduling.py +114 -0
  239. abt/core/orchestrator/workflow_executor/state_machine.py +313 -0
  240. abt/core/orchestrator/workflow_executor/static_classification.py +279 -0
  241. abt/docs/__init__.py +18 -0
  242. abt/docs/collector.py +744 -0
  243. abt/docs/generate.py +103 -0
  244. abt/docs/renderer.py +23 -0
  245. abt/doctor/__init__.py +22 -0
  246. abt/doctor/baseline.py +44 -0
  247. abt/doctor/engine.py +127 -0
  248. abt/doctor/extended_rules.py +454 -0
  249. abt/doctor/filters.py +24 -0
  250. abt/doctor/llm_rules.py +250 -0
  251. abt/doctor/models.py +98 -0
  252. abt/doctor/registry.py +86 -0
  253. abt/doctor/reporter.py +124 -0
  254. abt/doctor/resource_types.py +89 -0
  255. abt/doctor/rules.py +340 -0
  256. abt/doctor/static_rules.py +55 -0
  257. abt/doctor/suppression.py +67 -0
  258. abt/evaluation/__init__.py +4 -0
  259. abt/evaluation/checks.py +205 -0
  260. abt/evaluation/judge.py +131 -0
  261. abt/evaluation/judge_model_pool.py +35 -0
  262. abt/evaluation/models.py +143 -0
  263. abt/exceptions.py +195 -0
  264. abt/exposures/__init__.py +110 -0
  265. abt/exposures/dispatcher.py +319 -0
  266. abt/exposures/firing.py +169 -0
  267. abt/include/__init__.py +5 -0
  268. abt/include/profile_templates/__init__.py +1 -0
  269. abt/include/profile_templates/anthropic.yaml +9 -0
  270. abt/include/profile_templates/bedrock.yaml +13 -0
  271. abt/include/profile_templates/openai.yaml +9 -0
  272. abt/infra/__init__.py +5 -0
  273. abt/infra/_middleware_bridge.py +120 -0
  274. abt/infra/approvals/__init__.py +40 -0
  275. abt/infra/approvals/authorization.py +24 -0
  276. abt/infra/approvals/bypass.py +61 -0
  277. abt/infra/approvals/dynamodb_store.py +780 -0
  278. abt/infra/approvals/external_approval.py +561 -0
  279. abt/infra/approvals/gate.py +367 -0
  280. abt/infra/approvals/gate_factory.py +291 -0
  281. abt/infra/approvals/models.py +228 -0
  282. abt/infra/approvals/registry.py +175 -0
  283. abt/infra/approvals/resolve_interactive.py +113 -0
  284. abt/infra/approvals/resource.py +326 -0
  285. abt/infra/approvals/resume/__init__.py +48 -0
  286. abt/infra/approvals/resume/drift.py +165 -0
  287. abt/infra/approvals/resume/finalize.py +262 -0
  288. abt/infra/approvals/resume/orchestrator.py +386 -0
  289. abt/infra/approvals/store/__init__.py +46 -0
  290. abt/infra/approvals/store/helpers.py +88 -0
  291. abt/infra/approvals/store/memory_store.py +205 -0
  292. abt/infra/approvals/store/protocols.py +191 -0
  293. abt/infra/approvals/store/providers.py +172 -0
  294. abt/infra/approvals/store/sqlite_approvals_crud.py +175 -0
  295. abt/infra/approvals/store/sqlite_audit_queue.py +122 -0
  296. abt/infra/approvals/store/sqlite_connection.py +64 -0
  297. abt/infra/approvals/store/sqlite_schema.py +64 -0
  298. abt/infra/approvals/store/sqlite_store.py +32 -0
  299. abt/infra/approvals/store/sqlite_thread_leases.py +71 -0
  300. abt/infra/approvals/thread_id.py +53 -0
  301. abt/infra/approvals/tool_args.py +60 -0
  302. abt/infra/cli_logging.py +475 -0
  303. abt/infra/code_interpreter.py +194 -0
  304. abt/infra/collapse.py +69 -0
  305. abt/infra/compaction.py +287 -0
  306. abt/infra/concurrency.py +167 -0
  307. abt/infra/config/__init__.py +1 -0
  308. abt/infra/config/config_models.py +39 -0
  309. abt/infra/config/rule_ids.py +30 -0
  310. abt/infra/config/settings.py +233 -0
  311. abt/infra/debug_log.py +63 -0
  312. abt/infra/env.py +95 -0
  313. abt/infra/exception_root_cause.py +98 -0
  314. abt/infra/extras.py +45 -0
  315. abt/infra/graph.py +27 -0
  316. abt/infra/guardrail_telemetry.py +38 -0
  317. abt/infra/http_redirect.py +75 -0
  318. abt/infra/ignore.py +56 -0
  319. abt/infra/io/__init__.py +1 -0
  320. abt/infra/io/atomic_write.py +142 -0
  321. abt/infra/io/path_resolution.py +39 -0
  322. abt/infra/io/path_sanitize.py +31 -0
  323. abt/infra/io/private_dir.py +49 -0
  324. abt/infra/io/private_files.py +81 -0
  325. abt/infra/io/repo_lock.py +125 -0
  326. abt/infra/io/workspace.py +425 -0
  327. abt/infra/llm/__init__.py +1 -0
  328. abt/infra/llm/constants.py +23 -0
  329. abt/infra/llm/image_support.py +154 -0
  330. abt/infra/llm/llm_helpers.py +42 -0
  331. abt/infra/llm/logging_callback.py +223 -0
  332. abt/infra/llm/loop_detection/__init__.py +54 -0
  333. abt/infra/llm/loop_detection/config.py +270 -0
  334. abt/infra/llm/loop_detection/detectors.py +456 -0
  335. abt/infra/llm/loop_detection/message_parsing.py +181 -0
  336. abt/infra/llm/loop_detection/middleware.py +317 -0
  337. abt/infra/llm/loop_detection_handlers.py +492 -0
  338. abt/infra/llm/loop_reflection.py +160 -0
  339. abt/infra/llm/model_rate_limit.py +152 -0
  340. abt/infra/llm/model_request_recorder.py +149 -0
  341. abt/infra/llm/progress_tracker.py +160 -0
  342. abt/infra/llm/prompt_builder.py +120 -0
  343. abt/infra/llm/run_stop.py +133 -0
  344. abt/infra/llm/run_timeout_middleware.py +221 -0
  345. abt/infra/llm/steering_middleware.py +103 -0
  346. abt/infra/llm/structured_output_arg_repair.py +250 -0
  347. abt/infra/llm/structured_output_guard.py +105 -0
  348. abt/infra/llm/structured_output_repair.py +100 -0
  349. abt/infra/llm/subagent_stop_notice.py +53 -0
  350. abt/infra/llm/synthesis.py +192 -0
  351. abt/infra/llm/token_budget_middleware.py +389 -0
  352. abt/infra/llm/tool_call_limit.py +292 -0
  353. abt/infra/llm/tool_error_unwrap.py +198 -0
  354. abt/infra/llm/tool_message_repair.py +183 -0
  355. abt/infra/llm/tool_name_repair.py +135 -0
  356. abt/infra/llm/tool_result_cache.py +154 -0
  357. abt/infra/llm/tool_retry.py +153 -0
  358. abt/infra/llm/usage_tokens.py +88 -0
  359. abt/infra/llm/write_todos_repair.py +74 -0
  360. abt/infra/module_loader.py +81 -0
  361. abt/infra/observability/__init__.py +58 -0
  362. abt/infra/observability/braintrust_callbacks.py +166 -0
  363. abt/infra/observability/config.py +40 -0
  364. abt/infra/observability/event_bridge.py +106 -0
  365. abt/infra/observability/hooks.py +233 -0
  366. abt/infra/observability/langchain_callbacks.py +108 -0
  367. abt/infra/observability/metrics.py +144 -0
  368. abt/infra/observability/otel.py +136 -0
  369. abt/infra/redaction.py +337 -0
  370. abt/infra/rubric.py +177 -0
  371. abt/infra/run_identity.py +103 -0
  372. abt/infra/run_sync.py +19 -0
  373. abt/infra/slack_filter_validation.py +116 -0
  374. abt/infra/stateless_run.py +155 -0
  375. abt/infra/stream_adapter.py +591 -0
  376. abt/infra/subprocess_policy.py +134 -0
  377. abt/infra/suggest.py +12 -0
  378. abt/infra/terminal_style.py +35 -0
  379. abt/infra/token_estimator.py +50 -0
  380. abt/infra/token_usage_format.py +6 -0
  381. abt/infra/tool_call_artifacts.py +230 -0
  382. abt/infra/tool_runtime.py +47 -0
  383. abt/infra/yaml/__init__.py +1 -0
  384. abt/infra/yaml/dump.py +39 -0
  385. abt/infra/yaml/frontmatter.py +120 -0
  386. abt/infra/yaml/resource_discovery.py +84 -0
  387. abt/infra/yaml/yaml_helpers.py +96 -0
  388. abt/integrations/__init__.py +1 -0
  389. abt/integrations/_credentials.py +31 -0
  390. abt/integrations/_resilience.py +170 -0
  391. abt/integrations/_subprocess_env.py +158 -0
  392. abt/integrations/_timeout.py +39 -0
  393. abt/integrations/atlassian/__init__.py +13 -0
  394. abt/integrations/atlassian/client.py +96 -0
  395. abt/integrations/atlassian/jira_write.py +140 -0
  396. abt/integrations/atlassian/markdown.py +224 -0
  397. abt/integrations/atlassian/search.py +590 -0
  398. abt/integrations/databricks/__init__.py +93 -0
  399. abt/integrations/databricks/client.py +230 -0
  400. abt/integrations/databricks/clusters.py +106 -0
  401. abt/integrations/databricks/genie.py +341 -0
  402. abt/integrations/databricks/jobs.py +535 -0
  403. abt/integrations/databricks/notebooks.py +384 -0
  404. abt/integrations/databricks/permissions.py +103 -0
  405. abt/integrations/databricks/pipelines.py +108 -0
  406. abt/integrations/databricks/queries.py +264 -0
  407. abt/integrations/databricks/statements.py +175 -0
  408. abt/integrations/databricks/utils.py +325 -0
  409. abt/integrations/databricks/warehouses.py +96 -0
  410. abt/integrations/slack/__init__.py +16 -0
  411. abt/integrations/slack/channel_digest.py +215 -0
  412. abt/integrations/slack/client.py +131 -0
  413. abt/integrations/slack/history.py +84 -0
  414. abt/integrations/slack/post.py +57 -0
  415. abt/integrations/slack/refs.py +113 -0
  416. abt/integrations/slack/search.py +395 -0
  417. abt/integrations/slack/thread.py +385 -0
  418. abt/io_gating.py +49 -0
  419. abt/io_models.py +21 -0
  420. abt/isolation.py +86 -0
  421. abt/llm_providers.py +467 -0
  422. abt/log.py +111 -0
  423. abt/loom/__init__.py +13 -0
  424. abt/loom/invoke_protocol.py +42 -0
  425. abt/loom/loaders.py +84 -0
  426. abt/loom/remote_tool.py +210 -0
  427. abt/loom/resolver.py +257 -0
  428. abt/loom/schema.py +102 -0
  429. abt/manifest_agent_filters.py +22 -0
  430. abt/mcps/__init__.py +8 -0
  431. abt/mcps/adapter.py +194 -0
  432. abt/mcps/discovery.py +129 -0
  433. abt/mcps/error_policy.py +67 -0
  434. abt/mcps/interceptors.py +114 -0
  435. abt/mcps/json_loader.py +223 -0
  436. abt/mcps/registry.py +529 -0
  437. abt/mcps/tool_loader.py +240 -0
  438. abt/middleware/__init__.py +24 -0
  439. abt/middleware/builtins.py +415 -0
  440. abt/middleware/decorator.py +80 -0
  441. abt/middleware/registry.py +249 -0
  442. abt/middleware/resolver.py +124 -0
  443. abt/output/__init__.py +29 -0
  444. abt/output/progress.py +194 -0
  445. abt/output/sink.py +517 -0
  446. abt/packages/__init__.py +19 -0
  447. abt/packages/_isolated_worker.py +90 -0
  448. abt/packages/catalog.py +164 -0
  449. abt/packages/cli_runner.py +90 -0
  450. abt/packages/config.py +218 -0
  451. abt/packages/discovery.py +154 -0
  452. abt/packages/errors.py +54 -0
  453. abt/packages/expander.py +189 -0
  454. abt/packages/install.py +567 -0
  455. abt/packages/isolated_tools.py +183 -0
  456. abt/packages/lockfile.py +102 -0
  457. abt/packages/spec.py +183 -0
  458. abt/packages/tool_exec.py +988 -0
  459. abt/packages/tool_executors.py +338 -0
  460. abt/packages/tool_output.py +179 -0
  461. abt/packages/tool_runtime.py +25 -0
  462. abt/packages/tool_specs.py +64 -0
  463. abt/packages/tooling_docs.py +116 -0
  464. abt/packages/validation.py +67 -0
  465. abt/packages/workspace_routes.py +85 -0
  466. abt/profiles/__init__.py +116 -0
  467. abt/profiles/_context.py +42 -0
  468. abt/profiles/env_loader.py +101 -0
  469. abt/profiles/loader.py +153 -0
  470. abt/profiles/models.py +126 -0
  471. abt/profiles/publisher.py +21 -0
  472. abt/profiles/resolver.py +176 -0
  473. abt/project/__init__.py +62 -0
  474. abt/project/artifacts.py +111 -0
  475. abt/project/config.py +441 -0
  476. abt/project/context.py +216 -0
  477. abt/project/yaml_io.py +179 -0
  478. abt/project_root.py +63 -0
  479. abt/publish/__init__.py +14 -0
  480. abt/publish/config.py +26 -0
  481. abt/publish/strip.py +70 -0
  482. abt/publish/uploaders.py +66 -0
  483. abt/py.typed +0 -0
  484. abt/retrievers/__init__.py +25 -0
  485. abt/retrievers/builtin_providers.py +224 -0
  486. abt/retrievers/discovery.py +122 -0
  487. abt/retrievers/prompt_transform.py +342 -0
  488. abt/retrievers/registry.py +88 -0
  489. abt/runner/__init__.py +47 -0
  490. abt/runner/_dry_run_plan.py +50 -0
  491. abt/runner/cli_args.py +236 -0
  492. abt/runner/core.py +618 -0
  493. abt/runner/option_spec.py +347 -0
  494. abt/runner/preparation.py +249 -0
  495. abt/runner/stateless_prep.py +67 -0
  496. abt/runtime/__init__.py +97 -0
  497. abt/runtime/agent_backend.py +176 -0
  498. abt/runtime/agent_build/__init__.py +14 -0
  499. abt/runtime/agent_build/agent_config.py +331 -0
  500. abt/runtime/agent_build/background_subagent.py +14 -0
  501. abt/runtime/agent_build/background_subagent_middleware.py +546 -0
  502. abt/runtime/agent_build/budget_resolver.py +79 -0
  503. abt/runtime/agent_build/builder.py +206 -0
  504. abt/runtime/agent_build/delegation_graph.py +379 -0
  505. abt/runtime/agent_build/feature_settings.py +170 -0
  506. abt/runtime/agent_build/timeout_resolver.py +56 -0
  507. abt/runtime/agent_build/types.py +7 -0
  508. abt/runtime/agent_definitions.py +154 -0
  509. abt/runtime/agent_factory.py +971 -0
  510. abt/runtime/agent_node.py +292 -0
  511. abt/runtime/agent_spec.py +540 -0
  512. abt/runtime/base.py +124 -0
  513. abt/runtime/config.py +58 -0
  514. abt/runtime/config_scanner.py +171 -0
  515. abt/runtime/confirmation_settings.py +121 -0
  516. abt/runtime/contract_resolver.py +169 -0
  517. abt/runtime/effective_config.py +537 -0
  518. abt/runtime/few_shot_parser.py +203 -0
  519. abt/runtime/jinja_rendering.py +159 -0
  520. abt/runtime/middleware_builder.py +151 -0
  521. abt/runtime/output_schema.py +63 -0
  522. abt/runtime/project_runtime.py +114 -0
  523. abt/runtime/recursion_floor.py +313 -0
  524. abt/runtime/registry.py +98 -0
  525. abt/runtime/route_schema.py +6 -0
  526. abt/runtime/routing_common.py +75 -0
  527. abt/runtime/state.py +48 -0
  528. abt/runtime/task_recursion_wrapper.py +215 -0
  529. abt/runtime/tool_registry.py +325 -0
  530. abt/runtime/tool_runtime_middleware.py +138 -0
  531. abt/runtime/tool_runtime_settings.py +89 -0
  532. abt/runtime/tool_stubs.py +86 -0
  533. abt/runtime/tooling_resolver.py +251 -0
  534. abt/runtime_context.py +211 -0
  535. abt/sdk/__init__.py +111 -0
  536. abt/sdk/agents.py +17 -0
  537. abt/sdk/handlers.py +148 -0
  538. abt/sdk/operations.py +406 -0
  539. abt/sdk/reporting.py +133 -0
  540. abt/sdk/watch.py +395 -0
  541. abt/secrets.py +113 -0
  542. abt/selector.py +256 -0
  543. abt/serve/__init__.py +8 -0
  544. abt/serve/app.py +17 -0
  545. abt/serve/confirmation_gate.py +70 -0
  546. abt/serve/conversation_store.py +170 -0
  547. abt/serve/routes.py +983 -0
  548. abt/serve/sse_sink.py +81 -0
  549. abt/site/__init__.py +97 -0
  550. abt/site/dist/app.js +917 -0
  551. abt/site/document.html +345 -0
  552. abt/site/styles.css +2978 -0
  553. abt/skills/__init__.py +25 -0
  554. abt/skills/backend.py +45 -0
  555. abt/skills/paths.py +222 -0
  556. abt/skills/refs.py +88 -0
  557. abt/skills/remote_fetch.py +202 -0
  558. abt/skills/vanilla_middleware.py +186 -0
  559. abt/sources/__init__.py +354 -0
  560. abt/sources/callable.py +24 -0
  561. abt/sources/registry.py +159 -0
  562. abt/template_vars.py +24 -0
  563. abt/testing/__init__.py +14 -0
  564. abt/testing/checks.py +65 -0
  565. abt/testing/judge_record.py +21 -0
  566. abt/testing/loader.py +186 -0
  567. abt/testing/models.py +125 -0
  568. abt/testing/reporter.py +67 -0
  569. abt/testing/runner.py +364 -0
  570. abt/testing/schema_loader.py +72 -0
  571. abt/testing/schema_models.py +113 -0
  572. abt/testing/singular/__init__.py +31 -0
  573. abt/testing/singular/comparison.py +106 -0
  574. abt/testing/singular/conversation.py +102 -0
  575. abt/testing/singular/models.py +121 -0
  576. abt/tools.py +42 -0
  577. abt/transformers/__init__.py +22 -0
  578. abt/transformers/builtin_providers.py +267 -0
  579. abt/transformers/discovery.py +108 -0
  580. abt/transformers/logging.py +27 -0
  581. abt/transformers/registry.py +113 -0
  582. abt/triggers/__init__.py +111 -0
  583. abt/watch/__init__.py +3 -0
  584. abt/watch/_health.py +52 -0
  585. abt/watch/builders.py +154 -0
  586. abt/watch/dispatcher.py +569 -0
  587. abt/watch/http_app.py +307 -0
  588. abt/watch/invoke.py +767 -0
  589. abt/watch/invoke_config.py +39 -0
  590. abt/watch/leader.py +248 -0
  591. abt/watch/models.py +275 -0
  592. abt/watch/queue.py +998 -0
  593. abt/watch/run_store.py +448 -0
  594. abt/watch/runner.py +800 -0
  595. abt/watch/sources/__init__.py +3 -0
  596. abt/watch/sources/_backoff.py +18 -0
  597. abt/watch/sources/_slack_hub.py +160 -0
  598. abt/watch/sources/_slack_progress.py +405 -0
  599. abt/watch/sources/base.py +45 -0
  600. abt/watch/sources/cron.py +148 -0
  601. abt/watch/sources/github.py +274 -0
  602. abt/watch/sources/jira.py +377 -0
  603. abt/watch/sources/slack.py +700 -0
  604. abt/watch/steering_relay.py +299 -0
  605. abt/watch/worker.py +794 -0
  606. abt/workflows/__init__.py +587 -0
  607. abt/workflows/desugar.py +155 -0
  608. abt/workflows/schema.py +114 -0
  609. abt_core-0.0.1.dist-info/METADATA +240 -0
  610. abt_core-0.0.1.dist-info/RECORD +613 -0
  611. abt_core-0.0.1.dist-info/WHEEL +4 -0
  612. abt_core-0.0.1.dist-info/entry_points.txt +47 -0
  613. abt_core-0.0.1.dist-info/licenses/LICENSE +201 -0
abt/__init__.py ADDED
@@ -0,0 +1,111 @@
1
+ """Public API for abt-core.
2
+
3
+ All heavy re-exports are resolved lazily via :pep:`562` ``__getattr__`` so
4
+ importing :mod:`abt` (or any of its submodules that happen to traverse the
5
+ package root) does **not** drag the runtime stack (``langchain_core``,
6
+ ``langgraph``, ``deepagents``, …) into ``abt.cli``. The import budget test in
7
+ ``tests/unit/test_track_b_invariants.py`` guards this invariant.
8
+
9
+ Access patterns:
10
+
11
+ - ``from abt import AgentBuildTool`` triggers :mod:`abt._tool`.
12
+ - ``from abt import agent`` triggers :mod:`abt.sdk`.
13
+ - ``from abt import WritableManifest`` triggers :mod:`abt.artifacts` (pydantic-only).
14
+
15
+ Nothing above happens at package import time.
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ from typing import TYPE_CHECKING, Any
21
+
22
+ __all__ = [
23
+ "AbtRunner",
24
+ "AbtRunnerResult",
25
+ "AgentBuildTool",
26
+ "AgentConfig",
27
+ "BaseTool",
28
+ "CallbackCompileReporter",
29
+ "CompileReporter",
30
+ "InjectedToolArg",
31
+ "InjectedToolCallId",
32
+ "ProjectContext",
33
+ "RunResult",
34
+ "StructuredTool",
35
+ "ToolException",
36
+ "ToolRuntime",
37
+ "WritableManifest",
38
+ "agent",
39
+ "isolated_tool",
40
+ "run_agent",
41
+ "tool",
42
+ "use_compile_reporter",
43
+ ]
44
+
45
+
46
+ # Map each public name to ``(module, attr)`` for lazy resolution.
47
+ _LAZY_EXPORTS: dict[str, tuple[str, str]] = {
48
+ "AgentBuildTool": ("abt._tool", "AgentBuildTool"),
49
+ "AgentConfig": ("abt.runtime", "AgentConfig"),
50
+ "AbtRunner": ("abt.runner", "AbtRunner"),
51
+ "AbtRunnerResult": ("abt.runner", "AbtRunnerResult"),
52
+ "CallbackCompileReporter": ("abt.sdk.reporting", "CallbackCompileReporter"),
53
+ "CompileReporter": ("abt.sdk.reporting", "CompileReporter"),
54
+ "ProjectContext": ("abt.project", "ProjectContext"),
55
+ "RunResult": ("abt.core.orchestrator", "RunResult"),
56
+ "WritableManifest": ("abt.artifacts", "WritableManifest"),
57
+ "agent": ("abt.sdk", "agent"),
58
+ "isolated_tool": ("abt.isolation", "isolated_tool"),
59
+ "run_agent": ("abt.core.orchestrator", "run_agent"),
60
+ # The tool API: LangChain's objects under abt's names, so authors never import LangChain.
61
+ "BaseTool": ("abt.tools", "BaseTool"),
62
+ "InjectedToolArg": ("abt.tools", "InjectedToolArg"),
63
+ "InjectedToolCallId": ("abt.tools", "InjectedToolCallId"),
64
+ "StructuredTool": ("abt.tools", "StructuredTool"),
65
+ "ToolException": ("abt.tools", "ToolException"),
66
+ "ToolRuntime": ("abt.tools", "ToolRuntime"),
67
+ "tool": ("abt.tools", "tool"),
68
+ "use_compile_reporter": ("abt.sdk.reporting", "use_compile_reporter"),
69
+ }
70
+
71
+
72
+ def __getattr__(name: str) -> Any:
73
+ try:
74
+ module_name, attr = _LAZY_EXPORTS[name]
75
+ except KeyError:
76
+ raise AttributeError(f"module 'abt' has no attribute {name!r}") from None
77
+ import importlib
78
+
79
+ module = importlib.import_module(module_name)
80
+ value = getattr(module, attr)
81
+ globals()[name] = value
82
+ return value
83
+
84
+
85
+ def __dir__() -> list[str]:
86
+ return sorted(list(globals().keys()) + list(_LAZY_EXPORTS.keys()))
87
+
88
+
89
+ if TYPE_CHECKING:
90
+ from abt._tool import AgentBuildTool
91
+ from abt.artifacts import WritableManifest
92
+ from abt.core.orchestrator import RunResult, run_agent
93
+ from abt.isolation import isolated_tool
94
+ from abt.project import ProjectContext
95
+ from abt.runner import AbtRunner, AbtRunnerResult
96
+ from abt.runtime import AgentConfig
97
+ from abt.sdk import agent
98
+ from abt.sdk.reporting import (
99
+ CallbackCompileReporter,
100
+ CompileReporter,
101
+ use_compile_reporter,
102
+ )
103
+ from abt.tools import (
104
+ BaseTool,
105
+ InjectedToolArg,
106
+ InjectedToolCallId,
107
+ StructuredTool,
108
+ ToolException,
109
+ ToolRuntime,
110
+ tool,
111
+ )
abt/_tool.py ADDED
@@ -0,0 +1,161 @@
1
+ """Implementation of :class:`abt.AgentBuildTool`.
2
+
3
+ Kept out of :mod:`abt.__init__` so importing :mod:`abt.cli` (or any public
4
+ re-export via PEP 562 ``__getattr__``) does NOT drag in the runtime stack
5
+ (``langchain_core``, ``langgraph``, ``deepagents``). Touch this module only
6
+ through :class:`abt.AgentBuildTool`.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from dataclasses import replace
12
+ from pathlib import Path
13
+ from typing import Any
14
+
15
+ from abt.artifacts import WritableManifest
16
+ from abt.core.orchestrator import RunResult, run_agent
17
+ from abt.log import get_logger
18
+ from abt.mcps.registry import MCPRegistry, configure_mcp_sources
19
+ from abt.profiles.models import ProfileTarget
20
+ from abt.project import ProjectContext
21
+ from abt.runtime import (
22
+ AgentConfig,
23
+ ProjectRuntime,
24
+ aget_config,
25
+ project_runtime_var,
26
+ reload_registry_from_manifest,
27
+ )
28
+ from abt.runtime.agent_build.agent_config import _replace_budget_middleware, _to_pos_int
29
+ from abt.runtime_context import activate_project
30
+
31
+ logger = get_logger(__name__)
32
+
33
+
34
+ __all__ = ["AgentBuildTool"]
35
+
36
+
37
+ class AgentBuildTool:
38
+ """Project-scoped facade that wires runtime discovery paths.
39
+
40
+ Requires a compiled ``WritableManifest`` -- use
41
+ :func:`abt.artifacts.compile_manifest` to produce one.
42
+ """
43
+
44
+ def __init__(
45
+ self,
46
+ project_root: str | Path = ".",
47
+ *,
48
+ manifest: WritableManifest,
49
+ config_overrides: dict | None = None,
50
+ target: str | None = None,
51
+ profiles_dir: str | Path | None = None,
52
+ profile: dict[str, Any] | ProfileTarget | None = None,
53
+ publish_profile_env: bool = True,
54
+ ):
55
+ from abt.artifacts.compile_workflow.required_scope import safe_required_scope_from_manifest
56
+
57
+ # Scope ``credentials:``/``env:`` to what *manifest*'s compiled agents need — an unrelated
58
+ # agent's unset secret must not block this run (same scoping as bootstrap).
59
+ scope = safe_required_scope_from_manifest(manifest, Path(project_root).absolute())
60
+ activate_project(
61
+ project_root,
62
+ profiles_dir=profiles_dir,
63
+ target=target,
64
+ publish_profile_env=publish_profile_env,
65
+ profile=profile,
66
+ project_config=manifest.project_config,
67
+ required_namespaces=scope.credential_namespaces,
68
+ required_env_vars=scope.env_var_names,
69
+ )
70
+ # ``.absolute()`` (not ``.resolve()``): *project_root* may be a git-sync-managed symlink
71
+ # that gets rotated/pruned mid-dispatch. ``activate_project`` above already
72
+ # published ``ABT_PROJECT_ROOT`` as a logical path; resolving it again here would build
73
+ # ``self.context`` (and everything ``apply_env()`` publishes) on the physical worktree,
74
+ # silently undoing that and pinning every downstream path for the run's lifetime.
75
+ root = Path(project_root).absolute()
76
+ self.context = ProjectContext.from_root(root, overrides=config_overrides)
77
+ self.context.apply_env()
78
+ self._runtime = ProjectRuntime(mcp_registry=MCPRegistry())
79
+ self._runtime.mcp_registry.clear_cache()
80
+ self.context.validate_mcps_path()
81
+ configure_mcp_sources(
82
+ self.context.mcps_dir,
83
+ clear_existing=True,
84
+ registry=self._runtime.mcp_registry,
85
+ project_root=self.context.project_root,
86
+ )
87
+ reload_registry_from_manifest(manifest, project_root=root, runtime=self._runtime)
88
+
89
+ async def get_config(
90
+ self,
91
+ name: str,
92
+ *,
93
+ run_results_dir: Path | None = None,
94
+ ) -> AgentConfig:
95
+ prev = project_runtime_var.get()
96
+ if prev is not self._runtime:
97
+ token = project_runtime_var.set(self._runtime)
98
+ try:
99
+ return await aget_config(
100
+ name,
101
+ run_results_dir=run_results_dir or self.context.run_results_dir,
102
+ )
103
+ finally:
104
+ project_runtime_var.reset(token)
105
+ return await aget_config(
106
+ name,
107
+ run_results_dir=run_results_dir or self.context.run_results_dir,
108
+ )
109
+
110
+ async def run_by_name(self, name: str, prompt: str, **kwargs) -> RunResult:
111
+ opts = dict(kwargs)
112
+ run_results_dir = opts.pop("run_results_dir", None) or self.context.run_results_dir
113
+ cli_mmc = opts.pop("max_model_calls", None)
114
+ cli_mtt = opts.pop("max_total_tokens", None)
115
+ run_model_id = opts.pop("model_id", None)
116
+ run_temperature = opts.pop("temperature", None)
117
+ skip_handlers = bool(opts.pop("skip_handlers", False))
118
+ confirmation_gate = opts.pop("confirmation_gate", None)
119
+ checkpoint_spec = opts.pop("checkpoint_spec", None)
120
+ source_thread_keys = opts.pop("source_thread_keys", None)
121
+ run_id = opts.pop("run_id", None)
122
+ token = project_runtime_var.set(self._runtime)
123
+ try:
124
+ config = await self.get_config(name, run_results_dir=run_results_dir)
125
+ repl: dict = {}
126
+ if cli_mmc is not None or cli_mtt is not None:
127
+ repl["middleware_declarations"] = _replace_budget_middleware(
128
+ list(config.middleware_declarations), _to_pos_int(cli_mmc), _to_pos_int(cli_mtt)
129
+ )
130
+ if run_model_id is not None:
131
+ mid = str(run_model_id).strip()
132
+ if mid:
133
+ repl["model_id"] = mid
134
+ if run_temperature is not None:
135
+ try:
136
+ temp_val = float(run_temperature)
137
+ merged_kw = dict(config.model_kwargs)
138
+ merged_kw["temperature"] = temp_val
139
+ repl["model_kwargs"] = merged_kw
140
+ except (TypeError, ValueError):
141
+ logger.warning("Invalid temperature override %r ignored", run_temperature)
142
+ if repl:
143
+ config = replace(config, **repl)
144
+ return await run_agent(
145
+ config,
146
+ prompt,
147
+ run_results_dir=run_results_dir,
148
+ thread_context=opts.get("thread_context"),
149
+ output_sink=opts.get("output_sink"),
150
+ deadline_check=opts.get("deadline_check"),
151
+ thread_id=opts.get("thread_id"),
152
+ stream_processor=opts.get("stream_processor"),
153
+ skip_handlers=skip_handlers,
154
+ confirmation_gate=confirmation_gate,
155
+ checkpoint_spec=checkpoint_spec,
156
+ source_thread_keys=source_thread_keys,
157
+ run_id=run_id,
158
+ images=opts.get("images"),
159
+ )
160
+ finally:
161
+ project_runtime_var.reset(token)
abt/adapters/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # Adapters
2
+
3
+ Optional **source providers** and **exposure dispatchers** shipped with abt-core live here (`slack/`, `jira/`, `confluence/`, `local/`, `email/`). They are registered in `pyproject.toml` under `abt.source_providers` and `abt.exposure_dispatchers`.
4
+
5
+ | Adapter | Type | Requires extra |
6
+ |---------|------|----------------|
7
+ | `slack` | source + exposure | `abt-core[slack]` |
8
+ | `jira` | source + exposure | `abt-core[jira]` |
9
+ | `confluence` | exposure | `abt-core[confluence]` |
10
+ | `local` | exposure | *(none — stdlib only)* |
11
+ | `email` | exposure | *(none — stdlib only)* |
@@ -0,0 +1,5 @@
1
+ """First-party integrations (Slack, Jira, Confluence, Local, …) registered via setuptools entry points."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __all__: list[str] = []
@@ -0,0 +1,24 @@
1
+ """Config parsing shared by built-in adapters."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any
6
+
7
+ _TRUE_VALUES = frozenset({"1", "true", "yes", "on"})
8
+ _FALSE_VALUES = frozenset({"0", "false", "no", "off", ""})
9
+
10
+
11
+ def parse_bool(value: Any, *, field_name: str, owner: str) -> bool:
12
+ """Parse a YAML/vars-rendered boolean (``true``/``"yes"``/``"0"``…) for ``<owner> config.<field_name>``."""
13
+ if isinstance(value, bool):
14
+ return value
15
+ if isinstance(value, str):
16
+ normalized = value.strip().lower()
17
+ if normalized in _TRUE_VALUES:
18
+ return True
19
+ if normalized in _FALSE_VALUES:
20
+ return False
21
+ raise ValueError(f"{owner} config.{field_name} must be a boolean or one of {sorted(_TRUE_VALUES | _FALSE_VALUES)}")
22
+
23
+
24
+ __all__ = ["parse_bool"]