agentpack-cli 0.1.8__tar.gz → 0.1.10__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.
Files changed (89) hide show
  1. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/PKG-INFO +50 -19
  2. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/README.md +49 -13
  3. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/pyproject.toml +4 -8
  4. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/__init__.py +1 -1
  5. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/application/pack_service.py +1 -2
  6. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/benchmark.py +0 -1
  7. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/explain.py +0 -2
  8. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/pack.py +2 -5
  9. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/session.py +0 -1
  10. agentpack_cli-0.1.10/src/agentpack/commands/summarize.py +51 -0
  11. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/watch.py +2 -1
  12. agentpack_cli-0.1.10/src/agentpack/mcp_server.py +195 -0
  13. agentpack_cli-0.1.10/src/agentpack/summaries/base.py +93 -0
  14. agentpack_cli-0.1.10/src/agentpack/summaries/offline.py +148 -0
  15. agentpack_cli-0.1.8/src/agentpack/commands/summarize.py +0 -64
  16. agentpack_cli-0.1.8/src/agentpack/mcp_server.py +0 -119
  17. agentpack_cli-0.1.8/src/agentpack/summaries/base.py +0 -42
  18. agentpack_cli-0.1.8/src/agentpack/summaries/llm.py +0 -100
  19. agentpack_cli-0.1.8/src/agentpack/summaries/offline.py +0 -97
  20. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/.gitignore +0 -0
  21. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/LICENSE +0 -0
  22. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/adapters/__init__.py +0 -0
  23. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/adapters/antigravity.py +0 -0
  24. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/adapters/base.py +0 -0
  25. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/adapters/claude.py +0 -0
  26. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/adapters/codex.py +0 -0
  27. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/adapters/cursor.py +0 -0
  28. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/adapters/detect.py +0 -0
  29. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/adapters/generic.py +0 -0
  30. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/adapters/windsurf.py +0 -0
  31. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/__init__.py +0 -0
  32. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/dependency_graph.py +0 -0
  33. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/go_imports.py +0 -0
  34. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/java_imports.py +0 -0
  35. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/js_ts_imports.py +0 -0
  36. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/python_imports.py +0 -0
  37. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/ranking.py +0 -0
  38. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/rust_imports.py +0 -0
  39. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/symbols.py +0 -0
  40. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/analysis/tests.py +0 -0
  41. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/application/__init__.py +0 -0
  42. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/cli.py +0 -0
  43. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/__init__.py +0 -0
  44. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/_shared.py +0 -0
  45. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/claude_cmd.py +0 -0
  46. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/diff.py +0 -0
  47. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/doctor.py +0 -0
  48. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/init.py +0 -0
  49. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/install.py +0 -0
  50. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/mcp_cmd.py +0 -0
  51. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/monitor.py +0 -0
  52. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/scan.py +0 -0
  53. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/stats.py +0 -0
  54. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/commands/status.py +0 -0
  55. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/__init__.py +0 -0
  56. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/bootstrap.py +0 -0
  57. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/cache.py +0 -0
  58. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/config.py +0 -0
  59. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/context_pack.py +0 -0
  60. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/diff.py +0 -0
  61. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/git.py +0 -0
  62. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/git_hooks.py +0 -0
  63. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/global_install.py +0 -0
  64. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/ignore.py +0 -0
  65. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/merkle.py +0 -0
  66. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/models.py +0 -0
  67. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/redactor.py +0 -0
  68. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/scanner.py +0 -0
  69. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/snapshot.py +0 -0
  70. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/token_estimator.py +0 -0
  71. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/core/vscode_tasks.py +0 -0
  72. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/data/agentpack.md +0 -0
  73. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/installers/__init__.py +0 -0
  74. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/installers/antigravity.py +0 -0
  75. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/installers/claude.py +0 -0
  76. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/installers/codex.py +0 -0
  77. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/installers/cursor.py +0 -0
  78. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/installers/windsurf.py +0 -0
  79. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/integrations/__init__.py +0 -0
  80. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/integrations/git_hooks.py +0 -0
  81. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/integrations/global_install.py +0 -0
  82. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/integrations/vscode_tasks.py +0 -0
  83. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/renderers/__init__.py +0 -0
  84. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/renderers/compact.py +0 -0
  85. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/renderers/markdown.py +0 -0
  86. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/renderers/receipts.py +0 -0
  87. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/session/__init__.py +0 -0
  88. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/session/state.py +0 -0
  89. {agentpack_cli-0.1.8 → agentpack_cli-0.1.10}/src/agentpack/summaries/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentpack-cli
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Summary: Token-aware context packing for AI coding agents — Claude, Cursor, Windsurf, and Codex
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -23,18 +23,13 @@ Requires-Dist: tomli-w>=1.0.0
23
23
  Requires-Dist: tomli>=2.0.0; python_version < '3.11'
