code-analysis-client 1.6.45__tar.gz → 1.6.53__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 (24) hide show
  1. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/PKG-INFO +9 -4
  2. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/README.md +7 -2
  3. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/client.py +1 -1
  4. code_analysis_client-1.6.53/code_analysis_client/universal_file.py +50 -0
  5. code_analysis_client-1.6.53/code_analysis_client/version.txt +1 -0
  6. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client.egg-info/PKG-INFO +9 -4
  7. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client.egg-info/requires.txt +1 -1
  8. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/pyproject.toml +1 -1
  9. code_analysis_client-1.6.45/code_analysis_client/universal_file.py +0 -130
  10. code_analysis_client-1.6.45/code_analysis_client/version.txt +0 -1
  11. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/__init__.py +0 -0
  12. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/commands_proxy.py +0 -0
  13. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/config.py +0 -0
  14. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/exceptions.py +0 -0
  15. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/file_session.py +0 -0
  16. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/py.typed +0 -0
  17. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/responses.py +0 -0
  18. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/server_api.py +0 -0
  19. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/server_schema.py +0 -0
  20. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client/validation.py +0 -0
  21. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client.egg-info/SOURCES.txt +0 -0
  22. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client.egg-info/dependency_links.txt +0 -0
  23. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/code_analysis_client.egg-info/top_level.txt +0 -0
  24. {code_analysis_client-1.6.45 → code_analysis_client-1.6.53}/setup.cfg +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-analysis-client
3
- Version: 1.6.45
3
+ Version: 1.6.53
4
4
  Summary: Async JSON-RPC client for the code-analysis MCP server (mcp-proxy-adapter JsonRpcClient)
5
5
  Author-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
6
6
  Requires-Python: >=3.10
7
7
  Description-Content-Type: text/markdown
8
- Requires-Dist: mcp-proxy-adapter>=8.10.15
8
+ Requires-Dist: mcp-proxy-adapter>=8.10.19
9
9
  Provides-Extra: dev
10
10
  Requires-Dist: pytest>=8.0; extra == "dev"
11
11
  Requires-Dist: pytest-asyncio>=0.25.0; extra == "dev"
@@ -84,13 +84,18 @@ from the server registry. Use the facades below or generic `call` / `commands.*`
84
84
  | Facade | Property | Server commands |
85
85
  |--------|----------|-----------------|
86
86
  | Client DB sessions + transfer | `client.file_sessions` | `session_*`, `subordinate_session_*`, `project_file_transfer_*`, `project_file_advisory_lock_batch` |
87
- | Universal edit sessions | `client.universal_files` | `universal_file_open`, `edit`, `write`, `close`, `preview` |
87
+ | Universal file preview | `client.universal_files` | `universal_file_preview` (read-only) |
88
88
  | Any registered command | `client.call` / `client.commands.<name>` | schema from live `help()` |
89
89
 
90
90
  Canonical command lists: `code_analysis_client.server_api` — exported as
91
91
  `FILE_SESSION_COMMANDS`, `FILE_SESSION_FACADE_METHODS`, `CLIENT_FACADE_COMMANDS`,
92
92
  `REMOVED_COMMANDS`.
93
93
 
94
+ **Scope boundary:** this client manipulates files only as whole units — transfer,
95
+ locks, sessions, and structured read-only preview — and analyzes them. Content
96
+ editing (open/edit/write/close draft sessions) is not served by this project's
97
+ code-analysis server; use the ai-editor client for that.
98
+
94
99
  Sync checks (in-process registry):
95
100
 
