expo-app-intents 0.4.3 → 0.4.4

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/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.4.4 — 2026-09-23
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Annotate the mail example templates with macOS availability so `npx expo-app-intents init` output works on macOS. ([#50525](https://github.com/expo/expo/pull/50525) by [@gabrieldonadel](https://github.com/gabrieldonadel))
18
+
13
19
  ## 0.4.3 — 2026-09-22
14
20
 
15
21
  _This version does not introduce any user-facing changes._
package/cli/build/init.js CHANGED
@@ -145,7 +145,7 @@ const VISUAL_INTELLIGENCE_DESCRIPTION = 'Allows Siri to more intelligently read
145
145
  *
146
146
  * Indented for the body of `OnCreate`, because it is both rendered into a new setup module and
147
147
  * offered to the user for pasting into one this run kept.
148
- */ const VISUAL_INTELLIGENCE_REGISTRATION = ` if #available(iOS 18.0, *) {
148
+ */ const VISUAL_INTELLIGENCE_REGISTRATION = ` if #available(iOS 18.0, macOS 15.0, *) {
149
149
  AppEntityIdentifierRegistry.shared.registerIndexed("mailDraft", as: MailDraftEntity.self)
150
150
  }`;
151
151
  /** Finds the registration in an `AppIntentsSetup.swift` on disk, however it is formatted around. */ const VISUAL_INTELLIGENCE_REGISTRATION_PATTERN = /registerIndexed\s*\(\s*["']mailDraft["']/;
package/cli/src/init.ts CHANGED
@@ -76,7 +76,7 @@ const VISUAL_INTELLIGENCE_TEMPLATE_FILES = [
76
76
  * Indented for the body of `OnCreate`, because it is both rendered into a new setup module and
77
77
  * offered to the user for pasting into one this run kept.
78
78
  */
79
- const VISUAL_INTELLIGENCE_REGISTRATION = ` if #available(iOS 18.0, *) {
79
+ const VISUAL_INTELLIGENCE_REGISTRATION = ` if #available(iOS 18.0, macOS 15.0, *) {
80
80
  AppEntityIdentifierRegistry.shared.registerIndexed("mailDraft", as: MailDraftEntity.self)
81
81
  }`;
82
82
 
@@ -12,10 +12,7 @@ Pod::Spec.new do |s|
12
12
  s.homepage = package['homepage']
13
13
  s.platforms = {
14
14
  :ios => '16.4',
15
- # This module depends on ExpoUI, which is iOS/tvOS only. CocoaPods' resolver walks
16
- # `all_dependencies` and ignores the `.ios`/`.tvos` scoping below, so linking fails on macOS
17
- # Restore :osx once ExpoUI supports macOS
18
- # :osx => '13.4',
15
+ :osx => '13.4',
19
16
  :tvos => '16.4'
20
17
  }
21
18
  s.swift_version = '6.0'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-app-intents",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Expose Apple App Intents (Siri, Shortcuts, Spotlight, Apple Intelligence) from Expo apps",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -33,11 +33,11 @@
33
33
  "@types/node": "^22.14.0",
34
34
  "@types/prompts": "^2.4.9",
35
35
  "@types/react": "~19.3.0",
36
- "expo": "58.0.0-preview.5",
36
+ "expo": "58.0.0-preview.6",
37
37
  "expo-module-scripts": "56.0.3"
38
38
  },
39
39
  "dependencies": {
40
- "@expo/ui": "^58.0.5",
40
+ "@expo/ui": "^58.0.6",
41
41
  "commander": "^12.1.0",
42
42
  "prompts": "^2.4.2"
43
43
  },
@@ -46,7 +46,7 @@
46
46
  "react": "*",
47
47
  "react-native": "*"
48
48
  },
