@alwith/module-computer 0.1.1 → 0.1.3
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/package.json +1 -1
- package/proxy/stdio.mjs +18 -9
- package/rust/Cargo.lock +5 -5
- package/rust/Cargo.toml +3 -3
package/package.json
CHANGED
package/proxy/stdio.mjs
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
// A byte-only stdio carrier. Authentication and all scheduling live in the native host.
|
|
2
|
-
import { connect } from
|
|
3
|
-
const [address, token] = process.argv.slice(2)
|
|
4
|
-
if (!address || !token || !/^127\.0\.0\.1:\d+$/.test(address)) throw new Error(
|
|
5
|
-
const socket = connect({host:
|
|
6
|
-
socket.on(
|
|
7
|
-
socket.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { connect } from "node:net"
|
|
3
|
+
const [address, token] = process.argv.slice(2)
|
|
4
|
+
if (!address || !token || !/^127\.0\.0\.1:\d+$/.test(address)) throw new Error("Invalid computer gateway address")
|
|
5
|
+
const socket = connect({ host: "127.0.0.1", port: Number(address.split(":")[1]) })
|
|
6
|
+
socket.on("connect", () => {
|
|
7
|
+
socket.write(`${token}\n`)
|
|
8
|
+
process.stdin.pipe(socket)
|
|
9
|
+
socket.pipe(process.stdout)
|
|
10
|
+
})
|
|
11
|
+
socket.on("error", () => {
|
|
12
|
+
process.exitCode = 1
|
|
13
|
+
process.stdin.destroy()
|
|
14
|
+
})
|
|
15
|
+
socket.on("close", () => {
|
|
16
|
+
process.stdin.destroy()
|
|
17
|
+
})
|
|
18
|
+
process.stdin.on("end", () => socket.destroy())
|
|
19
|
+
process.stdout.on("error", () => socket.destroy())
|
package/rust/Cargo.lock
CHANGED
|
@@ -25,7 +25,7 @@ dependencies = [
|
|
|
25
25
|
|
|
26
26
|
[[package]]
|
|
27
27
|
name = "alwith-computer"
|
|
28
|
-
version = "0.1.
|
|
28
|
+
version = "0.1.3"
|
|
29
29
|
dependencies = [
|
|
30
30
|
"base64",
|
|
31
31
|
"core-foundation",
|
|
@@ -1746,9 +1746,9 @@ dependencies = [
|
|
|
1746
1746
|
|
|
1747
1747
|
[[package]]
|
|
1748
1748
|
name = "specta"
|
|
1749
|
-
version = "2.0.0-rc.
|
|
1749
|
+
version = "2.0.0-rc.27"
|
|
1750
1750
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1751
|
-
checksum = "
|
|
1751
|
+
checksum = "81633014710ece1c7e8ac99e1bc9ad8d4339a2ccbae89ca2aa1095d4262c86b8"
|
|
1752
1752
|
dependencies = [
|
|
1753
1753
|
"rustc_version",
|
|
1754
1754
|
"specta-macros",
|
|
@@ -1756,9 +1756,9 @@ dependencies = [
|
|
|
1756
1756
|
|
|
1757
1757
|
[[package]]
|
|
1758
1758
|
name = "specta-macros"
|
|
1759
|
-
version = "2.0.0-rc.
|
|
1759
|
+
version = "2.0.0-rc.27"
|
|
1760
1760
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1761
|
-
checksum = "
|
|
1761
|
+
checksum = "1fe882a75f48f76ac091ca2c5aaad7abd4dfdedf649c08e865bb0d62b5a2cb92"
|
|
1762
1762
|
dependencies = [
|
|
1763
1763
|
"Inflector",
|
|
1764
1764
|
"proc-macro2",
|
package/rust/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "alwith-computer"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.3"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
publish = false
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ publish = false
|
|
|
9
9
|
[dependencies]
|
|
10
10
|
serde = { version = "1", features = ["derive"] }
|
|
11
11
|
serde_json = "1"
|
|
12
|
-
specta = { version = "
|
|
12
|
+
specta = { version = "2.0.0-rc.27", features = ["derive"] }
|
|
13
13
|
tempfile = "3"
|
|
14
14
|
tokio = { version = "1", features = ["net", "io-util", "time", "sync", "rt", "macros", "process"] }
|
|
15
15
|
uuid = { version = "1", features = ["v4"] }
|
|
@@ -18,6 +18,6 @@ uuid = { version = "1", features = ["v4"] }
|
|
|
18
18
|
core-foundation = "0.10"
|
|
19
19
|
|
|
20
20
|
[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies]
|
|
21
|
-
xcap = "
|
|
21
|
+
xcap = "0.9.8"
|
|
22
22
|
image = { version = "0.25", default-features = false, features = ["jpeg"] }
|
|
23
23
|
base64 = "0.23"
|