24
24
  Requires-Dist: typer>=0.12.0
25
25
  Provides-Extra: all
26
- Requires-Dist: anthropic>=0.39.0; extra == 'all'
27
26
  Requires-Dist: mcp>=1.0.0; extra == 'all'
28
- Requires-Dist: openai>=1.0.0; extra == 'all'
29
27
  Requires-Dist: watchdog>=4.0.0; extra == 'all'
30
28
  Provides-Extra: dev
31
29
  Requires-Dist: mypy; extra == 'dev'
32
30
  Requires-Dist: pytest; extra == 'dev'
33
31
  Requires-Dist: ruff; extra == 'dev'
34
32
  Requires-Dist: tomli>=2.0.0; (python_version < '3.11') and extra == 'dev'
35
- Provides-Extra: llm
36
- Requires-Dist: anthropic>=0.39.0; extra == 'llm'
37
- Requires-Dist: openai>=1.0.0; extra == 'llm'
38
33
  Provides-Extra: mcp
39
34
  Requires-Dist: mcp>=1.0.0; extra == 'mcp'
40
35
  Provides-Extra: watch
@@ -48,7 +43,7 @@ Description-Content-Type: text/markdown
48
43
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
49
44
  [![CI](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml/badge.svg)](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml)
50
45
 
51
- > **Status: alpha (v0.1.5).** 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.
46
+ > **Status: alpha (v0.1.9).** 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.
52
47
  >
53
48
  > **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.
54
49
 
@@ -598,14 +593,14 @@ All installs are idempotent — safe to re-run, merge with existing config, neve
598
593
 
599
594
  ### `agentpack summarize`
600
595
 
601
- Build or refresh the offline summary cache. **No API calls.**
596
+ Build or refresh the offline summary cache. **No API calls, ever.**
602
597
 
603
598
  ```bash
604
599
  agentpack summarize # build summaries for all files not yet cached
605
600
  agentpack summarize --refresh # force rebuild all
606
601
  ```
607
602
 
608
- Run this once after `init`. After that, pack automatically rebuilds summaries only for changed files.
603
+ Summaries are built with parallel AST/regex analysis — no network, no tokens spent. Run once after `init`. After that, pack automatically rebuilds summaries only for changed files (hash-keyed cache).
609
604
 
610
605
  ---
611
606
 
@@ -635,6 +630,7 @@ Options:
635
630
  | `--since` | — | Only include files changed since this git ref |
636
631
  | `--session` | off | Re-pack on every file change (watch mode) |
637
632
  | `--refresh` | off | Force rebuild summaries before packing |
633
+ | `--budget` | 25000 | Token budget override |
638
634
 
639
635
  **Budget modes:**
640
636
 
@@ -699,6 +695,47 @@ Requires an initialized project (`agentpack init`). Refreshes context, prints th
699
695
 
700
696
  ---
701
697
 
