agentpack-cli 0.1.28__tar.gz → 0.1.30__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.1.28 → agentpack_cli-0.1.30}/PKG-INFO +46 -9
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/README.md +45 -8
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/pyproject.toml +1 -1
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/__init__.py +1 -1
- agentpack_cli-0.1.30/src/agentpack/analysis/repo_map.py +94 -0
- agentpack_cli-0.1.30/src/agentpack/analysis/task_classifier.py +48 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/application/pack_service.py +154 -7
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/cli.py +40 -2
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/benchmark.py +24 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/doctor.py +26 -1
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/explain.py +43 -1
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/hook_cmd.py +20 -1
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/init.py +2 -36
- agentpack_cli-0.1.30/src/agentpack/commands/install.py +243 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/pack.py +9 -2
- agentpack_cli-0.1.30/src/agentpack/commands/repair.py +40 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/status.py +29 -1
- agentpack_cli-0.1.30/src/agentpack/core/context_pack.py +511 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/models.py +9 -1
- agentpack_cli-0.1.30/src/agentpack/integrations/agents.py +233 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/mcp_server.py +39 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/renderers/compact.py +14 -1
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/renderers/markdown.py +17 -3
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/summaries/offline.py +96 -2
- agentpack_cli-0.1.28/src/agentpack/commands/install.py +0 -287
- agentpack_cli-0.1.28/src/agentpack/core/context_pack.py +0 -250
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/.gitignore +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/LICENSE +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/adapters/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/adapters/antigravity.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/adapters/base.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/adapters/claude.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/adapters/codex.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/adapters/cursor.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/adapters/detect.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/adapters/generic.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/adapters/windsurf.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/dependency_graph.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/go_imports.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/java_imports.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/js_ts_imports.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/python_imports.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/ranking.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/rust_imports.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/symbols.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/analysis/tests.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/application/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/_shared.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/claude_cmd.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/diff.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/mcp_cmd.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/monitor.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/quickstart.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/scan.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/stats.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/summarize.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/commands/watch.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/bootstrap.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/cache.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/config.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/diff.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/git.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/git_hooks.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/global_install.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/ignore.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/merkle.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/redactor.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/scanner.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/snapshot.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/token_estimator.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/core/vscode_tasks.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/data/agentpack.md +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/installers/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/installers/antigravity.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/installers/claude.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/installers/codex.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/installers/cursor.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/installers/windsurf.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/integrations/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/integrations/git_hooks.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/integrations/global_install.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/integrations/vscode_tasks.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/renderers/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/renderers/receipts.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/session/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/session/state.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/src/agentpack/summaries/__init__.py +0 -0
- {agentpack_cli-0.1.28 → agentpack_cli-0.1.30}/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.1.
|
|
3
|
+
Version: 0.1.30
|
|
4
4
|
Summary: Task-aware context packing for AI coding agents — Claude, Cursor, Windsurf, Codex, and Antigravity
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -44,7 +44,7 @@ Description-Content-Type: text/markdown
|
|
|
44
44
|
[](https://opensource.org/licenses/MIT)
|
|
45
45
|
[](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml)
|
|
46
46
|
|
|
47
|
-
> **Status: alpha (v0.1.
|
|
47
|
+
> **Status: alpha (v0.1.30).** Works, tested, used in real sessions. Python and JavaScript/TypeScript are the best-supported languages. Not yet validated across a wide range of repos. API may change before 1.0.
|
|
48
48
|
>
|
|
49
49
|
> **Platform note:** macOS and Linux are fully supported. Windows support is not yet implemented (git hooks use POSIX shell; the Claude Code session hooks use `python3`/`rm -f`). Contributions welcome.
|
|
50
50
|
|
|
@@ -87,9 +87,9 @@ None of these scale. On a 200-file codebase, option 1 wastes 5–10 turns just o
|
|
|
87
87
|
AgentPack solves this with a one-time offline analysis pass:
|
|
88
88
|
|
|
89
89
|
1. **Scans your repo once** — builds a summary cache of every file (signatures, imports, responsibilities). No API calls. Takes a few seconds.
|
|
90
|
-
2. **On each task** — uses git diff, import graph traversal, keyword/concept expansion, implementation-role boosts, and cross-layer relatedness to rank every file.
|
|
91
|
-
3. **Packs a tight context document** — changed files get full content,
|
|
92
|
-
4. **Explains pack quality** — noisy-pack diagnostics, score receipts, token-precision metrics, and benchmark miss reports show when the pack is broad or missing expected files.
|
|
90
|
+
2. **On each task** — classifies the task, builds a compact semantic repo map, then uses git diff, import graph traversal, keyword/concept expansion, implementation-role boosts, and cross-layer relatedness to rank every file.
|
|
91
|
+
3. **Packs a tight context document** — changed files get full content when cheap, relevant diff hunks when large, symbol bodies or interface skeletons when tighter, and summaries only when useful.
|
|
92
|
+
4. **Explains pack quality** — noisy-pack diagnostics, score receipts, token-precision metrics, mode-mix reports, delta summaries, and benchmark miss reports show when the pack is broad or missing expected files.
|
|
93
93
|
5. **Stays current** — auto-repacks silently on commit, so next session starts fresh.
|
|
94
94
|
|
|
95
95
|
The result: your agent starts with a focused map of the relevant code. It should reduce blind exploration, not replace the agent's own file reads or your judgment.
|
|
@@ -135,6 +135,7 @@ Typical results on large repos:
|
|
|
135
135
|
| Pack time | Seconds on warm cache; first summarize pass is slower |
|
|
136
136
|
| Recall | Should be high for files you later edit; validate with `agentpack benchmark` |
|
|
137
137
|
| Precision | Often modest; summaries are cheap but can still add noise |
|
|
138
|
+
| Delta overhead | Hooks can emit a tiny changed-file delta instead of the full pack |
|
|
138
139
|
|
|
139
140
|
The compression number is easy to verify, but it is not the same as usefulness. The important question is: **did AgentPack include the files you actually needed?**
|
|
140
141
|
|
|
@@ -158,6 +159,8 @@ This runs FastAPI, Next.js, and mixed Python/TypeScript fixture tasks. It is a s
|
|
|
158
159
|
|
|
159
160
|
AgentPack is best described as a **map, not a compass**. It is already good at token reduction, changed-file inclusion, related tests, imports, configs, and common concepts like auth/cache/rate limiting. Recent ranking work also improves full-stack tasks by pulling service/controller/schema/handler files when UI routes or pages match the same domain.
|
|
160
161
|
|
|
162
|
+
The pack now includes a semantic repo map, task class, and "delta since last pack" section. Diff mode scores individual hunks against task keywords, so large dirty files spend tokens on the changed areas most likely to matter. Metrics also learn from previous noisy selections and gently downrank paths that repeatedly failed to predict later edits.
|
|
163
|
+
|
|
161
164
|
Known weak spot: recall can still be low on unfamiliar product domains or cross-language flows. Use `benchmark --misses` and `agentpack explain` when an expected file is absent. Those commands show whether the miss was caused by ignore rules, low score, summary floor, budget cutoff, or missing task signal.
|
|
162
165
|
|
|
163
166
|
### Observed author-run numbers
|
|
@@ -217,9 +220,9 @@ These are repo dumpers. They pack a repo (or subset) into a file and hand it to
|
|
|
217
220
|
|
|
218
221
|
What they don't do: decide what's relevant to *your task*. You specify the scope — files, globs, directories — and they package your decision. If you want "only the files that matter for fixing this auth bug", you have to figure that out yourself. On a 200-file repo, that's 80% of the work.
|
|
219
222
|
|
|
220
|
-
AgentPack does that selection automatically. You give it a task string; it uses git diff, import graph traversal, and keyword scoring to rank every file, then cuts to fit your token budget. You don't touch globs.
|
|
223
|
+
AgentPack does that selection automatically. You give it a task string; it uses task classification, git diff, import graph traversal, semantic summaries, and keyword scoring to rank every file, then cuts to fit your token budget. You don't touch globs.
|
|
221
224
|
|
|
222
|
-
The other difference: all three pack uniformly (full content or nothing). AgentPack is selective by inclusion mode — changed files
|
|
225
|
+
The other difference: all three pack uniformly (full content or nothing). AgentPack is selective by inclusion mode — changed files can be full source, relevant diff hunks, symbol bodies, interface skeletons, or summaries; unrelated files get dropped. A repomix dump of a 50k-token repo stays 50k tokens. An agentpack of the same repo for a specific task is typically 8k–20k.
|
|
223
226
|
|
|
224
227
|
**Use repomix/gitingest if:** you want to dump an entire small repo into a chat UI for a one-shot question. Zero setup, great for "explain this codebase."
|
|
225
228
|
|
|
@@ -448,6 +451,7 @@ Builds an offline summary of every file — no API calls, no network. Each summa
|
|
|
448
451
|
- What the file does and its responsibility
|
|
449
452
|
- Exported classes, functions, signatures with extracted bodies
|
|
450
453
|
- Import dependencies
|
|
454
|
+
- Likely side effects, public API shape, error paths, and test hints
|
|
451
455
|
|
|
452
456
|
Summaries are stored in `.agentpack/cache/` keyed by file hash. Only changed files are re-summarized on the next pack.
|
|
453
457
|
|
|
@@ -583,6 +587,8 @@ Diagnose your agentpack installation — checks CLI, git template hooks, git con
|
|
|
583
587
|
|
|
584
588
|
```bash
|
|
585
589
|
agentpack doctor
|
|
590
|
+
agentpack doctor --agent codex
|
|
591
|
+
agentpack doctor --agent all
|
|
586
592
|
```
|
|
587
593
|
|
|
588
594
|
Example output:
|
|
@@ -621,6 +627,7 @@ Some checks failed. Run the suggested commands above to fix.
|
|
|
621
627
|
```
|
|
622
628
|
|
|
623
629
|
The new checks in `doctor`:
|
|
630
|
+
- **Agent matrix audit**: `--agent all` checks Claude, Cursor, Windsurf, Codex, Antigravity, and Generic in one pass, including Codex `.codex/hooks.json` lifecycle hooks.
|
|
624
631
|
- **Local vs global hooks**: warns when Claude hooks are only in the per-project `.claude/settings.json` — context won't auto-inject in other repos
|
|
625
632
|
- **Slash command presence**: checks both local (`.claude/commands/`) and global (`~/.claude/commands/`) installations
|
|
626
633
|
- **Source checkout mismatch**: warns when you're inside an AgentPack source checkout but the `agentpack` executable imports the installed site-packages copy. Use `PYTHONPATH=src python -m agentpack.cli ...` or `pip install -e .` for local development.
|
|
@@ -661,7 +668,7 @@ Also installs the detected agent integration:
|
|
|
661
668
|
|
|
662
669
|
### `agentpack install`
|
|
663
670
|
|
|
664
|
-
|
|
671
|
+
Install or refresh one agent integration without reinitializing project state.
|
|
665
672
|
|
|
666
673
|
```bash
|
|
667
674
|
agentpack install # auto-detect IDE
|
|
@@ -676,6 +683,18 @@ All installs are idempotent — safe to re-run, merge with existing config, neve
|
|
|
676
683
|
|
|
677
684
|
---
|
|
678
685
|
|
|
686
|
+
### `agentpack repair`
|
|
687
|
+
|
|
688
|
+
Repair missing or drifted integration files. It uses the same installer contract as `init` and `install`, but is named for the "make this repo healthy again" workflow.
|
|
689
|
+
|
|
690
|
+
```bash
|
|
691
|
+
agentpack repair # repair auto-detected agent
|
|
692
|
+
agentpack repair --agent codex # AGENTS.md + .codex/hooks.json + git hooks
|
|
693
|
+
agentpack repair --agent all # repair every supported integration
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
---
|
|
697
|
+
|
|
679
698
|
### `agentpack summarize`
|
|
680
699
|
|
|
681
700
|
Build or refresh the offline summary cache. **No API calls, ever.**
|
|
@@ -726,6 +745,18 @@ Options:
|
|
|
726
745
|
|
|
727
746
|
`pack` also prints diagnostics when the pack looks noisy: very short task text, no changed files, mostly filename matches, mostly summaries, many symbol matches, weak summaries excluded by the score floor, or summaries excluded by the mode cap.
|
|
728
747
|
|
|
748
|
+
AgentPack uses budget-aware compression when building context:
|
|
749
|
+
|
|
750
|
+
| Include mode | Used for |
|
|
751
|
+
|--------------|----------|
|
|
752
|
+
| `full` | Small or highly relevant changed files |
|
|
753
|
+
| `diff` | Large changed files where the edit hunk is more useful than the whole file |
|
|
754
|
+
| `symbols` | Focused implementation bodies under budget pressure |
|
|
755
|
+
| `skeleton` | Imports plus public class/function signatures |
|
|
756
|
+
| `summary` | Lower-priority supporting files |
|
|
757
|
+
|
|
758
|
+
This keeps unrelated dirty files from consuming the whole context budget while preserving changed-file recall.
|
|
759
|
+
|
|
729
760
|
---
|
|
730
761
|
|
|
731
762
|
### `agentpack quickstart`
|
|
@@ -828,6 +859,7 @@ agentpack explain --task "fix auth session bug"
|
|
|
828
859
|
agentpack explain --task auto
|
|
829
860
|
agentpack explain --file src/auth/session.py # per-file score breakdown
|
|
830
861
|
agentpack explain --omitted # top-10 excluded files
|
|
862
|
+
agentpack explain --budget-plan # modes, token costs, value/token
|
|
831
863
|
```
|
|
832
864
|
|
|
833
865
|
Per-file breakdown (`--file`):
|
|
@@ -849,7 +881,7 @@ src/auth/session.py
|
|
|
849
881
|
symbols: create_session, revoke_session, validate_session
|
|
850
882
|
```
|
|
851
883
|
|
|
852
|
-
Use `--omitted` to see what was left out and why. Use `--file` when a file you expected isn't showing up.
|
|
884
|
+
Use `--omitted` to see what was left out and why. Use `--file` when a file you expected isn't showing up. Use `--budget-plan` to inspect how the compression planner spent the token budget.
|
|
853
885
|
|
|
854
886
|
---
|
|
855
887
|
|
|
@@ -969,11 +1001,14 @@ Check whether the context pack is stale.
|
|
|
969
1001
|
|
|
970
1002
|
```bash
|
|
971
1003
|
agentpack status
|
|
1004
|
+
agentpack status --deep
|
|
972
1005
|
# Context pack is up to date.
|
|
973
1006
|
# Task: fix auth session bug
|
|
974
1007
|
# Generated: 2026-04-29T12:00:00Z
|
|
975
1008
|
```
|
|
976
1009
|
|
|
1010
|
+
`--deep` also prints the active agent, CLI path, current task, and integration health for the detected agent.
|
|
1011
|
+
|
|
977
1012
|
---
|
|
978
1013
|
|
|
979
1014
|
### `agentpack diff`
|
|
@@ -1300,6 +1335,7 @@ src/agentpack/
|
|
|
1300
1335
|
antigravity.py # AntigravityInstaller: GEMINI.md + auto-repack
|
|
1301
1336
|
|
|
1302
1337
|
integrations/ # system/tool integration (not core domain)
|
|
1338
|
+
agents.py # shared agent install/check contract
|
|
1303
1339
|
git_hooks.py # install/remove .git/hooks post-commit/merge/checkout
|
|
1304
1340
|
vscode_tasks.py # install/remove .vscode/tasks.json entries
|
|
1305
1341
|
global_install.py # global: git template hooks + shell rc hook
|
|
@@ -1316,6 +1352,7 @@ src/agentpack/
|
|
|
1316
1352
|
commands/ # CLI only — parse args, call services/installers
|
|
1317
1353
|
pack.py # agentpack pack → PackService.run()
|
|
1318
1354
|
install.py # agentpack install / global-install → installers/
|
|
1355
|
+
repair.py # agentpack repair → shared integration repair
|
|
1319
1356
|
init.py # agentpack init
|
|
1320
1357
|
quickstart.py # agentpack quickstart — guided first-run commands
|
|
1321
1358
|
scan.py # agentpack scan
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
[](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml)
|
|
7
7
|
|
|
8
|
-
> **Status: alpha (v0.1.
|
|
8
|
+
> **Status: alpha (v0.1.30).** Works, tested, used in real sessions. Python and JavaScript/TypeScript are the best-supported languages. Not yet validated across a wide range of repos. API may change before 1.0.
|
|
9
9
|
>
|
|
10
10
|
> **Platform note:** macOS and Linux are fully supported. Windows support is not yet implemented (git hooks use POSIX shell; the Claude Code session hooks use `python3`/`rm -f`). Contributions welcome.
|
|
11
11
|
|
|
@@ -48,9 +48,9 @@ None of these scale. On a 200-file codebase, option 1 wastes 5–10 turns just o
|
|
|
48
48
|
AgentPack solves this with a one-time offline analysis pass:
|
|
49
49
|
|
|
50
50
|
1. **Scans your repo once** — builds a summary cache of every file (signatures, imports, responsibilities). No API calls. Takes a few seconds.
|
|
51
|
-
2. **On each task** — uses git diff, import graph traversal, keyword/concept expansion, implementation-role boosts, and cross-layer relatedness to rank every file.
|
|
52
|
-
3. **Packs a tight context document** — changed files get full content,
|
|
53
|
-
4. **Explains pack quality** — noisy-pack diagnostics, score receipts, token-precision metrics, and benchmark miss reports show when the pack is broad or missing expected files.
|
|
51
|
+
2. **On each task** — classifies the task, builds a compact semantic repo map, then uses git diff, import graph traversal, keyword/concept expansion, implementation-role boosts, and cross-layer relatedness to rank every file.
|
|
52
|
+
3. **Packs a tight context document** — changed files get full content when cheap, relevant diff hunks when large, symbol bodies or interface skeletons when tighter, and summaries only when useful.
|
|
53
|
+
4. **Explains pack quality** — noisy-pack diagnostics, score receipts, token-precision metrics, mode-mix reports, delta summaries, and benchmark miss reports show when the pack is broad or missing expected files.
|
|
54
54
|
5. **Stays current** — auto-repacks silently on commit, so next session starts fresh.
|
|
55
55
|
|
|
56
56
|
The result: your agent starts with a focused map of the relevant code. It should reduce blind exploration, not replace the agent's own file reads or your judgment.
|
|
@@ -96,6 +96,7 @@ Typical results on large repos:
|
|
|
96
96
|
| Pack time | Seconds on warm cache; first summarize pass is slower |
|
|
97
97
|
| Recall | Should be high for files you later edit; validate with `agentpack benchmark` |
|
|
98
98
|
| Precision | Often modest; summaries are cheap but can still add noise |
|
|
99
|
+
| Delta overhead | Hooks can emit a tiny changed-file delta instead of the full pack |
|
|
99
100
|
|
|
100
101
|
The compression number is easy to verify, but it is not the same as usefulness. The important question is: **did AgentPack include the files you actually needed?**
|
|
101
102
|
|
|
@@ -119,6 +120,8 @@ This runs FastAPI, Next.js, and mixed Python/TypeScript fixture tasks. It is a s
|
|
|
119
120
|
|
|
120
121
|
AgentPack is best described as a **map, not a compass**. It is already good at token reduction, changed-file inclusion, related tests, imports, configs, and common concepts like auth/cache/rate limiting. Recent ranking work also improves full-stack tasks by pulling service/controller/schema/handler files when UI routes or pages match the same domain.
|
|
121
122
|
|
|
123
|
+
The pack now includes a semantic repo map, task class, and "delta since last pack" section. Diff mode scores individual hunks against task keywords, so large dirty files spend tokens on the changed areas most likely to matter. Metrics also learn from previous noisy selections and gently downrank paths that repeatedly failed to predict later edits.
|
|
124
|
+
|
|
122
125
|
Known weak spot: recall can still be low on unfamiliar product domains or cross-language flows. Use `benchmark --misses` and `agentpack explain` when an expected file is absent. Those commands show whether the miss was caused by ignore rules, low score, summary floor, budget cutoff, or missing task signal.
|
|
123
126
|
|
|
124
127
|
### Observed author-run numbers
|
|
@@ -178,9 +181,9 @@ These are repo dumpers. They pack a repo (or subset) into a file and hand it to
|
|
|
178
181
|
|
|
179
182
|
What they don't do: decide what's relevant to *your task*. You specify the scope — files, globs, directories — and they package your decision. If you want "only the files that matter for fixing this auth bug", you have to figure that out yourself. On a 200-file repo, that's 80% of the work.
|
|
180
183
|
|
|
181
|
-
AgentPack does that selection automatically. You give it a task string; it uses git diff, import graph traversal, and keyword scoring to rank every file, then cuts to fit your token budget. You don't touch globs.
|
|
184
|
+
AgentPack does that selection automatically. You give it a task string; it uses task classification, git diff, import graph traversal, semantic summaries, and keyword scoring to rank every file, then cuts to fit your token budget. You don't touch globs.
|
|
182
185
|
|
|
183
|
-
The other difference: all three pack uniformly (full content or nothing). AgentPack is selective by inclusion mode — changed files
|
|
186
|
+
The other difference: all three pack uniformly (full content or nothing). AgentPack is selective by inclusion mode — changed files can be full source, relevant diff hunks, symbol bodies, interface skeletons, or summaries; unrelated files get dropped. A repomix dump of a 50k-token repo stays 50k tokens. An agentpack of the same repo for a specific task is typically 8k–20k.
|
|
184
187
|
|
|
185
188
|
**Use repomix/gitingest if:** you want to dump an entire small repo into a chat UI for a one-shot question. Zero setup, great for "explain this codebase."
|
|
186
189
|
|
|
@@ -409,6 +412,7 @@ Builds an offline summary of every file — no API calls, no network. Each summa
|
|
|
409
412
|
- What the file does and its responsibility
|
|
410
413
|
- Exported classes, functions, signatures with extracted bodies
|
|
411
414
|
- Import dependencies
|
|
415
|
+
- Likely side effects, public API shape, error paths, and test hints
|
|
412
416
|
|
|
413
417
|
Summaries are stored in `.agentpack/cache/` keyed by file hash. Only changed files are re-summarized on the next pack.
|
|
414
418
|
|
|
@@ -544,6 +548,8 @@ Diagnose your agentpack installation — checks CLI, git template hooks, git con
|
|
|
544
548
|
|
|
545
549
|
```bash
|
|
546
550
|
agentpack doctor
|
|
551
|
+
agentpack doctor --agent codex
|
|
552
|
+
agentpack doctor --agent all
|
|
547
553
|
```
|
|
548
554
|
|
|
549
555
|
Example output:
|
|
@@ -582,6 +588,7 @@ Some checks failed. Run the suggested commands above to fix.
|
|
|
582
588
|
```
|
|
583
589
|
|
|
584
590
|
The new checks in `doctor`:
|
|
591
|
+
- **Agent matrix audit**: `--agent all` checks Claude, Cursor, Windsurf, Codex, Antigravity, and Generic in one pass, including Codex `.codex/hooks.json` lifecycle hooks.
|
|
585
592
|
- **Local vs global hooks**: warns when Claude hooks are only in the per-project `.claude/settings.json` — context won't auto-inject in other repos
|
|
586
593
|
- **Slash command presence**: checks both local (`.claude/commands/`) and global (`~/.claude/commands/`) installations
|
|
587
594
|
- **Source checkout mismatch**: warns when you're inside an AgentPack source checkout but the `agentpack` executable imports the installed site-packages copy. Use `PYTHONPATH=src python -m agentpack.cli ...` or `pip install -e .` for local development.
|
|
@@ -622,7 +629,7 @@ Also installs the detected agent integration:
|
|
|
622
629
|
|
|
623
630
|
### `agentpack install`
|
|
624
631
|
|
|
625
|
-
|
|
632
|
+
Install or refresh one agent integration without reinitializing project state.
|
|
626
633
|
|
|
627
634
|
```bash
|
|
628
635
|
agentpack install # auto-detect IDE
|
|
@@ -637,6 +644,18 @@ All installs are idempotent — safe to re-run, merge with existing config, neve
|
|
|
637
644
|
|
|
638
645
|
---
|
|
639
646
|
|
|
647
|
+
### `agentpack repair`
|
|
648
|
+
|
|
649
|
+
Repair missing or drifted integration files. It uses the same installer contract as `init` and `install`, but is named for the "make this repo healthy again" workflow.
|
|
650
|
+
|
|
651
|
+
```bash
|
|
652
|
+
agentpack repair # repair auto-detected agent
|
|
653
|
+
agentpack repair --agent codex # AGENTS.md + .codex/hooks.json + git hooks
|
|
654
|
+
agentpack repair --agent all # repair every supported integration
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
---
|
|
658
|
+
|
|
640
659
|
### `agentpack summarize`
|
|
641
660
|
|
|
642
661
|
Build or refresh the offline summary cache. **No API calls, ever.**
|
|
@@ -687,6 +706,18 @@ Options:
|
|
|
687
706
|
|
|
688
707
|
`pack` also prints diagnostics when the pack looks noisy: very short task text, no changed files, mostly filename matches, mostly summaries, many symbol matches, weak summaries excluded by the score floor, or summaries excluded by the mode cap.
|
|
689
708
|
|
|
709
|
+
AgentPack uses budget-aware compression when building context:
|
|
710
|
+
|
|
711
|
+
| Include mode | Used for |
|
|
712
|
+
|--------------|----------|
|
|
713
|
+
| `full` | Small or highly relevant changed files |
|
|
714
|
+
| `diff` | Large changed files where the edit hunk is more useful than the whole file |
|
|
715
|
+
| `symbols` | Focused implementation bodies under budget pressure |
|
|
716
|
+
| `skeleton` | Imports plus public class/function signatures |
|
|
717
|
+
| `summary` | Lower-priority supporting files |
|
|
718
|
+
|
|
719
|
+
This keeps unrelated dirty files from consuming the whole context budget while preserving changed-file recall.
|
|
720
|
+
|
|
690
721
|
---
|
|
691
722
|
|
|
692
723
|
### `agentpack quickstart`
|
|
@@ -789,6 +820,7 @@ agentpack explain --task "fix auth session bug"
|
|
|
789
820
|
agentpack explain --task auto
|
|
790
821
|
agentpack explain --file src/auth/session.py # per-file score breakdown
|
|
791
822
|
agentpack explain --omitted # top-10 excluded files
|
|
823
|
+
agentpack explain --budget-plan # modes, token costs, value/token
|
|
792
824
|
```
|
|
793
825
|
|
|
794
826
|
Per-file breakdown (`--file`):
|
|
@@ -810,7 +842,7 @@ src/auth/session.py
|
|
|
810
842
|
symbols: create_session, revoke_session, validate_session
|
|
811
843
|
```
|
|
812
844
|
|
|
813
|
-
Use `--omitted` to see what was left out and why. Use `--file` when a file you expected isn't showing up.
|
|
845
|
+
Use `--omitted` to see what was left out and why. Use `--file` when a file you expected isn't showing up. Use `--budget-plan` to inspect how the compression planner spent the token budget.
|
|
814
846
|
|
|
815
847
|
---
|
|
816
848
|
|
|
@@ -930,11 +962,14 @@ Check whether the context pack is stale.
|
|
|
930
962
|
|
|
931
963
|
```bash
|
|
932
964
|
agentpack status
|
|
965
|
+
agentpack status --deep
|
|
933
966
|
# Context pack is up to date.
|
|
934
967
|
# Task: fix auth session bug
|
|
935
968
|
# Generated: 2026-04-29T12:00:00Z
|
|
936
969
|
```
|
|
937
970
|
|
|
971
|
+
`--deep` also prints the active agent, CLI path, current task, and integration health for the detected agent.
|
|
972
|
+
|
|
938
973
|
---
|
|
939
974
|
|
|
940
975
|
### `agentpack diff`
|
|
@@ -1261,6 +1296,7 @@ src/agentpack/
|
|
|
1261
1296
|
antigravity.py # AntigravityInstaller: GEMINI.md + auto-repack
|
|
1262
1297
|
|
|
1263
1298
|
integrations/ # system/tool integration (not core domain)
|
|
1299
|
+
agents.py # shared agent install/check contract
|
|
1264
1300
|
git_hooks.py # install/remove .git/hooks post-commit/merge/checkout
|
|
1265
1301
|
vscode_tasks.py # install/remove .vscode/tasks.json entries
|
|
1266
1302
|
global_install.py # global: git template hooks + shell rc hook
|
|
@@ -1277,6 +1313,7 @@ src/agentpack/
|
|
|
1277
1313
|
commands/ # CLI only — parse args, call services/installers
|
|
1278
1314
|
pack.py # agentpack pack → PackService.run()
|
|
1279
1315
|
install.py # agentpack install / global-install → installers/
|
|
1316
|
+
repair.py # agentpack repair → shared integration repair
|
|
1280
1317
|
init.py # agentpack init
|
|
1281
1318
|
quickstart.py # agentpack quickstart — guided first-run commands
|
|
1282
1319
|
scan.py # agentpack scan
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections import defaultdict
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from agentpack.core.models import DependencyGraph, FileInfo
|
|
7
|
+
from agentpack.core.token_estimator import estimate_tokens
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def build_repo_map(
|
|
11
|
+
*,
|
|
12
|
+
files: list[FileInfo],
|
|
13
|
+
scored: list[tuple[FileInfo, float, list[str]]],
|
|
14
|
+
summaries: dict[str, Any],
|
|
15
|
+
dep_graph: DependencyGraph,
|
|
16
|
+
changed_paths: set[str],
|
|
17
|
+
budget_tokens: int = 600,
|
|
18
|
+
) -> str:
|
|
19
|
+
"""Return a compact semantic map of the repo around the current task."""
|
|
20
|
+
if budget_tokens <= 0 or not files:
|
|
21
|
+
return ""
|
|
22
|
+
|
|
23
|
+
file_scores = {fi.path: score for fi, score, _reasons in scored}
|
|
24
|
+
groups: dict[str, list[FileInfo]] = defaultdict(list)
|
|
25
|
+
for fi in files:
|
|
26
|
+
groups[_group_name(fi.path)].append(fi)
|
|
27
|
+
|
|
28
|
+
group_rows: list[tuple[float, str, list[FileInfo]]] = []
|
|
29
|
+
for group, members in groups.items():
|
|
30
|
+
score = max((file_scores.get(member.path, 0.0) for member in members), default=0.0)
|
|
31
|
+
if any(member.path in changed_paths for member in members):
|
|
32
|
+
score += 60
|
|
33
|
+
group_rows.append((score, group, members))
|
|
34
|
+
|
|
35
|
+
lines = ["Task repo map:"]
|
|
36
|
+
for _score, group, members in sorted(group_rows, reverse=True)[:8]:
|
|
37
|
+
changed_count = sum(1 for member in members if member.path in changed_paths)
|
|
38
|
+
role = _group_role(members, summaries)
|
|
39
|
+
suffix = f"; {changed_count} changed" if changed_count else ""
|
|
40
|
+
candidate = f"- {group}: {len(members)} files; {role}{suffix}"
|
|
41
|
+
if _fits(lines, candidate, budget_tokens):
|
|
42
|
+
lines.append(candidate)
|
|
43
|
+
|
|
44
|
+
top_members = sorted(members, key=lambda member: file_scores.get(member.path, 0.0), reverse=True)[:4]
|
|
45
|
+
for member in top_members:
|
|
46
|
+
summary = summaries.get(member.path) or {}
|
|
47
|
+
label = summary.get("role") or _short_summary(summary.get("summary", ""))
|
|
48
|
+
deps = dep_graph.get(member.path)
|
|
49
|
+
rel = ""
|
|
50
|
+
if deps.imports or deps.imported_by:
|
|
51
|
+
rel = f" deps:{len(deps.imports)}/{len(deps.imported_by)}"
|
|
52
|
+
mark = " changed" if member.path in changed_paths else ""
|
|
53
|
+
candidate = f" - {member.path}: {label or 'source file'}{rel}{mark}"
|
|
54
|
+
if not _fits(lines, candidate, budget_tokens):
|
|
55
|
+
return "\n".join(lines)
|
|
56
|
+
lines.append(candidate)
|
|
57
|
+
|
|
58
|
+
return "\n".join(lines) if len(lines) > 1 else ""
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _group_name(path: str) -> str:
|
|
62
|
+
parts = [part for part in path.split("/") if part]
|
|
63
|
+
if not parts:
|
|
64
|
+
return "."
|
|
65
|
+
if parts[0] in {"src", "app", "lib", "tests", "test"} and len(parts) > 1:
|
|
66
|
+
return "/".join(parts[:2])
|
|
67
|
+
return parts[0]
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _group_role(members: list[FileInfo], summaries: dict[str, Any]) -> str:
|
|
71
|
+
roles: dict[str, int] = {}
|
|
72
|
+
for member in members:
|
|
73
|
+
summary = summaries.get(member.path) or {}
|
|
74
|
+
role = summary.get("role") or _short_summary(summary.get("summary", ""))
|
|
75
|
+
if role:
|
|
76
|
+
roles[role] = roles.get(role, 0) + 1
|
|
77
|
+
if not roles:
|
|
78
|
+
languages = sorted({member.language or "unknown" for member in members})
|
|
79
|
+
return ", ".join(languages[:3])
|
|
80
|
+
return max(roles.items(), key=lambda item: item[1])[0]
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _short_summary(summary: str) -> str:
|
|
84
|
+
for line in summary.splitlines():
|
|
85
|
+
clean = line.strip("- ").strip()
|
|
86
|
+
if clean.lower().startswith("likely responsibility:"):
|
|
87
|
+
return clean.split(":", 1)[1].strip()
|
|
88
|
+
if clean.lower().startswith("role:"):
|
|
89
|
+
return clean.split(":", 1)[1].strip()
|
|
90
|
+
return ""
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _fits(lines: list[str], candidate: str, budget_tokens: int) -> bool:
|
|
94
|
+
return estimate_tokens("\n".join([*lines, candidate])) <= budget_tokens
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(frozen=True)
|
|
8
|
+
class TaskClassification:
|
|
9
|
+
kind: str
|
|
10
|
+
confidence: float
|
|
11
|
+
signals: list[str]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
_TASK_PATTERNS: list[tuple[str, tuple[str, ...]]] = [
|
|
15
|
+
("bugfix", ("fix", "bug", "broken", "regression", "debug", "issue", "error", "failing", "fail")),
|
|
16
|
+
("refactor", ("refactor", "cleanup", "clean", "simplify", "restructure", "rename")),
|
|
17
|
+
("docs", ("readme", "doc", "docs", "documentation", "changelog", "guide")),
|
|
18
|
+
("release", ("release", "publish", "version", "bump", "tag", "pypi", "npm")),
|
|
19
|
+
("test", ("test", "tests", "coverage", "pytest", "jest", "spec", "eval", "benchmark")),
|
|
20
|
+
("ui", ("ui", "frontend", "component", "page", "screen", "css", "style", "layout")),
|
|
21
|
+
("infra", ("ci", "workflow", "docker", "deploy", "build", "package", "hook", "mcp")),
|
|
22
|
+
("audit", ("audit", "review", "inspect", "scan", "verify", "doctor", "status")),
|
|
23
|
+
("feature", ("add", "implement", "create", "support", "enable", "new")),
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def classify_task(task: str) -> TaskClassification:
|
|
28
|
+
"""Classify a task into a coarse bucket for ranking/context hints."""
|
|
29
|
+
text = task.lower()
|
|
30
|
+
words = set(re.findall(r"[a-z0-9][a-z0-9_-]*", text))
|
|
31
|
+
scores: dict[str, tuple[int, list[str]]] = {}
|
|
32
|
+
for kind, signals in _TASK_PATTERNS:
|
|
33
|
+
hits = [signal for signal in signals if signal in words or signal in text]
|
|
34
|
+
if hits:
|
|
35
|
+
scores[kind] = (len(hits), hits[:5])
|
|
36
|
+
|
|
37
|
+
if not scores:
|
|
38
|
+
return TaskClassification(kind="general", confidence=0.2, signals=[])
|
|
39
|
+
|
|
40
|
+
kind, (count, signals) = max(scores.items(), key=lambda item: (item[1][0], _priority(item[0])))
|
|
41
|
+
total_hits = sum(value[0] for value in scores.values())
|
|
42
|
+
confidence = min(0.95, 0.45 + (count / max(1, total_hits)) * 0.45)
|
|
43
|
+
return TaskClassification(kind=kind, confidence=round(confidence, 2), signals=signals)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _priority(kind: str) -> int:
|
|
47
|
+
order = [name for name, _signals in _TASK_PATTERNS]
|
|
48
|
+
return len(order) - order.index(kind)
|