@stim-cli/server 1.15.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.
@@ -187,6 +187,26 @@ function protocolJsonSchema() {
187
187
  "deviceKey"
188
188
  ],
189
189
  additionalProperties: false,
190
+ oneOf: [
191
+ {
192
+ required: ["backend"],
193
+ properties: {
194
+ backend: { const: "ios-instance" },
195
+ deviceKey: { pattern: "^ios:mobile:[a-fA-F0-9-]{36}$" }
196
+ }
197
+ },
198
+ {
199
+ required: ["backend"],
200
+ properties: {
201
+ backend: { const: "android-instance" },
202
+ deviceKey: { pattern: "^android:mobile:emulator-[0-9]+$" }
203
+ }
204
+ },
205
+ {
206
+ not: { required: ["backend"] },
207
+ properties: { deviceKey: { pattern: "^[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+@[1-9][0-9]{0,9}$" } }
208
+ }
209
+ ],
190
210
  properties: {
191
211
  tenant: {
192
212
  type: "string",
@@ -200,10 +220,8 @@ function protocolJsonSchema() {
200
220
  type: "string",
201
221
  pattern: "^[A-Za-z0-9._-]{1,128}$"
202
222
  },
203
- deviceKey: {
204
- type: "string",
205
- pattern: "^[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+@[1-9][0-9]{0,9}$"
206
- }
223
+ backend: { enum: ["ios-instance", "android-instance"] },
224
+ deviceKey: { type: "string" }
207
225
  }
208
226
  }
209
227
  }
@@ -386,6 +404,19 @@ function protocolJsonSchema() {
386
404
  }
387
405
  }
388
406
  },
407
+ HostedLocalDeviceCount: { anyOf: [{
408
+ type: "integer",
409
+ minimum: 0
410
+ }, {
411
+ type: "object",
412
+ required: ["unknown"],
413
+ additionalProperties: false,
414
+ properties: { unknown: {
415
+ type: "string",
416
+ minLength: 1,
417
+ maxLength: 4e3
418
+ } }
419
+ }] },
389
420
  HostedDeviceOffer: {
390
421
  type: "object",
391
422
  required: [
@@ -439,7 +470,8 @@ function protocolJsonSchema() {
439
470
  workerDiskFreeBytes: {
440
471
  type: ["number", "null"],
441
472
  minimum: 0
442
- }
473
+ },
474
+ localDevices: { $ref: "#/$defs/HostedLocalDeviceCount" }
443
475
  }
444
476
  },
445
477
  capacity: {
@@ -462,7 +494,8 @@ function protocolJsonSchema() {
462
494
  available: {
463
495
  type: ["integer", "null"],
464
496
  minimum: 0
465
- }
497
+ },
498
+ local: { $ref: "#/$defs/HostedLocalDeviceCount" }
466
499
  }
467
500
  }
468
501
  },
@@ -536,6 +569,68 @@ function protocolJsonSchema() {
536
569
  maximum: 65535
537
570
  } }
538
571
  },
