{"_id":"@aotui/mobile-ai-native-react-native","_rev":"3-fe1331780d2c225cc776c709f8e6dcdd","name":"@aotui/mobile-ai-native-react-native","dist-tags":{"latest":"0.1.0-alpha.3","alpha":"0.1.0-alpha.2"},"versions":{"0.1.0-alpha.1":{"name":"@aotui/mobile-ai-native-react-native","version":"0.1.0-alpha.1","keywords":["aotui","mobile","react-native","expo","agent-native"],"license":"Apache-2.0","_id":"@aotui/mobile-ai-native-react-native@0.1.0-alpha.1","maintainers":[{"name":"johnnyzhang.agentina","email":"waynezhang.luck@gmail.com"}],"dist":{"shasum":"5e9b4708988d56e022ca5ea0894f05b98043d06d","tarball":"https://registry.npmjs.org/@aotui/mobile-ai-native-react-native/-/mobile-ai-native-react-native-0.1.0-alpha.1.tgz","fileCount":15,"integrity":"sha512-gTdhXeIyIQPBZC9S1625OD9bfziAOSU3RRUOC+G6hTGqrNeLQV2xrneBraFH7FlHwrsz7OBaCn5ICEK9TFwueA==","signatures":[{"sig":"MEUCIGFVAL/CVG6Y722nkCT04UcTun+T7CXjtsr7HfSKCvQoAiEA7fe7R9pcygDtipw83cczJJb8LNGq25L5oqINIYqA76c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24726},"main":"dist/index.js","type":"module","_from":"file:/var/folders/hp/stypzkys30gdsjlhc9kfsqhr0000gn/T/tmp.ERUekOjMjy/aotui-mobile-ai-native-react-native-0.1.0-alpha.1.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest --config vitest.config.ts","build":"pnpm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","test:run":"vitest --config vitest.config.ts --run"},"_npmUser":{"name":"johnnyzhang.agentina","email":"waynezhang.luck@gmail.com"},"_resolved":"/var/folders/hp/stypzkys30gdsjlhc9kfsqhr0000gn/T/tmp.ERUekOjMjy/aotui-mobile-ai-native-react-native-0.1.0-alpha.1.tgz","_integrity":"sha512-gTdhXeIyIQPBZC9S1625OD9bfziAOSU3RRUOC+G6hTGqrNeLQV2xrneBraFH7FlHwrsz7OBaCn5ICEK9TFwueA==","_npmVersion":"10.9.2","description":"React Native / Expo host adapter for the mobile AI-native runtime.","directories":{},"_nodeVersion":"23.11.0","dependencies":{"@aotui/mobile-ai-native":"0.1.0-alpha.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.0.0","vitest":"^3.2.4","react-dom":"^19.0.0","typescript":"^5.9.3","@types/react":"^19.0.0","@types/react-dom":"^19.0.0"},"peerDependencies":{"react":"^19.0.0","react-native":">=0.83.0"},"_npmOperationalInternal":{"tmp":"tmp/mobile-ai-native-react-native_0.1.0-alpha.1_1774588598328_0.5700381607755838","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.2":{"name":"@aotui/mobile-ai-native-react-native","version":"0.1.0-alpha.2","keywords":["aotui","mobile","react-native","expo","agent-native"],"license":"Apache-2.0","_id":"@aotui/mobile-ai-native-react-native@0.1.0-alpha.2","maintainers":[{"name":"johnnyzhang.agentina","email":"waynezhang.luck@gmail.com"}],"dist":{"shasum":"b49b7f0b920a610ad3c1876c786258a20e4d22cd","tarball":"https://registry.npmjs.org/@aotui/mobile-ai-native-react-native/-/mobile-ai-native-react-native-0.1.0-alpha.2.tgz","fileCount":15,"integrity":"sha512-yw87NVlrPcF3IND9Tf8JwQednSODwAVn43PhrMYR8Fzd2rqyOu7+3KfltoFCS9TtAhuaQ39uC8CJognnh45bvQ==","signatures":[{"sig":"MEQCIH/juJU52H/2ithtq7u8RNKcb5oza/dIU76sSRhmyhVhAiB6oi/THPPYobsfjZZTWs4ZYpZIYu7vE7AFhv6P0t+jQw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24832},"main":"dist/index.js","type":"module","_from":"file:/var/folders/hp/stypzkys30gdsjlhc9kfsqhr0000gn/T/tmp.iz30eBnJFJ/aotui-mobile-ai-native-react-native-0.1.0-alpha.2.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest --config vitest.config.ts","build":"pnpm run clean && tsc -p tsconfig.json && node ../../scripts/fix-relative-import-extensions.mjs ./dist","clean":"rm -rf dist","test:run":"vitest --config vitest.config.ts --run"},"_npmUser":{"name":"johnnyzhang.agentina","email":"waynezhang.luck@gmail.com"},"_resolved":"/var/folders/hp/stypzkys30gdsjlhc9kfsqhr0000gn/T/tmp.iz30eBnJFJ/aotui-mobile-ai-native-react-native-0.1.0-alpha.2.tgz","_integrity":"sha512-yw87NVlrPcF3IND9Tf8JwQednSODwAVn43PhrMYR8Fzd2rqyOu7+3KfltoFCS9TtAhuaQ39uC8CJognnh45bvQ==","_npmVersion":"10.9.2","description":"React Native / Expo host adapter for the mobile AI-native runtime.","directories":{},"_nodeVersion":"23.11.0","dependencies":{"@aotui/mobile-ai-native":"0.1.0-alpha.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"react":"^19.0.0","vitest":"^3.2.4","react-dom":"^19.0.0","typescript":"^5.9.3","@types/react":"^19.0.0","@types/react-dom":"^19.0.0"},"peerDependencies":{"react":"^19.0.0","react-native":">=0.83.0"},"_npmOperationalInternal":{"tmp":"tmp/mobile-ai-native-react-native_0.1.0-alpha.2_1774924457868_0.29939887644475816","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.3":{"name":"@aotui/mobile-ai-native-react-native","version":"0.1.0-alpha.3","description":"React Native / Expo host adapter for the mobile AI-native runtime.","license":"Apache-2.0","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"peerDependencies":{"react":"^19.0.0","react-native":">=0.83.0"},"dependencies":{"@aotui/mobile-ai-native":"0.1.0-alpha.3"},"devDependencies":{"@types/react":"^19.0.0","@types/react-dom":"^19.0.0","react":"19.2.0","react-dom":"19.2.0","typescript":"^5.9.3","vitest":"^3.2.4","zod":"^4.3.6"},"keywords":["aotui","mobile","react-native","expo","agent-native"],"publishConfig":{"access":"public"},"scripts":{"clean":"rm -rf dist","build":"pnpm run clean && tsc -p tsconfig.json && node ../../scripts/fix-relative-import-extensions.mjs ./dist","test":"vitest --config vitest.config.ts","test:run":"vitest --config vitest.config.ts --run"},"_id":"@aotui/mobile-ai-native-react-native@0.1.0-alpha.3","_integrity":"sha512-HfsO/W14zuk8lmvx8PIVasyiVAU29hocNIwoOoSRDRQA6ZKhNZnKP3e7+7m2OApnnahufxeKM68qQQitVTW63w==","_resolved":"/private/var/folders/hp/stypzkys30gdsjlhc9kfsqhr0000gn/T/6f07580126ea394e4baa6bf61be38270/aotui-mobile-ai-native-react-native-0.1.0-alpha.3.tgz","_from":"file:aotui-mobile-ai-native-react-native-0.1.0-alpha.3.tgz","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-HfsO/W14zuk8lmvx8PIVasyiVAU29hocNIwoOoSRDRQA6ZKhNZnKP3e7+7m2OApnnahufxeKM68qQQitVTW63w==","shasum":"81be93516a5b715d00b7162a472a080767b4797c","tarball":"https://registry.npmjs.org/@aotui/mobile-ai-native-react-native/-/mobile-ai-native-react-native-0.1.0-alpha.3.tgz","fileCount":14,"unpackedSize":13866,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA3tbbGuVW6XY4n5LArd9x4idSOqbhSgkQY5HoKm5R0mAiEAmhUfrXHcZLx3v74kOqqCHNfANIYL6sRRQu4zqeAGN2o="}]},"_npmUser":{"name":"johnnyzhang.agentina","email":"waynezhang.luck@gmail.com"},"directories":{},"maintainers":[{"name":"johnnyzhang.agentina","email":"waynezhang.luck@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mobile-ai-native-react-native_0.1.0-alpha.3_1775795086853_0.2320792453044882"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-27T05:16:38.191Z","modified":"2026-04-10T04:24:47.125Z","0.1.0-alpha.1":"2026-03-27T05:16:38.454Z","0.1.0-alpha.2":"2026-03-31T02:34:17.998Z","0.1.0-alpha.3":"2026-04-10T04:24:46.983Z"},"license":"Apache-2.0","keywords":["aotui","mobile","react-native","expo","agent-native"],"description":"React Native / Expo host adapter for the mobile AI-native runtime.","maintainers":[{"name":"johnnyzhang.agentina","email":"waynezhang.luck@gmail.com"}],"readme":"# @aotui/mobile-ai-native-react-native\n\n`@aotui/mobile-ai-native-react-native` is the React Native / Expo host adapter for [`@aotui/mobile-ai-native`](../../mobile-ai-native/README.md).\n\nUse it when you want:\n\n- a real React context boundary for the runtime\n- reactive hooks for GUI state, trace, and snapshot reads\n- a host-safe AI surface for `snapshotId`-scoped tool execution\n- a place to connect app foreground/background and screen focus lifecycle\n\nThis package does **not** replace the core runtime.\nThe split is intentional:\n\n- `@aotui/mobile-ai-native`\n  owns state, action runtime, snapshot assembly, refs, tool bridge, trace, and effect contracts\n- `@aotui/mobile-ai-native-react-native`\n  owns React host wiring and React Native / Expo integration\n\n## Installation\n\n```bash\npnpm add @aotui/mobile-ai-native @aotui/mobile-ai-native-react-native react react-native\n```\n\n## Runtime Shape\n\nThe adapter exposes:\n\n- `createReactNativeAppRuntime`\n- `AppRuntimeProvider`\n- `useRuntimeState`\n- `useRuntimeActions`\n- `useRuntimeTrace`\n- `useRuntimeSnapshot`\n- `useRuntimeHostLifecycle`\n- `createHostLifecycleBridge`\n\nMinimal shape:\n\n```tsx\nimport {\n  AppRuntimeProvider,\n  createReactNativeAppRuntime,\n  useRuntimeActions,\n  useRuntimeState,\n} from \"@aotui/mobile-ai-native-react-native\";\n\nconst runtime = createReactNativeAppRuntime(appDefinition);\n\nfunction InboxScreen() {\n  const items = useRuntimeState((state) => state.inbox.items);\n  const { executeAction } = useRuntimeActions();\n\n  return (\n    <>\n      {items.map((message) => (\n        <Button\n          key={message.id}\n          title={message.subject}\n          onPress={() => executeAction(\"openMessage\", { message })}\n        />\n      ))}\n    </>\n  );\n}\n\nexport function App() {\n  return (\n    <AppRuntimeProvider runtime={runtime}>\n      <InboxScreen />\n    </AppRuntimeProvider>\n  );\n}\n```\n\n## AI Surface\n\nThe adapter keeps raw core internals hidden, but still exposes a host-safe AI boundary:\n\n```ts\nconst snapshot = runtime.ai.getSnapshot();\n\nawait runtime.ai.executeTool(\n  \"openMessage\",\n  { message: \"messages[0]\" },\n  snapshot.snapshotId,\n);\n```\n\nThis preserves the core contract:\n\n- snapshot reads stay atomic\n- `snapshot.tools` stays a stable manifest while `snapshot.toolAvailability` carries current executability hints\n- tool execution stays tied to the exact `snapshotId` the model saw\n- GUI keeps reacting to the same shared state as the tool path\n\n## Host Lifecycle\n\nUse `createHostLifecycleBridge()` and `useRuntimeHostLifecycle()` to forward host signals such as:\n\n- app active\n- app background\n- screen focused\n- screen blurred\n\nThe adapter owns that boundary so the core package can stay host-agnostic.\n\n## Reference App\n\nSee the Expo reference app in [`examples/mobile-ai-native-expo-adapter`](../../examples/mobile-ai-native-expo-adapter).\n","readmeFilename":"README.md"}