@stim-cli/server 1.16.0 → 1.17.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.
@@ -162,11 +162,27 @@
162
162
  "backend"
163
163
  ],
164
164
  "properties": {
165
+ "backend": {
166
+ "const": "ios-instance"
167
+ },
165
168
  "deviceKey": {
166
169
  "pattern": "^ios:mobile:[a-fA-F0-9-]{36}$"
167
170
  }
168
171
  }
169
172
  },
173
+ {
174
+ "required": [
175
+ "backend"
176
+ ],
177
+ "properties": {
178
+ "backend": {
179
+ "const": "android-instance"
180
+ },
181
+ "deviceKey": {
182
+ "pattern": "^android:mobile:emulator-[0-9]+$"
183
+ }
184
+ }
185
+ },
170
186
  {
171
187
  "not": {
172
188
  "required": [
@@ -194,7 +210,10 @@
194
210
  "pattern": "^[A-Za-z0-9._-]{1,128}$"
195
211
  },
196
212
  "backend": {
197
- "const": "ios-instance"
213
+ "enum": [
214
+ "ios-instance",
215
+ "android-instance"
216
+ ]
198
217
  },
199
218
  "deviceKey": {
200
219
  "type": "string"
@@ -490,6 +509,28 @@
490
509
  }
491
510
  }
492
511
  },
512
+ "HostedLocalDeviceCount": {
513
+ "anyOf": [
514
+ {
515
+ "type": "integer",
516
+ "minimum": 0
517
+ },
518
+ {
519
+ "type": "object",
520
+ "required": [
521
+ "unknown"
522
+ ],
523
+ "additionalProperties": false,
524
+ "properties": {
525
+ "unknown": {
526
+ "type": "string",
527
+ "minLength": 1,
528
+ "maxLength": 4000
529
+ }
530
+ }
531
+ }
532
+ ]
533
+ },
493
534
  "HostedDeviceOffer": {
494
535
  "type": "object",
495
536
  "required": [
@@ -553,6 +594,9 @@
553
594
  "null"
554
595
  ],
555
596
  "minimum": 0
597
+ },
598
+ "localDevices": {
599
+ "$ref": "#/$defs/HostedLocalDeviceCount"
556
600
  }
557
601
  }
558
602
  },
@@ -579,6 +623,9 @@
579
623
  "null"
580
624
  ],
581
625
  "minimum": 0
626
+ },
627
+ "local": {
628
+ "$ref": "#/$defs/HostedLocalDeviceCount"
582
629
  }
583
630
  }
584
631
  }
@@ -729,6 +776,113 @@
729
776
  }
730
777
  }
731
778
  },
