answer42 0.9.0__tar.gz → 0.10.0__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 (67) hide show
  1. {answer42-0.9.0 → answer42-0.10.0}/PKG-INFO +2 -2
  2. {answer42-0.9.0 → answer42-0.10.0}/README.md +1 -1
  3. {answer42-0.9.0 → answer42-0.10.0}/docs/architecture.md +7 -1
  4. {answer42-0.9.0 → answer42-0.10.0}/pyproject.toml +1 -1
  5. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/assets/MCPTestClient.cf +0 -0
  6. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/assets/MCPTestManager.cf +0 -0
  7. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/server.py +23 -7
  8. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/tool_groups.py +1 -1
  9. {answer42-0.9.0 → answer42-0.10.0}/.gitignore +0 -0
  10. {answer42-0.9.0 → answer42-0.10.0}/LICENSE +0 -0
  11. {answer42-0.9.0 → answer42-0.10.0}/credentials.example.json +0 -0
  12. {answer42-0.9.0 → answer42-0.10.0}/docs/agent-installation.md +0 -0
  13. {answer42-0.9.0 → answer42-0.10.0}/docs/assets/answer42-logo.png +0 -0
  14. {answer42-0.9.0 → answer42-0.10.0}/docs/assets/platform42-logo.svg +0 -0
  15. {answer42-0.9.0 → answer42-0.10.0}/docs/installation.md +0 -0
  16. {answer42-0.9.0 → answer42-0.10.0}/scripts/build_cf.py +0 -0
  17. {answer42-0.9.0 → answer42-0.10.0}/scripts/e2e_http_smoke.py +0 -0
  18. {answer42-0.9.0 → answer42-0.10.0}/scripts/e2e_stable.py +0 -0
  19. {answer42-0.9.0 → answer42-0.10.0}/scripts/openclaw_mcp_autoreload.py +0 -0
  20. {answer42-0.9.0 → answer42-0.10.0}/scripts/rag_cli.py +0 -0
  21. {answer42-0.9.0 → answer42-0.10.0}/scripts/read_webclient_start_info.py +0 -0
  22. {answer42-0.9.0 → answer42-0.10.0}/src/cf/ConfigDumpInfo.xml +0 -0
  23. {answer42-0.9.0 → answer42-0.10.0}/src/cf/Configuration.xml +0 -0
  24. {answer42-0.9.0 → answer42-0.10.0}/src/cf/DataProcessors/MCPTestManager/Ext/ObjectModule.bsl +0 -0
  25. {answer42-0.9.0 → answer42-0.10.0}/src/cf/DataProcessors/MCPTestManager/Forms//320/244/320/276/321/200/320/274/320/260/Ext/Form/Module.bsl" +0 -0
  26. {answer42-0.9.0 → answer42-0.10.0}/src/cf/DataProcessors/MCPTestManager/Forms//320/244/320/276/321/200/320/274/320/260/Ext/Form.xml" +0 -0
  27. {answer42-0.9.0 → answer42-0.10.0}/src/cf/DataProcessors/MCPTestManager/Forms//320/244/320/276/321/200/320/274/320/260.xml" +0 -0
  28. {answer42-0.9.0 → answer42-0.10.0}/src/cf/DataProcessors/MCPTestManager.xml +0 -0
  29. {answer42-0.9.0 → answer42-0.10.0}/src/cf/Ext/ManagedApplicationModule.bsl +0 -0
  30. {answer42-0.9.0 → answer42-0.10.0}/src/cf/Languages//320/240/321/203/321/201/321/201/320/272/320/270/320/271.xml" +0 -0
  31. {answer42-0.9.0 → answer42-0.10.0}/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
  32. {answer42-0.9.0 → answer42-0.10.0}/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
  33. {answer42-0.9.0 → answer42-0.10.0}/src/client_cf/ConfigDumpInfo.xml +0 -0
  34. {answer42-0.9.0 → answer42-0.10.0}/src/client_cf/Configuration.xml +0 -0
  35. {answer42-0.9.0 → answer42-0.10.0}/src/client_cf/Languages//320/240/321/203/321/201/321/201/320/272/320/270/320/271.xml" +0 -0
  36. {answer42-0.9.0 → answer42-0.10.0}/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
  37. {answer42-0.9.0 → answer42-0.10.0}/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
  38. {answer42-0.9.0 → answer42-0.10.0}/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
  39. {answer42-0.9.0 → answer42-0.10.0}/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
  40. {answer42-0.9.0 → answer42-0.10.0}/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
  41. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/__init__.py +0 -0
  42. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/assets/__init__.py +0 -0
  43. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/auth.py +0 -0
  44. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/bridge.py +0 -0
  45. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/credentials.py +0 -0
  46. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/credentials_cli.py +0 -0
  47. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/html_agent.py +0 -0
  48. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/os_support.py +0 -0
  49. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/platform.py +0 -0
  50. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/protocol.py +0 -0
  51. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/rag/__init__.py +0 -0
  52. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/rag/detect.py +0 -0
  53. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/rag/dump.py +0 -0
  54. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/rag/model.py +0 -0
  55. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/rag/parsers.py +0 -0
  56. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/rag/service.py +0 -0
  57. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/rag/store.py +0 -0
  58. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/rag/summary_backend.py +0 -0
  59. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/rag/summary_vector.py +0 -0
  60. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/recorder.py +0 -0
  61. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/release_helper.py +0 -0
  62. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/runtime.py +0 -0
  63. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/skill_installer.py +0 -0
  64. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/webclient_probe.py +0 -0
  65. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/webkit_patch.py +0 -0
  66. {answer42-0.9.0 → answer42-0.10.0}/src/mcp_1c/win_desktop.py +0 -0
  67. {answer42-0.9.0 → answer42-0.10.0}/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.9.0
