code-memory 1.0.2__tar.gz → 1.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.
- {code_memory-1.0.2 → code_memory-1.0.4}/PKG-INFO +1 -1
- {code_memory-1.0.2 → code_memory-1.0.4}/db.py +1 -2
- {code_memory-1.0.2 → code_memory-1.0.4}/doc_parser.py +0 -2
- {code_memory-1.0.2 → code_memory-1.0.4}/git_search.py +4 -5
- {code_memory-1.0.2 → code_memory-1.0.4}/logging_config.py +1 -1
- {code_memory-1.0.2 → code_memory-1.0.4}/parser.py +1 -5
- code_memory-1.0.4/prompts/milestone_6.xml +756 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/pyproject.toml +1 -1
- {code_memory-1.0.2 → code_memory-1.0.4}/queries.py +99 -2
- {code_memory-1.0.2 → code_memory-1.0.4}/server.py +195 -64
- {code_memory-1.0.2 → code_memory-1.0.4}/tests/test_errors.py +2 -4
- {code_memory-1.0.2 → code_memory-1.0.4}/tests/test_logging.py +1 -3
- {code_memory-1.0.2 → code_memory-1.0.4}/tests/test_tools.py +0 -3
- {code_memory-1.0.2 → code_memory-1.0.4}/uv.lock +1 -1
- {code_memory-1.0.2 → code_memory-1.0.4}/validation.py +0 -1
- {code_memory-1.0.2 → code_memory-1.0.4}/.github/workflows/ci.yml +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/.github/workflows/publish.yml +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/.gitignore +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/.python-version +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/CHANGELOG.md +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/CONTRIBUTING.md +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/LICENSE +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/Makefile +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/README.md +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/errors.py +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_1.xml +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_2.xml +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_3.xml +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_4.xml +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_5.xml +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/tests/__init__.py +0 -0
- {code_memory-1.0.2 → code_memory-1.0.4}/tests/conftest.py +1 -1
- {code_memory-1.0.2 → code_memory-1.0.4}/tests/test_validation.py +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-memory
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: A deterministic, high-precision code intelligence MCP server
|
|
5
5
|
Project-URL: Homepage, https://github.com/kapillamba4/code-memory
|
|
6
6
|
Project-URL: Documentation, https://github.com/kapillamba4/code-memory#readme
|
|
@@ -13,7 +13,6 @@ from __future__ import annotations
|
|
|
13
13
|
|
|
14
14
|
import hashlib
|
|
15
15
|
import sqlite3
|
|
16
|
-
from pathlib import Path
|
|
17
16
|
from typing import TYPE_CHECKING
|
|
18
17
|
|
|
19
18
|
import sqlite_vec
|
|
@@ -220,7 +219,7 @@ def file_hash(filepath: str) -> str:
|
|
|
220
219
|
|
|
221
220
|
def upsert_file(db: sqlite3.Connection, path: str, last_modified: float, fhash: str) -> int:
|
|
222
221
|
"""Insert or update a file record. Returns the file_id."""
|
|
223
|
-
|
|
222
|
+
db.execute(
|
|
224
223
|
"""
|
|
225
224
|
INSERT INTO files (path, last_modified, file_hash)
|
|
226
225
|
VALUES (?, ?, ?)
|
|
@@ -15,14 +15,13 @@ Design rules
|
|
|
15
15
|
|
|
16
16
|
from __future__ import annotations
|
|
17
17
|
|
|
18
|
-
from datetime import
|
|
18
|
+
from datetime import UTC, datetime
|
|
19
19
|
from pathlib import Path
|
|
20
20
|
from typing import Any
|
|
21
21
|
|
|
22
22
|
import git
|
|
23
23
|
from git.exc import InvalidGitRepositoryError, NoSuchPathError
|
|
24
24
|
|
|
25
|
-
|
|
26
25
|
# ---------------------------------------------------------------------------
|
|
27
26
|
# Helpers
|
|
28
27
|
# ---------------------------------------------------------------------------
|
|
@@ -34,7 +33,7 @@ def _commit_to_dict(commit: git.Commit, *, include_files_changed_count: bool = F
|
|
|
34
33
|
include_files_changed_count: If True, compute the number of files
|
|
35
34
|
changed (triggers a diff — slow for bulk iteration).
|
|
36
35
|
"""
|
|
37
|
-
dt = datetime.fromtimestamp(commit.committed_date, tz=
|
|
36
|
+
dt = datetime.fromtimestamp(commit.committed_date, tz=UTC)
|
|
38
37
|
result: dict[str, Any] = {
|
|
39
38
|
"hash": commit.hexsha[:7],
|
|
40
39
|
"full_hash": commit.hexsha,
|
|
@@ -143,7 +142,7 @@ def get_commit_detail(
|
|
|
143
142
|
return {"error": f"Could not resolve commit '{commit_hash}': {exc}"}
|
|
144
143
|
|
|
145
144
|
try:
|
|
146
|
-
dt = datetime.fromtimestamp(commit.committed_date, tz=
|
|
145
|
+
dt = datetime.fromtimestamp(commit.committed_date, tz=UTC)
|
|
147
146
|
|
|
148
147
|
parent_hashes = [p.hexsha[:7] for p in commit.parents]
|
|
149
148
|
|
|
@@ -271,7 +270,7 @@ def get_blame(
|
|
|
271
270
|
"full_hash": commit.hexsha,
|
|
272
271
|
"author": str(commit.author),
|
|
273
272
|
"date": datetime.fromtimestamp(
|
|
274
|
-
commit.committed_date, tz=
|
|
273
|
+
commit.committed_date, tz=UTC
|
|
275
274
|
).isoformat(),
|
|
276
275
|
"line_content": line_text,
|
|
277
276
|
"commit_message": commit.message.strip().split("\n")[0],
|
|
@@ -96,7 +96,7 @@ class ToolLogger:
|
|
|
96
96
|
self.result_count: int | None = None
|
|
97
97
|
self.error: str | None = None
|
|
98
98
|
|
|
99
|
-
def __enter__(self) ->
|
|
99
|
+
def __enter__(self) -> ToolLogger:
|
|
100
100
|
self.start_time = datetime.now()
|
|
101
101
|
# Sanitize params for logging (don't log sensitive data)
|
|
102
102
|
safe_params = {k: v for k, v in self.params.items() if v is not None}
|
|
@@ -14,7 +14,7 @@ import os
|
|
|
14
14
|
from pathlib import Path
|
|
15
15
|
from typing import Any
|
|
16
16
|
|
|
17
|
-
from tree_sitter import Language,
|
|
17
|
+
from tree_sitter import Language, Node, Parser
|
|
18
18
|
|
|
19
19
|
import db as db_mod
|
|
20
20
|
|
|
@@ -110,7 +110,6 @@ _NODE_KIND_MAP: dict[str, tuple[str, bool]] = {
|
|
|
110
110
|
"constructor_declaration": ("method", False),
|
|
111
111
|
"interface_declaration": ("class", True),
|
|
112
112
|
# Go (function_declaration already mapped above for JS/TS/Kotlin)
|
|
113
|
-
"method_declaration": ("method", False),
|
|
114
113
|
"type_spec": ("class", False),
|
|
115
114
|
# Rust
|
|
116
115
|
"function_item": ("function", False),
|
|
@@ -119,12 +118,9 @@ _NODE_KIND_MAP: dict[str, tuple[str, bool]] = {
|
|
|
119
118
|
"enum_item": ("class", False),
|
|
120
119
|
"trait_item": ("class", True),
|
|
121
120
|
# C / C++
|
|
122
|
-
"function_definition": ("function", False),
|
|
123
121
|
"struct_specifier": ("class", False),
|
|
124
122
|
"class_specifier": ("class", True),
|
|
125
123
|
# Kotlin
|
|
126
|
-
"function_declaration": ("function", False),
|
|
127
|
-
"class_declaration": ("class", True),
|
|
128
124
|
"object_declaration": ("class", True),
|
|
129
125
|
"companion_object": ("class", True),
|
|
130
126
|
# Ruby
|