create-efforge 0.0.0-stage → 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 (237) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +140 -2
  3. package/dist/addon.js +115 -0
  4. package/dist/bin.js +6 -0
  5. package/dist/cli.js +9 -0
  6. package/dist/commands/add.js +440 -0
  7. package/dist/commands/create.js +186 -0
  8. package/dist/diff.js +72 -0
  9. package/dist/exec.js +20 -0
  10. package/dist/generate.js +181 -0
  11. package/dist/manifest.js +14 -0
  12. package/dist/projectName.js +41 -0
  13. package/dist/prompts/flow.js +111 -0
  14. package/dist/prompts/navigable.js +97 -0
  15. package/dist/routeTree.js +7 -0
  16. package/dist/rules.js +24 -0
  17. package/dist/slots.js +96 -0
  18. package/dist/stack.js +68 -0
  19. package/dist/transforms/addAlchemyResource.js +71 -0
  20. package/dist/transforms/addArrayItem.js +31 -0
  21. package/dist/transforms/addAuthPlugin.js +77 -0
  22. package/dist/transforms/addDevVar.js +18 -0
  23. package/dist/transforms/addExport.js +46 -0
  24. package/dist/transforms/addImport.js +11 -0
  25. package/dist/transforms/addLayer.js +31 -0
  26. package/dist/transforms/addServerFnMiddleware.js +62 -0
  27. package/dist/transforms/addWorkflowSecret.js +43 -0
  28. package/dist/transforms/addWranglerBinding.js +61 -0
  29. package/dist/transforms/appendAgentsSection.js +26 -0
  30. package/dist/transforms/errors.js +7 -0
  31. package/dist/transforms/index.js +40 -0
  32. package/dist/transforms/setWranglerValue.js +40 -0
  33. package/dist/transforms/util.js +219 -0
  34. package/dist/tree.js +1 -0
  35. package/dist/versions.js +73 -0
  36. package/dist/write.js +26 -0
  37. package/package.json +63 -4
  38. package/templates/ai/effect-ai-byok/addon.json +619 -0
  39. package/templates/ai/effect-ai-byok/files/core/llm-crypto.test.ts +47 -0
  40. package/templates/ai/effect-ai-byok/files/core/llm-crypto.ts +76 -0
  41. package/templates/ai/effect-ai-byok/files/core/llm-store.ts +21 -0
  42. package/templates/ai/effect-ai-byok/files/core/llm.ts +32 -0
  43. package/templates/ai/effect-ai-byok/files/drizzle/d1/20261018161056_llm_credential/migration.sql +9 -0
  44. package/templates/ai/effect-ai-byok/files/drizzle/d1/20261018161056_llm_credential/snapshot.json +944 -0
  45. package/templates/ai/effect-ai-byok/files/drizzle/pg/20261018161056_llm_credential/migration.sql +10 -0
  46. package/templates/ai/effect-ai-byok/files/drizzle/pg/20261018161056_llm_credential/snapshot.json +1232 -0
  47. package/templates/ai/effect-ai-byok/files/routes/ai.tsx +193 -0
  48. package/templates/ai/effect-ai-byok/files/schema/d1.ts +16 -0
  49. package/templates/ai/effect-ai-byok/files/schema/pg.ts +14 -0
  50. package/templates/ai/effect-ai-byok/files/server/ai-settings.ts +129 -0
  51. package/templates/ai/effect-ai-byok/files/server/ai.ts +25 -0
  52. package/templates/ai/effect-ai-byok/files/server/llm-env.ts +48 -0
  53. package/templates/ai/effect-ai-byok/files/server/llm-orgs.ts +146 -0
  54. package/templates/ai/effect-ai-byok/files/server/llm-provider.ts +56 -0
  55. package/templates/ai/effect-ai-byok/files/server/llm-store-drizzle.ts +48 -0
  56. package/templates/ai/effect-ai-byok/files/server/llm-store-sql-d1.ts +41 -0
  57. package/templates/ai/effect-ai-byok/files/server/llm-store-sql-pg.ts +41 -0
  58. package/templates/ai/effect-ai-byok/files/sql/d1.sql +8 -0
  59. package/templates/ai/effect-ai-byok/files/sql/pg.sql +8 -0
  60. package/templates/auth/better-auth/addon.json +424 -0
  61. package/templates/auth/better-auth/files/core/Auth.ts +18 -0
  62. package/templates/auth/better-auth/files/drizzle/d1/20261018161054_auth/migration.sql +51 -0
  63. package/templates/auth/better-auth/files/drizzle/d1/20261018161054_auth/snapshot.json +522 -0
  64. package/templates/auth/better-auth/files/drizzle/pg/20261018161053_auth/migration.sql +51 -0
  65. package/templates/auth/better-auth/files/drizzle/pg/20261018161053_auth/snapshot.json +680 -0
  66. package/templates/auth/better-auth/files/lib/auth-client.ts +4 -0
  67. package/templates/auth/better-auth/files/routes/app.tsx +54 -0
  68. package/templates/auth/better-auth/files/schema/d1/auth-schema.ts +86 -0
  69. package/templates/auth/better-auth/files/schema/pg/auth-schema.ts +73 -0
  70. package/templates/auth/better-auth/files/server/auth-live.ts +47 -0
  71. package/templates/auth/better-auth/files/server/session.ts +14 -0
  72. package/templates/auth/better-auth/files/shared/components/auth-card.tsx +32 -0
  73. package/templates/auth/better-auth/files/shared/components/user-menu.tsx +44 -0
  74. package/templates/auth/better-auth/files/shared/drizzle/d1/drizzle.config.ts +7 -0
  75. package/templates/auth/better-auth/files/shared/drizzle/pg/drizzle.config.ts +10 -0
  76. package/templates/auth/better-auth/files/shared/lib/form.ts +5 -0
  77. package/templates/auth/better-auth/files/shared/lib/redirect.ts +6 -0
  78. package/templates/auth/better-auth/files/shared/routes/app/index.tsx +54 -0
  79. package/templates/auth/better-auth/files/shared/routes/sign-in.tsx +85 -0
  80. package/templates/auth/better-auth/files/shared/routes/sign-up.tsx +91 -0
  81. package/templates/auth/better-auth/files/shared/server/auth-route.ts +15 -0
  82. package/templates/auth/better-auth/files/shared/server/auth.ts +22 -0
  83. package/templates/auth/better-auth/files/shared/server/db/d1-drizzle.ts +25 -0
  84. package/templates/auth/better-auth/files/shared/server/db/d1-effect-sql.ts +17 -0
  85. package/templates/auth/better-auth/files/shared/server/db/pg-drizzle.ts +32 -0
  86. package/templates/auth/better-auth/files/shared/server/db/pg-effect-sql.ts +29 -0
  87. package/templates/auth/better-auth/files/shared/server/require-session.ts +20 -0
  88. package/templates/auth/better-auth/files/sql/d1/0002_auth.sql +13 -0
  89. package/templates/auth/better-auth/files/sql/pg/0002_auth.sql +13 -0
  90. package/templates/auth/better-auth-orgs/addon.json +463 -0
  91. package/templates/auth/better-auth-orgs/files/components/org-switcher.tsx +65 -0
  92. package/templates/auth/better-auth-orgs/files/core/Auth.ts +20 -0
  93. package/templates/auth/better-auth-orgs/files/drizzle/d1/20261018161055_auth/migration.sql +88 -0
  94. package/templates/auth/better-auth-orgs/files/drizzle/d1/20261018161055_auth/snapshot.json +862 -0
  95. package/templates/auth/better-auth-orgs/files/drizzle/pg/20261018161055_auth/migration.sql +88 -0
  96. package/templates/auth/better-auth-orgs/files/drizzle/pg/20261018161055_auth/snapshot.json +1127 -0
  97. package/templates/auth/better-auth-orgs/files/lib/auth-client.ts +5 -0
  98. package/templates/auth/better-auth-orgs/files/routes/accept-invite.$id.tsx +68 -0
  99. package/templates/auth/better-auth-orgs/files/routes/app/settings/index.tsx +27 -0
  100. package/templates/auth/better-auth-orgs/files/routes/app/settings/members.tsx +198 -0
  101. package/templates/auth/better-auth-orgs/files/routes/app/settings.tsx +30 -0
  102. package/templates/auth/better-auth-orgs/files/routes/app.tsx +58 -0
  103. package/templates/auth/better-auth-orgs/files/routes/onboarding.tsx +66 -0
  104. package/templates/auth/better-auth-orgs/files/schema/d1/auth-schema.ts +139 -0
  105. package/templates/auth/better-auth-orgs/files/schema/pg/auth-schema.ts +124 -0
  106. package/templates/auth/better-auth-orgs/files/server/auth-live.ts +52 -0
  107. package/templates/auth/better-auth-orgs/files/server/session.ts +44 -0
  108. package/templates/auth/better-auth-orgs/files/sql/d1/0002_auth.sql +27 -0
  109. package/templates/auth/better-auth-orgs/files/sql/pg/0002_auth.sql +27 -0
  110. package/templates/base/addon.json +212 -0
  111. package/templates/base/files/AGENTS.md +70 -0
  112. package/templates/base/files/CLAUDE.md +1 -0
  113. package/templates/base/files/README.md +28 -0
  114. package/templates/base/files/core/package.json +13 -0
  115. package/templates/base/files/core/src/index.ts +2 -0
  116. package/templates/base/files/core/test/core.test.ts +4 -0
  117. package/templates/base/files/core/tsconfig.json +6 -0
  118. package/templates/base/files/gitignore +11 -0
  119. package/templates/base/files/pnpm-workspace.yaml +11 -0
  120. package/templates/base/files/root/package.json +16 -0
  121. package/templates/base/files/root/tsconfig.base.json +19 -0
  122. package/templates/base/files/root/turbo.json +9 -0
  123. package/templates/base/files/root/vite.config.ts +61 -0
  124. package/templates/base/files/web/components.json +21 -0
  125. package/templates/base/files/web/package.json +17 -0
  126. package/templates/base/files/web/src/components/theme-provider.tsx +57 -0
  127. package/templates/base/files/web/src/components/theme-toggle.tsx +34 -0
  128. package/templates/base/files/web/src/components/ui/avatar.tsx +93 -0
  129. package/templates/base/files/web/src/components/ui/button.tsx +61 -0
  130. package/templates/base/files/web/src/components/ui/card.tsx +74 -0
  131. package/templates/base/files/web/src/components/ui/dialog.tsx +141 -0
  132. package/templates/base/files/web/src/components/ui/dropdown-menu.tsx +225 -0
  133. package/templates/base/files/web/src/components/ui/input.tsx +20 -0
  134. package/templates/base/files/web/src/components/ui/label.tsx +18 -0
  135. package/templates/base/files/web/src/components/ui/sonner.tsx +45 -0
  136. package/templates/base/files/web/src/components/widgets.tsx +4 -0
  137. package/templates/base/files/web/src/lib/utils.ts +6 -0
  138. package/templates/base/files/web/src/router.tsx +12 -0
  139. package/templates/base/files/web/src/routes/__root.tsx +42 -0
  140. package/templates/base/files/web/src/routes/app/index.tsx +27 -0
  141. package/templates/base/files/web/src/routes/app/settings.tsx +29 -0
  142. package/templates/base/files/web/src/routes/app.tsx +47 -0
  143. package/templates/base/files/web/src/routes/index.tsx +51 -0
  144. package/templates/base/files/web/src/server/greeting.ts +12 -0
  145. package/templates/base/files/web/src/server/layers.ts +10 -0
  146. package/templates/base/files/web/src/server/runtime.ts +5 -0
  147. package/templates/base/files/web/src/styles.css +81 -0
  148. package/templates/base/files/web/tsconfig.json +11 -0
  149. package/templates/base/files/web/vite.config.ts +9 -0
  150. package/templates/database/d1/addon.json +118 -0
  151. package/templates/database/d1/files/package.json +12 -0
  152. package/templates/database/d1/files/tsconfig.json +5 -0
  153. package/templates/database/postgres/addon.json +142 -0
  154. package/templates/database/postgres/files/docker-compose.yml +21 -0
  155. package/templates/database/postgres/files/package.json +12 -0
  156. package/templates/database/postgres/files/runtime.ts +12 -0
  157. package/templates/database/postgres/files/tsconfig.json +5 -0
  158. package/templates/extras/browser/addon.json +173 -0
  159. package/templates/extras/browser/files/BrowserContainer.ts +14 -0
  160. package/templates/extras/browser/files/app/Dockerfile +15 -0
  161. package/templates/extras/browser/files/app/dockerignore +1 -0
  162. package/templates/extras/browser/files/app/package-lock +605 -0
  163. package/templates/extras/browser/files/app/package.json +9 -0
  164. package/templates/extras/browser/files/app/src/server.ts +78 -0
  165. package/templates/extras/browser/files/app/src/url-policy.ts +115 -0
  166. package/templates/extras/browser/files/app/tsconfig.json +6 -0
  167. package/templates/extras/browser/files/browser.ts +34 -0
  168. package/templates/extras/browser/files/core-browser.ts +21 -0
  169. package/templates/extras/browser/files/run-browser.ts +25 -0
  170. package/templates/extras/email/addon.json +182 -0
  171. package/templates/extras/email/files/core-mailer.ts +28 -0
  172. package/templates/extras/email/files/invitation-email.ts +38 -0
  173. package/templates/extras/email/files/mailer.ts +58 -0
  174. package/templates/extras/realtime/addon.json +135 -0
  175. package/templates/extras/realtime/files/Room.ts +46 -0
  176. package/templates/extras/realtime/files/core-realtime.ts +19 -0
  177. package/templates/extras/realtime/files/realtime-demo.tsx +40 -0
  178. package/templates/extras/realtime/files/realtime-limits.test.ts +32 -0
  179. package/templates/extras/realtime/files/realtime-limits.ts +35 -0
  180. package/templates/extras/realtime/files/realtime-route.ts +39 -0
  181. package/templates/extras/realtime/files/realtime.ts +39 -0
  182. package/templates/extras/realtime/files/use-room.ts +67 -0
  183. package/templates/extras/storage/addon.json +132 -0
  184. package/templates/extras/storage/files/core-storage.ts +64 -0
  185. package/templates/extras/storage/files/storage-route.ts +50 -0
  186. package/templates/extras/storage/files/storage-security.test.ts +71 -0
  187. package/templates/extras/storage/files/storage-security.ts +92 -0
  188. package/templates/extras/storage/files/storage.ts +84 -0
  189. package/templates/extras/workflows/addon.json +95 -0
  190. package/templates/extras/workflows/files/Example.ts +42 -0
  191. package/templates/extras/workflows/files/core-jobs.ts +45 -0
  192. package/templates/extras/workflows/files/example-job.ts +36 -0
  193. package/templates/extras/workflows/files/jobs.ts +34 -0
  194. package/templates/infra/alchemy/addon.json +37 -0
  195. package/templates/infra/alchemy/files/README.md +27 -0
  196. package/templates/infra/alchemy/files/alchemy.run.ts +36 -0
  197. package/templates/infra/alchemy/files/github/deploy.yml +63 -0
  198. package/templates/infra/alchemy/files/tsconfig.json +5 -0
  199. package/templates/infra/alchemy/files/vite.config.ts +30 -0
  200. package/templates/orm/drizzle/addon.json +188 -0
  201. package/templates/orm/drizzle/files/d1/Database.ts +7 -0
  202. package/templates/orm/drizzle/files/d1/drizzle/20261018154417_init/migration.sql +10 -0
  203. package/templates/orm/drizzle/files/d1/drizzle/20261018154417_init/snapshot.json +60 -0
  204. package/templates/orm/drizzle/files/d1/drizzle.config.ts +7 -0
  205. package/templates/orm/drizzle/files/d1/layer.ts +13 -0
  206. package/templates/orm/drizzle/files/d1/migrate.ts +37 -0
  207. package/templates/orm/drizzle/files/d1/schema.ts +15 -0
  208. package/templates/orm/drizzle/files/pg/Database.ts +7 -0
  209. package/templates/orm/drizzle/files/pg/drizzle/20261018154416_init/migration.sql +10 -0
  210. package/templates/orm/drizzle/files/pg/drizzle/20261018154416_init/snapshot.json +75 -0
  211. package/templates/orm/drizzle/files/pg/drizzle.config.ts +10 -0
  212. package/templates/orm/drizzle/files/pg/layer.ts +16 -0
  213. package/templates/orm/drizzle/files/pg/migrate.ts +24 -0
  214. package/templates/orm/drizzle/files/pg/schema.ts +11 -0
  215. package/templates/orm/drizzle/files/shared/index.ts +2 -0
  216. package/templates/orm/drizzle/files/shared/notes.ts +15 -0
  217. package/templates/orm/drizzle/files/shared/page.tsx +50 -0
  218. package/templates/orm/effect-sql/addon.json +124 -0
  219. package/templates/orm/effect-sql/files/d1/layer.ts +13 -0
  220. package/templates/orm/effect-sql/files/d1/migrate.ts +20 -0
  221. package/templates/orm/effect-sql/files/d1/schema.ts +7 -0
  222. package/templates/orm/effect-sql/files/d1-sql/0001_init.sql +10 -0
  223. package/templates/orm/effect-sql/files/pg/layer.ts +16 -0
  224. package/templates/orm/effect-sql/files/pg/migrate.ts +66 -0
  225. package/templates/orm/effect-sql/files/pg/schema.ts +7 -0
  226. package/templates/orm/effect-sql/files/pg-sql/0001_init.sql +10 -0
  227. package/templates/orm/effect-sql/files/shared/Database.ts +7 -0
  228. package/templates/orm/effect-sql/files/shared/index.ts +2 -0
  229. package/templates/orm/effect-sql/files/shared/notes.ts +18 -0
  230. package/templates/orm/effect-sql/files/shared/page.tsx +50 -0
  231. package/templates/runtime/cloudflare/addon.json +52 -0
  232. package/templates/runtime/cloudflare/files/cloudflare.ts +10 -0
  233. package/templates/runtime/cloudflare/files/routes.ts +5 -0
  234. package/templates/runtime/cloudflare/files/server.ts +22 -0
  235. package/templates/runtime/cloudflare/files/tsconfig.json +12 -0
  236. package/templates/runtime/cloudflare/files/vite.config.ts +20 -0
  237. package/templates/runtime/cloudflare/files/wrangler.jsonc +8 -0
