libcontext 0.1.0__tar.gz → 0.2.0__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 (40) hide show
  1. {libcontext-0.1.0 → libcontext-0.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +36 -36
  2. {libcontext-0.1.0 → libcontext-0.2.0}/.github/ISSUE_TEMPLATE/feature_request.md +23 -23
  3. {libcontext-0.1.0 → libcontext-0.2.0}/.github/PULL_REQUEST_TEMPLATE.md +21 -21
  4. {libcontext-0.1.0 → libcontext-0.2.0}/.github/workflows/ci.yml +99 -99
  5. libcontext-0.2.0/.github/workflows/release.yml +118 -0
  6. {libcontext-0.1.0 → libcontext-0.2.0}/.gitignore +67 -65
  7. {libcontext-0.1.0 → libcontext-0.2.0}/CHANGELOG.md +52 -35
  8. {libcontext-0.1.0 → libcontext-0.2.0}/CONTRIBUTING.md +168 -166
  9. {libcontext-0.1.0 → libcontext-0.2.0}/DEPENDENCIES.md +60 -52
  10. {libcontext-0.1.0 → libcontext-0.2.0}/LICENSE +21 -21
  11. libcontext-0.2.0/PKG-INFO +285 -0
  12. libcontext-0.2.0/README.md +256 -0
  13. {libcontext-0.1.0 → libcontext-0.2.0}/SECURITY.md +47 -38
  14. libcontext-0.2.0/docs/adr/001-progressive-disclosure-over-always-on-context.md +53 -0
  15. libcontext-0.2.0/docs/adr/002-skill-plus-cli-as-primary-integration.md +104 -0
  16. libcontext-0.2.0/docs/adr/004-ast-only-inspection.md +56 -0
  17. libcontext-0.2.0/docs/adr/README.md +15 -0
  18. {libcontext-0.1.0 → libcontext-0.2.0}/pyproject.toml +11 -8
  19. {libcontext-0.1.0 → libcontext-0.2.0}/src/libcontext/__init__.py +80 -57
  20. libcontext-0.2.0/src/libcontext/cli.py +577 -0
  21. {libcontext-0.1.0 → libcontext-0.2.0}/src/libcontext/collector.py +286 -290
  22. {libcontext-0.1.0 → libcontext-0.2.0}/src/libcontext/config.py +153 -151
  23. libcontext-0.2.0/src/libcontext/exceptions.py +58 -0
  24. {libcontext-0.1.0 → libcontext-0.2.0}/src/libcontext/inspector.py +410 -399
  25. libcontext-0.2.0/src/libcontext/mcp_server.py +164 -0
  26. {libcontext-0.1.0 → libcontext-0.2.0}/src/libcontext/models.py +92 -92
  27. {libcontext-0.1.0 → libcontext-0.2.0}/src/libcontext/renderer.py +484 -366
  28. libcontext-0.2.0/tests/test_cli.py +686 -0
  29. libcontext-0.2.0/tests/test_cli_mcp_parity.py +185 -0
  30. {libcontext-0.1.0 → libcontext-0.2.0}/tests/test_collector.py +585 -584
  31. {libcontext-0.1.0 → libcontext-0.2.0}/tests/test_config.py +327 -326
  32. {libcontext-0.1.0 → libcontext-0.2.0}/tests/test_inspector.py +395 -395
  33. libcontext-0.2.0/tests/test_mcp_server.py +252 -0
  34. {libcontext-0.1.0 → libcontext-0.2.0}/tests/test_renderer.py +463 -312
  35. libcontext-0.1.0/PKG-INFO +0 -282
  36. libcontext-0.1.0/README.md +0 -250
  37. libcontext-0.1.0/src/libcontext/cli.py +0 -218
  38. libcontext-0.1.0/tests/test_cli.py +0 -400
  39. {libcontext-0.1.0 → libcontext-0.2.0}/src/libcontext/py.typed +0 -0
  40. {libcontext-0.1.0 → libcontext-0.2.0}/tests/__init__.py +0 -0
@@ -1,36 +1,36 @@
1
- ---
2
- name: Bug Report
3
- about: Report a bug to help us improve
4
- title: "[BUG] "
5
- labels: bug
6
- assignees: ""
7
- ---
8
-
9
- ## Description
10
-
11
- A clear and concise description of the bug.
12
-
13
- ## Steps to Reproduce
14
-
15
- 1. Install `...`
16
- 2. Run `libctx ...`
17
- 3. See error
18
-
19
- ## Expected Behaviour
20
-
21
- What you expected to happen.
22
-
23
- ## Actual Behaviour
24
-
25
- What actually happened. Include the full error traceback if applicable.
26
-
27
- ## Environment
28
-
29
- - **OS:** (e.g., Windows 11, Ubuntu 22.04, macOS 14)
30
- - **Python version:** (e.g., 3.11.4)
31
- - **libcontext version:** (e.g., 0.1.0)
32
- - **Package being inspected:** (e.g., requests 2.31.0)
33
-
34
- ## Additional Context
35
-
36
- Any other context about the problem (screenshots, logs, etc.).
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug to help us improve
4
+ title: "[BUG] "
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Description
10
+
11
+ A clear and concise description of the bug.
12
+
13
+ ## Steps to Reproduce
14
+
15
+ 1. Install `...`
16
+ 2. Run `libctx ...`
17
+ 3. See error
18
+
19
+ ## Expected Behaviour
20
+
21
+ What you expected to happen.
22
+
23
+ ## Actual Behaviour
24
+
25
+ What actually happened. Include the full error traceback if applicable.
26
+
27
+ ## Environment
28
+
29
+ - **OS:** (e.g., Windows 11, Ubuntu 22.04, macOS 14)
30
+ - **Python version:** (e.g., 3.11.4)
31
+ - **libcontext version:** (e.g., 0.1.0)
32
+ - **Package being inspected:** (e.g., requests 2.31.0)
33
+
34
+ ## Additional Context
35
+
36
+ Any other context about the problem (screenshots, logs, etc.).
@@ -1,23 +1,23 @@
1
- ---
2
- name: Feature Request
3
- about: Suggest a new feature or enhancement
4
- title: "[FEATURE] "
5
- labels: enhancement
6
- assignees: ""
7
- ---
8
-
9
- ## Problem Statement
10
-
11
- A clear and concise description of the problem this feature would solve.
12
-
13
- ## Proposed Solution
14
-
15
- Describe your proposed solution or feature.
16
-
17
- ## Alternatives Considered
18
-
19
- Any alternative solutions or features you've considered.
20
-
21
- ## Additional Context
22
-
23
- Any other context, mockups, or examples.
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a new feature or enhancement
4
+ title: "[FEATURE] "
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Problem Statement
10
+
11
+ A clear and concise description of the problem this feature would solve.
12
+
13
+ ## Proposed Solution
14
+
15
+ Describe your proposed solution or feature.
16
+
17
+ ## Alternatives Considered
18
+
19
+ Any alternative solutions or features you've considered.
20
+
21
+ ## Additional Context
22
+
23
+ Any other context, mockups, or examples.
@@ -1,21 +1,21 @@
1
- ## Description
2
-
3
- Brief description of the changes in this PR.
4
-
5
- ## Motivation
6
-
7
- Why is this change needed? Link to related issue(s) if applicable.
8
-
9
- Closes #
10
-
11
- ## Changes
12
-
13
- - Change 1
14
- - Change 2
15
-
16
- ## Checklist
17
-
18
- - [ ] Tests added/updated
19
- - [ ] All tests pass (`pytest`)
20
- - [ ] Docstrings added/updated for public API changes
21
- - [ ] CHANGELOG.md updated (for user-facing changes)
1
+ ## Description
2
+
3
+ Brief description of the changes in this PR.
4
+
5
+ ## Motivation
6
+
7
+ Why is this change needed? Link to related issue(s) if applicable.
8
+
9
+ Closes #
10
+
11
+ ## Changes
12
+
13
+ - Change 1
14
+ - Change 2
15
+
16
+ ## Checklist
17
+
18
+ - [ ] Tests added/updated
19
+ - [ ] All tests pass (`pytest`)
20
+ - [ ] Docstrings added/updated for public API changes
21
+ - [ ] CHANGELOG.md updated (for user-facing changes)
@@ -1,99 +1,99 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- branches: [main]
8
-
9
- permissions:
10
- contents: read
11
-
12
- jobs:
13
- test:
14
- name: Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
15
- runs-on: ${{ matrix.os }}
16
-
17
- strategy:
18
- fail-fast: false
19
- matrix:
20
- os: [ubuntu-latest, windows-latest, macos-latest]
21
- python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22
-
23
- steps:
24
- - uses: actions/checkout@v4
25
-
26
- - name: Set up Python ${{ matrix.python-version }}
27
- uses: actions/setup-python@v5
28
- with:
29
- python-version: ${{ matrix.python-version }}
30
-
31
- - name: Install dependencies
32
- run: |
33
- python -m pip install --upgrade pip
34
- pip install -e ".[dev]"
35
-
36
- - name: Run tests
37
- run: pytest -v --cov=libcontext --cov-report=xml
38
-
39
- - name: Upload coverage
40
- if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
41
- uses: codecov/codecov-action@v4
42
- with:
43
- file: coverage.xml
44
- fail_ci_if_error: false
45
-
46
- lint:
47
- name: Lint
48
- runs-on: ubuntu-latest
49
-
50
- steps:
51
- - uses: actions/checkout@v4
52
-
53
- - name: Set up Python
54
- uses: actions/setup-python@v5
55
- with:
56
- python-version: "3.12"
57
-
58
- - name: Install dependencies
59
- run: |
60
- python -m pip install --upgrade pip
61
- pip install -e ".[dev]"
62
-
63
- - name: Ruff lint
64
- run: ruff check src/ tests/
65
-
66
- - name: Ruff format check
67
- run: ruff format --check src/ tests/
68
-
69
- - name: Type checking (mypy)
70
- run: mypy src/libcontext
71
-
72
- build:
73
- name: Build package
74
- runs-on: ubuntu-latest
75
-
76
- steps:
77
- - uses: actions/checkout@v4
78
-
79
- - name: Set up Python
80
- uses: actions/setup-python@v5
81
- with:
82
- python-version: "3.12"
83
-
84
- - name: Install build tools
85
- run: |
86
- python -m pip install --upgrade pip
87
- pip install build twine
88
-
89
- - name: Build
90
- run: python -m build
91
-
92
- - name: Check package
93
- run: twine check dist/*
94
-
95
- - name: Upload artifacts
96
- uses: actions/upload-artifact@v4
97
- with:
98
- name: dist
99
- path: dist/
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ name: Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
15
+ runs-on: ${{ matrix.os }}
16
+
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ os: [ubuntu-latest, windows-latest, macos-latest]
21
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+
31
+ - name: Install dependencies
32
+ run: |
33
+ python -m pip install --upgrade pip
34
+ pip install -e ".[dev]"
35
+
36
+ - name: Run tests
37
+ run: pytest -v --cov=libcontext --cov-report=xml
38
+
39
+ - name: Upload coverage
40
+ if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
41
+ uses: codecov/codecov-action@v4
42
+ with:
43
+ file: coverage.xml
44
+ fail_ci_if_error: false
45
+
46
+ lint:
47
+ name: Lint
48
+ runs-on: ubuntu-latest
49
+
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+
53
+ - name: Set up Python
54
+ uses: actions/setup-python@v5
55
+ with:
56
+ python-version: "3.12"
57
+
58
+ - name: Install dependencies
59
+ run: |
60
+ python -m pip install --upgrade pip
61
+ pip install -e ".[dev]"
62
+
63
+ - name: Ruff lint
64
+ run: ruff check src/ tests/
65
+
66
+ - name: Ruff format check
67
+ run: ruff format --check src/ tests/
68
+
69
+ - name: Type checking (mypy)
70
+ run: mypy src/libcontext
71
+
72
+ build:
73
+ name: Build package
74
+ runs-on: ubuntu-latest
75
+
76
+ steps:
77
+ - uses: actions/checkout@v4
78
+
79
+ - name: Set up Python
80
+ uses: actions/setup-python@v5
81
+ with:
82
+ python-version: "3.12"
83
+
84
+ - name: Install build tools
85
+ run: |
86
+ python -m pip install --upgrade pip
87
+ pip install build twine
88
+
89
+ - name: Build
90
+ run: python -m build
91
+
92
+ - name: Check package
93
+ run: twine check dist/*
94
+
95
+ - name: Upload artifacts
96
+ uses: actions/upload-artifact@v4
97
+ with:
98
+ name: dist
99
+ path: dist/
@@ -0,0 +1,118 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: write # needed for GitHub Release creation
10
+ id-token: write # needed for PyPI Trusted Publishing (OIDC)
11
+
12
+ jobs:
13
+ # ── 1. Quality gate ─────────────────────────────────────────────────
14
+ quality:
15
+ name: Quality gate
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v5
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --all-extras
31
+
32
+ - name: Ruff lint
33
+ run: uv run ruff check src/ tests/
34
+
35
+ - name: Ruff format check
36
+ run: uv run ruff format --check src/ tests/
37
+
38
+ - name: Type checking (mypy)
39
+ run: uv run mypy src/libcontext
40
+
41
+ - name: Run tests
42
+ run: uv run pytest -v --cov=libcontext
43
+
44
+ # ── 2. Build ────────────────────────────────────────────────────────
45
+ build:
46
+ name: Build package
47
+ needs: quality
48
+ runs-on: ubuntu-latest
49
+
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+
53
+ - name: Install uv
54
+ uses: astral-sh/setup-uv@v5
55
+
56
+ - name: Build sdist & wheel
57
+ run: uv build
58
+
59
+ - name: Upload dist artifacts
60
+ uses: actions/upload-artifact@v4
61
+ with:
62
+ name: dist
63
+ path: dist/
64
+
65
+ # ── 3. Publish to PyPI (Trusted Publisher / OIDC) ───────────────────
66
+ publish-pypi:
67
+ name: Publish to PyPI
68
+ needs: build
69
+ runs-on: ubuntu-latest
70
+ environment: pypi
71
+
72
+ steps:
73
+ - name: Download dist artifacts
74
+ uses: actions/download-artifact@v4
75
+ with:
76
+ name: dist
77
+ path: dist/
78
+
79
+ - name: Publish to PyPI
80
+ uses: pypa/gh-action-pypi-publish@release/v1
81
+
82
+ # ── 4. GitHub Release ──────────────────────────────────────────────
83
+ github-release:
84
+ name: GitHub Release
85
+ needs: build
86
+ runs-on: ubuntu-latest
87
+
88
+ steps:
89
+ - uses: actions/checkout@v4
90
+
91
+ - name: Download dist artifacts
92
+ uses: actions/download-artifact@v4
93
+ with:
94
+ name: dist
95
+ path: dist/
96
+
97
+ - name: Extract changelog for this version
98
+ id: changelog
99
+ run: |
100
+ TAG="${GITHUB_REF#refs/tags/v}"
101
+ # Extract the section for this version from CHANGELOG.md
102
+ BODY=$(awk -v ver="$TAG" '
103
+ /^## \[/ {
104
+ if (found) exit
105
+ if (index($0, "[" ver "]")) found=1
106
+ next
107
+ }
108
+ found { print }
109
+ ' CHANGELOG.md)
110
+ # Write to file for the release body
111
+ echo "$BODY" > release_body.md
112
+
113
+ - name: Create GitHub Release
114
+ uses: softprops/action-gh-release@v2
115
+ with:
116
+ body_path: release_body.md
117
+ files: dist/*
118
+ generate_release_notes: false
@@ -1,65 +1,67 @@
1
- # Byte-compiled / cached
2
- __pycache__/
3
- *.py[cod]
4
- *$py.class
5
-
6
- # C extensions
7
- *.so
8
-
9
- # Distribution / packaging
10
- .Python
11
- build/
12
- develop-eggs/
13
- dist/
14
- downloads/
15
- eggs/
16
- .eggs/
17
- lib/
18
- lib64/
19
- parts/
20
- sdist/
21
- var/
22
- wheels/
23
- *.egg-info/
24
- *.egg
25
-
26
- # Virtual environments
27
- .venv/
28
- venv/
29
- ENV/
30
- env/
31
-
32
- # uv
33
- uv.lock
34
-
35
- # IDE
36
- .vscode/
37
- .idea/
38
- *.swp
39
- *.swo
40
- *~
41
-
42
- # Testing / coverage
43
- htmlcov/
44
- .tox/
45
- .nox/
46
- .coverage
47
- .coverage.*
48
- .cache
49
- nosetests.xml
50
- coverage.xml
51
- *.cover
52
- *.py,cover
53
- .hypothesis/
54
- .pytest_cache/
55
-
56
- # mypy
57
- .mypy_cache/
58
- dmypy.json
59
-
60
- # ruff
61
- .ruff_cache/
62
-
63
- # OS files
64
- .DS_Store
65
- Thumbs.db
1
+ # Byte-compiled / cached
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ *.egg
25
+
26
+ # Virtual environments
27
+ .venv/
28
+ venv/
29
+ ENV/
30
+ env/
31
+
32
+ # uv
33
+ uv.lock
34
+
35
+ # IDE
36
+ .vscode/
37
+ .idea/
38
+ .claude/
39
+ CLAUDE.md
40
+ *.swp
41
+ *.swo
42
+ *~
43
+
44
+ # Testing / coverage
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py,cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+
58
+ # mypy
59
+ .mypy_cache/
60
+ dmypy.json
61
+
62
+ # ruff
63
+ .ruff_cache/
64
+
65
+ # OS files
66
+ .DS_Store
67
+ Thumbs.db