{"_id":"@eitjuh/expo-apple-intelligence","_rev":"2-56404f3f7f472847fac52ce1b9293352","name":"@eitjuh/expo-apple-intelligence","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@eitjuh/expo-apple-intelligence","version":"0.1.0","keywords":["react-native","expo","apple","apple-intelligence","ai","llm","foundation-models","on-device-ai","machine-learning","ios","siri","neural-engine","private-ai","offline-ai"],"author":{"name":"eitjuh"},"license":"MIT","_id":"@eitjuh/expo-apple-intelligence@0.1.0","maintainers":[{"name":"eitjuh","email":"eitjuh@gmail.com"}],"homepage":"https://github.com/eitjuh/expo-apple-intelligence#readme","bugs":{"url":"https://github.com/eitjuh/expo-apple-intelligence/issues"},"dist":{"shasum":"2ac244504cce54e036547e43f2102b8b05f1089b","tarball":"https://registry.npmjs.org/@eitjuh/expo-apple-intelligence/-/expo-apple-intelligence-0.1.0.tgz","fileCount":18,"integrity":"sha512-KrC4WgeyEEVGto/N0uAoC9NGjx2C+49hjzifXerzXCFn3fDDY5K7+kbN8Kz5QshYiBPxVF7/o6eN/qA/BIS9bQ==","signatures":[{"sig":"MEUCIQCFhlgt0XbqhGD99f8NCCcYtgr6ulA6P+lJ/iWtsdU35QIgZ5PlKoCROZBnWgLz1BFNGMMpagbAZv3V7jJzZ3yn9Fc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34202},"main":"build/index.js","types":"build/index.d.ts","gitHead":"6f1e27e43633c924b0ddc0a2087343461a7a80b6","scripts":{"lint":"expo-module lint","test":"expo-module test","build":"expo-module build","clean":"expo-module clean","prepare":"expo-module prepare","expo-module":"expo-module","prepublishOnly":"expo-module prepublishOnly"},"_npmUser":{"name":"eitjuh","email":"eitjuh@gmail.com"},"repository":{"url":"git+https://github.com/eitjuh/expo-apple-intelligence.git","type":"git"},"_npmVersion":"11.6.2","description":"Access Apple's on-device Foundation Models (Apple Intelligence) from React Native/Expo. Private, fast, offline AI.","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","expo-modules-core":"^2.0.0","expo-module-scripts":"^4.0.0"},"peerDependencies":{"expo":"*","react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/expo-apple-intelligence_0.1.0_1766869694103_0.1106110383429677","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@eitjuh/expo-apple-intelligence","version":"0.1.1","description":"Access Apple's on-device Foundation Models (Apple Intelligence) from React Native/Expo. Private, fast, offline AI.","main":"build/index.js","types":"build/index.d.ts","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/eitjuh/expo-apple-intelligence.git"},"bugs":{"url":"https://github.com/eitjuh/expo-apple-intelligence/issues"},"author":{"name":"eitjuh"},"license":"MIT","homepage":"https://github.com/eitjuh/expo-apple-intelligence#readme","scripts":{"build":"expo-module build","clean":"expo-module clean","lint":"expo-module lint","test":"expo-module test","prepare":"expo-module prepare","prepublishOnly":"expo-module prepublishOnly","expo-module":"expo-module"},"keywords":["react-native","expo","apple","apple-intelligence","ai","llm","foundation-models","on-device-ai","machine-learning","ios","siri","neural-engine","private-ai","offline-ai"],"peerDependencies":{"expo":"*","react":"*","react-native":"*"},"devDependencies":{"expo-module-scripts":"^4.0.0","expo-modules-core":"^2.0.0","typescript":"^5.3.0"},"gitHead":"e3ac0efbefb24635bb3525e02c6de1a1e36ca3b7","_id":"@eitjuh/expo-apple-intelligence@0.1.1","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-1PhF3MX83KsAoZB5tU4SRKD0b9+kX5GvBLCkSnXzYtEMQCWtUA884RdffK5lT9vs7YZc2u73H1jF4g8ODOhsmg==","shasum":"e01e2cd249c4fb66407ff30bd7dd8b7286da36e1","tarball":"https://registry.npmjs.org/@eitjuh/expo-apple-intelligence/-/expo-apple-intelligence-0.1.1.tgz","fileCount":18,"unpackedSize":34629,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEl9SPFqeK4amOR+/9P9QhhfgARfRQfH6H4uJEVGl8XWAiEA8nzWG3hc2ND/po2Ls3uW7INwpuuPK11O2IAS8XtOxOE="}]},"_npmUser":{"name":"eitjuh","email":"eitjuh@gmail.com"},"directories":{},"maintainers":[{"name":"eitjuh","email":"eitjuh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/expo-apple-intelligence_0.1.1_1766870264260_0.631910963191795"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-27T21:08:14.007Z","modified":"2025-12-27T21:17:44.616Z","0.1.0":"2025-12-27T21:08:14.272Z","0.1.1":"2025-12-27T21:17:44.412Z"},"bugs":{"url":"https://github.com/eitjuh/expo-apple-intelligence/issues"},"author":{"name":"eitjuh"},"license":"MIT","homepage":"https://github.com/eitjuh/expo-apple-intelligence#readme","keywords":["react-native","expo","apple","apple-intelligence","ai","llm","foundation-models","on-device-ai","machine-learning","ios","siri","neural-engine","private-ai","offline-ai"],"repository":{"type":"git","url":"git+https://github.com/eitjuh/expo-apple-intelligence.git"},"description":"Access Apple's on-device Foundation Models (Apple Intelligence) from React Native/Expo. Private, fast, offline AI.","maintainers":[{"name":"eitjuh","email":"eitjuh@gmail.com"}],"readme":"# expo-apple-intelligence\n\n<p align=\"center\">\n  <img src=\"https://img.shields.io/npm/v/expo-apple-intelligence?style=flat-square\" alt=\"npm version\" />\n  <img src=\"https://img.shields.io/npm/dm/expo-apple-intelligence?style=flat-square\" alt=\"npm downloads\" />\n  <img src=\"https://img.shields.io/badge/platforms-iOS-lightgrey?style=flat-square\" alt=\"platforms\" />\n  <img src=\"https://img.shields.io/badge/license-MIT-blue?style=flat-square\" alt=\"license\" />\n</p>\n\n<p align=\"center\">\n  <b>Access Apple's on-device Foundation Models (Apple Intelligence) from React Native/Expo.</b>\n  <br />\n  <i>Private. Fast. Offline.</i>\n</p>\n\n---\n\n## ✨ Features\n\n- 🔒 **Complete Privacy** - All AI processing happens on-device. Your data never leaves the phone.\n- ⚡ **Blazing Fast** - Powered by Apple Neural Engine for instant responses.\n- 📴 **Works Offline** - No internet connection required.\n- 💬 **Session Support** - Maintain conversation context across messages.\n- 🎯 **Simple API** - Just a few functions to get started.\n\n## 📋 Requirements\n\n| Requirement | Minimum |\n|-------------|---------|\n| iOS Version | iOS 26.0+ |\n| Device | iPhone 15 Pro+ / iPad with M1+ |\n| Apple Intelligence | Must be enabled in Settings |\n| Xcode | 26.0+ |\n\n> ⚠️ **Beta Notice**: iOS 26 and the Foundation Models framework are currently in beta. APIs may change.\n\n## 🚀 Installation\n\n```bash\nnpx expo install @eitjuh/expo-apple-intelligence\n```\n\n### Development Build Required\n\nThis package requires native code, so you'll need a [development build](https://docs.expo.dev/develop/development-builds/introduction/):\n\n```bash\n# Install expo-dev-client if you haven't already\nnpx expo install expo-dev-client\n\n# Build for iOS\nnpx expo run:ios\n```\n\n## 📖 Quick Start\n\n```typescript\nimport * as AppleIntelligence from '@eitjuh/expo-apple-intelligence';\n\n// Check if Apple Intelligence is available\nconst available = await AppleIntelligence.isAvailable();\n\nif (available) {\n  // Generate a response\n  const result = await AppleIntelligence.generateResponse(\n    'Explain quantum computing in simple terms'\n  );\n  \n  if (result.success) {\n    console.log(result.response);\n  }\n}\n```\n\n## 📚 API Reference\n\n### `isAvailable()`\n\nCheck if Apple Intelligence is available on the current device.\n\n```typescript\nconst available: boolean = await AppleIntelligence.isAvailable();\n```\n\n### `getAvailabilityStatus()`\n\nGet detailed availability information including reasons for unavailability.\n\n```typescript\nconst status = await AppleIntelligence.getAvailabilityStatus();\n\n// status: {\n//   status: 'available' | 'unavailable' | 'unsupported' | 'unknown';\n//   isAvailable: boolean;\n//   reason?: string;\n//   message: string;\n// }\n```\n\n**Possible statuses:**\n- `available` - Apple Intelligence is ready to use\n- `unavailable` - Device supports it but it's not enabled/ready\n- `unsupported` - Device or iOS version doesn't support Apple Intelligence\n- `unknown` - Unable to determine status\n\n### `generateResponse(prompt)`\n\nGenerate a response using Apple's on-device language model.\n\n```typescript\nconst result = await AppleIntelligence.generateResponse('Your prompt here');\n\n// result: {\n//   success: boolean;\n//   response?: string;  // The generated text\n//   error?: string;     // Error message if failed\n// }\n```\n\n### `createSession(options?)`\n\nCreate a conversation session that maintains context across messages.\n\n```typescript\nconst session = await AppleIntelligence.createSession({\n  systemPrompt: 'You are a helpful coding assistant.' // Optional\n});\n\n// Send messages that build on each other\nconst response1 = await session.sendMessage('What is TypeScript?');\nconst response2 = await session.sendMessage('How do I use interfaces?');\n// The model remembers the context from previous messages\n\n// Reset the conversation\nawait session.reset();\n```\n\n## 💡 Examples\n\n### Basic Chat\n\n```typescript\nimport { useState } from 'react';\nimport * as AppleIntelligence from '@eitjuh/expo-apple-intelligence';\n\nfunction ChatScreen() {\n  const [response, setResponse] = useState('');\n  const [loading, setLoading] = useState(false);\n\n  async function handleSend(message: string) {\n    setLoading(true);\n    \n    const result = await AppleIntelligence.generateResponse(message);\n    \n    if (result.success) {\n      setResponse(result.response ?? '');\n    } else {\n      console.error(result.error);\n    }\n    \n    setLoading(false);\n  }\n\n  return (/* your UI */);\n}\n```\n\n### Checking Availability\n\n```typescript\nimport { useEffect, useState } from 'react';\nimport * as AppleIntelligence from '@eitjuh/expo-apple-intelligence';\n\nfunction App() {\n  const [status, setStatus] = useState<string>('Checking...');\n\n  useEffect(() => {\n    async function checkAvailability() {\n      const result = await AppleIntelligence.getAvailabilityStatus();\n      setStatus(result.message);\n    }\n    checkAvailability();\n  }, []);\n\n  return (/* show status */);\n}\n```\n\n### Persistent Conversation\n\n```typescript\nimport * as AppleIntelligence from '@eitjuh/expo-apple-intelligence';\n\n// Create a session once\nconst session = await AppleIntelligence.createSession({\n  systemPrompt: 'You are a friendly assistant who speaks casually.'\n});\n\n// Send multiple messages - context is preserved\nawait session.sendMessage('Hi! My name is Alex.');\nawait session.sendMessage('What did I just tell you my name was?');\n// The model will remember \"Alex\"\n```\n\n## ❓ FAQ\n\n### Why does it show \"unavailable\" on my device?\n\nApple Intelligence requires:\n1. **iOS 26 or later** - Currently in beta\n2. **Supported hardware** - iPhone 15 Pro/Pro Max or later, iPad with M1 chip or later\n3. **Apple Intelligence enabled** - Go to Settings → Apple Intelligence & Siri → Turn on Apple Intelligence\n4. **Model downloaded** - The on-device model may need to download first\n\n### Does this work on Android?\n\nNo. Apple Intelligence is an Apple-only feature. On Android, `isAvailable()` will return `false` and all generation functions will return an error indicating the platform is unsupported.\n\n### Is my data sent to Apple's servers?\n\nNo. All processing happens entirely on your device using Apple's Neural Engine. This is one of the key privacy benefits of Apple Intelligence.\n\n### Can I use this with Expo Go?\n\nNo. This package requires native code, so you need to use a [development build](https://docs.expo.dev/develop/development-builds/introduction/) or a standalone app.\n\n## 🔧 Troubleshooting\n\n### \"Native module not loaded\"\n\nMake sure you've created a development build:\n\n```bash\nnpx expo run:ios\n```\n\n### \"Foundation Models not available\"\n\nYour Xcode or iOS simulator may not be on version 26+. Check your versions:\n\n```bash\nxcodebuild -version\n```\n\n### Build errors with Swift\n\nEnsure your project is set up for Swift. The module requires Swift 5.9+.\n\n## 📄 License\n\nMIT © [eitjuh](https://github.com/eitjuh)\n\n## 🙏 Acknowledgments\n\n- Apple for the Foundation Models framework\n- The Expo team for expo-modules-core\n\n---\n\n<p align=\"center\">\n  <sub>Built with ❤️ for the React Native community</sub>\n</p>\n\n","readmeFilename":"README.md"}