codigest 0.4.0__tar.gz → 0.4.1__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 (44) hide show
  1. {codigest-0.4.0 → codigest-0.4.1}/CITATION.cff +1 -1
  2. {codigest-0.4.0 → codigest-0.4.1}/PKG-INFO +1 -1
  3. {codigest-0.4.0 → codigest-0.4.1}/pyproject.toml +1 -1
  4. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/mcp.py +0 -1
  5. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/term.py +30 -7
  6. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/main.py +8 -8
  7. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/shell/hook.ps1 +5 -1
  8. {codigest-0.4.0 → codigest-0.4.1}/uv.lock +1 -1
  9. {codigest-0.4.0 → codigest-0.4.1}/.github/workflows/publish.yml +0 -0
  10. {codigest-0.4.0 → codigest-0.4.1}/.gitignore +0 -0
  11. {codigest-0.4.0 → codigest-0.4.1}/.python-version +0 -0
  12. {codigest-0.4.0 → codigest-0.4.1}/LICENSE +0 -0
  13. {codigest-0.4.0 → codigest-0.4.1}/README.md +0 -0
  14. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/__init__.py +0 -0
  15. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/__main__.py +0 -0
  16. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/cap.py +0 -0
  17. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/clean.py +0 -0
  18. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/diff.py +0 -0
  19. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/digest.py +0 -0
  20. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/init.py +0 -0
  21. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/scan.py +0 -0
  22. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/semdiff.py +0 -0
  23. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/status.py +0 -0
  24. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/commands/tree.py +0 -0
  25. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/config.py +0 -0
  26. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/cache.py +0 -0
  27. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/common.py +0 -0
  28. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/git_ops.py +0 -0
  29. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/output.py +0 -0
  30. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/processor.py +0 -0
  31. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/prompts.py +0 -0
  32. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/redact.py +0 -0
  33. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/resolver.py +0 -0
  34. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/runner.py +0 -0
  35. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/scanner.py +0 -0
  36. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/semdiff.py +0 -0
  37. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/shadow.py +0 -0
  38. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/shellhist.py +0 -0
  39. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/structure.py +0 -0
  40. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/tags.py +0 -0
  41. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/termstore.py +0 -0
  42. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/core/tokenizer.py +0 -0
  43. {codigest-0.4.0 → codigest-0.4.1}/src/codigest/options.py +0 -0
  44. {codigest-0.4.0 → codigest-0.4.1}/tests/test_termstore.py +0 -0
@@ -14,7 +14,7 @@ authors:
14
14
  repository-code: "https://github.com/NaNIsaac/codigest"
15
15
  url: "https://pypi.org/project/codigest/"
16
16
  license: MIT
17
- version: 0.4.0
17
+ version: 0.4.1
18
18
  date-released: "2026-10-15"
19
19
  keywords:
20
20
  - LLM
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: codigest
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Human-Centered Codebase Context Manager for LLMs
5
5
  Project-URL: Homepage, https://github.com/NaNIsaac/codigest
6
6
  Project-URL: Repository, https://github.com/NaNIsaac/codigest
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codigest"
3
- version = "0.4.0"
3
+ version = "0.4.1"
4
4
  description = "Human-Centered Codebase Context Manager for LLMs"
5
5
  authors = [{ name = "Isaac Yong", email = "isaacyong@naver.com" }]
6
6
  readme = "README.md"
@@ -97,7 +97,6 @@ def _cli(command: str, args: JSON) -> str:
97
97
  argv.append("-r")
98
98
  if message := args.get("message"):
99
99
  argv += ["-m", message]
100
- # Options before positionals: Typer group callbacks require that order.
101
100
  match command:
102
101
  case "scan":
103
102
  argv += [str(t) for t in args.get("targets") or []] or ([args["path"]] if "path" in args else [])
@@ -1,7 +1,9 @@
1
1
  """
2
2
  `cdg term` -- recall recent terminal commands (and their output) as LLM context.
3
3
  """
4
+ import os
4
5
  import sys
6
+ import traceback
5
7
  from pathlib import Path
6
8
  from typing import Annotated
7
9
 
@@ -99,13 +101,10 @@ def handle(
99
101
  f"[yellow][Warning][/yellow] No Codigest captures found; "
100
102
  f"falling back to {shell} history [dim](commands only, no output)[/dim]"
101
103
  )
102
- log.print(
103
- "[dim]Capture output with `cdg term install` (PowerShell) "
104
- "or `cdg cap -- <command>`.[/dim]"
105
- )
104
+ _diagnose(log)
106
105
  else:
107
106
  log.print("[yellow]No terminal history available.[/yellow]")
108
- log.print("[dim]Try: cdg term install, or cdg cap -- <command>[/dim]")
107
+ _diagnose(log)
109
108
  raise typer.Exit(code=1)
110
109
 
111
110
  if failed:
@@ -138,6 +137,7 @@ def clear() -> None:
138
137
  """Delete all stored terminal captures."""
139
138
  console = Console()
140
139
  removed = termstore.clear()
