dsh-mac-computer-use 1.3.1 → 1.3.2
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/index.js +9 -3
- package/package.json +1 -1
- package/setup.js +3 -1
package/index.js
CHANGED
|
@@ -62,6 +62,7 @@ function fifoOpen() {
|
|
|
62
62
|
/** 只认当前账号的浮层:别的账号开着浮层不算(否则每次操作都白等它的 FIFO) */
|
|
63
63
|
function overlayRunning() {
|
|
64
64
|
return new Promise((resolve) => {
|
|
65
|
+
if (typeof process.getuid !== 'function') return resolve(false)
|
|
65
66
|
execFile('/usr/bin/pgrep', ['-U', String(process.getuid()), '-f', 'dsh-cursor-overlay'], (err) => resolve(!err))
|
|
66
67
|
})
|
|
67
68
|
}
|
|
@@ -650,10 +651,15 @@ export function apply(ctx, config) {
|
|
|
650
651
|
}),
|
|
651
652
|
]
|
|
652
653
|
|
|
653
|
-
|
|
654
|
-
|
|
654
|
+
// 不是 macOS 就不给模型这些工具(用不了);设置页照样挂,卡片会写「只支持 macOS」
|
|
655
|
+
if (process.platform !== 'darwin') {
|
|
656
|
+
trace(`不是 macOS(${process.platform}),不注册桌面工具`)
|
|
657
|
+
} else {
|
|
658
|
+
for (const tool of tools) {
|
|
659
|
+
try { ctx.tools.register(tool) } catch (e) { trace(`注册 ${tool.name} 失败: ${e && e.message}`); throw e }
|
|
660
|
+
}
|
|
661
|
+
trace(`已注册 ${tools.length} 个工具: ${tools.map((t) => t.name).join(', ')}`)
|
|
655
662
|
}
|
|
656
|
-
trace(`已注册 ${tools.length} 个工具: ${tools.map((t) => t.name).join(', ')}`)
|
|
657
663
|
|
|
658
664
|
// DSH 设置页的数据路由。挂不上也只是设置页没数据,绝不能连累工具注册
|
|
659
665
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mac-computer-use",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vision-first Mac computer use for DSH: window list, screenshots, OCR text targeting, numbered elements, background clicks and typing. Works without the accessibility tree.",
|
|
6
6
|
"license": "MIT",
|
package/setup.js
CHANGED
|
@@ -45,7 +45,9 @@ export function findBin() {
|
|
|
45
45
|
export const OVERLAY = process.env.DSH_CU_OVERLAY || path.join(os.homedir(), '.dsh/bin/dsh-cursor-overlay')
|
|
46
46
|
|
|
47
47
|
// 只认当前账号的浮层:别的账号开着的不算、也不去关
|
|
48
|
-
|
|
48
|
+
// Windows / Linux 上没有 getuid:模块顶层直接调会让整个插件导入失败(DSH 里显示「没启动」)
|
|
49
|
+
const UID = typeof process.getuid === 'function' ? String(process.getuid()) : ''
|
|
50
|
+
const MINE = ['-U', UID, '-f', 'dsh-cursor-overlay']
|
|
49
51
|
|
|
50
52
|
export function overlayState() {
|
|
51
53
|
let installed = false, running = false
|