@agimon-ai/po-native 0.0.1-alpha.5 → 0.0.1-alpha.51

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.
Files changed (131) hide show
  1. package/README.md +48 -120
  2. package/app.config.ts +1 -0
  3. package/assets/cta-renew.png +0 -0
  4. package/assets/cta-sign-in.png +0 -0
  5. package/generated/richAssets.json +1 -1
  6. package/metro.config.cjs +4 -0
  7. package/modules/po-bundle-store/android/build.gradle +15 -0
  8. package/modules/po-bundle-store/android/src/main/java/expo/modules/pobundlestore/PoBundleStoreModule.kt +66 -0
  9. package/modules/po-bundle-store/expo-module.config.json +5 -0
  10. package/modules/po-bundle-store/index.ts +30 -0
  11. package/modules/po-bundle-store/ios/PoBundleStore.podspec +16 -0
  12. package/modules/po-bundle-store/ios/PoBundleStoreModule.swift +81 -0
  13. package/modules/po-lan-tls/android/build.gradle +20 -0
  14. package/modules/po-lan-tls/android/src/main/java/expo/modules/polantls/PoLanTlsModule.kt +521 -0
  15. package/modules/po-lan-tls/expo-module.config.json +5 -0
  16. package/modules/po-lan-tls/index.ts +538 -0
  17. package/modules/po-lan-tls/ios/PoLanTls.podspec +17 -0
  18. package/modules/po-lan-tls/ios/PoLanTlsModule.swift +593 -0
  19. package/package.json +13 -11
  20. package/src/adapters/remoteHttp.ts +36 -2
  21. package/src/adapters/remoteSocket.ts +9 -5
  22. package/src/app/AccountRoute.tsx +223 -655
  23. package/src/app/App.tsx +1366 -637
  24. package/src/app/GrantNotices.tsx +44 -4
  25. package/src/app/HostBackdrop.tsx +55 -0
  26. package/src/app/HostsRoutes.tsx +90 -9
  27. package/src/app/SessionSharingRoute.tsx +192 -0
  28. package/src/app/TeamRoute.tsx +98 -0
  29. package/src/app/activityLoads.ts +32 -0
  30. package/src/app/appearance.ts +53 -5
  31. package/src/app/bundledPlugins.ts +8 -0
  32. package/src/app/cloudRuntime.ts +74 -20
  33. package/src/app/hostRuntimes.ts +122 -25
  34. package/src/app/liveRuntime.ts +402 -227
  35. package/src/app/nativeTemplate.tsx +45 -19
  36. package/src/app/railWorkspaces.ts +7 -6
  37. package/src/app/sessionAvatars.ts +52 -0
  38. package/src/app/useHome.ts +46 -13
  39. package/src/components/ActivitySheet.stories.tsx +3 -3
  40. package/src/components/ActivitySheet.tsx +1 -1
  41. package/src/components/CompletionSheet.stories.tsx +8 -6
  42. package/src/components/ContextFace.stories.tsx +1 -1
  43. package/src/components/ContextFace.tsx +2 -2
  44. package/src/components/DialogSheet.stories.tsx +1 -1
  45. package/src/components/GrantNotice.tsx +27 -41
  46. package/src/components/MessageActionsSheet.stories.tsx +2 -5
  47. package/src/components/SessionOptionsSheet.tsx +18 -18
  48. package/src/components/SessionSheets.stories.tsx +151 -0
  49. package/src/components/SessionSheets.tsx +371 -2
  50. package/src/components/homeApps.ts +1 -38
  51. package/src/components/richActivity/AuthorMediaHost.tsx +69 -90
  52. package/src/components/richActivity/AuthorVideoTransport.stories.tsx +95 -0
  53. package/src/components/richActivity/AuthorVideoTransport.tsx +144 -0
  54. package/src/index.tsx +6 -0
  55. package/src/screens/AccountHosts.stories.tsx +51 -0
  56. package/src/screens/AccountOnboarding.stories.tsx +67 -3
  57. package/src/screens/AccountScreen.tsx +239 -107
  58. package/src/screens/AppearanceScreen.tsx +61 -34
  59. package/src/screens/AuthoringDesign.stories.tsx +420 -0
  60. package/src/screens/ComposerOptionsDesign.stories.tsx +5 -5
  61. package/src/screens/ContributedSettingsScreen.tsx +6 -8
  62. package/src/screens/ConversationDesign.stories.tsx +1 -2
  63. package/src/screens/GlobalSettings.stories.tsx +36 -0
  64. package/src/screens/GlobalSettings.tsx +146 -0
  65. package/src/screens/Grants.stories.tsx +198 -3
  66. package/src/screens/HomeComputers.stories.tsx +41 -45
  67. package/src/screens/HomeDesign.stories.tsx +335 -0
  68. package/src/screens/HomeScreen.stories.tsx +17 -161
  69. package/src/screens/HomeScreen.tsx +271 -225
  70. package/src/screens/HostDrawer.stories.tsx +17 -2
  71. package/src/screens/HostDrawer.tsx +12 -2
  72. package/src/screens/HostsView.tsx +64 -0
  73. package/src/screens/LargeContentDesign.stories.tsx +2 -2
  74. package/src/screens/MultiHostDesign.stories.tsx +1 -1
  75. package/src/screens/NativeListsDesign.stories.tsx +14 -15
  76. package/src/screens/PluginActionsDesign.stories.tsx +1 -2
  77. package/src/screens/PluginCatalogScreen.tsx +244 -0
  78. package/src/screens/PluginDetailScreen.tsx +270 -0
  79. package/src/screens/PluginMarketplaceDesign.stories.tsx +347 -0
  80. package/src/screens/PluginOnboardingScreen.tsx +181 -0
  81. package/src/screens/PresetsScreen.tsx +212 -0
  82. package/src/screens/ProvidersScreen.tsx +2 -2
  83. package/src/screens/RemoteControlScreen.tsx +11 -84
  84. package/src/screens/SessionScreen.stories.tsx +28 -4
  85. package/src/screens/SessionSharing.stories.tsx +78 -0
  86. package/src/screens/SessionSharingView.tsx +247 -0
  87. package/src/screens/SettingsRound2Design.stories.tsx +3 -3
  88. package/src/screens/SettingsScreen.stories.tsx +43 -32
  89. package/src/screens/SettingsScreen.tsx +91 -11
  90. package/src/screens/Team.stories.tsx +56 -0
  91. package/src/screens/TeamView.tsx +306 -0
  92. package/src/screens/WorkspaceProvidersSection.tsx +8 -19
  93. package/src/screens/WorkspaceSettingsScreen.tsx +16 -16
  94. package/src/screens/homeModel.ts +2 -3
  95. package/src/screens/pluginModel.tsx +78 -0
  96. package/src/screens/usePluginMarketplace.ts +229 -0
  97. package/src/services/accountClient/index.ts +79 -272
  98. package/src/services/apiTransport/index.ts +38 -18
  99. package/src/services/bundleCache/index.ts +35 -0
  100. package/src/services/bundleUpdates/index.ts +536 -0
  101. package/src/services/cloudHosts/index.ts +32 -8
  102. package/src/services/connection/index.ts +2 -1
  103. package/src/services/deviceTrust/index.ts +127 -18
  104. package/src/services/hostActions/index.ts +87 -24
  105. package/src/services/hostModules/index.ts +16 -3
  106. package/src/services/logExport/index.ts +4 -1
  107. package/src/services/pairing/index.ts +38 -8
  108. package/src/services/pluginRuntime/index.ts +95 -40
  109. package/src/services/relayTransport/index.ts +258 -0
  110. package/src/services/relayTransport/route.ts +19 -0
  111. package/src/services/requestCache/index.ts +70 -0
  112. package/src/services/requestCache/type.ts +6 -0
  113. package/src/services/sessionRuntime/index.ts +1 -1
  114. package/src/services/settingsApi/index.ts +93 -47
  115. package/src/services/workspaceProviders/index.ts +15 -8
  116. package/src/types/poTemplateElegant.d.ts +9 -0
  117. package/src/components/ActivityPanel.tsx +0 -49
  118. package/src/components/CaptureTray.tsx +0 -93
  119. package/src/components/CompletionSheet.tsx +0 -378
  120. package/src/components/Composer.tsx +0 -453
  121. package/src/components/DialogSheet.tsx +0 -114
  122. package/src/components/MessageActionsSheet.tsx +0 -37
  123. package/src/components/TimelineItem.tsx +0 -238
  124. package/src/components/slotProps.ts +0 -159
  125. package/src/screens/PluginsScreen.tsx +0 -97
  126. package/src/screens/SessionScreen.tsx +0 -666
  127. package/src/screens/accountBack.ts +0 -15
  128. package/src/services/accountGrants/index.ts +0 -147
  129. package/src/services/accountRoster/index.ts +0 -390
  130. package/src/services/accountTrust/index.ts +0 -261
  131. package/src/services/issuerSelection.native.ts +0 -27