140
+ (termstore.get_term_dir() / "ingest-errors.log").unlink(missing_ok=True)
141
141
  console.print(f"[green]Cleared[/green] {removed} captured entries.")
142
142
 
143
143
 
@@ -151,8 +151,31 @@ def path() -> None:
151
151
  @app.command("ingest", hidden=True)
152
152
  def ingest() -> None:
153
153
  """Store one JSON entry from stdin (called by the shell hook)."""
154
- data = json.loads(sys.stdin.buffer.read().decode("utf-8-sig"))
155
- termstore.append_entry(termstore.Entry.from_dict(data))
154
+ try:
155
+ data = json.loads(sys.stdin.buffer.read().decode("utf-8-sig"))
156
+ termstore.append_entry(termstore.Entry.from_dict(data))
157
+ except Exception:
158
+ # The hook discards our stderr; leave a trail `cdg term` can surface.
159
+ with _ingest_log().open("a", encoding="utf-8") as f:
160
+ f.write(f"--- {termstore.now_iso()}\n{traceback.format_exc()}")
161
+ raise typer.Exit(code=1)
162
+
163
+
164
+ def _ingest_log() -> Path:
165
+ termstore.get_term_dir().mkdir(parents=True, exist_ok=True)
166
+ return termstore.get_term_dir() / "ingest-errors.log"
167
+
168
+
169
+ def _diagnose(log) -> None:
170
+ """Explains why nothing was captured instead of failing silently."""
171
+ if not os.environ.get("CODIGEST_HOOK"):
172
+ log.print(
173
+ "[dim]Capture hook is not active in this shell. Run `cdg term install` "
174
+ "and open a new window, or enable it now with:[/dim]"
175
+ )
176
+ log.print(f"[dim] . '{HOOK_PATH}'[/dim]", highlight=False)
177
+ if (errors := termstore.get_term_dir() / "ingest-errors.log").exists():
178
+ log.print(f"[red]Capture errors were logged:[/red] {errors}", highlight=False)
156
179
 
157
180
 
158
181
  # --------------------------------------------------------------------------
@@ -19,14 +19,14 @@ app = typer.Typer(
19
19
  no_args_is_help=True
20
20
  )
21
21
 
22
- app.add_typer(init.app, name="init")
23
- app.add_typer(status.app, name="status")
24
- app.add_typer(clean.app, name="clean")
25
- app.add_typer(scan.app, name="scan")
26
- app.add_typer(tree.app, name="tree")
27
- app.add_typer(digest.app, name="digest")
28
- app.add_typer(diff.app, name="diff")
29
- app.add_typer(semdiff.app, name="semdiff")
22
+ app.command(name="init")(init.handle)
23
+ app.command(name="status")(status.handle)
24
+ app.command(name="clean")(clean.handle)
25
+ app.command(name="scan")(scan.handle)
26
+ app.command(name="tree")(tree.handle)
27
+ app.command(name="digest")(digest.handle)
28
+ app.command(name="diff")(diff.handle)
29
+ app.command(name="semdiff")(semdiff.handle)
30
30
  app.add_typer(term.app, name="term")
31
31
 
32
32
  # `cap` is a plain command, not a group: its first argument is the wrapped
@@ -76,7 +76,8 @@ if (-not (Get-Module PSReadLine)) { return }
76
76
 
77
77
  # ponytail: denylist heuristic for programs that need a real TTY (editors, pagers,
78
78
  # REPLs, ssh). Extend with $env:CODIGEST_CAP_SKIP (a regex) when one slips through.
79
- $global:__cdgSkip = '^\s*(vim?|nvim|nano|emacs|less|more|ssh|htop|btop|top|fzf|lazygit|claude|codex|wsl|cdg|codigest|exit)(\.exe)?\b' +
79
+ $global:__cdgSkip = '^\s*(vim?|nvim|nano|emacs|less|more|ssh|htop|btop|top|fzf|lazygit|claude|codex|wsl|exit)(\.exe)?\b' +
80
+ '|^\s*(cdg|codigest)(\.exe)?\s+(term|mcp)\b' +
80
81
  '|^\s*(python3?|py|ipython|node|pwsh|powershell|bash|cmd)(\.exe)?\s*$' +
81
82
  '|^\s*git\s+(commit(?!.*\s-\w*[mF])|rebase\s+-i|add\s+-[pi]|mergetool)'
82
83
 
@@ -114,3 +115,6 @@ Set-PSReadLineOption -AddToHistoryHandler {
114
115
  if ($global:__cdgPrevHistHandler) { return $global:__cdgPrevHistHandler.Invoke($l) }
115
116
  return $true
116
117
  }
118
+
119
+ # Lets `cdg term` tell whether this shell is hooked.
120
+ $env:CODIGEST_HOOK = '1'
@@ -16,7 +16,7 @@ wheels = [
16
16
 
17
17
  [[package]]
18
18
  name = "codigest"
19
- version = "0.4.0"
19
+ version = "0.4.1"
20
20
  source = { editable = "." }
21
21
  dependencies = [
22
22
  { name = "loguru" },
File without changes
File without changes
File without changes
File without changes