698
+ ### `agentpack mcp`
699
+
700
+ Run AgentPack as an MCP server — exposes context packing as tools that Claude Code (and any MCP-compatible agent) can call directly.
701
+
702
+ ```bash
703
+ pip install "agentpack-cli[mcp]"
704
+ agentpack mcp
705
+ ```
706
+
707
+ Register in Claude Code settings (`~/.claude/settings.json`):
708
+
709
+ ```json
710
+ {
711
+ "mcpServers": {
712
+ "agentpack": {
713
+ "command": "agentpack",
714
+ "args": ["mcp"]
715
+ }
716
+ }
717
+ }
718
+ ```
719
+
720
+ **Tools exposed:**
721
+
722
+ | Tool | Description |
723
+ |---|---|
724
+ | `pack_context(task, mode, budget, max_tokens)` | Generate a ranked context pack for a task. Returns packed markdown, truncated to `max_tokens` (default 20,000). |
725
+ | `get_context()` | Return the latest pre-built pack instantly (no repack). Prepends a freshness/staleness header so you know if it's stale. |
726
+ | `refresh()` | Refresh using the current `task.md` or git-inferred task. |
727
+
728
+ **Staleness detection:** `get_context()` compares the snapshot hash from when the pack was built against the current repo snapshot. If files changed since last pack, it prepends:
729
+ ```
730
+ > **Stale context** — repo changed since last pack (generated: ...). Run pack_context() to refresh.
731
+ ```
732
+
733
+ **Smart truncation:** `pack_context()` keeps headers intact and trims file content blocks to fit the token budget, appending a note about how many files were omitted.
734
+
735
+ Zero API calls — all analysis is offline. Summary cache keyed by file hash: cold run parallelises AST parsing across CPU cores; warm cache hits are instant.
736
+
737
+ ---
738
+
702
739
  ### `agentpack explain`
703
740
 
704
741
  Debug file selection — show which files would be selected, why, and what was excluded — without writing a context pack.
@@ -920,10 +957,6 @@ include_tests = true
920
957
  include_configs = true
921
958
  include_receipts = true
922
959
 
923
- [summary]
924
- provider = "offline"
925
- schema_version = 1
926
-
927
960
  [agents.claude]
928
961
  output = ".agentpack/context.claude.md"
929
962
  patch_claude_md = true
@@ -1026,7 +1059,6 @@ Works like `.gitignore`. Default rules exclude:
1026
1059
  │ miss → build from AST/regex, cache it │
1027
1060
  │ │
1028
1061
  │ offline ── AST / regex extract │
1029
- │ claude ── Haiku API (optional) │
1030
1062
  └────────────────────┬────────────────────┘
1031
1063
 
1032
1064
  ┌────────────────────▼────────────────────┐
@@ -1127,8 +1159,7 @@ src/agentpack/
1127
1159
 
1128
1160
  summaries/
1129
1161
  offline.py # zero-API: AST/regex → imports, symbols, summary
1130
- llm.py # Claude Haiku API summaries (optional)
1131
- base.py # cache-or-build orchestration
1162
+ base.py # cache-or-build orchestration (parallel, ThreadPool+ProcessPool)
1132
1163
 
1133
1164
  adapters/ # context rendering only — no installation logic
1134
1165
  base.py # abstract BaseAdapter (output_path + render + write)
@@ -1365,7 +1396,7 @@ config_file = 60 # was 25 — configs always matter here
1365
1396
 
1366
1397
  ## Principles
1367
1398
 
1368
- - **Local-first**: `init`, `scan`, `diff`, `pack`, `stats`, `summarize` make zero API calls by default
1399
+ - **Local-first**: `init`, `scan`, `diff`, `pack`, `stats`, `summarize` make zero API calls ever. No optional LLM paths, no per-file costs.
1369
1400
  - **Non-destructive**: never overwrites user files; config patching only touches agentpack-managed blocks
1370
1401
  - **Agent-neutral**: architecture is generic; Claude Code is the primary target (deepest integration); Cursor, Windsurf, Codex, and Antigravity are supported but less battle-tested
1371
1402
  - **No daemons**: file watching is opt-in via `agentpack watch`; git hooks run in the background and are opt-in via `install`