package/README.md CHANGED
@@ -1,162 +1,90 @@
1
1
  # Po Native
2
2
 
3
- The Po phone app for iOS and Android, built with Expo 57 and React Native 0.86. App name "Po", company iOS bundle id `ai.po.app`, Android package `ai.agimon.po`. It is private, experimental (`stage:experimental`), and built locally only: no EAS or other cloud build.
3
+ Po's experimental iOS and Android client, built with Expo and React Native. It connects to paired Po computers and hosted accounts, shares the dashboard's session stores, and mounts native plugin interfaces from each host's verified composition. Dependency versions are maintained in [`package.json`](package.json), not in this guide.
4
4
 
5
- The app pairs with one Po host over its remote-access tunnel, lists that host's sessions, shows a session transcript with a composer, and runs the host's native plugin contributions (for example po-task's task tool renderer and task graph channel) from a signed composition it downloads.
5
+ The app is named **Po**. Its iOS bundle ID is `ai.po.app`; Android remains `ai.agimon.po`. Builds use the local Expo/Xcode/Gradle scripts, not EAS.
6
6
 
7
- ## How it works
7
+ ## Trust and connection
8
8
 
9
- - **Pairing.** Scan the host's pairing QR with the camera, or paste the URL. The host approves the request on its own screen. The app then registers device keys (see the trust model) and keeps the host record.
10
- - **Connection.** Remote HTTP with the device cookie, three sealed channels (session, protocol, HTTP), the Pi `Client` over the protocol socket, and the hub socket. A dropped hub signs in again with the device key and rebuilds the connection.
11
- - **Session state.** `@agimon-ai/po-web-dashboard/core` supplies the session, transcript, and plugin registry stores, the same ones the browser cockpit uses, without any DOM dependency.
12
- - **Plugins.** The host advertises native compositions through `nativeGlobal` and `workspaces[].nativeComposition` on `/api/compositions` and `nativeComposition` on a session summary. For each mount the app loads the composition through its verified cache, evaluates it, keeps only the plugin ids the descriptor admits, installs them in the plugin registry, and starts them. Channel frames reach plugins through `dispatchChannelFrame`. A newer load for a mount makes older ones stale.
13
- - **Navigation.** `App` registers screens by phase (reconnecting, pairing, ready) in a React Navigation native stack, inside `SafeAreaProvider > PoNativeProvider > KeyboardProvider > NavigationContainer`. Native headers own back navigation and swipe back; Sessions has a large title and a Settings action. A session opens in the live runtime on focus and closes on blur; Settings reloads trusted devices on focus.
14
- - **Lists and content.** Sessions and transcripts use the component library's FlashList-backed `List`; the transcript uses `startAtBottom`. Assistant text uses `Markdown`; tool entries use the plugin `sessionToolRenderer`, falling back to `MessageItem` and `CodeBlock`.
15
- - **Sheets.** `PoNativeProvider` supplies the shared gesture root and bottom sheet host for plugin detail sheets and action menus. The composer's decision prompts stay inline as gentle rose panels, not modal sheets. `SettingsScreen` lists trusted devices, revokes one through biometric step-up, and forgets the host.
16
- - **Styling.** `react-native-unistyles` 3.5.2 with Po's `light` and `dark` themes from `@agimon-ai/po-web-components/nativeTheme`, registered in `src/unistyles.ts` with adaptive themes. Every screen and component keeps its `StyleSheet.create` in its own file so the Unistyles Babel plugin rewrites it.
9
+ Pair a computer by scanning its QR or pasting the pairing URL, then approve on that computer. Pairing requires enrolled phone biometrics. The phone pins the host's bundle signer and uses separate P-256 identity and biometric step-up keys. Keys and host records are stored in host-specific SecureStore namespaces with `WHEN_UNLOCKED_THIS_DEVICE_ONLY`; legacy records migrate from the earlier single-host keys.
17
10
 
18
- ## Trust model
11
+ Reconnect uses the identity key and accepts a fresh tunnel key only after the pinned signer attests it over the phone's nonce. Gated actions require biometric step-up. These are software keys decrypted into JavaScript memory for signing, not Secure Enclave or StrongBox keys.
19
12
 
20
- The full model is in [Security model](../../../docs/securities.md#trusted-native-devices). In short:
13
+ Each host has its own sealed session, protocol, and HTTP channels, runtime, and composition cache. The selected phone pairing ID is not the remote federation host ID. See [host linking and account operations](docs/host-link-bridge.md) and the [security guide](../../../docs/security.md#remote-access).
21
14
 
22
- - **Pairing needs host approval and biometrics.** If the phone has no Face ID, Touch ID, or fingerprint enrolled, pairing stops with "Set up Face ID or a fingerprint to pair this phone."
23
- - **Two device keys.** After approval the app generates two P-256 keys and registers them through the sealed gateway: an identity key for silent sign-in, and a step-up key that only biometrics unlock. They live in `expo-secure-store` as `po.device.identity.v1` and `po.device.stepup.v1`; the host record (origin, trusted device id, pinned signer key and revision, label) is `po.host.v1`. All three are `WHEN_UNLOCKED_THIS_DEVICE_ONLY`.
24
- - **Reconnect.** On start the app signs in with the identity key, no QR and no host approval. It trusts the host's fresh tunnel key only after the bundle signer it pinned from the QR attests that key over the app's own nonce. A changed signer fails closed and Home shows the connect card again.
25
- - **Step-up.** Every gated action from a device-key session needs a biometric signature, on every tunnel. `fetchWithStepUp` retries a request once after a 401 that names an action.
26
- - **Revocation.** From the host UI, or from a paired phone after step-up (`device.revoke`). A quick-tunnel browser cannot revoke. Forget host requires successful remote revocation before deleting local keys; failure retains them for retry. A confirmed revocation is checkpointed so interrupted local cleanup can finish after restart. A biometric change invalidates the step-up key; pair again by QR.
27
- - **Keys are software keys.** They are decrypted into JS memory to sign. They are not Secure Enclave or StrongBox keys.
15
+ **Forget on this phone is local and works offline.** It clears that computer's pairing keys, summaries, plugins, and runtime. Revoke-only metadata remains for a later pairing with the same pinned computer; it does not retain reconnect credentials or revoke the fresh pairing. Forget does not remove account membership or unlink peers. Account removal and device revocation are separate actions with separate confirmation requirements.
28
16
 
29
- ### Trusted compositions are not sandboxed
17
+ ## Native plugins are trusted code
30
18
 
31
- A native composition is host code, one CommonJS module per plugin. The app verifies each module before running it: on every load, cached or downloaded, it checks the signed manifest against the pinned signer with the `native` bundle profile (top-level `.js` modules, each at most 4 MiB), requires the exact advertised revision, and checks that module's hash. The same revision with a different hash is refused, a signer change clears the cache, and the cache keeps at most 64 modules under `Paths.cache/po/compositions/`. It then evaluates each module with `new Function` against a frozen map of host modules (`NATIVE_HOST_MODULE_IDS` from `@agimon-ai/po-core/native`); any other `require` throws. A module that fails to load, verify, or evaluate is left out with a warning and the rest still run. That map is a compatibility boundary, not a sandbox: a verified module runs with the app's full JavaScript privileges.
19
+ The app checks a composition's signed manifest against the pinned signer with the `native` profile, requires the advertised revision, and verifies each module's hash before evaluation. Reusing a known revision with different bytes is refused. The cache is host-scoped and bounded to 64 modules; builds with the native bundle store use it, with the Expo cache as a migration fallback.
32
20
 
33
- ## Local checks
21
+ Modules are CommonJS evaluated with `new Function`. `require` resolves only the frozen `NATIVE_HOST_MODULE_IDS` map. That is a compatibility boundary, **not a sandbox**: verified code has the app's JavaScript privileges. A failed module is omitted with a warning, not executed unverified.
34
22
 
35
- ```sh
36
- pnpm install
37
- pnpm nx run-many -t lint typecheck build test -p @agimon-ai/po-native --parallel=2
38
- ```
23
+ Shared native views live in `@agimon-ai/po-native-dashboard`; components and providers live in `@agimon-ai/po-native-components`. Register Unistyles themes before importing the component library. Runtime code must not import stories.
39
24
 
40
- `build` runs the proof fixture builder and `expo export --platform all` into `dist/shell`. `build:proof` (`scripts/buildProof.mjs`) builds a small counter composition and signs it with the `native` profile; tests use it as a fixture. Node tests do not exercise native crypto, Hermes, or native modules.
25
+ ## Local development and checks
41
26
 
42
- ## Running on a device
27
+ From the repository root:
43
28
 
44
29
  ```sh
30
+ pnpm install
31
+ pnpm nx run-many -t lint typecheck build test -p @agimon-ai/po-native --parallel=2
45
32
  pnpm nx run @agimon-ai/po-native:prebuild
46
33
  pnpm --filter @agimon-ai/po-native ios:setup
47
34
  pnpm nx run @agimon-ai/po-native:ios
35
+ # Android needs JDK 17; on macOS:
48
36
  JAVA_HOME=$(/usr/libexec/java_home -v 17) pnpm nx run @agimon-ai/po-native:android
49
37
  ```
50
38
 
51
- `ios` and `android` are local Release builds. `ios:setup` installs CocoaPods 1.16.2 under `.build/gems` and the iOS commands set `GEM_HOME`, `GEM_PATH`, and `PATH` for that process only; system gems and shell configuration are untouched. The generated `ios/` and `android/` folders, Expo state, and `.build/` are gitignored and never edited by hand; signing changes come from `@agimon-ai/po-expo-signing` during prebuild.
39
+ `build` generates the signed proof fixture, then runs Expo export into `dist/shell`. `ios` and `android` are local Release builds. `ios:setup` installs CocoaPods under `.build/gems`, without changing system gems or shell configuration. Generated native projects are gitignored; signing changes belong in [`po-expo-signing`](../../expo/po-expo-signing/README.md), not hand-edited `ios/` or `android/` files.
52
40
 
53
- The company iOS build requires an `ai.po.app` provisioning profile with Push Notifications. Previous
54
- `ai.agimon.po` iOS installs are a separate app identity; rebuild and pair the company app. Native push
55
- checks the installed iOS application ID before enrollment and reads its provisioning-profile APNs
56
- environment, with a production fallback for App Store/TestFlight installs.
57
- Android remains `ai.agimon.po` with FCM. See [push setup](../../foundations/po-notification/README.md#native-push-server-credentials).
41
+ Node tests do not establish Hermes evaluation, native crypto signatures, biometric invalidation, camera scanning, push delivery, or device rendering. Colocated stories use the workspace style-system tooling. A story or source check is not human visual approval or a device acceptance test.
58
42
 
59
- ## Ad hoc builds
43
+ ## Signed local builds
60
44
 
61
45
  ```sh
62
46
  pnpm nx run @agimon-ai/po-native:ios:adhoc
63
47
  pnpm nx run @agimon-ai/po-native:android:adhoc
64
48
  ```
65
49
 
66
- Both run `scripts/buildAdHoc.mjs`, which fails before touching earlier outputs when a required variable is missing. Every command runs through `spawnSync` with an argument array, and secret values are redacted from console output and logs.
67
-
68
- - **iOS** (macOS with Xcode): build the proof fixture, `expo prebuild --clean --platform ios`, `pod install`, `xcodebuild archive`, then `-exportArchive` with a temporary `ExportOptions.plist` (`method: release-testing`, manual signing) that is deleted afterwards. Run `ios:setup` first.
69
- - **Android**: build the proof fixture, `expo prebuild --clean --platform android`, then `./gradlew assembleRelease` under JDK 17.
50
+ The build script validates required inputs before replacing earlier final artifacts. It uses argument-array commands, redacts signing secrets in logs, and does not upload anything.
70
51
 
71
- | Variable | Platform | Required | Meaning |
72
- | ------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------- |
73
- | `APPLE_TEAM_ID` | iOS | yes | Team id for `appleTeamId`, `DEVELOPMENT_TEAM`, and the export plist |
74
- | `PO_NATIVE_IOS_PROFILE` | iOS | yes | Provisioning profile name; the Release target switches to manual signing |
75
- | `PO_NATIVE_IOS_CODE_SIGN_IDENTITY` | iOS | no | `CODE_SIGN_IDENTITY` and export `signingCertificate`, e.g. `Apple Distribution` |
76
- | `PO_NATIVE_ANDROID_KEYSTORE` | Android | yes | Path to the release keystore, made absolute before Gradle runs |
77
- | `PO_NATIVE_ANDROID_KEYSTORE_PASSWORD` | Android | yes | Keystore password |
78
- | `PO_NATIVE_ANDROID_KEY_ALIAS` | Android | yes | Key alias |
79
- | `PO_NATIVE_ANDROID_KEY_PASSWORD` | Android | yes | Key password |
80
- | `JAVA_HOME` | Android | no | JDK 17; on macOS it defaults to `/usr/libexec/java_home -v 17` |
52
+ | Input | Use |
53
+ | ------------------------------------- | ------------------------------------------------------------------------------ |
54
+ | `APPLE_TEAM_ID` | Required iOS signing team |
55
+ | `PO_NATIVE_IOS_PROFILE` | Required installed provisioning-profile name |
56
+ | `PO_NATIVE_IOS_CODE_SIGN_IDENTITY` | Optional signing certificate name; TestFlight defaults to `Apple Distribution` |
57
+ | `PO_NATIVE_ANDROID_KEYSTORE` | Required Android keystore path |
58
+ | `PO_NATIVE_ANDROID_KEYSTORE_PASSWORD` | Required keystore password |
59
+ | `PO_NATIVE_ANDROID_KEY_ALIAS` | Required key alias |
60
+ | `PO_NATIVE_ANDROID_KEY_PASSWORD` | Required key password |
61
+ | `JAVA_HOME` | JDK 17; macOS scripts can resolve it through `java_home` |
81
62
 
82
- Secrets come only from these variables or the keychain. Gradle reads the Android values at build time, so none is written into the generated project.
63
+ iOS archives and exports with manual signing (`release-testing` for ad hoc). Android runs `assembleRelease`. Secrets come from the environment or keychain, not generated project files. Outputs are `.build/adhoc/po-native.ipa` or `po-native.apk`, with `SHA256SUMS`. Private per-step logs are under `.build/adhoc/logs/`; work files are under `.build/adhoc/work/`. A failed build preserves the previous final artifact.
83
64
 
84
- **Output.** `.build/adhoc/po-native.ipa` or `.build/adhoc/po-native.apk`, plus `.build/adhoc/SHA256SUMS` covering whichever artifacts exist. Per-step logs (mode `0600`) go to `.build/adhoc/logs/<platform>/`, and intermediate files to `.build/adhoc/work/<platform>/`.
65
+ ### TestFlight export
85
66
 
86
- ## TestFlight archive and export
87
-
88
- Use an installed **App Store Connect distribution profile** for `ai.po.app`, with Push Notifications,
89
- and the matching **Apple Distribution certificate and private key** in the local keychain. A development
90
- or ad hoc profile is not interchangeable. Run `ios:setup` first. No App Store Connect API key is needed
91
- for this local export.
67
+ Install an App Store Connect distribution profile for `ai.po.app` with Push Notifications and the matching Apple Distribution certificate/private key. Run `ios:setup`, then set:
92
68
 
93
69
  ```sh
94
- export APPLE_TEAM_ID="RYQ366PW4R"
70
+ export APPLE_TEAM_ID="YOUR_TEAM_ID"
95
71
  export PO_NATIVE_IOS_PROFILE="YOUR_APP_STORE_CONNECT_PROFILE"
96
72
  export PO_NATIVE_IOS_CODE_SIGN_IDENTITY="Apple Distribution"
97
73
  export PO_NATIVE_IOS_BUILD_NUMBER="42"
98
- export PO_NATIVE_APNS_ENVIRONMENT="production"
74
+ export PO_NATIVE_IDENTITY_ISSUER="https://your-identity-home.example"
99
75
  pnpm nx run @agimon-ai/po-native:ios:testflight
100
76
  ```
101
77
 
102
- The same command is available as `pnpm --filter @agimon-ai/po-native ios:testflight`. It reuses the
103
- local iOS archive script, defaults the signing identity to `Apple Distribution`, and supplies production
104
- APNs to prebuild. An explicitly configured sandbox environment is rejected before building.
105
- `PO_NATIVE_IOS_BUILD_NUMBER` is required, becomes Expo's `ios.buildNumber`, and must increase for each
106
- submitted build. Use a valid `CFBundleVersion`, for example `42` or `1.2.3` (first component 1-9999,
107
- remaining components 0-99). The marketing version remains `version` in `app.config.ts`.
108
-
109
- Before export, the script verifies the archive's bundle ID, build number and signed production APNs
110
- entitlement. It exports with `method: app-store-connect`, `destination: export`, manual signing, and
111
- `manageAppVersionAndBuildNumber: false`. It does not upload, submit, install, create credentials, or
112
- modify the Apple portal. Upload remains a separate, explicitly approved action.
113
-
114
- TestFlight installs have no embedded provisioning profile. When the profile environment is unavailable,
115
- the app checks the native release type and registers `production` only for App Store/TestFlight builds.
116
- Other release types still require an explicit profile environment. After pairing and allowing notifications,
117
- open the app and verify `nativePush.environment: "production"` on its trusted device record in the
118
- server's `~/.po/web/trusted-devices.json`. Do not print or share the token. This confirms enrollment,
119
- not APNs delivery.
120
-
121
- **Output:** `.build/testflight/po-native.ipa` and `.build/testflight/SHA256SUMS`. The archive and dSYMs
122
- remain under `.build/testflight/work/ios/`, with private per-step logs under `.build/testflight/logs/ios/`.
123
- Existing ad hoc and Android commands keep their methods and `.build/adhoc/` outputs. A failed build
124
- keeps the previous final IPA/APK. Command/configuration tests do not verify real signing, App Store
125
- Connect acceptance, or TestFlight push delivery.
126
-
127
- ## Native stories
128
-
129
- Each screen has a story beside it (`src/screens/*.stories.tsx`), and po-task has three `*.native.stories.tsx` stories for its native task UI. They are tagged `style-system`, `mockup`, and `native`. They render through `@agimon-ai/style-system`'s native mode: this package's `style-system.config.yaml` extends the root `native-app` preset (`bundler: vite-react-native`, `unistylesConfig: src/unistyles.ts`, dark scheme, 393 by 852 viewport). Whether style-system accepts po-task's stories, which live in another package, when rendered against this app path is unverified.
130
-
131
- ## Not yet
132
-
133
- - **Activity groups are not rendered.** Only the plain host `activity` slot is; `activity.<group>` fills such as po-task's task section do not appear.
134
- - **Threads, transient tabs, and composer context are inert placeholders.** The slot props the app passes to plugins stub `renderThread`, `openTransientTab`, `closeTransientTab`, `appendComposerDraft`, `attachComposerContext`, and `attachComposerCapture`; `sendSessionFrame`, `renderSlot`, and `slotData` are inert there too.
135
- - **A session's composition mounts only if its summary is loaded when the session is opened.** A summary that arrives later does not mount it.
136
- - **Not ported from po-web:** alerts, voice handoff, dormant transcripts, thread frames, and held channels.
137
- - **`po doctor` does not show the native build.** `po sync --check` does.
138
- - **Device runtime is unverified.** No release-mode device run has confirmed that Hermes runs `new Function`, that `react-native-quick-crypto` WebCrypto ECDSA produces the P1363 signatures the host verifies, that `expo-secure-store` biometric items prompt and invalidate as expected, or that the `expo-camera` scanner works.
139
- - **Visual fidelity is BLOCKED.** The screens and stories are mockups (`mockup` tag). Rendered appearance needs human approval of the native stories before it can be claimed.
140
- - **One paired host per phone.**
141
-
142
- ## Phase 3 native grants
143
-
144
- `accountGrants` exposes `onSessionStart` and `onJobCreated` typed hooks. Same-host work returns
145
- no grant and does not contact the account service. Cross-host work gets a 30-day, non-redelegable
146
- C5 signed by the account device key with the issuer's current revocation epoch. SecureStore keeps
147
- envelopes in issuer-specific namespaces. Opening or foregrounding the app renews unexpired grants
148
- only inside the seven-day window. An epoch change never silently renews old consent. An explicit
149
- renew action may obtain new consent after refreshing account trust.
150
-
151
- `receiveGrantPause` accepts the typed work-paused event plus the authenticated reporting host id,
152
- matches it to saved work, and supplies Home's gentle rose notice. `startLiveRuntime` accepts an
153
- optional network-authenticated `federationHostId`. The local pairing record id is not that id.
154
-
155
- Cross-host session/job creation and network host-id mapping are pending phases 5 and 7. Those
156
- callers must pass the returned envelopes to the calling host, which stores them and refreshes
157
- delegated tokens. App-open renewal currently updates the phone's saved envelopes only; host
158
- handoff and automatic job resume are not mounted yet. No public host upload route is invented.
159
- The notice deliberately says permission was renewed on this phone, not that a job resumed.
160
-
161
- Notice targets: `Native/Design/Grants`, Playground, Dark, Renewing and Retry. These remain mockups.
162
- Visual fidelity is BLOCKED pending explicit user approval, and native device behavior is unverified.
78
+ Choose the actual HTTPS identity-home origin, not the example. Production builds require it. The command supplies production APNs and rejects an explicitly configured sandbox environment. Build numbers must increase for submissions and satisfy `CFBundleVersion` (for example `42` or `1.2.3`; first component 1–9999, others 0–99). The marketing version comes from `app.config.ts`.
79
+
80
+ Before export the script checks the archive's bundle ID, build number, and signed production APNs entitlement. It uses `app-store-connect` export with manual signing. It does not create credentials, alter the Apple portal, upload, or submit. Output is `.build/testflight/po-native.ipa` with `SHA256SUMS`; archive/dSYMs and private logs remain under that directory's `work/` and `logs/` trees. Existing ad hoc outputs stay separate.
81
+
82
+ ## Push and remaining acceptance
83
+
84
+ Native push validates the installed iOS app ID and provisioning environment. App Store/TestFlight installs without an embedded profile use the native release type to select production APNs. Android uses FCM. See [server credentials](../../foundations/po-notification/README.md#native-push-server-credentials). Earlier `ai.agimon.po` iOS installs are a different identity and must be rebuilt and paired as the company app.
85
+
86
+ After pairing and granting notification permission, inspect the trusted device's enrollment on the host without printing or sharing its token. Production enrollment is not proof of APNs delivery; verify delivery on the signed installed app.
87
+
88
+ Cross-host grants are explicit, time-limited, non-redelegable consent. Phone-side renewal does not by itself prove that a host received the renewed envelope or resumed a job. Preserve that distinction in notices and acceptance reports. Historical grant targets remain `Native/Design/Grants` (Playground, Dark, Renewing, Retry); their mockup tags are not approval evidence.
89
+
90
+ The host-link guide records scoped approval evidence and unverified device behavior. Do not infer blanket visual approval, device acceptance, or full web feature parity from source, test success, or this README.
package/app.config.ts CHANGED
@@ -36,6 +36,7 @@ const config: ExpoConfig = {
36
36
  ios: {
37
37
  bundleIdentifier: 'ai.po.app',
38
38
  usesAppleSignIn: true,
39
+ infoPlist: { NSLocalNetworkUsageDescription: 'Connect to your paired Po computer on your local network.' },
39
40
  // Export compliance answer on App Store Connect: no non-exempt encryption.
40
41
  config: { usesNonExemptEncryption: false },
41
42
  ...(iosBuildNumber ? { buildNumber: iosBuildNumber } : {}),
Binary file
Binary file