leancontext 2.0.2__tar.gz → 2.0.4__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 (74) hide show
  1. leancontext-2.0.4/.github/workflows/codeql.yml +23 -0
  2. {leancontext-2.0.2 → leancontext-2.0.4}/CHANGELOG.md +11 -1
  3. {leancontext-2.0.2 → leancontext-2.0.4}/PKG-INFO +7 -6
  4. {leancontext-2.0.2 → leancontext-2.0.4}/README.md +6 -5
  5. leancontext-2.0.4/SUPPORT.md +7 -0
  6. {leancontext-2.0.2 → leancontext-2.0.4}/pyproject.toml +1 -1
  7. {leancontext-2.0.2 → leancontext-2.0.4}/.editorconfig +0 -0
  8. {leancontext-2.0.2 → leancontext-2.0.4}/.github/CODEOWNERS +0 -0
  9. {leancontext-2.0.2 → leancontext-2.0.4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  10. {leancontext-2.0.2 → leancontext-2.0.4}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  11. {leancontext-2.0.2 → leancontext-2.0.4}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  12. {leancontext-2.0.2 → leancontext-2.0.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  13. {leancontext-2.0.2 → leancontext-2.0.4}/.github/dependabot.yml +0 -0
  14. {leancontext-2.0.2 → leancontext-2.0.4}/.github/workflows/ci.yml +0 -0
  15. {leancontext-2.0.2 → leancontext-2.0.4}/.github/workflows/publish.yml +0 -0
  16. {leancontext-2.0.2 → leancontext-2.0.4}/.gitignore +0 -0
  17. {leancontext-2.0.2 → leancontext-2.0.4}/.pre-commit-config.yaml +0 -0
  18. {leancontext-2.0.2 → leancontext-2.0.4}/AGENTS.md +0 -0
  19. {leancontext-2.0.2 → leancontext-2.0.4}/CITATION.cff +0 -0
  20. {leancontext-2.0.2 → leancontext-2.0.4}/CODE_OF_CONDUCT.md +0 -0
  21. {leancontext-2.0.2 → leancontext-2.0.4}/CONTRIBUTING.md +0 -0
  22. {leancontext-2.0.2 → leancontext-2.0.4}/LICENSE +0 -0
  23. {leancontext-2.0.2 → leancontext-2.0.4}/RELEASING.md +0 -0
  24. {leancontext-2.0.2 → leancontext-2.0.4}/SECURITY.md +0 -0
  25. {leancontext-2.0.2 → leancontext-2.0.4}/assets/logo.png +0 -0
  26. {leancontext-2.0.2 → leancontext-2.0.4}/assets/logo.svg +0 -0
  27. {leancontext-2.0.2 → leancontext-2.0.4}/bench.py +0 -0
  28. {leancontext-2.0.2 → leancontext-2.0.4}/demo.py +0 -0
  29. {leancontext-2.0.2 → leancontext-2.0.4}/docs/ARCHITECTURE.md +0 -0
  30. {leancontext-2.0.2 → leancontext-2.0.4}/examples/basic_usage.py +0 -0
  31. {leancontext-2.0.2 → leancontext-2.0.4}/examples/validate_caching.py +0 -0
  32. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/__init__.py +0 -0
  33. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/cli.py +0 -0
  34. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/core.py +0 -0
  35. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/cost.py +0 -0
  36. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/fidelity.py +0 -0
  37. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/__init__.py +0 -0
  38. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/_common.py +0 -0
  39. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/anthropic_native.py +0 -0
  40. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/clients.py +0 -0
  41. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/decorator.py +0 -0
  42. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/frameworks.py +0 -0
  43. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/litellm.py +0 -0
  44. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/mcp_server.py +0 -0
  45. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/otel.py +0 -0
  46. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/integrations/proxy.py +0 -0
  47. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/messages.py +0 -0
  48. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/paging.py +0 -0
  49. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/py.typed +0 -0
  50. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/reducers/__init__.py +0 -0
  51. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/reducers/base.py +0 -0
  52. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/reducers/diff.py +0 -0
  53. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/reducers/html.py +0 -0
  54. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/reducers/json_data.py +0 -0
  55. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/reducers/logs.py +0 -0
  56. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/reducers/stacktrace.py +0 -0
  57. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/reducers/table.py +0 -0
  58. {leancontext-2.0.2 → leancontext-2.0.4}/leancontext/tokens.py +0 -0
  59. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_cache.py +0 -0
  60. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_core.py +0 -0
  61. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_differentiators.py +0 -0
  62. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_fidelity.py +0 -0
  63. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_frameworks.py +0 -0
  64. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_gateway.py +0 -0
  65. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_gemini.py +0 -0
  66. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_limits.py +0 -0
  67. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_mcp.py +0 -0
  68. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_messages.py +0 -0
  69. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_otel.py +0 -0
  70. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_paging.py +0 -0
  71. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_proxy.py +0 -0
  72. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_reducers.py +0 -0
  73. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_table.py +0 -0
  74. {leancontext-2.0.2 → leancontext-2.0.4}/tests/test_tokens.py +0 -0
@@ -0,0 +1,23 @@
1
+ name: CodeQL
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ schedule:
9
+ - cron: "0 6 * * 1" # weekly
10
+
11
+ permissions:
12
+ contents: read
13
+ security-events: write
14
+
15
+ jobs:
16
+ analyze:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: github/codeql-action/init@v3
21
+ with:
22
+ languages: python
23
+ - uses: github/codeql-action/analyze@v3
@@ -5,6 +5,15 @@ All notable changes to this project are documented here. The format is based on
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.0.4] - 2026-06-21
9
+
10
+ ### Fixed
11
+ - README uses absolute image and link URLs so the logo and links render on the PyPI
12
+ project page (relative paths only resolve on GitHub).
13
+
14
+ ### Added
15
+ - PyPI downloads badge, `SUPPORT.md`, and a CodeQL security-scanning workflow.
16
+
8
17
  ## [2.0.2] - 2026-06-21
9
18
 
10
19
  ### Changed
@@ -34,6 +43,7 @@ All notable changes to this project are documented here. The format is based on
34
43
  - Targets Python 3.14; ruff, mypy, and coverage run in CI; examples, contributor, and
35
44
  security docs included.
36
45
 
37
- [Unreleased]: https://github.com/pankajniet/LeanContext/compare/v2.0.2...HEAD
46
+ [Unreleased]: https://github.com/pankajniet/LeanContext/compare/v2.0.4...HEAD
47
+ [2.0.4]: https://github.com/pankajniet/LeanContext/releases/tag/v2.0.4
38
48
  [2.0.2]: https://github.com/pankajniet/LeanContext/releases/tag/v2.0.2
39
49
  [2.0.0]: https://github.com/pankajniet/LeanContext/releases/tag/v2.0.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: leancontext
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: Deterministic, type-aware reduction of agent tool outputs at the source. Cut LLM token cost without making the agent do less.
5
5
  Project-URL: Homepage, https://github.com/pankajniet/LeanContext
6
6
  Project-URL: Repository, https://github.com/pankajniet/LeanContext
@@ -45,7 +45,7 @@ Requires-Dist: tiktoken>=0.12; extra == 'tiktoken'
45
45
  Description-Content-Type: text/markdown
46
46
 
47
47
  <p align="center">
48
- <img src="assets/logo.png" alt="LeanContext" width="460">
48
+ <img src="https://raw.githubusercontent.com/pankajniet/LeanContext/main/assets/logo.png" alt="LeanContext" width="460">
49
49
  </p>
50
50
 
51
51
  <p align="center">
@@ -54,7 +54,8 @@ Description-Content-Type: text/markdown
54
54
 
55
55
  <p align="center">
56
56
  <a href="https://pypi.org/project/leancontext/"><img alt="PyPI" src="https://img.shields.io/pypi/v/leancontext.svg"></a>
57
- <a href="LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg"></a>
57
+ <a href="https://pypi.org/project/leancontext/"><img alt="Downloads" src="https://img.shields.io/pypi/dm/leancontext.svg"></a>
58
+ <a href="https://github.com/pankajniet/LeanContext/blob/main/LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg"></a>
58
59
  <img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue.svg">
59
60
  <a href="https://github.com/pankajniet/LeanContext/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/pankajniet/LeanContext/actions/workflows/ci.yml/badge.svg"></a>
60
61
  <a href="https://github.com/astral-sh/ruff"><img alt="Ruff" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"></a>
@@ -192,7 +193,7 @@ Anything else, or any payload below the size, saving, or fidelity thresholds, pa
192
193
  Each tool output flows through fail-open gates (hash, size check, type detection, the typed
193
194
  reducer, then a saving and fidelity check) and returns either the reduced text or the original.
194
195
  Results are cached by content hash, so a payload re-sent across turns is reduced only once.
195
- See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for diagrams.
196
+ See [docs/ARCHITECTURE.md](https://github.com/pankajniet/LeanContext/blob/main/docs/ARCHITECTURE.md) for diagrams.
196
197
 
197
198
  ## Cost and telemetry
198
199
 
@@ -221,8 +222,8 @@ adapters, broader Anthropic native interop, and a PyPI release.
221
222
  ## Contributing
222
223
 
223
224
  Issues and PRs welcome. Run `pytest`. Reducers are pure functions, `str -> (reduced, notes)`,
224
- and must be deterministic and value-preserving. See [AGENTS.md](AGENTS.md) for the design rules.
225
+ and must be deterministic and value-preserving. See [AGENTS.md](https://github.com/pankajniet/LeanContext/blob/main/AGENTS.md) for the design rules.
225
226
 
226
227
  ## License
227
228
 
228
- [Apache-2.0](LICENSE)
229
+ [Apache-2.0](https://github.com/pankajniet/LeanContext/blob/main/LICENSE)
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="assets/logo.png" alt="LeanContext" width="460">
2
+ <img src="https://raw.githubusercontent.com/pankajniet/LeanContext/main/assets/logo.png" alt="LeanContext" width="460">
3
3
  </p>
4
4
 
5
5
  <p align="center">
@@ -8,7 +8,8 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://pypi.org/project/leancontext/"><img alt="PyPI" src="https://img.shields.io/pypi/v/leancontext.svg"></a>
11
- <a href="LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg"></a>
11
+ <a href="https://pypi.org/project/leancontext/"><img alt="Downloads" src="https://img.shields.io/pypi/dm/leancontext.svg"></a>
12
+ <a href="https://github.com/pankajniet/LeanContext/blob/main/LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg"></a>
12
13
  <img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-blue.svg">
13
14
  <a href="https://github.com/pankajniet/LeanContext/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/pankajniet/LeanContext/actions/workflows/ci.yml/badge.svg"></a>
14
15
  <a href="https://github.com/astral-sh/ruff"><img alt="Ruff" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"></a>
@@ -146,7 +147,7 @@ Anything else, or any payload below the size, saving, or fidelity thresholds, pa
146
147
  Each tool output flows through fail-open gates (hash, size check, type detection, the typed
147
148
  reducer, then a saving and fidelity check) and returns either the reduced text or the original.
148
149
  Results are cached by content hash, so a payload re-sent across turns is reduced only once.
149
- See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for diagrams.
150
+ See [docs/ARCHITECTURE.md](https://github.com/pankajniet/LeanContext/blob/main/docs/ARCHITECTURE.md) for diagrams.
150
151
 
151
152
  ## Cost and telemetry
152
153
 
@@ -175,8 +176,8 @@ adapters, broader Anthropic native interop, and a PyPI release.
175
176
  ## Contributing
176
177
 
177
178
  Issues and PRs welcome. Run `pytest`. Reducers are pure functions, `str -> (reduced, notes)`,
178
- and must be deterministic and value-preserving. See [AGENTS.md](AGENTS.md) for the design rules.
179
+ and must be deterministic and value-preserving. See [AGENTS.md](https://github.com/pankajniet/LeanContext/blob/main/AGENTS.md) for the design rules.
179
180
 
180
181
  ## License
181
182
 
182
- [Apache-2.0](LICENSE)
183
+ [Apache-2.0](https://github.com/pankajniet/LeanContext/blob/main/LICENSE)
@@ -0,0 +1,7 @@
1
+ # Support
2
+
3
+ - **Questions and ideas:** open a [Discussion](https://github.com/pankajniet/LeanContext/discussions),
4
+ or an issue using the *Feature request* template.
5
+ - **Bugs:** open an issue with the *Bug report* template.
6
+ - **Security:** see [SECURITY.md](SECURITY.md) — report privately, not in a public issue.
7
+ - **Docs:** start with the [README](README.md) and [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "leancontext"
3
- version = "2.0.2"
3
+ version = "2.0.4"
4
4
  description = "Deterministic, type-aware reduction of agent tool outputs at the source. Cut LLM token cost without making the agent do less."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
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