agent-devkit 0.1.6 → 0.3.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 +59 -5
- package/bin/agent.mjs +133 -7
- package/package.json +1 -1
- package/runtime/README.md +239 -5
- package/runtime/agent +36 -5
- package/runtime/agents/README.md +44 -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/contribution-reviewer/AGENTS.md +8 -0
- package/runtime/agents/contribution-reviewer/README.md +8 -0
- package/runtime/agents/contribution-reviewer/agent.yaml +40 -0
- package/runtime/agents/contribution-reviewer/capabilities/plan-contribution-pr/capability.yaml +27 -0
- package/runtime/agents/contribution-reviewer/capabilities/plan-contribution-pr/decision-rules.md +5 -0
- package/runtime/agents/contribution-reviewer/capabilities/plan-contribution-pr/workflow.md +6 -0
- package/runtime/agents/contribution-reviewer/capabilities/review-contribution/capability.yaml +25 -0
- package/runtime/agents/contribution-reviewer/capabilities/review-contribution/decision-rules.md +5 -0
- package/runtime/agents/contribution-reviewer/capabilities/review-contribution/workflow.md +5 -0
- package/runtime/agents/contribution-reviewer/capabilities/validate-local-contribution/capability.yaml +26 -0
- package/runtime/agents/contribution-reviewer/capabilities/validate-local-contribution/decision-rules.md +5 -0
- package/runtime/agents/contribution-reviewer/capabilities/validate-local-contribution/workflow.md +6 -0
- package/runtime/agents/contribution-reviewer/infra/README.md +6 -0
- package/runtime/agents/contribution-reviewer/knowledge/context.md +8 -0
- package/runtime/agents/contribution-reviewer/knowledge/system.md +8 -0
- package/runtime/agents/contribution-reviewer/templates/README.md +3 -0
- 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-author/AGENTS.md +7 -0
- package/runtime/agents/knowledge-author/README.md +7 -0
- package/runtime/agents/knowledge-author/agent.yaml +37 -0
- package/runtime/agents/knowledge-author/capabilities/create-knowledge-snapshot/capability.yaml +30 -0
- package/runtime/agents/knowledge-author/capabilities/create-knowledge-snapshot/decision-rules.md +6 -0
- package/runtime/agents/knowledge-author/capabilities/create-knowledge-snapshot/workflow.md +7 -0
- package/runtime/agents/knowledge-author/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-author/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-author/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-author/templates/.gitkeep +1 -0
- package/runtime/agents/knowledge-curator/AGENTS.md +7 -0
- package/runtime/agents/knowledge-curator/README.md +6 -0
- package/runtime/agents/knowledge-curator/agent.yaml +37 -0
- package/runtime/agents/knowledge-curator/capabilities/curate-knowledge-base/capability.yaml +29 -0
- package/runtime/agents/knowledge-curator/capabilities/curate-knowledge-base/decision-rules.md +6 -0
- package/runtime/agents/knowledge-curator/capabilities/curate-knowledge-base/workflow.md +7 -0
- package/runtime/agents/knowledge-curator/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-curator/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-curator/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-curator/templates/.gitkeep +1 -0
- package/runtime/agents/knowledge-generator/agent.yaml +13 -3
- package/runtime/agents/knowledge-generator/capabilities/generate-knowledge/capability.yaml +1 -1
- package/runtime/agents/knowledge-infra-builder/AGENTS.md +8 -0
- package/runtime/agents/knowledge-infra-builder/README.md +8 -0
- package/runtime/agents/knowledge-infra-builder/agent.yaml +38 -0
- package/runtime/agents/knowledge-infra-builder/capabilities/create-knowledge-base/capability.yaml +30 -0
- package/runtime/agents/knowledge-infra-builder/capabilities/create-knowledge-base/decision-rules.md +6 -0
- package/runtime/agents/knowledge-infra-builder/capabilities/create-knowledge-base/workflow.md +7 -0
- package/runtime/agents/knowledge-infra-builder/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-infra-builder/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-infra-builder/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-infra-builder/templates/.gitkeep +1 -0
- package/runtime/agents/knowledge-owner/AGENTS.md +7 -0
- package/runtime/agents/knowledge-owner/README.md +6 -0
- package/runtime/agents/knowledge-owner/agent.yaml +37 -0
- package/runtime/agents/knowledge-owner/capabilities/publish-knowledge-snapshot/capability.yaml +28 -0
- package/runtime/agents/knowledge-owner/capabilities/publish-knowledge-snapshot/decision-rules.md +6 -0
- package/runtime/agents/knowledge-owner/capabilities/publish-knowledge-snapshot/workflow.md +7 -0
- package/runtime/agents/knowledge-owner/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-owner/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-owner/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-owner/templates/.gitkeep +1 -0
- package/runtime/agents/knowledge-reviewer/AGENTS.md +7 -0
- package/runtime/agents/knowledge-reviewer/README.md +7 -0
- package/runtime/agents/knowledge-reviewer/agent.yaml +36 -0
- package/runtime/agents/knowledge-reviewer/capabilities/review-knowledge-snapshot/capability.yaml +26 -0
- package/runtime/agents/knowledge-reviewer/capabilities/review-knowledge-snapshot/decision-rules.md +6 -0
- package/runtime/agents/knowledge-reviewer/capabilities/review-knowledge-snapshot/workflow.md +7 -0
- package/runtime/agents/knowledge-reviewer/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-reviewer/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-reviewer/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-reviewer/templates/.gitkeep +1 -0
- 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/local-memory-manager/AGENTS.md +5 -0
- package/runtime/agents/local-memory-manager/README.md +7 -0
- package/runtime/agents/local-memory-manager/agent.yaml +38 -0
- package/runtime/agents/local-memory-manager/capabilities/curate-local-memory/capability.yaml +19 -0
- package/runtime/agents/local-memory-manager/capabilities/curate-local-memory/decision-rules.md +5 -0
- package/runtime/agents/local-memory-manager/capabilities/curate-local-memory/workflow.md +6 -0
- package/runtime/agents/local-memory-manager/capabilities/inspect-local-memory/capability.yaml +19 -0
- package/runtime/agents/local-memory-manager/capabilities/inspect-local-memory/decision-rules.md +5 -0
- package/runtime/agents/local-memory-manager/capabilities/inspect-local-memory/workflow.md +5 -0
- package/runtime/agents/local-memory-manager/infra/.gitkeep +1 -0
- package/runtime/agents/local-memory-manager/knowledge/context.md +4 -0
- package/runtime/agents/local-memory-manager/knowledge/system.md +4 -0
- package/runtime/agents/local-memory-manager/templates/.gitkeep +1 -0
- package/runtime/agents/memory-sync-manager/AGENTS.md +7 -0
- package/runtime/agents/memory-sync-manager/README.md +7 -0
- package/runtime/agents/memory-sync-manager/agent.yaml +37 -0
- package/runtime/agents/memory-sync-manager/capabilities/plan-memory-backup/capability.yaml +29 -0
- package/runtime/agents/memory-sync-manager/capabilities/plan-memory-backup/decision-rules.md +6 -0
- package/runtime/agents/memory-sync-manager/capabilities/plan-memory-backup/workflow.md +7 -0
- package/runtime/agents/memory-sync-manager/infra/.gitkeep +1 -0
- package/runtime/agents/memory-sync-manager/knowledge/context.md +4 -0
- package/runtime/agents/memory-sync-manager/knowledge/system.md +4 -0
- package/runtime/agents/memory-sync-manager/templates/.gitkeep +1 -0
- 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/shared-memory-curator/AGENTS.md +5 -0
- package/runtime/agents/shared-memory-curator/README.md +6 -0
- package/runtime/agents/shared-memory-curator/agent.yaml +38 -0
- package/runtime/agents/shared-memory-curator/capabilities/create-shared-memory/capability.yaml +19 -0
- package/runtime/agents/shared-memory-curator/capabilities/create-shared-memory/decision-rules.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/create-shared-memory/workflow.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/publish-shared-submission/capability.yaml +19 -0
- package/runtime/agents/shared-memory-curator/capabilities/publish-shared-submission/decision-rules.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/publish-shared-submission/workflow.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/review-shared-submission/capability.yaml +19 -0
- package/runtime/agents/shared-memory-curator/capabilities/review-shared-submission/decision-rules.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/review-shared-submission/workflow.md +5 -0
- package/runtime/agents/shared-memory-curator/infra/.gitkeep +1 -0
- package/runtime/agents/shared-memory-curator/knowledge/context.md +5 -0
- package/runtime/agents/shared-memory-curator/knowledge/system.md +4 -0
- package/runtime/agents/shared-memory-curator/templates/.gitkeep +1 -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/README.md +35 -4
- 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 +247 -6
- package/runtime/cli/aikit/agentic_commands.py +158 -0
- package/runtime/cli/aikit/app_home.py +1 -0
- package/runtime/cli/aikit/architecture.py +84 -0
- package/runtime/cli/aikit/audit.py +187 -8
- package/runtime/cli/aikit/autonomy.py +237 -0
- package/runtime/cli/aikit/capability_runtime.py +522 -0
- package/runtime/cli/aikit/catalog.py +516 -0
- package/runtime/cli/aikit/cli_dispatch.py +1554 -0
- package/runtime/cli/aikit/cli_parser.py +547 -0
- package/runtime/cli/aikit/collaboration.py +359 -0
- package/runtime/cli/aikit/configuration_orchestrator.py +52 -26
- package/runtime/cli/aikit/contribution.py +235 -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 +164 -0
- package/runtime/cli/aikit/errors.py +7 -0
- package/runtime/cli/aikit/eval.py +504 -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 +1332 -0
- package/runtime/cli/aikit/impact_map.py +294 -0
- package/runtime/cli/aikit/interactive_wizard.py +227 -0
- package/runtime/cli/aikit/knowledge_base.py +1067 -0
- package/runtime/cli/aikit/llm.py +12 -4
- package/runtime/cli/aikit/local_artifacts.py +444 -0
- package/runtime/cli/aikit/local_llm.py +161 -0
- package/runtime/cli/aikit/local_llm_operator.py +35 -1
- package/runtime/cli/aikit/main.py +23 -2833
- package/runtime/cli/aikit/mcp_manifest.py +1027 -0
- package/runtime/cli/aikit/mcp_server.py +132 -0
- package/runtime/cli/aikit/mcp_tools.py +900 -0
- package/runtime/cli/aikit/memory.py +405 -0
- package/runtime/cli/aikit/mini_brain.py +246 -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 +662 -0
- package/runtime/cli/aikit/notifications.py +716 -2
- package/runtime/cli/aikit/ollama.py +64 -14
- package/runtime/cli/aikit/onboarding.py +551 -0
- package/runtime/cli/aikit/orchestrator.py +809 -119
- package/runtime/cli/aikit/output.py +130 -2
- package/runtime/cli/aikit/permissions.py +14 -4
- package/runtime/cli/aikit/prompt_injection.py +68 -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 +114 -0
- package/runtime/cli/aikit/sessions.py +88 -2
- package/runtime/cli/aikit/setup_wizard_payload.py +35 -0
- package/runtime/cli/aikit/shared_memory.py +415 -0
- package/runtime/cli/aikit/sources.py +298 -50
- package/runtime/cli/aikit/specialist_readiness.py +152 -0
- package/runtime/cli/aikit/tasks.py +553 -22
- package/runtime/cli/aikit/team.py +380 -0
- package/runtime/cli/aikit/toolchain.py +7 -2
- package/runtime/cli/aikit/wizard_state.py +15 -1
- package/runtime/cli/aikit/workflows.py +216 -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/knowledge-github.yaml +40 -0
- package/runtime/providers/knowledge-google-drive.yaml +32 -0
- package/runtime/providers/knowledge-local.yaml +26 -0
- package/runtime/providers/knowledge-notion.yaml +32 -0
- package/runtime/providers/knowledge-obsidian.yaml +24 -0
- package/runtime/providers/knowledge-onedrive.yaml +36 -0
- package/runtime/providers/knowledge-s3.yaml +45 -0
- package/runtime/providers/knowledge-sharepoint.yaml +39 -0
- package/runtime/providers/knowledge-supabase.yaml +43 -0
- package/runtime/providers/knowledge-vector.yaml +39 -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/requirements.txt +6 -0
- package/runtime/scripts/docker-cli-qa.sh +453 -0
- package/runtime/scripts/release-catalog-snapshot.json +594 -0
- package/runtime/scripts/release-gate.py +189 -8
- package/runtime/scripts/validate-repo.py +312 -0
- package/runtime/tooling/toolchain.yaml +92 -0
- package/runtime/vendor/skills/napkin/napkin.md +32 -12
- package/runtime/workflows/azure-card-analysis/README.md +3 -0
- package/runtime/workflows/azure-card-analysis/workflow.yaml +30 -0
- package/runtime/workflows/daily-pr-review/README.md +3 -0
- package/runtime/workflows/daily-pr-review/workflow.yaml +31 -0
- package/runtime/workflows/incident-analysis/README.md +3 -0
- package/runtime/workflows/incident-analysis/workflow.yaml +33 -0
- package/runtime/workflows/release-prep/README.md +3 -0
- package/runtime/workflows/release-prep/workflow.yaml +30 -0
|
@@ -4,6 +4,14 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import re
|
|
6
6
|
import shutil
|
|
7
|
+
import hashlib
|
|
8
|
+
import hmac
|
|
9
|
+
import base64
|
|
10
|
+
import io
|
|
11
|
+
import json
|
|
12
|
+
import os
|
|
13
|
+
import tarfile
|
|
14
|
+
import tempfile
|
|
7
15
|
from datetime import datetime, timezone
|
|
8
16
|
from pathlib import Path
|
|
9
17
|
from typing import Any
|
|
@@ -95,12 +103,18 @@ Curated local runbook entries promoted from repeated use.
|
|
|
95
103
|
- Keep high-value reusable notes here.
|
|
96
104
|
""",
|
|
97
105
|
}
|
|
106
|
+
BACKUP_PACKAGE_SCHEMA_VERSION = "agent-devkit.memory-backup-package/v1"
|
|
107
|
+
BACKUP_PACKAGE_ALGORITHM = "PBKDF2-HMAC-SHA256/XOR-HMAC-SHA256"
|
|
98
108
|
|
|
99
109
|
|
|
100
110
|
def memory_home() -> Path:
|
|
101
111
|
return app_memory_home()
|
|
102
112
|
|
|
103
113
|
|
|
114
|
+
def memory_backups_home() -> Path:
|
|
115
|
+
return app_path("backups", "memory")
|
|
116
|
+
|
|
117
|
+
|
|
104
118
|
def ensure_memory() -> dict[str, Any]:
|
|
105
119
|
ensure_app_home()
|
|
106
120
|
home = memory_home()
|
|
@@ -193,6 +207,183 @@ def show_memory(root: Path, *, agent_id: str | None = None, source_id: str | Non
|
|
|
193
207
|
}
|
|
194
208
|
|
|
195
209
|
|
|
210
|
+
def create_memory_backup(
|
|
211
|
+
*,
|
|
212
|
+
title: str | None = None,
|
|
213
|
+
encrypted: bool = False,
|
|
214
|
+
passphrase_env: str | None = None,
|
|
215
|
+
) -> dict[str, Any]:
|
|
216
|
+
memory_paths = ensure_memory()
|
|
217
|
+
backups = memory_backups_home()
|
|
218
|
+
backups.mkdir(parents=True, exist_ok=True)
|
|
219
|
+
backup_id = unique_backup_id(title)
|
|
220
|
+
backup_root = backups / backup_id
|
|
221
|
+
backup_root.mkdir(parents=True, exist_ok=False)
|
|
222
|
+
backup_memory = backup_root / ("_memory-staging" if encrypted else "memory")
|
|
223
|
+
shutil.copytree(memory_home(), backup_memory)
|
|
224
|
+
|
|
225
|
+
files = backup_file_inventory(backup_memory)
|
|
226
|
+
manifest = {
|
|
227
|
+
"schema_version": "agent-devkit.memory-backup/v1",
|
|
228
|
+
"id": backup_id,
|
|
229
|
+
"title": title or "Memory backup",
|
|
230
|
+
"created_at": datetime.now(timezone.utc).isoformat(),
|
|
231
|
+
"source_home": str(memory_home()),
|
|
232
|
+
"storage": "local-filesystem",
|
|
233
|
+
"remote_upload": False,
|
|
234
|
+
"encrypted": encrypted,
|
|
235
|
+
"sensitive_local_copy": not encrypted,
|
|
236
|
+
"files": files,
|
|
237
|
+
"package": None,
|
|
238
|
+
"notes": [
|
|
239
|
+
"This is a local backup only; no remote provider upload was executed.",
|
|
240
|
+
"Remote backup must be encrypted before upload and requires explicit opt-in.",
|
|
241
|
+
],
|
|
242
|
+
}
|
|
243
|
+
if encrypted:
|
|
244
|
+
package_path = backup_root / f"{backup_id}.adkmb"
|
|
245
|
+
passphrase = passphrase_from_env(passphrase_env)
|
|
246
|
+
write_encrypted_backup_package(package_path, backup_memory, manifest, passphrase)
|
|
247
|
+
manifest["package"] = str(package_path)
|
|
248
|
+
manifest["package_name"] = package_path.name
|
|
249
|
+
shutil.rmtree(backup_memory)
|
|
250
|
+
manifest_path = backup_root / "manifest.json"
|
|
251
|
+
manifest_path.write_text(json.dumps(manifest, ensure_ascii=False, indent=2, sort_keys=True) + "\n", encoding="utf-8")
|
|
252
|
+
next_steps = [
|
|
253
|
+
f"Restore with `agent memory backup restore {backup_id} --yes`.",
|
|
254
|
+
f"Delete with `agent memory backup delete {backup_id} --yes`.",
|
|
255
|
+
]
|
|
256
|
+
if encrypted:
|
|
257
|
+
next_steps[0] = f"Restore with `agent memory backup restore {backup_id} --passphrase-env {passphrase_env or 'AGENT_DEVKIT_BACKUP_PASSPHRASE'} --yes`."
|
|
258
|
+
next_steps.insert(1, f"Portable package: {manifest['package']}")
|
|
259
|
+
return {
|
|
260
|
+
"kind": "memory-backup",
|
|
261
|
+
"status": "created",
|
|
262
|
+
"backup": public_backup(manifest, backup_root),
|
|
263
|
+
"home": str(backups),
|
|
264
|
+
"memory_home": memory_paths["home"],
|
|
265
|
+
"next_steps": next_steps,
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def list_memory_backups() -> dict[str, Any]:
|
|
270
|
+
backups = memory_backups_home()
|
|
271
|
+
items = []
|
|
272
|
+
if backups.exists():
|
|
273
|
+
for manifest_path in sorted(backups.glob("*/manifest.json")):
|
|
274
|
+
manifest = load_backup_manifest(manifest_path)
|
|
275
|
+
if manifest:
|
|
276
|
+
items.append(public_backup(manifest, manifest_path.parent))
|
|
277
|
+
return {
|
|
278
|
+
"kind": "memory-backups",
|
|
279
|
+
"status": "ok",
|
|
280
|
+
"home": str(backups),
|
|
281
|
+
"count": len(items),
|
|
282
|
+
"items": items,
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
def restore_memory_backup(
|
|
287
|
+
backup_id: str | None,
|
|
288
|
+
*,
|
|
289
|
+
yes: bool = False,
|
|
290
|
+
backup_file: str | None = None,
|
|
291
|
+
passphrase_env: str | None = None,
|
|
292
|
+
) -> dict[str, Any]:
|
|
293
|
+
backup_root, manifest = require_memory_backup(backup_id, backup_file=backup_file, passphrase_env=passphrase_env)
|
|
294
|
+
payload = {
|
|
295
|
+
"kind": "memory-backup-restore",
|
|
296
|
+
"backup": public_backup(manifest, backup_root),
|
|
297
|
+
"memory_home": str(memory_home()),
|
|
298
|
+
"requires_confirmation": True,
|
|
299
|
+
}
|
|
300
|
+
if not yes:
|
|
301
|
+
return {
|
|
302
|
+
**payload,
|
|
303
|
+
"status": "planned",
|
|
304
|
+
"executed": False,
|
|
305
|
+
"next_steps": [restore_next_step(manifest, backup_file=backup_file, passphrase_env=passphrase_env)],
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
ensure_app_home()
|
|
309
|
+
safety_backup: str | None = None
|
|
310
|
+
with decrypted_memory_source(backup_root, manifest, passphrase_env=passphrase_env) as source_memory:
|
|
311
|
+
if memory_home().exists():
|
|
312
|
+
safety_root = memory_backups_home() / f"pre-restore-{timestamp_id()}"
|
|
313
|
+
safety_root.mkdir(parents=True, exist_ok=False)
|
|
314
|
+
shutil.copytree(memory_home(), safety_root / "memory")
|
|
315
|
+
safety_backup = str(safety_root)
|
|
316
|
+
shutil.rmtree(memory_home())
|
|
317
|
+
shutil.copytree(source_memory, memory_home())
|
|
318
|
+
return {
|
|
319
|
+
**payload,
|
|
320
|
+
"status": "restored",
|
|
321
|
+
"executed": True,
|
|
322
|
+
"safety_backup": safety_backup,
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
class decrypted_memory_source:
|
|
327
|
+
def __init__(self, backup_root: Path, manifest: dict[str, Any], *, passphrase_env: str | None = None) -> None:
|
|
328
|
+
self.backup_root = backup_root
|
|
329
|
+
self.manifest = manifest
|
|
330
|
+
self.passphrase_env = passphrase_env
|
|
331
|
+
self.temp_dir: tempfile.TemporaryDirectory[str] | None = None
|
|
332
|
+
|
|
333
|
+
def __enter__(self) -> Path:
|
|
334
|
+
plain = self.backup_root / "memory"
|
|
335
|
+
if plain.exists():
|
|
336
|
+
return plain
|
|
337
|
+
package_path = package_path_from_manifest(self.backup_root, self.manifest)
|
|
338
|
+
if not package_path:
|
|
339
|
+
raise ValueError(f"memory backup has no restorable memory payload: {self.manifest.get('id')}")
|
|
340
|
+
passphrase = passphrase_from_env(self.passphrase_env)
|
|
341
|
+
self.temp_dir = tempfile.TemporaryDirectory(prefix="agent-devkit-memory-restore-")
|
|
342
|
+
target = Path(self.temp_dir.name)
|
|
343
|
+
extract_encrypted_backup_package(package_path, target, passphrase)
|
|
344
|
+
memory = target / "memory"
|
|
345
|
+
if not memory.exists():
|
|
346
|
+
raise ValueError("encrypted memory backup package did not contain memory/")
|
|
347
|
+
return memory
|
|
348
|
+
|
|
349
|
+
def __exit__(self, _exc_type: object, _exc: object, _tb: object) -> None:
|
|
350
|
+
if self.temp_dir:
|
|
351
|
+
self.temp_dir.cleanup()
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def restore_next_step(manifest: dict[str, Any], *, backup_file: str | None, passphrase_env: str | None) -> str:
|
|
355
|
+
if manifest.get("encrypted"):
|
|
356
|
+
env_name = passphrase_env or "AGENT_DEVKIT_BACKUP_PASSPHRASE"
|
|
357
|
+
if backup_file:
|
|
358
|
+
return f"Re-run with `agent memory backup restore --file {backup_file} --passphrase-env {env_name} --yes` to restore local memory."
|
|
359
|
+
return f"Re-run with `agent memory backup restore {manifest['id']} --passphrase-env {env_name} --yes` to restore local memory."
|
|
360
|
+
if backup_file:
|
|
361
|
+
return f"Re-run with `agent memory backup restore --file {backup_file} --yes` to restore local memory."
|
|
362
|
+
return f"Re-run with `agent memory backup restore {manifest['id']} --yes` to restore local memory."
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
def delete_memory_backup(backup_id: str | None, *, yes: bool = False) -> dict[str, Any]:
|
|
366
|
+
backup_root, manifest = require_memory_backup(backup_id)
|
|
367
|
+
payload = {
|
|
368
|
+
"kind": "memory-backup-delete",
|
|
369
|
+
"backup": public_backup(manifest, backup_root),
|
|
370
|
+
"requires_confirmation": True,
|
|
371
|
+
}
|
|
372
|
+
if not yes:
|
|
373
|
+
return {
|
|
374
|
+
**payload,
|
|
375
|
+
"status": "planned",
|
|
376
|
+
"executed": False,
|
|
377
|
+
"next_steps": [f"Re-run with `agent memory backup delete {manifest['id']} --yes` to remove this local backup."],
|
|
378
|
+
}
|
|
379
|
+
shutil.rmtree(backup_root)
|
|
380
|
+
return {
|
|
381
|
+
**payload,
|
|
382
|
+
"status": "deleted",
|
|
383
|
+
"executed": True,
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
|
|
196
387
|
def reset_memory(
|
|
197
388
|
*,
|
|
198
389
|
all_memory: bool = False,
|
|
@@ -246,6 +437,220 @@ def memory_path_payload() -> dict[str, Any]:
|
|
|
246
437
|
return ensure_memory()
|
|
247
438
|
|
|
248
439
|
|
|
440
|
+
def unique_backup_id(title: str | None) -> str:
|
|
441
|
+
base = sanitize_segment(title or "memory-backup")
|
|
442
|
+
candidate = f"{base}-{timestamp_id()}"
|
|
443
|
+
backups = memory_backups_home()
|
|
444
|
+
if not (backups / candidate).exists():
|
|
445
|
+
return candidate
|
|
446
|
+
suffix = 2
|
|
447
|
+
while (backups / f"{candidate}-{suffix}").exists():
|
|
448
|
+
suffix += 1
|
|
449
|
+
return f"{candidate}-{suffix}"
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
def timestamp_id() -> str:
|
|
453
|
+
return datetime.now(timezone.utc).strftime("%Y%m%d%H%M%S")
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
def backup_file_inventory(root: Path) -> list[dict[str, Any]]:
|
|
457
|
+
items: list[dict[str, Any]] = []
|
|
458
|
+
for path in sorted(item for item in root.rglob("*") if item.is_file()):
|
|
459
|
+
relative = str(path.relative_to(root))
|
|
460
|
+
data = path.read_bytes()
|
|
461
|
+
items.append(
|
|
462
|
+
{
|
|
463
|
+
"path": relative,
|
|
464
|
+
"bytes": len(data),
|
|
465
|
+
"sha256": hashlib.sha256(data).hexdigest(),
|
|
466
|
+
}
|
|
467
|
+
)
|
|
468
|
+
return items
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
def public_backup(manifest: dict[str, Any], root: Path) -> dict[str, Any]:
|
|
472
|
+
files = manifest.get("files") if isinstance(manifest.get("files"), list) else []
|
|
473
|
+
return {
|
|
474
|
+
"id": manifest.get("id"),
|
|
475
|
+
"title": manifest.get("title"),
|
|
476
|
+
"created_at": manifest.get("created_at"),
|
|
477
|
+
"path": str(root),
|
|
478
|
+
"storage": manifest.get("storage"),
|
|
479
|
+
"remote_upload": manifest.get("remote_upload") is True,
|
|
480
|
+
"encrypted": manifest.get("encrypted") is True,
|
|
481
|
+
"sensitive_local_copy": manifest.get("sensitive_local_copy") is True,
|
|
482
|
+
"package": manifest.get("package"),
|
|
483
|
+
"package_name": manifest.get("package_name"),
|
|
484
|
+
"file_count": len(files),
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
def require_memory_backup(
|
|
489
|
+
backup_id: str | None,
|
|
490
|
+
*,
|
|
491
|
+
backup_file: str | None = None,
|
|
492
|
+
passphrase_env: str | None = None,
|
|
493
|
+
) -> tuple[Path, dict[str, Any]]:
|
|
494
|
+
if backup_file:
|
|
495
|
+
package = Path(backup_file).expanduser().resolve()
|
|
496
|
+
manifest = read_encrypted_backup_header(package, passphrase_env=passphrase_env)
|
|
497
|
+
return package.parent, manifest
|
|
498
|
+
item_id = sanitize_segment(backup_id or "")
|
|
499
|
+
if not item_id:
|
|
500
|
+
raise ValueError("memory backup requires a backup id")
|
|
501
|
+
root = memory_backups_home() / item_id
|
|
502
|
+
manifest_path = root / "manifest.json"
|
|
503
|
+
if not manifest_path.exists():
|
|
504
|
+
raise ValueError(f"memory backup not found: {item_id}")
|
|
505
|
+
manifest = load_backup_manifest(manifest_path)
|
|
506
|
+
if not manifest:
|
|
507
|
+
raise ValueError(f"invalid memory backup manifest: {item_id}")
|
|
508
|
+
return root, manifest
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
def load_backup_manifest(path: Path) -> dict[str, Any] | None:
|
|
512
|
+
try:
|
|
513
|
+
payload = json.loads(path.read_text(encoding="utf-8"))
|
|
514
|
+
except (OSError, json.JSONDecodeError):
|
|
515
|
+
return None
|
|
516
|
+
return payload if isinstance(payload, dict) else None
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
def passphrase_from_env(passphrase_env: str | None) -> str:
|
|
520
|
+
env_name = passphrase_env or "AGENT_DEVKIT_BACKUP_PASSPHRASE"
|
|
521
|
+
if not re.match(r"^[A-Za-z_][A-Za-z0-9_]*$", env_name):
|
|
522
|
+
raise ValueError("--passphrase-env must be an environment variable name")
|
|
523
|
+
value = os.environ.get(env_name)
|
|
524
|
+
if not value:
|
|
525
|
+
raise ValueError(f"memory backup passphrase environment variable is not set: {env_name}")
|
|
526
|
+
if len(value) < 8:
|
|
527
|
+
raise ValueError("memory backup passphrase must have at least 8 characters")
|
|
528
|
+
return value
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
def write_encrypted_backup_package(package_path: Path, memory_dir: Path, manifest: dict[str, Any], passphrase: str) -> None:
|
|
532
|
+
tar_bytes = memory_tar_bytes(memory_dir)
|
|
533
|
+
salt = os.urandom(16)
|
|
534
|
+
nonce = os.urandom(16)
|
|
535
|
+
key = derive_backup_key(passphrase, salt)
|
|
536
|
+
ciphertext = xor_bytes(tar_bytes, key, nonce)
|
|
537
|
+
header = {
|
|
538
|
+
"schema_version": BACKUP_PACKAGE_SCHEMA_VERSION,
|
|
539
|
+
"algorithm": BACKUP_PACKAGE_ALGORITHM,
|
|
540
|
+
"kdf": "PBKDF2-HMAC-SHA256",
|
|
541
|
+
"iterations": 200_000,
|
|
542
|
+
"salt": base64.b64encode(salt).decode("ascii"),
|
|
543
|
+
"nonce": base64.b64encode(nonce).decode("ascii"),
|
|
544
|
+
"manifest": {key: value for key, value in manifest.items() if key != "files"},
|
|
545
|
+
"files": manifest.get("files") or [],
|
|
546
|
+
}
|
|
547
|
+
header_bytes = json.dumps(header, ensure_ascii=False, sort_keys=True).encode("utf-8")
|
|
548
|
+
tag = hmac.new(key, header_bytes + ciphertext, hashlib.sha256).hexdigest()
|
|
549
|
+
envelope = {
|
|
550
|
+
"schema_version": BACKUP_PACKAGE_SCHEMA_VERSION,
|
|
551
|
+
"header": header,
|
|
552
|
+
"ciphertext": base64.b64encode(ciphertext).decode("ascii"),
|
|
553
|
+
"tag": tag,
|
|
554
|
+
}
|
|
555
|
+
package_path.write_text(json.dumps(envelope, ensure_ascii=False, indent=2, sort_keys=True) + "\n", encoding="utf-8")
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
def read_encrypted_backup_header(package_path: Path, *, passphrase_env: str | None = None) -> dict[str, Any]:
|
|
559
|
+
envelope = read_backup_package(package_path)
|
|
560
|
+
header = envelope["header"]
|
|
561
|
+
manifest = header.get("manifest") if isinstance(header.get("manifest"), dict) else {}
|
|
562
|
+
payload = dict(manifest)
|
|
563
|
+
payload["files"] = header.get("files") if isinstance(header.get("files"), list) else []
|
|
564
|
+
payload["encrypted"] = True
|
|
565
|
+
payload["sensitive_local_copy"] = False
|
|
566
|
+
payload["package"] = str(package_path)
|
|
567
|
+
payload["package_name"] = package_path.name
|
|
568
|
+
payload.setdefault("id", package_path.stem)
|
|
569
|
+
payload.setdefault("title", package_path.stem)
|
|
570
|
+
return payload
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
def extract_encrypted_backup_package(package_path: Path, target: Path, passphrase: str) -> None:
|
|
574
|
+
envelope = read_backup_package(package_path)
|
|
575
|
+
header = envelope["header"]
|
|
576
|
+
salt = base64.b64decode(header["salt"])
|
|
577
|
+
nonce = base64.b64decode(header["nonce"])
|
|
578
|
+
ciphertext = base64.b64decode(envelope["ciphertext"])
|
|
579
|
+
key = derive_backup_key(passphrase, salt)
|
|
580
|
+
header_bytes = json.dumps(header, ensure_ascii=False, sort_keys=True).encode("utf-8")
|
|
581
|
+
expected_tag = hmac.new(key, header_bytes + ciphertext, hashlib.sha256).hexdigest()
|
|
582
|
+
if not hmac.compare_digest(expected_tag, str(envelope.get("tag") or "")):
|
|
583
|
+
raise ValueError("memory backup package integrity check failed")
|
|
584
|
+
tar_bytes = xor_bytes(ciphertext, key, nonce)
|
|
585
|
+
extract_memory_tar(tar_bytes, target)
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
def read_backup_package(package_path: Path) -> dict[str, Any]:
|
|
589
|
+
if not package_path.exists():
|
|
590
|
+
raise ValueError(f"memory backup package not found: {package_path}")
|
|
591
|
+
try:
|
|
592
|
+
envelope = json.loads(package_path.read_text(encoding="utf-8"))
|
|
593
|
+
except (OSError, json.JSONDecodeError) as exc:
|
|
594
|
+
raise ValueError(f"invalid memory backup package: {package_path}") from exc
|
|
595
|
+
if not isinstance(envelope, dict) or envelope.get("schema_version") != BACKUP_PACKAGE_SCHEMA_VERSION:
|
|
596
|
+
raise ValueError(f"unsupported memory backup package: {package_path}")
|
|
597
|
+
header = envelope.get("header")
|
|
598
|
+
if not isinstance(header, dict) or header.get("algorithm") != BACKUP_PACKAGE_ALGORITHM:
|
|
599
|
+
raise ValueError(f"unsupported memory backup package algorithm: {package_path}")
|
|
600
|
+
return envelope
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
def memory_tar_bytes(memory_dir: Path) -> bytes:
|
|
604
|
+
buffer = io.BytesIO()
|
|
605
|
+
with tarfile.open(fileobj=buffer, mode="w:gz") as archive:
|
|
606
|
+
for path in sorted(item for item in memory_dir.rglob("*") if item.is_file()):
|
|
607
|
+
archive.add(path, arcname=str(Path("memory") / path.relative_to(memory_dir)))
|
|
608
|
+
return buffer.getvalue()
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
def extract_memory_tar(payload: bytes, target: Path) -> None:
|
|
612
|
+
target.mkdir(parents=True, exist_ok=True)
|
|
613
|
+
with tarfile.open(fileobj=io.BytesIO(payload), mode="r:gz") as archive:
|
|
614
|
+
for member in archive.getmembers():
|
|
615
|
+
member_path = Path(member.name)
|
|
616
|
+
if member_path.is_absolute() or ".." in member_path.parts or not member.name.startswith("memory/"):
|
|
617
|
+
raise ValueError(f"unsafe path in memory backup package: {member.name}")
|
|
618
|
+
if not member.isfile():
|
|
619
|
+
continue
|
|
620
|
+
output = target / member_path
|
|
621
|
+
output.parent.mkdir(parents=True, exist_ok=True)
|
|
622
|
+
extracted = archive.extractfile(member)
|
|
623
|
+
if extracted is None:
|
|
624
|
+
continue
|
|
625
|
+
output.write_bytes(extracted.read())
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
def derive_backup_key(passphrase: str, salt: bytes) -> bytes:
|
|
629
|
+
return hashlib.pbkdf2_hmac("sha256", passphrase.encode("utf-8"), salt, 200_000, dklen=32)
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
def xor_bytes(payload: bytes, key: bytes, nonce: bytes) -> bytes:
|
|
633
|
+
output = bytearray()
|
|
634
|
+
counter = 0
|
|
635
|
+
for index in range(0, len(payload), 32):
|
|
636
|
+
block = payload[index : index + 32]
|
|
637
|
+
stream = hmac.new(key, nonce + counter.to_bytes(8, "big"), hashlib.sha256).digest()
|
|
638
|
+
output.extend(byte ^ stream[offset] for offset, byte in enumerate(block))
|
|
639
|
+
counter += 1
|
|
640
|
+
return bytes(output)
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
def package_path_from_manifest(backup_root: Path, manifest: dict[str, Any]) -> Path | None:
|
|
644
|
+
raw = manifest.get("package")
|
|
645
|
+
if isinstance(raw, str) and raw:
|
|
646
|
+
return Path(raw).expanduser().resolve()
|
|
647
|
+
package_name = manifest.get("package_name")
|
|
648
|
+
if isinstance(package_name, str) and package_name:
|
|
649
|
+
return backup_root / package_name
|
|
650
|
+
candidates = sorted(backup_root.glob("*.adkmb"))
|
|
651
|
+
return candidates[0] if candidates else None
|
|
652
|
+
|
|
653
|
+
|
|
249
654
|
def increment_bucket(bucket: dict[str, Any], key: str, now: str) -> None:
|
|
250
655
|
item = bucket.setdefault(key, {"count": 0, "first_seen": now, "last_seen": now})
|
|
251
656
|
item["count"] = int(item.get("count") or 0) + 1
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"""Mini-brain local model contract and setup helpers."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from datetime import datetime, timezone
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from cli.aikit.llm import BACKENDS, configure_backend, doctor_backend, load_config, save_config
|
|
9
|
+
from cli.aikit.ollama import ollama_pull, ollama_status
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
MINI_BRAIN_CONFIG_KEY = "mini_brain"
|
|
13
|
+
DEFAULT_HF_MODEL = "Qwen/Qwen3-0.6B"
|
|
14
|
+
DEFAULT_OLLAMA_MODEL = "qwen3:0.6b"
|
|
15
|
+
DEFAULT_PROVIDER = "ollama"
|
|
16
|
+
DEFAULT_BASE_URL = "http://localhost:11434/v1"
|
|
17
|
+
ALLOWED_TASKS = [
|
|
18
|
+
"setup_help",
|
|
19
|
+
"wizard_conversation",
|
|
20
|
+
"intent_classification",
|
|
21
|
+
"command_explanation",
|
|
22
|
+
"short_error_summary",
|
|
23
|
+
]
|
|
24
|
+
FORBIDDEN_TASKS = [
|
|
25
|
+
"external_write_decision",
|
|
26
|
+
"destructive_operation_approval",
|
|
27
|
+
"security_review_final",
|
|
28
|
+
"architecture_decision",
|
|
29
|
+
"secret_handling",
|
|
30
|
+
"final_delivery_decision",
|
|
31
|
+
]
|
|
32
|
+
DEFAULT_LIMITS = {
|
|
33
|
+
"max_context_chars": 6000,
|
|
34
|
+
"max_response_chars": 2000,
|
|
35
|
+
"max_llm_calls": 1,
|
|
36
|
+
}
|
|
37
|
+
DEFAULT_GUARDRAILS = [
|
|
38
|
+
"no_secrets",
|
|
39
|
+
"low_risk_only",
|
|
40
|
+
"no_external_writes",
|
|
41
|
+
"coordinator_review_required",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def mini_brain_contract(
|
|
46
|
+
*,
|
|
47
|
+
config: dict[str, Any] | None = None,
|
|
48
|
+
ollama_payload: dict[str, Any] | None = None,
|
|
49
|
+
ollama_backend: dict[str, Any] | None = None,
|
|
50
|
+
) -> dict[str, Any]:
|
|
51
|
+
config = load_config() if config is None else config
|
|
52
|
+
stored = config.get(MINI_BRAIN_CONFIG_KEY) if isinstance(config.get(MINI_BRAIN_CONFIG_KEY), dict) else {}
|
|
53
|
+
enabled = bool(stored.get("enabled"))
|
|
54
|
+
provider = stored.get("provider") or stored.get("runtime") or DEFAULT_PROVIDER
|
|
55
|
+
hf_model = stored.get("hf_model") or stored.get("model") or DEFAULT_HF_MODEL
|
|
56
|
+
ollama_model = stored.get("ollama_model") or DEFAULT_OLLAMA_MODEL
|
|
57
|
+
ollama_payload = ollama_status() if ollama_payload is None else ollama_payload
|
|
58
|
+
ollama_backend = doctor_backend(BACKENDS["ollama"], config) if ollama_backend is None else ollama_backend
|
|
59
|
+
backend_configured = ollama_backend.get("status") == "ok"
|
|
60
|
+
runtime_available = ollama_payload.get("status") == "ok" or backend_configured
|
|
61
|
+
available = enabled and provider == DEFAULT_PROVIDER and runtime_available
|
|
62
|
+
status = "ok" if available else "disabled" if not enabled else "unavailable"
|
|
63
|
+
return {
|
|
64
|
+
"kind": "mini-brain",
|
|
65
|
+
"status": status,
|
|
66
|
+
"enabled": enabled,
|
|
67
|
+
"available": available,
|
|
68
|
+
"configured": enabled and provider == DEFAULT_PROVIDER and backend_configured,
|
|
69
|
+
"provider": provider,
|
|
70
|
+
"runtime": provider,
|
|
71
|
+
"hf_model": hf_model,
|
|
72
|
+
"model": hf_model,
|
|
73
|
+
"ollama_model": ollama_model,
|
|
74
|
+
"allowed_tasks": list_value(stored.get("allowed_tasks"), ALLOWED_TASKS),
|
|
75
|
+
"forbidden_tasks": list_value(stored.get("forbidden_tasks"), FORBIDDEN_TASKS),
|
|
76
|
+
"limits": dict_value(stored.get("limits"), DEFAULT_LIMITS),
|
|
77
|
+
"guardrails": list_value(stored.get("guardrails"), DEFAULT_GUARDRAILS),
|
|
78
|
+
"stored_secret": False,
|
|
79
|
+
"ollama": {
|
|
80
|
+
"status": ollama_payload.get("status"),
|
|
81
|
+
"daemon": (ollama_payload.get("daemon") or {}).get("status")
|
|
82
|
+
if isinstance(ollama_payload.get("daemon"), dict)
|
|
83
|
+
else None,
|
|
84
|
+
"model_count": ollama_payload.get("model_count"),
|
|
85
|
+
},
|
|
86
|
+
"backend": {
|
|
87
|
+
"status": ollama_backend.get("status"),
|
|
88
|
+
"model": ollama_backend.get("model"),
|
|
89
|
+
"base_url": ollama_backend.get("base_url"),
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def setup_mini_brain(
|
|
95
|
+
*,
|
|
96
|
+
dry_run: bool = False,
|
|
97
|
+
yes: bool = False,
|
|
98
|
+
set_default: bool = False,
|
|
99
|
+
model: str = DEFAULT_OLLAMA_MODEL,
|
|
100
|
+
) -> dict[str, Any]:
|
|
101
|
+
if dry_run or not yes:
|
|
102
|
+
status = "planned" if dry_run else "needs-confirmation"
|
|
103
|
+
needs_confirmation = not dry_run and not yes
|
|
104
|
+
return {
|
|
105
|
+
"kind": "mini-brain-setup",
|
|
106
|
+
"status": status,
|
|
107
|
+
"ok": bool(dry_run),
|
|
108
|
+
"exit_code": 2 if needs_confirmation else 0,
|
|
109
|
+
"dry_run": dry_run,
|
|
110
|
+
"yes": yes,
|
|
111
|
+
"stored_secret": False,
|
|
112
|
+
"mini_brain": planned_contract(model=model),
|
|
113
|
+
"pull": ollama_pull(model, yes=False, dry_run=dry_run),
|
|
114
|
+
"next_steps": ["agent setup mini-brain --yes"],
|
|
115
|
+
"message": "Use --yes to pull Qwen3-0.6B with Ollama and enable the mini-brain.",
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
pull = ollama_pull(model, yes=True, dry_run=False)
|
|
119
|
+
toolchain_install = None
|
|
120
|
+
if pull.get("status") == "missing":
|
|
121
|
+
from cli.aikit.toolchain import install_toolchain
|
|
122
|
+
|
|
123
|
+
toolchain_install = install_toolchain(None, "ollama", dry_run=False, yes=True)
|
|
124
|
+
if toolchain_install.get("status") == "installed":
|
|
125
|
+
pull = ollama_pull(model, yes=True, dry_run=False)
|
|
126
|
+
if not pull.get("ok"):
|
|
127
|
+
payload = {
|
|
128
|
+
"kind": "mini-brain-setup",
|
|
129
|
+
"status": "failed",
|
|
130
|
+
"ok": False,
|
|
131
|
+
"exit_code": int(pull.get("exit_code") or 2),
|
|
132
|
+
"dry_run": False,
|
|
133
|
+
"yes": True,
|
|
134
|
+
"stored_secret": False,
|
|
135
|
+
"mini_brain": planned_contract(model=model),
|
|
136
|
+
"pull": pull,
|
|
137
|
+
"next_steps": ["Install Ollama or run agent ollama pull qwen3:0.6b --yes"],
|
|
138
|
+
"message": pull.get("message") or "Could not pull the mini-brain model.",
|
|
139
|
+
}
|
|
140
|
+
if toolchain_install:
|
|
141
|
+
payload["toolchain_install"] = toolchain_install
|
|
142
|
+
payload["next_steps"] = [
|
|
143
|
+
"Review `agent toolchain doctor ollama`.",
|
|
144
|
+
"Run `agent toolchain install ollama --yes` if you approve external installation.",
|
|
145
|
+
"Then run `agent setup mini-brain --yes` again.",
|
|
146
|
+
]
|
|
147
|
+
return payload
|
|
148
|
+
|
|
149
|
+
existing_config = load_config()
|
|
150
|
+
existing_ollama = (
|
|
151
|
+
existing_config.get("llm", {}).get("backends", {}).get(DEFAULT_PROVIDER)
|
|
152
|
+
if isinstance(existing_config.get("llm"), dict)
|
|
153
|
+
else {}
|
|
154
|
+
)
|
|
155
|
+
existing_base_url = existing_ollama.get("base_url") if isinstance(existing_ollama, dict) else None
|
|
156
|
+
configured = configure_backend(
|
|
157
|
+
DEFAULT_PROVIDER,
|
|
158
|
+
base_url=existing_base_url or DEFAULT_BASE_URL,
|
|
159
|
+
model=model,
|
|
160
|
+
set_default=set_default,
|
|
161
|
+
)
|
|
162
|
+
config = load_config()
|
|
163
|
+
config[MINI_BRAIN_CONFIG_KEY] = stored_config(model=model)
|
|
164
|
+
written_path = save_config(config)
|
|
165
|
+
contract = mini_brain_contract(config=config)
|
|
166
|
+
return {
|
|
167
|
+
"kind": "mini-brain-setup",
|
|
168
|
+
"status": "configured",
|
|
169
|
+
"ok": True,
|
|
170
|
+
"dry_run": False,
|
|
171
|
+
"yes": True,
|
|
172
|
+
"stored_secret": False,
|
|
173
|
+
"config_path": str(written_path),
|
|
174
|
+
"mini_brain": contract,
|
|
175
|
+
"pull": pull,
|
|
176
|
+
"toolchain_install": toolchain_install,
|
|
177
|
+
"llm_configure": configured,
|
|
178
|
+
"next_steps": ["Use low-risk setup, wizard and summary prompts normally."],
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def planned_contract(*, model: str = DEFAULT_OLLAMA_MODEL) -> dict[str, Any]:
|
|
183
|
+
return {
|
|
184
|
+
"kind": "mini-brain",
|
|
185
|
+
"status": "planned",
|
|
186
|
+
"enabled": False,
|
|
187
|
+
"available": False,
|
|
188
|
+
"configured": False,
|
|
189
|
+
"provider": DEFAULT_PROVIDER,
|
|
190
|
+
"runtime": DEFAULT_PROVIDER,
|
|
191
|
+
"hf_model": DEFAULT_HF_MODEL,
|
|
192
|
+
"model": DEFAULT_HF_MODEL,
|
|
193
|
+
"ollama_model": model,
|
|
194
|
+
"allowed_tasks": list(ALLOWED_TASKS),
|
|
195
|
+
"forbidden_tasks": list(FORBIDDEN_TASKS),
|
|
196
|
+
"limits": dict(DEFAULT_LIMITS),
|
|
197
|
+
"guardrails": list(DEFAULT_GUARDRAILS),
|
|
198
|
+
"stored_secret": False,
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def stored_config(*, model: str = DEFAULT_OLLAMA_MODEL) -> dict[str, Any]:
|
|
203
|
+
return {
|
|
204
|
+
"enabled": True,
|
|
205
|
+
"provider": DEFAULT_PROVIDER,
|
|
206
|
+
"runtime": DEFAULT_PROVIDER,
|
|
207
|
+
"hf_model": DEFAULT_HF_MODEL,
|
|
208
|
+
"model": DEFAULT_HF_MODEL,
|
|
209
|
+
"ollama_model": model,
|
|
210
|
+
"allowed_tasks": list(ALLOWED_TASKS),
|
|
211
|
+
"forbidden_tasks": list(FORBIDDEN_TASKS),
|
|
212
|
+
"limits": dict(DEFAULT_LIMITS),
|
|
213
|
+
"guardrails": list(DEFAULT_GUARDRAILS),
|
|
214
|
+
"stored_secret": False,
|
|
215
|
+
"updated_at": now_iso(),
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def summarize_mini_brain(value: Any) -> dict[str, Any] | None:
|
|
220
|
+
if not isinstance(value, dict):
|
|
221
|
+
return None
|
|
222
|
+
return {
|
|
223
|
+
"status": value.get("status"),
|
|
224
|
+
"enabled": value.get("enabled") is True,
|
|
225
|
+
"available": value.get("available") is True,
|
|
226
|
+
"provider": value.get("provider"),
|
|
227
|
+
"hf_model": value.get("hf_model") or value.get("model"),
|
|
228
|
+
"ollama_model": value.get("ollama_model"),
|
|
229
|
+
"stored_secret": value.get("stored_secret") is True,
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def list_value(value: Any, default: list[str]) -> list[str]:
|
|
234
|
+
if not isinstance(value, list):
|
|
235
|
+
return list(default)
|
|
236
|
+
return [str(item) for item in value if str(item).strip()]
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def dict_value(value: Any, default: dict[str, Any]) -> dict[str, Any]:
|
|
240
|
+
if not isinstance(value, dict):
|
|
241
|
+
return dict(default)
|
|
242
|
+
return dict(value)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
def now_iso() -> str:
|
|
246
|
+
return datetime.now(timezone.utc).isoformat()
|