agent-devkit 0.1.6 → 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.
- package/README.md +13 -1
- package/package.json +1 -1
- package/runtime/README.md +53 -1
- package/runtime/agent +5 -0
- package/runtime/agents/README.md +26 -0
- package/runtime/agents/agent-devkit-agent-builder/AGENTS.md +24 -0
- package/runtime/agents/agent-devkit-agent-builder/README.md +37 -0
- package/runtime/agents/agent-devkit-agent-builder/agent.yaml +46 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/capability.yaml +29 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/decision-rules.md +7 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/runner.py +33 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/plan-agent/workflow.md +8 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/capability.yaml +31 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/decision-rules.md +9 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/runner.py +39 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/scaffold-agent/workflow.md +8 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/capability.yaml +28 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/decision-rules.md +6 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/runner.py +33 -0
- package/runtime/agents/agent-devkit-agent-builder/capabilities/validate-agent-contract/workflow.md +7 -0
- package/runtime/agents/agent-devkit-agent-builder/infra/integrations/agent-devkit/agent_builder_repository.py +527 -0
- package/runtime/agents/agent-devkit-agent-builder/knowledge/context.md +15 -0
- package/runtime/agents/agent-devkit-agent-builder/knowledge/policies.yaml +11 -0
- package/runtime/agents/agent-devkit-agent-builder/knowledge/system.md +11 -0
- package/runtime/agents/agent-devkit-agent-builder/templates/agent-plan-output.md +20 -0
- package/runtime/agents/agent-devkit-agent-builder/templates/scaffold-plan-output.md +13 -0
- package/runtime/agents/agent-devkit-agent-builder/templates/validation-report-output.md +13 -0
- package/runtime/agents/agent-devkit-agent-builder/tests/test_runners.py +188 -0
- package/runtime/agents/automation-architect/AGENTS.md +11 -0
- package/runtime/agents/automation-architect/README.md +27 -0
- package/runtime/agents/automation-architect/agent.yaml +57 -0
- package/runtime/agents/automation-architect/capabilities/classify-automation-request/capability.yaml +35 -0
- package/runtime/agents/automation-architect/capabilities/classify-automation-request/decision-rules.md +10 -0
- package/runtime/agents/automation-architect/capabilities/classify-automation-request/runner.py +37 -0
- package/runtime/agents/automation-architect/capabilities/classify-automation-request/workflow.md +7 -0
- package/runtime/agents/automation-architect/capabilities/delegate-automation-build/capability.yaml +34 -0
- package/runtime/agents/automation-architect/capabilities/delegate-automation-build/decision-rules.md +7 -0
- package/runtime/agents/automation-architect/capabilities/delegate-automation-build/runner.py +37 -0
- package/runtime/agents/automation-architect/capabilities/delegate-automation-build/workflow.md +6 -0
- package/runtime/agents/automation-architect/capabilities/plan-automation-solution/capability.yaml +35 -0
- package/runtime/agents/automation-architect/capabilities/plan-automation-solution/decision-rules.md +7 -0
- package/runtime/agents/automation-architect/capabilities/plan-automation-solution/runner.py +37 -0
- package/runtime/agents/automation-architect/capabilities/plan-automation-solution/workflow.md +7 -0
- package/runtime/agents/automation-architect/capabilities/review-automation-solution/capability.yaml +36 -0
- package/runtime/agents/automation-architect/capabilities/review-automation-solution/decision-rules.md +7 -0
- package/runtime/agents/automation-architect/capabilities/review-automation-solution/runner.py +39 -0
- package/runtime/agents/automation-architect/capabilities/review-automation-solution/workflow.md +7 -0
- package/runtime/agents/automation-architect/infra/integrations/automation-architecture/automation_architecture_repository.py +481 -0
- package/runtime/agents/automation-architect/knowledge/context.md +22 -0
- package/runtime/agents/automation-architect/knowledge/policies.yaml +20 -0
- package/runtime/agents/automation-architect/knowledge/system.md +8 -0
- package/runtime/agents/automation-architect/templates/automation-classification.md +6 -0
- package/runtime/agents/automation-architect/templates/automation-plan.md +5 -0
- package/runtime/agents/automation-architect/tests/test_runners.py +135 -0
- package/runtime/agents/aws-architecture-analyst/agent.yaml +17 -4
- package/runtime/agents/aws-cloudwatch-log-analyzer/agent.yaml +12 -2
- package/runtime/agents/aws-cloudwatch-log-analyzer/capabilities/analyze-service-error/capability.yaml +16 -0
- package/runtime/agents/aws-lambda-builder/AGENTS.md +27 -0
- package/runtime/agents/aws-lambda-builder/README.md +21 -0
- package/runtime/agents/aws-lambda-builder/agent.yaml +46 -0
- package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/capability.yaml +18 -0
- package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/decision-rules.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/runner.py +33 -0
- package/runtime/agents/aws-lambda-builder/capabilities/deploy-lambda-plan/workflow.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/capability.yaml +20 -0
- package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/decision-rules.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/runner.py +39 -0
- package/runtime/agents/aws-lambda-builder/capabilities/generate-lambda-project/workflow.md +7 -0
- package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/capability.yaml +22 -0
- package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/decision-rules.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/runner.py +41 -0
- package/runtime/agents/aws-lambda-builder/capabilities/package-lambda/workflow.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/capability.yaml +18 -0
- package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/decision-rules.md +7 -0
- package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/runner.py +33 -0
- package/runtime/agents/aws-lambda-builder/capabilities/plan-lambda/workflow.md +6 -0
- package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/capability.yaml +18 -0
- package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/decision-rules.md +7 -0
- package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/runner.py +33 -0
- package/runtime/agents/aws-lambda-builder/capabilities/review-lambda-security/workflow.md +5 -0
- package/runtime/agents/aws-lambda-builder/infra/integrations/aws-lambda/aws_lambda_repository.py +688 -0
- package/runtime/agents/aws-lambda-builder/knowledge/context.md +12 -0
- package/runtime/agents/aws-lambda-builder/knowledge/policies.yaml +23 -0
- package/runtime/agents/aws-lambda-builder/knowledge/system.md +10 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-deploy-plan.md +3 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-package.md +3 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-plan.md +3 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-readme.md +3 -0
- package/runtime/agents/aws-lambda-builder/templates/lambda-security-review.md +3 -0
- package/runtime/agents/aws-lambda-builder/tests/test_runners.py +355 -0
- package/runtime/agents/aws-operations-operator/agent.yaml +18 -6
- package/runtime/agents/aws-security-governance-auditor/agent.yaml +17 -5
- package/runtime/agents/azure-devops-orchestrator/agent.yaml +15 -2
- package/runtime/agents/azure-devops-orchestrator/capabilities/read-card/capability.yaml +29 -0
- package/runtime/agents/bpo-analyser/agent.yaml +12 -2
- package/runtime/agents/bpo-analyser/knowledge/policies.yaml +2 -2
- package/runtime/agents/data-scientist-analyst/agent.yaml +16 -4
- package/runtime/agents/data-scientist-analyst/capabilities/generate-data-report/capability.yaml +1 -1
- package/runtime/agents/data-scientist-analyst/capabilities/generate-reconciliation-report/capability.yaml +1 -1
- package/runtime/agents/data-scientist-analyst/capabilities/run-data-pipeline/capability.yaml +1 -1
- package/runtime/agents/data-scientist-analyst/infra/integrations/agent-bridge/methods/analyze-sql-source.yaml +1 -1
- package/runtime/agents/data-scientist-analyst/knowledge/policies.yaml +4 -4
- package/runtime/agents/data-scientist-analyst/knowledge/system.md +1 -1
- package/runtime/agents/data-scientist-analyst/tests/test_runners.py +1 -1
- package/runtime/agents/database-change-operator/agent.yaml +12 -1
- package/runtime/agents/docker-container-builder/AGENTS.md +27 -0
- package/runtime/agents/docker-container-builder/README.md +21 -0
- package/runtime/agents/docker-container-builder/agent.yaml +52 -0
- package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/capability.yaml +18 -0
- package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/decision-rules.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/runner.py +32 -0
- package/runtime/agents/docker-container-builder/capabilities/analyze-containerization-target/workflow.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-compose/capability.yaml +18 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-compose/decision-rules.md +7 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-compose/runner.py +32 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-compose/workflow.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/capability.yaml +20 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/decision-rules.md +7 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/runner.py +38 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-container-project-files/workflow.md +7 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/capability.yaml +18 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/decision-rules.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/runner.py +32 -0
- package/runtime/agents/docker-container-builder/capabilities/generate-dockerfile/workflow.md +7 -0
- package/runtime/agents/docker-container-builder/capabilities/plan-image-build/capability.yaml +18 -0
- package/runtime/agents/docker-container-builder/capabilities/plan-image-build/decision-rules.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/plan-image-build/runner.py +32 -0
- package/runtime/agents/docker-container-builder/capabilities/plan-image-build/workflow.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/review-docker-security/capability.yaml +21 -0
- package/runtime/agents/docker-container-builder/capabilities/review-docker-security/decision-rules.md +6 -0
- package/runtime/agents/docker-container-builder/capabilities/review-docker-security/runner.py +43 -0
- package/runtime/agents/docker-container-builder/capabilities/review-docker-security/workflow.md +5 -0
- package/runtime/agents/docker-container-builder/infra/integrations/docker-container/docker_container_repository.py +837 -0
- package/runtime/agents/docker-container-builder/knowledge/context.md +21 -0
- package/runtime/agents/docker-container-builder/knowledge/policies.yaml +13 -0
- package/runtime/agents/docker-container-builder/knowledge/system.md +21 -0
- package/runtime/agents/docker-container-builder/templates/container-plan.md +4 -0
- package/runtime/agents/docker-container-builder/templates/container-review.md +4 -0
- package/runtime/agents/docker-container-builder/templates/docker-compose.md +5 -0
- package/runtime/agents/docker-container-builder/templates/docker-readme.md +3 -0
- package/runtime/agents/docker-container-builder/templates/dockerfile.md +5 -0
- package/runtime/agents/docker-container-builder/tests/test_runners.py +255 -0
- package/runtime/agents/drawio-diagram-builder/agent.yaml +11 -2
- package/runtime/agents/drawio-diagram-builder/capabilities/execute-diagram-delivery/capability.yaml +1 -1
- package/runtime/agents/drawio-diagram-builder/capabilities/read-azure-card-context/capability.yaml +1 -1
- package/runtime/agents/elasticsearch-log-analyzer/agent.yaml +14 -2
- package/runtime/agents/elasticsearch-log-analyzer/capabilities/analyze-service-errors/capability.yaml +14 -0
- package/runtime/agents/excel-workbook-builder/agent.yaml +10 -0
- package/runtime/agents/excel-workbook-builder/capabilities/create-template/capability.yaml +1 -1
- package/runtime/agents/excel-workbook-builder/capabilities/create-template/workflow.md +1 -1
- package/runtime/agents/excel-workbook-builder/capabilities/create-template-version/capability.yaml +1 -1
- package/runtime/agents/excel-workbook-builder/capabilities/generate-template-input-file/capability.yaml +1 -2
- package/runtime/agents/excel-workbook-builder/capabilities/refine-template/capability.yaml +1 -1
- package/runtime/agents/excel-workbook-builder/capabilities/register-template/capability.yaml +1 -2
- package/runtime/agents/excel-workbook-builder/capabilities/register-template/workflow.md +1 -1
- package/runtime/agents/execution-loop-builder/AGENTS.md +24 -0
- package/runtime/agents/execution-loop-builder/README.md +19 -0
- package/runtime/agents/execution-loop-builder/agent.yaml +49 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/capability.yaml +20 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/decision-rules.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/runner.py +38 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-project-files/workflow.md +7 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/capability.yaml +18 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/decision-rules.md +5 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/runner.py +32 -0
- package/runtime/agents/execution-loop-builder/capabilities/generate-loop-runner/workflow.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/capability.yaml +18 -0
- package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/decision-rules.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/runner.py +32 -0
- package/runtime/agents/execution-loop-builder/capabilities/plan-execution-loop/workflow.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/capability.yaml +19 -0
- package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/decision-rules.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/runner.py +36 -0
- package/runtime/agents/execution-loop-builder/capabilities/register-loop-task/workflow.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/capability.yaml +19 -0
- package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/decision-rules.md +6 -0
- package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/runner.py +39 -0
- package/runtime/agents/execution-loop-builder/capabilities/review-loop-safety/workflow.md +5 -0
- package/runtime/agents/execution-loop-builder/infra/integrations/execution-loop/execution_loop_repository.py +608 -0
- package/runtime/agents/execution-loop-builder/knowledge/context.md +26 -0
- package/runtime/agents/execution-loop-builder/knowledge/policies.yaml +13 -0
- package/runtime/agents/execution-loop-builder/knowledge/system.md +19 -0
- package/runtime/agents/execution-loop-builder/templates/loop-plan.md +3 -0
- package/runtime/agents/execution-loop-builder/templates/loop-readme.md +3 -0
- package/runtime/agents/execution-loop-builder/templates/loop-review.md +3 -0
- package/runtime/agents/execution-loop-builder/templates/loop-runner.py +2 -0
- package/runtime/agents/execution-loop-builder/tests/test_runners.py +274 -0
- package/runtime/agents/execution-reviewer/agent.yaml +6 -4
- package/runtime/agents/execution-reviewer/capabilities/review-agent-result/capability.yaml +1 -2
- package/runtime/agents/execution-reviewer/capabilities/review-final-output/capability.yaml +1 -2
- package/runtime/agents/execution-reviewer/capabilities/review-plan/capability.yaml +1 -2
- package/runtime/agents/figma-ui-ux-product-designer/agent.yaml +17 -5
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/analyze-product-context/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/conduct-design-interview/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/conduct-design-review-session/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/generate-dev-handoff/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/generate-user-journey-diagram/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/ingest-design-source/capability.yaml +1 -1
- package/runtime/agents/figma-ui-ux-product-designer/capabilities/triage-design-feedback/capability.yaml +1 -1
- package/runtime/agents/generic-agent-builder/AGENTS.md +20 -0
- package/runtime/agents/generic-agent-builder/README.md +40 -0
- package/runtime/agents/generic-agent-builder/agent.yaml +43 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/capability.yaml +18 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/decision-rules.md +5 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/runner.py +33 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-agent-instructions/workflow.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/capability.yaml +20 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/decision-rules.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/runner.py +39 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-project-agent-files/workflow.md +7 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-skill/capability.yaml +18 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-skill/decision-rules.md +5 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-skill/runner.py +33 -0
- package/runtime/agents/generic-agent-builder/capabilities/generate-skill/workflow.md +5 -0
- package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/capability.yaml +18 -0
- package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/decision-rules.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/runner.py +33 -0
- package/runtime/agents/generic-agent-builder/capabilities/plan-generic-agent/workflow.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/capability.yaml +20 -0
- package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/decision-rules.md +6 -0
- package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/runner.py +40 -0
- package/runtime/agents/generic-agent-builder/capabilities/review-generic-agent/workflow.md +7 -0
- package/runtime/agents/generic-agent-builder/infra/integrations/generic-agent/generic_agent_repository.py +445 -0
- package/runtime/agents/generic-agent-builder/knowledge/context.md +11 -0
- package/runtime/agents/generic-agent-builder/knowledge/policies.yaml +12 -0
- package/runtime/agents/generic-agent-builder/knowledge/system.md +17 -0
- package/runtime/agents/generic-agent-builder/templates/generic-agent-instructions.md +17 -0
- package/runtime/agents/generic-agent-builder/templates/generic-review-report.md +13 -0
- package/runtime/agents/generic-agent-builder/templates/generic-skill.md +14 -0
- package/runtime/agents/generic-agent-builder/tests/test_runners.py +220 -0
- package/runtime/agents/github-pr-reviewer/agent.yaml +17 -5
- package/runtime/agents/github-pr-reviewer/capabilities/create-review-automation/capability.yaml +1 -1
- package/runtime/agents/github-pr-reviewer/capabilities/inspect-pr/capability.yaml +1 -1
- package/runtime/agents/github-pr-reviewer/capabilities/list-review-requests/capability.yaml +1 -1
- package/runtime/agents/github-pr-reviewer/capabilities/review-pr-diff/capability.yaml +1 -1
- package/runtime/agents/knowledge-generator/agent.yaml +13 -3
- package/runtime/agents/knowledge-generator/capabilities/generate-knowledge/capability.yaml +1 -1
- package/runtime/agents/local-llm-operator/agent.yaml +6 -4
- package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/capability.yaml +1 -2
- package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/capability.yaml +1 -2
- package/runtime/agents/local-llm-operator/capabilities/select-local-worker/capability.yaml +1 -2
- package/runtime/agents/n1-support-agent/agent.yaml +40 -1
- package/runtime/agents/n2-support-agent/agent.yaml +41 -2
- package/runtime/agents/n2-support-agent/knowledge/policies.yaml +2 -2
- package/runtime/agents/notification-operator/AGENTS.md +11 -0
- package/runtime/agents/notification-operator/README.md +15 -0
- package/runtime/agents/notification-operator/agent.yaml +43 -0
- package/runtime/agents/notification-operator/capabilities/configure-notification-channel/capability.yaml +19 -0
- package/runtime/agents/notification-operator/capabilities/configure-notification-channel/decision-rules.md +6 -0
- package/runtime/agents/notification-operator/capabilities/configure-notification-channel/runner.py +33 -0
- package/runtime/agents/notification-operator/capabilities/configure-notification-channel/workflow.md +6 -0
- package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/capability.yaml +25 -0
- package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/decision-rules.md +7 -0
- package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/runner.py +49 -0
- package/runtime/agents/notification-operator/capabilities/format-task-completion-notification/workflow.md +6 -0
- package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/capability.yaml +27 -0
- package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/decision-rules.md +6 -0
- package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/runner.py +68 -0
- package/runtime/agents/notification-operator/capabilities/send-task-completion-notification/workflow.md +7 -0
- package/runtime/agents/notification-operator/infra/README.md +6 -0
- package/runtime/agents/notification-operator/knowledge/context.md +10 -0
- package/runtime/agents/notification-operator/knowledge/policies.yaml +9 -0
- package/runtime/agents/notification-operator/knowledge/system.md +7 -0
- package/runtime/agents/notification-operator/templates/README.md +6 -0
- package/runtime/agents/notification-operator/tests/test_runners.py +108 -0
- package/runtime/agents/playwright-automation-builder/AGENTS.md +23 -0
- package/runtime/agents/playwright-automation-builder/README.md +43 -0
- package/runtime/agents/playwright-automation-builder/agent.yaml +48 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/capability.yaml +20 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/runner.py +38 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-project-files/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/capability.yaml +18 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/runner.py +32 -0
- package/runtime/agents/playwright-automation-builder/capabilities/generate-playwright-script/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/capability.yaml +18 -0
- package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/runner.py +32 -0
- package/runtime/agents/playwright-automation-builder/capabilities/plan-playwright-automation/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/capability.yaml +19 -0
- package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/runner.py +33 -0
- package/runtime/agents/playwright-automation-builder/capabilities/review-playwright-artifacts/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/capability.yaml +22 -0
- package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/runner.py +40 -0
- package/runtime/agents/playwright-automation-builder/capabilities/run-playwright-check/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/capability.yaml +22 -0
- package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/decision-rules.md +6 -0
- package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/runner.py +42 -0
- package/runtime/agents/playwright-automation-builder/capabilities/wrap-playwright-as-capability/workflow.md +6 -0
- package/runtime/agents/playwright-automation-builder/infra/integrations/playwright-automation/playwright_automation_repository.py +865 -0
- package/runtime/agents/playwright-automation-builder/knowledge/context.md +19 -0
- package/runtime/agents/playwright-automation-builder/knowledge/policies.yaml +25 -0
- package/runtime/agents/playwright-automation-builder/knowledge/system.md +19 -0
- package/runtime/agents/playwright-automation-builder/templates/capability-wrapper.md +4 -0
- package/runtime/agents/playwright-automation-builder/templates/playwright-automation.py +12 -0
- package/runtime/agents/playwright-automation-builder/templates/playwright-readme.md +13 -0
- package/runtime/agents/playwright-automation-builder/templates/playwright-review-report.md +9 -0
- package/runtime/agents/playwright-automation-builder/templates/playwright-test.py +2 -0
- package/runtime/agents/playwright-automation-builder/tests/test_runners.py +261 -0
- package/runtime/agents/postgres-data-analyzer/agent.yaml +13 -2
- package/runtime/agents/presentation-deck-builder/agent.yaml +14 -3
- package/runtime/agents/presentation-deck-builder/capabilities/create-template/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/capabilities/create-template-version/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/capabilities/generate-template-input-file/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/capabilities/refine-template/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/capabilities/register-template/capability.yaml +1 -1
- package/runtime/agents/presentation-deck-builder/knowledge/prompts/create-template.md +1 -1
- package/runtime/agents/presentation-deck-builder/knowledge/prompts/generate-template-input-file.md +1 -1
- package/runtime/agents/provider-configurator/agent.yaml +6 -4
- package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/capability.yaml +1 -2
- package/runtime/agents/provider-configurator/capabilities/configure-provider-source/capability.yaml +1 -2
- package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/capability.yaml +1 -2
- package/runtime/agents/pyautogui-automation-builder/AGENTS.md +32 -0
- package/runtime/agents/pyautogui-automation-builder/README.md +44 -0
- package/runtime/agents/pyautogui-automation-builder/agent.yaml +45 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/capability.yaml +20 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/decision-rules.md +6 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/runner.py +39 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-project-files/workflow.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/capability.yaml +18 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/decision-rules.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/runner.py +33 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/generate-pyautogui-script/workflow.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/capability.yaml +18 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/decision-rules.md +8 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/runner.py +33 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/plan-desktop-automation/workflow.md +9 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/capability.yaml +20 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/decision-rules.md +8 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/runner.py +43 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/review-pyautogui-script/workflow.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/capability.yaml +22 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/decision-rules.md +6 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/runner.py +43 -0
- package/runtime/agents/pyautogui-automation-builder/capabilities/wrap-pyautogui-as-capability/workflow.md +7 -0
- package/runtime/agents/pyautogui-automation-builder/infra/integrations/pyautogui-automation/pyautogui_automation_repository.py +856 -0
- package/runtime/agents/pyautogui-automation-builder/knowledge/context.md +17 -0
- package/runtime/agents/pyautogui-automation-builder/knowledge/policies.yaml +24 -0
- package/runtime/agents/pyautogui-automation-builder/knowledge/system.md +13 -0
- package/runtime/agents/pyautogui-automation-builder/templates/capability-wrapper.md +3 -0
- package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-automation.py +12 -0
- package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-readme.md +3 -0
- package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-review-report.md +3 -0
- package/runtime/agents/pyautogui-automation-builder/templates/pyautogui-test.py +2 -0
- package/runtime/agents/pyautogui-automation-builder/tests/test_runners.py +376 -0
- package/runtime/agents/python-automation-builder/AGENTS.md +25 -0
- package/runtime/agents/python-automation-builder/README.md +43 -0
- package/runtime/agents/python-automation-builder/agent.yaml +45 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/capability.yaml +20 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/decision-rules.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/runner.py +39 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-automation-project-files/workflow.md +7 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/capability.yaml +18 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/decision-rules.md +5 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/runner.py +33 -0
- package/runtime/agents/python-automation-builder/capabilities/generate-python-automation/workflow.md +5 -0
- package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/capability.yaml +18 -0
- package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/decision-rules.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/runner.py +33 -0
- package/runtime/agents/python-automation-builder/capabilities/plan-python-automation/workflow.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/review-python-automation/capability.yaml +20 -0
- package/runtime/agents/python-automation-builder/capabilities/review-python-automation/decision-rules.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/review-python-automation/runner.py +43 -0
- package/runtime/agents/python-automation-builder/capabilities/review-python-automation/workflow.md +5 -0
- package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/capability.yaml +22 -0
- package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/decision-rules.md +6 -0
- package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/runner.py +43 -0
- package/runtime/agents/python-automation-builder/capabilities/wrap-automation-as-capability/workflow.md +6 -0
- package/runtime/agents/python-automation-builder/infra/integrations/python-automation/python_automation_repository.py +717 -0
- package/runtime/agents/python-automation-builder/knowledge/context.md +15 -0
- package/runtime/agents/python-automation-builder/knowledge/policies.yaml +12 -0
- package/runtime/agents/python-automation-builder/knowledge/system.md +19 -0
- package/runtime/agents/python-automation-builder/templates/automation-readme.md +13 -0
- package/runtime/agents/python-automation-builder/templates/automation-review-report.md +13 -0
- package/runtime/agents/python-automation-builder/templates/automation-test.py +9 -0
- package/runtime/agents/python-automation-builder/templates/automation.py +19 -0
- package/runtime/agents/python-automation-builder/templates/capability-wrapper.md +4 -0
- package/runtime/agents/python-automation-builder/tests/test_runners.py +292 -0
- package/runtime/agents/selenium-automation-builder/AGENTS.md +27 -0
- package/runtime/agents/selenium-automation-builder/README.md +40 -0
- package/runtime/agents/selenium-automation-builder/agent.yaml +45 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/capability.yaml +20 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/runner.py +39 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-project-files/workflow.md +7 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/capability.yaml +18 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/runner.py +33 -0
- package/runtime/agents/selenium-automation-builder/capabilities/generate-selenium-script/workflow.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/capability.yaml +18 -0
- package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/runner.py +33 -0
- package/runtime/agents/selenium-automation-builder/capabilities/plan-selenium-automation/workflow.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/capability.yaml +20 -0
- package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/runner.py +40 -0
- package/runtime/agents/selenium-automation-builder/capabilities/review-selenium-script/workflow.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/capability.yaml +22 -0
- package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/decision-rules.md +6 -0
- package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/runner.py +43 -0
- package/runtime/agents/selenium-automation-builder/capabilities/wrap-selenium-as-capability/workflow.md +6 -0
- package/runtime/agents/selenium-automation-builder/infra/integrations/selenium-automation/selenium_automation_repository.py +793 -0
- package/runtime/agents/selenium-automation-builder/knowledge/context.md +15 -0
- package/runtime/agents/selenium-automation-builder/knowledge/policies.yaml +17 -0
- package/runtime/agents/selenium-automation-builder/knowledge/system.md +18 -0
- package/runtime/agents/selenium-automation-builder/templates/capability-wrapper.md +4 -0
- package/runtime/agents/selenium-automation-builder/templates/selenium-automation.py +20 -0
- package/runtime/agents/selenium-automation-builder/templates/selenium-readme.md +13 -0
- package/runtime/agents/selenium-automation-builder/templates/selenium-review-report.md +13 -0
- package/runtime/agents/selenium-automation-builder/templates/selenium-test.py +9 -0
- package/runtime/agents/selenium-automation-builder/tests/test_runners.py +282 -0
- package/runtime/agents/software-specification-analyst/agent.yaml +17 -4
- package/runtime/agents/software-specification-analyst/capabilities/analyze-multiple-projects/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/analyze-project-context/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/conduct-requirements-interview/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/create-complete-spec/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/create-final-spec-from-analysis/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/create-functional-spec/capability.yaml +11 -0
- package/runtime/agents/software-specification-analyst/capabilities/create-technical-spec/capability.yaml +12 -0
- package/runtime/agents/software-specification-analyst/capabilities/refine-analysis-with-feedback/capability.yaml +1 -1
- package/runtime/agents/software-specification-analyst/capabilities/write-user-stories/capability.yaml +12 -0
- package/runtime/agents/sqlserver-change-operator/agent.yaml +12 -1
- package/runtime/agents/sqlserver-data-analyzer/agent.yaml +13 -2
- package/runtime/agents/supabase-project-analyst/AGENTS.md +29 -0
- package/runtime/agents/supabase-project-analyst/README.md +23 -0
- package/runtime/agents/supabase-project-analyst/agent.yaml +53 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/decision-rules.md +5 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-auth-security/workflow.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-rls-policies/workflow.md +7 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/decision-rules.md +5 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/audit-storage-policies/workflow.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/generate-supabase-report/workflow.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/capability.yaml +19 -0
- package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/runner.py +36 -0
- package/runtime/agents/supabase-project-analyst/capabilities/inspect-supabase-project/workflow.md +7 -0
- package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/plan-supabase-fix/workflow.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/capability.yaml +18 -0
- package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/decision-rules.md +6 -0
- package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/runner.py +32 -0
- package/runtime/agents/supabase-project-analyst/capabilities/review-migrations/workflow.md +5 -0
- package/runtime/agents/supabase-project-analyst/infra/integrations/supabase-project/supabase_project_repository.py +589 -0
- package/runtime/agents/supabase-project-analyst/knowledge/context.md +11 -0
- package/runtime/agents/supabase-project-analyst/knowledge/policies.yaml +24 -0
- package/runtime/agents/supabase-project-analyst/knowledge/system.md +10 -0
- package/runtime/agents/supabase-project-analyst/templates/supabase-audit.md +3 -0
- package/runtime/agents/supabase-project-analyst/templates/supabase-fix-plan.md +3 -0
- package/runtime/agents/supabase-project-analyst/templates/supabase-inspection.md +3 -0
- package/runtime/agents/supabase-project-analyst/templates/supabase-report.md +3 -0
- package/runtime/agents/supabase-project-analyst/tests/test_runners.py +239 -0
- package/runtime/agents/task-orchestrator/agent.yaml +25 -3
- package/runtime/agents/task-orchestrator/capabilities/plan-task/capability.yaml +1 -2
- package/runtime/agents/task-orchestrator/capabilities/select-specialists/capability.yaml +1 -2
- package/runtime/agents/technical-integration-analyst/agent.yaml +15 -2
- package/runtime/agents/topdesk-orchestrator/agent.yaml +10 -2
- package/runtime/cli/aikit/__init__.py +1 -1
- package/runtime/cli/aikit/acceptance.py +166 -0
- package/runtime/cli/aikit/agent_executor.py +26 -3
- package/runtime/cli/aikit/agent_registry.py +244 -5
- package/runtime/cli/aikit/architecture.py +84 -0
- package/runtime/cli/aikit/audit.py +172 -3
- package/runtime/cli/aikit/autonomy.py +237 -0
- package/runtime/cli/aikit/capability_runtime.py +522 -0
- package/runtime/cli/aikit/catalog.py +246 -0
- package/runtime/cli/aikit/cli_dispatch.py +1078 -0
- package/runtime/cli/aikit/cli_parser.py +409 -0
- package/runtime/cli/aikit/collaboration.py +359 -0
- package/runtime/cli/aikit/configuration_orchestrator.py +52 -26
- package/runtime/cli/aikit/contribution.py +105 -0
- package/runtime/cli/aikit/core/__init__.py +1 -0
- package/runtime/cli/aikit/core/capability_contract.py +112 -0
- package/runtime/cli/aikit/core/requests.py +69 -0
- package/runtime/cli/aikit/core/runtime.py +64 -0
- package/runtime/cli/aikit/diagnostics.py +8 -2
- package/runtime/cli/aikit/doctor_runtime.py +79 -0
- package/runtime/cli/aikit/errors.py +7 -0
- package/runtime/cli/aikit/eval.py +158 -0
- package/runtime/cli/aikit/execution_reviewer.py +21 -0
- package/runtime/cli/aikit/extensions.py +140 -0
- package/runtime/cli/aikit/fallback.py +1 -0
- package/runtime/cli/aikit/github_pr.py +23 -0
- package/runtime/cli/aikit/guardrails.py +25 -10
- package/runtime/cli/aikit/human_output.py +1026 -0
- package/runtime/cli/aikit/impact_map.py +294 -0
- package/runtime/cli/aikit/interactive_wizard.py +79 -0
- package/runtime/cli/aikit/local_llm_operator.py +35 -1
- package/runtime/cli/aikit/main.py +9 -2834
- package/runtime/cli/aikit/mcp_manifest.py +229 -0
- package/runtime/cli/aikit/mcp_server.py +132 -0
- package/runtime/cli/aikit/mcp_tools.py +262 -0
- package/runtime/cli/aikit/mini_brain.py +227 -0
- package/runtime/cli/aikit/model_router.py +182 -18
- package/runtime/cli/aikit/module_controller.py +335 -0
- package/runtime/cli/aikit/natural_prompt_runtime.py +538 -0
- package/runtime/cli/aikit/notifications.py +716 -2
- package/runtime/cli/aikit/ollama.py +1 -0
- package/runtime/cli/aikit/orchestrator.py +809 -119
- package/runtime/cli/aikit/output.py +63 -2
- package/runtime/cli/aikit/permissions.py +14 -4
- package/runtime/cli/aikit/prompt_injection.py +57 -0
- package/runtime/cli/aikit/review_gate.py +38 -6
- package/runtime/cli/aikit/roadmap.py +195 -0
- package/runtime/cli/aikit/roadmap_cli.py +70 -0
- package/runtime/cli/aikit/router.py +41 -12
- package/runtime/cli/aikit/router_explain.py +152 -0
- package/runtime/cli/aikit/runtime_paths.py +11 -0
- package/runtime/cli/aikit/secrets.py +113 -0
- package/runtime/cli/aikit/sessions.py +88 -2
- package/runtime/cli/aikit/setup_wizard_payload.py +32 -0
- package/runtime/cli/aikit/sources.py +298 -50
- package/runtime/cli/aikit/tasks.py +449 -21
- package/runtime/cli/aikit/wizard_state.py +15 -1
- package/runtime/cli/aikit/workflows.py +115 -0
- package/runtime/cli/aikit/write_policy.py +108 -0
- package/runtime/plugins/claude-code-ai-devkit/README.md +17 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/README.md +29 -2
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-db-analyst.md +44 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-execution-reviewer.md +38 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-pr-reviewer.md +42 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-repo-explorer.md +40 -0
- package/runtime/plugins/claude-code-ai-devkit/agents/agent-devkit-support-triage.md +43 -0
- package/runtime/plugins/claude-code-ai-devkit/plugin.json +1 -1
- package/runtime/plugins/claude-code-ai-devkit/skills/ai-devkit-router/SKILL.md +16 -0
- package/runtime/plugins/claude-skill-ai-devkit/ai-devkit/SKILL.md +1 -0
- package/runtime/plugins/claude-skill-ai-devkit/ai-devkit/references/subagents.md +21 -0
- package/runtime/plugins/claude-skill-ai-devkit/plugin.json +1 -1
- package/runtime/providers/azure-devops.yaml +9 -0
- package/runtime/providers/github.yaml +4 -0
- package/runtime/providers/local-notification.yaml +5 -2
- package/runtime/providers/local-scheduler.yaml +1 -1
- package/runtime/providers/supabase.yaml +46 -0
- package/runtime/scripts/release-catalog-snapshot.json +543 -0
- package/runtime/scripts/release-gate.py +141 -1
- package/runtime/scripts/validate-repo.py +312 -0
- package/runtime/vendor/skills/napkin/napkin.md +15 -9
|
@@ -1,9 +1,723 @@
|
|
|
1
|
-
"""
|
|
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
|