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
|
@@ -0,0 +1,717 @@
|
|
|
1
|
+
"""Repository for deterministic Python automation generation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import re
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
import yaml
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
REQUIRED_SPEC_FIELDS = ("automation_name", "purpose", "inputs", "outputs", "systems", "side_effects")
|
|
14
|
+
IDEMPOTENCY_CLASSES = {"safe-repeat", "creates-artifact", "updates-local", "external-write", "destructive"}
|
|
15
|
+
OUT_OF_SCOPE_DEPENDENCIES = {
|
|
16
|
+
"selenium": "problem 16",
|
|
17
|
+
"pyautogui": "problem 17",
|
|
18
|
+
"playwright": "problem 27",
|
|
19
|
+
}
|
|
20
|
+
FORBIDDEN_MARKER_PATTERN = re.compile(r"\b(?:SECRET|TOKEN|PASSWORD|API_KEY|PRIVATE_KEY)\b\s*[:=]")
|
|
21
|
+
KEBAB_CASE = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$")
|
|
22
|
+
SLUG_PATTERN = re.compile(r"[^a-z0-9]+")
|
|
23
|
+
STANDARD_LIBRARY_HINTS = {
|
|
24
|
+
"argparse",
|
|
25
|
+
"csv",
|
|
26
|
+
"datetime",
|
|
27
|
+
"json",
|
|
28
|
+
"logging",
|
|
29
|
+
"os",
|
|
30
|
+
"pathlib",
|
|
31
|
+
"re",
|
|
32
|
+
"shutil",
|
|
33
|
+
"subprocess",
|
|
34
|
+
"sys",
|
|
35
|
+
"tempfile",
|
|
36
|
+
"time",
|
|
37
|
+
"urllib",
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class PythonAutomationError(RuntimeError):
|
|
42
|
+
"""Raised when the builder cannot read or process an input spec."""
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class PythonAutomationRepository:
|
|
46
|
+
def __init__(self, root: Path | None = None) -> None:
|
|
47
|
+
self.root = root or Path(__file__).resolve().parents[5]
|
|
48
|
+
|
|
49
|
+
def plan_python_automation(self, *, spec_path: Path) -> dict[str, Any]:
|
|
50
|
+
spec = self.load_spec(spec_path)
|
|
51
|
+
spec_result = self.validate_spec(spec)
|
|
52
|
+
if spec_result["status"] != "ok":
|
|
53
|
+
return spec_result
|
|
54
|
+
|
|
55
|
+
normalized = self.normalize_spec(spec)
|
|
56
|
+
blocked = self.detect_forbidden_content(normalized)
|
|
57
|
+
if blocked:
|
|
58
|
+
return blocked
|
|
59
|
+
|
|
60
|
+
dependency_block = self.detect_out_of_scope_dependencies(normalized["dependencies"])
|
|
61
|
+
if dependency_block:
|
|
62
|
+
return dependency_block
|
|
63
|
+
|
|
64
|
+
files = self.build_automation_files(normalized)
|
|
65
|
+
return {
|
|
66
|
+
"kind": "python-automation-plan",
|
|
67
|
+
"status": "ok",
|
|
68
|
+
"automation": self.automation_summary(normalized),
|
|
69
|
+
"idempotency": normalized["side_effects"],
|
|
70
|
+
"risk": normalized["risk"],
|
|
71
|
+
"write_policy": "read_only",
|
|
72
|
+
"dependencies": self.dependency_plan(normalized["dependencies"]),
|
|
73
|
+
"planned_artifacts": self.public_file_plan(files),
|
|
74
|
+
"side_effect_guardrails": self.side_effect_guardrails(normalized["side_effects"]),
|
|
75
|
+
"questions": self.open_questions(normalized),
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
def generate_python_automation(self, *, spec_path: Path) -> dict[str, Any]:
|
|
79
|
+
plan = self.plan_python_automation(spec_path=spec_path)
|
|
80
|
+
if plan["status"] != "ok":
|
|
81
|
+
return plan
|
|
82
|
+
|
|
83
|
+
spec = self.normalize_spec(self.load_spec(spec_path))
|
|
84
|
+
content = self.render_automation_py(spec)
|
|
85
|
+
return {
|
|
86
|
+
"kind": "python-automation-script",
|
|
87
|
+
"status": "ok",
|
|
88
|
+
"automation": self.automation_summary(spec),
|
|
89
|
+
"artifact": "automation.py",
|
|
90
|
+
"content": content,
|
|
91
|
+
"bytes": len(content.encode("utf-8")),
|
|
92
|
+
"write_policy": "output_only",
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
def generate_automation_project_files(
|
|
96
|
+
self,
|
|
97
|
+
*,
|
|
98
|
+
spec_path: Path,
|
|
99
|
+
execute: bool = False,
|
|
100
|
+
allow_overwrite: bool = False,
|
|
101
|
+
) -> dict[str, Any]:
|
|
102
|
+
plan = self.plan_python_automation(spec_path=spec_path)
|
|
103
|
+
if plan["status"] != "ok":
|
|
104
|
+
return plan
|
|
105
|
+
|
|
106
|
+
spec = self.normalize_spec(self.load_spec(spec_path))
|
|
107
|
+
target_project = spec.get("target_project")
|
|
108
|
+
if not target_project:
|
|
109
|
+
return {
|
|
110
|
+
"kind": "python-automation-project-files",
|
|
111
|
+
"status": "needs-input",
|
|
112
|
+
"missing_fields": ["target_project"],
|
|
113
|
+
"questions": ["Qual e o caminho do projeto destino?"],
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
target_root = Path(str(target_project)).expanduser().resolve()
|
|
117
|
+
files = self.build_automation_files(spec, base_dir=spec["automation_slug"])
|
|
118
|
+
return self.write_or_plan_files(
|
|
119
|
+
kind="python-automation-project-files",
|
|
120
|
+
files=files,
|
|
121
|
+
target_root=target_root,
|
|
122
|
+
execute=execute,
|
|
123
|
+
allow_overwrite=allow_overwrite,
|
|
124
|
+
extra={"automation": self.automation_summary(spec), "idempotency": spec["side_effects"]},
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
def review_python_automation(self, *, text: str, side_effects: str = "updates-local") -> dict[str, Any]:
|
|
128
|
+
normalized_side_effects = str(side_effects or "updates-local").strip()
|
|
129
|
+
findings: list[str] = []
|
|
130
|
+
if not text.strip():
|
|
131
|
+
findings.append("automation script is empty")
|
|
132
|
+
lower_text = text.lower()
|
|
133
|
+
if "--dry-run" not in text:
|
|
134
|
+
findings.append("automation must expose --dry-run")
|
|
135
|
+
if normalized_side_effects not in {"safe-repeat"} and "--execute" not in text:
|
|
136
|
+
findings.append("automation with side effects must expose --execute")
|
|
137
|
+
if normalized_side_effects not in {"safe-repeat"} and "--yes" not in text and "--confirm" not in text:
|
|
138
|
+
findings.append("automation with side effects must require --yes or --confirm")
|
|
139
|
+
if "logging" not in lower_text:
|
|
140
|
+
findings.append("automation should use logging")
|
|
141
|
+
if "return 0" not in text and "sys.exit(0)" not in text:
|
|
142
|
+
findings.append("automation should return a predictable success exit code")
|
|
143
|
+
if "redact" not in lower_text:
|
|
144
|
+
findings.append("automation should include a redaction helper for public logs")
|
|
145
|
+
if self.detect_text_forbidden_content(text):
|
|
146
|
+
findings.append("automation contains a secret marker or URL")
|
|
147
|
+
|
|
148
|
+
valid = not findings
|
|
149
|
+
return {
|
|
150
|
+
"kind": "python-automation-review",
|
|
151
|
+
"status": "ok" if valid else "failed",
|
|
152
|
+
"valid": valid,
|
|
153
|
+
"side_effects": normalized_side_effects,
|
|
154
|
+
"findings": findings,
|
|
155
|
+
"write_policy": "read_only",
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
def wrap_automation_as_capability(
|
|
159
|
+
self,
|
|
160
|
+
*,
|
|
161
|
+
spec_path: Path,
|
|
162
|
+
agent_id: str,
|
|
163
|
+
capability_id: str,
|
|
164
|
+
execute: bool = False,
|
|
165
|
+
allow_overwrite: bool = False,
|
|
166
|
+
) -> dict[str, Any]:
|
|
167
|
+
plan = self.plan_python_automation(spec_path=spec_path)
|
|
168
|
+
if plan["status"] != "ok":
|
|
169
|
+
return plan
|
|
170
|
+
|
|
171
|
+
if not KEBAB_CASE.match(agent_id):
|
|
172
|
+
return {
|
|
173
|
+
"kind": "python-automation-capability-wrapper",
|
|
174
|
+
"status": "blocked",
|
|
175
|
+
"reason": "invalid_agent_id",
|
|
176
|
+
"risks": ["agent-id must be kebab-case."],
|
|
177
|
+
}
|
|
178
|
+
if not KEBAB_CASE.match(capability_id):
|
|
179
|
+
return {
|
|
180
|
+
"kind": "python-automation-capability-wrapper",
|
|
181
|
+
"status": "blocked",
|
|
182
|
+
"reason": "invalid_capability_id",
|
|
183
|
+
"risks": ["capability-id must be kebab-case."],
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
spec = self.normalize_spec(self.load_spec(spec_path))
|
|
187
|
+
target_project = spec.get("target_project")
|
|
188
|
+
if not target_project:
|
|
189
|
+
return {
|
|
190
|
+
"kind": "python-automation-capability-wrapper",
|
|
191
|
+
"status": "needs-input",
|
|
192
|
+
"missing_fields": ["target_project"],
|
|
193
|
+
"questions": ["Qual e o caminho do projeto destino?"],
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
target_root = Path(str(target_project)).expanduser().resolve()
|
|
197
|
+
files = self.build_capability_wrapper_files(spec, agent_id=agent_id, capability_id=capability_id)
|
|
198
|
+
return self.write_or_plan_files(
|
|
199
|
+
kind="python-automation-capability-wrapper",
|
|
200
|
+
files=files,
|
|
201
|
+
target_root=target_root,
|
|
202
|
+
execute=execute,
|
|
203
|
+
allow_overwrite=allow_overwrite,
|
|
204
|
+
extra={
|
|
205
|
+
"agent_id": agent_id,
|
|
206
|
+
"capability_id": capability_id,
|
|
207
|
+
"capability_write_policy": self.capability_write_policy(spec["side_effects"]),
|
|
208
|
+
},
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
def load_spec(self, path: Path) -> dict[str, Any]:
|
|
212
|
+
if not path.exists():
|
|
213
|
+
raise PythonAutomationError(f"spec not found: {path}")
|
|
214
|
+
text = path.read_text(encoding="utf-8")
|
|
215
|
+
if path.suffix.lower() == ".json":
|
|
216
|
+
payload = json.loads(text)
|
|
217
|
+
else:
|
|
218
|
+
payload = yaml.safe_load(text) or {}
|
|
219
|
+
if not isinstance(payload, dict):
|
|
220
|
+
raise PythonAutomationError("spec must be a mapping")
|
|
221
|
+
return payload
|
|
222
|
+
|
|
223
|
+
def validate_spec(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
224
|
+
missing = [field for field in REQUIRED_SPEC_FIELDS if not spec.get(field)]
|
|
225
|
+
if missing:
|
|
226
|
+
return {
|
|
227
|
+
"kind": "python-automation-plan",
|
|
228
|
+
"status": "needs-input",
|
|
229
|
+
"missing_fields": missing,
|
|
230
|
+
"questions": [self.question_for_missing_field(field) for field in missing],
|
|
231
|
+
}
|
|
232
|
+
for field in ("inputs", "outputs", "systems", "dependencies", "quality_gates"):
|
|
233
|
+
if spec.get(field) is not None and not isinstance(spec[field], list):
|
|
234
|
+
return {
|
|
235
|
+
"kind": "python-automation-plan",
|
|
236
|
+
"status": "blocked",
|
|
237
|
+
"reason": "invalid_list_field",
|
|
238
|
+
"field": field,
|
|
239
|
+
"risks": [f"{field} must be a list when provided."],
|
|
240
|
+
}
|
|
241
|
+
side_effects = str(spec.get("side_effects") or "").strip()
|
|
242
|
+
if side_effects not in IDEMPOTENCY_CLASSES:
|
|
243
|
+
return {
|
|
244
|
+
"kind": "python-automation-plan",
|
|
245
|
+
"status": "blocked",
|
|
246
|
+
"reason": "invalid_side_effects",
|
|
247
|
+
"supported_values": sorted(IDEMPOTENCY_CLASSES),
|
|
248
|
+
}
|
|
249
|
+
return {"status": "ok"}
|
|
250
|
+
|
|
251
|
+
def normalize_spec(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
252
|
+
normalized = dict(spec)
|
|
253
|
+
normalized["automation_name"] = " ".join(str(spec["automation_name"]).split())
|
|
254
|
+
normalized["automation_slug"] = self.slugify(normalized["automation_name"])
|
|
255
|
+
normalized["purpose"] = " ".join(str(spec["purpose"]).split())
|
|
256
|
+
normalized["inputs"] = [str(item).strip() for item in spec.get("inputs") or []]
|
|
257
|
+
normalized["outputs"] = [str(item).strip() for item in spec.get("outputs") or []]
|
|
258
|
+
normalized["systems"] = [str(item).strip() for item in spec.get("systems") or []]
|
|
259
|
+
normalized["frequency"] = " ".join(str(spec.get("frequency") or "manual").split())
|
|
260
|
+
normalized["risk"] = " ".join(str(spec.get("risk") or "medium").split())
|
|
261
|
+
normalized["target_environment"] = " ".join(str(spec.get("target_environment") or "local").split())
|
|
262
|
+
normalized["side_effects"] = str(spec["side_effects"]).strip()
|
|
263
|
+
normalized["dependencies"] = [str(item).strip() for item in spec.get("dependencies") or []]
|
|
264
|
+
normalized["quality_gates"] = [str(item).strip() for item in spec.get("quality_gates") or []]
|
|
265
|
+
if spec.get("target_project"):
|
|
266
|
+
normalized["target_project"] = str(spec["target_project"]).strip()
|
|
267
|
+
return normalized
|
|
268
|
+
|
|
269
|
+
def detect_forbidden_content(self, spec: dict[str, Any]) -> dict[str, Any] | None:
|
|
270
|
+
for value in self.iter_strings(spec):
|
|
271
|
+
if self.detect_text_forbidden_content(value):
|
|
272
|
+
return {
|
|
273
|
+
"kind": "python-automation-plan",
|
|
274
|
+
"status": "blocked",
|
|
275
|
+
"reason": "forbidden_sensitive_marker",
|
|
276
|
+
"risks": ["Spec contains a URL or text that looks like a secret or credential marker."],
|
|
277
|
+
}
|
|
278
|
+
return None
|
|
279
|
+
|
|
280
|
+
def detect_text_forbidden_content(self, value: str) -> bool:
|
|
281
|
+
return bool(FORBIDDEN_MARKER_PATTERN.search(value)) or "http://" in value or "https://" in value
|
|
282
|
+
|
|
283
|
+
def detect_out_of_scope_dependencies(self, dependencies: list[str]) -> dict[str, Any] | None:
|
|
284
|
+
for dependency in dependencies:
|
|
285
|
+
normalized = dependency.strip().lower().replace("_", "-")
|
|
286
|
+
for blocked, problem in OUT_OF_SCOPE_DEPENDENCIES.items():
|
|
287
|
+
if blocked in normalized:
|
|
288
|
+
return {
|
|
289
|
+
"kind": "python-automation-plan",
|
|
290
|
+
"status": "blocked",
|
|
291
|
+
"reason": "out_of_scope_dependency",
|
|
292
|
+
"dependency": dependency,
|
|
293
|
+
"next_steps": [f"Use {problem} for {blocked}-specific automation."],
|
|
294
|
+
}
|
|
295
|
+
return None
|
|
296
|
+
|
|
297
|
+
def build_automation_files(self, spec: dict[str, Any], *, base_dir: str = "") -> list[tuple[str, str]]:
|
|
298
|
+
prefix = f"{base_dir}/" if base_dir else ""
|
|
299
|
+
files = [
|
|
300
|
+
(f"{prefix}automation.py", self.render_automation_py(spec)),
|
|
301
|
+
(f"{prefix}README.md", self.render_readme(spec)),
|
|
302
|
+
(f"{prefix}tests/test_automation.py", self.render_automation_test(spec)),
|
|
303
|
+
]
|
|
304
|
+
requirements = self.render_requirements(spec)
|
|
305
|
+
if requirements:
|
|
306
|
+
files.append((f"{prefix}requirements.txt", requirements))
|
|
307
|
+
return files
|
|
308
|
+
|
|
309
|
+
def build_capability_wrapper_files(
|
|
310
|
+
self,
|
|
311
|
+
spec: dict[str, Any],
|
|
312
|
+
*,
|
|
313
|
+
agent_id: str,
|
|
314
|
+
capability_id: str,
|
|
315
|
+
) -> list[tuple[str, str]]:
|
|
316
|
+
base = f"agents/{agent_id}/capabilities/{capability_id}"
|
|
317
|
+
return [
|
|
318
|
+
(f"{base}/capability.yaml", self.render_capability_yaml(spec, agent_id=agent_id, capability_id=capability_id)),
|
|
319
|
+
(f"{base}/workflow.md", self.render_capability_workflow(spec, capability_id=capability_id)),
|
|
320
|
+
(f"{base}/decision-rules.md", self.render_capability_decision_rules(spec)),
|
|
321
|
+
(f"{base}/runner.py", self.render_capability_runner(spec)),
|
|
322
|
+
]
|
|
323
|
+
|
|
324
|
+
def write_or_plan_files(
|
|
325
|
+
self,
|
|
326
|
+
*,
|
|
327
|
+
kind: str,
|
|
328
|
+
files: list[tuple[str, str]],
|
|
329
|
+
target_root: Path,
|
|
330
|
+
execute: bool,
|
|
331
|
+
allow_overwrite: bool,
|
|
332
|
+
extra: dict[str, Any],
|
|
333
|
+
) -> dict[str, Any]:
|
|
334
|
+
if not target_root.exists() or not target_root.is_dir():
|
|
335
|
+
return {
|
|
336
|
+
"kind": kind,
|
|
337
|
+
"status": "blocked",
|
|
338
|
+
"reason": "target_project_missing",
|
|
339
|
+
"target_project": str(target_root),
|
|
340
|
+
"risks": ["target_project must exist before files can be written."],
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
checked_files = []
|
|
344
|
+
for relative_path, content in files:
|
|
345
|
+
target = (target_root / relative_path).resolve()
|
|
346
|
+
if Path(relative_path).is_absolute() or not self.is_inside(target_root, target):
|
|
347
|
+
return {
|
|
348
|
+
"kind": kind,
|
|
349
|
+
"status": "blocked",
|
|
350
|
+
"reason": "path_outside_target_project",
|
|
351
|
+
"path": relative_path,
|
|
352
|
+
"target_project": str(target_root),
|
|
353
|
+
}
|
|
354
|
+
checked_files.append((relative_path, target, content))
|
|
355
|
+
|
|
356
|
+
if not execute:
|
|
357
|
+
return {
|
|
358
|
+
"kind": kind,
|
|
359
|
+
"status": "planned",
|
|
360
|
+
"dry_run": True,
|
|
361
|
+
"target_project": str(target_root),
|
|
362
|
+
"planned_files": [
|
|
363
|
+
{
|
|
364
|
+
"path": relative_path,
|
|
365
|
+
"absolute_path": str(target),
|
|
366
|
+
"bytes": len(content.encode("utf-8")),
|
|
367
|
+
}
|
|
368
|
+
for relative_path, target, content in checked_files
|
|
369
|
+
],
|
|
370
|
+
**extra,
|
|
371
|
+
"next_steps": ["Rerun with --execute after reviewing the planned files."],
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
existing = [target for _relative_path, target, _content in checked_files if target.exists()]
|
|
375
|
+
if existing and not allow_overwrite:
|
|
376
|
+
return {
|
|
377
|
+
"kind": kind,
|
|
378
|
+
"status": "blocked",
|
|
379
|
+
"reason": "target_exists",
|
|
380
|
+
"target_project": str(target_root),
|
|
381
|
+
"existing_files": [str(path) for path in existing],
|
|
382
|
+
**extra,
|
|
383
|
+
"next_steps": ["Rerun with --allow-overwrite only after reviewing the existing files."],
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
written_files = []
|
|
387
|
+
for _relative_path, target, content in checked_files:
|
|
388
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
389
|
+
target.write_text(content, encoding="utf-8")
|
|
390
|
+
written_files.append({"path": str(target), "bytes": len(content.encode("utf-8"))})
|
|
391
|
+
|
|
392
|
+
return {
|
|
393
|
+
"kind": kind,
|
|
394
|
+
"status": "written",
|
|
395
|
+
"dry_run": False,
|
|
396
|
+
"target_project": str(target_root),
|
|
397
|
+
"written_files": written_files,
|
|
398
|
+
**extra,
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
def render_automation_py(self, spec: dict[str, Any]) -> str:
|
|
402
|
+
needs_confirmation = spec["side_effects"] != "safe-repeat"
|
|
403
|
+
confirmation_block = [
|
|
404
|
+
" if args.execute and not args.yes:",
|
|
405
|
+
" logger.error(\"real execution requires --yes after reviewing --dry-run output\")",
|
|
406
|
+
" return 2",
|
|
407
|
+
]
|
|
408
|
+
if not needs_confirmation:
|
|
409
|
+
confirmation_block = [
|
|
410
|
+
" if args.execute and not args.yes:",
|
|
411
|
+
" logger.info(\"--yes not required for safe-repeat automation, continuing\")",
|
|
412
|
+
]
|
|
413
|
+
|
|
414
|
+
lines = [
|
|
415
|
+
"#!/usr/bin/env python3",
|
|
416
|
+
f'"""Automation: {spec["automation_name"]}."""',
|
|
417
|
+
"",
|
|
418
|
+
"from __future__ import annotations",
|
|
419
|
+
"",
|
|
420
|
+
"import argparse",
|
|
421
|
+
"import json",
|
|
422
|
+
"import logging",
|
|
423
|
+
"import sys",
|
|
424
|
+
"from pathlib import Path",
|
|
425
|
+
"",
|
|
426
|
+
"",
|
|
427
|
+
"SENSITIVE_MARKERS = (\"SECRET\", \"TOKEN\", \"PASSWORD\", \"API_KEY\", \"PRIVATE_KEY\")",
|
|
428
|
+
"",
|
|
429
|
+
"",
|
|
430
|
+
"def redact(value: str) -> str:",
|
|
431
|
+
" text = str(value)",
|
|
432
|
+
" for marker in SENSITIVE_MARKERS:",
|
|
433
|
+
" if marker in text.upper():",
|
|
434
|
+
" return \"<redacted>\"",
|
|
435
|
+
" return text",
|
|
436
|
+
"",
|
|
437
|
+
"",
|
|
438
|
+
"def build_parser() -> argparse.ArgumentParser:",
|
|
439
|
+
f" parser = argparse.ArgumentParser(description={spec['purpose']!r})",
|
|
440
|
+
" parser.add_argument(\"--dry-run\", action=\"store_true\", help=\"show planned actions without writing\")",
|
|
441
|
+
" parser.add_argument(\"--execute\", action=\"store_true\", help=\"apply the planned actions\")",
|
|
442
|
+
" parser.add_argument(\"--yes\", action=\"store_true\", help=\"confirm real execution after dry-run review\")",
|
|
443
|
+
" parser.add_argument(\"--input\", help=\"optional input path or identifier\")",
|
|
444
|
+
" parser.add_argument(\"--summary-json\", help=\"optional path for a JSON execution summary\")",
|
|
445
|
+
" return parser",
|
|
446
|
+
"",
|
|
447
|
+
"",
|
|
448
|
+
"def planned_actions(args: argparse.Namespace) -> list[dict[str, str]]:",
|
|
449
|
+
" target = args.input or \"<input-not-provided>\"",
|
|
450
|
+
" return [",
|
|
451
|
+
" {",
|
|
452
|
+
" \"action\": \"inspect\",",
|
|
453
|
+
" \"target\": redact(target),",
|
|
454
|
+
f" \"side_effects\": {spec['side_effects']!r},",
|
|
455
|
+
" }",
|
|
456
|
+
" ]",
|
|
457
|
+
"",
|
|
458
|
+
"",
|
|
459
|
+
"def write_summary(path: str | None, payload: dict) -> None:",
|
|
460
|
+
" if not path:",
|
|
461
|
+
" return",
|
|
462
|
+
" target = Path(path)",
|
|
463
|
+
" target.parent.mkdir(parents=True, exist_ok=True)",
|
|
464
|
+
" target.write_text(json.dumps(payload, indent=2) + \"\\n\", encoding=\"utf-8\")",
|
|
465
|
+
"",
|
|
466
|
+
"",
|
|
467
|
+
"def main(argv: list[str] | None = None) -> int:",
|
|
468
|
+
" parser = build_parser()",
|
|
469
|
+
" args = parser.parse_args(argv)",
|
|
470
|
+
" logging.basicConfig(level=logging.INFO, format=\"%(levelname)s %(message)s\")",
|
|
471
|
+
" logger = logging.getLogger(\"automation\")",
|
|
472
|
+
"",
|
|
473
|
+
" if args.execute and args.dry_run:",
|
|
474
|
+
" logger.error(\"choose either --dry-run or --execute\")",
|
|
475
|
+
" return 2",
|
|
476
|
+
"",
|
|
477
|
+
*confirmation_block,
|
|
478
|
+
"",
|
|
479
|
+
" actions = planned_actions(args)",
|
|
480
|
+
" dry_run = not args.execute",
|
|
481
|
+
" payload = {",
|
|
482
|
+
f" \"automation\": {spec['automation_slug']!r},",
|
|
483
|
+
" \"dry_run\": dry_run,",
|
|
484
|
+
" \"actions\": actions,",
|
|
485
|
+
" }",
|
|
486
|
+
" logger.info(\"dry_run=%s actions=%s\", dry_run, len(actions))",
|
|
487
|
+
"",
|
|
488
|
+
" if dry_run:",
|
|
489
|
+
" print(json.dumps(payload, indent=2))",
|
|
490
|
+
" return 0",
|
|
491
|
+
"",
|
|
492
|
+
" # Add the approved write behavior here after validating the dry-run output.",
|
|
493
|
+
" write_summary(args.summary_json, payload)",
|
|
494
|
+
" print(json.dumps(payload, indent=2))",
|
|
495
|
+
" return 0",
|
|
496
|
+
"",
|
|
497
|
+
"",
|
|
498
|
+
"if __name__ == \"__main__\":",
|
|
499
|
+
" raise SystemExit(main())",
|
|
500
|
+
"",
|
|
501
|
+
]
|
|
502
|
+
return "\n".join(lines)
|
|
503
|
+
|
|
504
|
+
def render_readme(self, spec: dict[str, Any]) -> str:
|
|
505
|
+
dependency_lines = self.markdown_list(spec["dependencies"], fallback="No external dependencies.")
|
|
506
|
+
quality_lines = self.markdown_list(spec["quality_gates"], fallback="Review dry-run output before execution.")
|
|
507
|
+
return "\n".join(
|
|
508
|
+
[
|
|
509
|
+
f"# {spec['automation_name']}",
|
|
510
|
+
"",
|
|
511
|
+
spec["purpose"],
|
|
512
|
+
"",
|
|
513
|
+
"## Contract",
|
|
514
|
+
"",
|
|
515
|
+
f"- Inputs: {', '.join(spec['inputs'])}",
|
|
516
|
+
f"- Outputs: {', '.join(spec['outputs'])}",
|
|
517
|
+
f"- Systems: {', '.join(spec['systems'])}",
|
|
518
|
+
f"- Frequency: {spec['frequency']}",
|
|
519
|
+
f"- Target environment: {spec['target_environment']}",
|
|
520
|
+
f"- Side effects: {spec['side_effects']}",
|
|
521
|
+
f"- Risk: {spec['risk']}",
|
|
522
|
+
"",
|
|
523
|
+
"## Usage",
|
|
524
|
+
"",
|
|
525
|
+
"```bash",
|
|
526
|
+
"python automation.py --dry-run --input ./data",
|
|
527
|
+
"python automation.py --execute --yes --input ./data",
|
|
528
|
+
"```",
|
|
529
|
+
"",
|
|
530
|
+
"## Dependencies",
|
|
531
|
+
"",
|
|
532
|
+
dependency_lines,
|
|
533
|
+
"",
|
|
534
|
+
"## Quality Gates",
|
|
535
|
+
"",
|
|
536
|
+
quality_lines,
|
|
537
|
+
"",
|
|
538
|
+
"## Guardrails",
|
|
539
|
+
"",
|
|
540
|
+
"- Do not hardcode secrets.",
|
|
541
|
+
"- Review dry-run output before execution.",
|
|
542
|
+
"- Use `--execute --yes` only after validating targets and blast radius.",
|
|
543
|
+
"- Keep logs free of sensitive values.",
|
|
544
|
+
"",
|
|
545
|
+
]
|
|
546
|
+
)
|
|
547
|
+
|
|
548
|
+
def render_automation_test(self, spec: dict[str, Any]) -> str:
|
|
549
|
+
return "\n".join(
|
|
550
|
+
[
|
|
551
|
+
"import json",
|
|
552
|
+
"import subprocess",
|
|
553
|
+
"import sys",
|
|
554
|
+
"from pathlib import Path",
|
|
555
|
+
"",
|
|
556
|
+
"",
|
|
557
|
+
"def test_automation_dry_run_returns_json():",
|
|
558
|
+
" script = Path(__file__).resolve().parents[1] / \"automation.py\"",
|
|
559
|
+
" result = subprocess.run(",
|
|
560
|
+
" [sys.executable, str(script), \"--dry-run\", \"--input\", \"fixture\"],",
|
|
561
|
+
" text=True,",
|
|
562
|
+
" capture_output=True,",
|
|
563
|
+
" check=False,",
|
|
564
|
+
" )",
|
|
565
|
+
" assert result.returncode == 0, result.stderr",
|
|
566
|
+
" payload = json.loads(result.stdout)",
|
|
567
|
+
" assert payload[\"dry_run\"] is True",
|
|
568
|
+
f" assert payload[\"automation\"] == {spec['automation_slug']!r}",
|
|
569
|
+
"",
|
|
570
|
+
]
|
|
571
|
+
)
|
|
572
|
+
|
|
573
|
+
def render_requirements(self, spec: dict[str, Any]) -> str:
|
|
574
|
+
external = [
|
|
575
|
+
dependency
|
|
576
|
+
for dependency in spec["dependencies"]
|
|
577
|
+
if dependency and dependency.strip().lower() not in STANDARD_LIBRARY_HINTS
|
|
578
|
+
]
|
|
579
|
+
return "".join(f"{dependency}\n" for dependency in external)
|
|
580
|
+
|
|
581
|
+
def render_capability_yaml(self, spec: dict[str, Any], *, agent_id: str, capability_id: str) -> str:
|
|
582
|
+
payload = {
|
|
583
|
+
"id": f"{agent_id}.{capability_id}",
|
|
584
|
+
"kind": "capability",
|
|
585
|
+
"name": self.title_from_id(capability_id),
|
|
586
|
+
"version": "0.1.0",
|
|
587
|
+
"status": "draft",
|
|
588
|
+
"purpose": spec["purpose"],
|
|
589
|
+
"entrypoint": {"runner": "runner.py", "workflow": "workflow.md"},
|
|
590
|
+
"inputs": {"required": [], "optional": ["dry-run", "execute", "yes", "input", "summary-json"]},
|
|
591
|
+
"outputs": {"artifacts": ["automation-result.json"]},
|
|
592
|
+
"write_policy": self.capability_write_policy(spec["side_effects"]),
|
|
593
|
+
}
|
|
594
|
+
return yaml.safe_dump(payload, sort_keys=False, allow_unicode=False)
|
|
595
|
+
|
|
596
|
+
def render_capability_workflow(self, spec: dict[str, Any], *, capability_id: str) -> str:
|
|
597
|
+
return "\n".join(
|
|
598
|
+
[
|
|
599
|
+
"# Workflow",
|
|
600
|
+
"",
|
|
601
|
+
f"1. Executar `{capability_id}` em dry-run por padrao.",
|
|
602
|
+
"2. Validar alvo, entrada e resumo planejado.",
|
|
603
|
+
"3. Usar `--execute --yes --confirm-execute` apenas apos revisar o dry-run.",
|
|
604
|
+
"4. Retornar JSON com status, dry-run e acoes.",
|
|
605
|
+
"",
|
|
606
|
+
]
|
|
607
|
+
)
|
|
608
|
+
|
|
609
|
+
def render_capability_decision_rules(self, spec: dict[str, Any]) -> str:
|
|
610
|
+
return "\n".join(
|
|
611
|
+
[
|
|
612
|
+
"# Decision Rules",
|
|
613
|
+
"",
|
|
614
|
+
f"- Side effects classificados como `{spec['side_effects']}`.",
|
|
615
|
+
"- Nao persistir segredos.",
|
|
616
|
+
"- Escrita real exige confirmacao do runtime e do script.",
|
|
617
|
+
"- Falhas devem retornar exit code diferente de zero.",
|
|
618
|
+
"",
|
|
619
|
+
]
|
|
620
|
+
)
|
|
621
|
+
|
|
622
|
+
def render_capability_runner(self, spec: dict[str, Any]) -> str:
|
|
623
|
+
return self.render_automation_py(spec)
|
|
624
|
+
|
|
625
|
+
def capability_write_policy(self, side_effects: str) -> str:
|
|
626
|
+
mapping = {
|
|
627
|
+
"safe-repeat": "read_only",
|
|
628
|
+
"creates-artifact": "local_write",
|
|
629
|
+
"updates-local": "local_write",
|
|
630
|
+
"external-write": "confirm",
|
|
631
|
+
"destructive": "blocked_by_default",
|
|
632
|
+
}
|
|
633
|
+
return mapping[side_effects]
|
|
634
|
+
|
|
635
|
+
def dependency_plan(self, dependencies: list[str]) -> list[dict[str, Any]]:
|
|
636
|
+
result = []
|
|
637
|
+
for dependency in dependencies:
|
|
638
|
+
normalized = dependency.strip().lower()
|
|
639
|
+
result.append(
|
|
640
|
+
{
|
|
641
|
+
"name": dependency,
|
|
642
|
+
"kind": "standard-library" if normalized in STANDARD_LIBRARY_HINTS else "external",
|
|
643
|
+
"decision": "allowed" if normalized in STANDARD_LIBRARY_HINTS else "review-required",
|
|
644
|
+
}
|
|
645
|
+
)
|
|
646
|
+
return result
|
|
647
|
+
|
|
648
|
+
def side_effect_guardrails(self, side_effects: str) -> list[str]:
|
|
649
|
+
guardrails = {
|
|
650
|
+
"safe-repeat": ["Dry-run still available for inspection."],
|
|
651
|
+
"creates-artifact": ["Show target artifact path in dry-run.", "Use --execute --yes for creation."],
|
|
652
|
+
"updates-local": ["Show affected local paths in dry-run.", "Use --execute --yes for writes."],
|
|
653
|
+
"external-write": ["Require external approval and provider-specific confirmation."],
|
|
654
|
+
"destructive": ["Blocked by default; require a separate risk decision before execution."],
|
|
655
|
+
}
|
|
656
|
+
return guardrails[side_effects]
|
|
657
|
+
|
|
658
|
+
def automation_summary(self, spec: dict[str, Any]) -> dict[str, Any]:
|
|
659
|
+
return {
|
|
660
|
+
"name": spec["automation_name"],
|
|
661
|
+
"slug": spec["automation_slug"],
|
|
662
|
+
"purpose": spec["purpose"],
|
|
663
|
+
"systems": spec["systems"],
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
def public_file_plan(self, files: list[tuple[str, str]]) -> list[dict[str, Any]]:
|
|
667
|
+
return [{"path": path, "bytes": len(content.encode("utf-8"))} for path, content in files]
|
|
668
|
+
|
|
669
|
+
def open_questions(self, spec: dict[str, Any]) -> list[str]:
|
|
670
|
+
questions: list[str] = []
|
|
671
|
+
if not spec["quality_gates"]:
|
|
672
|
+
questions.append("Quais criterios confirmam que a automacao executou corretamente?")
|
|
673
|
+
if any(item["kind"] == "external" for item in self.dependency_plan(spec["dependencies"])):
|
|
674
|
+
questions.append("A dependencia externa e realmente necessaria ou standard library resolve?")
|
|
675
|
+
if spec["side_effects"] in {"external-write", "destructive"}:
|
|
676
|
+
questions.append("Qual aprovacao humana e rollback sao exigidos antes da execucao real?")
|
|
677
|
+
return questions
|
|
678
|
+
|
|
679
|
+
def question_for_missing_field(self, field: str) -> str:
|
|
680
|
+
questions = {
|
|
681
|
+
"automation_name": "Qual sera o nome da automacao?",
|
|
682
|
+
"purpose": "Qual tarefa repetitiva a automacao deve resolver?",
|
|
683
|
+
"inputs": "Quais entradas a automacao recebe?",
|
|
684
|
+
"outputs": "Quais saidas a automacao produz?",
|
|
685
|
+
"systems": "Quais sistemas ou recursos a automacao toca?",
|
|
686
|
+
"side_effects": "Qual classificacao de side effects se aplica?",
|
|
687
|
+
}
|
|
688
|
+
return questions.get(field, f"Informe o campo obrigatorio {field}.")
|
|
689
|
+
|
|
690
|
+
def markdown_list(self, values: list[str], *, fallback: str) -> str:
|
|
691
|
+
if not values:
|
|
692
|
+
return f"- {fallback}"
|
|
693
|
+
return "\n".join(f"- {value}" for value in values)
|
|
694
|
+
|
|
695
|
+
def slugify(self, value: str) -> str:
|
|
696
|
+
slug = SLUG_PATTERN.sub("-", value.strip().lower()).strip("-")
|
|
697
|
+
return slug or "python-automation"
|
|
698
|
+
|
|
699
|
+
def title_from_id(self, value: str) -> str:
|
|
700
|
+
return " ".join(part.capitalize() for part in value.split("-"))
|
|
701
|
+
|
|
702
|
+
def iter_strings(self, value: Any):
|
|
703
|
+
if isinstance(value, str):
|
|
704
|
+
yield value
|
|
705
|
+
elif isinstance(value, dict):
|
|
706
|
+
for item in value.values():
|
|
707
|
+
yield from self.iter_strings(item)
|
|
708
|
+
elif isinstance(value, list):
|
|
709
|
+
for item in value:
|
|
710
|
+
yield from self.iter_strings(item)
|
|
711
|
+
|
|
712
|
+
def is_inside(self, root: Path, target: Path) -> bool:
|
|
713
|
+
try:
|
|
714
|
+
target.relative_to(root)
|
|
715
|
+
return True
|
|
716
|
+
except ValueError:
|
|
717
|
+
return False
|