deepcode-hku 1.0.1__py3-none-any.whl

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. cli/__init__.py +18 -0
  2. cli/cli_app.py +296 -0
  3. cli/cli_interface.py +744 -0
  4. cli/cli_launcher.py +155 -0
  5. cli/main_cli.py +243 -0
  6. cli/workflows/__init__.py +11 -0
  7. cli/workflows/cli_workflow_adapter.py +336 -0
  8. deepcode.py +219 -0
  9. deepcode_hku-1.0.1.dist-info/METADATA +695 -0
  10. deepcode_hku-1.0.1.dist-info/RECORD +44 -0
  11. deepcode_hku-1.0.1.dist-info/WHEEL +5 -0
  12. deepcode_hku-1.0.1.dist-info/entry_points.txt +2 -0
  13. deepcode_hku-1.0.1.dist-info/licenses/LICENSE +21 -0
  14. deepcode_hku-1.0.1.dist-info/top_level.txt +6 -0
  15. tools/__init__.py +0 -0
  16. tools/code_implementation_server.py +1045 -0
  17. tools/code_indexer.py +1657 -0
  18. tools/code_reference_indexer.py +486 -0
  19. tools/command_executor.py +324 -0
  20. tools/git_command.py +356 -0
  21. tools/pdf_converter.py +640 -0
  22. tools/pdf_downloader.py +1370 -0
  23. tools/pdf_utils.py +52 -0
  24. ui/__init__.py +43 -0
  25. ui/app.py +13 -0
  26. ui/components.py +1450 -0
  27. ui/handlers.py +773 -0
  28. ui/layout.py +106 -0
  29. ui/streamlit_app.py +38 -0
  30. ui/styles.py +2116 -0
  31. utils/__init__.py +17 -0
  32. utils/cli_interface.py +459 -0
  33. utils/dialogue_logger.py +671 -0
  34. utils/file_processor.py +426 -0
  35. utils/simple_llm_logger.py +198 -0
  36. workflows/__init__.py +31 -0
  37. workflows/agent_orchestration_engine.py +1371 -0
  38. workflows/agents/__init__.py +13 -0
  39. workflows/agents/code_implementation_agent.py +1093 -0
  40. workflows/agents/memory_agent_concise.py +923 -0
  41. workflows/agents/memory_agent_concise_index.py +935 -0
  42. workflows/code_implementation_workflow.py +924 -0
  43. workflows/code_implementation_workflow_index.py +931 -0
  44. workflows/codebase_index_workflow.py +726 -0
tools/pdf_utils.py ADDED
@@ -0,0 +1,52 @@
1
+ """
2
+ PDF utility functions for the DeepCode agent system.
3
+ """
4
+
5
+ from pathlib import Path
6
+ import PyPDF2
7
+
8
+
9
+ def read_pdf_metadata(file_path: Path) -> dict:
10
+ """Read PDF metadata with proper encoding handling."""
11
+ try:
12
+ print(f"\nAttempting to read PDF metadata from: {file_path}")
13
+ with open(file_path, "rb") as file:
14
+ pdf_reader = PyPDF2.PdfReader(file)
15
+ info = pdf_reader.metadata
16
+ first_page = pdf_reader.pages[0]
17
+ text = first_page.extract_text()
18
+ lines = text.split("\n")[:10]
19
+
20
+ title = None
21
+ authors = []
22
+
23
+ if info:
24
+ title = info.get("/Title", "").strip().replace("\x00", "")
25
+ author = info.get("/Author", "").strip().replace("\x00", "")
26
+ if author:
27
+ authors = [author]
28
+
29
+ if not title and lines:
30
+ title = lines[0].strip()
31
+
32
+ if not authors and len(lines) > 1:
33
+ for line in lines[1:3]:
34
+ if "author" in line.lower() or "by" in line.lower():
35
+ authors = [line.strip()]
36
+ break
37
+
38
+ return {
39
+ "title": title if title else "Unknown Title",
40
+ "authors": authors if authors else ["Unknown Author"],
41
+ "year": info.get("/CreationDate", "")[:4] if info else "Unknown Year",
42
+ "first_lines": lines,
43
+ }
44
+
45
+ except Exception as e:
46
+ print(f"\nError reading PDF: {str(e)}")
47
+ return {
48
+ "title": "Error reading PDF",
49
+ "authors": ["Unknown"],
50
+ "year": "Unknown",
51
+ "first_lines": [],
52
+ }
ui/__init__.py ADDED
@@ -0,0 +1,43 @@
1
+ """
2
+ UI Module
3
+
4
+ Streamlit application user interface components module
5
+
6
+ Contains the following submodules:
7
+ - styles: CSS styles
8
+ - components: UI components
9
+ - layout: Page layout
10
+ - handlers: Event handlers
11
+ - streamlit_app: Main application
12
+ - app: Application entry
13
+ """
14
+
15
+ __version__ = "1.0.0"
16
+ __author__ = "DeepCode Team"
17
+
18
+ # Import main components
19
+ from .layout import main_layout
20
+ from .components import display_header, display_features, display_status
21
+ from .handlers import initialize_session_state
22
+ from .styles import get_main_styles
23
+
24
+ # Import application main function
25
+ try:
26
+ from .streamlit_app import main as streamlit_main
27
+ except ImportError:
28
+ # Fallback to absolute import if relative import fails
29
+ import sys
30
+ import os
31
+
32
+ sys.path.insert(0, os.path.dirname(__file__))
33
+ from streamlit_app import main as streamlit_main
34
+
35
+ __all__ = [
36
+ "main_layout",
37
+ "display_header",
38
+ "display_features",
39
+ "display_status",
40
+ "initialize_session_state",
41
+ "get_main_styles",
42
+ "streamlit_main",
43
+ ]
ui/app.py ADDED
@@ -0,0 +1,13 @@
1
+ """
2
+ DeepCode UI Application Entry Point
3
+
4
+ This file serves as the unified entry point for the UI module
5
+ """
6
+
7
+ from .streamlit_app import main
8
+
9
+ # Directly export main function for external calls
10
+ __all__ = ["main"]
11
+
12
+ if __name__ == "__main__":
13
+ main()