@everfur/sdk 0.1.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 (89) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/LICENSE +21 -0
  3. package/README.md +161 -0
  4. package/animations/package.json +8 -0
  5. package/chat/package.json +8 -0
  6. package/client/package.json +8 -0
  7. package/core/package.json +8 -0
  8. package/dist/CameraPort-Cv31Pz7g.d.cts +29 -0
  9. package/dist/CameraPort-Cv31Pz7g.d.ts +29 -0
  10. package/dist/ChatController-CKdBvPj2.d.ts +146 -0
  11. package/dist/ChatController-CpUMvvZf.d.cts +146 -0
  12. package/dist/EverfurResult-D92-uL82.d.cts +240 -0
  13. package/dist/EverfurResult-D92-uL82.d.ts +240 -0
  14. package/dist/FilePort-BabWrv7I.d.cts +22 -0
  15. package/dist/FilePort-BabWrv7I.d.ts +22 -0
  16. package/dist/PhotoController-BItt5M7u.d.cts +43 -0
  17. package/dist/PhotoController-D8zMTdcW.d.ts +43 -0
  18. package/dist/TelemetryPort-BDNr00hu.d.cts +12 -0
  19. package/dist/TelemetryPort-BDNr00hu.d.ts +12 -0
  20. package/dist/animations/index.cjs +1997 -0
  21. package/dist/animations/index.d.cts +517 -0
  22. package/dist/animations/index.d.ts +517 -0
  23. package/dist/animations/index.js +1972 -0
  24. package/dist/cacheEpoch-DknKn3S0.d.cts +36 -0
  25. package/dist/cacheEpoch-DknKn3S0.d.ts +36 -0
  26. package/dist/chat/index.cjs +1170 -0
  27. package/dist/chat/index.d.cts +59 -0
  28. package/dist/chat/index.d.ts +59 -0
  29. package/dist/chat/index.js +1167 -0
  30. package/dist/client/index.cjs +2317 -0
  31. package/dist/client/index.d.cts +65 -0
  32. package/dist/client/index.d.ts +65 -0
  33. package/dist/client/index.js +2217 -0
  34. package/dist/config-BSjBdxrZ.d.cts +501 -0
  35. package/dist/config-CiJ0PVBB.d.ts +501 -0
  36. package/dist/core/index.cjs +3175 -0
  37. package/dist/core/index.d.cts +70 -0
  38. package/dist/core/index.d.ts +70 -0
  39. package/dist/core/index.js +3163 -0
  40. package/dist/identity-Brl-lDd6.d.cts +91 -0
  41. package/dist/identity-DK9zORrG.d.ts +91 -0
  42. package/dist/ids-CJ1S6adf.d.cts +46 -0
  43. package/dist/ids-CJ1S6adf.d.ts +46 -0
  44. package/dist/index.cjs +4488 -0
  45. package/dist/index.d.cts +156 -0
  46. package/dist/index.d.ts +156 -0
  47. package/dist/index.js +4464 -0
  48. package/dist/petsRepository-BEGb97M9.d.cts +326 -0
  49. package/dist/petsRepository-Bu18r2kK.d.ts +326 -0
  50. package/dist/photo/index.cjs +2189 -0
  51. package/dist/photo/index.d.cts +43 -0
  52. package/dist/photo/index.d.ts +43 -0
  53. package/dist/photo/index.js +2186 -0
  54. package/dist/projection-CeIUsbSk.d.cts +8 -0
  55. package/dist/projection-CeIUsbSk.d.ts +8 -0
  56. package/dist/records/index.cjs +2840 -0
  57. package/dist/records/index.d.cts +224 -0
  58. package/dist/records/index.d.ts +224 -0
  59. package/dist/records/index.js +2834 -0
  60. package/dist/requestFunnel-DuUH-kAe.d.cts +28 -0
  61. package/dist/requestFunnel-dio5OmR9.d.ts +28 -0
  62. package/dist/resolve-Dq_4_agU.d.cts +86 -0
  63. package/dist/resolve-Dq_4_agU.d.ts +86 -0
  64. package/dist/runtime-BgQnA594.d.cts +349 -0
  65. package/dist/runtime-CBA-LvdM.d.ts +349 -0
  66. package/dist/server/index.cjs +533 -0
  67. package/dist/server/index.d.cts +48 -0
  68. package/dist/server/index.d.ts +48 -0
  69. package/dist/server/index.js +530 -0
  70. package/dist/testing/index.cjs +825 -0
  71. package/dist/testing/index.d.cts +113 -0
  72. package/dist/testing/index.d.ts +113 -0
  73. package/dist/testing/index.js +822 -0
  74. package/dist/testing/rn/index.cjs +449 -0
  75. package/dist/testing/rn/index.d.cts +49 -0
  76. package/dist/testing/rn/index.d.ts +49 -0
  77. package/dist/testing/rn/index.js +444 -0
  78. package/dist/video/index.cjs +1941 -0
  79. package/dist/video/index.d.cts +66 -0
  80. package/dist/video/index.d.ts +66 -0
  81. package/dist/video/index.js +1938 -0
  82. package/package.json +311 -0
  83. package/photo/package.json +8 -0
  84. package/records/package.json +8 -0
  85. package/server/device-blocked.cjs +15 -0
  86. package/server/package.json +9 -0
  87. package/testing/package.json +8 -0
  88. package/testing/rn/package.json +8 -0
  89. package/video/package.json +8 -0
