linxsy-code/dsh-plugin-window-input0

dsh-plugin-window-input

DeepSeek Harness plugin: attach to a Windows window and type text into it (window_list / window_focus / window_type). No core changes needed — load via --patch.

包名
dsh-plugin-window-input
版本
0.1.0
许可证
MIT
最近更新
2026年9月8日

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗

dsh-plugin-window-input

A self-contained DeepSeek Harness plugin that lets the agent attach to a window on the local Windows desktop and type text into it — no core modifications needed.

Load it into a stock DSH via --patch. Works on Windows only.

What you get

ToolWhat it does
window_listEnumerate visible top-level windows (title, class, process name, hwnd), optionally filtered by a query.
window_focusBring a window to the foreground by title (substring) or hwnd.
window_typeType text into a window's input control — the control is auto-detected (focused control → UI Automation → Scintilla → SendInput).

Example flows

window_list                    → find the "Notepad" window
window_type title="Notepad" text="hello" pressEnter=true

How window_type finds the input box

Typing into a window needs more than its top-level handle — it needs the control that is waiting for keyboard input. The engine resolves it in layers:

  1. Focused controlGetGUIThreadInfo returns the thread's focused child, the authoritative keyboard target. Works for any app.
  2. UI Automation ValuePattern — for standard controls (Notepad, editors, chat inputs) it sets the value directly, no focus needed.
  3. Scintilla editors (Notepad++, many code editors) — text is inserted cross-process via clipboard + SCI_PASTE (pointer-free and safe; the pointer-based SCI_REPLACESEL/SCI_INSERTTEXT do NOT work cross-process).
  4. SendInput (opt-in method="sendinput") — for terminals/apps that only accept keyboard injection. Some environments (remote desktop, security software, restricted tokens) block synthetic input injection.

pressEnter inserts a newline via \n (UI Automation) or SCI_NEWLINE (Scintilla), so it works even where SendInput is blocked.

Requirements

  • Windows
  • A DeepSeek Harness checkout (pnpm dsh web)

Installation

# 1. clone this repo anywhere
git clone https://github.com/linxsy-code/dsh-plugin-window-input.git

# 2. edit cordis.yml — point name at YOUR clone path (a file:// URL)
#    e.g.  name: 'file:///C:/path/to/dsh-plugin-window-input/src/index.ts'

# 3. from the DeepSeek Harness checkout root:
pnpm dsh web --patch 
/cordis.yml

Open http://127.0.0.1:3080. In a new session, ask the agent e.g. "use window_type to type 'hello' into Notepad and press Enter" — or if you also use the @ window menu, pick a window with @窗口.

Files

  • src/index.ts — the plugin (registers the three tools, spawns win-agent.ps1).
  • win-agent.ps1 — the engine (Win32 P/Invoke + UI Automation + Scintilla messages, emits JSON).
  • cordis.yml — the --patch overlay.

Known limitations

  • SendInput may be blocked in remote-desktop / sandboxed / restricted-token environments (Win32 error 87) — prefer the default UI Automation / Scintilla paths.
  • UI Automation SetValue only reaches controls that expose ValuePattern; canvas-only or exotic controls fall back to the focused-control path.
  • Windows only.

@窗口 mention (optional, requires the fork)

A companion feature adds a 窗口 (Windows) category to the @ mention menu in the DSH Web composer: type @, pick a window, and it inserts @窗口 that the agent resolves through window_type. Because it touches the client Remote assembly, it lives in a fork of DSH rather than a --patch plugin:

https://github.com/linxsy-code/deepseek-harness   (branch master)

License

MIT © 2026 linxs


dsh-plugin-window-input(中文)

让 DeepSeek Harness 的 Agent 能「附着到某个 Windows 窗口并往里输入文字」,无需改动核心代码

工具

  • window_list:枚举可见顶层窗口(标题/类名/进程/hwnd),可按关键字过滤。
  • window_focus:按标题(子串)或 hwnd 把窗口切到前台。
  • window_type:向窗口输入文字,自动识别输入框(焦点控件 → UI Automation → Scintilla → SendInput)。

安装

git clone https://github.com/linxsy-code/dsh-plugin-window-input.git
# 编辑 cordis.yml,把 name 改成你本机克隆路径(file:// URL)
cd 
pnpm dsh web --patch /cordis.yml

打开 http://127.0.0.1:3080,新会话里 Agent 就能用 window_list / window_focus / window_type

已知限制

  • SendInput 在远程桌面/受限令牌等环境下可能被拦截(Win32 87),请用默认的 UIA/Scintilla 路径。
  • 仅支持 Windows。

@窗口 提及(可选,需 fork)

配套功能可在 @ 弹出菜单里加「窗口」类别列出所有窗口、选中插入 @窗口 供 Agent 解析。因涉及客户端 Remote 装配,只提供在 fork 里:github.com/linxsy-code/deepseek-harness(master 分支)。