@capgo/capacitor-llm 8.0.18 → 8.0.19

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.
@@ -12,7 +12,7 @@ import java.util.List;
12
12
  @CapacitorPlugin(name = "CapgoLLM")
13
13
  public class LLMPlugin extends Plugin {
14
14
 
15
- private final String pluginVersion = "8.0.18";
15
+ private final String pluginVersion = "8.0.19";
16
16
 
17
17
  private LLM llm;
18
18
 
@@ -18,7 +18,7 @@ import MediaPipeTasksGenAI
18
18
 
19
19
  @objc(LLMPlugin)
20
20
  public class LLMPlugin: CAPPlugin, CAPBridgedPlugin {
21
- private let pluginVersion: String = "8.0.18"
21
+ private let pluginVersion: String = "8.0.19"
22
22
  #if targetEnvironment(macCatalyst)
23
23
  private let catalystNotSupportedMessage = "CapgoLLM is not available on Mac Catalyst. Use an iOS/iPadOS target instead."
24
24
  #endif
@@ -61,6 +61,16 @@ public class LLMPlugin: CAPPlugin, CAPBridgedPlugin {
61
61
 
62
62
  #if canImport(FoundationModels)
63
63
  private var appleModel: Any? = {
64
+ // `SystemLanguageModel.default` is not functional for an iOS/iPadOS
65
+ // binary running "Designed for iPad" on Apple Silicon Mac, and
66
+ // touching it there crashes the app during plugin instantiation —
67
+ // before any of the app's own platform checks get a chance to run,
68
+ // since Capacitor eagerly instantiates every registered plugin at
69
+ // bridge startup. Skip it in that environment, same as the existing
70
+ // Mac Catalyst guard below.
71
+ if ProcessInfo.processInfo.isiOSAppOnMac {
72
+ return nil
73
+ }
64
74
  if #available(iOS 26.0, *) {
65
75
  return SystemLanguageModel.default
66
76
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-llm",
3
- "version": "8.0.18",
3
+ "version": "8.0.19",
4
4
  "description": "Adds support for LLM locally runned for Capacitor",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",