@@ -1387,9 +1418,9 @@ config_file = 60 # was 25 — configs always matter here
1387
1418
  ## Optional dependencies
1388
1419
 
1389
1420
  ```bash
1390
- pip install "agentpack-cli[llm]" # anthropic — LLM summaries via Claude Haiku
1391
1421
  pip install "agentpack-cli[watch]" # watchdog — faster file watching for agentpack watch
1392
- pip install "agentpack-cli[all]" # llm + watch
1422
+ pip install "agentpack-cli[mcp]" # mcp expose agentpack as MCP server tools
1423
+ pip install "agentpack-cli[all]" # watch + mcp
1393
1424
  ```
1394
1425
 
1395
1426
  ---
@@ -5,7 +5,7 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
6
  [![CI](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml/badge.svg)](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml)
7
7
 
8
- > **Status: alpha (v0.1.5).** 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.
8
+ > **Status: alpha (v0.1.9).** 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
 
@@ -555,14 +555,14 @@ All installs are idempotent — safe to re-run, merge with existing config, neve
555
555
 
556
556
  ### `agentpack summarize`
557
557
 
558
- Build or refresh the offline summary cache. **No API calls.**
558
+ Build or refresh the offline summary cache. **No API calls, ever.**
559
559
 
560
560
  ```bash
561
561
  agentpack summarize # build summaries for all files not yet cached
562
562
  agentpack summarize --refresh # force rebuild all
563
563
  ```
564
564
 
565
- Run this once after `init`. After that, pack automatically rebuilds summaries only for changed files.
565
+ Summaries are built with parallel AST/regex analysis — no network, no tokens spent. Run once after `init`. After that, pack automatically rebuilds summaries only for changed files (hash-keyed cache).
566
566
 
567
567
  ---
568
568
 
@@ -592,6 +592,7 @@ Options:
592
592
  | `--since` | — | Only include files changed since this git ref |
593
593
  | `--session` | off | Re-pack on every file change (watch mode) |
594
594
  | `--refresh` | off | Force rebuild summaries before packing |
595
+ | `--budget` | 25000 | Token budget override |
595
596
 
596
597
  **Budget modes:**
597
598
 
@@ -656,6 +657,47 @@ Requires an initialized project (`agentpack init`). Refreshes context, prints th
656
657
 
657
658
  ---
658
659
 
660
+ ### `agentpack mcp`
661
+
662
+ Run AgentPack as an MCP server — exposes context packing as tools that Claude Code (and any MCP-compatible agent) can call directly.
663
+
664
+ ```bash
665
+ pip install "agentpack-cli[mcp]"
666
+ agentpack mcp
667
+ ```
668
+
669
+ Register in Claude Code settings (`~/.claude/settings.json`):
670
+
671
+ ```json
672
+ {
673
+ "mcpServers": {
674
+ "agentpack": {
675
+ "command": "agentpack",
676
+ "args": ["mcp"]
677
+ }
678
+ }
679
+ }
680
+ ```
681
+
682
+ **Tools exposed:**
683
+
684
+ | Tool | Description |
685
+ |---|---|
686
+ | `pack_context(task, mode, budget, max_tokens)` | Generate a ranked context pack for a task. Returns packed markdown, truncated to `max_tokens` (default 20,000). |
687
+ | `get_context()` | Return the latest pre-built pack instantly (no repack). Prepends a freshness/staleness header so you know if it's stale. |
688
+ | `refresh()` | Refresh using the current `task.md` or git-inferred task. |
689
+
690
+ **Staleness detection:** `get_context()` compares the snapshot hash from when the pack was built against the current repo snapshot. If files changed since last pack, it prepends:
691
+ ```
692
+ > **Stale context** — repo changed since last pack (generated: ...). Run pack_context() to refresh.
693
+ ```
694
+
695
+ **Smart truncation:** `pack_context()` keeps headers intact and trims file content blocks to fit the token budget, appending a note about how many files were omitted.
696
+
697
+ Zero API calls — all analysis is offline. Summary cache keyed by file hash: cold run parallelises AST parsing across CPU cores; warm cache hits are instant.
698
+
699
+ ---
700
+
659
701
  ### `agentpack explain`