3
+ Version: 0.10.0
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>
@@ -210,7 +210,7 @@ answer42
210
210
  | `commands` | командный интерфейс, командные панели и контекстные меню |
211
211
  | `ui_snapshots` | работа с сохранённым большим `ui_tree` (включается сама, когда `ui_tree` сохранил результат в ресурс) |
212
212
  | `metadata` | метаданные конфигурации из живого интерфейса |
213
- | `rag` | RAG по исходникам конфигурации — **только пока RAG активен** (`start_session(rag_enabled=true)`) |
213
+ | `rag` | RAG по исходникам конфигурации — **только пока RAG активен**: сервер запущен с `--enable-rag` (по умолчанию RAG выключен) и сессия начата с `start_session(rag_enabled=true)` |
214
214
  | `html` | живые веб-страницы в HTML-полях: текст, поиск элементов, клик, ввод, ожидание, ошибки консоли (включается сама после `start_session`); произвольный JavaScript `html_eval` — только с `--dev-tools` |
215
215
  | `recording` | запись доказательств (скриншоты, слайды, PDF) |
216
216
  | `credentials` | сохранённые учётные данные баз |
@@ -168,7 +168,7 @@ answer42
168
168
  | `commands` | командный интерфейс, командные панели и контекстные меню |
169
169
  | `ui_snapshots` | работа с сохранённым большим `ui_tree` (включается сама, когда `ui_tree` сохранил результат в ресурс) |
170
170
  | `metadata` | метаданные конфигурации из живого интерфейса |
171
- | `rag` | RAG по исходникам конфигурации — **только пока RAG активен** (`start_session(rag_enabled=true)`) |
171
+ | `rag` | RAG по исходникам конфигурации — **только пока RAG активен**: сервер запущен с `--enable-rag` (по умолчанию RAG выключен) и сессия начата с `start_session(rag_enabled=true)` |
172
172
  | `html` | живые веб-страницы в HTML-полях: текст, поиск элементов, клик, ввод, ожидание, ошибки консоли (включается сама после `start_session`); произвольный JavaScript `html_eval` — только с `--dev-tools` |
