answer42 0.5.5__tar.gz → 0.5.7__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.
- {answer42-0.5.5 → answer42-0.5.7}/PKG-INFO +1 -1
- {answer42-0.5.5 → answer42-0.5.7}/pyproject.toml +1 -1
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/assets/MCPTestClient.cf +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/assets/MCPTestManager.cf +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/credentials.py +25 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/os_support.py +4 -2
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/server.py +101 -19
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/webclient_probe.py +7 -0
- {answer42-0.5.5 → answer42-0.5.7}/.gitignore +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/LICENSE +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/README.md +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/credentials.example.json +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/docs/agent-installation.md +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/docs/architecture.md +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/docs/assets/answer42-logo.png +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/docs/assets/platform42-logo.svg +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/docs/installation.md +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/scripts/build_cf.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/scripts/build_pages.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/scripts/e2e_http_smoke.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/scripts/e2e_stable.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/scripts/openclaw_mcp_autoreload.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/scripts/rag_cli.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/scripts/read_webclient_start_info.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/cf/ConfigDumpInfo.xml +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/cf/Configuration.xml +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/cf/DataProcessors/MCPTestManager/Ext/ObjectModule.bsl +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/cf/DataProcessors/MCPTestManager/Forms//320/244/320/276/321/200/320/274/320/260/Ext/Form/Module.bsl" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/cf/DataProcessors/MCPTestManager/Forms//320/244/320/276/321/200/320/274/320/260/Ext/Form.xml" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/cf/DataProcessors/MCPTestManager/Forms//320/244/320/276/321/200/320/274/320/260.xml" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/cf/DataProcessors/MCPTestManager.xml +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/cf/Ext/ManagedApplicationModule.bsl +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/cf/Languages//320/240/321/203/321/201/321/201/320/272/320/270/320/271.xml" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/Catalogs//320/237/320/241_/320/222/320/273/320/260/320/264/320/265/320/273/320/265/321/206.xml" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/Catalogs//320/237/320/241_/320/241/320/277/321/200/320/260/320/262/320/276/321/207/320/275/320/270/320/2721.xml" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/ConfigDumpInfo.xml +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/Configuration.xml +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/Languages//320/240/321/203/321/201/321/201/320/272/320/270/320/271.xml" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/Reports//320/237/320/241_/320/241/320/277/320/270/321/201/320/276/320/272/320/255/320/273/320/265/320/274/320/265/320/275/321/202/320/276/320/262/Ext/ManagerModule.bsl" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/Reports//320/237/320/241_/320/241/320/277/320/270/321/201/320/276/320/272/320/255/320/273/320/265/320/274/320/265/320/275/321/202/320/276/320/262/Ext/ObjectModule.bsl" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/Reports//320/237/320/241_/320/241/320/277/320/270/321/201/320/276/320/272/320/255/320/273/320/265/320/274/320/265/320/275/321/202/320/276/320/262/Templates//320/236/321/201/320/275/320/276/320/262/320/275/320/260/321/217/320/241/321/205/320/265/320/274/320/260/320/232/320/276/320/274/320/277/320/276/320/275/320/276/320/262/320/272/320/270/320/224/320/260/320/275/320/275/321/213/321/205/Ext/Template.xml" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/Reports//320/237/320/241_/320/241/320/277/320/270/321/201/320/276/320/272/320/255/320/273/320/265/320/274/320/265/320/275/321/202/320/276/320/262/Templates//320/236/321/201/320/275/320/276/320/262/320/275/320/260/321/217/320/241/321/205/320/265/320/274/320/260/320/232/320/276/320/274/320/277/320/276/320/275/320/276/320/262/320/272/320/270/320/224/320/260/320/275/320/275/321/213/321/205.xml" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/client_cf/Reports//320/237/320/241_/320/241/320/277/320/270/321/201/320/276/320/272/320/255/320/273/320/265/320/274/320/265/320/275/321/202/320/276/320/262.xml" +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/__init__.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/assets/__init__.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/auth.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/bridge.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/platform.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/protocol.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/rag/__init__.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/rag/detect.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/rag/dump.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/rag/model.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/rag/parsers.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/rag/service.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/rag/store.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/rag/summary_backend.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/rag/summary_vector.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/recorder.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/release_helper.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/runtime.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/skill_installer.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/win_desktop.py +0 -0
- {answer42-0.5.5 → answer42-0.5.7}/src/mcp_1c/window_control.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: answer42
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.7
|
|
4
4
|
Summary: Answer42 — The Answer to Life, Universe, and 1C — UI Driver. MCP-powered 1C:Enterprise UI automation: click, fill, navigate, test, and introspect managed forms through the test-client API
|
|
5
5
|
Author: Marvin (AI Assistant), 42Clouds, and contributors
|
|
6
6
|
Author-email: "Kosolapov Stanislav (proDOOMman)" <prodoomman@gmail.com>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "answer42"
|
|
3
|
-
version = "0.5.
|
|
3
|
+
version = "0.5.7"
|
|
4
4
|
description = "Answer42 — The Answer to Life, Universe, and 1C — UI Driver. MCP-powered 1C:Enterprise UI automation: click, fill, navigate, test, and introspect managed forms through the test-client API"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
Binary file
|
|
Binary file
|
|
@@ -110,6 +110,31 @@ class CredentialsStore:
|
|
|
110
110
|
|
|
111
111
|
return None
|
|
112
112
|
|
|
113
|
+
def matching_entries(
|
|
114
|
+
self,
|
|
115
|
+
base_url: str,
|
|
116
|
+
account_id: str | None = None,
|
|
117
|
+
) -> list[dict[str, object]]:
|
|
118
|
+
"""Return every exact and wildcard credential candidate for a URL.
|
|
119
|
+
|
|
120
|
+
Exact URL entries precede wildcard entries so callers can try the most
|
|
121
|
+
specific mapping first without discarding other matching wildcards.
|
|
122
|
+
"""
|
|
123
|
+
url = str(base_url or "").strip().rstrip("/")
|
|
124
|
+
if not url:
|
|
125
|
+
return []
|
|
126
|
+
entries = self._account_entries(account_id)
|
|
127
|
+
exact = [
|
|
128
|
+
dict(entry) for entry in entries
|
|
129
|
+
if str(entry.get("url", "")).rstrip("/") == url
|
|
130
|
+
]
|
|
131
|
+
wildcard = [
|
|
132
|
+
dict(entry) for entry in entries
|
|
133
|
+
if self._has_wildcards(str(entry.get("url", "")))
|
|
134
|
+
and fnmatch.fnmatch(url, str(entry.get("url", "")).rstrip("/"))
|
|
135
|
+
]
|
|
136
|
+
return exact + wildcard
|
|
137
|
+
|
|
113
138
|
def list_entries(
|
|
114
139
|
self,
|
|
115
140
|
account_id: str | None = None,
|
|
@@ -40,7 +40,9 @@ def file_lock(path: Path) -> Iterator[None]:
|
|
|
40
40
|
"""Acquire an exclusive file lock on POSIX and Windows.
|
|
41
41
|
|
|
42
42
|
The implementation imports fcntl/msvcrt lazily so importing Answer42 on
|
|
43
|
-
Windows does not fail on the POSIX-only ``fcntl`` module.
|
|
43
|
+
Windows does not fail on the POSIX-only ``fcntl`` module. The primitive
|
|
44
|
+
follows the real interpreter OS rather than ``IS_WINDOWS``, which tests
|
|
45
|
+
patch to simulate another platform's behaviour.
|
|
44
46
|
"""
|
|
45
47
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
46
48
|
with path.open("a+b") as lock_file:
|
|
@@ -49,7 +51,7 @@ def file_lock(path: Path) -> Iterator[None]:
|
|
|
49
51
|
lock_file.write(b"0")
|
|
50
52
|
lock_file.flush()
|
|
51
53
|
lock_file.seek(0)
|
|
52
|
-
if
|
|
54
|
+
if os.name == "nt":
|
|
53
55
|
import msvcrt # type: ignore
|
|
54
56
|
|
|
55
57
|
msvcrt.locking(lock_file.fileno(), msvcrt.LK_LOCK, 1)
|
|
@@ -2,7 +2,9 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
4
|
import asyncio
|
|
5
|
+
import contextvars
|
|
5
6
|
import copy
|
|
7
|
+
import functools
|
|
6
8
|
import hashlib
|
|
7
9
|
import importlib.resources
|
|
8
10
|
import json
|
|
@@ -27,6 +29,7 @@ from urllib.parse import parse_qs, unquote, urlsplit, urlunsplit
|
|
|
27
29
|
import requests
|
|
28
30
|
from mcp.server import MCPServer
|
|
29
31
|
from mcp.server.lowlevel import NotificationOptions
|
|
32
|
+
from mcp.server.mcpserver.exceptions import ToolError
|
|
30
33
|
from mcp.server.mcpserver.resources import FileResource
|
|
31
34
|
from mcp.server.subscriptions import ToolsListChanged
|
|
32
35
|
from starlette.responses import FileResponse, PlainTextResponse
|
|
@@ -3734,6 +3737,9 @@ def _configure_tool_logging(log_path: str | Path) -> None:
|
|
|
3734
3737
|
|
|
3735
3738
|
|
|
3736
3739
|
_TOOL_CALL_WRAPPER_INSTALLED = False
|
|
3740
|
+
_MCP_TOOL_CALL_ACTIVE: contextvars.ContextVar[bool] = contextvars.ContextVar(
|
|
3741
|
+
"mcp_tool_call_active", default=False
|
|
3742
|
+
)
|
|
3737
3743
|
|
|
3738
3744
|
|
|
3739
3745
|
def _install_tool_call_logger() -> None:
|
|
@@ -3763,6 +3769,7 @@ def _install_tool_call_logger() -> None:
|
|
|
3763
3769
|
if isinstance(params, dict):
|
|
3764
3770
|
session_id = params.get("session_id", DEFAULT_SESSION)
|
|
3765
3771
|
start = time.monotonic()
|
|
3772
|
+
call_token = _MCP_TOOL_CALL_ACTIVE.set(True)
|
|
3766
3773
|
try:
|
|
3767
3774
|
result = await original(*args, **kwargs)
|
|
3768
3775
|
_log_tool_call(session_id, name, params, result, None, time.monotonic() - start)
|
|
@@ -3770,6 +3777,8 @@ def _install_tool_call_logger() -> None:
|
|
|
3770
3777
|
except Exception as exc:
|
|
3771
3778
|
_log_tool_call(session_id, name, params, None, str(exc), time.monotonic() - start)
|
|
3772
3779
|
raise
|
|
3780
|
+
finally:
|
|
3781
|
+
_MCP_TOOL_CALL_ACTIVE.reset(call_token)
|
|
3773
3782
|
|
|
3774
3783
|
mcp.call_tool = _logged_call_tool
|
|
3775
3784
|
_TOOL_CALL_WRAPPER_INSTALLED = True
|
|
@@ -4592,7 +4601,27 @@ def session_status(*,
|
|
|
4592
4601
|
}
|
|
4593
4602
|
|
|
4594
4603
|
|
|
4595
|
-
|
|
4604
|
+
async def _run_start_session_with_diagnostics(operation: Any) -> Any:
|
|
4605
|
+
"""Translate an anticipated startup failure into caller-visible MCP content."""
|
|
4606
|
+
try:
|
|
4607
|
+
return await operation()
|
|
4608
|
+
except RuntimeError as exc:
|
|
4609
|
+
if _MCP_TOOL_CALL_ACTIVE.get():
|
|
4610
|
+
raise ToolError(str(exc)) from exc
|
|
4611
|
+
raise
|
|
4612
|
+
|
|
4613
|
+
|
|
4614
|
+
def _start_session_tool(function: Any) -> Any:
|
|
4615
|
+
"""Register start_session while preserving its 1C diagnostics at the MCP boundary."""
|
|
4616
|
+
|
|
4617
|
+
@functools.wraps(function)
|
|
4618
|
+
async def guarded_start_session(*args: Any, **kwargs: Any) -> Any:
|
|
4619
|
+
return await _run_start_session_with_diagnostics(lambda: function(*args, **kwargs))
|
|
4620
|
+
|
|
4621
|
+
return mcp.tool()(guarded_start_session)
|
|
4622
|
+
|
|
4623
|
+
|
|
4624
|
+
@_start_session_tool
|
|
4596
4625
|
async def start_session(
|
|
4597
4626
|
base_url: Annotated[str, "Target 1C infobase URL; used for version detection and test-client connection"] = "",
|
|
4598
4627
|
username: Annotated[str, "1C username"] = "",
|
|
@@ -4617,17 +4646,26 @@ async def start_session(
|
|
|
4617
4646
|
start_monotonic = time.perf_counter()
|
|
4618
4647
|
stage_monotonic = start_monotonic
|
|
4619
4648
|
timings: dict[str, float] = {}
|
|
4649
|
+
supplied_username = username
|
|
4650
|
+
supplied_password = password
|
|
4620
4651
|
|
|
4621
4652
|
def mark_stage(name: str) -> None:
|
|
4622
4653
|
nonlocal stage_monotonic
|
|
4623
4654
|
now = time.perf_counter()
|
|
4624
4655
|
timings[f"{name}_seconds"] = round(now - stage_monotonic, 3)
|
|
4625
4656
|
stage_monotonic = now
|
|
4626
|
-
|
|
4657
|
+
input_looks_like_url = bool(re.match(r"^[A-Za-z][A-Za-z0-9+.-]*://", str(base_url or "")))
|
|
4658
|
+
# A URL without explicitly supplied credentials is resolved by the web
|
|
4659
|
+
# probe below. It must try every exact/wildcard candidate and retain the
|
|
4660
|
+
# one that authenticated, rather than preselecting the first match here.
|
|
4661
|
+
credential_ref = (
|
|
4662
|
+
None
|
|
4663
|
+
if input_looks_like_url and not username and not password
|
|
4664
|
+
else _resolve_credential_reference(base_url)
|
|
4665
|
+
)
|
|
4627
4666
|
credential_account_id = _current_account_id()
|
|
4628
4667
|
saved_credentials_used = False
|
|
4629
4668
|
saved_credentials_unverified = False
|
|
4630
|
-
input_looks_like_url = bool(re.match(r"^[A-Za-z][A-Za-z0-9+.-]*://", str(base_url or "")))
|
|
4631
4669
|
if credential_ref is not None:
|
|
4632
4670
|
# For saved titles/aliases, replace title -> real URL. For URL/wildcard matches,
|
|
4633
4671
|
# keep the original requested URL; using the wildcard pattern itself as /WS value
|
|
@@ -4656,11 +4694,19 @@ async def start_session(
|
|
|
4656
4694
|
base_url = ""
|
|
4657
4695
|
web_runtime_probe: dict[str, Any] = {"attempted": False, "status": "not_applicable"}
|
|
4658
4696
|
if base_url and initial_connection_mode == "ws":
|
|
4659
|
-
web_runtime_probe = await _probe_web_runtime_before_start(base_url,
|
|
4697
|
+
web_runtime_probe = await _probe_web_runtime_before_start(base_url, supplied_username, supplied_password)
|
|
4660
4698
|
if web_runtime_probe.get("authentication_failed"):
|
|
4661
4699
|
# No local 1C runtime/process has been started yet. Do not hide a
|
|
4662
4700
|
# confirmed publication login rejection behind a later timeout.
|
|
4663
4701
|
raise ValueError(str(web_runtime_probe.get("message") or "1C web authentication failed"))
|
|
4702
|
+
selected_credential_index = web_runtime_probe.pop("_selected_credential_index", None)
|
|
4703
|
+
if selected_credential_index is not None and not supplied_username and not supplied_password:
|
|
4704
|
+
candidates = _credentials_store().matching_entries(base_url, account_id=credential_account_id)
|
|
4705
|
+
selected = candidates[int(selected_credential_index)]
|
|
4706
|
+
username = str(selected["username"])
|
|
4707
|
+
password = str(selected["password"])
|
|
4708
|
+
saved_credentials_used = True
|
|
4709
|
+
saved_credentials_unverified = not bool(selected.get("verified", False))
|
|
4664
4710
|
inferred_summary_rag_config = "" if summary_rag_config else _summary_rag_config_from_42clouds_url(base_url)
|
|
4665
4711
|
effective_summary_rag_config = summary_rag_config or inferred_summary_rag_config
|
|
4666
4712
|
resolved_version = version or None
|
|
@@ -5311,6 +5357,12 @@ _EVENTLOG_ERROR_MARKERS = (
|
|
|
5311
5357
|
"failed",
|
|
5312
5358
|
"fail",
|
|
5313
5359
|
)
|
|
5360
|
+
_ONEC_BSL_STARTUP_ERROR_MARKERS = (
|
|
5361
|
+
"процедура или функция с указанным именем не определена",
|
|
5362
|
+
"неопределена",
|
|
5363
|
+
"modulemanager",
|
|
5364
|
+
"модульменеджера",
|
|
5365
|
+
)
|
|
5314
5366
|
|
|
5315
5367
|
|
|
5316
5368
|
def _is_placeholder_password(password: str) -> bool:
|
|
@@ -5336,25 +5388,46 @@ async def _probe_web_runtime_before_start(
|
|
|
5336
5388
|
"""
|
|
5337
5389
|
if not _is_web_base_url(base_url):
|
|
5338
5390
|
return {"attempted": False, "status": "not_web_publication"}
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5391
|
+
candidates: list[tuple[str, str, str, int | None]] = []
|
|
5392
|
+
if username or password:
|
|
5393
|
+
candidates.append((username, password, "explicit", None))
|
|
5394
|
+
elif _CREDENTIAL_STORE_ENABLED:
|
|
5395
|
+
for index, entry in enumerate(_credentials_store().matching_entries(base_url, account_id=_current_account_id())):
|
|
5396
|
+
candidates.append((entry["username"], entry["password"], "saved", index))
|
|
5397
|
+
if not candidates:
|
|
5398
|
+
candidates.append(("", "", "empty", None))
|
|
5399
|
+
|
|
5400
|
+
authentication_messages: list[str] = []
|
|
5401
|
+
unavailable_messages: list[str] = []
|
|
5402
|
+
for candidate_username, candidate_password, source, index in candidates:
|
|
5403
|
+
try:
|
|
5404
|
+
result = await asyncio.to_thread(probe_web_runtime, base_url, candidate_username, candidate_password)
|
|
5405
|
+
response: dict[str, Any] = {
|
|
5406
|
+
"attempted": True,
|
|
5407
|
+
"status": "ok",
|
|
5408
|
+
"runtime": result,
|
|
5409
|
+
"credentials_source": source,
|
|
5410
|
+
}
|
|
5411
|
+
if index is not None:
|
|
5412
|
+
response["_selected_credential_index"] = index
|
|
5413
|
+
return response
|
|
5414
|
+
except WebRuntimeAuthenticationError as exc:
|
|
5415
|
+
authentication_messages.append(str(exc))
|
|
5416
|
+
except (WebRuntimeProbeError, requests.RequestException) as exc:
|
|
5417
|
+
logging.info("Web runtime probe skipped for %s: %s", _normalize_base_url(base_url), exc)
|
|
5418
|
+
unavailable_messages.append(str(exc))
|
|
5419
|
+
if unavailable_messages:
|
|
5353
5420
|
return {
|
|
5354
5421
|
"attempted": True,
|
|
5355
5422
|
"status": "unavailable",
|
|
5356
|
-
"message":
|
|
5423
|
+
"message": unavailable_messages[-1],
|
|
5357
5424
|
}
|
|
5425
|
+
return {
|
|
5426
|
+
"attempted": True,
|
|
5427
|
+
"status": "authentication_failed",
|
|
5428
|
+
"authentication_failed": True,
|
|
5429
|
+
"message": authentication_messages[-1] if authentication_messages else "1C web authentication failed",
|
|
5430
|
+
}
|
|
5358
5431
|
|
|
5359
5432
|
|
|
5360
5433
|
def _users_url_for_base_url(base_url: str) -> str:
|
|
@@ -5563,6 +5636,15 @@ def _test_client_startup_error_from_logs(sess: SessionState) -> str:
|
|
|
5563
5636
|
if auth_lines:
|
|
5564
5637
|
return "\n".join(auth_lines[-20:])
|
|
5565
5638
|
|
|
5639
|
+
# Compilation/runtime diagnostics in /Out often name neither "error" nor
|
|
5640
|
+
# "ошибка". Preserve their source location and message for the MCP caller.
|
|
5641
|
+
bsl_lines = [
|
|
5642
|
+
line for line in text.splitlines()
|
|
5643
|
+
if any(marker in line.lower() for marker in _ONEC_BSL_STARTUP_ERROR_MARKERS)
|
|
5644
|
+
]
|
|
5645
|
+
if bsl_lines:
|
|
5646
|
+
return "\n".join(bsl_lines[-20:])
|
|
5647
|
+
|
|
5566
5648
|
meaningful = _extract_error_lines(text, max_lines=20)
|
|
5567
5649
|
if meaningful and any(marker in meaningful.lower() for marker in _EVENTLOG_ERROR_MARKERS):
|
|
5568
5650
|
return meaningful
|
|
@@ -196,6 +196,13 @@ def _login(
|
|
|
196
196
|
key_size = reply[0]
|
|
197
197
|
encrypted_login_key = reply[1 : 1 + key_size]
|
|
198
198
|
login_key = _decrypt(encrypted_login_key, proof_key, _INNER_IV)
|
|
199
|
+
except WebRuntimeProbeError as exc:
|
|
200
|
+
# Some 1C web publications signal an invalid password only through a
|
|
201
|
+
# malformed encrypted proof instead of an HTTP 401/403. Treat it as an
|
|
202
|
+
# authentication rejection so callers can try the next stored match.
|
|
203
|
+
if "invalid password-proof CRC" in str(exc):
|
|
204
|
+
raise WebRuntimeAuthenticationError("1C web authentication failed: incorrect user or password") from exc
|
|
205
|
+
raise
|
|
199
206
|
except (IndexError, KeyError, ValueError, TypeError) as exc:
|
|
200
207
|
raise WebRuntimeProbeError("1C web authentication returned an unsupported password-proof response") from exc
|
|
201
208
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|