96
101
  ```bash
@@ -110,7 +115,7 @@ documentation** is embedded in the **module docstrings** of those Python files
110
115
  |--------|---------|
111
116
  | `run_all_examples.py` | Full API tour + runs all live sibling scripts |
112
117
  | `ex_minimal_validated.py` | Smallest validated RPC example |
113
- | `ex_universal_files.py` | All `UniversalFileClient` methods (open/edit/write/close/preview) |
118
+ | `ex_universal_files.py` | `UniversalFileClient.preview` (read-only structured preview) |
114
119
  | `ex_session_view_subordinates.py` | `session_view` and subordinate CRUD |
115
120
  | `ex_file_sessions.py` | Sessions, locks, transfer roundtrip |
116
121
  | `ex_config_only.py` | Parse `config.json` without TCP |
@@ -72,13 +72,18 @@ from the server registry. Use the facades below or generic `call` / `commands.*`
72
72
  | Facade | Property | Server commands |
73
73
  |--------|----------|-----------------|
74
74
  | Client DB sessions + transfer | `client.file_sessions` | `session_*`, `subordinate_session_*`, `project_file_transfer_*`, `project_file_advisory_lock_batch` |
75
- | Universal edit sessions | `client.universal_files` | `universal_file_open`, `edit`, `write`, `close`, `preview` |
75
+ | Universal file preview | `client.universal_files` | `universal_file_preview` (read-only) |
76
76
  | Any registered command | `client.call` / `client.commands.<name>` | schema from live `help()` |
77
77
 
78
78
  Canonical command lists: `code_analysis_client.server_api` — exported as
79
79
  `FILE_SESSION_COMMANDS`, `FILE_SESSION_FACADE_METHODS`, `CLIENT_FACADE_COMMANDS`,
80
80
  `REMOVED_COMMANDS`.
81
81
 
82
+ **Scope boundary:** this client manipulates files only as whole units — transfer,
83
+ locks, sessions, and structured read-only preview — and analyzes them. Content
84
+ editing (open/edit/write/close draft sessions) is not served by this project's
85
+ code-analysis server; use the ai-editor client for that.
86
+
82
87
  Sync checks (in-process registry):
83
88
 
84
89
  ```bash
@@ -98,7 +103,7 @@ documentation** is embedded in the **module docstrings** of those Python files
98
103
  |--------|---------|
99
104
  | `run_all_examples.py` | Full API tour + runs all live sibling scripts |
100
105
  | `ex_minimal_validated.py` | Smallest validated RPC example |
101
- | `ex_universal_files.py` | All `UniversalFileClient` methods (open/edit/write/close/preview) |
106
+ | `ex_universal_files.py` | `UniversalFileClient.preview` (read-only structured preview) |
102
107
  | `ex_session_view_subordinates.py` | `session_view` and subordinate CRUD |
103
108
  | `ex_file_sessions.py` | Sessions, locks, transfer roundtrip |
104
109
  | `ex_config_only.py` | Parse `config.json` without TCP |
@@ -128,7 +128,7 @@ class CodeAnalysisAsyncClient:
128
128
 
129
129
  @property
130
130
  def universal_files(self) -> UniversalFileClient:
131
- """Universal edit-session workflow (``universal_file_*`` commands)."""
131
+ """Read-only structured preview (``universal_file_preview`` command)."""
132
132
  return UniversalFileClient(self)
133
133
 