173
173
  | `recording` | запись доказательств (скриншоты, слайды, PDF) |
174
174
  | `credentials` | сохранённые учётные данные баз |
@@ -231,6 +231,11 @@ MCP-инструмент `rag_sources_add_from_directory(path, watch=true)` ищ
231
231
  проиндексированных данных, результат содержит `rag_diagnostic.diagnostics[]` с
232
232
  машиночитаемым кодом и подсказкой агенту, как это исправить.
233
233
 
234
+ Встроенный RAG по умолчанию выключен на уровне сервера: инструменты группы `rag` скрыты,
235
+ `ui_tree` не обогащается типами, `start_session(rag_enabled=true)` возвращает
236
+ `rag_notice.reason="rag_disabled"`. Чтобы включить его, запустите сервер с `--enable-rag`
237
+ или `ONEC_MCP_ENABLE_RAG=1`; `--disable-rag` / `ONEC_MCP_DISABLE_RAG=1` имеют приоритет.
238
+
234
239
  `start_session()` по умолчанию запускается с `rag_enabled=false`, чтобы обычные сессии
235
240
  не тратили время на чтение реестров живой конфигурации. Чтобы явно привязать сводный
236
241
  снимок, передайте `summary_rag_config`, например `summary_rag_config="bp"`.
@@ -272,7 +277,8 @@ MCP-инструмент `rag_sources_add_from_directory(path, watch=true)` ищ
272
277
  | `ONEC_MCP_WINDOWS_DESKTOP` | Windows: `hidden` — запускать менеджер и клиент 1С на скрытых рабочих столах сессии; `current` — на текущем рабочем столе | `current` |
273
278
  | `ONEC_MCP_DATA_DIR` | Рабочая директория | OS tempdir + `answer42` (`/tmp/answer42` on Linux, `%TEMP%\answer42` on Windows) |
274
279
  | `MCP_1C_RAG_DB` | Путь к RAG SQLite | `build/rag/onec-rag.sqlite` |
275
- | `ONEC_MCP_DISABLE_RAG` | Отключить встроенный RAG (`1/true/yes/on`) | пусто |
280
+ | `ONEC_MCP_ENABLE_RAG` | Включить встроенный RAG (`1/true/yes/on`); по умолчанию он выключен | пусто |
281
+ | `ONEC_MCP_DISABLE_RAG` | Оставить RAG выключенным, даже если задан `ONEC_MCP_ENABLE_RAG` | пусто |
276
282
  | `ONEC_MCP_RAG_SOURCE_DIRS` | `:`/`;`-separated directories for startup RAG discovery/watch | пусто |
277
283
  | `ONEC_MCP_RAG_SOURCE_PREFIX` | Prefix for auto-discovered source names | пусто |
278
284
  | `ONEC_MCP_RAG_SOURCE_MAX_DEPTH` | Discovery depth for RAG source dirs | `4` |
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "answer42"
3
- version = "0.9.0"
3
+ version = "0.10.0"
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"
@@ -65,7 +65,12 @@ from .window_control import maximize_test_client_window as _maximize_external_wi
65
65
 
66
66
  mcp = MCPServer("Answer42")
67
67
  _RAG = RagService()
68
- _RAG_ENABLED = os.getenv("ONEC_MCP_DISABLE_RAG", "").strip().lower() not in {"1", "true", "yes", "on"}
68
+ _TRUE_ENV_VALUES = {"1", "true", "yes", "on"}
69
+ # The built-in RAG is opt-in (--enable-rag / ONEC_MCP_ENABLE_RAG=1); --disable-rag still wins when both are set.
70
+ _RAG_ENABLED = (
71
+ os.getenv("ONEC_MCP_ENABLE_RAG", "").strip().lower() in _TRUE_ENV_VALUES
72
+ and os.getenv("ONEC_MCP_DISABLE_RAG", "").strip().lower() not in _TRUE_ENV_VALUES
73
+ )
69
74
  AUTO_SUMMARY_RAG_ON_START = os.getenv("ONEC_MCP_AUTO_SUMMARY_RAG_ON_START", "0").strip().lower() in {"1", "true", "yes", "on"}
