4.9 KiB
A-Route RPA Send Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: 在 codex/a-route-rpa-send 分支实现 A 方案:通过受控 UI Automation 路线让 isphere_send_message 能配置为真实 UI 写入并点击发送。
Architecture: Go MCP 继续保留稳定 isphere_send_message 接口、hash、idempotency、audit。新增 A-route connector 调用 C# ISphereWinHelper 的 UIA action op;C# helper 根据窗口句柄、发送框 AutomationId、发送按钮 AutomationId 写入文本并点击。B-route sidecar 仍是主路线,但当前不可测时先实现 A-route 功能兜底。
Tech Stack: Go 1.23.4, github.com/modelcontextprotocol/go-sdk, Windows PowerShell, .NET Framework C# helper, Windows UI Automation.
Global Constraints
- Repository root:
E:\coding\codex\isphere-ai-bridge. - Active branch:
codex/a-route-rpa-send. - Do not use
rg; usegit ls-files,ag,grep -R, or PowerShell commands. - Local machine cannot log in; use synthetic WinForms/UIA verification for local tests.
- User explicitly removed human approval as a product gate for A-route; do not add approval IDs or approval queues in this plan.
- Keep audit redaction: do not store raw message body or raw idempotency key in committed docs/audit tests.
- Real UI action requires explicit env configuration; default MCP behavior remains preview/blocked.
Task 1: Go connector must carry raw content to action connector
Files:
- Modify:
internal/tools/send_message_connector.go - Modify:
internal/tools/isphere_send_message.go - Modify:
internal/tools/isphere_send_message_test.go
Interfaces:
-
Produces:
SendMessageConnectorRequest.ContentText stringfor connector execution only. -
Audit and response still omit raw content.
-
Write failing test proving injected connector receives raw
ContentTextwhile response/audit do not leak it. -
Run focused test and confirm failure.
-
Add
ContentTextto normalized args and connector request. -
Run focused send-message tests.
Task 2: Go A-route UIA connector adapter
Files:
- Create:
internal/tools/send_message_uia_adapter.go - Create:
internal/tools/send_message_uia_adapter_test.go
Interfaces:
-
Produces:
type UiaSendMessageAdapterConfig struct { HelperPath string; TimeoutSeconds int; Hwnd string; SendEditorAutomationID string; SendButtonAutomationID string; Mode string }. -
Produces:
NewUiaSendMessageConnector(config UiaSendMessageAdapterConfig, caller UiaHelperCaller) SendMessageConnector. -
Helper op:
uia_send_message. -
Write failing tests for missing config and successful helper call using a fake helper caller.
-
Implement adapter request mapping.
-
Run focused adapter tests.
Task 3: C# WinHelper UIA send action
Files:
- Create:
native/ISphereWinHelper/UiaSendAction.cs - Modify:
native/ISphereWinHelper/Program.cs - Modify:
scripts/verify-win-helper.ps1
Interfaces:
-
Helper op
uia_send_messageargs:hwnd,send_editor_automation_id,send_button_automation_id,content_text,content_sha256,target_ref. -
Helper data:
action_mode="uia_send_message",typed_text=true,clicked_ui=true,sent_message=true,content_sha256,target_ref,editor_found,button_found. -
Add synthetic WinForms verification that starts a form with
rtbSendMessage,btnSend, invokesuia_send_message, and verifies button-click side effect in a label. -
Implement
UiaSendActionwith ValuePattern/Win32 fallback and InvokePattern/click fallback. -
Run
scripts\verify-win-helper.ps1.
Task 4: Wire A-route connector into MCP env config
Files:
- Modify:
internal/tools/isphere_send_message.go - Modify:
internal/mcpserver/server.go - Modify:
scripts/verify-go-mcp.ps1 - Modify:
docs/go-mcp-runbook.md - Modify:
docs/current-status-card.md
Interfaces:
-
Env
ISPHERE_SEND_CONNECTOR_MODE=uia_rpaenables A-route connector. -
Env
ISPHERE_SEND_UIA_HWND,ISPHERE_SEND_UIA_EDITOR_AUTOMATION_ID,ISPHERE_SEND_UIA_BUTTON_AUTOMATION_ID, optionalISPHERE_SEND_UIA_HELPER_PATHconfigure the action. -
Default env remains no real send.
-
Add config loader and tests around production connector availability.
-
Keep standard smoke deterministic with env cleared.
-
Add server env routing test; helper synthetic UIA smoke covers the local write/click action.
-
Update docs with minimal usage.
Task 5: Verification, commit, push
- Run
git diff --check. - Run
go test ./.... - Run
go build ./cmd/isphere-mcpthen remove root binary. - Run
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1. - Run
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1. - Commit and push branch
codex/a-route-rpa-send.