Skip to content

Commit 8b3e77c

Browse files
committed
fix(appintents): add stable IDs (static var id) for custom actions to resolve Shortcuts ActionNotFound
1 parent 3de3c4a commit 8b3e77c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Intents/UTMActionIntent.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import AppIntents
1818

1919
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
2020
struct UTMStatusActionIntent: UTMIntent {
21+
static var id: String = "UTMStatusActionIntent"
2122
static let title: LocalizedStringResource = "Get Virtual Machine Status"
2223
static let description = IntentDescription("Get the status of a virtual machine.")
2324
static var parameterSummary: some ParameterSummary {
@@ -38,6 +39,7 @@ struct UTMStatusActionIntent: UTMIntent {
3839

3940
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
4041
struct UTMStartActionIntent: UTMIntent {
42+
static var id: String = "UTMStartActionIntent"
4143
static let title: LocalizedStringResource = "Start Virtual Machine"
4244
static let description = IntentDescription("Start a virtual machine.")
4345
static var parameterSummary: some ParameterSummary {
@@ -90,6 +92,7 @@ struct UTMStartActionIntent: UTMIntent {
9092

9193
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
9294
struct UTMStopActionIntent: UTMIntent {
95+
static var id: String = "UTMStopActionIntent"
9396
static let title: LocalizedStringResource = "Stop Virtual Machine"
9497
static let description = IntentDescription("Stop a virtual machine.")
9598
static var parameterSummary: some ParameterSummary {
@@ -128,6 +131,7 @@ extension UTMVirtualMachineStopMethod: AppEnum {
128131

129132
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
130133
struct UTMPauseActionIntent: UTMIntent {
134+
static var id: String = "UTMPauseActionIntent"
131135
static let title: LocalizedStringResource = "Pause Virtual Machine"
132136
static let description = IntentDescription("Pause a virtual machine.")
133137
static var parameterSummary: some ParameterSummary {
@@ -157,6 +161,7 @@ struct UTMPauseActionIntent: UTMIntent {
157161

158162
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
159163
struct UTMResumeActionIntent: UTMIntent {
164+
static var id: String = "UTMResumeActionIntent"
160165
static let title: LocalizedStringResource = "Resume Virtual Machine"
161166
static let description = IntentDescription("Resume a virtual machine.")
162167
static var parameterSummary: some ParameterSummary {
@@ -183,6 +188,7 @@ struct UTMResumeActionIntent: UTMIntent {
183188

184189
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
185190
struct UTMRestartActionIntent: UTMIntent {
191+
static var id: String = "UTMRestartActionIntent"
186192
static let title: LocalizedStringResource = "Restart Virtual Machine"
187193
static let description = IntentDescription("Restart a virtual machine.")
188194
static var parameterSummary: some ParameterSummary {

Intents/UTMInputIntent.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ private let kDelayNs: UInt64 = 20000000
2020

2121
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
2222
struct UTMSendScanCodeIntent: UTMIntent {
23+
static var id: String = "UTMSendScanCodeIntent"
2324
static let title: LocalizedStringResource = "Send Scan Code"
2425
static let description = IntentDescription("Send a sequence of raw keyboard scan codes to the virtual machine. Only supported on QEMU backend.")
2526
static var parameterSummary: some ParameterSummary {
@@ -63,6 +64,7 @@ struct UTMSendScanCodeIntent: UTMIntent {
6364

6465
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
6566
struct UTMSendKeystrokesIntent: UTMIntent {
67+
static var id: String = "UTMSendKeystrokesIntent"
6668
static let title: LocalizedStringResource = "Send Keystrokes"
6769
static let description = IntentDescription("Send text as a sequence of keystrokes to the virtual machine. Only supported on QEMU backend.")
6870
static var parameterSummary: some ParameterSummary {
@@ -154,6 +156,7 @@ struct UTMSendKeystrokesIntent: UTMIntent {
154156

155157
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
156158
struct UTMMouseClickIntent: UTMIntent {
159+
static var id: String = "UTMMouseClickIntent"
157160
static let title: LocalizedStringResource = "Send Mouse Click"
158161
static let description = IntentDescription("Send a mouse position and click to the virtual machine. Only supported on QEMU backend.")
159162
static var parameterSummary: some ParameterSummary {

0 commit comments

Comments
 (0)