agent-devkit 0.1.5 → 0.2.0

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 (606) hide show
  1. package/README.md +14 -2
  2. package/package.json +1 -1
  3. package/runtime/README.md +127 -6
  4. package/runtime/agent +5 -0
  5. package/runtime/agents/README.md +34 -0
  6. package/runtime/agents/agent-devkit-agent-builder/AGENTS.md +24 -0
  7. package/runtime/agents/agent-devkit-agent-builder/README.md +37 -0
  8. package/runtime/agents/agent-devkit-agent-builder/agent.yaml +46 -0
  9. package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/capability.yaml +29 -0
  10. package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/decision-rules.md +7 -0
  11. package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/runner.py +33 -0
  12. package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/workflow.md +8 -0
  13. package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/capability.yaml +31 -0
  14. package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/decision-rules.md +9 -0
  15. package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/runner.py +39 -0
  16. package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/workflow.md +8 -0
  17. package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/capability.yaml +28 -0
  18. package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/decision-rules.md +6 -0
  19. package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/runner.py +33 -0
  20. package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/workflow.md +7 -0
  21. package/runtime/agents/agent-devkit-agent-builder/infra/integrations/agent-devkit/agent_builder_repository.py +527 -0
  22. package/runtime/agents/agent-devkit-agent-builder/knowledge/context.md +15 -0
  23. package/runtime/agents/agent-devkit-agent-builder/knowledge/policies.yaml +11 -0
  24. package/runtime/agents/agent-devkit-agent-builder/knowledge/system.md +11 -0
  25. package/runtime/agents/agent-devkit-agent-builder/templates/agent-plan-output.md +20 -0
  26. package/runtime/agents/agent-devkit-agent-builder/templates/scaffold-plan-output.md +13 -0
  27. package/runtime/agents/agent-devkit-agent-builder/templates/validation-report-output.md +13 -0
  28. package/runtime/agents/agent-devkit-agent-builder/tests/test_runners.py +188 -0
  29. package/runtime/agents/automation-architect/AGENTS.md +11 -0
  30. package/runtime/agents/automation-architect/README.md +27 -0
  31. package/runtime/agents/automation-architect/agent.yaml +57 -0
  32. package/runtime/agents/automation-architect/capabilities/classify-automation-request/capability.yaml +35 -0
  33. package/runtime/agents/automation-architect/capabilities/classify-automation-request/decision-rules.md +10 -0
  34. package/runtime/agents/automation-architect/capabilities/classify-automation-request/runner.py +37 -0
  35. package/runtime/agents/automation-architect/capabilities/classify-automation-request/workflow.md +7 -0
  36. package/runtime/agents/automation-architect/capabilities/delegate-automation-build/capability.yaml +34 -0
  37. package/runtime/agents/automation-architect/capabilities/delegate-automation-build/decision-rules.md +7 -0
  38. package/runtime/agents/automation-architect/capabilities/delegate-automation-build/runner.py +37 -0
  39. package/runtime/agents/automation-architect/capabilities/delegate-automation-build/workflow.md +6 -0
  40. package/runtime/agents/automation-architect/capabilities/plan-automation-solution/capability.yaml +35 -0
  41. package/runtime/agents/automation-architect/capabilities/plan-automation-solution/decision-rules.md +7 -0
  42. package/runtime/agents/automation-architect/capabilities/plan-automation-solution/runner.py +37 -0
  43. package/runtime/agents/automation-architect/capabilities/plan-automation-solution/workflow.md +7 -0
  44. package/runtime/agents/automation-architect/capabilities/review-automation-solution/capability.yaml +36 -0
  45. package/runtime/agents/automation-architect/capabilities/review-automation-solution/decision-rules.md +7 -0
  46. package/runtime/agents/automation-architect/capabilities/review-automation-solution/runner.py +39 -0
  47. package/runtime/agents/automation-architect/capabilities/review-automation-solution/workflow.md +7 -0
  48. package/runtime/agents/automation-architect/infra/integrations/automation-architecture/automation_architecture_repository.py +481 -0
  49. package/runtime/agents/automation-architect/knowledge/context.md +22 -0
  50. package/runtime/agents/automation-architect/knowledge/policies.yaml +20 -0
  51. package/runtime/agents/automation-architect/knowledge/system.md +8 -0
  52. package/runtime/agents/automation-architect/templates/automation-classification.md +6 -0
  53. package/runtime/agents/automation-architect/templates/automation-plan.md +5 -0
  54. package/runtime/agents/automation-architect/tests/test_runners.py +135 -0
  55. package/runtime/agents/aws-architecture-analyst/agent.yaml +17 -4
  56. package/runtime/agents/aws-cloudwatch-log-analyzer/agent.yaml +12 -2
  57. package/runtime/agents/aws-cloudwatch-log-analyzer/capabilities/analyze-service-error/capability.yaml +16 -0
  58. package/runtime/agents/aws-lambda-builder/AGENTS.md +27 -0
  59. package/runtime/agents/aws-lambda-builder/README.md +21 -0
  60. package/runtime/agents/aws-lambda-builder/agent.yaml +46 -0
  61. package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/capability.yaml +18 -0
  62. package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/decision-rules.md +6 -0
  63. package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/runner.py +33 -0
  64. package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/workflow.md +6 -0
  65. package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/capability.yaml +20 -0
  66. package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/decision-rules.md +6 -0
  67. package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/runner.py +39 -0
  68. package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/workflow.md +7 -0
  69. package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/capability.yaml +22 -0
  70. package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/decision-rules.md +6 -0
  71. package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/runner.py +41 -0
  72. package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/workflow.md +6 -0
  73. package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/capability.yaml +18 -0
  74. package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/decision-rules.md +7 -0
  75. package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/runner.py +33 -0
  76. package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/workflow.md +6 -0
  77. package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/capability.yaml +18 -0
  78. package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/decision-rules.md +7 -0
  79. package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/runner.py +33 -0
  80. package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/workflow.md +5 -0
  81. package/runtime/agents/aws-lambda-builder/infra/integrations/aws-lambda/aws_lambda_repository.py +688 -0
  82. package/runtime/agents/aws-lambda-builder/knowledge/context.md +12 -0
  83. package/runtime/agents/aws-lambda-builder/knowledge/policies.yaml +23 -0
  84. package/runtime/agents/aws-lambda-builder/knowledge/system.md +10 -0
  85. package/runtime/agents/aws-lambda-builder/templates/lambda-deploy-plan.md +3 -0
  86. package/runtime/agents/aws-lambda-builder/templates/lambda-package.md +3 -0
  87. package/runtime/agents/aws-lambda-builder/templates/lambda-plan.md +3 -0
  88. package/runtime/agents/aws-lambda-builder/templates/lambda-readme.md +3 -0
  89. package/runtime/agents/aws-lambda-builder/templates/lambda-security-review.md +3 -0
  90. package/runtime/agents/aws-lambda-builder/tests/test_runners.py +355 -0
  91. package/runtime/agents/aws-operations-operator/agent.yaml +18 -6
  92. package/runtime/agents/aws-security-governance-auditor/agent.yaml +17 -5
  93. package/runtime/agents/azure-devops-orchestrator/agent.yaml +15 -2
  94. package/runtime/agents/azure-devops-orchestrator/capabilities/read-card/capability.yaml +29 -0
  95. package/runtime/agents/bpo-analyser/agent.yaml +12 -2
  96. package/runtime/agents/bpo-analyser/knowledge/policies.yaml +2 -2
  97. package/runtime/agents/data-scientist-analyst/agent.yaml +16 -4
  98. package/runtime/agents/data-scientist-analyst/capabilities/generate-data-report/capability.yaml +1 -1
  99. package/runtime/agents/data-scientist-analyst/capabilities/generate-reconciliation-report/capability.yaml +1 -1
  100. package/runtime/agents/data-scientist-analyst/capabilities/run-data-pipeline/capability.yaml +1 -1
  101. package/runtime/agents/data-scientist-analyst/infra/integrations/agent-bridge/methods/analyze-sql-source.yaml +1 -1
  102. package/runtime/agents/data-scientist-analyst/knowledge/policies.yaml +4 -4
  103. package/runtime/agents/data-scientist-analyst/knowledge/system.md +1 -1
  104. package/runtime/agents/data-scientist-analyst/tests/test_runners.py +1 -1
  105. package/runtime/agents/database-change-operator/agent.yaml +12 -1
  106. package/runtime/agents/docker-container-builder/AGENTS.md +27 -0
  107. package/runtime/agents/docker-container-builder/README.md +21 -0
  108. package/runtime/agents/docker-container-builder/agent.yaml +52 -0
  109. package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/capability.yaml +18 -0
  110. package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/decision-rules.md +6 -0
  111. package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/runner.py +32 -0
  112. package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/workflow.md +6 -0
  113. package/runtime/agents/docker-container-builder/capabilities/generate-compose/capability.yaml +18 -0
  114. package/runtime/agents/docker-container-builder/capabilities/generate-compose/decision-rules.md +7 -0
  115. package/runtime/agents/docker-container-builder/capabilities/generate-compose/runner.py +32 -0
  116. package/runtime/agents/docker-container-builder/capabilities/generate-compose/workflow.md +6 -0
  117. package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/capability.yaml +20 -0
  118. package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/decision-rules.md +7 -0
  119. package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/runner.py +38 -0
  120. package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/workflow.md +7 -0
  121. package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/capability.yaml +18 -0
  122. package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/decision-rules.md +6 -0
  123. package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/runner.py +32 -0
  124. package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/workflow.md +7 -0
  125. package/runtime/agents/docker-container-builder/capabilities/plan-image-build/capability.yaml +18 -0
  126. package/runtime/agents/docker-container-builder/capabilities/plan-image-build/decision-rules.md +6 -0
  127. package/runtime/agents/docker-container-builder/capabilities/plan-image-build/runner.py +32 -0
  128. package/runtime/agents/docker-container-builder/capabilities/plan-image-build/workflow.md +6 -0
  129. package/runtime/agents/docker-container-builder/capabilities/review-docker-security/capability.yaml +21 -0
  130. package/runtime/agents/docker-container-builder/capabilities/review-docker-security/decision-rules.md +6 -0
  131. package/runtime/agents/docker-container-builder/capabilities/review-docker-security/runner.py +43 -0
  132. package/runtime/agents/docker-container-builder/capabilities/review-docker-security/workflow.md +5 -0
  133. package/runtime/agents/docker-container-builder/infra/integrations/docker-container/docker_container_repository.py +837 -0
  134. package/runtime/agents/docker-container-builder/knowledge/context.md +21 -0
  135. package/runtime/agents/docker-container-builder/knowledge/policies.yaml +13 -0
  136. package/runtime/agents/docker-container-builder/knowledge/system.md +21 -0
  137. package/runtime/agents/docker-container-builder/templates/container-plan.md +4 -0
  138. package/runtime/agents/docker-container-builder/templates/container-review.md +4 -0
  139. package/runtime/agents/docker-container-builder/templates/docker-compose.md +5 -0
  140. package/runtime/agents/docker-container-builder/templates/docker-readme.md +3 -0
  141. package/runtime/agents/docker-container-builder/templates/dockerfile.md +5 -0
  142. package/runtime/agents/docker-container-builder/tests/test_runners.py +255 -0
  143. package/runtime/agents/drawio-diagram-builder/agent.yaml +11 -2
  144. package/runtime/agents/drawio-diagram-builder/capabilities/execute-diagram-delivery/capability.yaml +1 -1
  145. package/runtime/agents/drawio-diagram-builder/capabilities/read-azure-card-context/capability.yaml +1 -1
  146. package/runtime/agents/elasticsearch-log-analyzer/agent.yaml +14 -2
  147. package/runtime/agents/elasticsearch-log-analyzer/capabilities/analyze-service-errors/capability.yaml +14 -0
  148. package/runtime/agents/excel-workbook-builder/agent.yaml +10 -0
  149. package/runtime/agents/excel-workbook-builder/capabilities/create-template/capability.yaml +1 -1
  150. package/runtime/agents/excel-workbook-builder/capabilities/create-template/workflow.md +1 -1
  151. package/runtime/agents/excel-workbook-builder/capabilities/create-template-version/capability.yaml +1 -1
  152. package/runtime/agents/excel-workbook-builder/capabilities/generate-template-input-file/capability.yaml +1 -2
  153. package/runtime/agents/excel-workbook-builder/capabilities/refine-template/capability.yaml +1 -1
  154. package/runtime/agents/excel-workbook-builder/capabilities/register-template/capability.yaml +1 -2
  155. package/runtime/agents/excel-workbook-builder/capabilities/register-template/workflow.md +1 -1
  156. package/runtime/agents/execution-loop-builder/AGENTS.md +24 -0
  157. package/runtime/agents/execution-loop-builder/README.md +19 -0
  158. package/runtime/agents/execution-loop-builder/agent.yaml +49 -0
  159. package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/capability.yaml +20 -0
  160. package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/decision-rules.md +6 -0
  161. package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/runner.py +38 -0
  162. package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/workflow.md +7 -0
  163. package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/capability.yaml +18 -0
  164. package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/decision-rules.md +5 -0
  165. package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/runner.py +32 -0
  166. package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/workflow.md +6 -0
  167. package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/capability.yaml +18 -0
  168. package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/decision-rules.md +6 -0
  169. package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/runner.py +32 -0
  170. package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/workflow.md +6 -0
  171. package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/capability.yaml +19 -0
  172. package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/decision-rules.md +6 -0
  173. package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/runner.py +36 -0
  174. package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/workflow.md +6 -0
  175. package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/capability.yaml +19 -0
  176. package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/decision-rules.md +6 -0
  177. package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/runner.py +39 -0
  178. package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/workflow.md +5 -0
  179. package/runtime/agents/execution-loop-builder/infra/integrations/execution-loop/execution_loop_repository.py +608 -0
  180. package/runtime/agents/execution-loop-builder/knowledge/context.md +26 -0
  181. package/runtime/agents/execution-loop-builder/knowledge/policies.yaml +13 -0
  182. package/runtime/agents/execution-loop-builder/knowledge/system.md +19 -0
  183. package/runtime/agents/execution-loop-builder/templates/loop-plan.md +3 -0
  184. package/runtime/agents/execution-loop-builder/templates/loop-readme.md +3 -0
  185. package/runtime/agents/execution-loop-builder/templates/loop-review.md +3 -0
  186. package/runtime/agents/execution-loop-builder/templates/loop-runner.py +2 -0
  187. package/runtime/agents/execution-loop-builder/tests/test_runners.py +274 -0
  188. package/runtime/agents/execution-reviewer/AGENTS.md +8 -0
  189. package/runtime/agents/execution-reviewer/README.md +13 -0
  190. package/runtime/agents/execution-reviewer/agent.yaml +27 -0
  191. package/runtime/agents/execution-reviewer/capabilities/review-agent-result/capability.yaml +14 -0
  192. package/runtime/agents/execution-reviewer/capabilities/review-agent-result/decision-rules.md +6 -0
  193. package/runtime/agents/execution-reviewer/capabilities/review-agent-result/workflow.md +7 -0
  194. package/runtime/agents/execution-reviewer/capabilities/review-final-output/capability.yaml +14 -0
  195. package/runtime/agents/execution-reviewer/capabilities/review-final-output/decision-rules.md +6 -0
  196. package/runtime/agents/execution-reviewer/capabilities/review-final-output/workflow.md +7 -0
  197. package/runtime/agents/execution-reviewer/capabilities/review-plan/capability.yaml +14 -0
  198. package/runtime/agents/execution-reviewer/capabilities/review-plan/decision-rules.md +6 -0
  199. package/runtime/agents/execution-reviewer/capabilities/review-plan/workflow.md +7 -0
  200. package/runtime/agents/execution-reviewer/infra/README.md +4 -0
  201. package/runtime/agents/execution-reviewer/knowledge/context.md +6 -0
  202. package/runtime/agents/execution-reviewer/knowledge/system.md +18 -0
  203. package/runtime/agents/execution-reviewer/templates/README.md +4 -0
  204. package/runtime/agents/figma-ui-ux-product-designer/agent.yaml +17 -5
  205. package/runtime/agents/figma-ui-ux-product-designer/capabilities/analyze-product-context/capability.yaml +1 -1
  206. package/runtime/agents/figma-ui-ux-product-designer/capabilities/conduct-design-interview/capability.yaml +1 -1
  207. package/runtime/agents/figma-ui-ux-product-designer/capabilities/conduct-design-review-session/capability.yaml +1 -1
  208. package/runtime/agents/figma-ui-ux-product-designer/capabilities/generate-dev-handoff/capability.yaml +1 -1
  209. package/runtime/agents/figma-ui-ux-product-designer/capabilities/generate-user-journey-diagram/capability.yaml +1 -1
  210. package/runtime/agents/figma-ui-ux-product-designer/capabilities/ingest-design-source/capability.yaml +1 -1
  211. package/runtime/agents/figma-ui-ux-product-designer/capabilities/triage-design-feedback/capability.yaml +1 -1
  212. package/runtime/agents/generic-agent-builder/AGENTS.md +20 -0
  213. package/runtime/agents/generic-agent-builder/README.md +40 -0
  214. package/runtime/agents/generic-agent-builder/agent.yaml +43 -0
  215. package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/capability.yaml +18 -0
  216. package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/decision-rules.md +5 -0
  217. package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/runner.py +33 -0
  218. package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/workflow.md +6 -0
  219. package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/capability.yaml +20 -0
  220. package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/decision-rules.md +6 -0
  221. package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/runner.py +39 -0
  222. package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/workflow.md +7 -0
  223. package/runtime/agents/generic-agent-builder/capabilities/generate-skill/capability.yaml +18 -0
  224. package/runtime/agents/generic-agent-builder/capabilities/generate-skill/decision-rules.md +5 -0
  225. package/runtime/agents/generic-agent-builder/capabilities/generate-skill/runner.py +33 -0
  226. package/runtime/agents/generic-agent-builder/capabilities/generate-skill/workflow.md +5 -0
  227. package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/capability.yaml +18 -0
  228. package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/decision-rules.md +6 -0
  229. package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/runner.py +33 -0
  230. package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/workflow.md +6 -0
  231. package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/capability.yaml +20 -0
  232. package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/decision-rules.md +6 -0
  233. package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/runner.py +40 -0
  234. package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/workflow.md +7 -0
  235. package/runtime/agents/generic-agent-builder/infra/integrations/generic-agent/generic_agent_repository.py +445 -0
  236. package/runtime/agents/generic-agent-builder/knowledge/context.md +11 -0
  237. package/runtime/agents/generic-agent-builder/knowledge/policies.yaml +12 -0
  238. package/runtime/agents/generic-agent-builder/knowledge/system.md +17 -0
  239. package/runtime/agents/generic-agent-builder/templates/generic-agent-instructions.md +17 -0
  240. package/runtime/agents/generic-agent-builder/templates/generic-review-report.md +13 -0
  241. package/runtime/agents/generic-agent-builder/templates/generic-skill.md +14 -0
  242. package/runtime/agents/generic-agent-builder/tests/test_runners.py +220 -0
  243. package/runtime/agents/github-pr-reviewer/agent.yaml +17 -5
  244. package/runtime/agents/github-pr-reviewer/capabilities/create-review-automation/capability.yaml +1 -1
  245. package/runtime/agents/github-pr-reviewer/capabilities/inspect-pr/capability.yaml +1 -1
  246. package/runtime/agents/github-pr-reviewer/capabilities/list-review-requests/capability.yaml +1 -1
  247. package/runtime/agents/github-pr-reviewer/capabilities/review-pr-diff/capability.yaml +1 -1
  248. package/runtime/agents/knowledge-generator/agent.yaml +13 -3
  249. package/runtime/agents/knowledge-generator/capabilities/generate-knowledge/capability.yaml +1 -1
  250. package/runtime/agents/local-llm-operator/AGENTS.md +8 -0
  251. package/runtime/agents/local-llm-operator/README.md +12 -0
  252. package/runtime/agents/local-llm-operator/agent.yaml +28 -0
  253. package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/capability.yaml +14 -0
  254. package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/decision-rules.md +6 -0
  255. package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/workflow.md +7 -0
  256. package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/capability.yaml +14 -0
  257. package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/decision-rules.md +5 -0
  258. package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/workflow.md +6 -0
  259. package/runtime/agents/local-llm-operator/capabilities/select-local-worker/capability.yaml +14 -0
  260. package/runtime/agents/local-llm-operator/capabilities/select-local-worker/decision-rules.md +6 -0
  261. package/runtime/agents/local-llm-operator/capabilities/select-local-worker/workflow.md +7 -0
  262. package/runtime/agents/local-llm-operator/infra/README.md +4 -0
  263. package/runtime/agents/local-llm-operator/knowledge/context.md +6 -0
  264. package/runtime/agents/local-llm-operator/knowledge/system.md +18 -0
  265. package/runtime/agents/local-llm-operator/templates/README.md +4 -0
  266. package/runtime/agents/n1-support-agent/agent.yaml +40 -1
  267. package/runtime/agents/n2-support-agent/agent.yaml +41 -2
  268. package/runtime/agents/n2-support-agent/knowledge/policies.yaml +2 -2
  269. package/runtime/agents/notification-operator/AGENTS.md +11 -0
  270. package/runtime/agents/notification-operator/README.md +15 -0
  271. package/runtime/agents/notification-operator/agent.yaml +43 -0
  272. package/runtime/agents/notification-operator/capabilities/configure-notification-channel/capability.yaml +19 -0
  273. package/runtime/agents/notification-operator/capabilities/configure-notification-channel/decision-rules.md +6 -0
  274. package/runtime/agents/notification-operator/capabilities/configure-notification-channel/runner.py +33 -0
  275. package/runtime/agents/notification-operator/capabilities/configure-notification-channel/workflow.md +6 -0
  276. package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/capability.yaml +25 -0
  277. package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/decision-rules.md +7 -0
  278. package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/runner.py +49 -0
  279. package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/workflow.md +6 -0
  280. package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/capability.yaml +27 -0
  281. package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/decision-rules.md +6 -0
  282. package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/runner.py +68 -0
  283. package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/workflow.md +7 -0
  284. package/runtime/agents/notification-operator/infra/README.md +6 -0
  285. package/runtime/agents/notification-operator/knowledge/context.md +10 -0
  286. package/runtime/agents/notification-operator/knowledge/policies.yaml +9 -0
  287. package/runtime/agents/notification-operator/knowledge/system.md +7 -0
  288. package/runtime/agents/notification-operator/templates/README.md +6 -0
  289. package/runtime/agents/notification-operator/tests/test_runners.py +108 -0
  290. package/runtime/agents/playwright-automation-builder/AGENTS.md +23 -0
  291. package/runtime/agents/playwright-automation-builder/README.md +43 -0
  292. package/runtime/agents/playwright-automation-builder/agent.yaml +48 -0
  293. package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/capability.yaml +20 -0
  294. package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/decision-rules.md +6 -0
  295. package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/runner.py +38 -0
  296. package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/workflow.md +6 -0
  297. package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/capability.yaml +18 -0
  298. package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/decision-rules.md +6 -0
  299. package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/runner.py +32 -0
  300. package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/workflow.md +6 -0
  301. package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/capability.yaml +18 -0
  302. package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/decision-rules.md +6 -0
  303. package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/runner.py +32 -0
  304. package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/workflow.md +6 -0
  305. package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/capability.yaml +19 -0
  306. package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/decision-rules.md +6 -0
  307. package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/runner.py +33 -0
  308. package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/workflow.md +6 -0
  309. package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/capability.yaml +22 -0
  310. package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/decision-rules.md +6 -0
  311. package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/runner.py +40 -0
  312. package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/workflow.md +6 -0
  313. package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/capability.yaml +22 -0
  314. package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/decision-rules.md +6 -0
  315. package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/runner.py +42 -0
  316. package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/workflow.md +6 -0
  317. package/runtime/agents/playwright-automation-builder/infra/integrations/playwright-automation/playwright_automation_repository.py +865 -0
  318. package/runtime/agents/playwright-automation-builder/knowledge/context.md +19 -0
  319. package/runtime/agents/playwright-automation-builder/knowledge/policies.yaml +25 -0
  320. package/runtime/agents/playwright-automation-builder/knowledge/system.md +19 -0
  321. package/runtime/agents/playwright-automation-builder/templates/capability-wrapper.md +4 -0
  322. package/runtime/agents/playwright-automation-builder/templates/playwright-automation.py +12 -0
  323. package/runtime/agents/playwright-automation-builder/templates/playwright-readme.md +13 -0
  324. package/runtime/agents/playwright-automation-builder/templates/playwright-review-report.md +9 -0
  325. package/runtime/agents/playwright-automation-builder/templates/playwright-test.py +2 -0
  326. package/runtime/agents/playwright-automation-builder/tests/test_runners.py +261 -0
  327. package/runtime/agents/postgres-data-analyzer/agent.yaml +13 -2
  328. package/runtime/agents/presentation-deck-builder/agent.yaml +14 -3
  329. package/runtime/agents/presentation-deck-builder/capabilities/create-template/capability.yaml +1 -1
  330. package/runtime/agents/presentation-deck-builder/capabilities/create-template-version/capability.yaml +1 -1
  331. package/runtime/agents/presentation-deck-builder/capabilities/generate-template-input-file/capability.yaml +1 -1
  332. package/runtime/agents/presentation-deck-builder/capabilities/refine-template/capability.yaml +1 -1
  333. package/runtime/agents/presentation-deck-builder/capabilities/register-template/capability.yaml +1 -1
  334. package/runtime/agents/presentation-deck-builder/knowledge/prompts/create-template.md +1 -1
  335. package/runtime/agents/presentation-deck-builder/knowledge/prompts/generate-template-input-file.md +1 -1
  336. package/runtime/agents/provider-configurator/AGENTS.md +8 -0
  337. package/runtime/agents/provider-configurator/README.md +5 -0
  338. package/runtime/agents/provider-configurator/agent.yaml +27 -0
  339. package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/capability.yaml +14 -0
  340. package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/decision-rules.md +6 -0
  341. package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/workflow.md +7 -0
  342. package/runtime/agents/provider-configurator/capabilities/configure-provider-source/capability.yaml +14 -0
  343. package/runtime/agents/provider-configurator/capabilities/configure-provider-source/decision-rules.md +6 -0
  344. package/runtime/agents/provider-configurator/capabilities/configure-provider-source/workflow.md +8 -0
  345. package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/capability.yaml +14 -0
  346. package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/decision-rules.md +6 -0
  347. package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/workflow.md +7 -0
  348. package/runtime/agents/provider-configurator/infra/README.md +5 -0
  349. package/runtime/agents/provider-configurator/knowledge/context.md +8 -0
  350. package/runtime/agents/provider-configurator/knowledge/system.md +19 -0
  351. package/runtime/agents/provider-configurator/templates/README.md +4 -0
  352. package/runtime/agents/pyautogui-automation-builder/AGENTS.md +32 -0
  353. package/runtime/agents/pyautogui-automation-builder/README.md +44 -0
  354. package/runtime/agents/pyautogui-automation-builder/agent.yaml +45 -0
  355. package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/capability.yaml +20 -0
  356. package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/decision-rules.md +6 -0
  357. package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/runner.py +39 -0
  358. package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/workflow.md +7 -0
  359. package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/capability.yaml +18 -0
  360. package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/decision-rules.md +7 -0
  361. package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/runner.py +33 -0
  362. package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/workflow.md +7 -0
  363. package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/capability.yaml +18 -0
  364. package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/decision-rules.md +8 -0
  365. package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/runner.py +33 -0
  366. package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/workflow.md +9 -0
  367. package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/capability.yaml +20 -0
  368. package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/decision-rules.md +8 -0
  369. package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/runner.py +43 -0
  370. package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/workflow.md +7 -0
  371. package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/capability.yaml +22 -0
  372. package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/decision-rules.md +6 -0
  373. package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/runner.py +43 -0
  374. package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/workflow.md +7 -0
  375. package/runtime/agents/pyautogui-automation-builder/infra/integrations/pyautogui-automation/pyautogui_automation_repository.py +856 -0
  376. package/runtime/agents/pyautogui-automation-builder/knowledge/context.md +17 -0
  377. package/runtime/agents/pyautogui-automation-builder/knowledge/policies.yaml +24 -0
  378. package/runtime/agents/pyautogui-automation-builder/knowledge/system.md +13 -0
  379. package/runtime/agents/pyautogui-automation-builder/templates/capability-wrapper.md +3 -0
  380. package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-automation.py +12 -0
  381. package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-readme.md +3 -0
  382. package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-review-report.md +3 -0
  383. package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-test.py +2 -0
  384. package/runtime/agents/pyautogui-automation-builder/tests/test_runners.py +376 -0
  385. package/runtime/agents/python-automation-builder/AGENTS.md +25 -0
  386. package/runtime/agents/python-automation-builder/README.md +43 -0
  387. package/runtime/agents/python-automation-builder/agent.yaml +45 -0
  388. package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/capability.yaml +20 -0
  389. package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/decision-rules.md +6 -0
  390. package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/runner.py +39 -0
  391. package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/workflow.md +7 -0
  392. package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/capability.yaml +18 -0
  393. package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/decision-rules.md +5 -0
  394. package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/runner.py +33 -0
  395. package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/workflow.md +5 -0
  396. package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/capability.yaml +18 -0
  397. package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/decision-rules.md +6 -0
  398. package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/runner.py +33 -0
  399. package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/workflow.md +6 -0
  400. package/runtime/agents/python-automation-builder/capabilities/review-python-automation/capability.yaml +20 -0
  401. package/runtime/agents/python-automation-builder/capabilities/review-python-automation/decision-rules.md +6 -0
  402. package/runtime/agents/python-automation-builder/capabilities/review-python-automation/runner.py +43 -0
  403. package/runtime/agents/python-automation-builder/capabilities/review-python-automation/workflow.md +5 -0
  404. package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/capability.yaml +22 -0
  405. package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/decision-rules.md +6 -0
  406. package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/runner.py +43 -0
  407. package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/workflow.md +6 -0
  408. package/runtime/agents/python-automation-builder/infra/integrations/python-automation/python_automation_repository.py +717 -0
  409. package/runtime/agents/python-automation-builder/knowledge/context.md +15 -0
  410. package/runtime/agents/python-automation-builder/knowledge/policies.yaml +12 -0
  411. package/runtime/agents/python-automation-builder/knowledge/system.md +19 -0
  412. package/runtime/agents/python-automation-builder/templates/automation-readme.md +13 -0
  413. package/runtime/agents/python-automation-builder/templates/automation-review-report.md +13 -0
  414. package/runtime/agents/python-automation-builder/templates/automation-test.py +9 -0
  415. package/runtime/agents/python-automation-builder/templates/automation.py +19 -0
  416. package/runtime/agents/python-automation-builder/templates/capability-wrapper.md +4 -0
  417. package/runtime/agents/python-automation-builder/tests/test_runners.py +292 -0
  418. package/runtime/agents/selenium-automation-builder/AGENTS.md +27 -0
  419. package/runtime/agents/selenium-automation-builder/README.md +40 -0
  420. package/runtime/agents/selenium-automation-builder/agent.yaml +45 -0
  421. package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/capability.yaml +20 -0
  422. package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/decision-rules.md +6 -0
  423. package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/runner.py +39 -0
  424. package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/workflow.md +7 -0
  425. package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/capability.yaml +18 -0
  426. package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/decision-rules.md +6 -0
  427. package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/runner.py +33 -0
  428. package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/workflow.md +6 -0
  429. package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/capability.yaml +18 -0
  430. package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/decision-rules.md +6 -0
  431. package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/runner.py +33 -0
  432. package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/workflow.md +6 -0
  433. package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/capability.yaml +20 -0
  434. package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/decision-rules.md +6 -0
  435. package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/runner.py +40 -0
  436. package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/workflow.md +6 -0
  437. package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/capability.yaml +22 -0
  438. package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/decision-rules.md +6 -0
  439. package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/runner.py +43 -0
  440. package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/workflow.md +6 -0
  441. package/runtime/agents/selenium-automation-builder/infra/integrations/selenium-automation/selenium_automation_repository.py +793 -0
  442. package/runtime/agents/selenium-automation-builder/knowledge/context.md +15 -0
  443. package/runtime/agents/selenium-automation-builder/knowledge/policies.yaml +17 -0
  444. package/runtime/agents/selenium-automation-builder/knowledge/system.md +18 -0
  445. package/runtime/agents/selenium-automation-builder/templates/capability-wrapper.md +4 -0
  446. package/runtime/agents/selenium-automation-builder/templates/selenium-automation.py +20 -0
  447. package/runtime/agents/selenium-automation-builder/templates/selenium-readme.md +13 -0
  448. package/runtime/agents/selenium-automation-builder/templates/selenium-review-report.md +13 -0
  449. package/runtime/agents/selenium-automation-builder/templates/selenium-test.py +9 -0
  450. package/runtime/agents/selenium-automation-builder/tests/test_runners.py +282 -0
  451. package/runtime/agents/software-specification-analyst/agent.yaml +17 -4
  452. package/runtime/agents/software-specification-analyst/capabilities/analyze-multiple-projects/capability.yaml +1 -1
  453. package/runtime/agents/software-specification-analyst/capabilities/analyze-project-context/capability.yaml +1 -1
  454. package/runtime/agents/software-specification-analyst/capabilities/conduct-requirements-interview/capability.yaml +1 -1
  455. package/runtime/agents/software-specification-analyst/capabilities/create-complete-spec/capability.yaml +1 -1
  456. package/runtime/agents/software-specification-analyst/capabilities/create-final-spec-from-analysis/capability.yaml +1 -1
  457. package/runtime/agents/software-specification-analyst/capabilities/create-functional-spec/capability.yaml +11 -0
  458. package/runtime/agents/software-specification-analyst/capabilities/create-technical-spec/capability.yaml +12 -0
  459. package/runtime/agents/software-specification-analyst/capabilities/refine-analysis-with-feedback/capability.yaml +1 -1
  460. package/runtime/agents/software-specification-analyst/capabilities/write-user-stories/capability.yaml +12 -0
  461. package/runtime/agents/sqlserver-change-operator/agent.yaml +12 -1
  462. package/runtime/agents/sqlserver-data-analyzer/agent.yaml +13 -2
  463. package/runtime/agents/supabase-project-analyst/AGENTS.md +29 -0
  464. package/runtime/agents/supabase-project-analyst/README.md +23 -0
  465. package/runtime/agents/supabase-project-analyst/agent.yaml +53 -0
  466. package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/capability.yaml +18 -0
  467. package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/decision-rules.md +5 -0
  468. package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/runner.py +32 -0
  469. package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/workflow.md +6 -0
  470. package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/capability.yaml +18 -0
  471. package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/decision-rules.md +6 -0
  472. package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/runner.py +32 -0
  473. package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/workflow.md +7 -0
  474. package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/capability.yaml +18 -0
  475. package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/decision-rules.md +5 -0
  476. package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/runner.py +32 -0
  477. package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/workflow.md +6 -0
  478. package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/capability.yaml +18 -0
  479. package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/decision-rules.md +6 -0
  480. package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/runner.py +32 -0
  481. package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/workflow.md +6 -0
  482. package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/capability.yaml +19 -0
  483. package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/decision-rules.md +6 -0
  484. package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/runner.py +36 -0
  485. package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/workflow.md +7 -0
  486. package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/capability.yaml +18 -0
  487. package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/decision-rules.md +6 -0
  488. package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/runner.py +32 -0
  489. package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/workflow.md +6 -0
  490. package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/capability.yaml +18 -0
  491. package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/decision-rules.md +6 -0
  492. package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/runner.py +32 -0
  493. package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/workflow.md +5 -0
  494. package/runtime/agents/supabase-project-analyst/infra/integrations/supabase-project/supabase_project_repository.py +589 -0
  495. package/runtime/agents/supabase-project-analyst/knowledge/context.md +11 -0
  496. package/runtime/agents/supabase-project-analyst/knowledge/policies.yaml +24 -0
  497. package/runtime/agents/supabase-project-analyst/knowledge/system.md +10 -0
  498. package/runtime/agents/supabase-project-analyst/templates/supabase-audit.md +3 -0
  499. package/runtime/agents/supabase-project-analyst/templates/supabase-fix-plan.md +3 -0
  500. package/runtime/agents/supabase-project-analyst/templates/supabase-inspection.md +3 -0
  501. package/runtime/agents/supabase-project-analyst/templates/supabase-report.md +3 -0
  502. package/runtime/agents/supabase-project-analyst/tests/test_runners.py +239 -0
  503. package/runtime/agents/task-orchestrator/AGENTS.md +8 -0
  504. package/runtime/agents/task-orchestrator/README.md +7 -0
  505. package/runtime/agents/task-orchestrator/agent.yaml +53 -0
  506. package/runtime/agents/task-orchestrator/capabilities/coordinate-execution/capability.yaml +15 -0
  507. package/runtime/agents/task-orchestrator/capabilities/coordinate-execution/decision-rules.md +6 -0
  508. package/runtime/agents/task-orchestrator/capabilities/coordinate-execution/workflow.md +7 -0
  509. package/runtime/agents/task-orchestrator/capabilities/plan-task/capability.yaml +14 -0
  510. package/runtime/agents/task-orchestrator/capabilities/plan-task/decision-rules.md +6 -0
  511. package/runtime/agents/task-orchestrator/capabilities/plan-task/workflow.md +8 -0
  512. package/runtime/agents/task-orchestrator/capabilities/select-specialists/capability.yaml +14 -0
  513. package/runtime/agents/task-orchestrator/capabilities/select-specialists/decision-rules.md +6 -0
  514. package/runtime/agents/task-orchestrator/capabilities/select-specialists/workflow.md +7 -0
  515. package/runtime/agents/task-orchestrator/infra/README.md +5 -0
  516. package/runtime/agents/task-orchestrator/knowledge/context.md +9 -0
  517. package/runtime/agents/task-orchestrator/knowledge/system.md +20 -0
  518. package/runtime/agents/task-orchestrator/templates/README.md +4 -0
  519. package/runtime/agents/technical-integration-analyst/agent.yaml +15 -2
  520. package/runtime/agents/topdesk-orchestrator/agent.yaml +10 -2
  521. package/runtime/cli/README.md +76 -11
  522. package/runtime/cli/aikit/__init__.py +1 -1
  523. package/runtime/cli/aikit/acceptance.py +166 -0
  524. package/runtime/cli/aikit/agent_executor.py +89 -0
  525. package/runtime/cli/aikit/agent_registry.py +319 -0
  526. package/runtime/cli/aikit/app_home.py +87 -2
  527. package/runtime/cli/aikit/architecture.py +84 -0
  528. package/runtime/cli/aikit/audit.py +216 -3
  529. package/runtime/cli/aikit/autonomy.py +237 -0
  530. package/runtime/cli/aikit/capability_runtime.py +522 -0
  531. package/runtime/cli/aikit/catalog.py +246 -0
  532. package/runtime/cli/aikit/cli_dispatch.py +1078 -0
  533. package/runtime/cli/aikit/cli_parser.py +409 -0
  534. package/runtime/cli/aikit/collaboration.py +359 -0
  535. package/runtime/cli/aikit/configuration_orchestrator.py +52 -26
  536. package/runtime/cli/aikit/contribution.py +105 -0
  537. package/runtime/cli/aikit/control_router.py +298 -0
  538. package/runtime/cli/aikit/core/__init__.py +1 -0
  539. package/runtime/cli/aikit/core/capability_contract.py +112 -0
  540. package/runtime/cli/aikit/core/requests.py +69 -0
  541. package/runtime/cli/aikit/core/runtime.py +64 -0
  542. package/runtime/cli/aikit/decision_store.py +17 -0
  543. package/runtime/cli/aikit/diagnostics.py +10 -3
  544. package/runtime/cli/aikit/doctor_runtime.py +79 -0
  545. package/runtime/cli/aikit/errors.py +7 -0
  546. package/runtime/cli/aikit/eval.py +158 -0
  547. package/runtime/cli/aikit/execution_reviewer.py +195 -0
  548. package/runtime/cli/aikit/extensions.py +140 -0
  549. package/runtime/cli/aikit/fallback.py +1 -0
  550. package/runtime/cli/aikit/github_pr.py +23 -0
  551. package/runtime/cli/aikit/guardrails.py +25 -10
  552. package/runtime/cli/aikit/human_output.py +1026 -0
  553. package/runtime/cli/aikit/impact_map.py +294 -0
  554. package/runtime/cli/aikit/install.py +4 -3
  555. package/runtime/cli/aikit/interactive_wizard.py +79 -0
  556. package/runtime/cli/aikit/local_llm_operator.py +146 -0
  557. package/runtime/cli/aikit/lock.py +4 -1
  558. package/runtime/cli/aikit/main.py +11 -2561
  559. package/runtime/cli/aikit/mcp_manifest.py +229 -0
  560. package/runtime/cli/aikit/mcp_server.py +132 -0
  561. package/runtime/cli/aikit/mcp_tools.py +262 -0
  562. package/runtime/cli/aikit/mini_brain.py +227 -0
  563. package/runtime/cli/aikit/model_router.py +193 -20
  564. package/runtime/cli/aikit/module_controller.py +335 -0
  565. package/runtime/cli/aikit/natural_prompt_runtime.py +538 -0
  566. package/runtime/cli/aikit/notifications.py +716 -2
  567. package/runtime/cli/aikit/ollama.py +1 -0
  568. package/runtime/cli/aikit/orchestrator.py +1225 -0
  569. package/runtime/cli/aikit/output.py +63 -2
  570. package/runtime/cli/aikit/permissions.py +14 -4
  571. package/runtime/cli/aikit/prompt_injection.py +57 -0
  572. package/runtime/cli/aikit/review_gate.py +38 -6
  573. package/runtime/cli/aikit/roadmap.py +195 -0
  574. package/runtime/cli/aikit/roadmap_cli.py +70 -0
  575. package/runtime/cli/aikit/router.py +41 -12
  576. package/runtime/cli/aikit/router_explain.py +152 -0
  577. package/runtime/cli/aikit/runtime_paths.py +11 -0
  578. package/runtime/cli/aikit/secrets.py +113 -0
  579. package/runtime/cli/aikit/sessions.py +125 -2
  580. package/runtime/cli/aikit/setup_wizard_payload.py +32 -0
  581. package/runtime/cli/aikit/sources.py +298 -46
  582. package/runtime/cli/aikit/tasks.py +449 -21
  583. package/runtime/cli/aikit/wizard_state.py +517 -0
  584. package/runtime/cli/aikit/workflows.py +115 -0
  585. package/runtime/cli/aikit/write_policy.py +108 -0
  586. package/runtime/plugins/claude-code-ai-devkit/README.md +17 -0
  587. package/runtime/plugins/claude-code-ai-devkit/agents/README.md +29 -2
  588. package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-db-analyst.md +44 -0
  589. package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-execution-reviewer.md +38 -0
  590. package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-pr-reviewer.md +42 -0
  591. package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-repo-explorer.md +40 -0
  592. package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-support-triage.md +43 -0
  593. package/runtime/plugins/claude-code-ai-devkit/plugin.json +1 -1
  594. package/runtime/plugins/claude-code-ai-devkit/skills/ai-devkit-router/SKILL.md +16 -0
  595. package/runtime/plugins/claude-skill-ai-devkit/ai-devkit/SKILL.md +1 -0
  596. package/runtime/plugins/claude-skill-ai-devkit/ai-devkit/references/subagents.md +21 -0
  597. package/runtime/plugins/claude-skill-ai-devkit/plugin.json +1 -1
  598. package/runtime/providers/azure-devops.yaml +9 -0
  599. package/runtime/providers/github.yaml +4 -0
  600. package/runtime/providers/local-notification.yaml +5 -2
  601. package/runtime/providers/local-scheduler.yaml +1 -1
  602. package/runtime/providers/supabase.yaml +46 -0
  603. package/runtime/scripts/release-catalog-snapshot.json +543 -0
  604. package/runtime/scripts/release-gate.py +141 -1
  605. package/runtime/scripts/validate-repo.py +312 -0
  606. package/runtime/vendor/skills/napkin/napkin.md +15 -9
