@llmnative/react 0.1.1 → 1.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 (185) hide show
  1. package/README.md +397 -364
  2. package/bin/cli.js +117 -98
  3. package/dist/index.css +1 -1
  4. package/dist/index.js +21 -823
  5. package/dist/index.mjs +14984 -9345
  6. package/dist/style.css +1 -0
  7. package/dist/types/src/App.d.ts +75 -14
  8. package/dist/types/src/Config.d.ts +28 -5
  9. package/dist/types/src/Global.d.ts +2 -2
  10. package/dist/types/src/I18n.d.ts +186 -0
  11. package/dist/types/src/Theme.d.ts +153 -81
  12. package/dist/types/src/auth.d.ts +13 -1
  13. package/dist/types/src/components/Component.d.ts +13 -27
  14. package/dist/types/src/components/ErrorBoundary.d.ts +30 -0
  15. package/dist/types/src/components/blocks/Brand.d.ts +9 -4
  16. package/dist/types/src/components/blocks/Breadcrumbs.d.ts +50 -4
  17. package/dist/types/src/components/blocks/Carousel.d.ts +7 -5
  18. package/dist/types/src/components/blocks/Dropdown.d.ts +38 -20
  19. package/dist/types/src/components/blocks/ListCard.d.ts +38 -0
  20. package/dist/types/src/components/blocks/Menu.d.ts +15 -16
  21. package/dist/types/src/components/blocks/Notifications.d.ts +11 -3
  22. package/dist/types/src/components/blocks/ProviderSwitcher.d.ts +65 -0
  23. package/dist/types/src/components/blocks/Search.d.ts +3 -2
  24. package/dist/types/src/components/blocks/SideNav.d.ts +45 -0
  25. package/dist/types/src/components/blocks/ThemeSwitcher.d.ts +28 -0
  26. package/dist/types/src/components/blocks/Toolbar.d.ts +23 -0
  27. package/dist/types/src/components/index.d.ts +28 -7
  28. package/dist/types/src/components/types.d.ts +10 -3
  29. package/dist/types/src/components/ui/Alert.d.ts +20 -4
  30. package/dist/types/src/components/ui/Badge.d.ts +12 -5
  31. package/dist/types/src/components/ui/Buttons.d.ts +16 -12
  32. package/dist/types/src/components/ui/Card.d.ts +11 -7
  33. package/dist/types/src/components/ui/Code.d.ts +5 -1
  34. package/dist/types/src/components/ui/Gallery.d.ts +16 -16
  35. package/dist/types/src/components/ui/GridSystem.d.ts +5 -2
  36. package/dist/types/src/components/ui/Icon.d.ts +6 -1
  37. package/dist/types/src/components/ui/Image.d.ts +7 -1
  38. package/dist/types/src/components/ui/ImageAvatar.d.ts +4 -1
  39. package/dist/types/src/components/ui/Loader.d.ts +3 -1
  40. package/dist/types/src/components/ui/LocaleSwitcher.d.ts +14 -0
  41. package/dist/types/src/components/ui/Modal.d.ts +46 -15
  42. package/dist/types/src/components/ui/Pagination.d.ts +16 -3
  43. package/dist/types/src/components/ui/Percentage.d.ts +14 -5
  44. package/dist/types/src/components/ui/Repeat.d.ts +14 -6
  45. package/dist/types/src/components/ui/Tab.d.ts +29 -2
  46. package/dist/types/src/components/ui/TabDynamic.d.ts +4 -3
  47. package/dist/types/src/components/ui/Table.d.ts +18 -14
  48. package/dist/types/src/components/ui/fields/CodeEditor.d.ts +46 -0
  49. package/dist/types/src/components/ui/fields/ContextMenu.d.ts +87 -0
  50. package/dist/types/src/components/ui/fields/Crop.d.ts +4 -2
  51. package/dist/types/src/components/ui/fields/ImageField.d.ts +31 -0
  52. package/dist/types/src/components/ui/fields/Input.d.ts +43 -14
  53. package/dist/types/src/components/ui/fields/Prompt.d.ts +2 -31
  54. package/dist/types/src/components/ui/fields/RichText.d.ts +89 -0
  55. package/dist/types/src/components/ui/fields/Select.d.ts +13 -10
  56. package/dist/types/src/components/ui/fields/Upload.d.ts +50 -2
  57. package/dist/types/src/components/ui/fields/UploadCSV.d.ts +2 -0
  58. package/dist/types/src/components/ui/useRecordSelection.d.ts +1 -2
  59. package/dist/types/src/components/widgets/Form.d.ts +80 -43
  60. package/dist/types/src/components/widgets/ImageEditor.d.ts +4 -5
  61. package/dist/types/src/components/widgets/MarkdownReader.d.ts +4 -4
  62. package/dist/types/src/components/widgets/Prompt.d.ts +90 -22
  63. package/dist/types/src/components/widgets/TabDynamic.d.ts +4 -3
  64. package/dist/types/src/components/widgets/form-controller.d.ts +42 -0
  65. package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +1 -1
  66. package/dist/types/src/components/widgets/grid-core/GridDB.d.ts +1 -1
  67. package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +1 -1
  68. package/dist/types/src/components/widgets/grid-core/GridTableView.d.ts +1 -1
  69. package/dist/types/src/components/widgets/grid-core/types.d.ts +77 -27
  70. package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +4 -8
  71. package/dist/types/src/components/widgets/grid-core/useGridColumns.d.ts +2 -2
  72. package/dist/types/src/components/widgets/grid-core/useGridDBRecords.d.ts +1 -2
  73. package/dist/types/src/components/widgets/grid-core/useGridPreparedRecords.d.ts +2 -2
  74. package/dist/types/src/components/widgets/grid-core/useGridSelection.d.ts +4 -5
  75. package/dist/types/src/components/widgets/grid-core/utils.d.ts +11 -3
  76. package/dist/types/src/conf/Prompt.d.ts +1 -1
  77. package/dist/types/src/conf/i18n/ar.d.ts +2 -0
  78. package/dist/types/src/conf/i18n/de.d.ts +2 -0
  79. package/dist/types/src/conf/i18n/en.d.ts +2 -0
  80. package/dist/types/src/conf/i18n/index.d.ts +6 -0
  81. package/dist/types/src/conf/i18n/it.d.ts +2 -0
  82. package/dist/types/src/conf/i18n/ru.d.ts +2 -0
  83. package/dist/types/src/conf/i18n/zh.d.ts +2 -0
  84. package/dist/types/src/constant.d.ts +1 -1
  85. package/dist/types/src/index.d.ts +48 -13
  86. package/dist/types/src/libs/converter.d.ts +4 -4
  87. package/dist/types/src/libs/editorHeight.d.ts +12 -0
  88. package/dist/types/src/libs/fetch.d.ts +4 -4
  89. package/dist/types/src/libs/imageBuilder.d.ts +63 -14
  90. package/dist/types/src/libs/imageVariants.d.ts +35 -0
  91. package/dist/types/src/libs/index.d.ts +1 -4
  92. package/dist/types/src/libs/promptUtils.d.ts +24 -0
  93. package/dist/types/src/libs/sanitizer.d.ts +2 -2
  94. package/dist/types/src/libs/utils.d.ts +9 -10
  95. package/dist/types/src/pages/index.d.ts +0 -2
  96. package/dist/types/src/providers/ProviderConfiguration.d.ts +6 -0
  97. package/dist/types/src/providers/ProviderDescriptor.d.ts +18 -0
  98. package/dist/types/src/providers/ProviderRegistryContext.d.ts +51 -0
  99. package/dist/types/src/providers/ProviderSession.d.ts +68 -0
  100. package/dist/types/src/providers/ai/AIProvider.d.ts +57 -0
  101. package/dist/types/src/providers/ai/AIProviderContext.d.ts +13 -0
  102. package/dist/types/src/providers/ai/anthropic.d.ts +2 -0
  103. package/dist/types/src/providers/ai/deepseek.d.ts +1 -0
  104. package/dist/types/src/providers/ai/gemini.d.ts +2 -0
  105. package/dist/types/src/providers/ai/glm.d.ts +1 -0
  106. package/dist/types/src/providers/ai/index.d.ts +20 -134
  107. package/dist/types/src/providers/ai/mistral.d.ts +1 -0
  108. package/dist/types/src/providers/ai/openai.d.ts +1 -0
  109. package/dist/types/src/providers/ai/openaiCompatible.d.ts +19 -0
  110. package/dist/types/src/providers/ai/opencode.d.ts +2 -0
  111. package/dist/types/src/providers/ai/openrouter.d.ts +1 -0
  112. package/dist/types/src/providers/ai/shared.d.ts +55 -0
  113. package/dist/types/src/providers/api/ApiProvider.d.ts +43 -0
  114. package/dist/types/src/providers/api/direct.d.ts +14 -0
  115. package/dist/types/src/providers/api/firebase.d.ts +14 -0
  116. package/dist/types/src/providers/api/mock.d.ts +7 -0
  117. package/dist/types/src/providers/api/supabase.d.ts +14 -0
  118. package/dist/types/src/providers/auth/AuthProvider.d.ts +10 -2
  119. package/dist/types/src/providers/auth/firebase/FirebaseAuthProvider.d.ts +49 -0
  120. package/dist/types/src/providers/auth/google/GoogleAuth.d.ts +2 -2
  121. package/dist/types/src/providers/auth/supabase/SupabaseAuthProvider.d.ts +48 -0
  122. package/dist/types/src/providers/credentials/CredentialsProvider.d.ts +3 -0
  123. package/dist/types/src/providers/credentials/CredentialsProviderContext.d.ts +12 -0
  124. package/dist/types/src/providers/credentials/google/GoogleServiceAccountProvider.d.ts +8 -0
  125. package/dist/types/src/providers/data/DataProvider.d.ts +27 -1
  126. package/dist/types/src/providers/data/firebase.d.ts +5 -4
  127. package/dist/types/src/providers/data/firestore.d.ts +45 -0
  128. package/dist/types/src/providers/data/mock.d.ts +8 -1
  129. package/dist/types/src/providers/data/supabase.d.ts +36 -10
  130. package/dist/types/src/providers/email/definitions.d.ts +3 -0
  131. package/dist/types/src/providers/firebase-init.d.ts +24 -7
  132. package/dist/types/src/providers/icon/PhosphorIconProvider.d.ts +1 -1
  133. package/dist/types/src/providers/manifest.d.ts +20 -14
  134. package/dist/types/src/providers/proxy/index.d.ts +7 -0
  135. package/dist/types/src/providers/proxy/vite.d.ts +3 -0
  136. package/dist/types/src/providers/publish/PublishProvider.d.ts +29 -0
  137. package/dist/types/src/providers/publish/definitions.d.ts +3 -0
  138. package/dist/types/src/providers/scrape/index.d.ts +2 -1
  139. package/dist/types/src/providers/seo/google/keyword.d.ts +6 -1
  140. package/dist/types/src/providers/storage/StorageProvider.d.ts +155 -4
  141. package/dist/types/src/providers/storage/dropbox.d.ts +3 -3
  142. package/dist/types/src/providers/storage/firebase.d.ts +44 -7
  143. package/dist/types/src/providers/storage/supabase.d.ts +47 -7
  144. package/dist/types/src/providers/supabase-init.d.ts +35 -0
  145. package/dist/types/src/types/FormFields.d.ts +4 -2
  146. package/dist/types/src/types/FormSchema.d.ts +29 -0
  147. package/dist/types/themes/tokyo-night-light.d.ts +3 -0
  148. package/dist/types/themes/tokyo-night.d.ts +3 -0
  149. package/dist/types/themes/vscode-dark-plus.d.ts +3 -0
  150. package/dist/types/themes/vscode-light-plus.d.ts +3 -0
  151. package/dist/vite.js +1 -0
  152. package/dist/vite.mjs +54 -0
  153. package/package.json +46 -8
  154. package/scripts/cli/proxy-templates/cloudflare.ts +34 -0
  155. package/scripts/cli/proxy-templates/express.ts +77 -0
  156. package/scripts/cli/proxy-templates/nextjs-app.ts +42 -0
  157. package/scripts/cli/proxy-templates/nextjs-pages.ts +41 -0
  158. package/scripts/cli/proxy-templates/scaffold.json +33 -0
  159. package/scripts/cli/setup-devtools.js +155 -85
  160. package/scripts/cli/setup-project.js +618 -484
  161. package/themes/cyber.ts +469 -405
  162. package/themes/default.ts +469 -405
  163. package/themes/flat.ts +469 -405
  164. package/themes/tokyo-night-light.ts +38 -0
  165. package/themes/tokyo-night.ts +38 -0
  166. package/themes/vscode-dark-plus.ts +29 -0
  167. package/themes/vscode-light-plus.ts +29 -0
  168. package/dist/index.js.map +0 -1
  169. package/dist/index.mjs.map +0 -1
  170. package/dist/types/src/components/FormEnhancer.d.ts +0 -26
  171. package/dist/types/src/components/Template.d.ts +0 -18
  172. package/dist/types/src/components/ui/fields/AssistantAI.d.ts +0 -23
  173. package/dist/types/src/components/ui/fields/Command.d.ts +0 -15
  174. package/dist/types/src/components/ui/fields/ImageUrl.d.ts +0 -7
  175. package/dist/types/src/libs/cache.d.ts +0 -9
  176. package/dist/types/src/libs/database.d.ts +0 -3
  177. package/dist/types/src/libs/log.d.ts +0 -2
  178. package/dist/types/src/libs/seo.d.ts +0 -8
  179. package/dist/types/src/libs/storage.d.ts +0 -2
  180. package/dist/types/src/pages/Blog.d.ts +0 -3
  181. package/dist/types/src/pages/BlogPost.d.ts +0 -16
  182. package/dist/types/src/pages/Helper.d.ts +0 -8
  183. package/dist/types/src/providers/auth/google/apis/auth.d.ts +0 -4
  184. package/dist/types/src/types/Block.d.ts +0 -4
  185. package/dist/types/src/types/Section.d.ts +0 -4