660
702
 
661
703
  Debug file selection — show which files would be selected, why, and what was excluded — without writing a context pack.
@@ -877,10 +919,6 @@ include_tests = true
877
919
  include_configs = true
878
920
  include_receipts = true
879
921
 
880
- [summary]
881
- provider = "offline"
882
- schema_version = 1
883
-
884
922
  [agents.claude]
885
923
  output = ".agentpack/context.claude.md"
886
924
  patch_claude_md = true
@@ -983,7 +1021,6 @@ Works like `.gitignore`. Default rules exclude:
983
1021
  │ miss → build from AST/regex, cache it │
984
1022
  │ │
985
1023
  │ offline ── AST / regex extract │
986
- │ claude ── Haiku API (optional) │
987
1024
  └────────────────────┬────────────────────┘
988
1025
 
989
1026
  ┌────────────────────▼────────────────────┐
@@ -1084,8 +1121,7 @@ src/agentpack/
1084
1121
 
1085
1122
  summaries/
1086
1123
  offline.py # zero-API: AST/regex → imports, symbols, summary
1087
- llm.py # Claude Haiku API summaries (optional)
1088
- base.py # cache-or-build orchestration
1124
+ base.py # cache-or-build orchestration (parallel, ThreadPool+ProcessPool)
1089
1125
 
1090
1126
  adapters/ # context rendering only — no installation logic
1091
1127
  base.py # abstract BaseAdapter (output_path + render + write)
@@ -1322,7 +1358,7 @@ config_file = 60 # was 25 — configs always matter here
1322
1358
 
1323
1359
  ## Principles
1324
1360
 
1325
- - **Local-first**: `init`, `scan`, `diff`, `pack`, `stats`, `summarize` make zero API calls by default
1361
+ - **Local-first**: `init`, `scan`, `diff`, `pack`, `stats`, `summarize` make zero API calls ever. No optional LLM paths, no per-file costs.
1326
1362
  - **Non-destructive**: never overwrites user files; config patching only touches agentpack-managed blocks
1327
1363
  - **Agent-neutral**: architecture is generic; Claude Code is the primary target (deepest integration); Cursor, Windsurf, Codex, and Antigravity are supported but less battle-tested
1328
1364
  - **No daemons**: file watching is opt-in via `agentpack watch`; git hooks run in the background and are opt-in via `install`
@@ -1344,9 +1380,9 @@ config_file = 60 # was 25 — configs always matter here
1344
1380
  ## Optional dependencies
1345
1381
 
1346
1382
  ```bash
1347
- pip install "agentpack-cli[llm]" # anthropic — LLM summaries via Claude Haiku
1348
1383
  pip install "agentpack-cli[watch]" # watchdog — faster file watching for agentpack watch
1349
- pip install "agentpack-cli[all]" # llm + watch
1384
+ pip install "agentpack-cli[mcp]" # mcp expose agentpack as MCP server tools
1385
+ pip install "agentpack-cli[all]" # watch + mcp
1350
1386
  ```
1351
1387
 
