@stim-cli/server 1.20.2 → 1.21.0
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 +632 -265
- package/dist/{protocol-CjUChTWJ.mjs → protocol-D21Ab4EI.mjs} +391 -56
- package/dist/protocol.mjs +1 -1
- package/dist/protocol.schema.json +1103 -123
- package/dist/stim-frames/ProcessStream.swift +2 -1
- package/dist/stim-frames/SimulatorPosture.swift +0 -6
- package/dist/{stim-server-FWcuNpW7.mjs → stim-server-BQKNg9Jp.mjs} +3592 -2839
- package/dist/stim-server.mjs +1 -1
- package/dist/stim-service-runner.d.mts +13 -0
- package/dist/stim-service-runner.mjs +96 -0
- package/package.json +8 -3
- package/dist/stats-read.d.mts +0 -1
- package/dist/stats-read.mjs +0 -46
|
@@ -64,6 +64,7 @@ public enum ProcessStream {
|
|
|
64
64
|
arguments: [String],
|
|
65
65
|
cwd: String,
|
|
66
66
|
environment: [String: String]? = nil,
|
|
67
|
+
standardInput: FileHandle? = nil,
|
|
67
68
|
onLine: @escaping @Sendable (OutputLine) -> Void,
|
|
68
69
|
onExit: @escaping @Sendable (Int32) -> Void
|
|
69
70
|
) throws -> Process {
|
|
@@ -72,7 +73,7 @@ public enum ProcessStream {
|
|
|
72
73
|
process.arguments = arguments
|
|
73
74
|
process.currentDirectoryURL = URL(fileURLWithPath: cwd)
|
|
74
75
|
if let environment { process.environment = environment }
|
|
75
|
-
process.standardInput = FileHandle.nullDevice
|
|
76
|
+
process.standardInput = standardInput ?? FileHandle.nullDevice
|
|
76
77
|
let out = Pipe()
|
|
77
78
|
let err = Pipe()
|
|
78
79
|
process.standardOutput = out
|
|
@@ -190,12 +190,6 @@ public enum SimulatorPosture {
|
|
|
190
190
|
/// call it off the main thread.
|
|
191
191
|
public static func isAvailable(udid: String) -> Bool { connection(udid: udid) != nil }
|
|
192
192
|
|
|
193
|
-
/// The posture Stim Desktop last moved this simulator to, if any.
|
|
194
|
-
public static func lastPosture(udid: String) -> DuoPosture? {
|
|
195
|
-
guard let angle = lastAngle(udid: udid) else { return nil }
|
|
196
|
-
return DuoPosture.allCases.first { $0.hingeAngle == angle }
|
|
197
|
-
}
|
|
198
|
-
|
|
199
193
|
/// The hinge angle Stim Desktop last moved this simulator to, in degrees.
|
|
200
194
|
public static func lastAngle(udid: String) -> Double? {
|
|
201
195
|
lock.lock()
|