code-analysis-client 1.0.5__tar.gz → 1.0.9__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_analysis_client-1.0.5 → code_analysis_client-1.0.9}/PKG-INFO +25 -11
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/README.md +24 -10
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/__init__.py +6 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/client.py +1 -1
- code_analysis_client-1.0.9/code_analysis_client/file_session.py +682 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/server_api.py +72 -1
- code_analysis_client-1.0.9/code_analysis_client/version.txt +1 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client.egg-info/PKG-INFO +25 -11
- code_analysis_client-1.0.5/code_analysis_client/file_session.py +0 -389
- code_analysis_client-1.0.5/code_analysis_client/version.txt +0 -1
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/commands_proxy.py +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/config.py +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/exceptions.py +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/py.typed +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/responses.py +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/server_schema.py +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/universal_file.py +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client/validation.py +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client.egg-info/SOURCES.txt +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client.egg-info/dependency_links.txt +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client.egg-info/requires.txt +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/code_analysis_client.egg-info/top_level.txt +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/pyproject.toml +0 -0
- {code_analysis_client-1.0.5 → code_analysis_client-1.0.9}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-analysis-client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.9
|
|
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
|
|
@@ -75,7 +75,7 @@ async with CodeAnalysisAsyncClient(host="127.0.0.1", port=15001) as client:
|
|
|
75
75
|
|
|
76
76
|
Use `call_unified_validated` when you need queue polling. Pass `refresh_schema=True` on a single call to bypass the in-memory schema cache.
|
|
77
77
|
|
|
78
|
-
## High-level facades (aligned with server
|
|
78
|
+
## High-level facades (aligned with live server registry)
|
|
79
79
|
|
|
80
80
|
The client does **not** wrap CST commands (`cst_load_file`, …) or legacy file I/O
|
|
81
81
|
(`universal_file_read`, `read_project_text_file`, …). Those commands are removed
|
|
@@ -83,28 +83,42 @@ from the server registry. Use the facades below or generic `call` / `commands.*`
|
|
|
83
83
|
|
|
84
84
|
| Facade | Property | Server commands |
|
|
85
85
|
|--------|----------|-----------------|
|
|
86
|
-
| Client DB sessions + transfer | `client.file_sessions` | `session_*`, `project_file_transfer_*`, `project_file_advisory_lock_batch` |
|
|
86
|
+
| Client DB sessions + transfer | `client.file_sessions` | `session_*`, `subordinate_session_*`, `project_file_transfer_*`, `project_file_advisory_lock_batch` |
|
|
87
87
|
| Universal edit sessions | `client.universal_files` | `universal_file_open`, `edit`, `write`, `close`, `preview` |
|
|
88
88
|
| Any registered command | `client.call` / `client.commands.<name>` | schema from live `help()` |
|
|
89
89
|
|
|
90
|
-
Canonical command lists: `code_analysis_client.server_api`
|
|
91
|
-
`
|
|
90
|
+
Canonical command lists: `code_analysis_client.server_api` — exported as
|
|
91
|
+
`FILE_SESSION_COMMANDS`, `FILE_SESSION_FACADE_METHODS`, `CLIENT_FACADE_COMMANDS`,
|
|
92
|
+
`REMOVED_COMMANDS`.
|
|
92
93
|
|
|
93
|
-
Sync
|
|
94
|
+
Sync checks (in-process registry):
|
|
94
95
|
|
|
95
96
|
```bash
|
|
96
|
-
pytest tests/test_client_server_api_sync.py
|
|
97
|
+
pytest tests/test_client_server_api_sync.py tests/test_code_analysis_client.py -k session
|
|
97
98
|
```
|
|
98
99
|
|
|
99
|
-
Package version
|
|
100
|
+
Package version is in ``client/code_analysis_client/version.txt`` (synced with the
|
|
101
|
+
root ``code-analysis`` project via ``scripts/sync_code_analysis_client_version.py``).
|
|
100
102
|
|
|
101
103
|
## Examples (this repository)
|
|
102
104
|
|
|
103
105
|
Runnable scripts live under `client/examples/`. **Long-form “man page” style
|
|
104
106
|
documentation** is embedded in the **module docstrings** of those Python files
|
|
105
|
-
(see `client/examples/README.md` for how to read them).
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
(see `client/examples/README.md` for how to read them).
|
|
108
|
+
|
|
109
|
+
| Script | Purpose |
|
|
110
|
+
|--------|---------|
|
|
111
|
+
| `run_all_examples.py` | Full API tour + runs all live sibling scripts |
|
|
112
|
+
| `ex_minimal_validated.py` | Smallest validated RPC example |
|
|
113
|
+
| `ex_universal_files.py` | All `UniversalFileClient` methods (open/edit/write/close/preview) |
|
|
114
|
+
| `ex_session_view_subordinates.py` | `session_view` and subordinate CRUD |
|
|
115
|
+
| `ex_file_sessions.py` | Sessions, locks, transfer roundtrip |
|
|
116
|
+
| `ex_config_only.py` | Parse `config.json` without TCP |
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
casmgr --config config.json start
|
|
120
|
+
python client/examples/run_all_examples.py
|
|
121
|
+
```
|
|
108
122
|
|
|
109
123
|
## Development
|
|
110
124
|
|
|
@@ -63,7 +63,7 @@ async with CodeAnalysisAsyncClient(host="127.0.0.1", port=15001) as client:
|
|
|
63
63
|
|
|
64
64
|
Use `call_unified_validated` when you need queue polling. Pass `refresh_schema=True` on a single call to bypass the in-memory schema cache.
|
|
65
65
|
|
|
66
|
-
## High-level facades (aligned with server
|
|
66
|
+
## High-level facades (aligned with live server registry)
|
|
67
67
|
|
|
68
68
|
The client does **not** wrap CST commands (`cst_load_file`, …) or legacy file I/O
|
|
69
69
|
(`universal_file_read`, `read_project_text_file`, …). Those commands are removed
|
|
@@ -71,28 +71,42 @@ from the server registry. Use the facades below or generic `call` / `commands.*`
|
|
|
71
71
|
|
|
72
72
|
| Facade | Property | Server commands |
|
|
73
73
|
|--------|----------|-----------------|
|
|
74
|
-
| Client DB sessions + transfer | `client.file_sessions` | `session_*`, `project_file_transfer_*`, `project_file_advisory_lock_batch` |
|
|
74
|
+
| Client DB sessions + transfer | `client.file_sessions` | `session_*`, `subordinate_session_*`, `project_file_transfer_*`, `project_file_advisory_lock_batch` |
|
|
75
75
|
| Universal edit sessions | `client.universal_files` | `universal_file_open`, `edit`, `write`, `close`, `preview` |
|
|
76
76
|
| Any registered command | `client.call` / `client.commands.<name>` | schema from live `help()` |
|
|
77
77
|
|
|
78
|
-
Canonical command lists: `code_analysis_client.server_api`
|
|
79
|
-
`
|
|
78
|
+
Canonical command lists: `code_analysis_client.server_api` — exported as
|
|
79
|
+
`FILE_SESSION_COMMANDS`, `FILE_SESSION_FACADE_METHODS`, `CLIENT_FACADE_COMMANDS`,
|
|
80
|
+
`REMOVED_COMMANDS`.
|
|
80
81
|
|
|
81
|
-
Sync
|
|
82
|
+
Sync checks (in-process registry):
|
|
82
83
|
|
|
83
84
|
```bash
|
|
84
|
-
pytest tests/test_client_server_api_sync.py
|
|
85
|
+
pytest tests/test_client_server_api_sync.py tests/test_code_analysis_client.py -k session
|
|
85
86
|
```
|
|
86
87
|
|
|
87
|
-
Package version
|
|
88
|
+
Package version is in ``client/code_analysis_client/version.txt`` (synced with the
|
|
89
|
+
root ``code-analysis`` project via ``scripts/sync_code_analysis_client_version.py``).
|
|
88
90
|
|
|
89
91
|
## Examples (this repository)
|
|
90
92
|
|
|
91
93
|
Runnable scripts live under `client/examples/`. **Long-form “man page” style
|
|
92
94
|
documentation** is embedded in the **module docstrings** of those Python files
|
|
93
|
-
(see `client/examples/README.md` for how to read them).
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
(see `client/examples/README.md` for how to read them).
|
|
96
|
+
|
|
97
|
+
| Script | Purpose |
|
|
98
|
+
|--------|---------|
|
|
99
|
+
| `run_all_examples.py` | Full API tour + runs all live sibling scripts |
|
|
100
|
+
| `ex_minimal_validated.py` | Smallest validated RPC example |
|
|
101
|
+
| `ex_universal_files.py` | All `UniversalFileClient` methods (open/edit/write/close/preview) |
|
|
102
|
+
| `ex_session_view_subordinates.py` | `session_view` and subordinate CRUD |
|
|
103
|
+
| `ex_file_sessions.py` | Sessions, locks, transfer roundtrip |
|
|
104
|
+
| `ex_config_only.py` | Parse `config.json` without TCP |
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
casmgr --config config.json start
|
|
108
|
+
python client/examples/run_all_examples.py
|
|
109
|
+
```
|
|
96
110
|
|
|
97
111
|
## Development
|
|
98
112
|
|
|
@@ -21,8 +21,11 @@ from code_analysis_client.file_session import FileSessionClient, SessionNotFound
|
|
|
21
21
|
from code_analysis_client.server_api import (
|
|
22
22
|
CLIENT_FACADE_COMMANDS,
|
|
23
23
|
CST_REMOVED_COMMANDS,
|
|
24
|
+
FILE_SESSION_COMMANDS,
|
|
25
|
+
FILE_SESSION_FACADE_METHODS,
|
|
24
26
|
LEGACY_REMOVED_COMMANDS,
|
|
25
27
|
REMOVED_COMMANDS,
|
|
28
|
+
TRANSFER_FACADE_METHODS,
|
|
26
29
|
UNIVERSAL_FILE_COMMANDS,
|
|
27
30
|
)
|
|
28
31
|
from code_analysis_client.universal_file import UniversalFileClient
|
|
@@ -40,10 +43,13 @@ __all__ = [
|
|
|
40
43
|
"CST_REMOVED_COMMANDS",
|
|
41
44
|
"ClientValidationError",
|
|
42
45
|
"CodeAnalysisAsyncClient",
|
|
46
|
+
"FILE_SESSION_COMMANDS",
|
|
47
|
+
"FILE_SESSION_FACADE_METHODS",
|
|
43
48
|
"FileSessionClient",
|
|
44
49
|
"LEGACY_REMOVED_COMMANDS",
|
|
45
50
|
"REMOVED_COMMANDS",
|
|
46
51
|
"SessionNotFoundError",
|
|
52
|
+
"TRANSFER_FACADE_METHODS",
|
|
47
53
|
"UNIVERSAL_FILE_COMMANDS",
|
|
48
54
|
"UniversalFileClient",
|
|
49
55
|
"ValidatedCommandsProxy",
|
|
@@ -123,7 +123,7 @@ class CodeAnalysisAsyncClient:
|
|
|
123
123
|
|
|
124
124
|
@property
|
|
125
125
|
def file_sessions(self) -> FileSessionClient:
|
|
126
|
-
"""Session
|
|
126
|
+
"""Session workflow: ``session_*``, ``subordinate_session_*``, transfer, advisory locks."""
|
|
127
127
|
return FileSessionClient(self)
|
|
128
128
|
|
|
129
129
|
@property
|