1352
1388
  ---
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentpack-cli"
3
- version = "0.1.8"
3
+ version = "0.1.10"
4
4
  description = "Token-aware context packing for AI coding agents — Claude, Cursor, Windsurf, and Codex"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -31,11 +31,6 @@ dependencies = [
31
31
  agentpack = "agentpack.cli:app"
32
32
 
33
33
  [project.optional-dependencies]
34
- llm = [
35
- "anthropic>=0.39.0",
36
- "openai>=1.0.0"
37
- ]
38
-
39
34
  watch = [
40
35
  "watchdog>=4.0.0"
41
36
  ]
@@ -45,8 +40,6 @@ mcp = [
45
40
  ]
46
41
 
47
42
  all = [
48
- "anthropic>=0.39.0",
49
- "openai>=1.0.0",
50
43
  "watchdog>=4.0.0",
51
44
  "mcp>=1.0.0"
52
45
  ]
@@ -60,6 +53,9 @@ dev = [
60
53
 
61
54
  [tool.pytest.ini_options]
62
55
  pythonpath = ["src"]
56
+ markers = [
57
+ "slow: marks tests as slow (deselect with '-m \"not slow\"')",
58
+ ]
63
59
 
64
60
  [build-system]
65
61
  requires = ["hatchling"]
@@ -1,3 +1,3 @@
1
1
  """AgentPack — token-aware context packing for AI coding agents."""
2
2
 
3
- __version__ = "0.1.6"
3
+ __version__ = "0.1.10"
@@ -31,7 +31,6 @@ class PackRequest:
31
31
  budget: int
32
32
  since: str | None
33
33
  refresh: bool
34
- summary_provider: str
35
34
 
36
35
 
37
36
  @dataclass
@@ -176,7 +175,7 @@ class PackPlanner:
176
175
  packable = scan_result.packable
177
176
 
178
177
  t0 = time.perf_counter()
179
- summaries_objs = build_all_summaries(packable, root, request.summary_provider)
178
+ summaries_objs = build_all_summaries(packable, root)
180
179
  summaries = {p: s.model_dump() for p, s in summaries_objs.items()}
181
180
  phase_times["summarize"] = time.perf_counter() - t0
182
181
 
@@ -152,7 +152,6 @@ def _run_case(root: Path, case: BenchmarkCase) -> CaseResult:
152
152
  budget=0,
153
153
  since=None,
154
154
  refresh=False,
155
- summary_provider="offline",
156
155
  )
157
156
 
158
157
  t0 = time.perf_counter()
@@ -118,7 +118,6 @@ def register(app: typer.Typer) -> None:
118
118
  mode: str = typer.Option("balanced", "--mode", help="Budget mode (minimal|balanced|deep)."),
119
119
  budget: int = typer.Option(0, "--budget", help="Token budget (0 = use config default)."),
120
120
  since: Optional[str] = typer.Option(None, "--since", help="Git ref to compare against (e.g. HEAD~1, main)."),
121
- summary_provider: str = typer.Option("offline", "--summary-provider", help="Summary provider (offline|claude)."),
122
121
  file: Optional[str] = typer.Option(None, "--file", help="Show detailed score breakdown for a specific file."),
123
122
  omitted: bool = typer.Option(False, "--omitted", is_flag=True, help="Show top-10 excluded files and why."),
124
123
  ) -> None:
@@ -138,7 +137,6 @@ def register(app: typer.Typer) -> None:
138
137
  budget=budget,
139
138
  since=since,
140
139
  refresh=False,
141
- summary_provider=summary_provider,
142
140
  )
143
141
 
144
142
  with console.status("[bold]Planning..."):
@@ -25,7 +25,6 @@ def register(app: typer.Typer) -> None:
25
25
  budget: int = typer.Option(0, "--budget", help="Token budget (0 = use config default)."),
26
26
  since: Optional[str] = typer.Option(None, "--since", help="Git ref to compare against (e.g. HEAD~1, main)."),
27
27
  refresh: bool = typer.Option(False, "--refresh", help="Rebuild summaries before packing."),
28
- summary_provider: str = typer.Option("offline", "--summary-provider", help="Summary provider (offline|claude)."),
29
28
  watch: bool = typer.Option(False, "--watch", help="Watch for file changes and re-pack automatically."),
30
29
  session: bool = typer.Option(False, "--session", help="Keep re-packing on changes for the whole session (alias for --watch)."),
31
30
  ) -> None:
@@ -39,7 +38,7 @@ def register(app: typer.Typer) -> None:
39
38
 
40
39
  if watch or session:
41
40
  _pack_watch(agent=resolved_agent, task=resolved_task, mode=mode, budget=budget,
42
- since=since, summary_provider=summary_provider)
41
+ since=since)
43
42
  return