49
- "gitHead": "add8cbf49f477cfd2283ae05af35b4713a773c55",
49
+ "gitHead": "8aeb4368d396d2d71a2fc8c652c4d1d4d53ed858",
50
50
  "scripts": {
51
51
  "build": "pnpm run build:lib && pnpm run build:plugin && pnpm run build:cli",
52
52
  "build:lib": "expo-build src",
@@ -4,7 +4,7 @@ import Foundation
4
4
 
5
5
  /// On devices running the new AI Siri, the `CreateDraftIntent` should be automatically
6
6
  /// picked up by the system without the need of registering it in AppShortcutProvider phrases.
7
- @available(iOS 18.0, *)
7
+ @available(iOS 18.0, macOS 15.0, *)
8
8
  @AppIntent(schema: .mail.createDraft)
9
9
  struct CreateDraftIntent {
10
10
  static let openAppWhenRun: Bool = true
@@ -9,7 +9,7 @@ import Foundation
9
9
  ///
10
10
  /// The schema requires an authentication policy at least as restrictive as
11
11
  /// `.requiresLocalDeviceAuthentication`, because deleting content is destructive.
12
- @available(iOS 18.0, *)
12
+ @available(iOS 18.0, macOS 15.0, *)
13
13
  @AppIntent(schema: .mail.deleteDraft)
14
14
  struct DeleteDraftIntent {
15
15
  static let authenticationPolicy: IntentAuthenticationPolicy = .requiresLocalDeviceAuthentication
@@ -4,7 +4,7 @@ import Foundation
4
4
  /// The `.mail.draft` schema requires a non-optional account, so every draft needs one. This
5
5
  /// example ships a single hardcoded account. A real mail app would publish its accounts to the
6
6
  /// entity catalog from JavaScript, the same way the restaurant example publishes dishes.
7
- @available(iOS 18.0, *)
7
+ @available(iOS 18.0, macOS 15.0, *)
8
8
  @AppEntity(schema: .mail.account)
9
9
  struct MailAccountEntity {
10
10
  static let defaultQuery = MailAccountEntityQuery()
@@ -2,7 +2,7 @@ import AppIntents
2
2
  internal import ExpoAppIntents
3
3
  import Foundation
4
4
 
5
- @available(iOS 18.0, *)
5
+ @available(iOS 18.0, macOS 15.0, *)
6
6
  @AppEntity(schema: .mail.draft)
7
7
  struct MailDraftEntity {
8
8
  static let defaultQuery = MailDraftEntityQuery()
@@ -3,7 +3,7 @@ import AppIntents
3
3
  /// Schema entities must be resolvable by the system, which means the default query has to be an
4
4
  /// `EntityStringQuery` (or the entity has to be indexed). A plain `EntityQuery` is rejected by the
5
5
  /// App Intents metadata extractor at build time.
6
- @available(iOS 18.0, *)
6
+ @available(iOS 18.0, macOS 15.0, *)
7
7
  struct MailAccountEntityQuery: EntityStringQuery {
8
8
  func entities(for identifiers: [String]) async throws -> [MailAccountEntity] {
9
9
  return try await suggestedEntities().filter { identifiers.contains($0.id) }
@@ -1,7 +1,7 @@
1
1
  import AppIntents
2
2
  internal import ExpoAppIntents
3
3
 
4
- @available(iOS 18.0, *)
4
+ @available(iOS 18.0, macOS 15.0, *)
5
5
  struct MailDraftEntityQuery: EntityStringQuery {
6
6
  func entities(for identifiers: [String]) async throws -> [MailDraftEntity] {
7
7
  return try await AppIntentEntityStore.shared.entities(ofKind: "mailDraft", matching: identifiers)
@@ -5,7 +5,7 @@ import Foundation
5
5
 
6
6
  /// `IntentPerson` models a name and a handle rather than a plain address, so pull the address out
7
7
  /// when Spotlight wants one.
8
- @available(iOS 18.0, *)
8
+ @available(iOS 18.0, macOS 15.0, *)
9
9
  extension IntentPerson {
10
10
  var emailAddress: String? {
11
11
  guard let handle, case .emailAddress(let emailAddress) = handle.value else {
@@ -18,13 +18,13 @@ extension IntentPerson {
18
18
  /// Lets expo-app-intents rebuild drafts from the catalog that JavaScript publishes, which is what
19
19
  /// keeps the Spotlight index in step with `setEntityCatalogAsync`. The base entity already has the
20
20
  /// matching initializer, so this only declares the conformance.
21
- @available(iOS 18.0, *)
21
+ @available(iOS 18.0, macOS 15.0, *)
22
22
  extension MailDraftEntity: AppIntentEntityRecordConvertible {}
23
23
 
24
24
  /// Makes the draft entity Spotlight-indexable. This is added as an extension so the base
25
25
  /// `MailDraftEntity` stays unchanged: conformance and indexing are the only things visual
26
26
  /// intelligence adds to it.
27
- @available(iOS 18.0, *)
27
+ @available(iOS 18.0, macOS 15.0, *)
28
28
  extension MailDraftEntity: IndexedEntity {
29
29
  /// Groups the app's Spotlight items so they can be managed together.
30
30
  static let spotlightDomainIdentifier = "dev.expo.appintents.mailDraft"
@@ -5,7 +5,7 @@ import UniformTypeIdentifiers
5
5
 
6
6
  /// The `.mail.draft` schema does not require `Transferable`, but conforming lets the system share
7
7
  /// and export a draft, for example when dragging it out of the app.
8
- @available(iOS 18.0, *)
8
+ @available(iOS 18.0, macOS 15.0, *)
9
9
  extension MailDraftEntity: Transferable {
10
10
  static var transferRepresentation: some TransferRepresentation {
11
11
  FileRepresentation(exportedContentType: .plainText) { draft in
@@ -45,7 +45,7 @@ extension MailDraftEntity: Transferable {
45
45
  }
46
46
  }
47
47
 
48
- @available(iOS 18.0, *)
48
+ @available(iOS 18.0, macOS 15.0, *)
49
49
  private struct MailDraftTransferRecord: Encodable {
50
50
  let id: String
51
51
  let subject: String
@@ -5,7 +5,7 @@ import Foundation
5
5
  /// Opens a draft the system already knows about, for example a Spotlight result. `.mail.openDraft`
6
6
  /// is the mail domain's own open schema; it requires the iOS 27 SDK
7
7
  #if compiler(>=6.4)
8
- @available(iOS 27.0, *)
8
+ @available(iOS 27.0, macOS 27.0, *)
9
9
  @AppIntent(schema: .mail.openDraft)
10
10
  struct OpenMailDraftIntent {
11
11
  static var openAppWhenRun: Bool = true
@@ -4,7 +4,7 @@ internal import ExpoAppIntents
4
4
 
5
5
  /// `EnumerableEntityQuery` lets the system enumerate every draft, which is what Spotlight needs in
6
6
  /// order to index them without being handed a list first.
7
- @available(iOS 18.0, *)
7
+ @available(iOS 18.0, macOS 15.0, *)
8
8
  extension MailDraftEntityQuery: EnumerableEntityQuery {
9
9
  /// Every draft in the catalog, deliberately not `suggestedEntities()`. `hideInSuggestions` means
10
10
  /// "do not offer this in Siri suggestions", which says nothing about whether search may find it —
@@ -28,7 +28,7 @@ extension MailDraftEntityQuery: EnumerableEntityQuery {
28
28
  ///
29
29
  /// It requires the iOS 27 SDK, so it is compiler-gated separately from the conformances above.
30
30
  #if compiler(>=6.4)
31
- @available(iOS 27.0, *)
31
+ @available(iOS 27.0, macOS 27.0, *)
32
32
  extension MailDraftEntityQuery: IndexedEntityQuery {
33
33
  func reindexEntities(
34
34
  for identifiers: [MailDraftEntity.ID],