@@ -0,0 +1,49 @@
1
+ import type { AuthProviderAdapter, AuthSignInOptions, UserProfile } from '../AuthProvider';
2
+ import type { ProviderConfigurationState } from '../../ProviderConfiguration';
3
+ import type { FirebaseConfig } from '../../../Config';
4
+ /**
5
+ * Firebase-specific sign-in options.
6
+ *
7
+ * method: 'password' (default) | 'anonymous' | 'oauth'
8
+ * email + password: required when method = 'password'
9
+ * provider: required when method = 'oauth' - e.g. 'github', 'apple', 'microsoft'
10
+ * Note: for Google OAuth use GoogleAuthProvider, not FirebaseAuthProvider.
11
+ */
12
+ export interface FirebaseSignInOptions extends AuthSignInOptions {
13
+ method?: 'password' | 'anonymous' | 'oauth';
14
+ email?: string;
15
+ password?: string;
16
+ provider?: string;
17
+ }
18
+ export interface FirebaseAuthProviderOptions {
19
+ /**
20
+ * Static config for this provider's own Firebase app. Omit when relying on
21
+ * another consumer (e.g. providers.firebase + FirebaseDataProvider, or the
22
+ * tenant-switching session factories in ProviderSession.tsx) to have already
23
+ * initialized the target app — matches the provider's original zero-arg behavior.
24
+ */
25
+ config?: FirebaseConfig;
26
+ /**
27
+ * Firebase app name this provider's session lives under. Defaults to the SDK's
28
+ * unnamed default app. Give this a dedicated name (e.g. 'control-plane') when a
29
+ * long-lived login session must coexist with the default app used by tenant
30
+ * switching — ProviderSession's 'data'/'storage' firebase factories reinitialize
31
+ * the default app on every switch, which would otherwise tear down this session.
32
+ */
33
+ appName?: string;
34
+ }
35
+ export declare class FirebaseAuthProvider implements AuthProviderAdapter {
36
+ private readonly options;
37
+ private readonly appName?;
38
+ private readonly initPromise;
39
+ constructor(options?: FirebaseAuthProviderOptions);
40
+ getConfigurationState(): ProviderConfigurationState;
41
+ isConfigured(): boolean;
42
+ getUser(): UserProfile | null;
43
+ isAuthenticated(): boolean;
44
+ signIn(options?: FirebaseSignInOptions): Promise<UserProfile | null>;
45
+ signOut(): Promise<void>;
46
+ onAuthChange(callback: (user: UserProfile | null) => void): () => void;
47
+ getAccessToken(): Promise<string>;
48
+ getIdTokenClaims(): Promise<Record<string, unknown> | null>;
49
+ }
@@ -4,9 +4,9 @@ declare global {
4
4
  google: {
5
5
  accounts: {
6
6
  id: {
7
- initialize: (options: any) => void;
7
+ initialize: (options: Record<string, unknown>) => void;
8
8
  prompt: (callback?: () => void) => void;
9
- renderButton: (element: HTMLElement, options: any) => void;
9
+ renderButton: (element: HTMLElement, options: Record<string, unknown>) => void;
10
10
  disableAutoSelect: () => void;
11
11
  revoke: (hint: string, callback?: () => void) => void;
12
12
  };
@@ -0,0 +1,48 @@
1
+ import type { AuthProviderAdapter, AuthSignInOptions, UserProfile } from '../AuthProvider';
2
+ import type { ProviderConfigurationState } from '../../ProviderConfiguration';
3
+ export interface SupabaseAuthConfig {
4
+ url: string;
5
+ anonKey: string;
6
+ }
7
+ /**
8
+ * Supabase-specific sign-in options.
9
+ * Passed as part of `AuthSignInOptions` (open `[key: string]: any` index signature).
10
+ *
11
+ * method: 'password' (default) | 'magic_link' | 'oauth' | 'anonymous'
12
+ * email: required for 'password' and 'magic_link'
13
+ * password: required for 'password'
14
+ * provider: required for 'oauth' - e.g. 'github', 'google', 'apple', 'twitter'
15
+ * redirectTo: optional - overrides the redirect URL after OAuth / magic link
16
+ */
17
+ export interface SupabaseSignInOptions extends AuthSignInOptions {
18
+ method?: 'password' | 'magic_link' | 'oauth' | 'anonymous';
19
+ email?: string;
20
+ password?: string;
21
+ provider?: string;
22
+ redirectTo?: string;
23
+ }
24
+ export declare class SupabaseAuthProvider implements AuthProviderAdapter {
25
+ private config;
26
+ private get client();
27
+ constructor(config: SupabaseAuthConfig);
28
+ getConfigurationState(): ProviderConfigurationState;
29
+ isConfigured(): boolean;
30
+ /**
31
+ * Returns the currently cached session user (synchronous, no network call).
32
+ * Returns null if no active session.
33
+ */
34
+ getUser(): UserProfile | null;
35
+ isAuthenticated(): boolean;
36
+ /**
37
+ * Authenticate with Supabase.
38
+ *
39
+ * options.method = 'password' (default): email + password sign-in
40
+ * options.method = 'magic_link': OTP email - returns null (email sent, no user yet)
41
+ * options.method = 'oauth': redirect flow - returns null (user arrives after redirect)
42
+ * options.method = 'anonymous': anonymous session
43
+ */
44
+ signIn(options?: SupabaseSignInOptions): Promise<UserProfile | null>;
45
+ signOut(): Promise<void>;
46
+ onAuthChange(callback: (user: UserProfile | null) => void): () => void;
47
+ getAccessToken(): Promise<string>;
48
+ }
@@ -0,0 +1,3 @@
1
+ export interface CredentialsAdapter {
2
+ getToken(scope?: string): Promise<string>;
3
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { CredentialsAdapter } from './CredentialsProvider';
3
+ type CredentialsProviderContextValue = {
4
+ registry: Record<string, CredentialsAdapter>;
5
+ defaultKey: string;
6
+ };
7
+ declare const CredentialsProviderContext: React.Context<CredentialsProviderContextValue | null>;
8
+ export declare const CredentialsProvider: ({ registry, defaultKey, children, }: CredentialsProviderContextValue & {
9
+ children: React.ReactNode;
10
+ }) => React.JSX.Element;
11
+ export declare const useCredentialsProvider: (name?: string) => CredentialsAdapter;
12
+ export default CredentialsProviderContext;
@@ -0,0 +1,8 @@
1
+ import type { CredentialsAdapter } from '../CredentialsProvider';
2
+ import type { GoogleServiceAccount } from '../../../Config';
3
+ export declare class GoogleServiceAccountProvider implements CredentialsAdapter {
4
+ private config;
5
+ private cache;
6
+ constructor(config: GoogleServiceAccount);
7
+ getToken(scope?: string): Promise<string>;
8
+ }
@@ -1,10 +1,20 @@
1
1
  import type { ProviderConfigurable } from '../ProviderConfiguration';
2
- type FieldMap = Record<string, any>;
2
+ /** Canonical primary-key field name used by all data providers and the Form widget. */
3
+ export declare const RECORD_KEY: "_key";
4
+ /** A single field value in a record - scalar, nested object, or array of scalars. */
5
+ export type FieldValue = string | number | boolean | null | undefined | Record<string, unknown> | unknown[];
6
+ type FieldMap = Record<string, FieldValue>;
3
7
  type RecordObject = Record<string, FieldMap>;
8
+ /**
9
+ * A data record as used by Form, Grid, and all data providers.
10
+ * `_key` is the primary key injected by the provider (matches `RECORD_KEY`).
11
+ * `_index` is the 0-based position in the parent collection (read-only, injected by providers).
12
+ */
4
13
  export type RecordProps = FieldMap & {
5
14
  _key?: string;
6
15
  _index?: number;
7
16
  };
17
+ /** Ordered list of records returned by a provider `subscribe` or `read` call. */
8
18
  export type RecordArray = Array<RecordProps>;
9
19
  type ScalarValue = string | number | boolean | null;
10
20
  type RangeValue = string | number | boolean;
@@ -45,14 +55,30 @@ export interface SetChunksOptions {
45
55
  purge?: boolean;
46
56
  onProgress?: (done: number, total: number, message: string) => void;
47
57
  }
58
+ /**
59
+ * Port contract for all data back-ends (Firebase RTDB, Firestore, Supabase, Mock, …).
60
+ * Implement this interface to register a custom provider via `<App providers={...}>`.
61
+ */
48
62
  export interface DataProviderAdapter extends ProviderConfigurable {
63
+ /** Read a single record or collection at `path`. Returns `null` when not found. */
49
64
  read(path: string, options?: ReadOptions): Promise<any>;
65
+ /** Write (overwrite) the node at `path` with `data`. */
50
66
  set(path: string, data: object, exception?: boolean): Promise<void>;
67
+ /** Merge `data` into the existing node at `path` (partial update). */
51
68
  update(path: string, data: object, exception?: boolean): Promise<void>;
69
+ /** Delete the node at `path`. */
52
70
  remove(path: string, exception?: boolean): Promise<void>;
71
+ /**
72
+ * Subscribe to real-time updates at `path`.
73
+ * `setRecords` is called immediately with the current data, then on every change.
74
+ * Returns a cleanup function that cancels the subscription.
75
+ */
53
76
  subscribe(path: string | undefined, setRecords: (records: RecordArray) => void, options?: DatabaseOptions): () => void;
77
+ /** Return the number of records in the collection at `path`. */
54
78
  count?(path: string): Promise<number>;
79
+ /** Return only the direct child keys of `path` without fetching full records. */
55
80
  readShallow?(path: string, exception?: boolean): Promise<string[]>;
81
+ /** Write `data` to `path` in batches (useful for large imports). */
56
82
  setChunks?(path: string, data: object, options?: SetChunksOptions): Promise<void>;
57
83
  }
58
84
  export {};
@@ -1,4 +1,3 @@
1
- import 'firebase/compat/database';
2
1
  import { DataProviderAdapter, DatabaseOptions, ReadOptions, SetChunksOptions, RecordProps } from "./DataProvider";
3
2
  import type { ProviderConfigurationState } from "../ProviderConfiguration";
4
3
  export declare const SYSTEM_FIELDS: {
@@ -6,13 +5,15 @@ export declare const SYSTEM_FIELDS: {
6
5
  value: string;
7
6
  };
8
7
  export declare class FirebaseDataProvider implements DataProviderAdapter {
8
+ private static listenerRegistered;
9
+ constructor();
9
10
  getConfigurationState(): ProviderConfigurationState;
10
11
  isConfigured(): boolean;
11
12
  readShallow: (path: string, exception?: boolean) => Promise<string[]>;
12
13
  read: (path: string, { where, order, toArray, exception }?: ReadOptions) => Promise<any>;
13
- update: (path: string, data: any, exception?: boolean) => Promise<void>;
14
- set: (path: string, data: any, exception?: boolean) => Promise<void>;
15
- setChunks: (path: string, data: any, { chunkSize, purge, onProgress }?: SetChunksOptions) => Promise<void>;
14
+ update: (path: string, data: object, exception?: boolean) => Promise<void>;
15
+ set: (path: string, data: object, exception?: boolean) => Promise<void>;
16
+ setChunks: (path: string, data: object, { chunkSize, purge, onProgress }?: SetChunksOptions) => Promise<void>;
16
17
  remove: (path: string, exception?: boolean) => Promise<void>;
17
18
  count: (path: string) => Promise<number>;
18
19
  subscribe: <T extends RecordProps = RecordProps>(path: string | undefined, setRecords: (records: T[]) => void, { where, order, fieldMap, onLoad }?: DatabaseOptions) => (() => void);
@@ -0,0 +1,45 @@
1
+ import { DataProviderAdapter, DatabaseOptions, ReadOptions, SetChunksOptions, RecordProps } from './DataProvider';
2
+ import type { ProviderConfigurationState } from '../ProviderConfiguration';
3
+ export interface FirestoreDataProviderConfig {
4
+ /** Named database within the current app's project — omit for the "(default)" database. */
5
+ databaseId?: string;
6
+ }
7
+ export declare class FirestoreDataProvider implements DataProviderAdapter {
8
+ private static listenerRegistered;
9
+ private databaseId?;
10
+ constructor(config?: FirestoreDataProviderConfig);
11
+ /** Same "(default)" database as before when no databaseId was configured. */
12
+ private getDb;
13
+ getConfigurationState(): ProviderConfigurationState;
14
+ isConfigured(): boolean;
15
+ read: (path: string, { where, order, toArray, exception }?: ReadOptions) => Promise<any>;
16
+ set: (path: string, data: object, exception?: boolean) => Promise<void>;
17
+ update: (path: string, data: object, exception?: boolean) => Promise<void>;
18
+ remove: (path: string, exception?: boolean) => Promise<void>;
19
+ count: (path: string) => Promise<number>;
20
+ /**
21
+ * Real-time listener via Firestore onSnapshot.
22
+ *
23
+ * - Collection path (/users): subscribes to all matching documents.
24
+ * - Document path (/users/uid): subscribes to a single document.
25
+ *
26
+ * Returns an unsubscribe function - always call it on component unmount.
27
+ *
28
+ * Firestore inequality filters on a field require the first orderBy() to be
29
+ * on that same field. Pass `order` accordingly to avoid SDK errors.
30
+ */
31
+ subscribe: <T extends RecordProps = RecordProps>(path: string | undefined, setRecords: (records: T[]) => void, { where, order, fieldMap, onLoad }?: DatabaseOptions) => (() => void);
32
+ /**
33
+ * Returns the list of document IDs in a collection without loading document
34
+ * data - the Firestore equivalent of RTDB's ?shallow=true REST endpoint.
35
+ * On a document path, returns the document's field names.
36
+ */
37
+ readShallow: (path: string, exception?: boolean) => Promise<string[]>;
38
+ /**
39
+ * Bulk-writes `data` to a collection using Firestore writeBatch.
40
+ * Each batch holds at most min(chunkSize, 500) documents (Firestore limit).
41
+ * If `purge` is true, all existing documents in the collection are deleted
42
+ * first (also in batches of 500).
43
+ */
44
+ setChunks: (path: string, data: object, { chunkSize, purge, onProgress }?: SetChunksOptions) => Promise<void>;
45
+ }
@@ -1,9 +1,16 @@
1
1
  import { DataProviderAdapter, DatabaseOptions, ReadOptions, RecordArray } from './DataProvider';
2
2
  type CollectionStore = Record<string, Record<string, any>>;
3
+ export type MockDataProviderOptions = {
4
+ persist?: boolean;
5
+ storageKey?: string;
6
+ };
3
7
  export declare class MockDataProvider implements DataProviderAdapter {
4
8
  private store;
5
9
  private listeners;
6
- constructor(initialData?: CollectionStore);
10
+ private persistKey;
11
+ constructor(initialData?: CollectionStore, options?: MockDataProviderOptions);
12
+ private loadStore;
13
+ private saveStore;
7
14
  isConfigured(): boolean;
8
15
  getConfigurationState(): {
9
16
  configured: boolean;
@@ -1,19 +1,45 @@
1
- import { DataProviderAdapter, DatabaseOptions, ReadOptions, RecordArray } from "./DataProvider";
2
- import { type ProviderConfigurationState } from "../ProviderConfiguration";
3
- interface SupabaseConfig {
1
+ import { DataProviderAdapter, DatabaseOptions, ReadOptions, SetChunksOptions, RecordArray } from './DataProvider';
2
+ import type { ProviderConfigurationState } from '../ProviderConfiguration';
3
+ export interface SupabaseDataConfig {
4
4
  url: string;
5
5
  anonKey: string;
6
+ /**
7
+ * Name of the primary-key column in every Supabase table.
8
+ * Default: 'id'. Must be a text/uuid column.
9
+ */
10
+ primaryKey?: string;
11
+ /**
12
+ * Tenant-session JWT signed by the control-plane, scoped to this project.
13
+ * When present, the adapter uses an uncached, disposable client with this
14
+ * bearer token instead of the shared single-project client — see
15
+ * createSupabaseClient() in supabase-init.ts.
16
+ */
17
+ accessToken?: string;
6
18
  }
7
19
  export declare class SupabaseDataProvider implements DataProviderAdapter {
8
20
  private config;
9
- constructor(config: SupabaseConfig);
21
+ private get pk();
22
+ private scopedClient;
23
+ private get client();
24
+ constructor(config: SupabaseDataConfig);
25
+ /** Force-closes any realtime channels left open before this adapter is discarded. No-op for the shared (non-scoped) client. */
26
+ dispose: () => Promise<void>;
10
27
  getConfigurationState(): ProviderConfigurationState;
11
28
  isConfigured(): boolean;
12
- read: (path: string, _options?: ReadOptions) => Promise<any>;
13
- set: (path: string, data: object) => Promise<void>;
14
- update: (path: string, data: object) => Promise<void>;
15
- remove: (path: string) => Promise<void>;
16
- subscribe: (path: string | undefined, setRecords: (records: RecordArray) => void, _options?: DatabaseOptions) => (() => void);
29
+ read: (path: string, options?: ReadOptions) => Promise<any>;
30
+ set: (path: string, data: object, exception?: boolean) => Promise<void>;
31
+ update: (path: string, data: object, exception?: boolean) => Promise<void>;
32
+ remove: (path: string, exception?: boolean) => Promise<void>;
33
+ /**
34
+ * Real-time subscription via Supabase Postgres Changes.
35
+ * Requires the table to have Realtime enabled in the Supabase dashboard.
36
+ * Falls back gracefully if the channel cannot be created.
37
+ */
38
+ subscribe: (path: string | undefined, setRecords: (records: RecordArray) => void, options?: DatabaseOptions) => (() => void);
17
39
  count: (path: string) => Promise<number>;
40
+ /**
41
+ * Writes a large dataset in batches.
42
+ * If opts.purge = true, deletes all existing rows before writing.
43
+ */
44
+ setChunks: (path: string, data: object, opts?: SetChunksOptions) => Promise<void>;
18
45
  }
19
- export {};
@@ -0,0 +1,3 @@
1
+ import type { ProviderDescriptor } from '../ProviderDescriptor';
2
+ export type EmailProviderId = 'resend' | 'sendgrid' | 'mailgun' | 'postmark' | 'ses' | 'smtp';
3
+ export declare const EMAIL_PROVIDER_DEFINITIONS: ProviderDescriptor[];
@@ -1,10 +1,27 @@
1
- import firebase from "firebase/compat/app";
2
- import 'firebase/compat/database';
3
- import { Auth } from "firebase/auth";
1
+ import { type FirebaseApp } from 'firebase/app';
2
+ import { type Auth } from "firebase/auth";
4
3
  import { FirebaseConfig } from "../Config";
5
4
  import { type ProviderConfigurationState } from "./ProviderConfiguration";
6
- export declare const setFirebaseConfigState: (config: FirebaseConfig | undefined) => void;
7
- export declare const getFirebaseConfigurationState: () => ProviderConfigurationState;
8
- export declare const getSafeAuth: () => Auth | null;
9
- declare const init: (config: FirebaseConfig) => Promise<firebase.app.App>;
5
+ export declare const setFirebaseConfigState: (config: FirebaseConfig | undefined, appName?: string) => void;
6
+ export declare const getFirebaseConfigurationState: (appName?: string) => ProviderConfigurationState;
7
+ export declare const getFirestoreConfigurationState: (appName?: string) => ProviderConfigurationState;
8
+ export declare const getSafeAuth: (appName?: string) => Auth | null;
9
+ export declare const getFirebaseAuthorization: () => Promise<boolean>;
10
+ /**
11
+ * Signs into the currently-initialized Firebase app using a custom token minted
12
+ * server-side (Admin SDK createCustomToken()) and scoped to a specific project —
13
+ * the multi-tenant session-switch path, distinct from the Google-login flow above.
14
+ *
15
+ * Forces in-memory persistence: this session must never survive a reload or be
16
+ * written to IndexedDB/localStorage by the SDK's default persistence behavior.
17
+ * Call init(config) to point the app at the right project *before* calling this.
18
+ */
19
+ export declare const signInWithFirebaseCustomToken: (token: string) => Promise<boolean>;
20
+ declare const init: (config: FirebaseConfig, appName?: string) => Promise<FirebaseApp>;
21
+ /**
22
+ * Invokes a Firebase Callable Function against a given app (the SDK auto-attaches
23
+ * that app's current auth session's ID token — no manual header wiring). Lazily
24
+ * imports 'firebase/functions' so it's not bundled for apps that never call one.
25
+ */
26
+ export declare function callFirebaseFunction<T = unknown>(functionName: string, data: unknown, appName?: string, region?: string): Promise<T>;
10
27
  export default init;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { IconProviderAdapter, IconComponentProps } from './IconProvider';
3
3
  export type PhosphorWeight = 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
4
4
  export declare class PhosphorIconProvider implements IconProviderAdapter {
5
- private readonly weight;
5
+ weight: PhosphorWeight;
6
6
  readonly id: "phosphor";
7
7
  private readonly _cache;
8
8
  constructor(weight?: PhosphorWeight);
@@ -1,25 +1,26 @@
1
+ import type { CredentialsAdapter } from './credentials/CredentialsProvider';
1
2
  import { MockDataProvider } from './data/mock';
3
+ import type { AIProviderAdapter } from './ai/AIProvider';
2
4
  import type { DataProviderAdapter } from './data/DataProvider';
3
5
  import type { StorageProviderAdapter } from './storage/StorageProvider';
4
6
  import type { AuthProviderAdapter } from './auth/AuthProvider';
5
7
  import type { EmailProviderAdapter } from './email/EmailProvider';
6
- import type { DropboxConfig, FirebaseConfig, GoogleOAuth2, GoogleServiceAccount } from '../Config';
7
- export type ServiceCategory = 'data' | 'storage' | 'auth' | 'email';
8
- type AnyAdapter = DataProviderAdapter | StorageProviderAdapter | AuthProviderAdapter | EmailProviderAdapter;
8
+ import type { AIConfig, DropboxConfig, FirebaseConfig, GoogleOAuth2, GoogleServiceAccount, SupabaseConfig } from '../Config';
9
+ import type { ProviderService } from './ProviderRegistryContext';
10
+ /** The 6 built-in categories alias of ProviderService (ProviderRegistryContext.tsx), derived from ProviderAdapterMap so the two can't drift. */
11
+ export type ServiceCategory = ProviderService;
12
+ type AnyAdapter = DataProviderAdapter | StorageProviderAdapter | AuthProviderAdapter | EmailProviderAdapter | AIProviderAdapter | CredentialsAdapter;
9
13
  export interface DriverDescriptor<TConfig = unknown> {
10
14
  service: ServiceCategory;
11
15
  create: (config: TConfig) => AnyAdapter;
16
+ when?: (config: TConfig) => boolean;
12
17
  }
13
18
  export type DriverManifest<TConfig> = Record<string, DriverDescriptor<TConfig>>;
14
19
  export type GoogleProviderConfig = GoogleOAuth2 & {
15
20
  serviceAccount?: GoogleServiceAccount;
16
21
  developerToken?: string;
17
22
  };
18
- export type SupabaseProviderConfig = {
19
- url: string;
20
- anonKey: string;
21
- bucket?: string;
22
- };
23
+ export type SupabaseProviderConfig = SupabaseConfig;
23
24
  export type MockProviderConfig = {
24
25
  data?: ConstructorParameters<typeof MockDataProvider>[0];
25
26
  };
@@ -28,15 +29,20 @@ export declare const GOOGLE_MANIFEST: DriverManifest<GoogleProviderConfig>;
28
29
  export declare const DROPBOX_MANIFEST: DriverManifest<DropboxConfig>;
29
30
  export declare const SUPABASE_MANIFEST: DriverManifest<SupabaseProviderConfig>;
30
31
  export declare const MOCK_MANIFEST: DriverManifest<MockProviderConfig>;
32
+ export declare const AI_MANIFEST: DriverManifest<AIConfig>;
31
33
  export declare const PROVIDER_MANIFESTS: Record<string, DriverManifest<any>>;
32
- export type DataDriverName = 'dbRealtime' | 'supabaseDb' | 'mock';
34
+ export type DataDriverName = 'dbRealtime' | 'firestoreDb' | 'supabaseDb' | 'mock';
33
35
  export type StorageDriverName = 'firestorage' | 'supabaseStorage';
34
- export type AuthDriverName = 'googleAuth' | 'dropboxAuth';
36
+ export type AuthDriverName = 'googleAuth' | 'firebaseAuth' | 'dropboxAuth' | 'supabaseAuth';
35
37
  export type EmailDriverName = 'gmail';
38
+ export type AIDriverName = 'openai' | 'openrouter' | 'opencode' | 'openai-compatible' | 'deepseek' | 'gemini' | 'anthropic' | 'mistral';
39
+ export type CredentialsDriverName = 'googleServiceAccount';
36
40
  export type ServicesConfig = {
37
- data?: DataDriverName;
38
- storage?: StorageDriverName;
39
- auth?: AuthDriverName;
40
- email?: EmailDriverName;
41
+ data?: DataDriverName | string;
42
+ storage?: StorageDriverName | string;
43
+ auth?: AuthDriverName | string;
44
+ email?: EmailDriverName | string;
45
+ ai?: AIDriverName | string;
46
+ credentials?: CredentialsDriverName | string;
41
47
  };
42
48
  export {};
@@ -0,0 +1,7 @@
1
+ import type { ProxyConfig } from '../../Config';
2
+ export declare const PROXY_CALLER_HEADER = "x-llmnative-proxy";
3
+ export declare const DEFAULT_PROXY_ROUTE = "/api/proxy";
4
+ export declare const configureProxy: (config?: ProxyConfig) => void;
5
+ export declare const proxyFetch: typeof fetch;
6
+ export declare const useProxy: () => typeof fetch;
7
+ export declare const isProxyEnabled: () => boolean;
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from 'vite';
2
+ export declare const PROXY_PATH = "/api/proxy";
3
+ export declare const createProxyPlugin: (route?: string) => Plugin;
@@ -0,0 +1,29 @@
1
+ import type { ProviderConfigurable } from '../ProviderConfiguration';
2
+ export interface BuildManifest {
3
+ pages: number;
4
+ sizeBytes: number;
5
+ generatedAt: string;
6
+ }
7
+ export interface BuildArtifacts {
8
+ buildId: string;
9
+ outputPath: string;
10
+ manifest: BuildManifest;
11
+ }
12
+ export type DeployOptions = Record<string, never>;
13
+ export interface DeployResult {
14
+ success: boolean;
15
+ buildId: string;
16
+ url?: string;
17
+ error?: string;
18
+ }
19
+ export interface Deployment {
20
+ buildId: string;
21
+ timestamp: string;
22
+ status: 'success' | 'failed' | 'in_progress';
23
+ url?: string;
24
+ }
25
+ export interface PublishProviderAdapter extends ProviderConfigurable {
26
+ deploy(artifacts: BuildArtifacts, options?: DeployOptions): Promise<DeployResult>;
27
+ rollback(buildId: string): Promise<DeployResult>;
28
+ getDeployments(limit?: number): Promise<Deployment[]>;
29
+ }
@@ -0,0 +1,3 @@
1
+ import type { ProviderDescriptor } from '../ProviderDescriptor';
2
+ export type PublishProviderId = 'cloudflare_pages' | 'firebase_hosting' | 'supabase_storage' | 'ftp' | 'sftp' | 'netlify' | 'github_pages' | 's3_cloudfront' | 'static_export';
3
+ export declare const PUBLISH_PROVIDER_DEFINITIONS: ProviderDescriptor[];
@@ -1,4 +1,5 @@
1
- declare const fetchScrape: (caller?: any, storePaths?: string[]) => {
1
+ import { DataProviderAdapter } from "../../providers/data/DataProvider";
2
+ declare const fetchScrape: (dataProvider: DataProviderAdapter) => {
2
3
  googleSearch: (search: string) => Promise<any>;
3
4
  googleImages: (search: string) => Promise<any>;
4
5
  googleAutocomplete: (search: string) => Promise<any>;
@@ -10,5 +10,10 @@ type GetKeywordIdeasParams = {
10
10
  geoCode?: string;
11
11
  languageCode?: string;
12
12
  };
13
- export declare function getKeywordIdeas({ keyword, googleAdsAccountId, geoCode, languageCode, }: GetKeywordIdeasParams): Promise<any>;
13
+ export declare function getKeywordIdeas({ keyword, googleAdsAccountId, geoCode, languageCode, }: GetKeywordIdeasParams): Promise<{
14
+ keyword: string | undefined;
15
+ avgMonthlySearches: number;
16
+ competition: string;
17
+ cpc: number | null;
18
+ }[]>;
14
19
  export {};