coding-client 1.21.2__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 (109) hide show
  1. coding_client/__init__.py +1 -0
  2. coding_client/api/__init__.py +19 -0
  3. coding_client/api/exception_handlers.py +158 -0
  4. coding_client/api/logging_setup.py +44 -0
  5. coding_client/api/metrics.py +40 -0
  6. coding_client/api/openapi_config.py +124 -0
  7. coding_client/api/request_logging.py +60 -0
  8. coding_client/api/validation.py +150 -0
  9. coding_client/auth/__init__.py +78 -0
  10. coding_client/auth/_default_tenant.py +132 -0
  11. coding_client/auth/_header_trust.py +98 -0
  12. coding_client/auth/_onbehalf.py +315 -0
  13. coding_client/auth/_trusted_networks.py +94 -0
  14. coding_client/auth/dependencies.py +61 -0
  15. coding_client/auth/middleware.py +445 -0
  16. coding_client/auth/models.py +83 -0
  17. coding_client/auth/outbound.py +137 -0
  18. coding_client/auth/rbac.py +21 -0
  19. coding_client/auth/rbac_coding.py +5 -0
  20. coding_client/auth/tenant.py +650 -0
  21. coding_client/auth/websocket.py +148 -0
  22. coding_client/clients/__init__.py +24 -0
  23. coding_client/clients/base.py +131 -0
  24. coding_client/clients/coding_ai.py +33 -0
  25. coding_client/clients/coding_analysis.py +36 -0
  26. coding_client/clients/coding_containers.py +45 -0
  27. coding_client/clients/coding_github.py +127 -0
  28. coding_client/clients/coding_realtime.py +127 -0
  29. coding_client/clients/coding_security.py +51 -0
  30. coding_client/clients/coding_testing.py +31 -0
  31. coding_client/clients/coding_workspaces.py +265 -0
  32. coding_client/config/__init__.py +12 -0
  33. coding_client/config/base_settings.py +61 -0
  34. coding_client/config/yaml_config_loader.py +172 -0
  35. coding_client/db/__init__.py +42 -0
  36. coding_client/db/db_types.py +122 -0
  37. coding_client/db/exceptions.py +59 -0
  38. coding_client/db/postgres_connection.py +572 -0
  39. coding_client/db/tenant_query_helper.py +417 -0
  40. coding_client/db_init.py +49 -0
  41. coding_client/exceptions/__init__.py +67 -0
  42. coding_client/exceptions/api_exceptions.py +395 -0
  43. coding_client/exceptions/pydantic_ai_exceptions.py +533 -0
  44. coding_client/interfaces/__init__.py +22 -0
  45. coding_client/interfaces/cache_interface.py +179 -0
  46. coding_client/interfaces/container_interface.py +49 -0
  47. coding_client/interfaces/docker_interface.py +283 -0
  48. coding_client/interfaces/graph_interface.py +28 -0
  49. coding_client/interfaces/security_interface.py +72 -0
  50. coding_client/interfaces/webhook_interface.py +67 -0
  51. coding_client/llm/__init__.py +54 -0
  52. coding_client/llm/base_agent.py +195 -0
  53. coding_client/llm/context.py +121 -0
  54. coding_client/llm/responses.py +102 -0
  55. coding_client/llm/routing.py +82 -0
  56. coding_client/llm/settings.py +102 -0
  57. coding_client/models/__init__.py +62 -0
  58. coding_client/models/agent.py +38 -0
  59. coding_client/models/ai_test_failure.py +745 -0
  60. coding_client/models/analysis.py +330 -0
  61. coding_client/models/architecture.py +685 -0
  62. coding_client/models/bug.py +128 -0
  63. coding_client/models/code_graph.py +317 -0
  64. coding_client/models/container.py +241 -0
  65. coding_client/models/core.py +878 -0
  66. coding_client/models/docker_container.py +104 -0
  67. coding_client/models/github.py +293 -0
  68. coding_client/models/logging.py +29 -0
  69. coding_client/models/package_manager.py +257 -0
  70. coding_client/models/pr_validation.py +440 -0
  71. coding_client/models/pydantic_ai.py +395 -0
  72. coding_client/models/repo_scanner.py +249 -0
  73. coding_client/models/responses.py +431 -0
  74. coding_client/models/security.py +185 -0
  75. coding_client/models/static_analysis.py +508 -0
  76. coding_client/models/system.py +48 -0
  77. coding_client/models/test_executor.py +204 -0
  78. coding_client/models/testing.py +673 -0
  79. coding_client/models/testing_config.py +200 -0
  80. coding_client/models/validation.py +127 -0
  81. coding_client/models_init.py +272 -0
  82. coding_client/telemetry.py +195 -0
  83. coding_client/testing.py +180 -0
  84. coding_client/types/__init__.py +130 -0
  85. coding_client/types/constraint_types.py +276 -0
  86. coding_client/types/core_types.py +112 -0
  87. coding_client/types/state_machine.py +443 -0
  88. coding_client/utils/__init__.py +86 -0
  89. coding_client/utils/archive_utils.py +387 -0
  90. coding_client/utils/ast_debug.py +45 -0
  91. coding_client/utils/async_timeout.py +364 -0
  92. coding_client/utils/constants.py +518 -0
  93. coding_client/utils/content_processing.py +326 -0
  94. coding_client/utils/database.py +916 -0
  95. coding_client/utils/encoding_helper.py +222 -0
  96. coding_client/utils/enum_helpers.py +166 -0
  97. coding_client/utils/file_operations.py +177 -0
  98. coding_client/utils/filesystem_ops.py +528 -0
  99. coding_client/utils/http_client.py +562 -0
  100. coding_client/utils/path_utils.py +471 -0
  101. coding_client/utils/profiling.py +421 -0
  102. coding_client/utils/response_builder.py +240 -0
  103. coding_client/utils/retry_helper.py +712 -0
  104. coding_client/utils/security_validation.py +423 -0
  105. coding_client-1.21.2.dist-info/METADATA +234 -0
  106. coding_client-1.21.2.dist-info/RECORD +109 -0
  107. coding_client-1.21.2.dist-info/WHEEL +5 -0
  108. coding_client-1.21.2.dist-info/licenses/LICENSE +201 -0
  109. coding_client-1.21.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,122 @@