572
+ HostedSessionRow: {
573
+ type: "object",
574
+ required: [
575
+ "id",
576
+ "client",
577
+ "platform",
578
+ "device",
579
+ "app",
580
+ "state",
581
+ "parked",
582
+ "since",
583
+ "workspace"
584
+ ],
585
+ additionalProperties: false,
586
+ properties: {
587
+ id: { type: "string" },
588
+ client: {
589
+ type: "object",
590
+ required: ["id", "name"],
591
+ additionalProperties: false,
592
+ properties: {
593
+ id: { type: "string" },
594
+ name: { type: "string" }
595
+ }
596
+ },
597
+ platform: { enum: [
598
+ "ios",
599
+ "android",
600
+ "macos"
601
+ ] },
602
+ device: { type: ["string", "null"] },
603
+ app: { type: ["string", "null"] },
604
+ state: { enum: [
605
+ "preparing",
606
+ "ready",
607
+ "stopping",
608
+ "stopped",
609
+ "unknown"
610
+ ] },
611
+ parked: { type: "boolean" },
612
+ since: { type: "string" },
613
+ workspace: { type: "string" }
614
+ }
615
+ },
616
+ HostedSessionsResult: {
617
+ type: "object",
618
+ required: ["sessions"],
619
+ additionalProperties: false,
620
+ properties: { sessions: {
621
+ type: "array",
622
+ items: { $ref: "#/$defs/HostedSessionRow" }
623
+ } }
624
+ },
625
+ HostedSessionStopResult: {
626
+ type: "object",
627
+ required: ["id", "state"],
628
+ additionalProperties: false,
629
+ properties: {
630
+ id: { type: "string" },
631
+ state: { enum: ["stopping", "stopped"] }
632
+ }
633
+ },
539
634
  HostedDeviceSession: {
540
635
  type: "object",
541
636
  required: [
@@ -657,6 +752,7 @@ function protocolJsonSchema() {
657
752
  createdAt: { type: "string" },
658
753
  notice: { type: "string" },
659
754
  appAttempt: { type: "string" },
755
+ agent: { $ref: "#/$defs/HostedAppDelivery/properties/agent" },
660
756
  metroPort: {
661
757
  type: "integer",
662
758
  minimum: 1,
@@ -720,6 +816,12 @@ function protocolJsonSchema() {
720
816
  deviceName: {
721
817
  type: "string",
722
818
  minLength: 1
819
+ },
820
+ setupTicket: {
821
+ type: "string",
822
+ minLength: 43,
823
+ maxLength: 43,
824
+ pattern: "^[A-Za-z0-9_-]{43}$"
723
825
  }
724
826
  }
725
827
  }
@@ -819,13 +921,19 @@ function protocolJsonSchema() {
819
921
  },
820
922
  LogFilter: {
821
923
  type: "object",
822
- required: ["workspace"],
924
+ oneOf: [{ required: ["workspace"] }, { required: ["archive"] }],
823
925
  additionalProperties: false,
824
926
  properties: {
825
927
  workspace: {
826
928
  type: "string",
827
929
  description: "An environment path from a status payload."
828
930
  },
931
+ archive: {
932
+ type: "string",
933
+ minLength: 1,
934
+ pattern: "^(?!.*\\.\\.)[^/\\\\\\u0000]+$",
935
+ description: "An archived[].id from a status payload; omit workspace."
936
+ },
829
937
  sources: {
830
938
  type: "array",
831
939
  minItems: 1,
@@ -958,13 +1066,27 @@ function protocolJsonSchema() {
958
1066
  },
959
1067
  FrameTarget: {
960
1068
  type: "object",
961
- required: ["workspace", "platform"],
1069
+ required: ["platform"],
1070
+ oneOf: [{
1071
+ required: ["workspace"],
1072
+ not: { required: ["archive"] }
1073
+ }, {
1074
+ required: ["archive", "at"],
1075
+ not: { required: ["workspace"] },
1076
+ properties: { physical: { const: false } }
1077
+ }],
962
1078
  additionalProperties: false,
963
1079
  properties: {
964
1080
  workspace: {
965
1081
  type: "string",
966
1082
  description: "An environment path from a status payload."
967
1083
  },
1084
+ archive: {
1085
+ type: "string",
1086
+ minLength: 1,
1087
+ pattern: "^(?!.*\\.\\.)[^/\\\\\\u0000]+$",
1088
+ description: "An archived[].id from a status payload; omit workspace."
1089
+ },
968
1090
  platform: { enum: [...PLATFORMS] },
969
1091
  slot: {
970
1092
  type: "string",
@@ -1658,6 +1780,11 @@ function protocolJsonSchema() {
1658
1780
  minimum: 1,
1659
1781
  maximum: 65535
1660
1782
  },
1783
+ clientMetroPort: {
1784
+ type: "integer",
1785
+ minimum: 1,
1786
+ maximum: 65535
1787
+ },
1661
1788
  secret: {
1662
1789
  type: "string",
1663
1790
  pattern: "^[a-f0-9]{64}$"
@@ -1678,7 +1805,8 @@ function protocolJsonSchema() {
1678
1805
  video: {
1679
1806
  type: "array",
1680
1807
  items: { type: "string" }
1681
- }
1808
+ },
1809
+ deviceFrame: { type: "boolean" }
1682
1810
  })),
1683
1811
  request("device-host.frames.keyframe", {
1684
1812
  type: "object",
@@ -1816,10 +1944,16 @@ function protocolJsonSchema() {
1816
1944
  }),
1817
1945
  request("replay.range", {
1818
1946
  type: "object",
1819
- required: ["workspace", "platform"],
1947
+ required: ["platform"],
1948
+ oneOf: [{ required: ["workspace"] }, { required: ["archive"] }],
1820
1949
  additionalProperties: false,
1821
1950
  properties: {
1822
1951
  workspace: { type: "string" },
1952
+ archive: {
1953
+ type: "string",
1954
+ minLength: 1,
1955
+ pattern: "^(?!.*\\.\\.)[^/\\\\\\u0000]+$"
1956
+ },
1823
1957
  platform: { enum: [...RELOAD_PLATFORMS] },
1824
1958
  slot: {
1825
1959
  type: "string",
@@ -1827,16 +1961,28 @@ function protocolJsonSchema() {
1827
1961
  }
1828
1962
  }
1829
1963
  }),
1964
+ request("archive.detail", {
1965
+ type: "object",
1966
+ required: ["archive"],
1967
+ additionalProperties: false,
1968
+ properties: { archive: {
1969
+ type: "string",
1970
+ minLength: 1,
1971
+ pattern: "^(?!.*\\.\\.)[^/\\\\\\u0000]+$"
1972
+ } }
1973
+ }),
1830
1974
  request("replay.keyframe", {
1831
1975
  type: "object",
1832
- required: [
1833
- "workspace",
1834
- "platform",
1835
- "at"
1836
- ],
1976
+ required: ["platform", "at"],
1977
+ oneOf: [{ required: ["workspace"] }, { required: ["archive"] }],
1837
1978
  additionalProperties: false,
1838
1979
  properties: {
1839
1980
  workspace: { type: "string" },
1981
+ archive: {
1982
+ type: "string",
1983
+ minLength: 1,
1984
+ pattern: "^(?!.*\\.\\.)[^/\\\\\\u0000]+$"
1985
+ },
1840
1986
  platform: { enum: [...RELOAD_PLATFORMS] },
1841
1987
  slot: {
1842
1988
  type: "string",
@@ -2223,6 +2369,8 @@ function protocolJsonSchema() {
2223
2369
  request("build.artifact", buildJob),
2224
2370
  request("build.attach", buildJob),
2225
2371
  request("server.update.status"),
2372
+ request("device-host.sessions"),
2373
+ request("device-host.sessions.stop", session({})),
2226
2374
  request("machines.update.start", {
2227
2375
  type: "object",
2228
2376
  required: ["machine"],
@@ -2312,6 +2460,8 @@ function protocolJsonSchema() {
2312
2460
  result: { anyOf: [
2313
2461
  { $ref: "#/$defs/HostedDeviceOffer" },
2314
2462
  { $ref: "#/$defs/HostedDeviceSession" },
2463
+ { $ref: "#/$defs/HostedSessionsResult" },
2464
+ { $ref: "#/$defs/HostedSessionStopResult" },
2315
2465
  { $ref: "#/$defs/HostedAppDelivery" },
2316
2466
  { $ref: "#/$defs/HostedMetroResult" },
2317
2467
  { $ref: "#/$defs/HostedAppOfferResult" },
@@ -2500,6 +2650,8 @@ function protocolJsonSchema() {
2500
2650
  additionalProperties: false,
2501
2651
  properties: {
2502
2652
  event: { const: "device-frame" },
2653
+ platform: { enum: [...PLATFORMS] },
2654
+ slot: { type: "string" },
2503
2655
  subscription: { type: "string" },
2504
2656
  artwork: { oneOf: [{ type: "null" }, { $ref: "#/$defs/DeviceFrameArtwork" }] }
2505
2657
  }
@@ -2574,6 +2726,15 @@ function protocolJsonSchema() {
2574
2726
  }
2575
2727
  }
2576
2728
  },
2729
+ {
2730
+ type: "object",
2731
+ required: ["event", "subscription"],
2732
+ additionalProperties: false,
2733
+ properties: {
2734
+ event: { const: "logs-ended" },
2735
+ subscription: { type: "string" }
2736
+ }
2737
+ },
2577
2738
  {
2578
2739
  type: "object",
2579
2740
  required: [
@@ -2653,6 +2814,8 @@ function protocolJsonSchema() {
2653
2814
  additionalProperties: false,
2654
2815
  properties: {
2655
2816
  event: { const: "frame-delayed" },
2817
+ platform: { enum: [...PLATFORMS] },
2818
+ slot: { type: "string" },
2656
2819
  subscription: { type: "string" },
2657
2820
  delayed: { type: "boolean" },
2658
2821
  reason: { type: "string" }
@@ -2683,6 +2846,8 @@ function protocolJsonSchema() {
2683
2846
  additionalProperties: false,
2684
2847
  properties: {
2685
2848
  event: { const: "control-ended" },
2849
+ platform: { enum: [...PLATFORMS] },
2850
+ slot: { type: "string" },
2686
2851
  session: { type: "string" },
2687
2852
  reason: { enum: [...CONTROL_END_REASONS] },
2688
2853
  message: { type: "string" }
@@ -2698,6 +2863,8 @@ function protocolJsonSchema() {
2698
2863
  additionalProperties: false,
2699
2864
  properties: {
2700
2865
  event: { const: "error" },
2866
+ platform: { enum: [...PLATFORMS] },
2867
+ slot: { type: "string" },
2701
2868
  subscription: { type: "string" },
2702
2869
  error: { $ref: "#/$defs/ProtocolError" }
2703
2870
  }
package/dist/protocol.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { t as protocolJsonSchema } from "./protocol-MBMvJpvV.mjs";
1
+ import { t as protocolJsonSchema } from "./protocol-wBQmYsnp.mjs";
2
2
  export * from "@stim-cli/core/protocol";
3
3
  export { protocolJsonSchema };