agentpack-cli 0.1.9__tar.gz → 0.1.11__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.9 → agentpack_cli-0.1.11}/PKG-INFO +2 -1
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/pyproject.toml +12 -1
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/__init__.py +1 -1
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/symbols.py +0 -1
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/benchmark.py +3 -4
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/claude_cmd.py +0 -1
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/doctor.py +3 -3
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/explain.py +2 -2
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/init.py +3 -3
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/mcp_cmd.py +0 -1
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/pack.py +3 -4
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/session.py +2 -2
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/stats.py +2 -3
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/watch.py +8 -3
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/cache.py +0 -1
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/context_pack.py +0 -2
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/scanner.py +1 -1
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/token_estimator.py +0 -4
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/session/state.py +1 -1
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/summaries/offline.py +2 -3
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/.gitignore +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/LICENSE +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/README.md +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/adapters/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/adapters/antigravity.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/adapters/base.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/adapters/claude.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/adapters/codex.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/adapters/cursor.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/adapters/detect.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/adapters/generic.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/adapters/windsurf.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/dependency_graph.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/go_imports.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/java_imports.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/js_ts_imports.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/python_imports.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/ranking.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/rust_imports.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/analysis/tests.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/application/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/application/pack_service.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/cli.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/_shared.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/diff.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/install.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/monitor.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/scan.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/status.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/commands/summarize.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/bootstrap.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/config.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/diff.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/git.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/git_hooks.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/global_install.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/ignore.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/merkle.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/models.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/redactor.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/snapshot.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/core/vscode_tasks.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/data/agentpack.md +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/installers/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/installers/antigravity.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/installers/claude.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/installers/codex.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/installers/cursor.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/installers/windsurf.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/integrations/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/integrations/git_hooks.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/integrations/global_install.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/integrations/vscode_tasks.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/mcp_server.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/renderers/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/renderers/compact.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/renderers/markdown.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/renderers/receipts.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/session/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/src/agentpack/summaries/__init__.py +0 -0
- {agentpack_cli-0.1.9 → agentpack_cli-0.1.11}/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.11
|
|
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
|
|
@@ -28,6 +28,7 @@ Requires-Dist: watchdog>=4.0.0; extra == 'all'
|
|
|
28
28
|
Provides-Extra: dev
|
|
29
29
|
Requires-Dist: mypy; extra == 'dev'
|
|
30
30
|
Requires-Dist: pytest; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
31
32
|
Requires-Dist: ruff; extra == 'dev'
|
|
32
33
|
Requires-Dist: tomli>=2.0.0; (python_version < '3.11') and extra == 'dev'
|
|
33
34
|
Provides-Extra: mcp
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "agentpack-cli"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.11"
|
|
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"
|
|
@@ -46,6 +46,7 @@ all = [
|
|
|
46
46
|
|
|
47
47
|
dev = [
|
|
48
48
|
"pytest",
|
|
49
|
+
"pytest-cov",
|
|
49
50
|
"ruff",
|
|
50
51
|
"mypy",
|
|
51
52
|
"tomli>=2.0.0; python_version < '3.11'"
|
|
@@ -57,6 +58,16 @@ markers = [
|
|
|
57
58
|
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
58
59
|
]
|
|
59
60
|
|
|
61
|
+
[tool.coverage.run]
|
|
62
|
+
source = [
|
|
63
|
+
"src/agentpack/core",
|
|
64
|
+
"src/agentpack/analysis",
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
[tool.coverage.report]
|
|
68
|
+
fail_under = 80
|
|
69
|
+
show_missing = true
|
|
70
|
+
|
|
60
71
|
[build-system]
|
|
61
72
|
requires = ["hatchling"]
|
|
62
73
|
build-backend = "hatchling.build"
|
|
@@ -6,7 +6,6 @@ import time
|
|
|
6
6
|
from dataclasses import dataclass, field
|
|
7
7
|
from datetime import datetime, timezone
|
|
8
8
|
from pathlib import Path
|
|
9
|
-
from typing import Optional
|
|
10
9
|
|
|
11
10
|
import typer
|
|
12
11
|
from rich.table import Table
|
|
@@ -312,11 +311,11 @@ def _print_case_detail(result: CaseResult) -> None:
|
|
|
312
311
|
hits = expected_set & selected_set
|
|
313
312
|
misses = expected_set - selected_set
|
|
314
313
|
if hits:
|
|
315
|
-
console.print(
|
|
314
|
+
console.print(" [green]hit:[/] " + ", ".join(sorted(hits)))
|
|
316
315
|
if misses:
|
|
317
|
-
console.print(
|
|
316
|
+
console.print(" [red]miss:[/] " + ", ".join(sorted(misses)))
|
|
318
317
|
|
|
319
|
-
console.print(
|
|
318
|
+
console.print(" [dim]top files:[/] " + ", ".join(result.selected_paths[:5]))
|
|
320
319
|
|
|
321
320
|
|
|
322
321
|
def _print_summary_table(results: list[CaseResult]) -> None:
|
|
@@ -98,7 +98,7 @@ def register(app: typer.Typer) -> None:
|
|
|
98
98
|
if not config_path.exists():
|
|
99
99
|
console.print(f" [yellow]![/] Not initialized in {root} — run: agentpack init")
|
|
100
100
|
else:
|
|
101
|
-
console.print(
|
|
101
|
+
console.print(" [green]✓[/] .agentpack/config.toml present")
|
|
102
102
|
if context_path.exists():
|
|
103
103
|
import time
|
|
104
104
|
age = time.time() - context_path.stat().st_mtime
|
|
@@ -127,7 +127,7 @@ def register(app: typer.Typer) -> None:
|
|
|
127
127
|
console.print(f" [green]✓[/] Claude hooks present (local): {claude_settings}")
|
|
128
128
|
_local_has_hooks = True
|
|
129
129
|
else:
|
|
130
|
-
console.print(
|
|
130
|
+
console.print(" [yellow]![/] Claude hooks missing (local) — run: agentpack install --agent claude")
|
|
131
131
|
ok = False
|
|
132
132
|
except Exception:
|
|
133
133
|
console.print(f" [yellow]![/] Could not parse {claude_settings}")
|
|
@@ -141,7 +141,7 @@ def register(app: typer.Typer) -> None:
|
|
|
141
141
|
console.print(f" [green]✓[/] Claude hooks present (global): {global_claude_settings}")
|
|
142
142
|
_global_has_hooks = True
|
|
143
143
|
else:
|
|
144
|
-
console.print(
|
|
144
|
+
console.print(" [yellow]![/] Claude hooks missing (global) — run: agentpack install --agent claude --global")
|
|
145
145
|
except Exception:
|
|
146
146
|
console.print(f" [yellow]![/] Could not parse {global_claude_settings}")
|
|
147
147
|
else:
|
|
@@ -212,7 +212,7 @@ def register(app: typer.Typer) -> None:
|
|
|
212
212
|
)
|
|
213
213
|
|
|
214
214
|
if near_cutoff_paths:
|
|
215
|
-
console.print(
|
|
215
|
+
console.print("\n[bold]Files near budget cutoff[/] [dim](would appear with larger budget):[/]")
|
|
216
216
|
near_sorted = sorted(
|
|
217
217
|
near_cutoff_paths,
|
|
218
218
|
key=lambda p: -score_map.get(p, (0, []))[0],
|
|
@@ -226,7 +226,7 @@ def register(app: typer.Typer) -> None:
|
|
|
226
226
|
)
|
|
227
227
|
|
|
228
228
|
if excluded_receipts:
|
|
229
|
-
console.print(
|
|
229
|
+
console.print("\n[bold]Excluded[/] [dim](top 5 by score):[/]")
|
|
230
230
|
for r in excluded_receipts[:5]:
|
|
231
231
|
score_val, _ = score_map.get(r.path, (0, []))
|
|
232
232
|
console.print(
|
|
@@ -5,10 +5,10 @@ from typing import Optional
|
|
|
5
5
|
|
|
6
6
|
import typer
|
|
7
7
|
|
|
8
|
-
from agentpack.core.config import DEFAULT_CONFIG, CONFIG_TEMPLATE
|
|
8
|
+
from agentpack.core.config import DEFAULT_CONFIG, CONFIG_TEMPLATE
|
|
9
9
|
from agentpack.core.ignore import DEFAULT_AGENTIGNORE
|
|
10
10
|
from agentpack.commands._shared import console, _root
|
|
11
|
-
from agentpack.session.state import load_session, create_session,
|
|
11
|
+
from agentpack.session.state import load_session, create_session, SESSION_FILE, TASK_FILE
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def register(app: typer.Typer) -> None:
|
|
@@ -97,7 +97,7 @@ def register(app: typer.Typer) -> None:
|
|
|
97
97
|
if existing_session is None or force:
|
|
98
98
|
from agentpack.adapters.detect import detect_agent
|
|
99
99
|
resolved_agent = agent if agent != "auto" else detect_agent(root)
|
|
100
|
-
|
|
100
|
+
create_session(root, agent=resolved_agent, mode=resolved_mode)
|
|
101
101
|
console.print(f"[green]Created[/] {SESSION_FILE} [dim]agent={resolved_agent} mode={resolved_mode}[/]")
|
|
102
102
|
console.print(f"[green]Created[/] {TASK_FILE} [dim]edit to set your task[/]")
|
|
103
103
|
else:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import time
|
|
4
|
-
from pathlib import Path
|
|
5
4
|
from typing import Optional
|
|
6
5
|
|
|
7
6
|
import typer
|
|
@@ -78,7 +77,7 @@ def _print_pack_summary(result: PackResult) -> None:
|
|
|
78
77
|
saving_pct = result.saving_pct
|
|
79
78
|
changed_files = result.changed_files
|
|
80
79
|
task = result.pack.task
|
|
81
|
-
|
|
80
|
+
# since is not stored in PackResult; shown via changed_files
|
|
82
81
|
|
|
83
82
|
stats = Table(box=box.SIMPLE, show_header=False, padding=(0, 2))
|
|
84
83
|
stats.add_column(style="dim")
|
|
@@ -146,7 +145,7 @@ def _print_pack_summary(result: PackResult) -> None:
|
|
|
146
145
|
if len(sensitive_excluded) > 10:
|
|
147
146
|
console.print(f" [dim]... {len(sensitive_excluded) - 10} more[/]")
|
|
148
147
|
|
|
149
|
-
console.print(
|
|
148
|
+
console.print("\n[bold]Next step:[/]")
|
|
150
149
|
console.print(f" [bold white]claude < {out_path}[/]")
|
|
151
150
|
console.print()
|
|
152
151
|
|
|
@@ -167,7 +166,7 @@ def _pack_watch(
|
|
|
167
166
|
raise typer.Exit(1)
|
|
168
167
|
|
|
169
168
|
root = _root()
|
|
170
|
-
console.print(
|
|
169
|
+
console.print("[bold]Watch mode active.[/] Repacking on file changes... (Ctrl+C to stop)")
|
|
171
170
|
console.print(f" Task: {task}")
|
|
172
171
|
|
|
173
172
|
def _run_pack() -> None:
|
|
@@ -66,7 +66,7 @@ def register(app: typer.Typer) -> None:
|
|
|
66
66
|
console.print(f" [green]✓[/] {CONTEXT_FILE} [dim]{result['files']} files, {result['tokens']:,} tokens[/]")
|
|
67
67
|
log_activity(root, f"session start — {result['files']} files, {result['tokens']:,} tokens")
|
|
68
68
|
else:
|
|
69
|
-
console.print(
|
|
69
|
+
console.print(" [dim]✗ context generation failed — run agentpack session refresh[/]")
|
|
70
70
|
log_activity(root, "session start (context generation failed)")
|
|
71
71
|
|
|
72
72
|
console.print()
|
|
@@ -158,7 +158,7 @@ def _run_refresh(
|
|
|
158
158
|
task_path = root / TASK_FILE
|
|
159
159
|
if task_path.exists():
|
|
160
160
|
raw = task_path.read_text(encoding="utf-8").strip()
|
|
161
|
-
lines = [
|
|
161
|
+
lines = [line for line in raw.splitlines() if line.strip() and not line.startswith("#")]
|
|
162
162
|
task = lines[0].strip() if lines else ""
|
|
163
163
|
else:
|
|
164
164
|
task = ""
|
|
@@ -71,12 +71,11 @@ def register(app: typer.Typer) -> None:
|
|
|
71
71
|
|
|
72
72
|
# --- Last context top files ---
|
|
73
73
|
metrics_path = root / ".agentpack" / "metrics.jsonl"
|
|
74
|
-
last_selected: list[dict] = []
|
|
75
74
|
if metrics_path.exists():
|
|
76
|
-
lines = [
|
|
75
|
+
lines = [line.strip() for line in metrics_path.read_text().splitlines() if line.strip()]
|
|
77
76
|
if lines:
|
|
78
77
|
try:
|
|
79
|
-
|
|
78
|
+
json.loads(lines[-1])
|
|
80
79
|
# metrics don't store per-file data — use context file for top files
|
|
81
80
|
except Exception:
|
|
82
81
|
pass
|
|
@@ -17,7 +17,7 @@ _IGNORE_DIRS = {
|
|
|
17
17
|
".tox", ".eggs", "*.egg-info",
|
|
18
18
|
}
|
|
19
19
|
_IGNORE_NAMES = {"context.md", "context.compact.md"}
|
|
20
|
-
|
|
20
|
+
# Ignore all .agentpack/ generated files; task.md is the sole exception (user-edited, triggers refresh)
|
|
21
21
|
|
|
22
22
|
_MAX_POLL_FILES = 50_000
|
|
23
23
|
|
|
@@ -54,7 +54,9 @@ def register(app: typer.Typer) -> None:
|
|
|
54
54
|
|
|
55
55
|
# Try watchdog first, fall back to polling
|
|
56
56
|
try:
|
|
57
|
-
|
|
57
|
+
import importlib.util
|
|
58
|
+
if importlib.util.find_spec("watchdog") is None:
|
|
59
|
+
raise ImportError("watchdog not installed")
|
|
58
60
|
_watch_with_watchdog(root, effective_agent, effective_mode, budget, debounce, state)
|
|
59
61
|
except ImportError:
|
|
60
62
|
console.print("[dim]watchdog not installed — using polling (install watchdog for better performance)[/]")
|
|
@@ -74,7 +76,10 @@ def _should_ignore(path: str) -> bool:
|
|
|
74
76
|
if name in _IGNORE_NAMES:
|
|
75
77
|
return True
|
|
76
78
|
norm = path.replace("\\", "/")
|
|
77
|
-
|
|
79
|
+
# Ignore everything under .agentpack/ except task.md
|
|
80
|
+
if norm.startswith(".agentpack/") and norm != TASK_FILE:
|
|
81
|
+
return True
|
|
82
|
+
return False
|
|
78
83
|
|
|
79
84
|
|
|
80
85
|
def _run_refresh(root: Path, agent: str, mode: str, budget: int) -> None:
|
|
@@ -5,7 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
|
|
6
6
|
import pathspec
|
|
7
7
|
|
|
8
|
-
from agentpack.core.ignore import
|
|
8
|
+
from agentpack.core.ignore import is_ignored
|
|
9
9
|
from agentpack.core.models import FileInfo, ScanResult
|
|
10
10
|
from agentpack.core.token_estimator import estimate_tokens, estimate_tokens_bytes
|
|
11
11
|
|
|
@@ -12,10 +12,6 @@ def _get_encoder():
|
|
|
12
12
|
import tiktoken
|
|
13
13
|
# Only load tiktoken if its vocab cache already exists — avoids
|
|
14
14
|
# a blocking network download when running inside git hooks.
|
|
15
|
-
cache_dir = os.environ.get(
|
|
16
|
-
"TIKTOKEN_CACHE_DIR",
|
|
17
|
-
os.path.join(os.path.expanduser("~"), ".cache", "huggingface", "hub"),
|
|
18
|
-
)
|
|
19
15
|
tiktoken_cache = os.path.join(os.path.expanduser("~"), ".cache", "tiktoken")
|
|
20
16
|
cache_warm = os.path.isdir(tiktoken_cache) and any(
|
|
21
17
|
True for _ in os.scandir(tiktoken_cache)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import ast
|
|
4
3
|
import re
|
|
5
4
|
from pathlib import Path
|
|
6
5
|
|
|
7
|
-
from agentpack.core.models import FileSummary
|
|
6
|
+
from agentpack.core.models import FileSummary
|
|
8
7
|
from agentpack.analysis.symbols import extract_python_symbols, extract_js_symbols
|
|
9
8
|
from agentpack.analysis.python_imports import extract_imports as py_imports
|
|
10
9
|
from agentpack.analysis.js_ts_imports import extract_imports as js_imports
|
|
@@ -25,7 +24,7 @@ def _python_summary(path: str, abs_path: Path, file_hash: str) -> FileSummary:
|
|
|
25
24
|
top_level_imports = [i for i in imports if not i.startswith(".")][:8]
|
|
26
25
|
exposed = [s.name for s in symbols if s.kind in ("class", "function")][:8]
|
|
27
26
|
|
|
28
|
-
parts = [
|
|
27
|
+
parts = ["Language: Python"]
|
|
29
28
|
if exposed:
|
|
30
29
|
parts.append(f"Exposes: {', '.join(exposed)}")
|
|
31
30
|
if top_level_imports:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|