779
+ "HostedSessionRow": {
780
+ "type": "object",
781
+ "required": [
782
+ "id",
783
+ "client",
784
+ "platform",
785
+ "device",
786
+ "app",
787
+ "state",
788
+ "parked",
789
+ "since",
790
+ "workspace"
791
+ ],
792
+ "additionalProperties": false,
793
+ "properties": {
794
+ "id": {
795
+ "type": "string"
796
+ },
797
+ "client": {
798
+ "type": "object",
799
+ "required": [
800
+ "id",
801
+ "name"
802
+ ],
803
+ "additionalProperties": false,
804
+ "properties": {
805
+ "id": {
806
+ "type": "string"
807
+ },
808
+ "name": {
809
+ "type": "string"
810
+ }
811
+ }
812
+ },
813
+ "platform": {
814
+ "enum": [
815
+ "ios",
816
+ "android",
817
+ "macos"
818
+ ]
819
+ },
820
+ "device": {
821
+ "type": [
822
+ "string",
823
+ "null"
824
+ ]
825
+ },
826
+ "app": {
827
+ "type": [
828
+ "string",
829
+ "null"
830
+ ]
831
+ },
832
+ "state": {
833
+ "enum": [
834
+ "preparing",
835
+ "ready",
836
+ "stopping",
837
+ "stopped",
838
+ "unknown"
839
+ ]
840
+ },
841
+ "parked": {
842
+ "type": "boolean"
843
+ },
844
+ "since": {
845
+ "type": "string"
846
+ },
847
+ "workspace": {
848
+ "type": "string"
849
+ }
850
+ }
851
+ },
852
+ "HostedSessionsResult": {
853
+ "type": "object",
854
+ "required": [
855
+ "sessions"
856
+ ],
857
+ "additionalProperties": false,
858
+ "properties": {
859
+ "sessions": {
860
+ "type": "array",
861
+ "items": {
862
+ "$ref": "#/$defs/HostedSessionRow"
863
+ }
864
+ }
865
+ }
866
+ },
867
+ "HostedSessionStopResult": {
868
+ "type": "object",
869
+ "required": [
870
+ "id",
871
+ "state"
872
+ ],
873
+ "additionalProperties": false,
874
+ "properties": {
875
+ "id": {
876
+ "type": "string"
877
+ },
878
+ "state": {
879
+ "enum": [
880
+ "stopping",
881
+ "stopped"
882
+ ]
883
+ }
884
+ }
885
+ },
732
886
  "HostedDeviceSession": {
733
887
  "type": "object",
734
888
  "required": [
@@ -917,6 +1071,9 @@
917
1071
  "appAttempt": {
918
1072
  "type": "string"
919
1073
  },
1074
+ "agent": {
1075
+ "$ref": "#/$defs/HostedAppDelivery/properties/agent"
1076
+ },
920
1077
  "metroPort": {
921
1078
  "type": "integer",
922
1079
  "minimum": 1,
@@ -1144,11 +1301,14 @@
1144
1301
  "device-frames",
1145
1302
  "macos-hosted",
1146
1303
  "ios-hosted",
1304
+ "android-hosted",
1147
1305
  "hosted-ios-agent",
1306
+ "hosted-android-agent",
1148
1307
  "duo-frames",
1149
1308
  "workspace-diff",
1150
1309
  "hosted-congestion",
1151
1310
  "hosted-ios-data",
1311
+ "hosted-android-data",
1152
1312
  "server-update"
1153
1313
  ]
1154
1314
  }
@@ -2905,6 +3065,11 @@
2905
3065
  "minimum": 1,
2906
3066
  "maximum": 65535
2907
3067
  },
3068
+ "clientMetroPort": {
3069
+ "type": "integer",
3070
+ "minimum": 1,
3071
+ "maximum": 65535
3072
+ },
2908
3073
  "secret": {
2909
3074
  "type": "string",
2910
3075
  "pattern": "^[a-f0-9]{64}$"
@@ -3881,6 +4046,40 @@
3881
4046
  }
3882
4047
  }
3883
4048
  },
4049
+ {
4050
+ "type": "object",
4051
+ "required": [
4052
+ "id",
4053
+ "method",
4054
+ "params"
4055
+ ],
4056
+ "additionalProperties": false,
4057
+ "properties": {
4058
+ "id": {
4059
+ "type": [
4060
+ "integer",
4061
+ "string"
4062
+ ]
4063
+ },
4064
+ "method": {
4065
+ "const": "archive.detail"
4066
+ },
4067
+ "params": {
4068
+ "type": "object",
4069
+ "required": [
4070
+ "archive"
4071
+ ],
4072
+ "additionalProperties": false,
4073
+ "properties": {
4074
+ "archive": {
4075
+ "type": "string",
4076
+ "minLength": 1,
4077
+ "pattern": "^(?!.*\\.\\.)[^/\\\\\\u0000]+$"
4078
+ }
4079
+ }
4080
+ }
4081
+ }
4082
+ },
3884
4083
  {
3885
4084
  "type": "object",
3886
4085
  "required": [
@@ -5419,6 +5618,61 @@
5419
5618
  }
5420
5619
  }
5421
5620
  },
