agent-toolkit-cli 1.11.0__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_toolkit/__init__.py +4 -0
- agent_toolkit/__main__.py +5 -0
- agent_toolkit/_paths.py +145 -0
- agent_toolkit/bin/.gitkeep +0 -0
- agent_toolkit/bin/agent-toolkit.exe +0 -0
- agent_toolkit/cli/__init__.py +0 -0
- agent_toolkit/cli/__main__.py +5 -0
- agent_toolkit/cli/build.py +278 -0
- agent_toolkit/cli/completion.py +297 -0
- agent_toolkit/cli/context_budget.py +455 -0
- agent_toolkit/cli/devcompanion.py +923 -0
- agent_toolkit/cli/devcompanion_queue.py +235 -0
- agent_toolkit/cli/diff.py +176 -0
- agent_toolkit/cli/doctor.py +1052 -0
- agent_toolkit/cli/insights.py +771 -0
- agent_toolkit/cli/install.py +706 -0
- agent_toolkit/cli/main.py +171 -0
- agent_toolkit/cli/mcp.py +537 -0
- agent_toolkit/cli/memory.py +739 -0
- agent_toolkit/cli/plugin.py +224 -0
- agent_toolkit/cli/project.py +459 -0
- agent_toolkit/cli/release.py +178 -0
- agent_toolkit/cli/skills.py +461 -0
- agent_toolkit/cli/uninstall.py +166 -0
- agent_toolkit/cli/update.py +298 -0
- agent_toolkit/cli/workspace.py +1713 -0
- agent_toolkit/compiler/hook_registry.py +110 -0
- agent_toolkit/compiler/loader.py +338 -0
- agent_toolkit/compiler/mcp_registry.py +87 -0
- agent_toolkit/compiler/model.py +182 -0
- agent_toolkit/compiler/provenance.py +140 -0
- agent_toolkit/compiler/registry_emit.py +263 -0
- agent_toolkit/compiler/target_registry.py +122 -0
- agent_toolkit/compiler/targets/__init__.py +1 -0
- agent_toolkit/compiler/targets/agent_plugins.py +160 -0
- agent_toolkit/compiler/targets/base.py +229 -0
- agent_toolkit/compiler/targets/claude_code.py +241 -0
- agent_toolkit/compiler/targets/codex.py +261 -0
- agent_toolkit/compiler/targets/copilot.py +275 -0
- agent_toolkit/compiler/targets/cursor.py +207 -0
- agent_toolkit/compiler/targets/gemini_cli.py +213 -0
- agent_toolkit/compiler/targets/muse_code.py +113 -0
- agent_toolkit/compiler/targets/opencode.py +204 -0
- agent_toolkit/compiler/targets/pi.py +263 -0
- agent_toolkit/compiler/targets/windsurf.py +267 -0
- agent_toolkit/compiler/tool_mapping.py +83 -0
- agent_toolkit/data/.gitignore +4 -0
- agent_toolkit/data/__init__.py +1 -0
- agent_toolkit/data/agents/agentic-security-reviewer/AGENT.md +60 -0
- agent_toolkit/data/agents/architect/AGENT.md +30 -0
- agent_toolkit/data/agents/assistant/AGENT.md +59 -0
- agent_toolkit/data/agents/build-error-resolver/AGENT.md +30 -0
- agent_toolkit/data/agents/client-workflow-bootstrap/AGENT.md +60 -0
- agent_toolkit/data/agents/code-reviewer/AGENT.md +49 -0
- agent_toolkit/data/agents/database-reviewer/AGENT.md +44 -0
- agent_toolkit/data/agents/docs-lookup/AGENT.md +28 -0
- agent_toolkit/data/agents/e2e-runner/AGENT.md +38 -0
- agent_toolkit/data/agents/performance-optimizer/AGENT.md +52 -0
- agent_toolkit/data/agents/planner/AGENT.md +41 -0
- agent_toolkit/data/agents/refactor-cleaner/AGENT.md +43 -0
- agent_toolkit/data/agents/reference-lookup/AGENT.md +33 -0
- agent_toolkit/data/agents/security-reviewer/AGENT.md +47 -0
- agent_toolkit/data/agents/tdd-guide/AGENT.md +58 -0
- agent_toolkit/data/agents/tech-assistant/AGENT.md +11 -0
- agent_toolkit/data/agents/typescript-reviewer/AGENT.md +61 -0
- agent_toolkit/data/capabilities/hooks/README.md +6 -0
- agent_toolkit/data/capabilities/hooks/pre-commit-validate.yaml +26 -0
- agent_toolkit/data/capabilities/hooks/scripts/pre-commit-validate.sh +41 -0
- agent_toolkit/data/capabilities/hooks/scripts/session-start-context.sh +11 -0
- agent_toolkit/data/capabilities/hooks/session-start-context.yaml +23 -0
- agent_toolkit/data/capabilities/targets/registry.yaml +90 -0
- agent_toolkit/data/capabilities/upstream.lock +118 -0
- agent_toolkit/data/catalogs/agent-catalog.yaml +81 -0
- agent_toolkit/data/catalogs/loop-catalog.yaml +55 -0
- agent_toolkit/data/catalogs/skill-catalog.yaml +520 -0
- agent_toolkit/data/catalogs/skills-layout.json +391 -0
- agent_toolkit/data/distributions/products.yaml +190 -0
- agent_toolkit/data/distributions/targets/claude-code.yaml +47 -0
- agent_toolkit/data/distributions/targets/cursor.yaml +42 -0
- agent_toolkit/data/distributions/targets/opencode.yaml +55 -0
- agent_toolkit/data/loops/changelog-drafter/loop.yaml +40 -0
- agent_toolkit/data/loops/ci-sweeper/loop.yaml +53 -0
- agent_toolkit/data/loops/daily-triage/loop.yaml +47 -0
- agent_toolkit/data/loops/dep-sweeper/loop.yaml +46 -0
- agent_toolkit/data/loops/issue-triage/loop.yaml +40 -0
- agent_toolkit/data/loops/oss-daily-briefing/loop.yaml +65 -0
- agent_toolkit/data/loops/oss-pr-monitor/loop.yaml +86 -0
- agent_toolkit/data/loops/oss-triage/loop.yaml +67 -0
- agent_toolkit/data/loops/post-merge-cleanup/loop.yaml +44 -0
- agent_toolkit/data/loops/pr-babysitter/loop.yaml +46 -0
- agent_toolkit/data/mcp/registry/chrome-devtools.yaml +61 -0
- agent_toolkit/data/mcp/registry/clickup.yaml +48 -0
- agent_toolkit/data/mcp/registry/figma.yaml +44 -0
- agent_toolkit/data/mcp/registry/github.yaml +52 -0
- agent_toolkit/data/mcp/registry/linear.yaml +47 -0
- agent_toolkit/data/mcp/registry/notion.yaml +48 -0
- agent_toolkit/data/mcp/registry/slack.yaml +46 -0
- agent_toolkit/data/mcp/templates/chrome-devtools/README.md +57 -0
- agent_toolkit/data/mcp/templates/chrome-devtools/config.template.json +6 -0
- agent_toolkit/data/mcp/templates/clickup/README.md +45 -0
- agent_toolkit/data/mcp/templates/clickup/config.template.json +8 -0
- agent_toolkit/data/mcp/templates/clickup/wrapper.sh +23 -0
- agent_toolkit/data/mcp/templates/figma/README.md +54 -0
- agent_toolkit/data/mcp/templates/figma/config.template.json +9 -0
- agent_toolkit/data/mcp/templates/github/README.md +16 -0
- agent_toolkit/data/mcp/templates/github/config.template.json +15 -0
- agent_toolkit/data/mcp/templates/github/wrapper.sh +6 -0
- agent_toolkit/data/mcp/templates/linear/README.md +49 -0
- agent_toolkit/data/mcp/templates/linear/config.template.json +10 -0
- agent_toolkit/data/mcp/templates/notion/README.md +7 -0
- agent_toolkit/data/mcp/templates/notion/config.template.json +8 -0
- agent_toolkit/data/mcp/templates/notion/wrapper.sh +23 -0
- agent_toolkit/data/mcp/templates/slack/README.md +8 -0
- agent_toolkit/data/mcp/templates/slack/config.template.json +9 -0
- agent_toolkit/data/mcp/templates/slack/wrapper.sh +23 -0
- agent_toolkit/data/packs/README.md +66 -0
- agent_toolkit/data/packs/agentic-security/README.md +19 -0
- agent_toolkit/data/packs/agentic-security/config.yaml +25 -0
- agent_toolkit/data/packs/architecture/README.md +22 -0
- agent_toolkit/data/packs/architecture/config.yaml +27 -0
- agent_toolkit/data/packs/code-quality/README.md +19 -0
- agent_toolkit/data/packs/code-quality/config.yaml +21 -0
- agent_toolkit/data/packs/delivery-discipline/README.md +19 -0
- agent_toolkit/data/packs/delivery-discipline/config.yaml +42 -0
- agent_toolkit/data/packs/design-engineering/README.md +19 -0
- agent_toolkit/data/packs/design-engineering/config.yaml +41 -0
- agent_toolkit/data/packs/engineering-workflow/README.md +21 -0
- agent_toolkit/data/packs/engineering-workflow/config.yaml +57 -0
- agent_toolkit/data/packs/oss-maintenance/README.md +245 -0
- agent_toolkit/data/packs/oss-maintenance/config.yaml +75 -0
- agent_toolkit/data/profiles/claude-code/CLAUDE.md +110 -0
- agent_toolkit/data/profiles/claude-code/agents/assistant.md +59 -0
- agent_toolkit/data/profiles/claude-code/agents/build-error-resolver.md +30 -0
- agent_toolkit/data/profiles/claude-code/agents/client-workflow-bootstrap.md +60 -0
- agent_toolkit/data/profiles/claude-code/agents/contribution-planner.md +39 -0
- agent_toolkit/data/profiles/claude-code/agents/database-reviewer.md +44 -0
- agent_toolkit/data/profiles/claude-code/agents/docs-lookup.md +28 -0
- agent_toolkit/data/profiles/claude-code/agents/e2e-runner.md +38 -0
- agent_toolkit/data/profiles/claude-code/agents/performance-optimizer.md +52 -0
- agent_toolkit/data/profiles/claude-code/agents/planner.md +41 -0
- agent_toolkit/data/profiles/claude-code/agents/refactor-cleaner.md +43 -0
- agent_toolkit/data/profiles/claude-code/agents/reference-lookup.md +33 -0
- agent_toolkit/data/profiles/claude-code/agents/security-reviewer.md +47 -0
- agent_toolkit/data/profiles/claude-code/agents/tdd-guide.md +58 -0
- agent_toolkit/data/profiles/claude-code/agents/typescript-reviewer.md +61 -0
- agent_toolkit/data/profiles/claude-code/settings.json +86 -0
- agent_toolkit/data/profiles/copilot/copilot-instructions.md +15 -0
- agent_toolkit/data/profiles/cursor/README.md +33 -0
- agent_toolkit/data/profiles/cursor/rules/architect.mdc +23 -0
- agent_toolkit/data/profiles/cursor/rules/assistant.mdc +61 -0
- agent_toolkit/data/profiles/cursor/rules/build-error-resolver.mdc +20 -0
- agent_toolkit/data/profiles/cursor/rules/code-reviewer.mdc +21 -0
- agent_toolkit/data/profiles/cursor/rules/database-reviewer.mdc +29 -0
- agent_toolkit/data/profiles/cursor/rules/docs-lookup.mdc +15 -0
- agent_toolkit/data/profiles/cursor/rules/e2e-runner.mdc +30 -0
- agent_toolkit/data/profiles/cursor/rules/performance-optimizer.mdc +27 -0
- agent_toolkit/data/profiles/cursor/rules/planner.mdc +28 -0
- agent_toolkit/data/profiles/cursor/rules/refactor-cleaner.mdc +26 -0
- agent_toolkit/data/profiles/cursor/rules/reference-lookup.mdc +20 -0
- agent_toolkit/data/profiles/cursor/rules/security-reviewer.mdc +20 -0
- agent_toolkit/data/profiles/cursor/rules/tdd-guide.mdc +26 -0
- agent_toolkit/data/profiles/cursor/rules/typescript-reviewer.mdc +28 -0
- agent_toolkit/data/profiles/muse-code/README.md +35 -0
- agent_toolkit/data/profiles/opencode/README.md +44 -0
- agent_toolkit/data/profiles/opencode/agents/architect.md +30 -0
- agent_toolkit/data/profiles/opencode/agents/assistant.md +96 -0
- agent_toolkit/data/profiles/opencode/agents/build-error-resolver.md +31 -0
- agent_toolkit/data/profiles/opencode/agents/client-workflow-bootstrap.md +66 -0
- agent_toolkit/data/profiles/opencode/agents/code-reviewer.md +47 -0
- agent_toolkit/data/profiles/opencode/agents/contribution-planner.md +44 -0
- agent_toolkit/data/profiles/opencode/agents/database-reviewer.md +43 -0
- agent_toolkit/data/profiles/opencode/agents/docs-lookup.md +28 -0
- agent_toolkit/data/profiles/opencode/agents/e2e-runner.md +33 -0
- agent_toolkit/data/profiles/opencode/agents/performance-optimizer.md +34 -0
- agent_toolkit/data/profiles/opencode/agents/planner.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/refactor-cleaner.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/reference-lookup.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/security-reviewer.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/tdd-guide.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/typescript-reviewer.md +30 -0
- agent_toolkit/data/profiles/opencode/opencode.json +3 -0
- agent_toolkit/data/profiles/pi/skills/architect/skill.md +5 -0
- agent_toolkit/data/profiles/pi/skills/assistant/skill.md +3 -0
- agent_toolkit/data/profiles/pi/skills/code-reviewer/skill.md +5 -0
- agent_toolkit/data/profiles/pi/skills/planner/skill.md +3 -0
- agent_toolkit/data/profiles/pi/skills/security-reviewer/skill.md +3 -0
- agent_toolkit/data/profiles/windsurf/memories/global_rules.md +114 -0
- agent_toolkit/data/profiles/windsurf/rules/architect.mdc +23 -0
- agent_toolkit/data/profiles/windsurf/rules/assistant.mdc +61 -0
- agent_toolkit/data/profiles/windsurf/rules/build-error-resolver.mdc +20 -0
- agent_toolkit/data/profiles/windsurf/rules/code-reviewer.mdc +21 -0
- agent_toolkit/data/profiles/windsurf/rules/database-reviewer.mdc +29 -0
- agent_toolkit/data/profiles/windsurf/rules/docs-lookup.mdc +15 -0
- agent_toolkit/data/profiles/windsurf/rules/e2e-runner.mdc +30 -0
- agent_toolkit/data/profiles/windsurf/rules/performance-optimizer.mdc +27 -0
- agent_toolkit/data/profiles/windsurf/rules/planner.mdc +28 -0
- agent_toolkit/data/profiles/windsurf/rules/refactor-cleaner.mdc +26 -0
- agent_toolkit/data/profiles/windsurf/rules/reference-lookup.mdc +20 -0
- agent_toolkit/data/profiles/windsurf/rules/security-reviewer.mdc +20 -0
- agent_toolkit/data/profiles/windsurf/rules/tdd-guide.mdc +26 -0
- agent_toolkit/data/profiles/windsurf/rules/typescript-reviewer.mdc +28 -0
- agent_toolkit/data/skills/accessibility/review/SKILL.md +116 -0
- agent_toolkit/data/skills/accessibility/review/references/a11y-checklist.md +25 -0
- agent_toolkit/data/skills/accessibility/review/references/a11y-findings-template.md +56 -0
- agent_toolkit/data/skills/accessibility/review/references/research.md +47 -0
- agent_toolkit/data/skills/agentic-security/mcp-audit/SKILL.md +116 -0
- agent_toolkit/data/skills/agentic-security/mcp-audit/references/mcp-audit-template.md +51 -0
- agent_toolkit/data/skills/agentic-security/owasp-agentic-review/SKILL.md +73 -0
- agent_toolkit/data/skills/agentic-security/owasp-agentic-review/references/owasp-agentic-template.md +32 -0
- agent_toolkit/data/skills/agentic-security/supply-chain-audit/SKILL.md +142 -0
- agent_toolkit/data/skills/agentic-security/threat-modeling/SKILL.md +100 -0
- agent_toolkit/data/skills/agentic-security/threat-modeling/references/threat-model-template.md +55 -0
- agent_toolkit/data/skills/architecture/c4-model/SKILL.md +49 -0
- agent_toolkit/data/skills/cloud/aws-well-architected-review/SKILL.md +37 -0
- agent_toolkit/data/skills/cloud/cloud-design-patterns/SKILL.md +38 -0
- agent_toolkit/data/skills/core/assistant/SKILL.md +216 -0
- agent_toolkit/data/skills/core/assistant/references/AGENTS_TEMPLATE.md +0 -0
- agent_toolkit/data/skills/core/assistant/references/ORCHESTRATION.md +0 -0
- agent_toolkit/data/skills/core/assistant/references/REPO_INSPECTION.md +0 -0
- agent_toolkit/data/skills/core/dev-companion/SKILL.md +65 -0
- agent_toolkit/data/skills/core/dev-companion/references/LOOP_GUARDRAILS.md +0 -0
- agent_toolkit/data/skills/core/onboarding/SKILL.md +122 -0
- agent_toolkit/data/skills/core/output-handshake/SKILL.md +26 -0
- agent_toolkit/data/skills/core/pr-fallback/SKILL.md +35 -0
- agent_toolkit/data/skills/core/pr-fallback/references/pr-body-default.md +0 -0
- agent_toolkit/data/skills/core/project/SKILL.md +89 -0
- agent_toolkit/data/skills/core/workspace/SKILL.md +103 -0
- agent_toolkit/data/skills/core/workspace-knowledge-sync/SKILL.md +140 -0
- agent_toolkit/data/skills/data/dbt-validation/SKILL.md +41 -0
- agent_toolkit/data/skills/data/snowflake-validation/SKILL.md +38 -0
- agent_toolkit/data/skills/delivery/adr/SKILL.md +56 -0
- agent_toolkit/data/skills/delivery/adr/references/default-template.md +35 -0
- agent_toolkit/data/skills/delivery/adr/references/example-001-graphql-adoption.md +66 -0
- agent_toolkit/data/skills/delivery/agreement/SKILL.md +24 -0
- agent_toolkit/data/skills/delivery/agreement/references/default-template.md +17 -0
- agent_toolkit/data/skills/delivery/agreement/references/example-api-versioning.md +29 -0
- agent_toolkit/data/skills/delivery/bug/SKILL.md +26 -0
- agent_toolkit/data/skills/delivery/bug/references/default-template.md +26 -0
- agent_toolkit/data/skills/delivery/bug/references/example-search-filter-bug.md +58 -0
- agent_toolkit/data/skills/delivery/decision-log/SKILL.md +28 -0
- agent_toolkit/data/skills/delivery/decision-log/references/default-template.md +17 -0
- agent_toolkit/data/skills/delivery/decision-log/references/example-repository-pattern.md +27 -0
- agent_toolkit/data/skills/delivery/development-workflow/SKILL.md +34 -0
- agent_toolkit/data/skills/delivery/development-workflow/references/default-workflow-checklist.md +44 -0
- agent_toolkit/data/skills/delivery/epic/SKILL.md +22 -0
- agent_toolkit/data/skills/delivery/epic/references/default-template.md +26 -0
- agent_toolkit/data/skills/delivery/epic/references/example-unified-dashboard.md +40 -0
- agent_toolkit/data/skills/delivery/incident/SKILL.md +24 -0
- agent_toolkit/data/skills/delivery/incident/references/default-template.md +29 -0
- agent_toolkit/data/skills/delivery/incident/references/example-payment-outage.md +62 -0
- agent_toolkit/data/skills/delivery/management-unit-assessment/SKILL.md +104 -0
- agent_toolkit/data/skills/delivery/management-unit-assessment/references/default-template.md +24 -0
- agent_toolkit/data/skills/delivery/management-unit-assessment/references/example-team-assessment.md +126 -0
- agent_toolkit/data/skills/delivery/meeting-minutes/SKILL.md +25 -0
- agent_toolkit/data/skills/delivery/meeting-minutes/references/default-template.md +22 -0
- agent_toolkit/data/skills/delivery/meeting-minutes/references/example-weekly-sync.md +72 -0
- agent_toolkit/data/skills/delivery/planning/SKILL.md +31 -0
- agent_toolkit/data/skills/delivery/planning/references/default-template.md +25 -0
- agent_toolkit/data/skills/delivery/planning/references/example-sprint-planning.md +62 -0
- agent_toolkit/data/skills/delivery/prd/SKILL.md +46 -0
- agent_toolkit/data/skills/delivery/prd/references/default-template.md +31 -0
- agent_toolkit/data/skills/delivery/prd/references/example-unified-api.md +71 -0
- agent_toolkit/data/skills/delivery/project-assessment/SKILL.md +90 -0
- agent_toolkit/data/skills/delivery/project-assessment/references/default-template.md +26 -0
- agent_toolkit/data/skills/delivery/project-assessment/references/example-platform-assessment.md +122 -0
- agent_toolkit/data/skills/delivery/project-assessment-evidence/SKILL.md +88 -0
- agent_toolkit/data/skills/delivery/project-assessment-evidence/references/default-template.md +24 -0
- agent_toolkit/data/skills/delivery/project-assessment-evidence/references/example-evidence-map.md +46 -0
- agent_toolkit/data/skills/delivery/spike/SKILL.md +24 -0
- agent_toolkit/data/skills/delivery/spike/references/default-template.md +29 -0
- agent_toolkit/data/skills/delivery/spike/references/example-graphql-federation.md +79 -0
- agent_toolkit/data/skills/delivery/task/SKILL.md +21 -0
- agent_toolkit/data/skills/delivery/task/references/default-template.md +21 -0
- agent_toolkit/data/skills/delivery/task/references/example-nav-system.md +33 -0
- agent_toolkit/data/skills/delivery/technical-unit-assessment/SKILL.md +58 -0
- agent_toolkit/data/skills/delivery/technical-unit-assessment/references/default-template.md +26 -0
- agent_toolkit/data/skills/delivery/technical-unit-assessment/references/example-frontend-assessment.md +112 -0
- agent_toolkit/data/skills/delivery/technical-unit-assessment/references/indicator-groups.md +65 -0
- agent_toolkit/data/skills/delivery/trd/SKILL.md +49 -0
- agent_toolkit/data/skills/delivery/trd/references/default-template.md +31 -0
- agent_toolkit/data/skills/delivery/trd/references/example-api-migration.md +122 -0
- agent_toolkit/data/skills/delivery/user-story/SKILL.md +21 -0
- agent_toolkit/data/skills/delivery/user-story/references/default-template.md +21 -0
- agent_toolkit/data/skills/delivery/user-story/references/example-advanced-filtering.md +37 -0
- agent_toolkit/data/skills/delivery/work-item/SKILL.md +31 -0
- agent_toolkit/data/skills/delivery/work-item/references/default-template.md +21 -0
- agent_toolkit/data/skills/delivery/work-item/references/example-routing-dashboard.md +23 -0
- agent_toolkit/data/skills/delivery/workflow-client-bootstrap/SKILL.md +148 -0
- agent_toolkit/data/skills/delivery/workflow-client-bootstrap/questions.yaml +165 -0
- agent_toolkit/data/skills/delivery/workflow-generic-project/SKILL.md +79 -0
- agent_toolkit/data/skills/design/design-assessment/SKILL.md +150 -0
- agent_toolkit/data/skills/design/design-assessment/references/design-scorecard-template.md +78 -0
- agent_toolkit/data/skills/design/design-improvement/SKILL.md +167 -0
- agent_toolkit/data/skills/design/design-improvement/references/improvement-plan-template.md +113 -0
- agent_toolkit/data/skills/design/figma/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma/NOTICE.txt +25 -0
- agent_toolkit/data/skills/design/figma/SKILL.md +98 -0
- agent_toolkit/data/skills/design/figma/references/figma-mcp-config.md +82 -0
- agent_toolkit/data/skills/design/figma/references/figma-tools-and-prompts.md +34 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/NOTICE.txt +18 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/SKILL.md +354 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/references/mapping-checklist.md +7 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/scripts/normalize_node_id.py +25 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/NOTICE.txt +19 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/SKILL.md +554 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/references/rule-template.md +15 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/scripts/check_agents_md.sh +9 -0
- agent_toolkit/data/skills/design/figma-create-new-file/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma-create-new-file/NOTICE.txt +17 -0
- agent_toolkit/data/skills/design/figma-create-new-file/SKILL.md +72 -0
- agent_toolkit/data/skills/design/figma-implement-design/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma-implement-design/NOTICE.txt +19 -0
- agent_toolkit/data/skills/design/figma-implement-design/SKILL.md +268 -0
- agent_toolkit/data/skills/design/frontend-design/LICENSE.txt +177 -0
- agent_toolkit/data/skills/design/frontend-design/SKILL.md +82 -0
- agent_toolkit/data/skills/design/frontend-design/UPSTREAM.md +14 -0
- agent_toolkit/data/skills/design/frontend-design-review/LICENSE +21 -0
- agent_toolkit/data/skills/design/frontend-design-review/SKILL.md +194 -0
- agent_toolkit/data/skills/design/frontend-design-review/references/pattern-examples.md +21 -0
- agent_toolkit/data/skills/design/frontend-design-review/references/quick-checklist.md +38 -0
- agent_toolkit/data/skills/design/frontend-design-review/references/review-output-format.md +68 -0
- agent_toolkit/data/skills/design/frontend-design-review/references/review-type-modifiers.md +31 -0
- agent_toolkit/data/skills/design/web-design-guidelines/SKILL.md +78 -0
- agent_toolkit/data/skills/design/web-design-guidelines/references/LICENSE +21 -0
- agent_toolkit/data/skills/design/web-design-guidelines/references/web-interface-guidelines.md +180 -0
- agent_toolkit/data/skills/forge/gh-address-comments/LICENSE.txt +202 -0
- agent_toolkit/data/skills/forge/gh-address-comments/NOTICE.txt +20 -0
- agent_toolkit/data/skills/forge/gh-address-comments/SKILL.md +72 -0
- agent_toolkit/data/skills/forge/gh-address-comments/scripts/fetch_comments.py +239 -0
- agent_toolkit/data/skills/forge/gh-contribution-planner/SKILL.md +160 -0
- agent_toolkit/data/skills/forge/gh-contribution-planner/scripts/inspect_contributions.py +818 -0
- agent_toolkit/data/skills/forge/gh-fix-ci/LICENSE.txt +201 -0
- agent_toolkit/data/skills/forge/gh-fix-ci/NOTICE.txt +20 -0
- agent_toolkit/data/skills/forge/gh-fix-ci/SKILL.md +74 -0
- agent_toolkit/data/skills/forge/gh-fix-ci/scripts/inspect_pr_checks.py +509 -0
- agent_toolkit/data/skills/forge/github-cli-workflow/SKILL.md +49 -0
- agent_toolkit/data/skills/forge/gitlab-cli-workflow/SKILL.md +44 -0
- agent_toolkit/data/skills/forge/workflow-client-bootstrap/SKILL.md +14 -0
- agent_toolkit/data/skills/forge/workflow-generic-project/SKILL.md +14 -0
- agent_toolkit/data/skills/forge/worktree/SKILL.md +113 -0
- agent_toolkit/data/skills/integrations/clickup-cli/SKILL.md +78 -0
- agent_toolkit/data/skills/integrations/clickup-cli/references/docs-management.md +57 -0
- agent_toolkit/data/skills/integrations/clickup-cli/references/task-management.md +131 -0
- agent_toolkit/data/skills/integrations/clickup-cli/references/time-tracking.md +38 -0
- agent_toolkit/data/skills/integrations/linear/LICENSE.txt +202 -0
- agent_toolkit/data/skills/integrations/linear/NOTICE.txt +23 -0
- agent_toolkit/data/skills/integrations/linear/SKILL.md +134 -0
- agent_toolkit/data/skills/integrations/mcp/SKILL.md +88 -0
- agent_toolkit/data/skills/integrations/slack-assistant/SKILL.md +138 -0
- agent_toolkit/data/skills/integrations/slack-cli/SKILL.md +109 -0
- agent_toolkit/data/skills/integrations/slack-cli/references/INSTALLATION.md +42 -0
- agent_toolkit/data/skills/loops/loop-runner/SKILL.md +92 -0
- agent_toolkit/data/skills/ops/docs-generator/SKILL.md +120 -0
- agent_toolkit/data/skills/ops/llm-cost-advisor/SKILL.md +87 -0
- agent_toolkit/data/skills/ops/swarm/SKILL.md +108 -0
- agent_toolkit/data/skills/ops/swarm-handoff/SKILL.md +112 -0
- agent_toolkit/data/skills/ops/swarm-observer/SKILL.md +102 -0
- agent_toolkit/data/skills/ops/triage/SKILL.md +119 -0
- agent_toolkit/data/skills/quality/codeql/SKILL.md +106 -0
- agent_toolkit/data/skills/quality/codeql/references/codeql-queries.md +43 -0
- agent_toolkit/data/skills/quality/megalinter/SKILL.md +162 -0
- agent_toolkit/data/skills/quality/megalinter/references/megalinter-images.md +36 -0
- agent_toolkit/data/skills/quality/megalinter/references/megalinter-license.md +41 -0
- agent_toolkit/data/skills/quality/megalinter/references/megalinter-targets.md +66 -0
- agent_toolkit/data/skills/tooling/chrome-devtools/SKILL.md +146 -0
- agent_toolkit/data/skills/tooling/herdr/SKILL.md +109 -0
- agent_toolkit/data/skills/tooling/inventory/SKILL.md +81 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/LICENSE.txt +201 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/NOTICE.txt +27 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/SKILL.md +145 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/assets/experiment-template.ipynb +117 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/assets/tutorial-template.ipynb +115 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/references/experiment-patterns.md +10 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/references/notebook-structure.md +17 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/references/quality-checklist.md +11 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/references/tutorial-patterns.md +9 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/scripts/new_notebook.py +132 -0
- agent_toolkit/data/skills/tooling/mermaid/SKILL.md +36 -0
- agent_toolkit/data/skills/tooling/playwright-cli/LICENSE.txt +201 -0
- agent_toolkit/data/skills/tooling/playwright-cli/NOTICE.txt +29 -0
- agent_toolkit/data/skills/tooling/playwright-cli/SKILL.md +154 -0
- agent_toolkit/data/skills/tooling/playwright-cli/references/cli.md +116 -0
- agent_toolkit/data/skills/tooling/playwright-cli/references/workflows.md +98 -0
- agent_toolkit/data/skills/tooling/playwright-cli/scripts/executable_playwright_cli.sh +25 -0
- agent_toolkit/data_cache.py +79 -0
- agent_toolkit/data_sync.py +144 -0
- agent_toolkit/installer/__init__.py +0 -0
- agent_toolkit/installer/merge.py +59 -0
- agent_toolkit/installer/receipt.py +89 -0
- agent_toolkit/installer/sources.py +92 -0
- agent_toolkit/installer/tracking.py +63 -0
- agent_toolkit/launcher.py +69 -0
- agent_toolkit/loop/__init__.py +0 -0
- agent_toolkit/loop/budget.py +107 -0
- agent_toolkit/loop/gh_gate.py +923 -0
- agent_toolkit/loop/loop-gh-gate +923 -0
- agent_toolkit/loop/pack.py +65 -0
- agent_toolkit/loop/runner.py +2722 -0
- agent_toolkit/runner/__init__.py +0 -0
- agent_toolkit/runner/dispatcher.py +163 -0
- agent_toolkit/runner/policy.py +356 -0
- agent_toolkit/runner/providers/__init__.py +21 -0
- agent_toolkit/runner/providers/anthropic_provider.py +109 -0
- agent_toolkit/runner/providers/base.py +53 -0
- agent_toolkit/runner/providers/ollama_provider.py +108 -0
- agent_toolkit/runner/providers/openai_provider.py +103 -0
- agent_toolkit/runner/providers/opencode_provider.py +127 -0
- agent_toolkit/swarm/__init__.py +5 -0
- agent_toolkit/swarm/approvals.py +121 -0
- agent_toolkit/swarm/backends/__init__.py +596 -0
- agent_toolkit/swarm/budget.py +83 -0
- agent_toolkit/swarm/cli.py +2448 -0
- agent_toolkit/swarm/config.py +351 -0
- agent_toolkit/swarm/handoff.py +174 -0
- agent_toolkit/swarm/models.py +230 -0
- agent_toolkit/swarm/prompts.py +177 -0
- agent_toolkit/swarm/recipes.py +304 -0
- agent_toolkit/swarm/runner.py +267 -0
- agent_toolkit/swarm/state.py +93 -0
- agent_toolkit/swarm/store.py +148 -0
- agent_toolkit/swarm/worktree.py +105 -0
- agent_toolkit/templates/workspace/.gitignore +19 -0
- agent_toolkit/templates/workspace/AGENTS.md +82 -0
- agent_toolkit/templates/workspace/knowledge/README.md +22 -0
- agent_toolkit/templates/workspace/knowledge/learnings/general.md +3 -0
- agent_toolkit/templates/workspace/knowledge/todos/pending.md +7 -0
- agent_toolkit/templates/workspace/packs/README.md +24 -0
- agent_toolkit/templates/workspace/personas/architect.md +12 -0
- agent_toolkit/templates/workspace/personas/implementer.md +12 -0
- agent_toolkit/templates/workspace/personas/researcher.md +12 -0
- agent_toolkit/templates/workspace/personas/reviewer.md +12 -0
- agent_toolkit_cli-1.11.0.dist-info/METADATA +363 -0
- agent_toolkit_cli-1.11.0.dist-info/RECORD +438 -0
- agent_toolkit_cli-1.11.0.dist-info/WHEEL +4 -0
- agent_toolkit_cli-1.11.0.dist-info/entry_points.txt +4 -0
- agent_toolkit_cli-1.11.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""Installation receipt management — records what was installed and where."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from dataclasses import dataclass, field
|
|
7
|
+
from datetime import datetime, timezone
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Literal
|
|
10
|
+
|
|
11
|
+
RECEIPT_DIR = Path.home() / ".config" / "agent-toolkit" / "receipts"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class ArtifactEntry:
|
|
16
|
+
path: str
|
|
17
|
+
digest: str
|
|
18
|
+
ownership: Literal["created", "merged"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass
|
|
22
|
+
class InstallReceipt:
|
|
23
|
+
schema_version: int
|
|
24
|
+
product: str
|
|
25
|
+
target: str
|
|
26
|
+
scope: str
|
|
27
|
+
version: str
|
|
28
|
+
installed_at: str
|
|
29
|
+
source_digest: str
|
|
30
|
+
artifacts: list[ArtifactEntry] = field(default_factory=list)
|
|
31
|
+
config_patches: list[dict] = field(default_factory=list)
|
|
32
|
+
secrets: list = field(default_factory=list) # always empty
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def create(cls, product, target, scope, version, source_digest):
|
|
36
|
+
return cls(
|
|
37
|
+
schema_version=1,
|
|
38
|
+
product=product,
|
|
39
|
+
target=target,
|
|
40
|
+
scope=scope,
|
|
41
|
+
version=version,
|
|
42
|
+
installed_at=datetime.now(timezone.utc).isoformat(),
|
|
43
|
+
source_digest=source_digest,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def to_dict(self):
|
|
47
|
+
return {
|
|
48
|
+
"schemaVersion": self.schema_version,
|
|
49
|
+
"product": self.product,
|
|
50
|
+
"target": self.target,
|
|
51
|
+
"scope": self.scope,
|
|
52
|
+
"version": self.version,
|
|
53
|
+
"installedAt": self.installed_at,
|
|
54
|
+
"sourceDigest": self.source_digest,
|
|
55
|
+
"artifacts": [
|
|
56
|
+
{"path": a.path, "digest": a.digest, "ownership": a.ownership}
|
|
57
|
+
for a in self.artifacts
|
|
58
|
+
],
|
|
59
|
+
"configPatches": self.config_patches,
|
|
60
|
+
"secrets": [],
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
def save(self, receipt_dir=None):
|
|
64
|
+
d = Path(receipt_dir) if receipt_dir else RECEIPT_DIR
|
|
65
|
+
d.mkdir(parents=True, exist_ok=True)
|
|
66
|
+
p = d / f"{self.target}-{self.product}.json"
|
|
67
|
+
p.write_text(json.dumps(self.to_dict(), indent=2) + "\n")
|
|
68
|
+
return p
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
def load(cls, target, product, receipt_dir=None):
|
|
72
|
+
d = Path(receipt_dir) if receipt_dir else RECEIPT_DIR
|
|
73
|
+
p = d / f"{target}-{product}.json"
|
|
74
|
+
if not p.exists():
|
|
75
|
+
return None
|
|
76
|
+
data = json.loads(p.read_text())
|
|
77
|
+
r = cls(
|
|
78
|
+
schema_version=data.get("schemaVersion", 1),
|
|
79
|
+
product=data["product"],
|
|
80
|
+
target=data["target"],
|
|
81
|
+
scope=data.get("scope", "project"),
|
|
82
|
+
version=data["version"],
|
|
83
|
+
installed_at=data.get("installedAt", ""),
|
|
84
|
+
source_digest=data.get("sourceDigest", ""),
|
|
85
|
+
)
|
|
86
|
+
for a in data.get("artifacts", []):
|
|
87
|
+
r.artifacts.append(ArtifactEntry(a["path"], a["digest"], a["ownership"]))
|
|
88
|
+
r.config_patches = list(data.get("configPatches", []))
|
|
89
|
+
return r
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"""Resolve install source paths — prefer compiler-generated plugins/ over hand profiles/."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from agent_toolkit._paths import toolkit_root
|
|
9
|
+
|
|
10
|
+
# Default products whose compiled agents are installed for profile-based targets.
|
|
11
|
+
_DEFAULT_AGENT_PRODUCTS = (
|
|
12
|
+
"agent-toolkit-core",
|
|
13
|
+
"agent-toolkit-agents",
|
|
14
|
+
"agent-toolkit-forge",
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def find_repo_root(data_root: Path | None = None) -> Path:
|
|
19
|
+
"""Return repo root containing plugins/ compiler output."""
|
|
20
|
+
root = data_root or toolkit_root()
|
|
21
|
+
if (root / "plugins").is_dir():
|
|
22
|
+
return root
|
|
23
|
+
if (root.parent / "plugins").is_dir():
|
|
24
|
+
return root.parent
|
|
25
|
+
return root
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def plugins_dir(data_root: Path | None = None) -> Path | None:
|
|
29
|
+
"""Return plugins/ output directory when compiler artifacts are present."""
|
|
30
|
+
override = os.environ.get("AGENT_TOOLKIT_INSTALL_SOURCE", "").strip()
|
|
31
|
+
if override:
|
|
32
|
+
path = Path(override)
|
|
33
|
+
return path if path.is_dir() else None
|
|
34
|
+
|
|
35
|
+
repo = find_repo_root(data_root)
|
|
36
|
+
plugins = repo / "plugins"
|
|
37
|
+
return plugins if plugins.is_dir() else None
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def compiled_agent_files(
|
|
41
|
+
data_root: Path | None = None,
|
|
42
|
+
*,
|
|
43
|
+
products: tuple[str, ...] = _DEFAULT_AGENT_PRODUCTS,
|
|
44
|
+
) -> dict[str, Path]:
|
|
45
|
+
"""Map agent name -> AGENT.md path from compiled plugin bundles."""
|
|
46
|
+
root = data_root or toolkit_root()
|
|
47
|
+
plugins = root / "plugins"
|
|
48
|
+
if not plugins.is_dir():
|
|
49
|
+
repo_plugins = plugins_dir(data_root)
|
|
50
|
+
if repo_plugins is None:
|
|
51
|
+
return {}
|
|
52
|
+
plugins = repo_plugins
|
|
53
|
+
|
|
54
|
+
agents: dict[str, Path] = {}
|
|
55
|
+
for product_id in products:
|
|
56
|
+
agents_dir = plugins / product_id / "agents"
|
|
57
|
+
if not agents_dir.is_dir():
|
|
58
|
+
continue
|
|
59
|
+
for agent_dir in sorted(agents_dir.iterdir()):
|
|
60
|
+
if not agent_dir.is_dir():
|
|
61
|
+
continue
|
|
62
|
+
agent_md = agent_dir / "AGENT.md"
|
|
63
|
+
if agent_md.is_file():
|
|
64
|
+
agents[agent_dir.name] = agent_md
|
|
65
|
+
return agents
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def agent_install_sources(
|
|
69
|
+
tool: str,
|
|
70
|
+
data_root: Path | None = None,
|
|
71
|
+
) -> dict[str, Path]:
|
|
72
|
+
"""Return agent-name -> source file for a profile install target.
|
|
73
|
+
|
|
74
|
+
Prefers compiler-generated ``plugins/*/agents/*/AGENT.md`` artifacts.
|
|
75
|
+
Falls back to ``profiles/<tool>/agents/*.md`` when plugins are unavailable.
|
|
76
|
+
"""
|
|
77
|
+
compiled = compiled_agent_files(data_root)
|
|
78
|
+
if compiled:
|
|
79
|
+
return compiled
|
|
80
|
+
|
|
81
|
+
root = data_root or toolkit_root()
|
|
82
|
+
profile_agents = root / "profiles" / tool / "agents"
|
|
83
|
+
if not profile_agents.is_dir():
|
|
84
|
+
return {}
|
|
85
|
+
|
|
86
|
+
return {path.stem: path for path in sorted(profile_agents.glob("*.md")) if path.is_file()}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def profile_file(tool: str, *parts: str, data_root: Path | None = None) -> Path:
|
|
90
|
+
"""Return a profile-relative path (rules, CLAUDE.md, etc.)."""
|
|
91
|
+
root = data_root or toolkit_root()
|
|
92
|
+
return root / "profiles" / tool / Path(*parts)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""Track installed artifacts and persist InstallReceipt."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import hashlib
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from agent_toolkit import __version__
|
|
9
|
+
from agent_toolkit.installer.receipt import ArtifactEntry, InstallReceipt
|
|
10
|
+
|
|
11
|
+
PRODUCT = "agent-toolkit-profiles"
|
|
12
|
+
SCOPE = "user-home"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def receipt_dir() -> Path:
|
|
16
|
+
"""Return the install receipt directory (under the current HOME)."""
|
|
17
|
+
return Path.home() / ".config" / "agent-toolkit" / "receipts"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def file_digest(path: Path) -> str:
|
|
21
|
+
return hashlib.sha256(path.read_bytes()).hexdigest()[:16]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def source_digest(root: Path) -> str:
|
|
25
|
+
marker = root / "profiles"
|
|
26
|
+
if marker.is_dir():
|
|
27
|
+
return hashlib.sha256(str(marker.resolve()).encode()).hexdigest()[:12]
|
|
28
|
+
return __version__
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class InstallTracker:
|
|
32
|
+
"""Collect artifact entries during install and write receipt on save."""
|
|
33
|
+
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
target: str,
|
|
37
|
+
*,
|
|
38
|
+
dry_run: bool,
|
|
39
|
+
receipt_dir_path: Path | None = None,
|
|
40
|
+
toolkit_root: Path | None = None,
|
|
41
|
+
) -> None:
|
|
42
|
+
root = toolkit_root or Path()
|
|
43
|
+
self.dry_run = dry_run
|
|
44
|
+
self.receipt_dir_path = receipt_dir_path or receipt_dir()
|
|
45
|
+
self.receipt = InstallReceipt.create(
|
|
46
|
+
PRODUCT,
|
|
47
|
+
target,
|
|
48
|
+
SCOPE,
|
|
49
|
+
__version__,
|
|
50
|
+
source_digest(root),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
def record_created(self, path: Path) -> None:
|
|
54
|
+
if not path.is_file():
|
|
55
|
+
return
|
|
56
|
+
self.receipt.artifacts.append(
|
|
57
|
+
ArtifactEntry(str(path.resolve()), file_digest(path), "created")
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def save(self) -> Path | None:
|
|
61
|
+
if self.dry_run or not self.receipt.artifacts:
|
|
62
|
+
return None
|
|
63
|
+
return self.receipt.save(self.receipt_dir_path)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"""Thin PyPI launcher — replace this process with the bundled V binary (ADR-021 / #535).
|
|
2
|
+
|
|
3
|
+
No Python business logic. Product commands agent-toolkit and agent-toolkit-cli
|
|
4
|
+
hand off to the native binary.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import os
|
|
10
|
+
import subprocess
|
|
11
|
+
import sys
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
_BIN_DIR = Path(__file__).resolve().parent / "bin"
|
|
15
|
+
_NATIVE_NAMES = ("agent-toolkit.exe", "agent-toolkit")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def bundled_binary() -> Path | None:
|
|
19
|
+
for name in _NATIVE_NAMES:
|
|
20
|
+
cand = _BIN_DIR / name
|
|
21
|
+
if cand.is_file():
|
|
22
|
+
return cand
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def resolve_native_bin() -> Path | None:
|
|
27
|
+
env = os.environ.get("AGENT_TOOLKIT_BIN", "").strip()
|
|
28
|
+
if env:
|
|
29
|
+
p = Path(env)
|
|
30
|
+
if p.is_file():
|
|
31
|
+
return p
|
|
32
|
+
return None
|
|
33
|
+
bundled = bundled_binary()
|
|
34
|
+
if bundled is not None:
|
|
35
|
+
return bundled
|
|
36
|
+
root = os.environ.get("AGENT_TOOLKIT_ROOT", "").strip()
|
|
37
|
+
if root:
|
|
38
|
+
for rel in ("build/agent-toolkit", "build/agent-toolkit-v", "build/agent-toolkit.exe"):
|
|
39
|
+
cand = Path(root) / rel
|
|
40
|
+
if cand.is_file():
|
|
41
|
+
return cand
|
|
42
|
+
return None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def run_native(bin_path: Path, rest: list[str]) -> None:
|
|
46
|
+
argv = [str(bin_path), *rest]
|
|
47
|
+
if os.name == "nt":
|
|
48
|
+
proc = subprocess.run(argv, check=False)
|
|
49
|
+
raise SystemExit(int(proc.returncode))
|
|
50
|
+
os.execv(argv[0], argv)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def missing_binary_message() -> str:
|
|
54
|
+
return (
|
|
55
|
+
"agent-toolkit: native V binary not found (ADR-021).\n"
|
|
56
|
+
" Packaged wheels bundle the binary under agent_toolkit/bin/.\n"
|
|
57
|
+
" Dev: make build-cli, or set AGENT_TOOLKIT_BIN to that executable.\n"
|
|
58
|
+
" Python implementation (fallback): agent-toolkit-py\n"
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def main(argv: list[str] | None = None) -> None:
|
|
63
|
+
args = list(sys.argv if argv is None else argv)
|
|
64
|
+
rest = args[1:] if len(args) > 1 else []
|
|
65
|
+
bin_path = resolve_native_bin()
|
|
66
|
+
if bin_path is None:
|
|
67
|
+
sys.stderr.write(missing_binary_message())
|
|
68
|
+
raise SystemExit(127)
|
|
69
|
+
run_native(bin_path, rest)
|
|
File without changes
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""Loop budget helpers: wall-clock timeout and token accounting."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from datetime import datetime, timezone
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
DEFAULT_WALL_SECONDS = 900
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def wall_timeout_seconds(budget: dict[str, Any]) -> int:
|
|
14
|
+
"""Per-run wall-clock limit from loop budget (never bypassed by --force)."""
|
|
15
|
+
raw = budget.get("max_wall_seconds")
|
|
16
|
+
if raw is None:
|
|
17
|
+
return DEFAULT_WALL_SECONDS
|
|
18
|
+
try:
|
|
19
|
+
return max(30, int(raw))
|
|
20
|
+
except (TypeError, ValueError):
|
|
21
|
+
return DEFAULT_WALL_SECONDS
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def max_tokens_limit(budget: dict[str, Any]) -> int | None:
|
|
25
|
+
"""Per-run token ceiling, or None when unset."""
|
|
26
|
+
raw = budget.get("max_tokens")
|
|
27
|
+
if raw is None:
|
|
28
|
+
return None
|
|
29
|
+
try:
|
|
30
|
+
return int(raw)
|
|
31
|
+
except (TypeError, ValueError):
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def tokens_from_trace(trace_path: Path) -> int:
|
|
36
|
+
"""Sum token_usage / prompt+completion events from a trace.jsonl file."""
|
|
37
|
+
if not trace_path.is_file():
|
|
38
|
+
return 0
|
|
39
|
+
total = 0
|
|
40
|
+
for line in trace_path.read_text(encoding="utf-8").splitlines():
|
|
41
|
+
line = line.strip()
|
|
42
|
+
if not line:
|
|
43
|
+
continue
|
|
44
|
+
try:
|
|
45
|
+
event = json.loads(line)
|
|
46
|
+
except json.JSONDecodeError:
|
|
47
|
+
continue
|
|
48
|
+
kind = event.get("kind", "")
|
|
49
|
+
if kind == "token_usage":
|
|
50
|
+
total += int(event.get("total_tokens") or event.get("total") or 0)
|
|
51
|
+
elif kind in ("prompt", "completion"):
|
|
52
|
+
total += int(event.get("prompt_tokens", 0) or 0)
|
|
53
|
+
total += int(event.get("completion_tokens", 0) or 0)
|
|
54
|
+
return total
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def tokens_today(loop_dir: Path) -> int:
|
|
58
|
+
"""Sum tokens recorded in today's run traces under loop_dir/runs/."""
|
|
59
|
+
runs_dir = loop_dir / "runs"
|
|
60
|
+
if not runs_dir.is_dir():
|
|
61
|
+
return 0
|
|
62
|
+
today = datetime.now(timezone.utc).date()
|
|
63
|
+
total = 0
|
|
64
|
+
for run in runs_dir.iterdir():
|
|
65
|
+
if not run.is_dir():
|
|
66
|
+
continue
|
|
67
|
+
trace = run / "trace.jsonl"
|
|
68
|
+
if not trace.is_file():
|
|
69
|
+
continue
|
|
70
|
+
try:
|
|
71
|
+
first_line = trace.read_text(encoding="utf-8").splitlines()[0]
|
|
72
|
+
event = json.loads(first_line)
|
|
73
|
+
ts = event.get("ts", "")
|
|
74
|
+
if ts:
|
|
75
|
+
run_day = datetime.fromisoformat(str(ts).replace("Z", "+00:00")).date()
|
|
76
|
+
if run_day != today:
|
|
77
|
+
continue
|
|
78
|
+
except (IndexError, json.JSONDecodeError, ValueError):
|
|
79
|
+
pass
|
|
80
|
+
total += tokens_from_trace(trace)
|
|
81
|
+
return total
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def token_budget_exceeded(tokens_used: int, budget: dict[str, Any]) -> bool:
|
|
85
|
+
limit = max_tokens_limit(budget)
|
|
86
|
+
if limit is None:
|
|
87
|
+
return False
|
|
88
|
+
return tokens_used >= limit
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def soft_token_precheck(state: dict[str, Any], budget: dict[str, Any]) -> str | None:
|
|
92
|
+
"""Warn when last run tokens suggest the next run may hit max_tokens immediately."""
|
|
93
|
+
limit = max_tokens_limit(budget)
|
|
94
|
+
if limit is None:
|
|
95
|
+
return None
|
|
96
|
+
last_tokens = state.get("last_run_tokens")
|
|
97
|
+
if last_tokens is None:
|
|
98
|
+
return None
|
|
99
|
+
try:
|
|
100
|
+
last = int(last_tokens)
|
|
101
|
+
except (TypeError, ValueError):
|
|
102
|
+
return None
|
|
103
|
+
if last >= limit:
|
|
104
|
+
return (
|
|
105
|
+
f"Last run used {last:,} tokens (limit {limit:,}). Run may exit with budget_exhausted."
|
|
106
|
+
)
|
|
107
|
+
return None
|