44
43
 
45
44
  result = PackService().run(PackRequest(
@@ -50,7 +49,6 @@ def register(app: typer.Typer) -> None:
50
49
  budget=budget,
51
50
  since=since,
52
51
  refresh=refresh,
53
- summary_provider=summary_provider,
54
52
  ))
55
53
  _print_pack_summary(result)
56
54
 
@@ -159,7 +157,6 @@ def _pack_watch(
159
157
  mode: str,
160
158
  budget: int,
161
159
  since: str | None,
162
- summary_provider: str,
163
160
  ) -> None:
164
161
  try:
165
162
  from watchdog.observers import Observer
@@ -176,7 +173,7 @@ def _pack_watch(
176
173
  def _run_pack() -> None:
177
174
  result = PackService().run(PackRequest(
178
175
  root=root, agent=agent, task=task, mode=mode, budget=budget,
179
- since=since, refresh=False, summary_provider=summary_provider,
176
+ since=since, refresh=False,
180
177
  ))
181
178
  _print_pack_summary(result)
182
179
 
@@ -177,7 +177,6 @@ def _run_refresh(
177
177
  budget=budget,
178
178
  since=None,
179
179
  refresh=False,
180
- summary_provider="offline",
181
180
  ))
182
181
 
183
182
  # Write context files atomically — avoids partial reads if interrupted mid-write
@@ -0,0 +1,51 @@
1
+ from __future__ import annotations
2
+
3
+ import typer
4
+
5
+ from agentpack.core.config import load_config
6
+ from agentpack.core.ignore import load_spec
7
+ from agentpack.core.scanner import scan
8
+ from agentpack.summaries.base import get_or_build_summary
9
+ from agentpack.commands._shared import console, _root
10
+
11
+
12
+ def register(app: typer.Typer) -> None:
13
+ @app.command()
14
+ def summarize(
15
+ refresh: bool = typer.Option(False, "--refresh", help="Force rebuild all summaries."),
16
+ ) -> None:
17
+ """Build or refresh offline summary cache (no API calls)."""
18
+ root = _root()
19
+ cfg = load_config(root)
20
+ ignore_spec = load_spec(root / cfg.project.ignore_file)
21
+
22
+ console.print("[bold]Building offline summaries...[/]")
23
+
24
+ scan_result = scan(root, ignore_spec, cfg.context.max_file_tokens)
25
+ active = scan_result.packable
26
+
27
+ if refresh:
28
+ from agentpack.core import cache as summary_cache
29
+ for fi in active:
30
+ if fi.hash:
31
+ cache_path = (
32
+ root / ".agentpack" / "cache" /
33
+ f"{summary_cache._cache_key(fi.path, fi.hash, 'offline', 1)}.json"
34
+ )
35
+ cache_path.unlink(missing_ok=True)
36
+
37
+ built = 0
38
+ errors = 0
39
+ for fi in active:
40
+ try:
41
+ get_or_build_summary(fi, root)
42
+ built += 1
43
+ except Exception as e:
44
+ console.print(f"[yellow]Warning:[/] {fi.path}: {e}")
45
+ errors += 1
46
+
47
+ console.print(f"[green]Done.[/] Built/refreshed {built} summaries.", end="")
48
+ if errors:
49
+ console.print(f" [yellow]{errors} errors.[/]")
50
+ else:
51
+ console.print()
@@ -17,7 +17,8 @@ _IGNORE_DIRS = {
17
17
  ".tox", ".eggs", "*.egg-info",
18
18
  }
19
19
  _IGNORE_NAMES = {"context.md", "context.compact.md"}
20
- _IGNORE_PREFIXES = (".agentpack/context",)
20
+ # Ignore all agentpack-generated files but allow task.md — it's user-edited and triggers refresh
21
+ _IGNORE_PREFIXES = (".agentpack/context", ".agentpack/session.json", ".agentpack/activity.log")
21
22
 
22
23
  _MAX_POLL_FILES = 50_000
23
24