// The acts Siri, Shortcuts, the Action Button, Control Centre and the Live// Activity can ask of Cotton Meetings. Each runs in the app's process and// hands its act to the recorder (`MeetingsIntentBridge`).//// The titles and phrases are App Intents metadata, read by the system at// build time, so they must be literals: each is a KEY here, and its words are// the kit's `meetings` lines `intent.*`, written into `Meetings.strings` and// `AppShortcuts.strings` (`App/MeetingsWidgets/Strings`, held equal to the// kit by `meetings-intents.test.ts`).importAppIntentsimportFoundation/// Start recording a meeting, without opening the app.publicstructStartMeetingRecording: AudioRecordingIntent {publicstaticlet title: LocalizedStringResource = LocalizedStringResource("intent.start_meeting", table: "Meetings")publicstaticlet openAppWhenRun = falsepublicinit() {} @MainActorpublicfunc perform() asyncthrows -> someIntentResult {tryawaitMeetingsIntentBridge.run(.startMeeting)return .result() }}/// Start recording a memo, without opening the app.structStartMemoRecording: AudioRecordingIntent {staticlet title: LocalizedStringResource = LocalizedStringResource("intent.start_memo", table: "Meetings")staticlet openAppWhenRun = falseinit() {} @MainActorfunc perform() asyncthrows -> someIntentResult {tryawaitMeetingsIntentBridge.run(.startMemo)return .result() }}publicstructPauseMeetingRecording: LiveActivityIntent {publicstaticlet title: LocalizedStringResource = LocalizedStringResource("intent.pause", table: "Meetings")publicinit() {} @MainActorpublicfunc perform() asyncthrows -> someIntentResult {tryawaitMeetingsIntentBridge.run(.pause)return .result() }}publicstructResumeMeetingRecording: LiveActivityIntent {publicstaticlet title: LocalizedStringResource = LocalizedStringResource("intent.resume", table: "Meetings")publicinit() {} @MainActorpublicfunc perform() asyncthrows -> someIntentResult {tryawaitMeetingsIntentBridge.run(.resume)return .result() }}publicstructMarkMeetingMoment: LiveActivityIntent {publicstaticlet title: LocalizedStringResource = LocalizedStringResource("intent.mark", table: "Meetings")publicinit() {} @MainActorpublicfunc perform() asyncthrows -> someIntentResult {tryawaitMeetingsIntentBridge.run(.mark)return .result() }}publicstructStopMeetingRecording: LiveActivityIntent {publicstaticlet title: LocalizedStringResource = LocalizedStringResource("intent.stop", table: "Meetings")publicinit() {} @MainActorpublicfunc perform() asyncthrows -> someIntentResult {tryawaitMeetingsIntentBridge.run(.stop)return .result() }}/// What Siri and the Shortcuts app offer without setup, and what the Action/// Button lists.structMeetingsShortcuts: AppShortcutsProvider {staticvar appShortcuts: [AppShortcut] {AppShortcut( intent: StartMeetingRecording(), phrases: ["intent.phrase_record \(.applicationName)", "intent.phrase_start \(.applicationName)"], shortTitle: LocalizedStringResource("intent.start_meeting", table: "Meetings"), systemImageName: "record.circle")AppShortcut( intent: StartMemoRecording(), phrases: ["intent.phrase_memo \(.applicationName)"], shortTitle: LocalizedStringResource("intent.start_memo", table: "Meetings"), systemImageName: "waveform")AppShortcut( intent: StopMeetingRecording(), phrases: ["intent.phrase_stop \(.applicationName)"], shortTitle: LocalizedStringResource("intent.stop", table: "Meetings"), systemImageName: "stop.circle") }}/// Lets the app's own target discover the intents declared in this package.publicstructMeetingsLivePackage: AppIntentsPackage {}