70
75
  _CREDENTIAL_STORE_ENABLED = os.getenv("ONEC_MCP_DISABLE_CREDENTIAL_STORE", "").strip().lower() not in {"1", "true", "yes", "on"}
71
76
  _DEV_TOOLS_ENABLED = os.getenv("ONEC_MCP_DEV_TOOLS", "").strip().lower() in {"1", "true", "yes", "on"}
@@ -1907,7 +1912,7 @@ def _rag_disabled_result(session_rag_enabled: bool = True) -> dict[str, Any]:
1907
1912
  message = (
1908
1913
  "Built-in Answer42 RAG is disabled for this session. Start session with rag_enabled=true to use RAG tools."
1909
1914
  if reason == "rag_disabled_for_session"
1910
- else "Built-in Answer42 RAG is disabled for this MCP server. Start without --disable-rag / ONEC_MCP_DISABLE_RAG to use RAG tools."
1915
+ else "Built-in Answer42 RAG is off for this MCP server (the default). Start the server with --enable-rag / ONEC_MCP_ENABLE_RAG=1 to use RAG tools."
1911
1916
  )
1912
1917
  return {
1913
1918
  "available": False,
@@ -4583,6 +4588,11 @@ async def manage_tool_groups(
4583
4588
  if not names:
4584
4589
  raise ToolError("Pass the groups to change, e.g. groups='lists,commands'")
4585
4590
  if action_key == "enable" and tool_groups.RAG in names and not _rag_active():
4591
+ if not _RAG_ENABLED:
4592
+ raise ToolError(
4593
+ "RAG is off for this MCP server (the default), so its tools stay hidden. "
4594
+ "The server must be started with --enable-rag / ONEC_MCP_ENABLE_RAG=1."
4595
+ )
4586
4596
  raise ToolError(
4587
4597
  "RAG is not active, so its tools stay hidden. Start a session with "
4588
4598
  "start_session(rag_enabled=true) (or summary_rag_config=...); the rag tools then appear automatically."
@@ -5514,7 +5524,7 @@ async def start_session(
5514
5524
  extra_args: Annotated[str, "Extra raw 1C command-line arguments for the test client"] = "",
5515
5525
  execute: Annotated[str, "External data processor/report path for the test-client /Execute command-line parameter"] = "",
5516
5526
  command_parameter: Annotated[str, "Additional test-client /C value; when extra_args already contains /C, this value is appended with ';'"] = "",
5517
- rag_enabled: Annotated[bool, "Enable built-in RAG for this session"] = False,
5527
+ rag_enabled: Annotated[bool, "Enable built-in RAG for this session; needs a server started with --enable-rag"] = False,
5518
5528
  summary_rag_config: Annotated[str, "Explicit Summary RAG configuration alias/code, e.g. bp, bpc, ka, ut, zup, Accounting30, Бухгалтерия предприятия. Enables configuration+fresh summary snapshot without live autodetection."] = "",
5519
5529
  include_timings: Annotated[bool, "Include diagnostic startup timing breakdown in the returned _timings field"] = False,
5520
5530
  html_mode: Annotated[str, "How the html_* tools reach live pages in HTML document fields: auto (Linux: remote; Windows: patched when the platform's Web Inspector has the Answer42 bridge, console otherwise; default, or ONEC_MCP_HTML_MODE), console (Windows: the inspector hot key and a loader typed into its console), patched (the bridge built into the inspector front end: Windows — installed into the platform, see html_inspector_patch; Linux — overlaid per session, nothing to install, needs xdotool), remote (Linux: the WebKitGTK remote inspector), disabled (no bridge: the html_* tools are unavailable)"] = "",
@@ -12308,11 +12318,17 @@ def main(argv: list[str] | None = None) -> None:
12308
12318
  parser = argparse.ArgumentParser(description="MCP server for 1C:Enterprise test manager")
12309
12319
  parser.add_argument("--version", action="version", version=f"answer42 {__version__}")
12310
12320
  parser.add_argument("--log-level", default=os.getenv("ONEC_MCP_LOG_LEVEL", "INFO"))
12321
+ parser.add_argument(
12322
+ "--enable-rag",
12323
+ action="store_true",
12324
+ default=os.getenv("ONEC_MCP_ENABLE_RAG", "").strip().lower() in _TRUE_ENV_VALUES,
12325
+ help="enable built-in Answer42 RAG tools and RAG enrichment (off by default)",
12326
+ )
12311
12327
  parser.add_argument(
12312
12328
  "--disable-rag",
12313
12329
  action="store_true",
12314
- default=os.getenv("ONEC_MCP_DISABLE_RAG", "").strip().lower() in {"1", "true", "yes", "on"},
12315
- help="disable built-in Answer42 RAG tools and RAG enrichment",
12330
+ default=os.getenv("ONEC_MCP_DISABLE_RAG", "").strip().lower() in _TRUE_ENV_VALUES,
12331
+ help="keep built-in Answer42 RAG off even when --enable-rag / ONEC_MCP_ENABLE_RAG is set",
12316
12332
  )
12317
12333
  parser.add_argument(
12318
12334
  "--disable-credential-store",
@@ -12440,7 +12456,7 @@ def main(argv: list[str] | None = None) -> None:
12440
12456
 
12441
12457
  _configure_tool_logging(args.tool_log)
12442
12458
 
12443
- _RAG_ENABLED = not args.disable_rag
12459
+ _RAG_ENABLED = bool(args.enable_rag) and not args.disable_rag
12444
12460
  _CREDENTIAL_STORE_ENABLED = not args.disable_credential_store
12445
12461
  _DEV_TOOLS_ENABLED = bool(args.dev_tools)
12446
12462
  _register_dev_tools(_DEV_TOOLS_ENABLED)
@@ -12448,7 +12464,7 @@ def main(argv: list[str] | None = None) -> None:
12448
12464
  if _RAG_ENABLED:
12449
12465
  _register_startup_rag_source_dirs(args.rag_source_dir or [], args.rag_source_prefix, not args.rag_source_no_recursive, args.rag_source_max_depth)
12450
12466
  else:
12451
- logging.info("Built-in Answer42 RAG is disabled")
12467
+ logging.info("Built-in Answer42 RAG is off (enable with --enable-rag / ONEC_MCP_ENABLE_RAG=1)")
12452
12468
  _DYNAMIC_TOOL_GROUPS = args.tool_groups == "on"
12453
12469
  tool_profile = args.tool_profile or (tool_groups.DEFAULT_PROFILE if _DYNAMIC_TOOL_GROUPS else "full")
12454
12470
  profile_result = _configure_default_tool_profile(tool_profile)
@@ -77,7 +77,7 @@ DESCRIPTIONS: dict[str, str] = {
77
77
  "commands": "command interface sections/commands/search, command panels and context menus",
78
78
  "ui_snapshots": "inspect saved large ui_tree snapshots (search, nodes, children, diff, actions)",
79
79
  "metadata": "configuration metadata from the live UI: metadata catalog, subsystem and extension versions",
80
- RAG: "configuration source RAG: lookup, search, sources and snapshots (shown only while RAG is active)",
80
+ RAG: "configuration source RAG: lookup, search, sources and snapshots (server started with --enable-rag; shown only while RAG is active)",
81
81
  "html": "live web pages in HTML document fields through the embedded WebKit inspector (start_session bridges them by default): text, query, click, type, wait, console errors; html_eval only with --dev-tools",
82
82
  "recording": "evidence recording: screenshots and slides for each step, PDF report",
83
83
  "credentials": "manage saved infobase credentials",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes