refactor: split node agent and Go control plane

This commit is contained in:
2026-09-11 16:57:31 +08:00
parent 078c22c73b
commit c86ba9c4d7
129 changed files with 654 additions and 77 deletions
@@ -0,0 +1,16 @@
namespace WxAgent.Core;
public sealed record WechatNoteWindowCandidate(long Handle, int ProcessId, string Title, bool IsVisible, bool HasChatSurface);
public static class WechatNoteWindow
{
public static long? FindOpened(IEnumerable<WechatNoteWindowCandidate> windows, int processId, IReadOnlySet<long> previousHandles)
{
var candidates = windows.Where(window => window.Handle != 0 && window.ProcessId == processId
&& !previousHandles.Contains(window.Handle) && window.IsVisible && !window.HasChatSurface
&& window.Title.Contains("笔记", StringComparison.Ordinal)).ToArray();
if (candidates.Length > 1)
throw new WxAgentException(WxAgentErrorCode.UiStructureChanged, "Multiple new note windows appeared; refusing ambiguous content.");
return candidates.Length == 1 ? candidates[0].Handle : null;
}
}