@@ -0,0 +1,156 @@
1
+ import { U as UserRef, P as PetRef } from './ids-CJ1S6adf.cjs';
2
+ export { B as Brand, C as ClientId, a as ConversationId, D as DocumentId, J as JobId, R as RecordsRequestId, b as ResponseId, _ as __brand, c as conversationId, p as petRef, k as userRef } from './ids-CJ1S6adf.cjs';
3
+ export { e as EverfurConfigError, f as EverfurError, g as EverfurErrorCategory, a as EverfurErrorCode, E as EverfurResult, h as EverfurThrownError, l as categoryFor, q as isErr, r as isOk, s as isRetryableCode, w as unwrap, x as userFacingError } from './EverfurResult-D92-uL82.cjs';
4
+ import { T as TransportPort } from './config-BSjBdxrZ.cjs';
5
+ export { A as AcceptedFrame, b as AnalysisCompleteFrame, c as AnalysisStartedFrame, f as DeltaFrame, g as DoneFrame, j as ErrorFrame, E as EverfurRequest, p as EverfurRequestBase, F as Frame, s as FrameBase, t as FrameKind, H as HeartbeatFrame, u as HttpMethod, M as MultipartBody, U as UnknownFrame, G as UrgencyLevel } from './config-BSjBdxrZ.cjs';
6
+ export { T as TokenProvider } from './identity-Brl-lDd6.cjs';
7
+ import { b as CapabilityName, C as CapabilityDecision } from './resolve-Dq_4_agU.cjs';
8
+ export { a as CapabilityDisabled, c as DisabledLevel } from './resolve-Dq_4_agU.cjs';
9
+ import { K as KvPort, I as ImageCachePort } from './cacheEpoch-DknKn3S0.cjs';
10
+ import { S as SecureStorePort, m as LogSink, U as UploadPort, q as UploadTransport, j as EverfurRuntime } from './runtime-BgQnA594.cjs';
11
+ export { L as LogLevel, l as LogRecord, r as PresignedPolicy, s as UploadPolicyWire } from './runtime-BgQnA594.cjs';
12
+ import { T as TelemetryPort } from './TelemetryPort-BDNr00hu.cjs';
13
+ import { C as CameraPort } from './CameraPort-Cv31Pz7g.cjs';
14
+ export { a as CaptureOptions, M as MediaSource } from './CameraPort-Cv31Pz7g.cjs';
15
+ export { F as FileHandle, a as FilePort } from './FilePort-BabWrv7I.cjs';
16
+ import { E as ErrorPolicyPort } from './ChatController-CpUMvvZf.cjs';
17
+ export { c as ChatMessage, e as ChatStatus, f as Citation, g as SendOptions } from './ChatController-CpUMvvZf.cjs';
18
+ import { ReactNode } from 'react';
19
+ import { StyleProp, ViewStyle } from 'react-native';
20
+ export { EverfurChat, EverfurChatProps, UseEverfurChatState, useEverfurChat } from './chat/index.cjs';
21
+ import { n as EverfurTheme } from './petsRepository-BEGb97M9.cjs';
22
+ export { d as EverfurColorTokens, e as EverfurFontWeight, f as EverfurLetterSpacingTokens, g as EverfurLineHeightTokens, h as EverfurMotionDurationTokens, i as EverfurMotionTokens, j as EverfurRadiusTokens, k as EverfurSpaceTokens, l as EverfurSpringToken, m as EverfurTextColorTokens, o as EverfurThemeMeta, p as EverfurTypeSizeTokens, q as EverfurTypeTokens, r as EverfurWeightTokens } from './petsRepository-BEGb97M9.cjs';
23
+ import './requestFunnel-DuUH-kAe.cjs';
24
+
25
+ interface EverfurConfig {
26
+ /** pk_live_... ; tenant-resolved server-side (the keyless-fallback / anonymous-mode credential). */
27
+ readonly publishableKey: string;
28
+ /** REQUIRED via config or the EVERFUR_API_BASE_URL env var; the SDK ships no hardcoded host (INV-ORG-AGNOSTIC). */
29
+ readonly apiBaseUrl?: string;
30
+ /** Sent as X-Everfur-Contract; server additive-only. */
31
+ readonly contractVersion?: string;
32
+ /** Non-secret durable KV; a token is NEVER written through it. In-memory fallback when absent. */
33
+ readonly storage?: KvPort;
34
+ /** Opt-in encrypted storage, the ONLY port a token may cross to disk. Omit for memory-only tokens. */
35
+ readonly secureStore?: SecureStorePort;
36
+ /** Analytics sink; the SDK never imports PostHog/Sentry. No-op default. */
37
+ readonly telemetry?: TelemetryPort;
38
+ /** Receives ALREADY-redacted structured log records. */
39
+ readonly logSink?: LogSink;
40
+ /** Recovery decisions the host can override; a default policy is applied when absent. */
41
+ readonly errorPolicy?: ErrorPolicyPort;
42
+ /** Test seam; production builds the real transport from apiBaseUrl. */
43
+ readonly transport?: TransportPort;
44
+ /**
45
+ * Native capture seam for video / photo (an rn adapter over the camera peer). Absent =>
46
+ * capture-unavailable state, never a crash.
47
+ */
48
+ readonly camera?: CameraPort;
49
+ /** Native presigned-PUT seam for video / photo uploads. Absent => submits settle to a handled failure. */
50
+ readonly upload?: UploadPort;
51
+ /** Native S3-multipart seam for records document upload. Absent => records reads work, upload settles to a handled failure. */
52
+ readonly uploadTransport?: UploadTransport;
53
+ /** Platform image-cache seam for the animations fleet-wide epoch purge. Absent => the cosmetic purge no-ops. */
54
+ readonly imageCache?: ImageCachePort;
55
+ /** Structured, redacted LogPort events when true. */
56
+ readonly debug?: boolean;
57
+ }
58
+ /** Identity handed to the provider: the partner's opaque user id + a lazy token minter (SPEC-00 §4.3). */
59
+ interface EverfurUser {
60
+ readonly userRef: UserRef;
61
+ readonly getToken: () => Promise<string>;
62
+ }
63
+ /** Opaque, permissive theme input; server branding merges ON TOP. Hostile values are sanitized downstream. */
64
+ type EverfurThemeInput = Readonly<Record<string, string | number | boolean>>;
65
+ interface EverfurProviderProps {
66
+ readonly config: EverfurConfig;
67
+ /** Omit => general (anonymous) mode: pk alone on the wire. */
68
+ readonly user?: EverfurUser;
69
+ /** Optional default pet scope for capability hooks. */
70
+ readonly activePet?: PetRef;
71
+ readonly theme?: EverfurThemeInput;
72
+ readonly children: ReactNode;
73
+ }
74
+ /**
75
+ * Imperative handle for non-hook callers (parity with the Flutter facade). Obtained via `useEverfur()`.
76
+ * Each verb re-scopes every open capability in ONE commit through the core runtime (SPEC-10 §3).
77
+ */
78
+ interface EverfurHandle {
79
+ /** null => logout: drops the cached bearer and re-scopes every open capability. */
80
+ setUser(user: EverfurUser | null): void;
81
+ /** Re-scopes pet-bound controllers in the same commit. */
82
+ setActivePet(pet: PetRef | null): void;
83
+ /**
84
+ * Register (or update) the widget pet profile that records and consent assume exists. Without it, consent
85
+ * 404s for any pet the partner has not upserted out of band, so records is unreachable. Idempotent.
86
+ */
87
+ registerPet: EverfurRuntime['registerPet'];
88
+ /** Navigate / mount a prebuilt capability screen (host-routed via the runtime). */
89
+ open(capability: CapabilityName): void;
90
+ /**
91
+ * == setUser(null); additionally sweeps the SDK's genuinely per-user durable KV keys (the explicit
92
+ * PER_USER_KV_KEYS allowlist, EMPTY today; device-global keys are NOT swept). Returns a promise so a host
93
+ * can `await handle.logout()` before `setUser(nextUser)`.
94
+ */
95
+ logout(): Promise<void>;
96
+ }
97
+ /**
98
+ * Wrap the tree ONCE, high. Mounting constructs the runtime (transport, identity, registry,
99
+ * entitlement repository, pollers) exactly once and starts fail-closed: a bad manifest/entitlement
100
+ * fetch falls to the compiled default and children render immediately, never a blank screen.
101
+ * A config that cannot be resolved yields a DISABLED runtime (children still render, every capability
102
+ * off at `sdk_config`), never a throw: see `createEverfurRuntime`.
103
+ */
104
+ declare function EverfurProvider(props: EverfurProviderProps): ReactNode;
105
+ /**
106
+ * The imperative facade handle for non-hook callers.
107
+ * @throws {EverfurConfigError} kind 'not-initialized' if called outside an EverfurProvider.
108
+ */
109
+ declare function useEverfur(): EverfurHandle;
110
+
111
+ /**
112
+ * Read the resolved verdict for a coarse capability.
113
+ *
114
+ * During the first resolve (or while a stale value is being revalidated) the store reports
115
+ * `isPending`, and this returns `{ enabled:false, isPending:true }` so a gated surface shows a
116
+ * skeleton, never a flash of enabled UI it must retract. A kill-switch flip propagates through the
117
+ * store's revision poller and re-renders every subscriber in <2s. Never throws for a resolution
118
+ * failure (fail-closed: an absent verdict reads as denied).
119
+ */
120
+ declare function useCapability(name: CapabilityName): CapabilityDecision;
121
+
122
+ interface CapabilityGateProps {
123
+ readonly capability: CapabilityName;
124
+ readonly children: ReactNode;
125
+ /** Override the default OffState. Receives the resolved decision (carries SAFE `disabled` copy). */
126
+ readonly renderDisabled?: (decision: CapabilityDecision) => ReactNode;
127
+ /** Override the default pending skeleton. */
128
+ readonly renderPending?: () => ReactNode;
129
+ readonly style?: StyleProp<ViewStyle>;
130
+ }
131
+ declare function CapabilityGate(props: CapabilityGateProps): ReactNode;
132
+
133
+ /**
134
+ * Read the resolved Everfur theme. Returns a COMPLETE, legible, deeply-frozen theme in every case - inside a
135
+ * provider it is the server-resolved theme; outside one it is the compiled Everfur default (never null, never
136
+ * blank). Read a token as `theme.color.brand`, `theme.space.md`, `theme.type.size.body`, `theme.radius.lg`.
137
+ */
138
+ declare function useEverfurTheme(): EverfurTheme;
139
+
140
+ interface EverfurThemeProviderProps {
141
+ /**
142
+ * The clamped client `theme` prop, a first-paint/offline fallback merged UNDER the server branding. Any
143
+ * shape is tolerated (parsed defensively); unknown keys are ignored. Omit for the compiled default.
144
+ */
145
+ readonly clientTheme?: EverfurThemeInput | null;
146
+ readonly children: ReactNode;
147
+ }
148
+ /**
149
+ * Compute + publish the resolved theme. Reads server branding off the runtime entitlement store (the same
150
+ * useSyncExternalStore path `useCapability` uses), the device color scheme, and reduced-motion, then merges
151
+ * the clamped client prop UNDER the server via the pure `resolveTheme`. Recomputes only when one of those
152
+ * inputs changes; a plain re-render reuses the frozen theme.
153
+ */
154
+ declare function EverfurThemeProvider(props: EverfurThemeProviderProps): ReactNode;
155
+
156
+ export { CameraPort, CapabilityDecision, CapabilityGate, type CapabilityGateProps, CapabilityName, ErrorPolicyPort, type EverfurConfig, type EverfurHandle, EverfurProvider, type EverfurProviderProps, EverfurTheme, type EverfurThemeInput, EverfurThemeProvider, type EverfurThemeProviderProps, type EverfurUser, ImageCachePort, KvPort, LogSink, PetRef, SecureStorePort, TelemetryPort, TransportPort, UploadPort, UploadTransport, UserRef, useCapability, useEverfur, useEverfurTheme };
@@ -0,0 +1,156 @@
1
+ import { U as UserRef, P as PetRef } from './ids-CJ1S6adf.js';
2
+ export { B as Brand, C as ClientId, a as ConversationId, D as DocumentId, J as JobId, R as RecordsRequestId, b as ResponseId, _ as __brand, c as conversationId, p as petRef, k as userRef } from './ids-CJ1S6adf.js';
3
+ export { e as EverfurConfigError, f as EverfurError, g as EverfurErrorCategory, a as EverfurErrorCode, E as EverfurResult, h as EverfurThrownError, l as categoryFor, q as isErr, r as isOk, s as isRetryableCode, w as unwrap, x as userFacingError } from './EverfurResult-D92-uL82.js';
4
+ import { T as TransportPort } from './config-CiJ0PVBB.js';
5
+ export { A as AcceptedFrame, b as AnalysisCompleteFrame, c as AnalysisStartedFrame, f as DeltaFrame, g as DoneFrame, j as ErrorFrame, E as EverfurRequest, p as EverfurRequestBase, F as Frame, s as FrameBase, t as FrameKind, H as HeartbeatFrame, u as HttpMethod, M as MultipartBody, U as UnknownFrame, G as UrgencyLevel } from './config-CiJ0PVBB.js';
6
+ export { T as TokenProvider } from './identity-DK9zORrG.js';
7
+ import { b as CapabilityName, C as CapabilityDecision } from './resolve-Dq_4_agU.js';
8
+ export { a as CapabilityDisabled, c as DisabledLevel } from './resolve-Dq_4_agU.js';
9
+ import { K as KvPort, I as ImageCachePort } from './cacheEpoch-DknKn3S0.js';
10
+ import { S as SecureStorePort, m as LogSink, U as UploadPort, q as UploadTransport, j as EverfurRuntime } from './runtime-CBA-LvdM.js';
11
+ export { L as LogLevel, l as LogRecord, r as PresignedPolicy, s as UploadPolicyWire } from './runtime-CBA-LvdM.js';
12
+ import { T as TelemetryPort } from './TelemetryPort-BDNr00hu.js';
13
+ import { C as CameraPort } from './CameraPort-Cv31Pz7g.js';
14
+ export { a as CaptureOptions, M as MediaSource } from './CameraPort-Cv31Pz7g.js';
15
+ export { F as FileHandle, a as FilePort } from './FilePort-BabWrv7I.js';
16
+ import { E as ErrorPolicyPort } from './ChatController-CKdBvPj2.js';
17
+ export { c as ChatMessage, e as ChatStatus, f as Citation, g as SendOptions } from './ChatController-CKdBvPj2.js';
18
+ import { ReactNode } from 'react';
19
+ import { StyleProp, ViewStyle } from 'react-native';
20
+ export { EverfurChat, EverfurChatProps, UseEverfurChatState, useEverfurChat } from './chat/index.js';
21
+ import { n as EverfurTheme } from './petsRepository-Bu18r2kK.js';
22
+ export { d as EverfurColorTokens, e as EverfurFontWeight, f as EverfurLetterSpacingTokens, g as EverfurLineHeightTokens, h as EverfurMotionDurationTokens, i as EverfurMotionTokens, j as EverfurRadiusTokens, k as EverfurSpaceTokens, l as EverfurSpringToken, m as EverfurTextColorTokens, o as EverfurThemeMeta, p as EverfurTypeSizeTokens, q as EverfurTypeTokens, r as EverfurWeightTokens } from './petsRepository-Bu18r2kK.js';
23
+ import './requestFunnel-dio5OmR9.js';
24
+
25
+ interface EverfurConfig {
26
+ /** pk_live_... ; tenant-resolved server-side (the keyless-fallback / anonymous-mode credential). */
27
+ readonly publishableKey: string;
28
+ /** REQUIRED via config or the EVERFUR_API_BASE_URL env var; the SDK ships no hardcoded host (INV-ORG-AGNOSTIC). */
29
+ readonly apiBaseUrl?: string;
30
+ /** Sent as X-Everfur-Contract; server additive-only. */
31
+ readonly contractVersion?: string;
32
+ /** Non-secret durable KV; a token is NEVER written through it. In-memory fallback when absent. */
33
+ readonly storage?: KvPort;
34
+ /** Opt-in encrypted storage, the ONLY port a token may cross to disk. Omit for memory-only tokens. */
35
+ readonly secureStore?: SecureStorePort;
36
+ /** Analytics sink; the SDK never imports PostHog/Sentry. No-op default. */
37
+ readonly telemetry?: TelemetryPort;
38
+ /** Receives ALREADY-redacted structured log records. */
39
+ readonly logSink?: LogSink;
40
+ /** Recovery decisions the host can override; a default policy is applied when absent. */
41
+ readonly errorPolicy?: ErrorPolicyPort;
42
+ /** Test seam; production builds the real transport from apiBaseUrl. */
43
+ readonly transport?: TransportPort;
44
+ /**
45
+ * Native capture seam for video / photo (an rn adapter over the camera peer). Absent =>
46
+ * capture-unavailable state, never a crash.
47
+ */
48
+ readonly camera?: CameraPort;
49
+ /** Native presigned-PUT seam for video / photo uploads. Absent => submits settle to a handled failure. */
50
+ readonly upload?: UploadPort;
51
+ /** Native S3-multipart seam for records document upload. Absent => records reads work, upload settles to a handled failure. */
52
+ readonly uploadTransport?: UploadTransport;
53
+ /** Platform image-cache seam for the animations fleet-wide epoch purge. Absent => the cosmetic purge no-ops. */
54
+ readonly imageCache?: ImageCachePort;
55
+ /** Structured, redacted LogPort events when true. */
56
+ readonly debug?: boolean;
57
+ }
58
+ /** Identity handed to the provider: the partner's opaque user id + a lazy token minter (SPEC-00 §4.3). */
59
+ interface EverfurUser {
60
+ readonly userRef: UserRef;
61
+ readonly getToken: () => Promise<string>;
62
+ }
63
+ /** Opaque, permissive theme input; server branding merges ON TOP. Hostile values are sanitized downstream. */
64
+ type EverfurThemeInput = Readonly<Record<string, string | number | boolean>>;
65
+ interface EverfurProviderProps {
66
+ readonly config: EverfurConfig;
67
+ /** Omit => general (anonymous) mode: pk alone on the wire. */
68
+ readonly user?: EverfurUser;
69
+ /** Optional default pet scope for capability hooks. */
70
+ readonly activePet?: PetRef;
71
+ readonly theme?: EverfurThemeInput;
72
+ readonly children: ReactNode;
73
+ }
74
+ /**
75
+ * Imperative handle for non-hook callers (parity with the Flutter facade). Obtained via `useEverfur()`.
76
+ * Each verb re-scopes every open capability in ONE commit through the core runtime (SPEC-10 §3).
77
+ */
78
+ interface EverfurHandle {
79
+ /** null => logout: drops the cached bearer and re-scopes every open capability. */
80
+ setUser(user: EverfurUser | null): void;
81
+ /** Re-scopes pet-bound controllers in the same commit. */
82
+ setActivePet(pet: PetRef | null): void;
83
+ /**
84
+ * Register (or update) the widget pet profile that records and consent assume exists. Without it, consent
85
+ * 404s for any pet the partner has not upserted out of band, so records is unreachable. Idempotent.
86
+ */
87
+ registerPet: EverfurRuntime['registerPet'];
88
+ /** Navigate / mount a prebuilt capability screen (host-routed via the runtime). */
89
+ open(capability: CapabilityName): void;
90
+ /**
91
+ * == setUser(null); additionally sweeps the SDK's genuinely per-user durable KV keys (the explicit
92
+ * PER_USER_KV_KEYS allowlist, EMPTY today; device-global keys are NOT swept). Returns a promise so a host
93
+ * can `await handle.logout()` before `setUser(nextUser)`.
94
+ */
95
+ logout(): Promise<void>;
96
+ }
97
+ /**
98
+ * Wrap the tree ONCE, high. Mounting constructs the runtime (transport, identity, registry,
99
+ * entitlement repository, pollers) exactly once and starts fail-closed: a bad manifest/entitlement
100
+ * fetch falls to the compiled default and children render immediately, never a blank screen.
101
+ * A config that cannot be resolved yields a DISABLED runtime (children still render, every capability
102
+ * off at `sdk_config`), never a throw: see `createEverfurRuntime`.
103
+ */
104
+ declare function EverfurProvider(props: EverfurProviderProps): ReactNode;
105
+ /**
106
+ * The imperative facade handle for non-hook callers.
107
+ * @throws {EverfurConfigError} kind 'not-initialized' if called outside an EverfurProvider.
108
+ */
109
+ declare function useEverfur(): EverfurHandle;
110
+
111
+ /**
112
+ * Read the resolved verdict for a coarse capability.
113
+ *
114
+ * During the first resolve (or while a stale value is being revalidated) the store reports
115
+ * `isPending`, and this returns `{ enabled:false, isPending:true }` so a gated surface shows a
116
+ * skeleton, never a flash of enabled UI it must retract. A kill-switch flip propagates through the
117
+ * store's revision poller and re-renders every subscriber in <2s. Never throws for a resolution
118
+ * failure (fail-closed: an absent verdict reads as denied).
119
+ */
120
+ declare function useCapability(name: CapabilityName): CapabilityDecision;
121
+
122
+ interface CapabilityGateProps {
123
+ readonly capability: CapabilityName;
124
+ readonly children: ReactNode;
125
+ /** Override the default OffState. Receives the resolved decision (carries SAFE `disabled` copy). */
126
+ readonly renderDisabled?: (decision: CapabilityDecision) => ReactNode;
127
+ /** Override the default pending skeleton. */
128
+ readonly renderPending?: () => ReactNode;
129
+ readonly style?: StyleProp<ViewStyle>;
130
+ }
131
+ declare function CapabilityGate(props: CapabilityGateProps): ReactNode;
132
+
133
+ /**
134
+ * Read the resolved Everfur theme. Returns a COMPLETE, legible, deeply-frozen theme in every case - inside a
135
+ * provider it is the server-resolved theme; outside one it is the compiled Everfur default (never null, never
136
+ * blank). Read a token as `theme.color.brand`, `theme.space.md`, `theme.type.size.body`, `theme.radius.lg`.
137
+ */
138
+ declare function useEverfurTheme(): EverfurTheme;
139
+
140
+ interface EverfurThemeProviderProps {
141
+ /**
142
+ * The clamped client `theme` prop, a first-paint/offline fallback merged UNDER the server branding. Any
143
+ * shape is tolerated (parsed defensively); unknown keys are ignored. Omit for the compiled default.
144
+ */
145
+ readonly clientTheme?: EverfurThemeInput | null;
146
+ readonly children: ReactNode;
147
+ }
148
+ /**
149
+ * Compute + publish the resolved theme. Reads server branding off the runtime entitlement store (the same
150
+ * useSyncExternalStore path `useCapability` uses), the device color scheme, and reduced-motion, then merges
151
+ * the clamped client prop UNDER the server via the pure `resolveTheme`. Recomputes only when one of those
152
+ * inputs changes; a plain re-render reuses the frozen theme.
153
+ */
154
+ declare function EverfurThemeProvider(props: EverfurThemeProviderProps): ReactNode;
155
+
156
+ export { CameraPort, CapabilityDecision, CapabilityGate, type CapabilityGateProps, CapabilityName, ErrorPolicyPort, type EverfurConfig, type EverfurHandle, EverfurProvider, type EverfurProviderProps, EverfurTheme, type EverfurThemeInput, EverfurThemeProvider, type EverfurThemeProviderProps, type EverfurUser, ImageCachePort, KvPort, LogSink, PetRef, SecureStorePort, TelemetryPort, TransportPort, UploadPort, UploadTransport, UserRef, useCapability, useEverfur, useEverfurTheme };