@oxy.so/services 14.10.0 → 14.11.0

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 (88) hide show
  1. package/lib/commonjs/index.js +10 -0
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/boot/runProviderColdBoot.js +3 -1
  4. package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
  5. package/lib/commonjs/ui/components/OxyProvider.js +52 -18
  6. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  7. package/lib/commonjs/ui/context/OxyContext.js +15 -5
  8. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  9. package/lib/commonjs/ui/context/OxyHostedContext.js +515 -0
  10. package/lib/commonjs/ui/context/OxyHostedContext.js.map +1 -0
  11. package/lib/commonjs/ui/context/oxyRuntimeContext.js.map +1 -1
  12. package/lib/commonjs/ui/hooks/useAuth.js +13 -2
  13. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  14. package/lib/commonjs/ui/hooks/useOxyEvent.js +9 -5
  15. package/lib/commonjs/ui/hooks/useOxyEvent.js.map +1 -1
  16. package/lib/commonjs/ui/session/hostSession.js +474 -0
  17. package/lib/commonjs/ui/session/hostSession.js.map +1 -0
  18. package/lib/module/index.js +3 -0
  19. package/lib/module/index.js.map +1 -1
  20. package/lib/module/ui/boot/runProviderColdBoot.js +3 -1
  21. package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
  22. package/lib/module/ui/components/OxyProvider.js +53 -19
  23. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  24. package/lib/module/ui/context/OxyContext.js +15 -5
  25. package/lib/module/ui/context/OxyContext.js.map +1 -1
  26. package/lib/module/ui/context/OxyHostedContext.js +510 -0
  27. package/lib/module/ui/context/OxyHostedContext.js.map +1 -0
  28. package/lib/module/ui/context/oxyRuntimeContext.js.map +1 -1
  29. package/lib/module/ui/hooks/useAuth.js +13 -2
  30. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  31. package/lib/module/ui/hooks/useOxyEvent.js +9 -5
  32. package/lib/module/ui/hooks/useOxyEvent.js.map +1 -1
  33. package/lib/module/ui/session/hostSession.js +467 -0
  34. package/lib/module/ui/session/hostSession.js.map +1 -0
  35. package/lib/typescript/commonjs/index.d.ts +1 -0
  36. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  37. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +6 -0
  38. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  39. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  41. package/lib/typescript/commonjs/ui/context/OxyHostedContext.d.ts +40 -0
  42. package/lib/typescript/commonjs/ui/context/OxyHostedContext.d.ts.map +1 -0
  43. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +19 -2
  44. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/ui/context/oxyRuntimeContext.d.ts +6 -0
  46. package/lib/typescript/commonjs/ui/context/oxyRuntimeContext.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +3 -0
  48. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/ui/hooks/useOxyEvent.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/ui/session/hostSession.d.ts +69 -0
  51. package/lib/typescript/commonjs/ui/session/hostSession.d.ts.map +1 -0
  52. package/lib/typescript/commonjs/ui/types/navigation.d.ts +24 -1
  53. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts +9 -0
  55. package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts.map +1 -1
  56. package/lib/typescript/module/index.d.ts +1 -0
  57. package/lib/typescript/module/index.d.ts.map +1 -1
  58. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +6 -0
  59. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  60. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  61. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  62. package/lib/typescript/module/ui/context/OxyHostedContext.d.ts +40 -0
  63. package/lib/typescript/module/ui/context/OxyHostedContext.d.ts.map +1 -0
  64. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +19 -2
  65. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  66. package/lib/typescript/module/ui/context/oxyRuntimeContext.d.ts +6 -0
  67. package/lib/typescript/module/ui/context/oxyRuntimeContext.d.ts.map +1 -1
  68. package/lib/typescript/module/ui/hooks/useAuth.d.ts +3 -0
  69. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  70. package/lib/typescript/module/ui/hooks/useOxyEvent.d.ts.map +1 -1
  71. package/lib/typescript/module/ui/session/hostSession.d.ts +69 -0
  72. package/lib/typescript/module/ui/session/hostSession.d.ts.map +1 -0
  73. package/lib/typescript/module/ui/types/navigation.d.ts +24 -1
  74. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  75. package/lib/typescript/module/ui/utils/identityCrypto.d.ts +9 -0
  76. package/lib/typescript/module/ui/utils/identityCrypto.d.ts.map +1 -1
  77. package/package.json +4 -4
  78. package/src/index.ts +3 -0
  79. package/src/ui/boot/runProviderColdBoot.ts +12 -1
  80. package/src/ui/components/OxyProvider.tsx +77 -34
  81. package/src/ui/context/OxyContext.tsx +19 -4
  82. package/src/ui/context/OxyHostedContext.tsx +678 -0
  83. package/src/ui/context/oxyContextTypes.ts +21 -2
  84. package/src/ui/context/oxyRuntimeContext.ts +9 -1
  85. package/src/ui/hooks/useAuth.ts +13 -1
  86. package/src/ui/hooks/useOxyEvent.ts +8 -5
  87. package/src/ui/session/hostSession.ts +515 -0
  88. package/src/ui/types/navigation.ts +24 -1
