Shortcuts, Siri and Spotlight actions, and a Focus filter - #12
Merged
Merged
Conversation
- Nine App Intents: Play Mix, Play Sound, Resume Sounds, Pause Sounds, Set Brisa Volume, Stop Sounds After, Start Focus Session, Pause Focus Session, and a Focus filter. Mixes and sounds are entities, so they can be picked from a list or said by name. - Suggested phrases such as "Play <mix> in Brisa" and "Pause Brisa"; the mix names are refreshed whenever mixes change. - The Focus filter plays a mix and/or starts a focus session when a Focus turns on, and when it ends stops only what it started. - build.sh emits compile-time constant values and runs Apple's appintentsmetadataprocessor, so the swiftc build ships the same Metadata.appintents that Xcode produces. - Settings -> General explains it and opens Focus settings.
Shortcuts and Focus filters reject apps without a team ID (linkd: requiresValidatedBundle), so an ad-hoc signature is only a fallback.
Without a team ID macOS refuses the connection, so ad-hoc builds skip the App Intents metadata and Settings hides the Shortcuts and Focus row.
# Conflicts: # Brisa/Brisa.xcodeproj/project.pbxproj # Brisa/Scripts/build.sh # Brisa/Sources/AppModel.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Actions (Shortcuts app, Siri, Spotlight)
Suggested phrases work without setup: "Play Rainy study in Brisa", "Pause Brisa", "Resume Brisa", "Start a focus session in Brisa". Mix names are refreshed whenever mixes change.
Focus filter
System Settings → Focus → a Focus → Focus filters → Brisa: choose a mix to play and/or whether to start a focus session. When the Focus turns on, Brisa does it; when the Focus ends, Brisa stops only what the Focus started.
Build
Xcode normally generates
Metadata.appintents, which the system reads to discover actions.build.shnow emits compile-time constant values (-emit-const-values-path) and runsappintentsmetadataprocessoritself. Its output matches Xcode's for all 9 actions, the 2 entities and the 4 suggested phrases; the only differences are the order of a few fields.Settings → General gets a "Shortcuts and Focus" row explaining this, with a button that opens Focus settings.
Signing requirement
macOS only connects Shortcuts and Focus filters to apps signed by a developer team (
linkdlogsUnable to get teamIdand rejects ad-hoc apps withrequiresValidatedBundle). So:build.shsigns withBRISA_SIGN_IDENTITY, or the first Developer ID / Apple Development certificate in the keychain; otherwise it falls back to ad-hoc and skips the App Intents metadata, so Brisa doesn't show up in Shortcuts or Focus with actions that can't run.How it was tested
./Scripts/build.shandxcodebuildsucceed, and both produce the metadata with all actions../Scripts/test.sh: 28 passed.Metadata.appintents, and the availability check returns false for an ad-hoc binary.