5621
+ {
5622
+ "type": "object",
5623
+ "required": [
5624
+ "id",
5625
+ "method"
5626
+ ],
5627
+ "additionalProperties": false,
5628
+ "properties": {
5629
+ "id": {
5630
+ "type": [
5631
+ "integer",
5632
+ "string"
5633
+ ]
5634
+ },
5635
+ "method": {
5636
+ "const": "device-host.sessions"
5637
+ },
5638
+ "params": {
5639
+ "type": "object",
5640
+ "maxProperties": 0
5641
+ }
5642
+ }
5643
+ },
5644
+ {
5645
+ "type": "object",
5646
+ "required": [
5647
+ "id",
5648
+ "method",
5649
+ "params"
5650
+ ],
5651
+ "additionalProperties": false,
5652
+ "properties": {
5653
+ "id": {
5654
+ "type": [
5655
+ "integer",
5656
+ "string"
5657
+ ]
5658
+ },
5659
+ "method": {
5660
+ "const": "device-host.sessions.stop"
5661
+ },
5662
+ "params": {
5663
+ "type": "object",
5664
+ "required": [
5665
+ "session"
5666
+ ],
5667
+ "additionalProperties": false,
5668
+ "properties": {
5669
+ "session": {
5670
+ "type": "string"
5671
+ }
5672
+ }
5673
+ }
5674
+ }
5675
+ },
5422
5676
  {
5423
5677
  "type": "object",
5424
5678
  "required": [
@@ -5632,6 +5886,12 @@
5632
5886
  {
5633
5887
  "$ref": "#/$defs/HostedDeviceSession"
5634
5888
  },
5889
+ {
5890
+ "$ref": "#/$defs/HostedSessionsResult"
5891
+ },
5892
+ {
5893
+ "$ref": "#/$defs/HostedSessionStopResult"
5894
+ },
5635
5895
  {
5636
5896
  "$ref": "#/$defs/HostedAppDelivery"
5637
5897
  },
@@ -0,0 +1,34 @@
1
+ import Foundation
2
+
3
+ /// Finds DeviceKit's iPhone Duo model (V68.usdz). Xcode 27.0 does not ship it; Xcode 27.1 does.
4
+ public enum DuoModelAsset {
5
+ static let relativePath =
6
+ "SharedFrameworks/DeviceKit.framework/Versions/A/PlugIns/CoreDevicePopDeviceKitExtension.devicekitplugin/Contents/Resources/V68.usdz"
7
+
8
+ static func locate(selected: String, installed: [String], exists: (String) -> Bool) -> String? {
9
+ for developerDir in [selected] + installed.filter({ $0 != selected }) {
10
+ let path = URL(fileURLWithPath: developerDir).deletingLastPathComponent().appendingPathComponent(relativePath).path
11
+ if exists(path) { return path }
12
+ }
13
+ return nil
14
+ }
15
+
16
+ static func reason(selected: String) -> String {
17
+ "The iPhone Duo hardware model is not in the selected Xcode (\(URL(fileURLWithPath: selected).deletingLastPathComponent().deletingLastPathComponent().lastPathComponent)) or any other Xcode in /Applications. Xcode 27.1 or later includes it."
18
+ }
19
+
20
+ static var installedDeveloperDirs: [String] {
21
+ let names = (try? FileManager.default.contentsOfDirectory(atPath: "/Applications")) ?? []
22
+ return names.filter { $0.hasPrefix("Xcode") && $0.hasSuffix(".app") }.sorted(by: >)
23
+ .map { "/Applications/\($0)/Contents/Developer" }
24
+ }
25
+
26
+ static var current: URL? {
27
+ locate(selected: CoreSimulator.developerDir, installed: installedDeveloperDirs, exists: FileManager.default.fileExists)
28
+ .map { URL(fileURLWithPath: $0) }
29
+ }
30
+
31
+ public static var unavailableReason: String? {
32
+ current == nil ? reason(selected: CoreSimulator.developerDir) : nil
33
+ }
34
+ }
@@ -24,16 +24,8 @@ final class DuoModelView: SCNView {
24
24
  private var quarterTurns = 0
25
25
  var activeID: UInt32
26
26
 
27
- static var assetURL: URL {
28
- URL(fileURLWithPath: CoreSimulator.developerDir)
29
- .deletingLastPathComponent()
30
- .appendingPathComponent(
31
- "SharedFrameworks/DeviceKit.framework/Versions/A/PlugIns/CoreDevicePopDeviceKitExtension.devicekitplugin/Contents/Resources/V68.usdz"
32
- )
33
- }
34
-
35
27
  static func load(innerID: UInt32, coverID: UInt32, nativeTurns: [UInt32: Int], assetURL: URL? = nil) -> DuoModelView? {
36
- guard let source = SCNSceneSource(url: assetURL ?? Self.assetURL, options: nil),
28
+ guard let url = assetURL ?? DuoModelAsset.current, let source = SCNSceneSource(url: url, options: nil),
37
29
  let scene = source.scene(options: [.animationImportPolicy: SCNSceneSource.AnimationImportPolicy.play]),
38
30
  let inner = scene.rootNode.childNode(withName: "mQHVkATpIwJRVQx", recursively: true),
39
31
  let cover = scene.rootNode.childNode(withName: "zaWsadDZpWAUDAX", recursively: true),