@@ -4,7 +4,7 @@ import type { AccountQueriesConfig } from '../hooks/accountQueryPersistence';
4
4
  import type { RouteName } from '../navigation/routes';
5
5
  import type { User } from '@oxy.so/core';
6
6
  import type { ClientSession } from '@oxy.so/core';
7
- import type { SessionMode } from '@oxy.so/core/session';
7
+ import type { AuthStateStore, SessionMode } from '@oxy.so/core/session';
8
8
  import type { WebAuthMode } from '../oauth/types';
9
9
  import type { ProductAnalytics } from '../analytics/productAnalytics';
10
10
 
@@ -119,6 +119,13 @@ export interface OxyProviderProps {
119
119
  * skipped — it commits whichever account the IdP resolves, which is not
120
120
  * necessarily the local key's owner.
121
121
  *
122
+ * On a platform that holds the Oxy session — OxyOS, Astro — the platform
123
+ * registers a session host (`@oxy.so/core/host`, ADR 0058) before the app
124
+ * runs, and an `'account'` provider takes its session from it: the
125
+ * platform's token and account, nothing persisted, and `signIn()`,
126
+ * `openAccountDialog()`, a switch and `logout()` handed to the platform's
127
+ * own UI. The app does not choose. `'identity'` is never hosted.
128
+ *
122
129
  * Read once at mount, like `baseURL` / `oxyServices`: changing it on a
123
130
  * mounted provider does not re-bind the session.
124
131
  * @default 'account'
@@ -184,6 +191,22 @@ export interface OxyProviderProps {
184
191
  language?: OxyLanguageConfig;
185
192
  /** Persist bounded first-touch link labels and attach them only to a new account. */
186
193
  campaignAttribution?: boolean;
194
+ /**
195
+ * The seam for a PLATFORM'S SETUP CLIENT (OxyOS's login screen): where this
196
+ * provider persists the session credential instead of the platform's own
197
+ * storage. Every credential write — `{ deviceId, deviceSecret }`, the warm
198
+ * token, the sign-out marker — goes through it and nowhere else: no secure
199
+ * store, no `localStorage`, no shared device slot (the sibling-app lane is
200
+ * off) and no background credential (`backgroundSession` is ignored). The
201
+ * email-code, password and authenticator sign-ins and the "add a password"
202
+ * flow (ADR 0030) run as usual; `save()` receives the credential the moment
203
+ * a sign-in commits, so the platform can take it over.
204
+ *
205
+ * Ordinary apps never pass it. Never combined with a session host: when a
206
+ * platform has registered one (`@oxy.so/core/host`), the host wins and this
207
+ * is ignored. Read once, at mount.
208
+ */
209
+ authStateStore?: AuthStateStore;
187
210
  }
188
211
 
189
212
  export interface OxyLanguageConfig {