Class CodingPartnerService

java.lang.Object
com.shaft.mcp.CodingPartnerService

@Service public class CodingPartnerService extends Object
MCP planning tools for a repository-aware SHAFT IntelliJ coding partner.
  • Constructor Details

    • CodingPartnerService

      public CodingPartnerService()
      Creates the default coding partner service.

      Resolution of the effective MCP workspace root (which may probe or create local directories) is deferred until a tool method actually runs, so bean construction never performs filesystem access.

  • Method Details

    • plan

      @Tool(name="shaft_coding_partner_plan", description="plans a repository-aware SHAFT IntelliJ coding-partner workflow using current source, selected text, existing page objects/tests, capture evidence, and verification guidance") public McpCodingPartnerPlan plan(String repositoryPath, String intent, String backend, String currentSourcePath, String selectedText, List<String> artifactPaths, int maxResults)
      Builds a preview-only plan for turning user intent, existing Java code, and evidence into SHAFT changes.
      Parameters:
      repositoryPath - workspace-contained repository root
      intent - user scenario or coding intent
      backend - requested backend, usually webdriver or playwright
      currentSourcePath - current IntelliJ Java file path, absolute or repository-relative
      selectedText - selected source snippet or pasted manual context
      artifactPaths - optional evidence paths such as traces, Allure results, or screenshots
      maxResults - maximum reuse candidates to return
      Returns:
      preview-only coding partner plan
    • diff

      @Tool(name="shaft_coding_partner_diff", description="produces a preview-only unified diff that inserts reviewed SHAFT code blocks into an existing Java target at a chosen method or textual anchor; never writes files") public McpCodingPartnerDiff diff(String repositoryPath, String targetSourcePath, List<String> codeBlocks, String insertionAnchor)
      Builds a preview-only unified diff that inserts reviewed SHAFT code blocks into an existing Java target.

      The MCP server never writes files; the returned diff is for IntelliJ to preview and apply under explicit user approval.

      Parameters:
      repositoryPath - workspace-contained repository root
      targetSourcePath - Java target file, absolute or repository-relative
      codeBlocks - reviewed SHAFT code blocks to insert (Markdown fences are stripped)
      insertionAnchor - optional existing method or textual anchor to insert after
      Returns:
      preview-only unified diff