@@ -1,9 +1,723 @@
1
- """Notification payload helpers for local automations."""
1
+ """Best-effort local desktop notifications for Agent DevKit."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import json
6
+ import os
7
+ import platform
8
+ import shutil
9
+ import subprocess
10
+ from datetime import datetime, timezone
11
+ from pathlib import Path
5
12
  from typing import Any
6
13
 
14
+ from cli.aikit.app_home import config_path, ensure_app_home, app_path
15
+ from cli.aikit.memory import redact_secrets
16
+
17
+
18
+ SUPPORTED_EVENTS = (
19
+ "task.started",
20
+ "task.completed",
21
+ "task.failed",
22
+ "task.blocked",
23
+ "scheduled_task.started",
24
+ "scheduled_task.progress",
25
+ "scheduled_task.completed",
26
+ "scheduled_task.failed",
27
+ "scheduled_task.blocked",
28
+ "scheduled_task.retry_scheduled",
29
+ "scheduled_task.skipped",
30
+ "automation.completed",
31
+ "automation.failed",
32
+ "wizard.waiting",
33
+ "review.required",
34
+ "provider.missing",
35
+ "artifact.generated",
36
+ )
37
+ SEVERITIES = {"info", "warning", "error", "action_required"}
38
+ DEFAULT_EVENTS = ["task.failed", "task.blocked", "scheduled_task.failed", "scheduled_task.blocked"]
39
+ DEFAULT_TITLE = "Agent DevKit"
40
+ MAX_TITLE_LENGTH = 80
41
+ MAX_MESSAGE_LENGTH = 180
42
+ NOTIFICATION_TIMEOUT_SECONDS = 5
43
+ LOCAL_CHANNELS = ("desktop", "terminal", "stdout", "audit")
44
+ REMOTE_CHANNELS = ("slack", "teams", "whatsapp", "webhook", "mcp-gateway")
45
+ CHANNEL_ALIASES = {"local": "desktop", "console": "stdout"}
46
+
7
47
 
8
48
  def terminal_notification(message: str) -> dict[str, Any]:
9
- return {"type": "terminal", "message": message}
49
+ return {"type": "terminal", "message": sanitize_message(message)}
50
+
51
+
52
+ def list_notification_events() -> dict[str, Any]:
53
+ return {
54
+ "kind": "notifications",
55
+ "status": "ok",
56
+ "events": list(SUPPORTED_EVENTS),
57
+ "severities": sorted(SEVERITIES),
58
+ }
59
+
60
+
61
+ def list_notification_channels() -> dict[str, Any]:
62
+ return {
63
+ "kind": "notifications",
64
+ "status": "ok",
65
+ "action": "list-channels",
66
+ "channels": [
67
+ {"id": channel, "scope": "local", "status": "supported"}
68
+ for channel in LOCAL_CHANNELS
69
+ ]
70
+ + [
71
+ {"id": channel, "scope": "remote", "status": "future"}
72
+ for channel in REMOTE_CHANNELS
73
+ ],
74
+ }
75
+
76
+
77
+ def notification_doctor() -> dict[str, Any]:
78
+ backend = detect_desktop_backend()
79
+ config = notification_config()
80
+ return {
81
+ "kind": "notifications",
82
+ "status": "ok" if backend["available"] or backend["status"] in {"unsupported", "headless"} else "missing",
83
+ "action": "doctor",
84
+ "desktop": {
85
+ "enabled": config["desktop"]["enabled"],
86
+ "events": config["desktop"]["events"],
87
+ "backend": backend,
88
+ },
89
+ "history_path": str(notification_history_path()),
90
+ }
91
+
92
+
93
+ def configure_notifications(*, enabled: bool | None = None, events: list[str] | None = None) -> dict[str, Any]:
94
+ config = load_app_config()
95
+ notifications = config.setdefault("notifications", {})
96
+ desktop = notifications.setdefault("desktop", {})
97
+ if enabled is not None:
98
+ desktop["enabled"] = bool(enabled)
99
+ if events is not None:
100
+ normalized_events = normalize_events(events)
101
+ desktop["events"] = normalized_events
102
+ desktop.setdefault("enabled", False)
103
+ desktop.setdefault("events", list(DEFAULT_EVENTS))
104
+ channels = notifications.setdefault("channels", {})
105
+ desktop_channel = channels.setdefault("desktop", {})
106
+ desktop_channel["enabled"] = desktop["enabled"]
107
+ desktop_channel["events"] = list(desktop["events"])
108
+ path = save_app_config(config)
109
+ return {
110
+ "kind": "notifications",
111
+ "status": "configured",
112
+ "action": "configure",
113
+ "desktop": notification_config(config)["desktop"],
114
+ "config_path": str(path),
115
+ "stored_secret": False,
116
+ }
117
+
118
+
119
+ def configure_notification_channel(
120
+ channel: str,
121
+ *,
122
+ enabled: bool | None = None,
123
+ events: list[str] | None = None,
124
+ ) -> dict[str, Any]:
125
+ normalized_channel = normalize_channel(channel)
126
+ if normalized_channel not in LOCAL_CHANNELS:
127
+ return {
128
+ "kind": "notifications",
129
+ "status": "unsupported",
130
+ "ok": False,
131
+ "action": "configure-channel",
132
+ "channel": normalized_channel,
133
+ "reason": "remote-channel-out-of-scope",
134
+ }
135
+ config = load_app_config()
136
+ notifications = config.setdefault("notifications", {})
137
+ channels = notifications.setdefault("channels", {})
138
+ channel_config = channels.setdefault(normalized_channel, {})
139
+ if enabled is not None:
140
+ channel_config["enabled"] = bool(enabled)
141
+ if events is not None:
142
+ channel_config["events"] = normalize_events(events)
143
+ channel_config.setdefault("enabled", False)
144
+ channel_config.setdefault("events", list(DEFAULT_EVENTS))
145
+ if normalized_channel == "desktop":
146
+ desktop = notifications.setdefault("desktop", {})
147
+ desktop["enabled"] = channel_config["enabled"]
148
+ desktop["events"] = list(channel_config["events"])
149
+ path = save_app_config(config)
150
+ return {
151
+ "kind": "notifications",
152
+ "status": "configured",
153
+ "action": "configure-channel",
154
+ "channel": normalized_channel,
155
+ "channel_config": notification_config(config)["channels"][normalized_channel],
156
+ "config_path": str(path),
157
+ "stored_secret": False,
158
+ }
159
+
160
+
161
+ def send_notification_command(
162
+ *,
163
+ title: str = DEFAULT_TITLE,
164
+ message: str,
165
+ event: str = "task.completed",
166
+ severity: str = "info",
167
+ task_id: str | None = None,
168
+ origin: str = "cli",
169
+ status: str | None = None,
170
+ summary: str | None = None,
171
+ artifacts: list[str] | None = None,
172
+ next_steps: list[str] | None = None,
173
+ sensitive: bool = False,
174
+ channels: list[str] | None = None,
175
+ ) -> dict[str, Any]:
176
+ return send_notification(
177
+ {
178
+ "event": event,
179
+ "title": title,
180
+ "message": message,
181
+ "summary": summary,
182
+ "status": status,
183
+ "severity": severity,
184
+ "task_id": task_id,
185
+ "origin": origin,
186
+ "artifacts": artifacts or [],
187
+ "next_steps": next_steps or [],
188
+ "sensitive": sensitive,
189
+ },
190
+ force=True,
191
+ channels=channels,
192
+ )
193
+
194
+
195
+ def format_notification_event(payload: dict[str, Any]) -> dict[str, Any]:
196
+ event = normalize_event(payload.get("event"))
197
+ severity = normalize_severity(payload.get("severity"))
198
+ summary = sanitize_message(str(payload.get("summary") or payload.get("message") or ""))
199
+ task_id = sanitize_optional(payload.get("task_id"))
200
+ if not summary:
201
+ summary = fallback_message(event, task_id)
202
+ event_payload = {
203
+ "kind": "notification-event",
204
+ "event": event,
205
+ "status": normalize_status(payload.get("status") or status_for_event(event)),
206
+ "task_id": task_id,
207
+ "title": sanitize_title(str(payload.get("title") or DEFAULT_TITLE)),
208
+ "summary": summary,
209
+ "message": summary,
210
+ "artifacts": safe_list(payload.get("artifacts")),
211
+ "next_steps": safe_list(payload.get("next_steps")),
212
+ "severity": severity,
213
+ "sensitive": bool(payload.get("sensitive") is True),
214
+ "origin": normalize_origin(payload.get("origin")),
215
+ }
216
+ for key in ("run_id", "scheduled_for", "started_at", "finished_at", "next_run", "audit_id"):
217
+ value = sanitize_optional(payload.get(key))
218
+ if value is not None:
219
+ event_payload[key] = value
220
+ for key in ("duration_seconds", "attempt", "max_attempts"):
221
+ value = payload.get(key)
222
+ if value is not None:
223
+ event_payload[key] = safe_number(value)
224
+ return event_payload
225
+
226
+
227
+ def send_notification(payload: dict[str, Any], *, force: bool = False, channels: list[str] | None = None) -> dict[str, Any]:
228
+ notification = format_notification_event(payload)
229
+ requested_channels = normalize_channels(channels or payload.get("channels") or ["desktop"])
230
+ deliveries = [send_notification_to_channel(channel, notification, force=force) for channel in requested_channels]
231
+ if len(deliveries) == 1:
232
+ result = deliveries[0]
233
+ else:
234
+ failed = [item for item in deliveries if item.get("ok") is False]
235
+ result = {
236
+ "kind": "notifications",
237
+ "status": "failed" if failed else "sent",
238
+ "ok": not failed,
239
+ "deliveries": deliveries,
240
+ "notification": notification,
241
+ }
242
+ record_notification_attempt(result)
243
+ return result
244
+
245
+
246
+ def send_notification_to_channel(channel: str, notification: dict[str, Any], *, force: bool) -> dict[str, Any]:
247
+ if channel in {"terminal", "stdout", "audit"}:
248
+ return {
249
+ "kind": "notifications",
250
+ "status": "sent",
251
+ "ok": True,
252
+ "channel": channel,
253
+ "notification": notification,
254
+ }
255
+ if channel in REMOTE_CHANNELS:
256
+ return {
257
+ "kind": "notifications",
258
+ "status": "skipped",
259
+ "ok": True,
260
+ "channel": channel,
261
+ "reason": "remote-channel-not-configured",
262
+ "notification": notification,
263
+ }
264
+
265
+ config = notification_config()
266
+ if not force and not event_enabled(notification["event"], config, channel=channel):
267
+ return {
268
+ "kind": "notifications",
269
+ "status": "skipped",
270
+ "ok": True,
271
+ "channel": channel,
272
+ "reason": "event-disabled",
273
+ "notification": notification,
274
+ }
275
+
276
+ backend = detect_desktop_backend()
277
+ if not backend["available"]:
278
+ return {
279
+ "kind": "notifications",
280
+ "status": "skipped",
281
+ "ok": True,
282
+ "channel": channel,
283
+ "reason": backend["reason"],
284
+ "backend": backend,
285
+ "notification": notification,
286
+ }
287
+
288
+ return invoke_backend(backend, notification)
289
+
290
+
291
+ def maybe_notify_task(task: dict[str, Any], event: str, *, origin: str = "cli", result: dict[str, Any] | None = None) -> dict[str, Any] | None:
292
+ channels = task_notification_channels(task, event)
293
+ if not channels and not should_notify_task(task, event):
294
+ return None
295
+ title = str(task.get("title") or task.get("id") or "Task")
296
+ payload = {
297
+ "event": event,
298
+ "title": DEFAULT_TITLE,
299
+ "message": task_event_message(event, task),
300
+ "severity": severity_for_event(event),
301
+ "task_id": str(task.get("id") or ""),
302
+ "origin": origin,
303
+ "artifacts": (result or {}).get("artifacts") or [],
304
+ "next_steps": (result or {}).get("next_steps") or [],
305
+ }
306
+ for key in ("run_id", "scheduled_for", "started_at", "finished_at", "duration_seconds", "next_run", "audit_id", "attempt", "max_attempts"):
307
+ if result and result.get(key) is not None:
308
+ payload[key] = result[key]
309
+ if title and title != payload["task_id"]:
310
+ payload["message"] = f"{payload['message']} ({title})"
311
+ return send_notification(payload, force=bool(channels), channels=channels or None)
312
+
313
+
314
+ def should_notify_task(task: dict[str, Any], event: str) -> bool:
315
+ normalized_event = normalize_event(event)
316
+ if task_notification_channels(task, normalized_event):
317
+ return True
318
+ return event_enabled(normalized_event, notification_config())
319
+
320
+
321
+ def has_explicit_desktop_notification(task: dict[str, Any], event: str) -> bool:
322
+ return "desktop" in task_notification_channels(task, event)
323
+
324
+
325
+ def task_notification_channels(task: dict[str, Any], event: str) -> list[str]:
326
+ normalized_event = normalize_event(event)
327
+ channels: list[str] = []
328
+ notify = task.get("notify") if isinstance(task.get("notify"), dict) else {}
329
+ if notify:
330
+ configured = normalize_task_notification_events(notify.get("on"))
331
+ if normalized_event in configured:
332
+ channels.extend(normalize_channels(notify.get("channels") or ["desktop"]))
333
+ for item in task.get("notifications") or []:
334
+ if not isinstance(item, dict):
335
+ continue
336
+ if item.get("enabled") is False:
337
+ continue
338
+ configured = normalize_task_notification_events(item.get("on"))
339
+ if normalized_event in configured:
340
+ if isinstance(item.get("channels"), list):
341
+ channels.extend(normalize_channels(item.get("channels")))
342
+ else:
343
+ channels.append(normalize_channel(item.get("type") or "desktop"))
344
+ return dedupe(channels)
345
+
346
+
347
+ def normalize_task_notification_events(events: Any) -> set[str]:
348
+ raw_events = events if isinstance(events, list) else ["failed", "blocked", "completed"]
349
+ normalized: set[str] = set()
350
+ for event in raw_events:
351
+ value = str(event or "").strip().lower()
352
+ if value in {"completion", "completed", "success", "ok"}:
353
+ normalized.add("task.completed")
354
+ normalized.add("scheduled_task.completed")
355
+ elif value in {"failure", "failed", "error"}:
356
+ normalized.add("task.failed")
357
+ normalized.add("scheduled_task.failed")
358
+ elif value in {"blocked", "block"}:
359
+ normalized.add("task.blocked")
360
+ normalized.add("scheduled_task.blocked")
361
+ elif value in {"start", "started"}:
362
+ normalized.add("task.started")
363
+ normalized.add("scheduled_task.started")
364
+ elif value in {"progress", "running", "in_progress"}:
365
+ normalized.add("scheduled_task.progress")
366
+ elif value in {"retry", "retry_scheduled", "retry-scheduled"}:
367
+ normalized.add("scheduled_task.retry_scheduled")
368
+ elif value in {"skip", "skipped"}:
369
+ normalized.add("scheduled_task.skipped")
370
+ elif value.startswith("task.") or value.startswith("scheduled_task."):
371
+ normalized.add(normalize_event(value))
372
+ return normalized
373
+
374
+
375
+ def notification_config(config: dict[str, Any] | None = None) -> dict[str, Any]:
376
+ if config is None:
377
+ config = load_app_config()
378
+ notifications = config.get("notifications") if isinstance(config.get("notifications"), dict) else {}
379
+ desktop = notifications.get("desktop") if isinstance(notifications.get("desktop"), dict) else {}
380
+ channel_configs = notifications.get("channels") if isinstance(notifications.get("channels"), dict) else {}
381
+ channels: dict[str, dict[str, Any]] = {}
382
+ for channel in LOCAL_CHANNELS:
383
+ raw = channel_configs.get(channel) if isinstance(channel_configs.get(channel), dict) else {}
384
+ if channel == "desktop":
385
+ raw = {**desktop, **raw}
386
+ channels[channel] = {
387
+ "enabled": raw.get("enabled") is True,
388
+ "events": normalize_events(raw.get("events") if isinstance(raw.get("events"), list) else DEFAULT_EVENTS),
389
+ }
390
+ return {
391
+ "desktop": {
392
+ "enabled": channels["desktop"]["enabled"],
393
+ "events": channels["desktop"]["events"],
394
+ "quiet_hours": desktop.get("quiet_hours"),
395
+ },
396
+ "channels": channels,
397
+ }
398
+
399
+
400
+ def load_app_config() -> dict[str, Any]:
401
+ path = config_path()
402
+ if not path.exists():
403
+ return {}
404
+ try:
405
+ data = json.loads(path.read_text(encoding="utf-8"))
406
+ except json.JSONDecodeError:
407
+ return {}
408
+ return data if isinstance(data, dict) else {}
409
+
410
+
411
+ def save_app_config(config: dict[str, Any]) -> Path:
412
+ ensure_app_home()
413
+ path = config_path()
414
+ path.write_text(json.dumps(config, ensure_ascii=False, indent=2, sort_keys=True) + "\n", encoding="utf-8")
415
+ return path
416
+
417
+
418
+ def notification_history_path() -> Path:
419
+ ensure_app_home()
420
+ path = app_path("logs", "notifications.jsonl")
421
+ path.parent.mkdir(parents=True, exist_ok=True)
422
+ return path
423
+
424
+
425
+ def record_notification_attempt(result: dict[str, Any]) -> None:
426
+ notification = result.get("notification") or {}
427
+ entries: list[dict[str, Any]] = []
428
+ deliveries = result.get("deliveries") if isinstance(result.get("deliveries"), list) else [result]
429
+ for delivery in deliveries:
430
+ if not isinstance(delivery, dict):
431
+ continue
432
+ entries.append(
433
+ {
434
+ "created_at": datetime.now(timezone.utc).isoformat(),
435
+ "event": notification.get("event") or (delivery.get("notification") or {}).get("event"),
436
+ "channel": delivery.get("channel") or "desktop",
437
+ "status": delivery.get("status"),
438
+ "reason": delivery.get("reason"),
439
+ "origin": notification.get("origin") or (delivery.get("notification") or {}).get("origin"),
440
+ "task_id": notification.get("task_id") or (delivery.get("notification") or {}).get("task_id"),
441
+ }
442
+ )
443
+ try:
444
+ with notification_history_path().open("a", encoding="utf-8") as file:
445
+ for entry in entries:
446
+ file.write(json.dumps(entry, ensure_ascii=False, sort_keys=True) + "\n")
447
+ except OSError:
448
+ return
449
+
450
+
451
+ def detect_desktop_backend() -> dict[str, Any]:
452
+ system = platform.system().lower()
453
+ if system == "darwin":
454
+ command = shutil.which("osascript")
455
+ return {
456
+ "platform": "macos",
457
+ "name": "osascript",
458
+ "available": bool(command),
459
+ "status": "ok" if command else "missing",
460
+ "command": command,
461
+ "reason": None if command else "desktop-notification-unavailable",
462
+ }
463
+ if system == "linux":
464
+ if not (os.environ.get("DISPLAY") or os.environ.get("WAYLAND_DISPLAY")):
465
+ return {
466
+ "platform": "linux",
467
+ "name": "notify-send",
468
+ "available": False,
469
+ "status": "headless",
470
+ "command": None,
471
+ "reason": "desktop-session-unavailable",
472
+ }
473
+ command = shutil.which("notify-send")
474
+ return {
475
+ "platform": "linux",
476
+ "name": "notify-send",
477
+ "available": bool(command),
478
+ "status": "ok" if command else "missing",
479
+ "command": command,
480
+ "reason": None if command else "desktop-notification-unavailable",
481
+ }
482
+ if system == "windows":
483
+ return {
484
+ "platform": "windows",
485
+ "name": "powershell-toast",
486
+ "available": False,
487
+ "status": "unsupported",
488
+ "command": None,
489
+ "reason": "desktop-notification-unsupported",
490
+ "next_steps": ["Windows toast backend is not enabled in this build; notification attempt will be recorded as skipped."],
491
+ }
492
+ return {
493
+ "platform": system or "unknown",
494
+ "name": None,
495
+ "available": False,
496
+ "status": "unsupported",
497
+ "command": None,
498
+ "reason": "desktop-notification-unsupported",
499
+ }
500
+
501
+
502
+ def invoke_backend(backend: dict[str, Any], notification: dict[str, Any]) -> dict[str, Any]:
503
+ command = backend.get("command")
504
+ if not command:
505
+ return {
506
+ "kind": "notifications",
507
+ "status": "skipped",
508
+ "ok": True,
509
+ "channel": "desktop",
510
+ "reason": "desktop-notification-unavailable",
511
+ "backend": backend,
512
+ "notification": notification,
513
+ }
514
+ if backend.get("platform") == "macos":
515
+ args = [str(command), "-e", f'display notification {json.dumps(notification["message"])} with title {json.dumps(notification["title"])}']
516
+ elif backend.get("platform") == "linux":
517
+ args = [str(command), notification["title"], notification["message"]]
518
+ if notification.get("severity") == "error":
519
+ args.extend(["-u", "critical"])
520
+ else:
521
+ return {
522
+ "kind": "notifications",
523
+ "status": "skipped",
524
+ "ok": True,
525
+ "channel": "desktop",
526
+ "reason": "desktop-notification-unsupported",
527
+ "backend": backend,
528
+ "notification": notification,
529
+ }
530
+ try:
531
+ process = subprocess.run(
532
+ args,
533
+ check=False,
534
+ text=True,
535
+ stdout=subprocess.PIPE,
536
+ stderr=subprocess.PIPE,
537
+ timeout=NOTIFICATION_TIMEOUT_SECONDS,
538
+ )
539
+ except (OSError, subprocess.TimeoutExpired) as exc:
540
+ return {
541
+ "kind": "notifications",
542
+ "status": "failed",
543
+ "ok": False,
544
+ "channel": "desktop",
545
+ "reason": "desktop-notification-failed",
546
+ "message": redact_secrets(str(exc)),
547
+ "backend": backend,
548
+ "notification": notification,
549
+ }
550
+ if process.returncode != 0:
551
+ return {
552
+ "kind": "notifications",
553
+ "status": "failed",
554
+ "ok": False,
555
+ "channel": "desktop",
556
+ "reason": "desktop-notification-failed",
557
+ "returncode": process.returncode,
558
+ "message": sanitize_message(process.stderr or process.stdout or "notification command failed"),
559
+ "backend": backend,
560
+ "notification": notification,
561
+ }
562
+ return {
563
+ "kind": "notifications",
564
+ "status": "sent",
565
+ "ok": True,
566
+ "channel": "desktop",
567
+ "backend": backend,
568
+ "notification": notification,
569
+ }
570
+
571
+
572
+ def event_enabled(event: str, config: dict[str, Any], *, channel: str = "desktop") -> bool:
573
+ channels = config.get("channels") if isinstance(config.get("channels"), dict) else {}
574
+ channel_config = channels.get(channel) if isinstance(channels.get(channel), dict) else None
575
+ if channel_config is None and channel == "desktop":
576
+ channel_config = config.get("desktop") if isinstance(config.get("desktop"), dict) else {}
577
+ return bool(channel_config and channel_config.get("enabled") is True and event in set(channel_config.get("events") or []))
578
+
579
+
580
+ def normalize_events(events: Any) -> list[str]:
581
+ raw = events if isinstance(events, list) else []
582
+ normalized: list[str] = []
583
+ for event in raw:
584
+ value = normalize_event(event)
585
+ if value not in normalized:
586
+ normalized.append(value)
587
+ return normalized or list(DEFAULT_EVENTS)
588
+
589
+
590
+ def normalize_event(event: Any) -> str:
591
+ value = str(event or "").strip().lower()
592
+ if value in SUPPORTED_EVENTS:
593
+ return value
594
+ raise ValueError(f"unsupported notification event: {event}. available: {', '.join(SUPPORTED_EVENTS)}")
595
+
596
+
597
+ def normalize_status(status: Any) -> str:
598
+ value = str(status or "ok").strip().lower()
599
+ allowed = {"ok", "failed", "blocked", "needs-action", "generated", "running", "retry_scheduled", "skipped"}
600
+ if value in allowed:
601
+ return value
602
+ raise ValueError(f"unsupported notification status: {status}. available: {', '.join(sorted(allowed))}")
603
+
604
+
605
+ def normalize_channel(channel: Any) -> str:
606
+ value = str(channel or "desktop").strip().lower()
607
+ value = CHANNEL_ALIASES.get(value, value)
608
+ if value in LOCAL_CHANNELS or value in REMOTE_CHANNELS:
609
+ return value
610
+ raise ValueError(f"unsupported notification channel: {channel}. available: {', '.join(LOCAL_CHANNELS + REMOTE_CHANNELS)}")
611
+
612
+
613
+ def normalize_channels(channels: Any) -> list[str]:
614
+ raw = channels if isinstance(channels, list) else [channels]
615
+ normalized = [normalize_channel(channel) for channel in raw if str(channel or "").strip()]
616
+ return dedupe(normalized) or ["desktop"]
617
+
618
+
619
+ def normalize_severity(severity: Any) -> str:
620
+ value = str(severity or "info").strip().lower()
621
+ if value in SEVERITIES:
622
+ return value
623
+ raise ValueError(f"unsupported notification severity: {severity}. available: {', '.join(sorted(SEVERITIES))}")
624
+
625
+
626
+ def normalize_origin(origin: Any) -> str:
627
+ value = str(origin or "cli").strip().lower()
628
+ allowed = {"cli", "scheduler", "mcp", "wizard", "agent-prompt", "plugin", "core"}
629
+ return value if value in allowed else "cli"
630
+
631
+
632
+ def severity_for_event(event: str) -> str:
633
+ if event.endswith(".failed"):
634
+ return "error"
635
+ if event.endswith(".blocked") or event in {"wizard.waiting", "review.required", "provider.missing"}:
636
+ return "action_required"
637
+ return "info"
638
+
639
+
640
+ def status_for_event(event: str) -> str:
641
+ if event.endswith(".started") or event.endswith(".progress"):
642
+ return "running"
643
+ if event.endswith(".failed"):
644
+ return "failed"
645
+ if event.endswith(".blocked"):
646
+ return "blocked"
647
+ if event.endswith(".retry_scheduled"):
648
+ return "retry_scheduled"
649
+ if event.endswith(".skipped"):
650
+ return "skipped"
651
+ if event in {"wizard.waiting", "review.required", "provider.missing"}:
652
+ return "needs-action"
653
+ if event == "artifact.generated":
654
+ return "generated"
655
+ return "ok"
656
+
657
+
658
+ def task_event_message(event: str, task: dict[str, Any]) -> str:
659
+ task_id = str(task.get("id") or "task")
660
+ if event.endswith(".completed"):
661
+ return f"Tarefa {task_id} concluida."
662
+ if event.endswith(".failed"):
663
+ return f"Tarefa {task_id} falhou."
664
+ if event.endswith(".blocked"):
665
+ return f"Tarefa {task_id} bloqueada."
666
+ if event.endswith(".started"):
667
+ return f"Tarefa {task_id} iniciada."
668
+ if event.endswith(".progress"):
669
+ return f"Tarefa {task_id} em execucao."
670
+ if event.endswith(".retry_scheduled"):
671
+ return f"Retry da tarefa {task_id} agendado."
672
+ if event.endswith(".skipped"):
673
+ return f"Tarefa {task_id} ignorada pelo scheduler."
674
+ return f"Evento {event} em {task_id}."
675
+
676
+
677
+ def fallback_message(event: str, task_id: str | None) -> str:
678
+ target = task_id or "Agent DevKit"
679
+ return f"{event}: {target}"
680
+
681
+
682
+ def sanitize_title(value: str) -> str:
683
+ text = sanitize_message(value, limit=MAX_TITLE_LENGTH)
684
+ return text or DEFAULT_TITLE
685
+
686
+
687
+ def sanitize_message(value: str, *, limit: int = MAX_MESSAGE_LENGTH) -> str:
688
+ text = " ".join(redact_secrets(value).split())
689
+ if len(text) <= limit:
690
+ return text
691
+ return text[: limit - 3].rstrip() + "..."
692
+
693
+
694
+ def sanitize_optional(value: Any) -> str | None:
695
+ if value is None:
696
+ return None
697
+ text = sanitize_message(str(value), limit=80)
698
+ return text or None
699
+
700
+
701
+ def safe_list(value: Any) -> list[Any]:
702
+ if not isinstance(value, list):
703
+ return []
704
+ return [redact_secrets(str(item)) for item in value[:5]]
705
+
706
+
707
+ def safe_number(value: Any) -> int | float | str:
708
+ if isinstance(value, (int, float)):
709
+ return value
710
+ text = sanitize_message(str(value), limit=40)
711
+ try:
712
+ number = float(text)
713
+ except ValueError:
714
+ return text
715
+ return int(number) if number.is_integer() else number
716
+
717
+
718
+ def dedupe(values: list[str]) -> list[str]:
719
+ result: list[str] = []
720
+ for value in values:
721
+ if value not in result:
722
+ result.append(value)
723
+ return result