1
+ """Type definitions for database operations.
2
+
3
+ This module provides TypedDict classes and type aliases for better type safety
4
+ in database operations.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from datetime import datetime
10
+ from typing import Any, TypedDict
11
+
12
+
13
+ class NodeProperties(TypedDict, total=False):
14
+ """Properties stored for code graph nodes."""
15
+
16
+ name: str
17
+ qualified_name: str
18
+ path: str
19
+ file_path: str
20
+ docstring: str | None
21
+ complexity: int | None
22
+ return_type: dict[str, Any] | None
23
+ parameter_types: list[dict[str, Any]]
24
+ properties: dict[str, Any]
25
+ metadata: dict[str, Any]
26
+ content_hash: str
27
+
28
+
29
+ class EdgeProperties(TypedDict, total=False):
30
+ """Properties stored for code graph edges."""
31
+
32
+ weight: float
33
+ context: str | None
34
+ location_file: str | None
35
+ location_line: int | None
36
+ location_column: int | None
37
+
38
+
39
+ class NodeRecord(TypedDict):
40
+ """Complete database record for a node."""
41
+
42
+ id: str
43
+ type: str
44
+ properties: str # JSON-serialized NodeProperties
45
+ created_at: datetime
46
+ updated_at: datetime
47
+ content_hash: str
48
+ file_size: int | None
49
+ # Multi-language fields
50
+ language: str
51
+ file_path: str | None
52
+ line_number: int | None
53
+ column_start: int | None
54
+ column_end: int | None
55
+ visibility: str | None
56
+ is_static: bool
57
+ is_abstract: bool
58
+ is_final: bool
59
+ is_async: bool
60
+ signature: str | None
61
+ docstring: str | None
62
+
63
+
64
+ class EdgeRecord(TypedDict):
65
+ """Complete database record for an edge."""
66
+
67
+ id: int
68
+ source: str
69
+ target: str
70
+ relationship: str
71
+ properties: str | None # JSON-serialized EdgeProperties
72
+ weight: float
73
+ created_at: datetime
74
+ context: str | None
75
+ location_file: str | None
76
+ location_line: int | None
77
+ location_column: int | None
78
+
79
+
80
+ class CoreLanguageStats(TypedDict):
81
+ """Language statistics record."""
82
+
83
+ language: str
84
+ file_path: str
85
+ entity_count: int
86
+ relationship_count: int
87
+ lines_of_code: int
88
+ complexity_score: float
89
+ last_analyzed: datetime
90
+
91
+
92
+ class LanguageSummary(TypedDict):
93
+ """Aggregated language statistics."""
94
+
95
+ file_count: int
96
+ total_entities: int
97
+ total_relationships: int
98
+ total_lines: int
99
+ avg_complexity: float
100
+
101
+
102
+ class SchemaVersion(TypedDict):
103
+ """Schema version record."""
104
+
105
+ version: int
106
+ description: str
107
+ applied_at: datetime
108
+
109
+
110
+ class AnalysisSession(TypedDict):
111
+ """Analysis session tracking record."""
112
+
113
+ id: str
114
+ started_at: datetime
115
+ completed_at: datetime | None
116
+ languages: str # JSON array
117
+ files_processed: int
118
+ files_failed: int
119
+ total_entities: int
120
+ total_relationships: int
121
+ status: str # 'running', 'completed', 'failed'
122
+ error_message: str | None
@@ -0,0 +1,59 @@
1
+ """Database-specific exceptions for code graph operations.
2
+
3
+ This module provides custom exceptions for database operations to enable
4
+ more specific error handling and better error messages.
5
+ """
6
+
7
+
8
+ class DatabaseError(Exception):
9
+ """Base exception for all database-related errors."""
10
+
11
+ pass
12
+
13
+
14
+ class DatabaseConnectionError(DatabaseError):
15
+ """Raised when database connection cannot be established or is lost."""
16
+
17
+ pass
18
+
19
+
20
+ class DatabaseIntegrityError(DatabaseError):
21
+ """Raised when database integrity constraints are violated."""
22
+
23
+ pass
24
+
25
+
26
+ class DatabaseOperationalError(DatabaseError):
27
+ """Raised when database operations fail due to operational issues."""
28
+
29
+ pass
30
+
31
+
32
+ class DatabaseSchemaError(DatabaseError):
33
+ """Raised when database schema operations fail."""
34
+
35
+ pass
36
+
37
+
38
+ class DatabaseMigrationError(DatabaseError):
39
+ """Raised when database migrations fail."""
40
+
41
+ pass
42
+
43
+
44
+ class DatabaseTransactionError(DatabaseError):
45
+ """Raised when database transaction operations fail."""
46
+
47
+ pass
48
+
49
+
50
+ class DatabaseQueryError(DatabaseError):
51
+ """Raised when database queries fail or return unexpected results."""
52
+
53
+ pass
54
+
55
+
56
+ class DatabaseLockError(DatabaseError):
57
+ """Raised when database is locked and operations timeout."""
58
+
59
+ pass