LOKK 0.1.5__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 (66) hide show
  1. lokk-0.1.5/.github/workflows/publish.yml +31 -0
  2. lokk-0.1.5/.github/workflows/test.yml +35 -0
  3. lokk-0.1.5/.gitignore +18 -0
  4. lokk-0.1.5/LICENSE +21 -0
  5. lokk-0.1.5/PKG-INFO +96 -0
  6. lokk-0.1.5/README.md +53 -0
  7. lokk-0.1.5/docs/superpowers/plans/2026-06-20-loki-implementation.md +3493 -0
  8. lokk-0.1.5/docs/superpowers/specs/2026-06-20-loki-design.md +1676 -0
  9. lokk-0.1.5/loki/__init__.py +4 -0
  10. lokk-0.1.5/loki/ai/__init__.py +1 -0
  11. lokk-0.1.5/loki/ai/chat.py +95 -0
  12. lokk-0.1.5/loki/ai/guardrails.py +80 -0
  13. lokk-0.1.5/loki/ai/providers/__init__.py +6 -0
  14. lokk-0.1.5/loki/ai/providers/anthropic.py +59 -0
  15. lokk-0.1.5/loki/ai/providers/base.py +22 -0
  16. lokk-0.1.5/loki/ai/providers/groq.py +84 -0
  17. lokk-0.1.5/loki/ai/providers/openai_provider.py +64 -0
  18. lokk-0.1.5/loki/ai/providers/openrouter.py +71 -0
  19. lokk-0.1.5/loki/ai/rag.py +124 -0
  20. lokk-0.1.5/loki/ai/system_prompt.py +39 -0
  21. lokk-0.1.5/loki/cli.py +111 -0
  22. lokk-0.1.5/loki/commands/__init__.py +1 -0
  23. lokk-0.1.5/loki/commands/ai_cmd.py +59 -0
  24. lokk-0.1.5/loki/commands/capture_cmd.py +241 -0
  25. lokk-0.1.5/loki/commands/describe_cmd.py +71 -0
  26. lokk-0.1.5/loki/commands/errors_cmd.py +73 -0
  27. lokk-0.1.5/loki/commands/exit_cmd.py +27 -0
  28. lokk-0.1.5/loki/commands/fix_cmd.py +154 -0
  29. lokk-0.1.5/loki/commands/init_cmd.py +75 -0
  30. lokk-0.1.5/loki/commands/inject_cmd.py +94 -0
  31. lokk-0.1.5/loki/commands/models_cmd.py +69 -0
  32. lokk-0.1.5/loki/commands/report_cmd.py +88 -0
  33. lokk-0.1.5/loki/commands/show_cmd.py +35 -0
  34. lokk-0.1.5/loki/commands/watch_cmd.py +53 -0
  35. lokk-0.1.5/loki/core/__init__.py +1 -0
  36. lokk-0.1.5/loki/core/cache.py +77 -0
  37. lokk-0.1.5/loki/core/config.py +76 -0
  38. lokk-0.1.5/loki/core/errors.py +411 -0
  39. lokk-0.1.5/loki/core/global_hook.py +145 -0
  40. lokk-0.1.5/loki/core/runtime_capture.py +161 -0
  41. lokk-0.1.5/loki/core/scanner.py +158 -0
  42. lokk-0.1.5/loki/core/types.py +97 -0
  43. lokk-0.1.5/loki/security/__init__.py +15 -0
  44. lokk-0.1.5/loki/security/cache_security.py +72 -0
  45. lokk-0.1.5/loki/security/integrity.py +58 -0
  46. lokk-0.1.5/loki/security/leak_prevention.py +32 -0
  47. lokk-0.1.5/loki/security/secret_manager.py +112 -0
  48. lokk-0.1.5/loki/security/secure_delete.py +41 -0
  49. lokk-0.1.5/loki/ui/__init__.py +1 -0
  50. lokk-0.1.5/loki/ui/routes.py +130 -0
  51. lokk-0.1.5/loki/ui/security.py +58 -0
  52. lokk-0.1.5/loki/ui/server.py +55 -0
  53. lokk-0.1.5/loki/ui/static/app.js +228 -0
  54. lokk-0.1.5/loki/ui/static/index.html +431 -0
  55. lokk-0.1.5/loki/ui/static/style.css +995 -0
  56. lokk-0.1.5/pyproject.toml +58 -0
  57. lokk-0.1.5/res.app.js +117 -0
  58. lokk-0.1.5/res.index.html +899 -0
  59. lokk-0.1.5/res.style.css +414 -0
  60. lokk-0.1.5/tests/__init__.py +1 -0
  61. lokk-0.1.5/tests/test_cache.py +44 -0
  62. lokk-0.1.5/tests/test_commands.py +24 -0
  63. lokk-0.1.5/tests/test_errors.py +23 -0
  64. lokk-0.1.5/tests/test_providers.py +12 -0
  65. lokk-0.1.5/tests/test_scanner.py +32 -0
  66. lokk-0.1.5/tests/test_security.py +18 -0
