Commit Graph
2 Commits
Author SHA1 Message Date
yuanyuanxianganddeepseek-flash 5841f27df9 Feature(mcp): unify window and service controls behind one name per state
operate_window / host_control_window and control_service / host_control_service were two
implementations of the same intent. tools/list now exposes exactly one of each pair,
chosen by McpMachine: the host_control_* names when host management is enabled, the
main-connection names when it is not.

The advertised tool accepts the union of actions. host_control_window routes close/show
to the main-connection implementation, which stays the only path with close/show
semantics and requires McpManage; the machine path keeps its post-action verification
for restore/hide/maximize/minimize/activate. host_control_service routes
set_auto/set_manual the same way and rejects dry_run for them instead of pretending to
run one. Both old names remain callable aliases, and service_name is accepted as an
alias for the machine tool's name parameter.

The manifest generator treats the two main-connection tools as !machine entries, so the
two-capture union still covers both states. tools/list is 49 entries when everything is
on (was 51) and 47 when host management is off; the response shrinks from 193,008 B to
168,634 B (-12.6%), short of the 15% estimate because state-conditional tools must stay
in the manifest. The plan document records that measurement and the reason.

Verified with a dedicated two-state test: visibility matrix, close/show and
set_auto/set_manual routing through dry_run and validation paths, alias dispatch, and
-32006 for host_* names when host management is off. Step 8a/8b regressions and
verify_tools --live still pass.

Co-Authored-By: deepseek-flash
2026-11-12 17:40:51 +01:00
yuanyuanxianganddeepseek-flash f5ac7ba45f Docs: revise MCP tool optimization plan against measured baseline
The v1 plan was written without measuring the live server. Re-measure and fix
it against the code:

- tools/list response is 193,008 B (tools array 136,692 B; description 31,874 /
  inputSchema 44,192 / outputSchema 49,320), not 103,158 B; the >=15% goal now
  refers to this baseline.
- TermSession::sentPos is the sentinel offset, not a delivered cursor, so
  P0-2 introduces a real `delivered` cursor instead of reusing it.
- The whitelist additions icacls / net user / net localgroup are writes under
  prefix matching; only sc qc / enumdepend / sdshow qualify.
- "file too large" uses -32602, not the invented -32011 (destination write
  failure).
- P0-3 gains four prerequisites (size pre-check, McpFileTransfer gate, RAII
  cleanup, sha256/lines_total semantics); P0-1 spells out the default-session
  slot hazard; the stage order is P0-4 first since it is the cheapest win.

Appendix B records how the baseline was measured (verify_tools.py --live).

Co-Authored-By: deepseek-flash
2026-11-12 15:41:20 +01:00