@alwith/module-computer 0.6.3 → 0.6.4
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/artifacts/cmux-cua-e0f7388-alwith.5-aarch64-apple-darwin.tar.gz +0 -0
- package/dist/artifacts.js +1 -1
- package/dist/generated/commands.d.ts +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/native/darwin-arm64/THIRD_PARTY_NOTICES.md +4 -4
- package/native/darwin-arm64/artifact.json +1 -1
- package/native/darwin-arm64/libalwith_native_computer.dylib +0 -0
- package/native/linux-x64/THIRD_PARTY_NOTICES.md +11 -11
- package/native/linux-x64/artifact.json +1 -1
- package/native/linux-x64/libalwith_native_computer.so +0 -0
- package/native/win32-x64/THIRD_PARTY_NOTICES.md +4 -4
- package/native/win32-x64/alwith_native_computer.dll +0 -0
- package/native/win32-x64/artifact.json +1 -1
- package/package.json +2 -2
- package/proxy/stdio.mjs +157 -14
- package/artifacts/cmux-cua-e0f7388-alwith.4-aarch64-apple-darwin.tar.gz +0 -0
- /package/artifacts/{cmux-cua-e0f7388-alwith.4-x86_64-pc-windows-msvc.tar.gz → cmux-cua-e0f7388-alwith.5-x86_64-pc-windows-msvc.tar.gz} +0 -0
- /package/artifacts/{cmux-cua-e0f7388-alwith.4-x86_64-unknown-linux-gnu.tar.gz → cmux-cua-e0f7388-alwith.5-x86_64-unknown-linux-gnu.tar.gz} +0 -0
- /package/native/darwin-arm64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{specta-2.0.0-rc.27 → specta-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{specta-macros-2.0.0-rc.27 → specta-macros-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{uuid-1.29.0 → uuid-1.29.1}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{uuid-1.29.0 → uuid-1.29.1}/LICENSE-MIT +0 -0
- /package/native/linux-x64/licenses/{cc-1.11.0 → cc-1.11.1}/LICENSE-APACHE +0 -0
- /package/native/linux-x64/licenses/{cc-1.11.0 → cc-1.11.1}/LICENSE-MIT +0 -0
- /package/native/linux-x64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-APACHE +0 -0
- /package/native/linux-x64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-MIT +0 -0
- /package/native/linux-x64/licenses/{serde_spanned-1.1.2 → serde_spanned-1.1.3}/LICENSE-APACHE +0 -0
- /package/native/linux-x64/licenses/{serde_spanned-1.1.2 → serde_spanned-1.1.3}/LICENSE-MIT +0 -0
- /package/native/linux-x64/licenses/{smallvec-1.16.4 → smallvec-1.16.5}/LICENSE-APACHE +0 -0
- /package/native/linux-x64/licenses/{smallvec-1.16.4 → smallvec-1.16.5}/LICENSE-MIT +0 -0
- /package/native/linux-x64/licenses/{specta-2.0.0-rc.27 → specta-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/linux-x64/licenses/{specta-macros-2.0.0-rc.27 → specta-macros-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/linux-x64/licenses/{toml-1.2.0+spec-1.1.0 → toml-1.2.1+spec-1.1.0}/LICENSE-APACHE +0 -0
- /package/native/linux-x64/licenses/{toml-1.2.0+spec-1.1.0 → toml-1.2.1+spec-1.1.0}/LICENSE-MIT +0 -0
- /package/native/linux-x64/licenses/{toml_datetime-1.1.2+spec-1.1.0 → toml_datetime-1.1.3+spec-1.1.0}/LICENSE-APACHE +0 -0
- /package/native/linux-x64/licenses/{toml_datetime-1.1.2+spec-1.1.0 → toml_datetime-1.1.3+spec-1.1.0}/LICENSE-MIT +0 -0
- /package/native/linux-x64/licenses/{toml_edit-0.25.18+spec-1.1.0 → toml_edit-0.25.19+spec-1.1.0}/LICENSE-APACHE +0 -0
- /package/native/linux-x64/licenses/{toml_edit-0.25.18+spec-1.1.0 → toml_edit-0.25.19+spec-1.1.0}/LICENSE-MIT +0 -0
- /package/native/linux-x64/licenses/{uuid-1.29.0 → uuid-1.29.1}/LICENSE-APACHE +0 -0
- /package/native/linux-x64/licenses/{uuid-1.29.0 → uuid-1.29.1}/LICENSE-MIT +0 -0
- /package/native/linux-x64/licenses/{winnow-1.0.4 → winnow-1.0.5}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{flate2-1.1.10 → flate2-1.1.11}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{specta-2.0.0-rc.27 → specta-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{specta-macros-2.0.0-rc.27 → specta-macros-2.0.0-rc.28}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{uuid-1.29.0 → uuid-1.29.1}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{uuid-1.29.0 → uuid-1.29.1}/LICENSE-MIT +0 -0
|
Binary file
|
package/dist/artifacts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a={version:"cmux-e0f7388-alwith.
|
|
1
|
+
var a={version:"cmux-e0f7388-alwith.5",artifacts:{"aarch64-apple-darwin":{bundled:"../artifacts/cmux-cua-e0f7388-alwith.5-aarch64-apple-darwin.tar.gz",sha256:"9fc31f7e3b5a53bee5d2ac8b4fcd5e992859dbfb68abd4f247051bd97be29ffe",archive:"cmux-cua-e0f7388-alwith.5-aarch64-apple-darwin.tar.gz",executable:"cua-driver"},"x86_64-pc-windows-msvc":{bundled:"../artifacts/cmux-cua-e0f7388-alwith.5-x86_64-pc-windows-msvc.tar.gz",sha256:"33490ea7ef0999462e0d592e792b6a0a48cb6c9c76165aa04285b320df13c824",archive:"cmux-cua-e0f7388-alwith.5-x86_64-pc-windows-msvc.tar.gz",executable:"cua-driver.exe"},"x86_64-unknown-linux-gnu":{bundled:"../artifacts/cmux-cua-e0f7388-alwith.5-x86_64-unknown-linux-gnu.tar.gz",sha256:"8664e8b4e7e81bc13641d4becb527430d140ba23f630e9f20d9da6d473e236db",archive:"cmux-cua-e0f7388-alwith.5-x86_64-unknown-linux-gnu.tar.gz",executable:"cua-driver"}}};var t=a;export{t as default};
|
|
@@ -61,6 +61,7 @@ export declare const events: {
|
|
|
61
61
|
};
|
|
62
62
|
export type Activity = Activity_Serialize | Activity_Deserialize;
|
|
63
63
|
export type Activity_Deserialize = {
|
|
64
|
+
refreshing?: boolean;
|
|
64
65
|
sessionId: string;
|
|
65
66
|
phase: string;
|
|
66
67
|
queuePosition: number;
|
|
@@ -70,6 +71,7 @@ export type Activity_Deserialize = {
|
|
|
70
71
|
revision: number;
|
|
71
72
|
};
|
|
72
73
|
export type Activity_Serialize = {
|
|
74
|
+
refreshing: boolean;
|
|
73
75
|
sessionId: string;
|
|
74
76
|
phase: string;
|
|
75
77
|
queuePosition: number;
|
|
@@ -93,6 +95,8 @@ export type ComputerPreview_Serialize = {
|
|
|
93
95
|
};
|
|
94
96
|
export type ComputerStatus = ComputerStatus_Serialize | ComputerStatus_Deserialize;
|
|
95
97
|
export type ComputerStatus_Deserialize = {
|
|
98
|
+
driverPhase: string;
|
|
99
|
+
connections: ConnectionHealth;
|
|
96
100
|
permissions: Permissions;
|
|
97
101
|
available: boolean;
|
|
98
102
|
enabled: boolean;
|
|
@@ -102,6 +106,8 @@ export type ComputerStatus_Deserialize = {
|
|
|
102
106
|
diagnostics: string;
|
|
103
107
|
};
|
|
104
108
|
export type ComputerStatus_Serialize = {
|
|
109
|
+
driverPhase: string;
|
|
110
|
+
connections: ConnectionHealth;
|
|
105
111
|
permissions: Permissions;
|
|
106
112
|
available: boolean;
|
|
107
113
|
enabled: boolean;
|
|
@@ -116,6 +122,12 @@ export type Connection = {
|
|
|
116
122
|
args: string[];
|
|
117
123
|
env: Environment[];
|
|
118
124
|
};
|
|
125
|
+
export type ConnectionHealth = {
|
|
126
|
+
ready: number;
|
|
127
|
+
connecting: number;
|
|
128
|
+
disconnected: number;
|
|
129
|
+
failed: number;
|
|
130
|
+
};
|
|
119
131
|
export type CursorPosition = {
|
|
120
132
|
x: number;
|
|
121
133
|
y: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface ComputerMcpServer {
|
|
|
27
27
|
}>;
|
|
28
28
|
}
|
|
29
29
|
export declare const COMPUTER_SERVER_NAME = "alwith_computer";
|
|
30
|
-
export declare const COMPUTER_INSTRUCTIONS = "Computer actions must use the private MCP server named alwith_computer. Discover its tools before acting. When get_app_state is available, use the app-oriented tools: get_app_state starts app use and returns its key-window screenshot and accessibility tree; act using that app identity and the returned element indices or screenshot coordinates.
|
|
30
|
+
export declare const COMPUTER_INSTRUCTIONS = "Computer actions must use the private MCP server named alwith_computer. Discover its tools before acting. When get_app_state is available, use the app-oriented tools: get_app_state starts app use and returns its key-window screenshot and accessibility tree; act using that app identity and the returned element indices or screenshot coordinates. Group independent actions against a stable layout in one host turn, awaiting them sequentially. Do not run desktop actions concurrently. Prefer set_value for an editable field when supported. Do not poll get_app_state after each action: stable grounded actions can follow without another snapshot; refresh after navigation, layout changes, modal transitions or an action error, and verify the completed sequence. Actions report dispatch, not verified completion. Otherwise, read skill://cua-driver/SKILL.md from alwith_computer and use its window-oriented tools and element tokens. The host handles conversation ownership, queuing and preview. Respect driver refusals and explicit input delivery modes. Computer access is disabled until the user enables it in the application. If a computer call fails or access is revoked, stop computer actions and report the tool error; ordinary conversation can continue. Never replay an action whose outcome is unknown; never substitute cua_repl, shell automation or another computer channel. Ask the user to enable or reconnect computer access in the application when computer actions are needed.";
|
|
31
31
|
export declare function computerContext(resolve: () => Promise<ComputerConnection | null>): Promise<{
|
|
32
32
|
mcpServers: ComputerMcpServer[];
|
|
33
33
|
appendSystemPrompt?: string;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var r="alwith_computer",o="Computer actions must use the private MCP server named alwith_computer. Discover its tools before acting. When get_app_state is available, use the app-oriented tools: get_app_state starts app use and returns its key-window screenshot and accessibility tree; act using that app identity and the returned element indices or screenshot coordinates.
|
|
1
|
+
var r="alwith_computer",o="Computer actions must use the private MCP server named alwith_computer. Discover its tools before acting. When get_app_state is available, use the app-oriented tools: get_app_state starts app use and returns its key-window screenshot and accessibility tree; act using that app identity and the returned element indices or screenshot coordinates. Group independent actions against a stable layout in one host turn, awaiting them sequentially. Do not run desktop actions concurrently. Prefer set_value for an editable field when supported. Do not poll get_app_state after each action: stable grounded actions can follow without another snapshot; refresh after navigation, layout changes, modal transitions or an action error, and verify the completed sequence. Actions report dispatch, not verified completion. Otherwise, read skill://cua-driver/SKILL.md from alwith_computer and use its window-oriented tools and element tokens. The host handles conversation ownership, queuing and preview. Respect driver refusals and explicit input delivery modes. Computer access is disabled until the user enables it in the application. If a computer call fails or access is revoked, stop computer actions and report the tool error; ordinary conversation can continue. Never replay an action whose outcome is unknown; never substitute cua_repl, shell automation or another computer channel. Ask the user to enable or reconnect computer access in the application when computer actions are needed.";async function s(t){let e=await t();if(!e)return{mcpServers:[],revision:"disabled"};return{mcpServers:[{type:"stdio",name:"alwith_computer",command:e.command,args:[...e.args],env:e.env.map((n)=>({...n}))}],revision:e.generation,appendSystemPrompt:"Computer actions must use the private MCP server named alwith_computer. Discover its tools before acting. When get_app_state is available, use the app-oriented tools: get_app_state starts app use and returns its key-window screenshot and accessibility tree; act using that app identity and the returned element indices or screenshot coordinates. Group independent actions against a stable layout in one host turn, awaiting them sequentially. Do not run desktop actions concurrently. Prefer set_value for an editable field when supported. Do not poll get_app_state after each action: stable grounded actions can follow without another snapshot; refresh after navigation, layout changes, modal transitions or an action error, and verify the completed sequence. Actions report dispatch, not verified completion. Otherwise, read skill://cua-driver/SKILL.md from alwith_computer and use its window-oriented tools and element tokens. The host handles conversation ownership, queuing and preview. Respect driver refusals and explicit input delivery modes. Computer access is disabled until the user enables it in the application. If a computer call fails or access is revoked, stop computer actions and report the tool error; ordinary conversation can continue. Never replay an action whose outcome is unknown; never substitute cua_repl, shell automation or another computer channel. Ask the user to enable or reconnect computer access in the application when computer actions are needed."}}export{o as COMPUTER_INSTRUCTIONS,r as COMPUTER_SERVER_NAME,s as computerContext};
|
|
@@ -20,7 +20,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
20
20
|
- errno@0.3.14: MIT OR Apache-2.0; licenses/errno-0.3.14/
|
|
21
21
|
- fastrand@2.5.0: Apache-2.0 OR MIT; licenses/fastrand-2.5.0/
|
|
22
22
|
- fdeflate@0.3.7: MIT OR Apache-2.0; licenses/fdeflate-0.3.7/
|
|
23
|
-
- flate2@1.1.
|
|
23
|
+
- flate2@1.1.11: MIT OR Apache-2.0; licenses/flate2-1.1.11/
|
|
24
24
|
- getrandom@0.4.3: MIT OR Apache-2.0; licenses/getrandom-0.4.3/
|
|
25
25
|
- image@0.25.10: MIT OR Apache-2.0; licenses/image-0.25.10/
|
|
26
26
|
- itoa@1.0.18: MIT OR Apache-2.0; licenses/itoa-1.0.18/
|
|
@@ -71,8 +71,8 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
71
71
|
- signal-hook-registry@1.4.8: MIT OR Apache-2.0; licenses/signal-hook-registry-1.4.8/
|
|
72
72
|
- simd-adler32@0.3.10: MIT; licenses/simd-adler32-0.3.10/
|
|
73
73
|
- socket2@0.6.5: MIT OR Apache-2.0; licenses/socket2-0.6.5/
|
|
74
|
-
- specta@2.0.0-rc.
|
|
75
|
-
- specta-macros@2.0.0-rc.
|
|
74
|
+
- specta@2.0.0-rc.28: MIT; licenses/specta-2.0.0-rc.28/; source: https://raw.githubusercontent.com/specta-rs/specta/82278bb5fef379b755af41b831ae3d3533e55b39/LICENSE
|
|
75
|
+
- specta-macros@2.0.0-rc.28: MIT; licenses/specta-macros-2.0.0-rc.28/; source: https://raw.githubusercontent.com/specta-rs/specta/82278bb5fef379b755af41b831ae3d3533e55b39/LICENSE
|
|
76
76
|
- syn@2.0.119: MIT OR Apache-2.0; licenses/syn-2.0.119/
|
|
77
77
|
- syn@3.0.9: MIT OR Apache-2.0; licenses/syn-3.0.9/
|
|
78
78
|
- tempfile@3.27.0: MIT OR Apache-2.0; licenses/tempfile-3.27.0/
|
|
@@ -81,7 +81,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
81
81
|
- tokio@1.54.1: MIT; licenses/tokio-1.54.1/
|
|
82
82
|
- tokio-macros@2.7.2: MIT; licenses/tokio-macros-2.7.2/
|
|
83
83
|
- unicode-ident@1.0.27: (MIT OR Apache-2.0) AND Unicode-3.0; licenses/unicode-ident-1.0.27/
|
|
84
|
-
- uuid@1.29.
|
|
84
|
+
- uuid@1.29.1: Apache-2.0 OR MIT; licenses/uuid-1.29.1/
|
|
85
85
|
- xcap@0.9.8: Apache-2.0; licenses/xcap-0.9.8/
|
|
86
86
|
- zlib-rs@0.6.8: Zlib; licenses/zlib-rs-0.6.8/
|
|
87
87
|
- zmij@1.0.23: MIT; licenses/zmij-1.0.23/
|
|
Binary file
|
|
@@ -27,7 +27,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
27
27
|
- bytemuck_derive@1.12.1: Zlib OR Apache-2.0 OR MIT; licenses/bytemuck_derive-1.12.1/
|
|
28
28
|
- byteorder-lite@0.1.0: Unlicense OR MIT; licenses/byteorder-lite-0.1.0/
|
|
29
29
|
- bytes@1.12.1: MIT; licenses/bytes-1.12.1/
|
|
30
|
-
- cc@1.11.
|
|
30
|
+
- cc@1.11.1: MIT OR Apache-2.0; licenses/cc-1.11.1/
|
|
31
31
|
- cexpr@0.6.0: Apache-2.0/MIT; licenses/cexpr-0.6.0/
|
|
32
32
|
- cfg-expr@0.20.10: MIT OR Apache-2.0; licenses/cfg-expr-0.20.10/
|
|
33
33
|
- cfg-if@1.0.5: MIT OR Apache-2.0; licenses/cfg-if-1.0.5/
|
|
@@ -57,7 +57,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
57
57
|
- fastrand@2.5.0: Apache-2.0 OR MIT; licenses/fastrand-2.5.0/
|
|
58
58
|
- fdeflate@0.3.7: MIT OR Apache-2.0; licenses/fdeflate-0.3.7/
|
|
59
59
|
- find-msvc-tools@0.1.15: MIT OR Apache-2.0; licenses/find-msvc-tools-0.1.15/
|
|
60
|
-
- flate2@1.1.
|
|
60
|
+
- flate2@1.1.11: MIT OR Apache-2.0; licenses/flate2-1.1.11/
|
|
61
61
|
- form_urlencoded@1.2.2: MIT OR Apache-2.0; licenses/form_urlencoded-1.2.2/
|
|
62
62
|
- futures-core@0.3.34: MIT OR Apache-2.0; licenses/futures-core-0.3.34/
|
|
63
63
|
- futures-io@0.3.34: MIT OR Apache-2.0; licenses/futures-io-0.3.34/
|
|
@@ -141,16 +141,16 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
141
141
|
- serde_derive@1.0.229: MIT OR Apache-2.0; licenses/serde_derive-1.0.229/
|
|
142
142
|
- serde_json@1.0.154: MIT OR Apache-2.0; licenses/serde_json-1.0.154/
|
|
143
143
|
- serde_repr@0.1.21: MIT OR Apache-2.0; licenses/serde_repr-0.1.21/
|
|
144
|
-
- serde_spanned@1.1.
|
|
144
|
+
- serde_spanned@1.1.3: MIT OR Apache-2.0; licenses/serde_spanned-1.1.3/
|
|
145
145
|
- shlex@1.3.0: MIT OR Apache-2.0; licenses/shlex-1.3.0/
|
|
146
146
|
- shlex@2.0.1: MIT OR Apache-2.0; licenses/shlex-2.0.1/
|
|
147
147
|
- signal-hook-registry@1.4.8: MIT OR Apache-2.0; licenses/signal-hook-registry-1.4.8/
|
|
148
148
|
- simd-adler32@0.3.10: MIT; licenses/simd-adler32-0.3.10/
|
|
149
149
|
- slab@0.4.12: MIT; licenses/slab-0.4.12/
|
|
150
|
-
- smallvec@1.16.
|
|
150
|
+
- smallvec@1.16.5: MIT OR Apache-2.0; licenses/smallvec-1.16.5/
|
|
151
151
|
- socket2@0.6.5: MIT OR Apache-2.0; licenses/socket2-0.6.5/
|
|
152
|
-
- specta@2.0.0-rc.
|
|
153
|
-
- specta-macros@2.0.0-rc.
|
|
152
|
+
- specta@2.0.0-rc.28: MIT; licenses/specta-2.0.0-rc.28/; source: https://raw.githubusercontent.com/specta-rs/specta/82278bb5fef379b755af41b831ae3d3533e55b39/LICENSE
|
|
153
|
+
- specta-macros@2.0.0-rc.28: MIT; licenses/specta-macros-2.0.0-rc.28/; source: https://raw.githubusercontent.com/specta-rs/specta/82278bb5fef379b755af41b831ae3d3533e55b39/LICENSE
|
|
154
154
|
- stable_deref_trait@1.2.1: MIT OR Apache-2.0; licenses/stable_deref_trait-1.2.1/
|
|
155
155
|
- syn@2.0.119: MIT OR Apache-2.0; licenses/syn-2.0.119/
|
|
156
156
|
- syn@3.0.9: MIT OR Apache-2.0; licenses/syn-3.0.9/
|
|
@@ -163,9 +163,9 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
163
163
|
- tinystr@0.8.5: Unicode-3.0; licenses/tinystr-0.8.5/
|
|
164
164
|
- tokio@1.54.1: MIT; licenses/tokio-1.54.1/
|
|
165
165
|
- tokio-macros@2.7.2: MIT; licenses/tokio-macros-2.7.2/
|
|
166
|
-
- toml@1.2.
|
|
167
|
-
- toml_datetime@1.1.
|
|
168
|
-
- toml_edit@0.25.
|
|
166
|
+
- toml@1.2.1+spec-1.1.0: MIT OR Apache-2.0; licenses/toml-1.2.1+spec-1.1.0/
|
|
167
|
+
- toml_datetime@1.1.3+spec-1.1.0: MIT OR Apache-2.0; licenses/toml_datetime-1.1.3+spec-1.1.0/
|
|
168
|
+
- toml_edit@0.25.19+spec-1.1.0: MIT OR Apache-2.0; licenses/toml_edit-0.25.19+spec-1.1.0/
|
|
169
169
|
- toml_parser@1.1.5+spec-1.1.0: MIT OR Apache-2.0; licenses/toml_parser-1.1.5+spec-1.1.0/
|
|
170
170
|
- toml_writer@1.2.0+spec-1.1.0: MIT OR Apache-2.0; licenses/toml_writer-1.2.0+spec-1.1.0/
|
|
171
171
|
- tracing@0.1.44: MIT; licenses/tracing-0.1.44/
|
|
@@ -176,7 +176,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
176
176
|
- url@2.5.8: MIT OR Apache-2.0; licenses/url-2.5.8/
|
|
177
177
|
- utf8_iter@1.1.0: Apache-2.0 OR MIT; licenses/utf8_iter-1.1.0/
|
|
178
178
|
- utf_types@1.0.0: Apache-2.0 OR MIT; licenses/utf_types-1.0.0/
|
|
179
|
-
- uuid@1.29.
|
|
179
|
+
- uuid@1.29.1: Apache-2.0 OR MIT; licenses/uuid-1.29.1/
|
|
180
180
|
- version-compare@0.2.1: MIT; licenses/version-compare-0.2.1/
|
|
181
181
|
- wayland-backend@0.3.17: MIT; licenses/wayland-backend-0.3.17/
|
|
182
182
|
- wayland-client@0.31.15: MIT; licenses/wayland-client-0.31.15/
|
|
@@ -185,7 +185,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
185
185
|
- wayland-scanner@0.31.11: MIT; licenses/wayland-scanner-0.31.11/
|
|
186
186
|
- wayland-server@0.31.14: MIT; licenses/wayland-server-0.31.14/
|
|
187
187
|
- wayland-sys@0.31.11: MIT; licenses/wayland-sys-0.31.11/
|
|
188
|
-
- winnow@1.0.
|
|
188
|
+
- winnow@1.0.5: MIT; licenses/winnow-1.0.5/
|
|
189
189
|
- writeable@0.6.4: Unicode-3.0; licenses/writeable-0.6.4/
|
|
190
190
|
- xcap@0.9.8: Apache-2.0; licenses/xcap-0.9.8/
|
|
191
191
|
- xcb@1.7.1: MIT; licenses/xcb-1.7.1/
|
|
Binary file
|
|
@@ -15,7 +15,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
15
15
|
- crc32fast@1.5.4: MIT OR Apache-2.0; licenses/crc32fast-1.5.4/
|
|
16
16
|
- fastrand@2.5.0: Apache-2.0 OR MIT; licenses/fastrand-2.5.0/
|
|
17
17
|
- fdeflate@0.3.7: MIT OR Apache-2.0; licenses/fdeflate-0.3.7/
|
|
18
|
-
- flate2@1.1.
|
|
18
|
+
- flate2@1.1.11: MIT OR Apache-2.0; licenses/flate2-1.1.11/
|
|
19
19
|
- getrandom@0.4.3: MIT OR Apache-2.0; licenses/getrandom-0.4.3/
|
|
20
20
|
- image@0.25.10: MIT OR Apache-2.0; licenses/image-0.25.10/
|
|
21
21
|
- itoa@1.0.18: MIT OR Apache-2.0; licenses/itoa-1.0.18/
|
|
@@ -42,8 +42,8 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
42
42
|
- serde_json@1.0.154: MIT OR Apache-2.0; licenses/serde_json-1.0.154/
|
|
43
43
|
- simd-adler32@0.3.10: MIT; licenses/simd-adler32-0.3.10/
|
|
44
44
|
- socket2@0.6.5: MIT OR Apache-2.0; licenses/socket2-0.6.5/
|
|
45
|
-
- specta@2.0.0-rc.
|
|
46
|
-
- specta-macros@2.0.0-rc.
|
|
45
|
+
- specta@2.0.0-rc.28: MIT; licenses/specta-2.0.0-rc.28/; source: https://raw.githubusercontent.com/specta-rs/specta/82278bb5fef379b755af41b831ae3d3533e55b39/LICENSE
|
|
46
|
+
- specta-macros@2.0.0-rc.28: MIT; licenses/specta-macros-2.0.0-rc.28/; source: https://raw.githubusercontent.com/specta-rs/specta/82278bb5fef379b755af41b831ae3d3533e55b39/LICENSE
|
|
47
47
|
- syn@2.0.119: MIT OR Apache-2.0; licenses/syn-2.0.119/
|
|
48
48
|
- syn@3.0.9: MIT OR Apache-2.0; licenses/syn-3.0.9/
|
|
49
49
|
- tempfile@3.27.0: MIT OR Apache-2.0; licenses/tempfile-3.27.0/
|
|
@@ -52,7 +52,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
52
52
|
- tokio@1.54.1: MIT; licenses/tokio-1.54.1/
|
|
53
53
|
- tokio-macros@2.7.2: MIT; licenses/tokio-macros-2.7.2/
|
|
54
54
|
- unicode-ident@1.0.27: (MIT OR Apache-2.0) AND Unicode-3.0; licenses/unicode-ident-1.0.27/
|
|
55
|
-
- uuid@1.29.
|
|
55
|
+
- uuid@1.29.1: Apache-2.0 OR MIT; licenses/uuid-1.29.1/
|
|
56
56
|
- widestring@1.2.1: MIT OR Apache-2.0; licenses/widestring-1.2.1/
|
|
57
57
|
- windows@0.62.2: MIT OR Apache-2.0; licenses/windows-0.62.2/
|
|
58
58
|
- windows-collections@0.3.2: MIT OR Apache-2.0; licenses/windows-collections-0.3.2/
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwith/module-computer",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"files": [
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"README.md",
|
|
11
11
|
"licenses",
|
|
12
12
|
"proxy",
|
|
13
|
-
"artifacts/cmux-cua-e0f7388-alwith.
|
|
13
|
+
"artifacts/cmux-cua-e0f7388-alwith.5-*.tar.gz",
|
|
14
14
|
"native/**"
|
|
15
15
|
],
|
|
16
16
|
"exports": {
|
package/proxy/stdio.mjs
CHANGED
|
@@ -1,19 +1,162 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Keep MCP stdio alive across gateway disconnects. Never replay a dispatched action.
|
|
2
2
|
import { connect } from "node:net"
|
|
3
|
+
import { createInterface } from "node:readline"
|
|
4
|
+
|
|
3
5
|
const [address, token] = process.argv.slice(2)
|
|
4
6
|
if (!address || !token || !/^127\.0\.0\.1:\d+$/.test(address)) throw new Error("Invalid computer gateway address")
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
let socket
|
|
8
|
+
let opening
|
|
9
|
+
let pending
|
|
10
|
+
let initialization
|
|
11
|
+
let stopped = false
|
|
12
|
+
let sequence = 0
|
|
13
|
+
const wire = new WeakMap()
|
|
14
|
+
const output = (value) => process.stdout.write(`${wire.get(value) ?? JSON.stringify(value)}\n`)
|
|
15
|
+
const failure = () =>
|
|
16
|
+
new Error(
|
|
17
|
+
"Computer gateway disconnected. The previous action may have completed; do not replay it. Reconnect computer access and obtain a fresh app state. If the application restarted, reopen the conversation to renew its connection."
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
function exchange(request) {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
if (!socket || socket.destroyed) {
|
|
23
|
+
reject(failure())
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
const timer = setTimeout(() => socket?.destroy(failure()), 155_000)
|
|
27
|
+
pending = { id: request.id, resolve, reject, timer }
|
|
28
|
+
socket.write(`${JSON.stringify(request)}\n`)
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function establish() {
|
|
33
|
+
if (socket && !socket.destroyed) return
|
|
34
|
+
if (opening) return opening
|
|
35
|
+
opening = new Promise((resolve, reject) => {
|
|
36
|
+
const current = connect({
|
|
37
|
+
host: "127.0.0.1",
|
|
38
|
+
port: Number(address.split(":")[1])
|
|
39
|
+
})
|
|
40
|
+
socket = current
|
|
41
|
+
const timer = setTimeout(() => current.destroy(new Error("Computer gateway connection timed out")), 5000)
|
|
42
|
+
current.on("error", () => {})
|
|
43
|
+
current.on("close", () => {
|
|
44
|
+
clearTimeout(timer)
|
|
45
|
+
reject(failure())
|
|
46
|
+
if (socket !== current) return
|
|
47
|
+
socket = undefined
|
|
48
|
+
if (pending) {
|
|
49
|
+
clearTimeout(pending.timer)
|
|
50
|
+
pending.reject(failure())
|
|
51
|
+
pending = undefined
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
createInterface({ input: current }).on("line", (line) => {
|
|
55
|
+
let response
|
|
56
|
+
try {
|
|
57
|
+
response = JSON.parse(line)
|
|
58
|
+
} catch {
|
|
59
|
+
current.destroy(failure())
|
|
60
|
+
return
|
|
61
|
+
}
|
|
62
|
+
if (!response || typeof response !== "object" || Array.isArray(response)) {
|
|
63
|
+
current.destroy(failure())
|
|
64
|
+
return
|
|
65
|
+
}
|
|
66
|
+
wire.set(response, line)
|
|
67
|
+
if (pending && response.id === pending.id) {
|
|
68
|
+
const completed = pending
|
|
69
|
+
pending = undefined
|
|
70
|
+
clearTimeout(completed.timer)
|
|
71
|
+
completed.resolve(response)
|
|
72
|
+
} else output(response)
|
|
73
|
+
})
|
|
74
|
+
current.on("connect", () => {
|
|
75
|
+
clearTimeout(timer)
|
|
76
|
+
current.write(`${token}\n`)
|
|
77
|
+
resolve()
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
try {
|
|
81
|
+
await opening
|
|
82
|
+
if (initialization) {
|
|
83
|
+
for (const method of ["initialize", "tools/list"]) {
|
|
84
|
+
const request = method === "initialize" ? { ...initialization } : { jsonrpc: "2.0", method, params: {} }
|
|
85
|
+
request.id = `carrier-handshake-${++sequence}`
|
|
86
|
+
const response = await exchange(request)
|
|
87
|
+
if (response.error) throw new Error(`Computer gateway ${method} failed`)
|
|
88
|
+
if (method === "initialize")
|
|
89
|
+
socket.write(`${JSON.stringify({ jsonrpc: "2.0", method: "notifications/initialized" })}\n`)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
} catch (error) {
|
|
93
|
+
socket?.destroy()
|
|
94
|
+
throw error
|
|
95
|
+
} finally {
|
|
96
|
+
opening = undefined
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
let queue = Promise.resolve()
|
|
101
|
+
const input = createInterface({ input: process.stdin })
|
|
102
|
+
input.on("line", (line) => {
|
|
103
|
+
// Server-request replies and cancellation notifications must bypass a pending call.
|
|
104
|
+
let message
|
|
105
|
+
try {
|
|
106
|
+
message = JSON.parse(line)
|
|
107
|
+
} catch {
|
|
108
|
+
output({
|
|
109
|
+
jsonrpc: "2.0",
|
|
110
|
+
id: null,
|
|
111
|
+
error: { code: -32700, message: "Invalid JSON" }
|
|
112
|
+
})
|
|
113
|
+
return
|
|
114
|
+
}
|
|
115
|
+
if (!message || typeof message !== "object" || Array.isArray(message)) {
|
|
116
|
+
output({ jsonrpc: "2.0", id: null, error: { code: -32600, message: "Invalid MCP request" } })
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
if (!message.method || !Object.hasOwn(message, "id")) {
|
|
120
|
+
if (socket && !socket.destroyed) socket.write(`${line}\n`)
|
|
121
|
+
return
|
|
122
|
+
}
|
|
123
|
+
queue = queue.then(async () => {
|
|
124
|
+
if (stopped) return
|
|
125
|
+
let request
|
|
126
|
+
try {
|
|
127
|
+
request = JSON.parse(line)
|
|
128
|
+
} catch {
|
|
129
|
+
output({
|
|
130
|
+
jsonrpc: "2.0",
|
|
131
|
+
id: null,
|
|
132
|
+
error: { code: -32700, message: "Invalid JSON" }
|
|
133
|
+
})
|
|
134
|
+
return
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
await establish()
|
|
138
|
+
if (!Object.hasOwn(request, "id")) {
|
|
139
|
+
socket.write(`${line}\n`)
|
|
140
|
+
return
|
|
141
|
+
}
|
|
142
|
+
const response = await exchange(request)
|
|
143
|
+
if (request.method === "initialize" && !response.error) initialization = request
|
|
144
|
+
output(response)
|
|
145
|
+
} catch (error) {
|
|
146
|
+
if (Object.hasOwn(request, "id"))
|
|
147
|
+
output({
|
|
148
|
+
jsonrpc: "2.0",
|
|
149
|
+
id: request.id,
|
|
150
|
+
error: { code: -32000, message: error.message }
|
|
151
|
+
})
|
|
152
|
+
}
|
|
153
|
+
})
|
|
10
154
|
})
|
|
11
|
-
|
|
12
|
-
|
|
155
|
+
function stop() {
|
|
156
|
+
stopped = true
|
|
157
|
+
socket?.destroy()
|
|
158
|
+
input.close()
|
|
13
159
|
process.stdin.destroy()
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})
|
|
18
|
-
process.stdin.on("end", () => socket.destroy())
|
|
19
|
-
process.stdout.on("error", () => socket.destroy())
|
|
160
|
+
}
|
|
161
|
+
input.on("close", stop)
|
|
162
|
+
process.stdout.on("error", stop)
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/native/linux-x64/licenses/{serde_spanned-1.1.2 → serde_spanned-1.1.3}/LICENSE-APACHE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/native/linux-x64/licenses/{specta-macros-2.0.0-rc.27 → specta-macros-2.0.0-rc.28}/LICENSE
RENAMED
|
File without changes
|
/package/native/linux-x64/licenses/{toml-1.2.0+spec-1.1.0 → toml-1.2.1+spec-1.1.0}/LICENSE-APACHE
RENAMED
|
File without changes
|
/package/native/linux-x64/licenses/{toml-1.2.0+spec-1.1.0 → toml-1.2.1+spec-1.1.0}/LICENSE-MIT
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/native/win32-x64/licenses/{specta-macros-2.0.0-rc.27 → specta-macros-2.0.0-rc.28}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|