134
134
  async def get_command_schema(
@@ -0,0 +1,50 @@
1
+ """
2
+ Read-only structured file preview on top of :class:`CodeAnalysisAsyncClient`.
3
+
4
+ Wraps ``universal_file_preview`` only. Content editing (open/edit/write/close
5
+ sessions) is not served by this project's code-analysis server; that workflow
6
+ lives in the ai-editor client instead.
7
+
8
+ Author: Vasiliy Zdanovskiy
9
+ email: vasilyvz@gmail.com
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from typing import TYPE_CHECKING, Any, Dict
15
+
16
+ from code_analysis_client.responses import unwrap_command_result
17
+
18
+ if TYPE_CHECKING:
19
+ from code_analysis_client.client import CodeAnalysisAsyncClient
20
+
21
+
22
+ class UniversalFileClient:
23
+ """Read-only structured preview for project files.
24
+
25
+ Wraps ``universal_file_preview`` (the only ``universal_file_*`` command
26
+ still registered on the code-analysis server). Content editing belongs to
27
+ the ai-editor client, not this package.
28
+ """
29
+
30
+ __slots__ = ("_client",)
31
+
32
+ def __init__(self, client: CodeAnalysisAsyncClient) -> None:
33
+ """Store the async client used for universal file preview commands."""
34
+ self._client = client
35
+
36
+ async def preview(
37
+ self,
38
+ project_id: str,
39
+ file_path: str,
40
+ **kwargs: Any,
41
+ ) -> Dict[str, Any]:
42
+ """Structured read-only preview (``universal_file_preview``)."""
43
+ params: Dict[str, Any] = {
44
+ "project_id": project_id,
45
+ "file_path": file_path,
46
+ }
47
+ params.update(kwargs)
48
+ return unwrap_command_result(
49
+ await self._client.call_validated("universal_file_preview", params)
50
+ )
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-analysis-client
3
- Version: 1.6.45
3
+ Version: 1.6.53
4
4
  Summary: Async JSON-RPC client for the code-analysis MCP server (mcp-proxy-adapter JsonRpcClient)
5
5
  Author-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
6
6
  Requires-Python: >=3.10
7
7
  Description-Content-Type: text/markdown
8
- Requires-Dist: mcp-proxy-adapter>=8.10.15
8
+ Requires-Dist: mcp-proxy-adapter>=8.10.19
9
9
  Provides-Extra: dev
10
10
  Requires-Dist: pytest>=8.0; extra == "dev"
11
11
  Requires-Dist: pytest-asyncio>=0.25.0; extra == "dev"
@@ -84,13 +84,18 @@ from the server registry. Use the facades below or generic `call` / `commands.*`
84
84
  | Facade | Property | Server commands |
85
85
  |--------|----------|-----------------|
86
86
  | Client DB sessions + transfer | `client.file_sessions` | `session_*`, `subordinate_session_*`, `project_file_transfer_*`, `project_file_advisory_lock_batch` |
87
- | Universal edit sessions | `client.universal_files` | `universal_file_open`, `edit`, `write`, `close`, `preview` |
87
+ | Universal file preview | `client.universal_files` | `universal_file_preview` (read-only) |
88
88
  | Any registered command | `client.call` / `client.commands.<name>` | schema from live `help()` |
89
89
 
90
90
  Canonical command lists: `code_analysis_client.server_api` — exported as
91
91
  `FILE_SESSION_COMMANDS`, `FILE_SESSION_FACADE_METHODS`, `CLIENT_FACADE_COMMANDS`,
92
92
  `REMOVED_COMMANDS`.
93
93
 
94
+ **Scope boundary:** this client manipulates files only as whole units — transfer,
95
+ locks, sessions, and structured read-only preview — and analyzes them. Content
96
+ editing (open/edit/write/close draft sessions) is not served by this project's
97
+ code-analysis server; use the ai-editor client for that.
98
+
94
99
  Sync checks (in-process registry):
95
100
 
96
101
  ```bash
@@ -110,7 +115,7 @@ documentation** is embedded in the **module docstrings** of those Python files
110
115
  |--------|---------|
111
116
  | `run_all_examples.py` | Full API tour + runs all live sibling scripts |
112
117
  | `ex_minimal_validated.py` | Smallest validated RPC example |
113
- | `ex_universal_files.py` | All `UniversalFileClient` methods (open/edit/write/close/preview) |
118
+ | `ex_universal_files.py` | `UniversalFileClient.preview` (read-only structured preview) |
114
119
  | `ex_session_view_subordinates.py` | `session_view` and subordinate CRUD |
115
120
  | `ex_file_sessions.py` | Sessions, locks, transfer roundtrip |
116
121
  | `ex_config_only.py` | Parse `config.json` without TCP |
@@ -1,4 +1,4 @@
1
- mcp-proxy-adapter>=8.10.15
1
+ mcp-proxy-adapter>=8.10.19
2
2
 
3
3
  [dev]
4
4
  pytest>=8.0
@@ -12,7 +12,7 @@ authors = [
12
12
  { name = "Vasiliy Zdanovskiy", email = "vasilyvz@gmail.com" },
13
13
  ]
14
14
  dependencies = [
15
- "mcp-proxy-adapter>=8.10.15",
15
+ "mcp-proxy-adapter>=8.10.19",
16
16
  ]
17
17
 
18
18
  [project.optional-dependencies]
@@ -1,130 +0,0 @@
1
- """
2
- Universal file edit-session workflow on top of :class:`CodeAnalysisAsyncClient`.
3
-
4
- Wraps ``universal_file_open`` / ``edit`` / ``write`` / ``close`` / ``preview`` only.
5
- Legacy ``universal_file_read`` / ``universal_file_save`` and CST commands are not
6
- part of this API (see :mod:`server_api`).
7
-
8
- Author: Vasiliy Zdanovskiy
9
- email: vasilyvz@gmail.com
10
- """
11
-
12
- from __future__ import annotations
13
-
14
- from typing import TYPE_CHECKING, Any, Dict, List, Optional
15
-
16
- from code_analysis_client.responses import unwrap_command_result
17
-
18
- if TYPE_CHECKING:
19
- from code_analysis_client.client import CodeAnalysisAsyncClient
20
-
21
-
22
- class UniversalFileClient:
23
- """Edit-session workflow for project files (open → edit → write → close).
24
-
25
- Uses ``session_id`` from ``universal_file_open`` only. Not related to
26
- client ``session_*`` commands (``session_create``, ``session_open_file``, …).
27
- """
28
-
29
- __slots__ = ("_client",)
30
-
31
- def __init__(self, client: CodeAnalysisAsyncClient) -> None:
32
- """Store the async client used for universal file workflow commands."""
33
- self._client = client
34
-
35
- async def open(
36
- self,
37
- project_id: str,
38
- file_path: str,
39
- *,
40
- create: bool = False,
41
- initial_content: Optional[str] = None,
42
- ) -> Dict[str, Any]:
43
- """Start an edit session (``universal_file_open``).
44
-
45
- Identifies the file by ``project_id`` + ``file_path`` (not ``file_id``).
46
- """
47
- params: Dict[str, Any] = {
48
- "project_id": project_id,
49
- "file_path": file_path,
50
- "create": create,
51
- }
52
- if initial_content is not None:
53
- params["initial_content"] = initial_content
54
- return unwrap_command_result(
55
- await self._client.call_validated("universal_file_open", params)
56
- )
57
-
58
- async def edit(
59
- self,
60
- project_id: str,
61
- session_id: str,
62
- operations: List[Dict[str, Any]],
63
- ) -> Dict[str, Any]:
64
- """Apply draft mutations (``universal_file_edit``)."""
65
- return unwrap_command_result(
66
- await self._client.call_validated(
67
- "universal_file_edit",
68
- {
69
- "project_id": project_id,
70
- "session_id": session_id,
71
- "operations": operations,
72
- },
73
- )
74
- )
75
-
76
- async def write(
77
- self,
78
- project_id: str,
79
- session_id: str,
80
- *,
81
- write_mode: str = "commit",
82
- ) -> Dict[str, Any]:
83
- """Persist or preview draft (``universal_file_write``).
84
-
85
- Default ``write_mode`` is ``commit`` in this client wrapper. The server
86
- default when the parameter is omitted is ``preview``. Pass
87
- ``write_mode='preview'`` first to inspect the diff, then ``commit``.
88
- """
89
- return unwrap_command_result(
90
- await self._client.call_validated(
91
- "universal_file_write",
92
- {
93
- "project_id": project_id,
94
- "session_id": session_id,
95
- "write_mode": write_mode,
96
- },
97
- )
98
- )
99
-
100
- async def close(
101
- self,
102
- project_id: str,
103
- session_id: str,
104
- ) -> Dict[str, Any]:
105
- """End edit session (``universal_file_open`` session_id, not client ``session_*``)."""
106
- return unwrap_command_result(
107
- await self._client.call_validated(
108
- "universal_file_close",
109
- {
110
- "project_id": project_id,
111
- "session_id": session_id,
112
- },
113
- )
114
- )
115
-
116
- async def preview(
117
- self,
118
- project_id: str,
119
- file_path: str,
120
- **kwargs: Any,
121
- ) -> Dict[str, Any]:
122
- """Structured read-only preview (``universal_file_preview``)."""
123
- params: Dict[str, Any] = {
124
- "project_id": project_id,
125
- "file_path": file_path,
126
- }
127
- params.update(kwargs)
128
- return unwrap_command_result(
129
- await self._client.call_validated("universal_file_preview", params)
130
- )