@@ -0,0 +1,31 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+
11
+ permissions:
12
+ id-token: write
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+
22
+ - name: Install build tools
23
+ run: |
24
+ python -m pip install --upgrade pip
25
+ pip install build
26
+
27
+ - name: Build package
28
+ run: python -m build
29
+
30
+ - name: Publish to PyPI
31
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,35 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[dev]"
28
+
29
+ - name: Run tests
30
+ run: pytest tests/ -v --cov=loki
31
+
32
+ - name: Run linting
33
+ run: |
34
+ pip install ruff
35
+ ruff check loki/
lokk-0.1.5/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.so
5
+ .Python
6
+ env/
7
+ venv/
8
+ .venv/
9
+ dist/
10
+ build/
11
+ *.egg-info/
12
+ .eggs/
13
+ *.egg
14
+ .pytest_cache/
15
+ .coverage
16
+ htmlcov/
17
+ .mypy_cache/
18
+ .ruff_cache/
lokk-0.1.5/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Loki CLI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
lokk-0.1.5/PKG-INFO ADDED
@@ -0,0 +1,96 @@
1
+ Metadata-Version: 2.4
2
+ Name: LOKK
3
+ Version: 0.1.5
4
+ Summary: AI-powered code analysis CLI with error detection and chat
5
+ Project-URL: Homepage, https://github.com/loki-cli/loki
6
+ Project-URL: Repository, https://github.com/loki-cli/loki
7
+ Author: Loki Team
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: ai,cli,code-analysis,errors,linting
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Quality Assurance
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: astroid>=2.0
22
+ Requires-Dist: click>=8.0
23
+ Requires-Dist: cryptography>=41.0
24
+ Requires-Dist: faiss-cpu>=1.7
25
+ Requires-Dist: fastapi>=0.100
26
+ Requires-Dist: groq>=0.10
27
+ Requires-Dist: httpx>=0.24
28
+ Requires-Dist: keyring>=24.0
29
+ Requires-Dist: pylint>=2.0
30
+ Requires-Dist: rich>=13.0
31
+ Requires-Dist: sentence-transformers>=2.0
32
+ Requires-Dist: uvicorn>=0.20
33
+ Requires-Dist: watchdog>=3.0
34
+ Requires-Dist: websockets>=12.0
35
+ Provides-Extra: anthropic
36
+ Requires-Dist: anthropic>=0.20; extra == 'anthropic'
37
+ Provides-Extra: dev
38
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
39
+ Requires-Dist: pytest>=7.0; extra == 'dev'
40
+ Provides-Extra: openai
41
+ Requires-Dist: openai>=1.0; extra == 'openai'
42
+ Description-Content-Type: text/markdown
43
+
44
+ # loki-cli
45
+
46
+ AI-powered code analysis CLI with error detection, RAG chat, and web UI.
47
+
48
+ ## Features
49
+
50
+ - **10 CLI commands** for code analysis
51
+ - **AI-powered** error detection and fixes
52
+ - **RAG chat** with your codebase
53
+ - **Web UI** with real-time monitoring
54
+ - **Secure** - API keys in OS keychain, encrypted cache
55
+
56
+ ## Installation
57
+
58
+ ```bash
59
+ pip install loki-cli
60
+ ```
61
+
62
+ ## Quick Start
63
+
64
+ ```bash
65
+ loki init # Scan codebase
66
+ loki errors # Show errors
67
+ loki ai # Chat with AI
68
+ loki show # Open web UI
69
+ loki report # Generate report
70
+ ```
71
+
72
+ ## Commands
73
+
74
+ | Command | Description |
75
+ |---------|-------------|
76
+ | `loki init` | Scan codebase, build cache |
77
+ | `loki errors` | Show detected errors |
78
+ | `loki show` | Open web UI |
79
+ | `loki describe` | Detailed error explanations |
80
+ | `loki ai` | Terminal chat with AI |
81
+ | `loki exit` | Clear cache |
82
+ | `loki fix` | AI-powered fix suggestions |
83
+ | `loki watch` | Live file monitoring |
84
+ | `loki report` | Generate markdown report |
85
+ | `loki models` | Switch AI providers |
86
+
87
+ ## Security
88
+
89
+ - API keys stored in OS keychain (never in files)
90
+ - Cache encrypted with Fernet
91
+ - AI guardrails prevent prompt injection
92
+ - Secure deletion with 3-pass overwrite
93
+
94
+ ## License
95
+
96
+ MIT
lokk-0.1.5/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # loki-cli
2
+
3
+ AI-powered code analysis CLI with error detection, RAG chat, and web UI.
4
+
5
+ ## Features
6
+
7
+ - **10 CLI commands** for code analysis
8
+ - **AI-powered** error detection and fixes
9
+ - **RAG chat** with your codebase
10
+ - **Web UI** with real-time monitoring
11
+ - **Secure** - API keys in OS keychain, encrypted cache
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install loki-cli
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```bash
22
+ loki init # Scan codebase
23
+ loki errors # Show errors
24
+ loki ai # Chat with AI
25
+ loki show # Open web UI
26
+ loki report # Generate report
27
+ ```
28
+
29
+ ## Commands
30
+
31
+ | Command | Description |
32
+ |---------|-------------|
33
+ | `loki init` | Scan codebase, build cache |
34
+ | `loki errors` | Show detected errors |
35
+ | `loki show` | Open web UI |
36
+ | `loki describe` | Detailed error explanations |
37
+ | `loki ai` | Terminal chat with AI |
38
+ | `loki exit` | Clear cache |
39
+ | `loki fix` | AI-powered fix suggestions |
40
+ | `loki watch` | Live file monitoring |
41
+ | `loki report` | Generate markdown report |
42
+ | `loki models` | Switch AI providers |
43
+
44
+ ## Security
45
+
46
+ - API keys stored in OS keychain (never in files)
47
+ - Cache encrypted with Fernet
48
+ - AI guardrails prevent prompt injection
49
+ - Secure deletion with 3-pass overwrite
50
+
51
+ ## License
52
+
53
+ MIT