@@ -0,0 +1,76 @@
1
+ import { Data, Effect } from "effect"
2
+ import { LlmError } from "./llm"
3
+
4
+ /** `LLM_ENCRYPTION_KEY` is missing or not 32 base64-encoded bytes, so the Llm layer can't be built. */
5
+ export class LlmConfigError extends Data.TaggedError("LlmConfigError")<{
6
+ readonly message: string
7
+ }> {}
8
+
9
+ const VERSION = "v1"
10
+ const KEY_BYTES = 32
11
+ const IV_BYTES = 12
12
+
13
+ const toBase64 = (bytes: Uint8Array): string => btoa(String.fromCharCode(...bytes))
14
+ const fromBase64 = (text: string): Uint8Array<ArrayBuffer> =>
15
+ Uint8Array.from(atob(text), (c) => c.charCodeAt(0))
16
+
17
+ const invalidKey = new LlmConfigError({
18
+ message:
19
+ "LLM_ENCRYPTION_KEY must be 32 random bytes, base64 encoded. Generate one with `openssl rand -base64 32` and set it as a secret (.dev.vars locally).",
20
+ })
21
+
22
+ /** Imports the AES-GCM key from `LLM_ENCRYPTION_KEY`; fails with a clear message when it is unusable. */
23
+ export const loadEncryptionKey = (
24
+ value: string | undefined,
25
+ ): Effect.Effect<CryptoKey, LlmConfigError> =>
26
+ Effect.gen(function* () {
27
+ const text = (value ?? "").trim()
28
+ if (!/^[A-Za-z0-9+/]+={0,2}$/.test(text)) return yield* invalidKey
29
+ const raw = yield* Effect.try({ try: () => fromBase64(text), catch: () => invalidKey })
30
+ if (raw.length !== KEY_BYTES) return yield* invalidKey
31
+ return yield* Effect.promise(() =>
32
+ crypto.subtle.importKey("raw", raw, "AES-GCM", false, ["encrypt", "decrypt"]),
33
+ )
34
+ })
35
+
36
+ /**
37
+ * AES-GCM with a random IV. `context` (the organization id) is authenticated but not stored, so a
38
+ * ciphertext copied to another organization's row fails to decrypt. Output: `v1.<iv>.<ciphertext>`.
39
+ */
40
+ export const encryptSecret = (
41
+ key: CryptoKey,
42
+ plaintext: string,
43
+ context: string,
44
+ ): Effect.Effect<string, LlmError> =>
45
+ Effect.tryPromise({
46
+ try: async () => {
47
+ const iv = crypto.getRandomValues(new Uint8Array(IV_BYTES))
48
+ const encrypted = await crypto.subtle.encrypt(
49
+ { name: "AES-GCM", iv, additionalData: new TextEncoder().encode(context) },
50
+ key,
51
+ new TextEncoder().encode(plaintext),
52
+ )
53
+ return `${VERSION}.${toBase64(iv)}.${toBase64(new Uint8Array(encrypted))}`
54
+ },
55
+ catch: (cause) => new LlmError({ operation: "encrypt", cause }),
56
+ })
57
+
58
+ export const decryptSecret = (
59
+ key: CryptoKey,
60
+ payload: string,
61
+ context: string,
62
+ ): Effect.Effect<string, LlmError> =>
63
+ Effect.tryPromise({
64
+ try: async () => {
65
+ const [version, iv, data] = payload.split(".")
66
+ if (version !== VERSION || iv === undefined || data === undefined)
67
+ throw new Error("unknown ciphertext format")
68
+ const decrypted = await crypto.subtle.decrypt(
69
+ { name: "AES-GCM", iv: fromBase64(iv), additionalData: new TextEncoder().encode(context) },
70
+ key,
71
+ fromBase64(data),
72
+ )
73
+ return new TextDecoder().decode(decrypted)
74
+ },
75
+ catch: (cause) => new LlmError({ operation: "decrypt", cause }),
76
+ })
@@ -0,0 +1,21 @@
1
+ import { Context, type Effect, type Option } from "effect"
2
+ import type { LlmError } from "./llm"
3
+
4
+ /** One organization's model settings; the key is encrypted (see `llm-crypto.ts`). */
5
+ export interface LlmCredentialRow {
6
+ readonly orgId: string
7
+ readonly provider: string
8
+ readonly model: string
9
+ readonly encryptedKey: string
10
+ readonly baseUrl: string | null
11
+ }
12
+
13
+ /** Storage for the `llm_credential` table, one row per organization. */
14
+ export class LlmCredentialStore extends Context.Service<
15
+ LlmCredentialStore,
16
+ {
17
+ readonly find: (orgId: string) => Effect.Effect<Option.Option<LlmCredentialRow>, LlmError>
18
+ readonly upsert: (row: LlmCredentialRow) => Effect.Effect<void, LlmError>
19
+ readonly remove: (orgId: string) => Effect.Effect<void, LlmError>
20
+ }
21
+ >()("@repo/core/LlmCredentialStore") {}
@@ -0,0 +1,32 @@
1
+ import { Context, Data, type Effect } from "effect"
2
+
3
+ /** Providers `makeLlmLayer` can talk to. Ollama goes through the OpenAI-compatible client. */
4
+ export const llmProviders = ["anthropic", "openai", "openrouter", "ollama"] as const
5
+ export type LlmProvider = (typeof llmProviders)[number]
6
+
7
+ /** A provider request, or the storage around it, failed. */
8
+ export class LlmError extends Data.TaggedError("LlmError")<{
9
+ readonly operation: string
10
+ readonly cause: unknown
11
+ }> {
12
+ override get message(): string {
13
+ const cause = this.cause instanceof Error ? `: ${this.cause.message}` : ""
14
+ return `LLM ${this.operation} failed${cause}`
15
+ }
16
+ }
17
+
18
+ /** There is no usable model configuration for this call (no key set, or no organization selected). */
19
+ export class LlmNotConfigured extends Data.TaggedError("LlmNotConfigured")<{
20
+ readonly message: string
21
+ }> {}
22
+
23
+ /**
24
+ * Text generation. The implementation in `apps/web/src/server/llm.ts` decides where the provider,
25
+ * model and key come from; app code only calls `generateText`.
26
+ */
27
+ export class Llm extends Context.Service<
28
+ Llm,
29
+ {
30
+ readonly generateText: (prompt: string) => Effect.Effect<string, LlmError | LlmNotConfigured>
31
+ }
32
+ >()("@repo/core/Llm") {}
@@ -0,0 +1,9 @@
1
+ CREATE TABLE `llm_credential` (
2
+ `org_id` text PRIMARY KEY,
3
+ `provider` text NOT NULL,
4
+ `model` text NOT NULL,
5
+ `encrypted_key` text NOT NULL,
6
+ `base_url` text,
7
+ `updated_at` integer NOT NULL,
8
+ CONSTRAINT `fk_llm_credential_org_id_organization_id_fk` FOREIGN KEY (`org_id`) REFERENCES `organization`(`id`) ON DELETE CASCADE
9
+ );