@namzu/computer-use 1.4.0 → 1.4.1
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/CHANGELOG.md +6 -0
- package/README.md +2 -4
- package/dist/SubprocessComputerUseHost.d.ts +1 -1
- package/dist/SubprocessComputerUseHost.d.ts.map +1 -1
- package/dist/SubprocessComputerUseHost.js +15 -0
- package/dist/SubprocessComputerUseHost.js.map +1 -1
- package/package.json +2 -2
- package/src/SubprocessComputerUseHost.ts +16 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ec1ac3c: `SubprocessComputerUseHost.initialize()` asks the desktop one cheap question (its geometry) after loading the adapter and refuses to become ready if it does not answer. Finding PowerShell on a WSL PATH is not the same as having an interactive Windows session to capture; the host used to report ready and let every screenshot fail the same way. The error names the adapter and what the desktop said, and a host that only ships the tool when `initialize()` succeeds now leaves it unmounted.
|
|
8
|
+
|
|
3
9
|
## 1.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -6,9 +6,8 @@ description: >-
|
|
|
6
6
|
Which backend serves a call depends on the platform, and what a platform
|
|
7
7
|
cannot do is reported as a capability rather than discovered as a failure.
|
|
8
8
|
tags: [readme, package, computer-use, adapters]
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
diataxis: reference
|
|
9
|
+
status: stable
|
|
10
|
+
generated: { by: human:bahadirarda, at: 2026-08-20T00:00:00Z }
|
|
12
11
|
-->
|
|
13
12
|
|
|
14
13
|
<div align="center">
|
|
@@ -82,7 +81,6 @@ the Windows desktop containing the terminal.
|
|
|
82
81
|
|
|
83
82
|
## Documentation
|
|
84
83
|
|
|
85
|
-
- [Computer use — the platform matrix, capability flags and error surface](https://github.com/cogitave/namzu/blob/main/docs/packages/computer-use.md)
|
|
86
84
|
- [Namzu docs](https://github.com/cogitave/namzu/tree/main/docs)
|
|
87
85
|
|
|
88
86
|
## License
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComputerUseAction, ComputerUseCapabilities, ComputerUseHost, ComputerUseResult, DisplayGeometry } from '@namzu/sdk';
|
|
2
|
-
import type
|
|
2
|
+
import { type Adapter } from './adapters/types.js';
|
|
3
3
|
export interface SubprocessComputerUseHostOptions {
|
|
4
4
|
readonly env?: NodeJS.ProcessEnv;
|
|
5
5
|
readonly platform?: NodeJS.Platform;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubprocessComputerUseHost.d.ts","sourceRoot":"","sources":["../src/SubprocessComputerUseHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SubprocessComputerUseHost.d.ts","sourceRoot":"","sources":["../src/SubprocessComputerUseHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,OAAO,EAA2B,MAAM,qBAAqB,CAAA;AAsB3E,MAAM,WAAW,gCAAgC;IAChD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IACnC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED;;;;;;;;;;GAUG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAChE,QAAQ,CAAC,EAAE,kCAAiC;IAC5C,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,OAAO,CAAuB;gBAE1B,OAAO,GAAE,gCAAqC;IAY1D,IAAI,YAAY,IAAI,uBAAuB,CAE1C;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB3B,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC;IAK9C,OAAO,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAkB9D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,OAAO,CAAC,cAAc;CAQtB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AdapterUnavailableError } from './adapters/types.js';
|
|
1
2
|
import { detectDisplayServer } from './detect/index.js';
|
|
2
3
|
import { ComputerUseOutcomeUnknownError } from './errors.js';
|
|
3
4
|
import { SpawnError } from './util/spawn.js';
|
|
@@ -50,6 +51,20 @@ export class SubprocessComputerUseHost {
|
|
|
50
51
|
return;
|
|
51
52
|
const displayServer = this._capabilities.displayServer;
|
|
52
53
|
const adapter = await loadAdapter(displayServer);
|
|
54
|
+
// Loading an adapter proves its tools exist on PATH, not that a desktop
|
|
55
|
+
// answers. A WSL process finds PowerShell and still may have no
|
|
56
|
+
// interactive Windows session to capture; an ssh session finds xdotool
|
|
57
|
+
// and no display. The host used to become "ready" on the first and let
|
|
58
|
+
// every later action fail the same way — and a model that reads the
|
|
59
|
+
// same error asks again. One cheap read here turns that into "computer
|
|
60
|
+
// use is unavailable on this device" before any tool is mounted.
|
|
61
|
+
try {
|
|
62
|
+
await adapter.getDisplayGeometry();
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
66
|
+
throw new AdapterUnavailableError(`SubprocessComputerUseHost: the ${displayServer} adapter loaded but the desktop did not answer: ${reason}`);
|
|
67
|
+
}
|
|
53
68
|
this.adapter = adapter;
|
|
54
69
|
this._capabilities = adapter.capabilities;
|
|
55
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubprocessComputerUseHost.js","sourceRoot":"","sources":["../src/SubprocessComputerUseHost.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubprocessComputerUseHost.js","sourceRoot":"","sources":["../src/SubprocessComputerUseHost.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgB,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,0BAA0B,GAA4B;IAC3D,aAAa,EAAE,SAAS;IACxB,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,KAAK;IACf,cAAc,EAAE,KAAK;IACrB,SAAS,EAAE,KAAK;CAChB,CAAA;AAED,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAA4B;IACvE,aAAa;IACb,YAAY;IACZ,QAAQ;IACR,WAAW;IACX,KAAK;CACL,CAAC,CAAA;AAaF;;;;;;;;;;GAUG;AACH,MAAM,OAAO,yBAAyB;IAC5B,EAAE,GAAG,8BAA8B,CAAA;IACpC,aAAa,CAAyB;IACtC,OAAO,GAAmB,IAAI,CAAA;IAEtC,YAAY,UAA4C,EAAE;QACzD,MAAM,aAAa,GAAG,mBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;QACxE,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;YAClC,GAAG,0BAA0B;YAC7B,aAAa;SACb,CAAC,CAAA;QACF,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;YAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAA;QAClD,CA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ACb,MAAM,IAAI,KAAK,CACd,sEAAsE,aAAa,OAAO,CAC1F,CAAA;IACH,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namzu/computer-use",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Subprocess-based computer-use host for @namzu/sdk. Screenshot, mouse, and keyboard control via platform-native CLIs (screencapture/osascript on darwin, xdotool/maim on Linux X11, grim/wtype/ydotool on Wayland, PowerShell on Windows).",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
6
|
"engines": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@types/node": "^22.19.17",
|
|
54
54
|
"typescript": "^5.5.0",
|
|
55
55
|
"vitest": "^3.2.6",
|
|
56
|
-
"@namzu/sdk": "^
|
|
56
|
+
"@namzu/sdk": "^35.0.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsc --build",
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
ComputerUseResult,
|
|
6
6
|
DisplayGeometry,
|
|
7
7
|
} from '@namzu/sdk'
|
|
8
|
-
import type
|
|
8
|
+
import { type Adapter, AdapterUnavailableError } from './adapters/types.js'
|
|
9
9
|
import { detectDisplayServer } from './detect/index.js'
|
|
10
10
|
import { ComputerUseOutcomeUnknownError } from './errors.js'
|
|
11
11
|
import { SpawnError } from './util/spawn.js'
|
|
@@ -74,6 +74,21 @@ export class SubprocessComputerUseHost implements ComputerUseHost {
|
|
|
74
74
|
if (this.adapter) return
|
|
75
75
|
const displayServer = this._capabilities.displayServer
|
|
76
76
|
const adapter = await loadAdapter(displayServer)
|
|
77
|
+
// Loading an adapter proves its tools exist on PATH, not that a desktop
|
|
78
|
+
// answers. A WSL process finds PowerShell and still may have no
|
|
79
|
+
// interactive Windows session to capture; an ssh session finds xdotool
|
|
80
|
+
// and no display. The host used to become "ready" on the first and let
|
|
81
|
+
// every later action fail the same way — and a model that reads the
|
|
82
|
+
// same error asks again. One cheap read here turns that into "computer
|
|
83
|
+
// use is unavailable on this device" before any tool is mounted.
|
|
84
|
+
try {
|
|
85
|
+
await adapter.getDisplayGeometry()
|
|
86
|
+
} catch (error) {
|
|
87
|
+
const reason = error instanceof Error ? error.message : String(error)
|
|
88
|
+
throw new AdapterUnavailableError(
|
|
89
|
+
`SubprocessComputerUseHost: the ${displayServer} adapter loaded but the desktop did not answer: ${reason}`,
|
|
90
|
+
)
|
|
91
|
+
}
|
|
77
92
|
this.adapter = adapter
|
|
78
93
|
this._capabilities = adapter.capabilities
|
|
79
94
|
}
|