agentpack-cli 0.3.33__tar.gz → 0.3.35__tar.gz
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.
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/PKG-INFO +40 -13
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/README.md +39 -12
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/pyproject.toml +9 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/__init__.py +1 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/adapters/detect.py +30 -11
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/monorepo.py +156 -3
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/symbols.py +64 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/application/pack_service.py +1 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/cli.py +9 -7
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/dev_check.py +1 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/diagnose_selection.py +100 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/doctor.py +103 -5
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/guard.py +19 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/hook_cmd.py +325 -11
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/init.py +2 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/install.py +29 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/learn.py +37 -15
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/mcp_cmd.py +1 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/next_cmd.py +48 -18
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/pack.py +14 -7
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/quickstart.py +26 -15
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/release_check.py +1 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/repair.py +2 -1
- agentpack_cli-0.3.35/src/agentpack/commands/review_cmd.py +1469 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/route.py +7 -2
- agentpack_cli-0.3.35/src/agentpack/commands/toon_validate.py +72 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/workflow_cmd.py +51 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/citations.py +28 -4
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/command_surface.py +15 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/context_pack.py +99 -6
- agentpack_cli-0.3.35/src/agentpack/core/mcp_runtime.py +96 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/scanner.py +2 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/toon_parser.py +4 -1
- agentpack_cli-0.3.35/src/agentpack/core/toon_validator.py +462 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/dashboard/collectors.py +42 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/dashboard/models.py +22 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/dashboard/renderers.py +22 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/agentpack-learn.md +10 -0
- agentpack_cli-0.3.35/src/agentpack/data/agentpack-review.md +55 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/agentpack.md +1 -2
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/.codex-plugin/plugin.json +1 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/README.md +8 -3
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/skills/agentpack-learn.md +10 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/skills/agentpack-pack.md +5 -11
- agentpack_cli-0.3.35/src/agentpack/data/codex_plugin/skills/agentpack-review.md +50 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/skills/agentpack.md +1 -2
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/review/stage1-understanding.md +34 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/review/stage2-judge.md +27 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/installers/antigravity.py +8 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/installers/claude.py +8 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/installers/codex.py +8 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/installers/cursor.py +7 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/installers/windsurf.py +7 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/__init__.py +4 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/extractor.py +155 -8
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/models.py +27 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/renderers.py +74 -23
- agentpack_cli-0.3.35/src/agentpack/learning/sessions.py +139 -0
- agentpack_cli-0.3.35/src/agentpack/learning/task_memory.py +156 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/mcp_server.py +124 -7
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/renderers/markdown.py +3 -2
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/router/models.py +2 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/router/prompt_builder.py +28 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/router/service.py +307 -1
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/summaries/offline.py +67 -1
- agentpack_cli-0.3.33/src/agentpack/commands/review_cmd.py +0 -627
- agentpack_cli-0.3.33/src/agentpack/data/agentpack-review.md +0 -46
- agentpack_cli-0.3.33/src/agentpack/data/codex_plugin/skills/agentpack-review.md +0 -42
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/.gitignore +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/LICENSE +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/adapters/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/adapters/antigravity.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/adapters/base.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/adapters/claude.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/adapters/codex.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/adapters/cursor.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/adapters/generic.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/adapters/windsurf.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/broad_context.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/context_intent.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/dependency_graph.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/go_imports.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/java_imports.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/js_ts_imports.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/naming_signals.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/python_ast.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/python_imports.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/ranking.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/repo_map.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/role_inference.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/rust_imports.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/task_classifier.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/analysis/tests.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/application/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/_shared.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/benchmark.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/ci_cmd.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/claude_cmd.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/compress_output.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/dashboard.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/diff.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/eval_cmd.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/explain.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/ignore_cmd.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/memory.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/migrate.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/monitor.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/perf.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/release_cmd.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/retrieve.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/scan.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/skills.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/start_cmd.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/state_cmd.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/stats.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/status.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/summarize.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/task_cmd.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/threads.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/tune.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/upgrade.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/verify_wheel.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/watch.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/commands/wrap.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/bootstrap.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/cache.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/changed_paths.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/config.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/diff.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/e2e_benchmark.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/evals.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/execution_state.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/git.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/git_hooks.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/global_install.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/ignore.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/loop_protocol.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/merkle.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/models.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/modes.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/pack_handoff.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/pack_registry.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/redactor.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/snapshot.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/structured_format.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/task_freshness.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/thread_context.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/token_estimator.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/core/vscode_tasks.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/dashboard/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/.codexignore +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/.github/dependabot.yml +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/.github/workflows/hol-plugin-scanner.yml +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/LICENSE +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/SECURITY.md +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/assets/icon.svg +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/assets/route-demo.svg +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/skills/agentpack-refresh.md +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/data/codex_plugin/skills/agentpack-route.md +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/installers/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/integrations/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/integrations/agents.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/integrations/git_hooks.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/integrations/global_install.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/integrations/platform.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/integrations/vscode_tasks.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/collector.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/episodes.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/feedback.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/lesson_ranker.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/provider.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/quality.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/learning/skill_map.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/output_compression/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/output_compression/core.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/renderers/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/renderers/compact.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/renderers/receipts.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/renderers/toon.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/router/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/router/discovery.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/router/parser.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/router/scoring.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/router/skills_index.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/session/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/session/events.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/session/references.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/session/state.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/summaries/__init__.py +0 -0
- {agentpack_cli-0.3.33 → agentpack_cli-0.3.35}/src/agentpack/summaries/base.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentpack-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.35
|
|
4
4
|
Summary: Local context engine for AI coding agents that ranks relevant repo files and builds compact task-focused context packs for Claude Code, Codex, Cursor, Windsurf, MCP, and CI workflows.
|
|
5
5
|
Project-URL: Homepage, https://github.com/vishal2612200/agentpack
|
|
6
6
|
Project-URL: Documentation, https://vishal2612200.github.io/agentpack/
|
|
@@ -83,6 +83,14 @@ Description-Content-Type: text/markdown
|
|
|
83
83
|
|
|
84
84
|
---
|
|
85
85
|
|
|
86
|
+
<p align="center">
|
|
87
|
+
<img src="docs/assets/agentpack-demo.gif" alt="Terminal demo: AgentPack refreshes context, routes a task to ranked files and warnings, then runs a focused test." width="840">
|
|
88
|
+
</p>
|
|
89
|
+
|
|
90
|
+
<p align="center">
|
|
91
|
+
<a href="docs/assets/agentpack-demo.mp4">MP4 demo</a>
|
|
92
|
+
</p>
|
|
93
|
+
|
|
86
94
|
You know the pattern. You ask an agent to fix one bug. It `rg`s half the repo, opens the wrong files, misses the test, then rediscovers the architecture you already had.
|
|
87
95
|
|
|
88
96
|
AgentPack does the repo-orientation pass first.
|
|
@@ -90,6 +98,7 @@ AgentPack does the repo-orientation pass first.
|
|
|
90
98
|
```text
|
|
91
99
|
agentpack route --task "fix auth token expiry"
|
|
92
100
|
-> files that probably matter
|
|
101
|
+
-> why those files, and why common candidates were skipped
|
|
93
102
|
-> skills and rules that fit the task
|
|
94
103
|
-> tests that probably prove it
|
|
95
104
|
-> rules, commands, warnings
|
|
@@ -124,12 +133,15 @@ Inside your repo:
|
|
|
124
133
|
|
|
125
134
|
```bash
|
|
126
135
|
agentpack init --yes
|
|
127
|
-
agentpack
|
|
128
|
-
agentpack
|
|
129
|
-
agentpack
|
|
136
|
+
agentpack start "fix auth token expiry"
|
|
137
|
+
agentpack next
|
|
138
|
+
agentpack doctor --agent auto
|
|
130
139
|
```
|
|
131
140
|
|
|
132
141
|
Then give `.agentpack/context.md` to your agent, or let MCP-capable agents call AgentPack tools directly.
|
|
142
|
+
Core onboarding is `quickstart`, `start`, `next`, and `doctor`. Use `route`,
|
|
143
|
+
`pack`, and `benchmark` when you need deeper inspection or measurement.
|
|
144
|
+
Everything else is an advanced workflow or release/diagnostic helper.
|
|
133
145
|
|
|
134
146
|
For one-shot use without installing:
|
|
135
147
|
|
|
@@ -146,6 +158,13 @@ npx @vishal2612200/agentpack task set "fix auth token expiry"
|
|
|
146
158
|
npx @vishal2612200/agentpack pack --task auto
|
|
147
159
|
```
|
|
148
160
|
|
|
161
|
+
## New Contributors
|
|
162
|
+
|
|
163
|
+
Start with [`good first issue`](https://github.com/vishal2612200/agentpack/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22good%20first%20issue%22) or [`help wanted`](https://github.com/vishal2612200/agentpack/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22help%20wanted%22) issues.
|
|
164
|
+
If this would be your first open-source contribution, use the smaller
|
|
165
|
+
[`first-timers-only`](https://github.com/vishal2612200/agentpack/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22first-timers-only%22) queue.
|
|
166
|
+
Contribution setup and review expectations are in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
167
|
+
|
|
149
168
|
## Quick Demo
|
|
150
169
|
|
|
151
170
|
Route task first:
|
|
@@ -154,7 +173,7 @@ Route task first:
|
|
|
154
173
|
agentpack route --task "fix billing webhook retry handling"
|
|
155
174
|
```
|
|
156
175
|
|
|
157
|
-
AgentPack returns likely files, tests, rules, commands, and warnings without changing source files.
|
|
176
|
+
AgentPack returns likely files, why-selected and why-not-selected notes, tests, rules, commands, and warnings without changing source files.
|
|
158
177
|
It also recommends matching skills or agent rules when the task points at a known workflow, framework, language, or repo convention.
|
|
159
178
|
|
|
160
179
|
Build context pack next:
|
|
@@ -166,6 +185,7 @@ agentpack pack --task auto
|
|
|
166
185
|
|
|
167
186
|
AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks, token stats, and `.agentpack/citations.json` source provenance for the packed claims.
|
|
168
187
|
It reuses cached file summaries and snapshot metadata so repeated packs do not start from zero.
|
|
188
|
+
Run `agentpack doctor` when an agent integration, MCP setup, hook, or installed CLI path looks stale.
|
|
169
189
|
|
|
170
190
|
## What AgentPack Gives Your Agent
|
|
171
191
|
|
|
@@ -183,14 +203,14 @@ It reuses cached file summaries and snapshot metadata so repeated packs do not s
|
|
|
183
203
|
- freshness warnings when task or git state changes
|
|
184
204
|
- local benchmark data when selected context misses real changed files
|
|
185
205
|
|
|
186
|
-
## What's Current In 0.3.
|
|
206
|
+
## What's Current In 0.3.35
|
|
187
207
|
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
208
|
+
- First-run output is clearer: `quickstart`, `next`, and top-level help now point new users through one core path before optional diagnostics.
|
|
209
|
+
- `doctor`, `repair`, `guard`, and `review --check` now print more explicit failure, impact, repair command, and safe-to-continue guidance.
|
|
210
|
+
- Review inline posting is safer: live GitHub comments require a matching `--dry-run-post` payload hash before `--post-inline-comments`.
|
|
211
|
+
- MCP structured outputs and TOON validation are stricter, including canonical TOON output for agents that need repairable structured responses.
|
|
212
|
+
- Route output now explains both why files were selected and why common candidates were omitted.
|
|
213
|
+
- Codex, Claude, Cursor, Windsurf, and Antigravity detection and distributed guidance were refreshed so active-agent and fallback behavior are easier to audit.
|
|
194
214
|
|
|
195
215
|
## Proof So Far
|
|
196
216
|
|
|
@@ -210,6 +230,8 @@ Source: [`benchmarks/results/2026-06-25-public.md`](benchmarks/results/2026-06-2
|
|
|
210
230
|
|
|
211
231
|
This is useful but not magic. It says AgentPack often gets meaningful files into a small pack. It does not replace source inspection, tests, runtime evidence, or review. Agent success A/B benchmarks should report task success, tool calls, token cost, validation quality, and time-to-first-correct-file.
|
|
212
232
|
|
|
233
|
+
E2E outcome proof is tracked separately in [`benchmarks/results/e2e-ab-status.md`](benchmarks/results/e2e-ab-status.md). Do not treat file-selection results as task-success or cost-savings proof.
|
|
234
|
+
|
|
213
235
|
## What We Want To Prove Next
|
|
214
236
|
|
|
215
237
|
AgentPack should eventually show:
|
|
@@ -346,7 +368,7 @@ pipx ensurepath
|
|
|
346
368
|
|
|
347
369
|
## Status
|
|
348
370
|
|
|
349
|
-
Alpha: `0.3.
|
|
371
|
+
Alpha: `0.3.35`.
|
|
350
372
|
|
|
351
373
|
Works, tested, and used in real sessions. Python and JavaScript/TypeScript have strongest support. APIs may change before 1.0.
|
|
352
374
|
|
|
@@ -354,6 +376,11 @@ Platform support targets macOS, Linux, and Windows PowerShell with Git for Windo
|
|
|
354
376
|
|
|
355
377
|
Name note: PyPI package is `agentpack-cli`, npm package is `@vishal2612200/agentpack`, and command is `agentpack`. This project is unrelated to AgentPack dataset papers or other repos with the same name.
|
|
356
378
|
|
|
379
|
+
## Contributing
|
|
380
|
+
|
|
381
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md) for setup, validation, and PR expectations.
|
|
382
|
+
Community behavior is covered by [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).
|
|
383
|
+
|
|
357
384
|
## License
|
|
358
385
|
|
|
359
386
|
MIT
|
|
@@ -36,6 +36,14 @@
|
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
39
|
+
<p align="center">
|
|
40
|
+
<img src="docs/assets/agentpack-demo.gif" alt="Terminal demo: AgentPack refreshes context, routes a task to ranked files and warnings, then runs a focused test." width="840">
|
|
41
|
+
</p>
|
|
42
|
+
|
|
43
|
+
<p align="center">
|
|
44
|
+
<a href="docs/assets/agentpack-demo.mp4">MP4 demo</a>
|
|
45
|
+
</p>
|
|
46
|
+
|
|
39
47
|
You know the pattern. You ask an agent to fix one bug. It `rg`s half the repo, opens the wrong files, misses the test, then rediscovers the architecture you already had.
|
|
40
48
|
|
|
41
49
|
AgentPack does the repo-orientation pass first.
|
|
@@ -43,6 +51,7 @@ AgentPack does the repo-orientation pass first.
|
|
|
43
51
|
```text
|
|
44
52
|
agentpack route --task "fix auth token expiry"
|
|
45
53
|
-> files that probably matter
|
|
54
|
+
-> why those files, and why common candidates were skipped
|
|
46
55
|
-> skills and rules that fit the task
|
|
47
56
|
-> tests that probably prove it
|
|
48
57
|
-> rules, commands, warnings
|
|
@@ -77,12 +86,15 @@ Inside your repo:
|
|
|
77
86
|
|
|
78
87
|
```bash
|
|
79
88
|
agentpack init --yes
|
|
80
|
-
agentpack
|
|
81
|
-
agentpack
|
|
82
|
-
agentpack
|
|
89
|
+
agentpack start "fix auth token expiry"
|
|
90
|
+
agentpack next
|
|
91
|
+
agentpack doctor --agent auto
|
|
83
92
|
```
|
|
84
93
|
|
|
85
94
|
Then give `.agentpack/context.md` to your agent, or let MCP-capable agents call AgentPack tools directly.
|
|
95
|
+
Core onboarding is `quickstart`, `start`, `next`, and `doctor`. Use `route`,
|
|
96
|
+
`pack`, and `benchmark` when you need deeper inspection or measurement.
|
|
97
|
+
Everything else is an advanced workflow or release/diagnostic helper.
|
|
86
98
|
|
|
87
99
|
For one-shot use without installing:
|
|
88
100
|
|
|
@@ -99,6 +111,13 @@ npx @vishal2612200/agentpack task set "fix auth token expiry"
|
|
|
99
111
|
npx @vishal2612200/agentpack pack --task auto
|
|
100
112
|
```
|
|
101
113
|
|
|
114
|
+
## New Contributors
|
|
115
|
+
|
|
116
|
+
Start with [`good first issue`](https://github.com/vishal2612200/agentpack/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22good%20first%20issue%22) or [`help wanted`](https://github.com/vishal2612200/agentpack/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22help%20wanted%22) issues.
|
|
117
|
+
If this would be your first open-source contribution, use the smaller
|
|
118
|
+
[`first-timers-only`](https://github.com/vishal2612200/agentpack/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22first-timers-only%22) queue.
|
|
119
|
+
Contribution setup and review expectations are in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
120
|
+
|
|
102
121
|
## Quick Demo
|
|
103
122
|
|
|
104
123
|
Route task first:
|
|
@@ -107,7 +126,7 @@ Route task first:
|
|
|
107
126
|
agentpack route --task "fix billing webhook retry handling"
|
|
108
127
|
```
|
|
109
128
|
|
|
110
|
-
AgentPack returns likely files, tests, rules, commands, and warnings without changing source files.
|
|
129
|
+
AgentPack returns likely files, why-selected and why-not-selected notes, tests, rules, commands, and warnings without changing source files.
|
|
111
130
|
It also recommends matching skills or agent rules when the task points at a known workflow, framework, language, or repo convention.
|
|
112
131
|
|
|
113
132
|
Build context pack next:
|
|
@@ -119,6 +138,7 @@ agentpack pack --task auto
|
|
|
119
138
|
|
|
120
139
|
AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks, token stats, and `.agentpack/citations.json` source provenance for the packed claims.
|
|
121
140
|
It reuses cached file summaries and snapshot metadata so repeated packs do not start from zero.
|
|
141
|
+
Run `agentpack doctor` when an agent integration, MCP setup, hook, or installed CLI path looks stale.
|
|
122
142
|
|
|
123
143
|
## What AgentPack Gives Your Agent
|
|
124
144
|
|
|
@@ -136,14 +156,14 @@ It reuses cached file summaries and snapshot metadata so repeated packs do not s
|
|
|
136
156
|
- freshness warnings when task or git state changes
|
|
137
157
|
- local benchmark data when selected context misses real changed files
|
|
138
158
|
|
|
139
|
-
## What's Current In 0.3.
|
|
159
|
+
## What's Current In 0.3.35
|
|
140
160
|
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
161
|
+
- First-run output is clearer: `quickstart`, `next`, and top-level help now point new users through one core path before optional diagnostics.
|
|
162
|
+
- `doctor`, `repair`, `guard`, and `review --check` now print more explicit failure, impact, repair command, and safe-to-continue guidance.
|
|
163
|
+
- Review inline posting is safer: live GitHub comments require a matching `--dry-run-post` payload hash before `--post-inline-comments`.
|
|
164
|
+
- MCP structured outputs and TOON validation are stricter, including canonical TOON output for agents that need repairable structured responses.
|
|
165
|
+
- Route output now explains both why files were selected and why common candidates were omitted.
|
|
166
|
+
- Codex, Claude, Cursor, Windsurf, and Antigravity detection and distributed guidance were refreshed so active-agent and fallback behavior are easier to audit.
|
|
147
167
|
|
|
148
168
|
## Proof So Far
|
|
149
169
|
|
|
@@ -163,6 +183,8 @@ Source: [`benchmarks/results/2026-06-25-public.md`](benchmarks/results/2026-06-2
|
|
|
163
183
|
|
|
164
184
|
This is useful but not magic. It says AgentPack often gets meaningful files into a small pack. It does not replace source inspection, tests, runtime evidence, or review. Agent success A/B benchmarks should report task success, tool calls, token cost, validation quality, and time-to-first-correct-file.
|
|
165
185
|
|
|
186
|
+
E2E outcome proof is tracked separately in [`benchmarks/results/e2e-ab-status.md`](benchmarks/results/e2e-ab-status.md). Do not treat file-selection results as task-success or cost-savings proof.
|
|
187
|
+
|
|
166
188
|
## What We Want To Prove Next
|
|
167
189
|
|
|
168
190
|
AgentPack should eventually show:
|
|
@@ -299,7 +321,7 @@ pipx ensurepath
|
|
|
299
321
|
|
|
300
322
|
## Status
|
|
301
323
|
|
|
302
|
-
Alpha: `0.3.
|
|
324
|
+
Alpha: `0.3.35`.
|
|
303
325
|
|
|
304
326
|
Works, tested, and used in real sessions. Python and JavaScript/TypeScript have strongest support. APIs may change before 1.0.
|
|
305
327
|
|
|
@@ -307,6 +329,11 @@ Platform support targets macOS, Linux, and Windows PowerShell with Git for Windo
|
|
|
307
329
|
|
|
308
330
|
Name note: PyPI package is `agentpack-cli`, npm package is `@vishal2612200/agentpack`, and command is `agentpack`. This project is unrelated to AgentPack dataset papers or other repos with the same name.
|
|
309
331
|
|
|
332
|
+
## Contributing
|
|
333
|
+
|
|
334
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md) for setup, validation, and PR expectations.
|
|
335
|
+
Community behavior is covered by [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).
|
|
336
|
+
|
|
310
337
|
## License
|
|
311
338
|
|
|
312
339
|
MIT
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "agentpack-cli"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.35"
|
|
4
4
|
description = "Local context engine for AI coding agents that ranks relevant repo files and builds compact task-focused context packs for Claude Code, Codex, Cursor, Windsurf, MCP, and CI workflows."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -69,6 +69,14 @@ markers = [
|
|
|
69
69
|
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
70
70
|
]
|
|
71
71
|
|
|
72
|
+
[tool.mypy]
|
|
73
|
+
python_version = "3.10"
|
|
74
|
+
files = [
|
|
75
|
+
"src/agentpack/core/e2e_benchmark.py",
|
|
76
|
+
"src/agentpack/core/modes.py",
|
|
77
|
+
"src/agentpack/router/models.py",
|
|
78
|
+
]
|
|
79
|
+
|
|
72
80
|
[tool.coverage.run]
|
|
73
81
|
source = [
|
|
74
82
|
"src/agentpack/core",
|
|
@@ -10,34 +10,45 @@ def detect_agent(root: Path) -> str:
|
|
|
10
10
|
Priority:
|
|
11
11
|
1. AGENTPACK_AGENT env var (explicit override)
|
|
12
12
|
2. CLAUDECODE / CLAUDE_CODE_ENTRYPOINT env → claude
|
|
13
|
-
3.
|
|
14
|
-
4.
|
|
15
|
-
5.
|
|
16
|
-
6.
|
|
17
|
-
7. .
|
|
18
|
-
8. .
|
|
19
|
-
9.
|
|
13
|
+
3. Codex env markers → codex
|
|
14
|
+
4. ANTIGRAVITY env var present → antigravity
|
|
15
|
+
5. Codex project markers → codex
|
|
16
|
+
6. .agent/skills/ dir exists → antigravity
|
|
17
|
+
7. GEMINI.md exists → antigravity
|
|
18
|
+
8. .cursor/ dir or .cursorrules exists → cursor
|
|
19
|
+
9. .windsurfrules exists → windsurf
|
|
20
|
+
10. Fallback → claude
|
|
20
21
|
"""
|
|
21
22
|
if override := os.environ.get("AGENTPACK_AGENT"):
|
|
22
23
|
return override
|
|
23
24
|
|
|
25
|
+
# Host env wins over repository files. Multi-agent repos can contain every
|
|
26
|
+
# rule file, so project artifacts are only fallback hints.
|
|
24
27
|
# Claude Code sets CLAUDECODE=1 and CLAUDE_CODE_ENTRYPOINT in its shell env
|
|
25
28
|
if os.environ.get("CLAUDECODE") or os.environ.get("CLAUDE_CODE_ENTRYPOINT"):
|
|
26
29
|
return "claude"
|
|
27
30
|
|
|
31
|
+
if (
|
|
32
|
+
os.environ.get("OPENAI_CODEX")
|
|
33
|
+
or os.environ.get("CODEX_ENVIRONMENT")
|
|
34
|
+
or os.environ.get("CODEX_SHELL")
|
|
35
|
+
or os.environ.get("CODEX_CI")
|
|
36
|
+
or os.environ.get("CODEX_THREAD_ID")
|
|
37
|
+
):
|
|
38
|
+
return "codex"
|
|
39
|
+
|
|
28
40
|
if os.environ.get("ANTIGRAVITY"):
|
|
29
41
|
return "antigravity"
|
|
30
42
|
|
|
43
|
+
if _has_codex_project_markers(root):
|
|
44
|
+
return "codex"
|
|
45
|
+
|
|
31
46
|
if (root / ".agent" / "skills").is_dir():
|
|
32
47
|
return "antigravity"
|
|
33
48
|
|
|
34
49
|
if (root / "GEMINI.md").exists():
|
|
35
50
|
return "antigravity"
|
|
36
51
|
|
|
37
|
-
# Codex sets OPENAI_CODEX=1 or CODEX_ENVIRONMENT in its shell env
|
|
38
|
-
if os.environ.get("OPENAI_CODEX") or os.environ.get("CODEX_ENVIRONMENT"):
|
|
39
|
-
return "codex"
|
|
40
|
-
|
|
41
52
|
if (root / ".cursor").is_dir() or (root / ".cursorrules").exists():
|
|
42
53
|
return "cursor"
|
|
43
54
|
|
|
@@ -45,3 +56,11 @@ def detect_agent(root: Path) -> str:
|
|
|
45
56
|
return "windsurf"
|
|
46
57
|
|
|
47
58
|
return "claude"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _has_codex_project_markers(root: Path) -> bool:
|
|
62
|
+
return (
|
|
63
|
+
(root / ".codex").is_dir()
|
|
64
|
+
or (root / ".codex-plugin" / "plugin.json").exists()
|
|
65
|
+
or (root / ".codexignore").exists()
|
|
66
|
+
)
|
|
@@ -27,7 +27,15 @@ def detect_workspace_roots(root: Path) -> list[str]:
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
def detect_workspace_dependency_edges(root: Path, workspace_roots: list[str]) -> dict[str, set[str]]:
|
|
30
|
-
"""Return workspace -> workspace dependency edges from package
|
|
30
|
+
"""Return workspace -> workspace dependency edges from common package manifests."""
|
|
31
|
+
edges: dict[str, set[str]] = {workspace: set() for workspace in workspace_roots}
|
|
32
|
+
_add_package_json_edges(root, workspace_roots, edges)
|
|
33
|
+
_add_cargo_edges(root, workspace_roots, edges)
|
|
34
|
+
_add_go_edges(root, workspace_roots, edges)
|
|
35
|
+
return edges
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _add_package_json_edges(root: Path, workspace_roots: list[str], edges: dict[str, set[str]]) -> None:
|
|
31
39
|
package_names: dict[str, str] = {}
|
|
32
40
|
for workspace in workspace_roots:
|
|
33
41
|
package_json = root / workspace / "package.json"
|
|
@@ -41,7 +49,6 @@ def detect_workspace_dependency_edges(root: Path, workspace_roots: list[str]) ->
|
|
|
41
49
|
if isinstance(name, str) and name:
|
|
42
50
|
package_names[name] = workspace
|
|
43
51
|
|
|
44
|
-
edges: dict[str, set[str]] = {workspace: set() for workspace in workspace_roots}
|
|
45
52
|
for workspace in workspace_roots:
|
|
46
53
|
package_json = root / workspace / "package.json"
|
|
47
54
|
if not package_json.exists():
|
|
@@ -59,7 +66,153 @@ def detect_workspace_dependency_edges(root: Path, workspace_roots: list[str]) ->
|
|
|
59
66
|
dep_workspace = package_names.get(name)
|
|
60
67
|
if dep_workspace and dep_workspace != workspace:
|
|
61
68
|
edges.setdefault(workspace, set()).add(dep_workspace)
|
|
62
|
-
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _add_cargo_edges(root: Path, workspace_roots: list[str], edges: dict[str, set[str]]) -> None:
|
|
72
|
+
for workspace in workspace_roots:
|
|
73
|
+
manifest = root / workspace / "Cargo.toml"
|
|
74
|
+
if not manifest.exists():
|
|
75
|
+
continue
|
|
76
|
+
try:
|
|
77
|
+
import tomllib
|
|
78
|
+
except ImportError:
|
|
79
|
+
import tomli as tomllib # type: ignore[no-redef]
|
|
80
|
+
try:
|
|
81
|
+
data = tomllib.loads(manifest.read_text(encoding="utf-8"))
|
|
82
|
+
except (OSError, tomllib.TOMLDecodeError):
|
|
83
|
+
continue
|
|
84
|
+
for section in ("dependencies", "dev-dependencies", "build-dependencies"):
|
|
85
|
+
raw = data.get(section)
|
|
86
|
+
if isinstance(raw, dict):
|
|
87
|
+
_add_cargo_section_edges(root, workspace, raw, workspace_roots, edges)
|
|
88
|
+
target = data.get("target")
|
|
89
|
+
if isinstance(target, dict):
|
|
90
|
+
for target_data in target.values():
|
|
91
|
+
if not isinstance(target_data, dict):
|
|
92
|
+
continue
|
|
93
|
+
for section in ("dependencies", "dev-dependencies", "build-dependencies"):
|
|
94
|
+
raw = target_data.get(section)
|
|
95
|
+
if isinstance(raw, dict):
|
|
96
|
+
_add_cargo_section_edges(root, workspace, raw, workspace_roots, edges)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _add_cargo_section_edges(
|
|
100
|
+
root: Path,
|
|
101
|
+
workspace: str,
|
|
102
|
+
dependencies: dict[str, object],
|
|
103
|
+
workspace_roots: list[str],
|
|
104
|
+
edges: dict[str, set[str]],
|
|
105
|
+
) -> None:
|
|
106
|
+
workspace_dir = root / workspace
|
|
107
|
+
for spec in dependencies.values():
|
|
108
|
+
if not isinstance(spec, dict):
|
|
109
|
+
continue
|
|
110
|
+
raw_path = spec.get("path")
|
|
111
|
+
if not isinstance(raw_path, str) or not raw_path:
|
|
112
|
+
continue
|
|
113
|
+
dep_workspace = _workspace_from_relative_path(root, workspace_dir / raw_path, workspace_roots)
|
|
114
|
+
if dep_workspace and dep_workspace != workspace:
|
|
115
|
+
edges.setdefault(workspace, set()).add(dep_workspace)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def _add_go_edges(root: Path, workspace_roots: list[str], edges: dict[str, set[str]]) -> None:
|
|
119
|
+
module_to_workspace: dict[str, str] = {}
|
|
120
|
+
replacements_by_workspace: dict[str, dict[str, str]] = {}
|
|
121
|
+
requires_by_workspace: dict[str, set[str]] = {}
|
|
122
|
+
for workspace in workspace_roots:
|
|
123
|
+
go_mod = root / workspace / "go.mod"
|
|
124
|
+
if not go_mod.exists():
|
|
125
|
+
continue
|
|
126
|
+
try:
|
|
127
|
+
text = go_mod.read_text(encoding="utf-8")
|
|
128
|
+
except OSError:
|
|
129
|
+
continue
|
|
130
|
+
module = _go_module_name(text)
|
|
131
|
+
if module:
|
|
132
|
+
module_to_workspace[module] = workspace
|
|
133
|
+
replacements_by_workspace[workspace] = _go_replacements(root, root / workspace, text, workspace_roots)
|
|
134
|
+
requires_by_workspace[workspace] = _go_requires(text)
|
|
135
|
+
|
|
136
|
+
for workspace, requires in requires_by_workspace.items():
|
|
137
|
+
replacements = replacements_by_workspace.get(workspace, {})
|
|
138
|
+
for module in requires:
|
|
139
|
+
dep_workspace = replacements.get(module) or module_to_workspace.get(module)
|
|
140
|
+
if dep_workspace and dep_workspace != workspace:
|
|
141
|
+
edges.setdefault(workspace, set()).add(dep_workspace)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def _go_module_name(text: str) -> str | None:
|
|
145
|
+
match = re.search(r"^module\s+(\S+)", text, flags=re.MULTILINE)
|
|
146
|
+
return match.group(1) if match else None
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _go_requires(text: str) -> set[str]:
|
|
150
|
+
modules: set[str] = set()
|
|
151
|
+
in_block = False
|
|
152
|
+
for raw in text.splitlines():
|
|
153
|
+
line = raw.strip()
|
|
154
|
+
if not line or line.startswith("//"):
|
|
155
|
+
continue
|
|
156
|
+
if line == "require (":
|
|
157
|
+
in_block = True
|
|
158
|
+
continue
|
|
159
|
+
if in_block and line == ")":
|
|
160
|
+
in_block = False
|
|
161
|
+
continue
|
|
162
|
+
if line.startswith("require "):
|
|
163
|
+
modules.add(line.split()[1])
|
|
164
|
+
elif in_block:
|
|
165
|
+
modules.add(line.split()[0])
|
|
166
|
+
return modules
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def _go_replacements(root: Path, workspace_dir: Path, text: str, workspace_roots: list[str]) -> dict[str, str]:
|
|
170
|
+
replacements: dict[str, str] = {}
|
|
171
|
+
in_block = False
|
|
172
|
+
for raw in text.splitlines():
|
|
173
|
+
line = raw.strip()
|
|
174
|
+
if not line or line.startswith("//"):
|
|
175
|
+
continue
|
|
176
|
+
if line == "replace (":
|
|
177
|
+
in_block = True
|
|
178
|
+
continue
|
|
179
|
+
if in_block and line == ")":
|
|
180
|
+
in_block = False
|
|
181
|
+
continue
|
|
182
|
+
if line.startswith("replace "):
|
|
183
|
+
_add_go_replacement(root, workspace_dir, line.removeprefix("replace ").strip(), workspace_roots, replacements)
|
|
184
|
+
elif in_block:
|
|
185
|
+
_add_go_replacement(root, workspace_dir, line, workspace_roots, replacements)
|
|
186
|
+
return replacements
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def _add_go_replacement(
|
|
190
|
+
root: Path,
|
|
191
|
+
workspace_dir: Path,
|
|
192
|
+
line: str,
|
|
193
|
+
workspace_roots: list[str],
|
|
194
|
+
replacements: dict[str, str],
|
|
195
|
+
) -> None:
|
|
196
|
+
if "=>" not in line:
|
|
197
|
+
return
|
|
198
|
+
left, right = [part.strip() for part in line.split("=>", 1)]
|
|
199
|
+
module = left.split()[0]
|
|
200
|
+
target = right.split()[0]
|
|
201
|
+
if not target.startswith((".", "/")):
|
|
202
|
+
return
|
|
203
|
+
target_path = Path(target)
|
|
204
|
+
candidate = target_path if target_path.is_absolute() else workspace_dir / target_path
|
|
205
|
+
dep_workspace = _workspace_from_relative_path(root, candidate, workspace_roots)
|
|
206
|
+
if dep_workspace:
|
|
207
|
+
replacements[module] = dep_workspace
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def _workspace_from_relative_path(root: Path, candidate: Path, workspace_roots: list[str]) -> str | None:
|
|
211
|
+
try:
|
|
212
|
+
rel = candidate.resolve().relative_to(root.resolve()).as_posix()
|
|
213
|
+
except (OSError, ValueError):
|
|
214
|
+
return None
|
|
215
|
+
return workspace_for_path(rel, workspace_roots)
|
|
63
216
|
|
|
64
217
|
|
|
65
218
|
def workspace_for_path(path: str, workspace_roots: list[str]) -> str | None:
|
|
@@ -97,6 +97,8 @@ _JS_EXPORTED_VAR = re.compile(
|
|
|
97
97
|
r"\bexport\s+(?:declare\s+)?(?:const|let|var)\s+(\w+)\s*(?::[^=;]+)?=",
|
|
98
98
|
)
|
|
99
99
|
_JS_CLASS = re.compile(r"(?:export\s+)?class\s+(\w+)")
|
|
100
|
+
_GO_FUNC = re.compile(r"^func\s+(?:\(([^)]+)\)\s*)?(\w+)\s*\(([^)]*)\)")
|
|
101
|
+
_GO_TYPE = re.compile(r"^type\s+(\w+)\s+(struct|interface)\b")
|
|
100
102
|
|
|
101
103
|
|
|
102
104
|
def extract_js_symbols(path: Path) -> list[Symbol]:
|
|
@@ -137,11 +139,73 @@ def extract_js_symbols(path: Path) -> list[Symbol]:
|
|
|
137
139
|
return symbols
|
|
138
140
|
|
|
139
141
|
|
|
142
|
+
def extract_go_symbols(path: Path) -> list[Symbol]:
|
|
143
|
+
try:
|
|
144
|
+
lines = path.read_text(errors="replace").splitlines()
|
|
145
|
+
except OSError:
|
|
146
|
+
return []
|
|
147
|
+
|
|
148
|
+
symbols: list[Symbol] = []
|
|
149
|
+
for i, line in enumerate(lines, 1):
|
|
150
|
+
stripped = line.strip()
|
|
151
|
+
func_match = _GO_FUNC.match(stripped)
|
|
152
|
+
if func_match:
|
|
153
|
+
receiver, name, _args = func_match.groups()
|
|
154
|
+
symbol_name = f"{_go_receiver_name(receiver)}.{name}" if receiver else name
|
|
155
|
+
symbols.append(
|
|
156
|
+
Symbol(
|
|
157
|
+
name=symbol_name,
|
|
158
|
+
kind="method" if receiver else "function",
|
|
159
|
+
start_line=i,
|
|
160
|
+
end_line=_go_symbol_end_line(lines, i),
|
|
161
|
+
signature=stripped[:120],
|
|
162
|
+
body="\n".join(lines[i - 1 : min(i + 49, len(lines))]),
|
|
163
|
+
)
|
|
164
|
+
)
|
|
165
|
+
continue
|
|
166
|
+
type_match = _GO_TYPE.match(stripped)
|
|
167
|
+
if type_match:
|
|
168
|
+
name, type_kind = type_match.groups()
|
|
169
|
+
symbols.append(
|
|
170
|
+
Symbol(
|
|
171
|
+
name=name,
|
|
172
|
+
kind="class",
|
|
173
|
+
start_line=i,
|
|
174
|
+
end_line=_go_symbol_end_line(lines, i),
|
|
175
|
+
signature=stripped[:120],
|
|
176
|
+
summary=f"Go {type_kind}",
|
|
177
|
+
body="\n".join(lines[i - 1 : min(i + 49, len(lines))]),
|
|
178
|
+
)
|
|
179
|
+
)
|
|
180
|
+
return symbols
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def _go_receiver_name(receiver: str | None) -> str:
|
|
184
|
+
if not receiver:
|
|
185
|
+
return ""
|
|
186
|
+
parts = receiver.replace("*", " ").split()
|
|
187
|
+
return parts[-1] if parts else receiver.strip()
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _go_symbol_end_line(lines: list[str], start_line: int) -> int:
|
|
191
|
+
depth = 0
|
|
192
|
+
saw_open = False
|
|
193
|
+
for index in range(start_line - 1, len(lines)):
|
|
194
|
+
line = lines[index]
|
|
195
|
+
depth += line.count("{") - line.count("}")
|
|
196
|
+
saw_open = saw_open or "{" in line
|
|
197
|
+
if saw_open and depth <= 0:
|
|
198
|
+
return index + 1
|
|
199
|
+
return start_line
|
|
200
|
+
|
|
201
|
+
|
|
140
202
|
def extract_symbols(path: Path, language: str | None) -> list[Symbol]:
|
|
141
203
|
if language == "python":
|
|
142
204
|
return extract_python_symbols(path)
|
|
143
205
|
if language in ("javascript", "typescript"):
|
|
144
206
|
return extract_js_symbols(path)
|
|
207
|
+
if language == "go":
|
|
208
|
+
return extract_go_symbols(path)
|
|
145
209
|
return []
|
|
146
210
|
|
|
147
211
|
|