dsh-screen-automation 0.1.10 → 0.1.11
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 +10 -7
- package/lib/index.js +45 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
2. 重复任务生成并验证流程,安装到小助手桌面端后直接运行。
|
|
15
15
|
3. 流程需要智能定位、智能执行或智能异常处理时,再在桌面端配置“Agent接入”。DSH 调用小助手不代表小助手能反向调用当前 DSH。
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
本插件按 screen-automation Skill 1.2.10 更新工具接口与描述。规范正文由
|
|
18
18
|
[原子 Skill](https://github.com/xiaozs-com/screen-automation/blob/main/skills/screen-automation/SKILL.md) 维护。
|
|
19
19
|
先调用 status、describe、capabilities、access_list,区分运行状态、系统契约、动作接口和可选组件的 effective 状态。
|
|
20
20
|
|
|
@@ -53,7 +53,7 @@ dsh-screen-automation (Host 插件, Node/TS)
|
|
|
53
53
|
|
|
54
54
|
本插件不自行解析、转换或补全 `workflow.md`,因此桌面端新增流程语言时,桥接层保持原样透传。
|
|
55
55
|
创建或修改流程遵循[当前工作流开发标准](https://github.com/xiaozs-com/screen-automation/blob/main/skills/screen-automation/references/workflow-standard.md)。
|
|
56
|
-
新增流程使用语言 3,以观察 → 执行 → 验证组织真实业务步骤;查询 `screen_automation_workflow_schema(target=steps)`、`screen_automation_workflow_sdk`
|
|
56
|
+
新增流程使用语言 3,以观察 → 执行 → 验证组织真实业务步骤;查询 `screen_automation_workflow_schema(target=steps)`、`screen_automation_workflow_sdk` 获取安装版接口。新版异常恢复字段以 `steps.failure_contract` 为准。连续交互流程段先查询 `workflow_schema(target=interactions)`,并确认安装版支持 `continuous-interaction@1`。
|
|
57
57
|
智能阶段和步骤内有界失败处理见 [Agent 阶段](https://github.com/xiaozs-com/screen-automation/blob/main/skills/screen-automation/references/workflow-agent-phases.md)。
|
|
58
58
|
观察、验证、失败判断只读;改变屏幕的 Agent 执行需要显式阶段授权与后置验证,用户在场边界仍然有效。
|
|
59
59
|
本地目录/ZIP 使用 `workflow_inspect(source)`;安装后使用 `workflow_validate(workflow_id)` 检查已安装副本。错误时修复源包并重新检查、安装和校验。
|
|
@@ -67,7 +67,7 @@ dsh-screen-automation (Host 插件, Node/TS)
|
|
|
67
67
|
|---|---|---|
|
|
68
68
|
| `describe` | `cli describe` | 系统自描述与安全契约 |
|
|
69
69
|
| `access_list` / `access_status` | `cli access list` / `cli access status <capability_id>` | 访问、授权、组件和启用状态 |
|
|
70
|
-
| `workflow_schema` | `cli workflow schema steps\|sdk\|
|
|
70
|
+
| `workflow_schema` | `cli workflow schema steps\|sdk\|interactions` | 阶段、SDK、连续交互流程段的机器可读格式 |
|
|
71
71
|
| `workflow_sdk` | `cli workflow sdk` | 安装版 SDK 签名 |
|
|
72
72
|
| `agent_status` / `agent_probe` | `cli agent status` / `cli agent probe` | Agent 接入摘要/连接探测 |
|
|
73
73
|
|
|
@@ -103,7 +103,7 @@ Profile 并进入该网址;正常关闭或重启后会保留站点登录状态
|
|
|
103
103
|
| `screen_automation_list_workflows` | `cli workflow list` | 已安装流程 |
|
|
104
104
|
| `screen_automation_run_workflow` | `cli start-workflow <id>` | 运行流程(支持 `count` / `dry_run`) |
|
|
105
105
|
| `screen_automation_stop_run` | `cli stop --run-id <id>` | 请求停止;继续查询 list_runs,分别报告 stopping、finalizing、实际结束;stopped:false 不表示已停止 |
|
|
106
|
-
| `screen_automation_list_runs` | `cli runs list` |
|
|
106
|
+
| `screen_automation_list_runs` | `cli runs list` | 按 `run_id` 查看运行、排队和停止收尾状态 |
|
|
107
107
|
| `screen_automation_health` | `cli health --workflow <id>` | 运行前健康检查 |
|
|
108
108
|
| `screen_automation_capture` | `cli screen capture` | 截图(可选 `region` / `output`) |
|
|
109
109
|
|
|
@@ -141,6 +141,9 @@ Profile 并进入该网址;正常关闭或重启后会保留站点登录状态
|
|
|
141
141
|
|
|
142
142
|
| 工具 | 映射的 CLI | 说明 |
|
|
143
143
|
|---|---|---|
|
|
144
|
+
| `screen_automation_window_list_visible` | `cli window list-visible` | 列出可见窗口 |
|
|
145
|
+
| `screen_automation_window_wait_selection` | `cli window wait-selection` | 等待用户选择窗口,可按标题或进程筛选 |
|
|
146
|
+
| `screen_automation_task_observe` | `cli task observe --text-only` | 读取绑定窗口信息与 OCR,可设置信度阈值 |
|
|
144
147
|
| `screen_automation_task_begin` | `cli task begin` | 开始任务会话,可按 `title` / `process` / `handle` 绑定窗口 |
|
|
145
148
|
| `screen_automation_task_status` | `cli task status` | 报告当前任务会话目标窗口 |
|
|
146
149
|
| `screen_automation_task_end` | `cli task end` | 结束当前任务会话 |
|
|
@@ -184,7 +187,7 @@ screen capture 拿图 → ctx.attachments.saveImage 登记为不可变图片引
|
|
|
184
187
|
1. 环境变量 `SCREEN_AUTOMATION_BIN`(最高优先级,直接指向可执行文件)
|
|
185
188
|
2. macOS:`SCREEN_AUTOMATION_MAC_APP` → 其下 `Contents/MacOS/screen-automation-helper`
|
|
186
189
|
或 `/Applications/Screen Automation Helper.app/...`、 `$HOME/Applications/Screen Automation Helper.app/...`
|
|
187
|
-
3. Windows:`SCREEN_AUTOMATION_WIN_EXE` → `%LOCALAPPDATA%\Programs\Xiaozs\ScreenAutomationHelper\...` →
|
|
190
|
+
3. Windows:`SCREEN_AUTOMATION_WIN_EXE` → `SCREEN_AUTOMATION_HELPER_EXE` → `%LOCALAPPDATA%\Programs\Xiaozs\ScreenAutomationHelper\...` →
|
|
188
191
|
`%ProgramFiles%\Xiaozs\ScreenAutomationHelper\...` → `%ProgramFiles(x86)%\Xiaozs\ScreenAutomationHelper\...`
|
|
189
192
|
|
|
190
193
|
都找不到时,工具会抛出带官网下载链接的明确错误。
|
|
@@ -308,8 +311,8 @@ npm pack
|
|
|
308
311
|
|
|
309
312
|
## 验证状态
|
|
310
313
|
|
|
311
|
-
源码仓库的 `docs/SKILL_1.2.5_REVIEW.md`
|
|
312
|
-
`npm test` 检查
|
|
314
|
+
源码仓库的 `docs/SKILL_1.2.5_REVIEW.md` 保留 1.2.5 的历史核查记录。
|
|
315
|
+
`npm test` 检查 58 个工具注册、CLI 参数与执行策略;包括拒绝未确认截图、模型预检和确认后的视觉链路。
|
|
313
316
|
|
|
314
317
|
- **依赖完整性**:原 `package.json` 缺 `typescript`,已补入 `devDependencies`;`npm install && npm run build` 现在可稳定产出 `lib/index.js` + `lib/index.d.ts`。
|
|
315
318
|
- **类型层**:对照真实发布的 `@deepseek-ai/dsh-tools` / `@deepseek-ai/dsh-llm` / `@deepseek-ai/dsh-attachment` 编译通过。
|
package/lib/index.js
CHANGED
|
@@ -81,6 +81,7 @@ function resolveBinary() {
|
|
|
81
81
|
if (win && fs.existsSync(win))
|
|
82
82
|
return win;
|
|
83
83
|
const candidates = [
|
|
84
|
+
env.SCREEN_AUTOMATION_HELPER_EXE,
|
|
84
85
|
env.LOCALAPPDATA
|
|
85
86
|
? `${env.LOCALAPPDATA}\\Programs\\Xiaozs\\ScreenAutomationHelper\\ScreenAutomationHelper.exe`
|
|
86
87
|
: null,
|
|
@@ -153,7 +154,7 @@ function cliTool(opts) {
|
|
|
153
154
|
throw new Error(`screen_automation tool denied by Agent Bridge task policy: ${opts.name}`);
|
|
154
155
|
}
|
|
155
156
|
try {
|
|
156
|
-
return await runCli(opts.buildArgs(args),
|
|
157
|
+
return await runCli(opts.buildArgs(args), opts.timeoutMs, opts.stdinText?.(args));
|
|
157
158
|
}
|
|
158
159
|
catch (e) {
|
|
159
160
|
if (opts.softFail) {
|
|
@@ -196,8 +197,8 @@ export function apply(ctx) {
|
|
|
196
197
|
}));
|
|
197
198
|
ctx.tools.register(cliTool({
|
|
198
199
|
name: 'screen_automation_workflow_schema',
|
|
199
|
-
description: 'Read installed workflow schema.
|
|
200
|
-
parameters: { target: { type: 'string', required: true, enum: ['steps', 'sdk', 'templates'] } },
|
|
200
|
+
description: 'Read installed workflow schema. Check steps.failure_contract for supported on-site recovery and follow-up actions. Query interactions and confirm continuous-interaction@1 before authoring continuous interaction sections. Observe/verify phases are read-only; execution needs explicit stage permission and post-verification. Python permissions and AST checks are not an OS sandbox.',
|
|
201
|
+
parameters: { target: { type: 'string', required: true, enum: ['steps', 'sdk', 'templates', 'interactions'] } },
|
|
201
202
|
buildArgs: (a) => ['workflow', 'schema', String(a.target)],
|
|
202
203
|
}));
|
|
203
204
|
ctx.tools.register(cliTool({
|
|
@@ -444,7 +445,8 @@ export function apply(ctx) {
|
|
|
444
445
|
ctx.tools.register(cliTool({
|
|
445
446
|
name: 'screen_automation_run_workflow',
|
|
446
447
|
description: 'Run an installed automation workflow by id on the local Screen Automation Helper platform. ' +
|
|
447
|
-
'
|
|
448
|
+
'Before starting parallel runs, check installed capabilities and conflicts in target windows or business state. ' +
|
|
449
|
+
'The helper schedules shared foreground input. Use list_runs to report each run_id as running or queued when applicable.',
|
|
448
450
|
parameters: {
|
|
449
451
|
workflow_id: { type: 'string', required: true, description: 'Installed workflow id, e.g. ark-afp-usage-monitor' },
|
|
450
452
|
count: { type: 'number', description: 'Number of times to run (default 1).' },
|
|
@@ -471,7 +473,7 @@ export function apply(ctx) {
|
|
|
471
473
|
// 6) 列出当前运行
|
|
472
474
|
ctx.tools.register(cliTool({
|
|
473
475
|
name: 'screen_automation_list_runs',
|
|
474
|
-
description: 'List
|
|
476
|
+
description: 'List workflow runs and report each run_id with its state, including queued, running, stopping and finalizing.',
|
|
475
477
|
parameters: {},
|
|
476
478
|
buildArgs: () => ['runs', 'list'],
|
|
477
479
|
}));
|
|
@@ -769,7 +771,43 @@ export function apply(ctx) {
|
|
|
769
771
|
},
|
|
770
772
|
buildArgs: (a) => ['workflow', 'remove', String(a.workflow_id)],
|
|
771
773
|
}));
|
|
772
|
-
// =====
|
|
774
|
+
// ===== 窗口选择与任务会话 =====
|
|
775
|
+
ctx.tools.register(cliTool({
|
|
776
|
+
name: 'screen_automation_window_list_visible',
|
|
777
|
+
description: 'List visible local windows. Use the result to identify a target for task_begin.',
|
|
778
|
+
parameters: {},
|
|
779
|
+
buildArgs: () => ['window', 'list-visible'],
|
|
780
|
+
}));
|
|
781
|
+
ctx.tools.register(cliTool({
|
|
782
|
+
name: 'screen_automation_window_wait_selection',
|
|
783
|
+
description: 'Wait up to 30 seconds for the user to select the target window, optionally filtered by title or process. Bind the selected window with task_begin.',
|
|
784
|
+
parameters: {
|
|
785
|
+
title: { type: 'string', description: 'Optional window title filter.' },
|
|
786
|
+
process: { type: 'string', description: 'Optional process name filter.' },
|
|
787
|
+
},
|
|
788
|
+
timeoutMs: 40000,
|
|
789
|
+
buildArgs: (a) => {
|
|
790
|
+
const args = ['window', 'wait-selection'];
|
|
791
|
+
if (a.title)
|
|
792
|
+
args.push('--title', a.title);
|
|
793
|
+
if (a.process)
|
|
794
|
+
args.push('--process', a.process);
|
|
795
|
+
return args;
|
|
796
|
+
},
|
|
797
|
+
}));
|
|
798
|
+
ctx.tools.register(cliTool({
|
|
799
|
+
name: 'screen_automation_task_observe',
|
|
800
|
+
description: 'Read window metadata and OCR text for the bound task. Observe before acting and again to verify the result.',
|
|
801
|
+
parameters: {
|
|
802
|
+
min_confidence: { type: 'number', description: 'Optional minimum OCR confidence (0..1).' },
|
|
803
|
+
},
|
|
804
|
+
buildArgs: (a) => {
|
|
805
|
+
const args = ['task', 'observe', '--text-only'];
|
|
806
|
+
if (typeof a.min_confidence === 'number')
|
|
807
|
+
args.push('--min-confidence', String(a.min_confidence));
|
|
808
|
+
return args;
|
|
809
|
+
},
|
|
810
|
+
}));
|
|
773
811
|
// 24) 开始任务会话
|
|
774
812
|
ctx.tools.register(cliTool({
|
|
775
813
|
name: 'screen_automation_task_begin',
|
|
@@ -980,6 +1018,6 @@ export function apply(ctx) {
|
|
|
980
1018
|
console.log('[screen-automation] loaded; bridged tools: status, describe, capabilities, access_list/status, workflow_schema/sdk, agent_status/probe, browser enhancement, list/run/stop workflows, runs, health, capture, ' +
|
|
981
1019
|
'recognize_text, locate_text, color_regions, match_template, contours, wait_text, ' +
|
|
982
1020
|
'click, drag, scroll, long_press, type_text, hotkey, ' +
|
|
983
|
-
'workflow_validate/install/remove/show/describe/inspect, task_begin/status/end, ' +
|
|
1021
|
+
'workflow_validate/install/remove/show/describe/inspect, window_list_visible/wait_selection, task_begin/observe/status/end, ' +
|
|
984
1022
|
'understand(vlm)');
|
|
985
1023
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-screen-automation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "DeepSeek Harness (dsh) plugin that bridges the local 'Screen Automation Helper' desktop platform (Windows/macOS) into the Agent tool system. Exposes status, capabilities, workflow list/run/stop, run management, screen capture, local recognition primitives, input control, workflow lifecycle, task sessions and VLM understanding as dsh tools that shell out to the helper's CLI (JSON interface).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|