@logictan/dsh-desktop-agent 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,6 +53,11 @@ Only elements carrying both a token and a non-empty label become anchors.
53
53
  None beyond installing this plugin. It publishes the `cua_driver_native__*` tools
54
54
  itself, from the Cua Driver native SDK it depends on, and dispatches to them.
55
55
 
56
+ Those tools are registered but **not announced**: their 56 schemas are 109,857
57
+ characters of the first request, and the work goes through `desktop_agent` instead.
58
+ The registry resolves a call from its own layers rather than from the prompt, so a
59
+ call to one of these names still executes — it just is not advertised.
60
+
56
61
  A profile that still mounts the old
57
62
  `@deepseek-ai/dsh-experimental-computer-use-cua-driver-native` provider must drop
58
63
  that row and its `@deepseek-ai/dsh-computer-use` dependency first: both would
@@ -81,11 +86,8 @@ it uses the frontmost window.
81
86
 
82
87
  ### When to call it
83
88
 
84
- For any desktop task that takes more than about two steps, call `desktop_agent`
85
- rather than driving the `cua_driver_native__*` tools yourself. The loop's ~40
86
- captures and decisions stay inside this one call; driving the raw tools by hand
87
- puts every screenshot into the agent's own context instead. The raw tools remain
88
- the right choice for resolving a window, or for a single action already decided on.
89
+ For any desktop task, call `desktop_agent`. The loop's ~40 captures and decisions
90
+ stay inside this one call rather than entering the agent's own context.
89
91
 
90
92
  For a task that lives in a web page, `browser_agent` is the better tool — it
91
93
  drives the DOM over CDP and does not depend on reading pixels. This tool is for
package/lib/driver.js CHANGED
@@ -161,6 +161,21 @@ async function publishTools(ctx, driver, lifetime, pending) {
161
161
  }));
162
162
  }
163
163
 
164
+ // These schemas are what makes the prompt expensive and the model no better:
165
+ // measured, they are 109,857 characters of a 220,021-character first request,
166
+ // and the 1,864-session log holds 509 model-direct calls against them, spread
167
+ // over 27 sessions — 25 of which never used `desktop_agent` at all. The work
168
+ // goes through `desktop_agent`, whose sub-dispatches carry a `parent` token
169
+ // and are resolved from the registry's own layers, never from the prompt. So
170
+ // the announcement is withdrawn while the definitions stay registered and
171
+ // executable: `resolveExecution` consults the layer visibility, not the
172
+ // assembly, so a model that names one anyway still gets it executed.
173
+ ctx.on('system-prompt/assemble', async (_assembly, _context, next) => {
174
+ const assembly = await next();
175
+ const kept = assembly.tools.filter((tool) => !names.has(tool.name));
176
+ return kept.length === assembly.tools.length ? assembly : { ...assembly, tools: kept };
177
+ });
178
+
164
179
  const systemPrompt = ctx.get('systemPrompt');
165
180
  if (systemPrompt === null || systemPrompt === undefined) {
166
181
  ctx.logger?.warn?.('desktop-agent: the systemPrompt service is unavailable; the Cua Driver guidance was not registered.');
package/lib/index.js CHANGED
@@ -154,10 +154,8 @@ export async function apply(ctx, config, loadSdk) {
154
154
  'asks the configured model what to do, and performs the click, key, or text entry it chose. ' +
155
155
  'Works on ordinary applications and on games that expose no usable accessibility tree, because it reads the ' +
156
156
  'picture rather than the element table. ' +
157
- '\n\nPREFER THIS over calling the cua_driver_native__* tools yourself for any task that takes more than ' +
158
- 'about two steps. It runs the whole loop inside one call, so its 40 screenshots and decisions never enter ' +
159
- 'this conversation; driving those tools by hand puts every screenshot into the context instead. Reach for the ' +
160
- 'raw tools only to resolve a window, or for a single action you have already decided on. ' +
157
+ '\n\nPREFER THIS for any desktop task. It runs the whole loop inside one call, so its 40 screenshots ' +
158
+ 'and decisions never enter this conversation. ' +
161
159
  '\n\nChoose this for native windows and desktop applications. For a task that lives in a web page, ' +
162
160
  'browser_agent is the better tool: it drives the DOM over CDP and is far more precise than a screenshot. ' +
163
161
  'Note that a covered window cannot be driven, and a game that filters injected input needs foreground ' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logictan/dsh-desktop-agent",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "DSH desktop agent: a native-vision decision loop that drives the host desktop through the Cua Driver tools. DSH 桌面 Agent 子插件。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",