@ai-development-environment/control-agent 0.0.131 → 0.0.133
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/dist/control-agent.js +61 -10
- package/package.json +1 -1
package/dist/control-agent.js
CHANGED
|
@@ -9673,6 +9673,12 @@ function parseBuildDestination(value) {
|
|
|
9673
9673
|
BUILD_DESTINATION_TYPES,
|
|
9674
9674
|
"build destination.type"
|
|
9675
9675
|
),
|
|
9676
|
+
...destination.deviceType === void 0 ? {} : {
|
|
9677
|
+
deviceType: nullableString4(
|
|
9678
|
+
destination.deviceType,
|
|
9679
|
+
"build destination.deviceType"
|
|
9680
|
+
)
|
|
9681
|
+
},
|
|
9676
9682
|
id: stringValue7(destination.id, "build destination.id"),
|
|
9677
9683
|
name: stringValue7(destination.name, "build destination.name"),
|
|
9678
9684
|
platform: stringValue7(destination.platform, "build destination.platform"),
|
|
@@ -11146,7 +11152,7 @@ function tailscaleServeRemovePayload(value) {
|
|
|
11146
11152
|
// package.json
|
|
11147
11153
|
var package_default = {
|
|
11148
11154
|
name: "@ai-development-environment/control-agent",
|
|
11149
|
-
version: "0.0.
|
|
11155
|
+
version: "0.0.133",
|
|
11150
11156
|
description: "Control agent for the AI Development Environment",
|
|
11151
11157
|
license: "MIT",
|
|
11152
11158
|
repository: {
|
|
@@ -45682,6 +45688,13 @@ function simulatorDestinations(value, includeUnavailable = false) {
|
|
|
45682
45688
|
const devices = value.devices;
|
|
45683
45689
|
if (!devices || typeof devices !== "object" || Array.isArray(devices))
|
|
45684
45690
|
return [];
|
|
45691
|
+
const rawTypes = value.devicetypes;
|
|
45692
|
+
const deviceTypes = /* @__PURE__ */ new Map();
|
|
45693
|
+
if (Array.isArray(rawTypes))
|
|
45694
|
+
for (const raw of rawTypes) {
|
|
45695
|
+
if (raw && typeof raw === "object" && typeof raw.identifier === "string" && typeof raw.name === "string")
|
|
45696
|
+
deviceTypes.set(raw.identifier, raw.name);
|
|
45697
|
+
}
|
|
45685
45698
|
const result = [];
|
|
45686
45699
|
for (const [runtime, entries] of Object.entries(devices)) {
|
|
45687
45700
|
if (!runtime.includes("SimRuntime.iOS-") || !Array.isArray(entries))
|
|
@@ -45694,6 +45707,7 @@ function simulatorDestinations(value, includeUnavailable = false) {
|
|
|
45694
45707
|
if (!available && !includeUnavailable || typeof device.udid !== "string")
|
|
45695
45708
|
continue;
|
|
45696
45709
|
result.push({
|
|
45710
|
+
...typeof device.deviceTypeIdentifier === "string" && deviceTypes.has(device.deviceTypeIdentifier) ? { deviceType: deviceTypes.get(device.deviceTypeIdentifier) } : {},
|
|
45697
45711
|
type: "SIMULATOR",
|
|
45698
45712
|
id: device.udid,
|
|
45699
45713
|
name: typeof device.name === "string" ? device.name : device.udid,
|
|
@@ -45729,19 +45743,50 @@ function physicalDestinations(value, includeUnavailable = false) {
|
|
|
45729
45743
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return [];
|
|
45730
45744
|
const id2 = nestedString(raw, [
|
|
45731
45745
|
["identifier"],
|
|
45746
|
+
["properties", "hardware", "udid"],
|
|
45732
45747
|
["hardwareProperties", "udid"],
|
|
45733
45748
|
["deviceProperties", "identifier"]
|
|
45734
45749
|
]);
|
|
45735
45750
|
const platform2 = nestedString(raw, [
|
|
45751
|
+
["properties", "hardware", "platform"],
|
|
45736
45752
|
["hardwareProperties", "platform"],
|
|
45737
45753
|
["deviceProperties", "osType"]
|
|
45738
45754
|
]);
|
|
45739
|
-
if (!id2 || platform2 && !platform2.
|
|
45740
|
-
|
|
45755
|
+
if (!id2 || platform2 && !["ios", "ipados"].includes(platform2.trim().toLowerCase()))
|
|
45756
|
+
return [];
|
|
45757
|
+
const reality = nestedString(raw, [
|
|
45758
|
+
["properties", "hardware", "reality"],
|
|
45759
|
+
["hardwareProperties", "reality"]
|
|
45760
|
+
])?.trim().toLowerCase();
|
|
45761
|
+
const transport = nestedString(raw, [
|
|
45762
|
+
["properties", "connection", "transportType"],
|
|
45763
|
+
["connectionProperties", "transportType"]
|
|
45764
|
+
])?.trim().toLowerCase();
|
|
45765
|
+
const visibility = nestedString(raw, [
|
|
45766
|
+
["visibilityClass"],
|
|
45767
|
+
["properties", "state", "visibilityClass"]
|
|
45768
|
+
])?.trim().toLowerCase();
|
|
45769
|
+
if (reality === "simulated" || !reality && (visibility === "simulators" || transport === "samemachine"))
|
|
45770
|
+
return [];
|
|
45771
|
+
const connectionState = nestedString(raw, [
|
|
45772
|
+
["properties", "connection", "state"],
|
|
45741
45773
|
["connectionProperties", "tunnelState"],
|
|
45742
45774
|
["deviceProperties", "connectionState"]
|
|
45743
|
-
]);
|
|
45744
|
-
const
|
|
45775
|
+
])?.trim().toLowerCase();
|
|
45776
|
+
const paired = nestedString(raw, [
|
|
45777
|
+
["properties", "connection", "pairingState"],
|
|
45778
|
+
["connectionProperties", "pairingState"]
|
|
45779
|
+
])?.trim().toLowerCase() === "paired";
|
|
45780
|
+
const connected = connectionState === "connected";
|
|
45781
|
+
const available = connected || paired && (transport === "wired" || transport === "localnetwork");
|
|
45782
|
+
const state = connected ? "Connected" : available ? "Available (paired)" : connectionState && [
|
|
45783
|
+
"disconnected",
|
|
45784
|
+
"unavailable",
|
|
45785
|
+
"offline",
|
|
45786
|
+
"notconnected",
|
|
45787
|
+
"not_connected",
|
|
45788
|
+
"not connected"
|
|
45789
|
+
].includes(connectionState) ? "Unavailable" : "Unknown";
|
|
45745
45790
|
if (!available && !includeUnavailable) {
|
|
45746
45791
|
return [];
|
|
45747
45792
|
}
|
|
@@ -45749,9 +45794,15 @@ function physicalDestinations(value, includeUnavailable = false) {
|
|
|
45749
45794
|
{
|
|
45750
45795
|
type: "PHYSICAL_DEVICE",
|
|
45751
45796
|
id: id2,
|
|
45752
|
-
name: nestedString(raw, [
|
|
45797
|
+
name: nestedString(raw, [
|
|
45798
|
+
["properties", "state", "name"],
|
|
45799
|
+
["deviceProperties", "name"],
|
|
45800
|
+
["name"]
|
|
45801
|
+
]) ?? id2,
|
|
45753
45802
|
platform: "iOS",
|
|
45754
45803
|
osVersion: nestedString(raw, [
|
|
45804
|
+
["properties", "software", "osVersionNumber", "stringValue"],
|
|
45805
|
+
["properties", "software", "osVersionNumber"],
|
|
45755
45806
|
["deviceProperties", "osVersionNumber"],
|
|
45756
45807
|
["deviceProperties", "osVersion"]
|
|
45757
45808
|
]),
|
|
@@ -45796,12 +45847,12 @@ var inspectBuildDestinations = async (payload, timeoutMs, signal2) => {
|
|
|
45796
45847
|
const [simulators, physical] = await Promise.all([
|
|
45797
45848
|
command(
|
|
45798
45849
|
"xcrun",
|
|
45799
|
-
["simctl", "list", "
|
|
45850
|
+
["simctl", "list", "-j"],
|
|
45800
45851
|
Math.min(timeoutMs, 3e4),
|
|
45801
45852
|
signal2,
|
|
45802
45853
|
folder
|
|
45803
45854
|
),
|
|
45804
|
-
listPhysicalDevices(timeoutMs, signal2)
|
|
45855
|
+
listPhysicalDevices(timeoutMs, signal2, true)
|
|
45805
45856
|
]);
|
|
45806
45857
|
return {
|
|
45807
45858
|
...successfulProcess3,
|
|
@@ -45818,7 +45869,7 @@ var inspectBuildRunDestinations = async (payload, timeoutMs, signal2) => {
|
|
|
45818
45869
|
if (input.destinationType === "SIMULATOR") {
|
|
45819
45870
|
const simulators = await command(
|
|
45820
45871
|
"xcrun",
|
|
45821
|
-
["simctl", "list", "
|
|
45872
|
+
["simctl", "list", "-j"],
|
|
45822
45873
|
Math.min(timeoutMs, 3e4),
|
|
45823
45874
|
signal2,
|
|
45824
45875
|
folder
|
|
@@ -45839,7 +45890,7 @@ var inspectAgentBuildRunDestinations = async (payload, timeoutMs, signal2) => {
|
|
|
45839
45890
|
if (input.destinationType === "SIMULATOR") {
|
|
45840
45891
|
const simulators = await command(
|
|
45841
45892
|
"xcrun",
|
|
45842
|
-
["simctl", "list", "
|
|
45893
|
+
["simctl", "list", "-j"],
|
|
45843
45894
|
Math.min(timeoutMs, 3e4),
|
|
45844
45895
|
signal2,
|
|
45845
45896
|
process.cwd()
|