diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a09a3c1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.8' + +services: + db: + image: postgres:13 + container_name: my_postgres + environment: + POSTGRES_DB: mydb + POSTGRES_USER: myuser + POSTGRES_PASSWORD: mypassword + ports: + - "5434:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: diff --git a/drizzle.config.ts b/drizzle.config.ts index bc353ed..36d3a43 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -2,12 +2,12 @@ import "dotenv/config"; import type { Config } from "drizzle-kit"; export default { - dialect: "sqlite", + dialect: "postgresql", schema: "./src/database/schema.ts", out: "./src/database/migrations", verbose: true, strict: true, dbCredentials: { - url: "workbench.db", + url: "postgresql://myuser:mypassword@localhost:5434/mydb", }, } satisfies Config; diff --git a/package.json b/package.json index a79e913..79e5034 100644 --- a/package.json +++ b/package.json @@ -23,65 +23,69 @@ "@sveltejs/adapter-cloudflare": "^4.4.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", + "@tailwindcss/typography": "^0.5.13", "@testing-library/jest-dom": "^6.4.5", "@testing-library/svelte": "^5.2.0", - "@types/better-sqlite3": "^7.6.11", + "@types/lodash": "^4.17.1", + "@types/pg": "^8.11.6", + "@vitest/browser": "^1.6.0", "@vitest/ui": "^1.6.0", "autoprefixer": "^10.4.19", - "better-sqlite3": "^10.0.0", + "drizzle-kit": "^0.24.0", "jsdom": "^24.0.0", "postcss": "^8.4.38", "prettier": "^3.2.5", "prettier-plugin-svelte": "^3.2.3", "prettier-plugin-tailwindcss": "^0.5.14", - "svelte": "^5.0.0-next.1", + "svelte": "^5.0.0-next.203", "svelte-check": "^3.6.0", + "sveltekit-superforms": "^2.16.1", "tailwindcss": "^3.4.3", "tslib": "^2.4.1", "typescript": "^5.0.0", "vite": "^5.0.3", - "wrangler": "^3.53.1" + "vitest": "^1.6.0", + "wrangler": "^3.53.1", + "zod": "3.23.8" }, "type": "module", "dependencies": { - "@ai-sdk/anthropic": "^0.0.10", - "@ai-sdk/google": "^0.0.10", - "@ai-sdk/mistral": "^0.0.9", + "@ai-sdk/amazon-bedrock": "^0.0.9", + "@ai-sdk/anthropic": "^0.0.35", + "@ai-sdk/azure": "^0.0.18", + "@ai-sdk/cohere": "^0.0.8", + "@ai-sdk/google": "^0.0.30", + "@ai-sdk/google-vertex": "^0.0.19", + "@ai-sdk/mistral": "^0.0.26", "@ai-sdk/openai": "^0.0.10", - "@ai-sdk/ui-utils": "^0.0.9", - "@codemirror/autocomplete": "^6.16.0", - "@codemirror/lang-markdown": "^6.2.5", - "@codemirror/language-data": "^6.5.0", - "@codemirror/state": "^6.4.1", - "@codemirror/view": "^6.26.3", + "@ai-sdk/ui-utils": "^0.0.24", + "@electric-sql/pglite": "^0.2.0", "@fontsource-variable/inter": "^5.0.18", - "@tailwindcss/typography": "^0.5.13", - "@types/lodash": "^4.17.1", - "@vitest/browser": "^1.6.0", - "ai": "^3.1.12", + "@lexical/history": "^0.16.0", + "@lexical/plain-text": "^0.16.0", + "@lexical/text": "^0.16.0", + "@lexical/utils": "^0.16.0", + "ai": "^3.3.0", "bits-ui": "^0.21.7", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "dotenv": "^16.4.5", - "drizzle-kit": "^0.21.2", - "drizzle-orm": "^0.30.10", + "drizzle-orm": "^0.33.0", "filepond": "^4.31.1", + "formsnap": "^1.0.1", "highlight.js": "^11.7.0", - "kysely": "^0.27.3", + "lexical": "^0.16.1", "lodash": "^4.17.21", "lucide-svelte": "^0.378.0", "marked": "^12.0.1", "marked-katex-extension": "^5.0.1", "msw": "^2.3.1", "nanoid": "^5.0.7", - "sqlocal": "^0.9.0", - "svelte-codemirror-editor": "^1.3.0", + "pg": "^8.12.0", "svelte-filepond": "^0.2.2", "svelte-french-toast": "^1.2.0", "tailwind-merge": "^2.3.0", "tailwind-variants": "^0.2.1", - "vitest": "^1.6.0", - "webdriverio": "^8.36.1", - "zod": "^3.23.6" + "unstructured-client": "^0.14.3" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8dc4959..2db36f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,54 +8,57 @@ importers: .: dependencies: + '@ai-sdk/amazon-bedrock': + specifier: ^0.0.9 + version: 0.0.9(zod@3.23.8) '@ai-sdk/anthropic': - specifier: ^0.0.10 - version: 0.0.10(zod@3.23.6) + specifier: ^0.0.35 + version: 0.0.35(zod@3.23.8) + '@ai-sdk/azure': + specifier: ^0.0.18 + version: 0.0.18(zod@3.23.8) + '@ai-sdk/cohere': + specifier: ^0.0.8 + version: 0.0.8(zod@3.23.8) '@ai-sdk/google': - specifier: ^0.0.10 - version: 0.0.10(zod@3.23.6) + specifier: ^0.0.30 + version: 0.0.30(zod@3.23.8) + '@ai-sdk/google-vertex': + specifier: ^0.0.19 + version: 0.0.19(@google-cloud/vertexai@1.4.0)(zod@3.23.8) '@ai-sdk/mistral': - specifier: ^0.0.9 - version: 0.0.9(zod@3.23.6) + specifier: ^0.0.26 + version: 0.0.26(zod@3.23.8) '@ai-sdk/openai': specifier: ^0.0.10 - version: 0.0.10(zod@3.23.6) + version: 0.0.10(zod@3.23.8) '@ai-sdk/ui-utils': - specifier: ^0.0.9 - version: 0.0.9(zod@3.23.6) - '@codemirror/autocomplete': - specifier: ^6.16.0 - version: 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/lang-markdown': - specifier: ^6.2.5 - version: 6.2.5 - '@codemirror/language-data': - specifier: ^6.5.0 - version: 6.5.1(@codemirror/view@6.26.3) - '@codemirror/state': - specifier: ^6.4.1 - version: 6.4.1 - '@codemirror/view': - specifier: ^6.26.3 - version: 6.26.3 + specifier: ^0.0.24 + version: 0.0.24(zod@3.23.8) + '@electric-sql/pglite': + specifier: ^0.2.0 + version: 0.2.0 '@fontsource-variable/inter': specifier: ^5.0.18 version: 5.0.18 - '@tailwindcss/typography': - specifier: ^0.5.13 - version: 0.5.13(tailwindcss@3.4.3) - '@types/lodash': - specifier: ^4.17.1 - version: 4.17.1 - '@vitest/browser': - specifier: ^1.6.0 - version: 1.6.0(playwright@1.44.0)(vitest@1.6.0)(webdriverio@8.36.1(typescript@5.4.5)) + '@lexical/history': + specifier: ^0.16.0 + version: 0.16.1 + '@lexical/plain-text': + specifier: ^0.16.0 + version: 0.16.1 + '@lexical/text': + specifier: ^0.16.0 + version: 0.16.1 + '@lexical/utils': + specifier: ^0.16.0 + version: 0.16.1 ai: - specifier: ^3.1.12 - version: 3.1.12(react@18.3.1)(solid-js@1.8.17)(svelte@5.0.0-next.123)(vue@3.4.26(typescript@5.4.5))(zod@3.23.6) + specifier: ^3.3.0 + version: 3.3.0(react@18.3.1)(solid-js@1.8.17)(sswr@2.1.0(svelte@5.0.0-next.208))(svelte@5.0.0-next.208)(vue@3.4.26(typescript@5.4.5))(zod@3.23.8) bits-ui: specifier: ^0.21.7 - version: 0.21.7(svelte@5.0.0-next.123) + version: 0.21.7(svelte@5.0.0-next.208) class-variance-authority: specifier: ^0.7.0 version: 0.7.0 @@ -65,27 +68,27 @@ importers: dotenv: specifier: ^16.4.5 version: 16.4.5 - drizzle-kit: - specifier: ^0.21.2 - version: 0.21.2 drizzle-orm: - specifier: ^0.30.10 - version: 0.30.10(@cloudflare/workers-types@4.20240502.0)(@types/better-sqlite3@7.6.11)(@types/sql.js@1.4.9)(better-sqlite3@10.0.0)(kysely@0.27.3)(react@18.3.1)(sql.js@1.10.3) + specifier: ^0.33.0 + version: 0.33.0(@cloudflare/workers-types@4.20240502.0)(@electric-sql/pglite@0.2.0)(@opentelemetry/api@1.9.0)(@types/better-sqlite3@7.6.11)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(better-sqlite3@10.0.0)(kysely@0.27.3)(pg@8.12.0)(react@18.3.1)(sql.js@1.10.3) filepond: specifier: ^4.31.1 version: 4.31.1 + formsnap: + specifier: ^1.0.1 + version: 1.0.1(svelte@5.0.0-next.208)(sveltekit-superforms@2.16.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)) highlight.js: specifier: ^11.7.0 version: 11.9.0 - kysely: - specifier: ^0.27.3 - version: 0.27.3 + lexical: + specifier: ^0.16.1 + version: 0.16.1 lodash: specifier: ^4.17.21 version: 4.17.21 lucide-svelte: specifier: ^0.378.0 - version: 0.378.0(svelte@5.0.0-next.123) + version: 0.378.0(svelte@5.0.0-next.208) marked: specifier: ^12.0.1 version: 12.0.2 @@ -98,76 +101,76 @@ importers: nanoid: specifier: ^5.0.7 version: 5.0.7 - sqlocal: - specifier: ^0.9.0 - version: 0.9.0(drizzle-orm@0.30.10(@cloudflare/workers-types@4.20240502.0)(@types/better-sqlite3@7.6.11)(@types/sql.js@1.4.9)(better-sqlite3@10.0.0)(kysely@0.27.3)(react@18.3.1)(sql.js@1.10.3))(kysely@0.27.3) - svelte-codemirror-editor: - specifier: ^1.3.0 - version: 1.3.0(codemirror@6.0.1(@lezer/common@1.2.1))(svelte@5.0.0-next.123) + pg: + specifier: ^8.12.0 + version: 8.12.0 svelte-filepond: specifier: ^0.2.2 version: 0.2.2(filepond@4.31.1) svelte-french-toast: specifier: ^1.2.0 - version: 1.2.0(svelte@5.0.0-next.123) + version: 1.2.0(svelte@5.0.0-next.208) tailwind-merge: specifier: ^2.3.0 version: 2.3.0 tailwind-variants: specifier: ^0.2.1 version: 0.2.1(tailwindcss@3.4.3) - vitest: - specifier: ^1.6.0 - version: 1.6.0(@types/node@20.14.9)(@vitest/browser@1.6.0)(@vitest/ui@1.6.0)(jsdom@24.0.0) - webdriverio: - specifier: ^8.36.1 - version: 8.36.1(typescript@5.4.5) - zod: - specifier: ^3.23.6 - version: 3.23.6 + unstructured-client: + specifier: ^0.14.3 + version: 0.14.3(zod@3.23.8) devDependencies: '@cloudflare/workers-types': specifier: ^4.20240502.0 version: 4.20240502.0 '@melt-ui/pp': specifier: ^0.3.1 - version: 0.3.1(@melt-ui/svelte@0.77.0(svelte@5.0.0-next.123))(svelte@5.0.0-next.123) + version: 0.3.1(@melt-ui/svelte@0.77.0(svelte@5.0.0-next.208))(svelte@5.0.0-next.208) '@melt-ui/svelte': specifier: ^0.77.0 - version: 0.77.0(svelte@5.0.0-next.123) + version: 0.77.0(svelte@5.0.0-next.208) '@playwright/test': specifier: ^1.28.1 version: 1.44.0 '@sveltejs/adapter-auto': specifier: ^3.0.0 - version: 3.2.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9))) + version: 3.2.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9))) '@sveltejs/adapter-cloudflare': specifier: ^4.4.0 - version: 4.4.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(wrangler@3.53.1(@cloudflare/workers-types@4.20240502.0)) + version: 4.4.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(wrangler@3.53.1(@cloudflare/workers-types@4.20240502.0)) '@sveltejs/kit': specifier: ^2.0.0 - version: 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)) + version: 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)) '@sveltejs/vite-plugin-svelte': specifier: ^3.0.0 - version: 3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)) + version: 3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)) + '@tailwindcss/typography': + specifier: ^0.5.13 + version: 0.5.13(tailwindcss@3.4.3) '@testing-library/jest-dom': specifier: ^6.4.5 version: 6.4.5(vitest@1.6.0(@types/node@20.14.9)(@vitest/browser@1.6.0)(@vitest/ui@1.6.0)(jsdom@24.0.0)) '@testing-library/svelte': specifier: ^5.2.0 - version: 5.2.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9))(vitest@1.6.0(@types/node@20.14.9)(@vitest/browser@1.6.0)(@vitest/ui@1.6.0)(jsdom@24.0.0)) - '@types/better-sqlite3': - specifier: ^7.6.11 - version: 7.6.11 + version: 5.2.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9))(vitest@1.6.0(@types/node@20.14.9)(@vitest/browser@1.6.0)(@vitest/ui@1.6.0)(jsdom@24.0.0)) + '@types/lodash': + specifier: ^4.17.1 + version: 4.17.1 + '@types/pg': + specifier: ^8.11.6 + version: 8.11.6 + '@vitest/browser': + specifier: ^1.6.0 + version: 1.6.0(playwright@1.44.0)(vitest@1.6.0)(webdriverio@8.36.1(typescript@5.4.5)) '@vitest/ui': specifier: ^1.6.0 version: 1.6.0(vitest@1.6.0) autoprefixer: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.38) - better-sqlite3: - specifier: ^10.0.0 - version: 10.0.0 + drizzle-kit: + specifier: ^0.24.0 + version: 0.24.0 jsdom: specifier: ^24.0.0 version: 24.0.0 @@ -179,16 +182,19 @@ importers: version: 3.2.5 prettier-plugin-svelte: specifier: ^3.2.3 - version: 3.2.3(prettier@3.2.5)(svelte@5.0.0-next.123) + version: 3.2.3(prettier@3.2.5)(svelte@5.0.0-next.208) prettier-plugin-tailwindcss: specifier: ^0.5.14 - version: 0.5.14(prettier-plugin-svelte@3.2.3(prettier@3.2.5)(svelte@5.0.0-next.123))(prettier@3.2.5) + version: 0.5.14(prettier-plugin-svelte@3.2.3(prettier@3.2.5)(svelte@5.0.0-next.208))(prettier@3.2.5) svelte: - specifier: ^5.0.0-next.1 - version: 5.0.0-next.123 + specifier: ^5.0.0-next.203 + version: 5.0.0-next.208 svelte-check: specifier: ^3.6.0 - version: 3.7.1(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.123) + version: 3.7.1(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.208) + sveltekit-superforms: + specifier: ^2.16.1 + version: 2.16.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208) tailwindcss: specifier: ^3.4.3 version: 3.4.3 @@ -201,41 +207,62 @@ importers: vite: specifier: ^5.0.3 version: 5.2.11(@types/node@20.14.9) + vitest: + specifier: ^1.6.0 + version: 1.6.0(@types/node@20.14.9)(@vitest/browser@1.6.0)(@vitest/ui@1.6.0)(jsdom@24.0.0) wrangler: specifier: ^3.53.1 version: 3.53.1(@cloudflare/workers-types@4.20240502.0) + zod: + specifier: 3.23.8 + version: 3.23.8 packages: '@adobe/css-tools@4.3.3': resolution: {integrity: sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==} - '@ai-sdk/anthropic@0.0.10': - resolution: {integrity: sha512-ya53IOWG7xtGEW/d+r55qeUIlEP81LkH5XCot3fbqshnhDVBsqSLxoBzp2vyN3PzftpoL7awglOWR6sHvF9U+g==} + '@ai-sdk/amazon-bedrock@0.0.9': + resolution: {integrity: sha512-QUjFTvenYmThQgm6feCftf/TdxIjqr9V87MUUXh7iuG983/HehNd3HkYf0AENBE4GyHuvE68+1FB5Qd4hZjZHQ==} engines: {node: '>=18'} peerDependencies: zod: ^3.0.0 - peerDependenciesMeta: - zod: - optional: true - '@ai-sdk/google@0.0.10': - resolution: {integrity: sha512-3TYNGrGnzQpUSwGebSVch3FH477FzDv7wBTw9roBh2sjqr6xGd7lmFeNxm9/wXoZ1ryEM6gHuf2LLot3jiBXLA==} + '@ai-sdk/anthropic@0.0.35': + resolution: {integrity: sha512-bCyonZyMQZdYTfSazLFRzQ2teuVc8icejbG6JhIZJvoQpcA5zzmruLD335vAf1hhGAFrHjrLNB+u4vTL52pfbQ==} engines: {node: '>=18'} peerDependencies: zod: ^3.0.0 - peerDependenciesMeta: - zod: - optional: true - '@ai-sdk/mistral@0.0.9': - resolution: {integrity: sha512-+77VVID+ENXYMADNi/h2+qc+eEaoe0fYodmAE6hcZGM+yTxL+Ko2RlsX1b3popJ85PdzozBZOcXra1MqLHHF6A==} + '@ai-sdk/azure@0.0.18': + resolution: {integrity: sha512-dPJRVjRISJn/v15nUiAo+nfh1KG286iPnaq5cR7FCi1j2P3pY12nFnTYlGJYY91jSsme5Vo4kPKmTphbV8XdCw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.0.0 + + '@ai-sdk/cohere@0.0.8': + resolution: {integrity: sha512-W1YbJp6Aytn/UU0u4Io/xTbfVQ8RZ9wt0UHl6o/GZUdY/h60S1SYTI4PTA+JvZGBoSjZvD5DAGBknfoKCcffqA==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.0.0 + + '@ai-sdk/google-vertex@0.0.19': + resolution: {integrity: sha512-RvftHR7IFU/hRbNznT+5Wyqx8+wA39cg2DGnlhi28PofY7y70V5crZpbESFGCFPXq253ZlO4nwssFXtDWhcQRg==} + engines: {node: '>=18'} + peerDependencies: + '@google-cloud/vertexai': ^1.3.1 + + '@ai-sdk/google@0.0.30': + resolution: {integrity: sha512-sGkUc7qyJ5LuIkJ+Lsq+VH8o2521biggU45F1oK3jLi9Y6tMA854ZNye5YhgeWVjv56FOBy/okLYvwxPodHfAw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.0.0 + + '@ai-sdk/mistral@0.0.26': + resolution: {integrity: sha512-v14/KRcpsbriNAZE1KB68RseG3Z4IBZ9g9oVqnc8i/wiTLfD9MXgJoCrJqezAtkaFb/wpdpshHPNCLgAXyrBwg==} engines: {node: '>=18'} peerDependencies: zod: ^3.0.0 - peerDependenciesMeta: - zod: - optional: true '@ai-sdk/openai@0.0.10': resolution: {integrity: sha512-q6x8UVkKE67n9Apy3toPPd5SpLfqxSUQ8t+ADm1A3FXRHMCJUD/1wt8EGSkIPmLZDsLpLXW/NZG+PdgOpHYvAw==} @@ -246,6 +273,12 @@ packages: zod: optional: true + '@ai-sdk/openai@0.0.40': + resolution: {integrity: sha512-9Iq1UaBHA5ZzNv6j3govuKGXrbrjuWvZIgWNJv4xzXlDMHu9P9hnqlBr/Aiay54WwCuTVNhTzAUTfFgnTs2kbQ==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.0.0 + '@ai-sdk/provider-utils@0.0.6': resolution: {integrity: sha512-SxOZgSxnaVlW04/SjfMoAD45kWOWTWx0QcZrHaQnePooLhyk5AqQpgauPijL803uoJPCKfzd0UBv1gSKvWiU0A==} engines: {node: '>=18'} @@ -255,8 +288,8 @@ packages: zod: optional: true - '@ai-sdk/provider-utils@0.0.8': - resolution: {integrity: sha512-J/ZNvFhORd3gCeK3jFvNrxp1Dnvy6PvPq21RJ+OsIEjsoHeKQaHALCWG0aJunXDuzd+Mck/lCg7LqA0qmIbHIg==} + '@ai-sdk/provider-utils@1.0.5': + resolution: {integrity: sha512-XfOawxk95X3S43arn2iQIFyWGMi0DTxsf9ETc6t7bh91RPWOOPYN1tsmS5MTKD33OGJeaDQ/gnVRzXUCRBrckQ==} engines: {node: '>=18'} peerDependencies: zod: ^3.0.0 @@ -264,29 +297,46 @@ packages: zod: optional: true - '@ai-sdk/provider-utils@1.0.0': - resolution: {integrity: sha512-Akq7MmGQII8xAuoVjJns/n/2BTUrF6qaXIj/3nEuXk/hPSdETlLWRSrjrTmLpte1VIPE5ecNzTALST+6nz47UQ==} + '@ai-sdk/provider@0.0.14': + resolution: {integrity: sha512-gaQ5Y033nro9iX1YUjEDFDRhmMcEiCk56LJdIUbX5ozEiCNCfpiBpEqrjSp/Gp5RzBS2W0BVxfG7UGW6Ezcrzg==} + engines: {node: '>=18'} + + '@ai-sdk/provider@0.0.3': + resolution: {integrity: sha512-0B8P6VZpJ6F9yS9BpmJBYSqIaIfeRtL5tD5SP+qgR8y0pPwalIbRMUFiLz9YUT6g70MJsCLpm/2/fX3cfAYCJw==} + engines: {node: '>=18'} + + '@ai-sdk/react@0.0.36': + resolution: {integrity: sha512-LAxFLtHKN1BajTNP8YzyVIwXn45LSunmvm2Svrfq5oPOyJ2gUEjtaONnbme4mwRXJ1kk6b63SLrgOIXbz6XF/g==} engines: {node: '>=18'} peerDependencies: + react: ^18 || ^19 zod: ^3.0.0 peerDependenciesMeta: + react: + optional: true zod: optional: true - '@ai-sdk/provider@0.0.11': - resolution: {integrity: sha512-VTipPQ92Moa5Ovg/nZIc8yNoIFfukZjUHZcQMduJbiUh3CLQyrBAKTEV9AwjPy8wgVxj3+GZjon0yyOJKhfp5g==} - engines: {node: '>=18'} - - '@ai-sdk/provider@0.0.3': - resolution: {integrity: sha512-0B8P6VZpJ6F9yS9BpmJBYSqIaIfeRtL5tD5SP+qgR8y0pPwalIbRMUFiLz9YUT6g70MJsCLpm/2/fX3cfAYCJw==} + '@ai-sdk/solid@0.0.27': + resolution: {integrity: sha512-uEvlT7MBkRRZxk7teDgtrGe7G3U9tspgSJUvupdOE2d0a4vLlHrMqHb07ao97/Xo1aVHh7oBF9XIgRzKnFtbIQ==} engines: {node: '>=18'} + peerDependencies: + solid-js: ^1.7.7 + peerDependenciesMeta: + solid-js: + optional: true - '@ai-sdk/provider@0.0.5': - resolution: {integrity: sha512-TZDldBZ5clAsNwJ2PSeo/b1uILj9a2lvi0rnOj2RCNZDgaVqFRVIAnKyeHusCRv2lzhPIw03B3fiGI6VoLzOAA==} + '@ai-sdk/svelte@0.0.29': + resolution: {integrity: sha512-7vrh61wXPVfy19nS4CqyAC3UWjsOgj/b94PCccVTGFoqbmVSa0VptXPYoFfgPTP/W71v7TjXqeq1ygLc4noTZw==} engines: {node: '>=18'} + peerDependencies: + svelte: ^3.0.0 || ^4.0.0 + peerDependenciesMeta: + svelte: + optional: true - '@ai-sdk/ui-utils@0.0.9': - resolution: {integrity: sha512-RdC68yG1abpFQgpm3Tcn4hMbRzpRj0BXbphhwSpMwHqPQu4c/n82tYYJvhGB+rRXs/qLftLBS1NtrhqEYSVZTg==} + '@ai-sdk/ui-utils@0.0.24': + resolution: {integrity: sha512-NBhhICWJ5vAkN4BJnP/MyT+fOB6rTlGlsKGQwvjlhNxdrY1/jXqe2ikNkCbCSEz20IDk82bmg2JJBM96g1O3Ig==} engines: {node: '>=18'} peerDependencies: zod: ^3.0.0 @@ -294,6 +344,15 @@ packages: zod: optional: true + '@ai-sdk/vue@0.0.28': + resolution: {integrity: sha512-ZnDjkkUH/9xoXqJEmyrG9Z8z7DKBnp2uyCd9ZVI8QSqKOaP0jOwhv8THUXlIqDEF+ULLGMWm0XeY/L7i3CMYTA==} + engines: {node: '>=18'} + peerDependencies: + vue: ^3.3.4 + peerDependenciesMeta: + vue: + optional: true + '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -302,6 +361,131 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@ark/schema@0.2.0': + resolution: {integrity: sha512-IkNWCSHdjaoemMXpps4uFHEAQzwJPbTAS8K2vcQpk90sa+eNBuPSVyB/81/Qyl1VYW0iX3ceGC5NL/OznQv1jg==} + + '@ark/util@0.1.0': + resolution: {integrity: sha512-qCLYICQoCy3kEKDVwirQp8qvxhY7NJd8BhhoHaj1l3wCFAk9NUbcDsxAkPStZEMdPI/d7NcbGJe8SWZuRG2twQ==} + + '@aws-crypto/crc32@5.2.0': + resolution: {integrity: sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==} + engines: {node: '>=16.0.0'} + + '@aws-crypto/sha256-browser@5.2.0': + resolution: {integrity: sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==} + + '@aws-crypto/sha256-js@5.2.0': + resolution: {integrity: sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==} + engines: {node: '>=16.0.0'} + + '@aws-crypto/supports-web-crypto@5.2.0': + resolution: {integrity: sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==} + + '@aws-crypto/util@5.2.0': + resolution: {integrity: sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==} + + '@aws-sdk/client-bedrock-runtime@3.602.0': + resolution: {integrity: sha512-m6+Yey6/4OBEYuBvoiz5Z5O3dkOrkUcIj9LkFLuXDUllb4UNWWc8ePUnQ4xQpWEyQELceeOPSs5ngdZiHrCemw==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/client-sso-oidc@3.600.0': + resolution: {integrity: sha512-7+I8RWURGfzvChyNQSyj5/tKrqRbzRl7H+BnTOf/4Vsw1nFOi5ROhlhD4X/Y0QCTacxnaoNcIrqnY7uGGvVRzw==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/client-sso@3.598.0': + resolution: {integrity: sha512-nOI5lqPYa+YZlrrzwAJywJSw3MKVjvu6Ge2fCqQUNYMfxFB0NAaDFnl0EPjXi+sEbtCuz/uWE77poHbqiZ+7Iw==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/client-sts@3.600.0': + resolution: {integrity: sha512-KQG97B7LvTtTiGmjlrG1LRAY8wUvCQzrmZVV5bjrJ/1oXAU7DITYwVbSJeX9NWg6hDuSk0VE3MFwIXS2SvfLIA==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/core@3.598.0': + resolution: {integrity: sha512-HaSjt7puO5Cc7cOlrXFCW0rtA0BM9lvzjl56x0A20Pt+0wxXGeTOZZOkXQIepbrFkV2e/HYukuT9e99vXDm59g==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/credential-provider-env@3.598.0': + resolution: {integrity: sha512-vi1khgn7yXzLCcgSIzQrrtd2ilUM0dWodxj3PQ6BLfP0O+q1imO3hG1nq7DVyJtq7rFHs6+9N8G4mYvTkxby2w==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/credential-provider-http@3.598.0': + resolution: {integrity: sha512-N7cIafi4HVlQvEgvZSo1G4T9qb/JMLGMdBsDCT5XkeJrF0aptQWzTFH0jIdZcLrMYvzPcuEyO3yCBe6cy/ba0g==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/credential-provider-ini@3.598.0': + resolution: {integrity: sha512-/ppcIVUbRwDIwJDoYfp90X3+AuJo2mvE52Y1t2VSrvUovYn6N4v95/vXj6LS8CNDhz2jvEJYmu+0cTMHdhI6eA==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@aws-sdk/client-sts': ^3.598.0 + + '@aws-sdk/credential-provider-node@3.600.0': + resolution: {integrity: sha512-1pC7MPMYD45J7yFjA90SxpR0yaSvy+yZiq23aXhAPZLYgJBAxHLu0s0mDCk/piWGPh8+UGur5K0bVdx4B1D5hw==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/credential-provider-process@3.598.0': + resolution: {integrity: sha512-rM707XbLW8huMk722AgjVyxu2tMZee++fNA8TJVNgs1Ma02Wx6bBrfIvlyK0rCcIRb0WdQYP6fe3Xhiu4e8IBA==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/credential-provider-sso@3.598.0': + resolution: {integrity: sha512-5InwUmrAuqQdOOgxTccRayMMkSmekdLk6s+az9tmikq0QFAHUCtofI+/fllMXSR9iL6JbGYi1940+EUmS4pHJA==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/credential-provider-web-identity@3.598.0': + resolution: {integrity: sha512-GV5GdiMbz5Tz9JO4NJtRoFXjW0GPEujA0j+5J/B723rTN+REHthJu48HdBKouHGhdzkDWkkh1bu52V02Wprw8w==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@aws-sdk/client-sts': ^3.598.0 + + '@aws-sdk/middleware-host-header@3.598.0': + resolution: {integrity: sha512-WiaG059YBQwQraNejLIi0gMNkX7dfPZ8hDIhvMr5aVPRbaHH8AYF3iNSsXYCHvA2Cfa1O9haYXsuMF9flXnCmA==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/middleware-logger@3.598.0': + resolution: {integrity: sha512-bxBjf/VYiu3zfu8SYM2S9dQQc3tz5uBAOcPz/Bt8DyyK3GgOpjhschH/2XuUErsoUO1gDJqZSdGOmuHGZQn00Q==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/middleware-recursion-detection@3.598.0': + resolution: {integrity: sha512-vjT9BeFY9FeN0f8hm2l6F53tI0N5bUq6RcDkQXKNabXBnQxKptJRad6oP2X5y3FoVfBLOuDkQgiC2940GIPxtQ==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/middleware-user-agent@3.598.0': + resolution: {integrity: sha512-4tjESlHG5B5MdjUaLK7tQs/miUtHbb6deauQx8ryqSBYOhfHVgb1ZnzvQR0bTrhpqUg0WlybSkDaZAICf9xctg==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/region-config-resolver@3.598.0': + resolution: {integrity: sha512-oYXhmTokSav4ytmWleCr3rs/1nyvZW/S0tdi6X7u+dLNL5Jee+uMxWGzgOrWK6wrQOzucLVjS4E/wA11Kv2GTw==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/token-providers@3.598.0': + resolution: {integrity: sha512-TKY1EVdHVBnZqpyxyTHdpZpa1tUpb6nxVeRNn1zWG8QB5MvH4ALLd/jR+gtmWDNQbIG4cVuBOZFVL8hIYicKTA==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@aws-sdk/client-sso-oidc': ^3.598.0 + + '@aws-sdk/types@3.598.0': + resolution: {integrity: sha512-742uRl6z7u0LFmZwDrFP6r1wlZcgVPw+/TilluDJmCAR8BgRw3IR+743kUXKBGd8QZDRW2n6v/PYsi/AWCDDMQ==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/util-endpoints@3.598.0': + resolution: {integrity: sha512-Qo9UoiVVZxcOEdiOMZg3xb1mzkTxrhd4qSlg5QQrfWPJVx/QOg+Iy0NtGxPtHtVZNHZxohYwDwV/tfsnDSE2gQ==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/util-locate-window@3.568.0': + resolution: {integrity: sha512-3nh4TINkXYr+H41QaPelCceEB2FXP3fxp93YZXB/kqJvX0U9j0N0Uk45gvsjmEPzG8XxkPEeLIfT2I1M7A6Lig==} + engines: {node: '>=16.0.0'} + + '@aws-sdk/util-user-agent-browser@3.598.0': + resolution: {integrity: sha512-36Sxo6F+ykElaL1mWzWjlg+1epMpSe8obwhCN1yGE7Js9ywy5U6k6l+A3q3YM9YRbm740sNxncbwLklMvuhTKw==} + + '@aws-sdk/util-user-agent-node@3.598.0': + resolution: {integrity: sha512-oyWGcOlfTdzkC6SVplyr0AGh54IMrDxbhg5RxJ5P+V4BKfcDoDcZV9xenUk9NsOi9MuUjxMumb9UJGkDhM1m0A==} + engines: {node: '>=16.0.0'} + peerDependencies: + aws-crt: '>=1.0.0' + peerDependenciesMeta: + aws-crt: + optional: true + '@babel/code-frame@7.24.2': resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} engines: {node: '>=6.9.0'} @@ -374,102 +558,16 @@ packages: '@cloudflare/workers-types@4.20240502.0': resolution: {integrity: sha512-OB1jIyPOzyOcuZFHWhsQnkRLN6u8+jmU9X3T4KZlGgn3Ivw8pBiswhLOp+yFeChR3Y4/5+V0hPFRko5SReordg==} - '@codemirror/autocomplete@6.16.0': - resolution: {integrity: sha512-P/LeCTtZHRTCU4xQsa89vSKWecYv1ZqwzOd5topheGRf+qtacFgBeIMQi3eL8Kt/BUNvxUWkx+5qP2jlGoARrg==} - peerDependencies: - '@codemirror/language': ^6.0.0 - '@codemirror/state': ^6.0.0 - '@codemirror/view': ^6.0.0 - '@lezer/common': ^1.0.0 - - '@codemirror/commands@6.5.0': - resolution: {integrity: sha512-rK+sj4fCAN/QfcY9BEzYMgp4wwL/q5aj/VfNSoH1RWPF9XS/dUwBkvlL3hpWgEjOqlpdN1uLC9UkjJ4tmyjJYg==} - - '@codemirror/lang-angular@0.1.3': - resolution: {integrity: sha512-xgeWGJQQl1LyStvndWtruUvb4SnBZDAu/gvFH/ZU+c0W25tQR8e5hq7WTwiIY2dNxnf+49mRiGI/9yxIwB6f5w==} - - '@codemirror/lang-cpp@6.0.2': - resolution: {integrity: sha512-6oYEYUKHvrnacXxWxYa6t4puTlbN3dgV662BDfSH8+MfjQjVmP697/KYTDOqpxgerkvoNm7q5wlFMBeX8ZMocg==} - - '@codemirror/lang-css@6.2.1': - resolution: {integrity: sha512-/UNWDNV5Viwi/1lpr/dIXJNWiwDxpw13I4pTUAsNxZdg6E0mI2kTQb0P2iHczg1Tu+H4EBgJR+hYhKiHKko7qg==} - - '@codemirror/lang-go@6.0.0': - resolution: {integrity: sha512-mMT4YeYdKGjnffDBOhr1ur1glee4oV/rfMe28vzazNHZkSt7vSiuHiBcgr3L/79Cl2RIjFdpQ1XMD0/T8Rx64g==} - - '@codemirror/lang-html@6.4.9': - resolution: {integrity: sha512-aQv37pIMSlueybId/2PVSP6NPnmurFDVmZwzc7jszd2KAF8qd4VBbvNYPXWQq90WIARjsdVkPbw29pszmHws3Q==} - - '@codemirror/lang-java@6.0.1': - resolution: {integrity: sha512-OOnmhH67h97jHzCuFaIEspbmsT98fNdhVhmA3zCxW0cn7l8rChDhZtwiwJ/JOKXgfm4J+ELxQihxaI7bj7mJRg==} - - '@codemirror/lang-javascript@6.2.2': - resolution: {integrity: sha512-VGQfY+FCc285AhWuwjYxQyUQcYurWlxdKYT4bqwr3Twnd5wP5WSeu52t4tvvuWmljT4EmgEgZCqSieokhtY8hg==} - - '@codemirror/lang-json@6.0.1': - resolution: {integrity: sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==} - - '@codemirror/lang-less@6.0.2': - resolution: {integrity: sha512-EYdQTG22V+KUUk8Qq582g7FMnCZeEHsyuOJisHRft/mQ+ZSZ2w51NupvDUHiqtsOy7It5cHLPGfHQLpMh9bqpQ==} - - '@codemirror/lang-liquid@6.2.1': - resolution: {integrity: sha512-J1Mratcm6JLNEiX+U2OlCDTysGuwbHD76XwuL5o5bo9soJtSbz2g6RU3vGHFyS5DC8rgVmFSzi7i6oBftm7tnA==} - - '@codemirror/lang-markdown@6.2.5': - resolution: {integrity: sha512-Hgke565YcO4fd9pe2uLYxnMufHO5rQwRr+AAhFq8ABuhkrjyX8R5p5s+hZUTdV60O0dMRjxKhBLxz8pu/MkUVA==} - - '@codemirror/lang-php@6.0.1': - resolution: {integrity: sha512-ublojMdw/PNWa7qdN5TMsjmqkNuTBD3k6ndZ4Z0S25SBAiweFGyY68AS3xNcIOlb6DDFDvKlinLQ40vSLqf8xA==} - - '@codemirror/lang-python@6.1.6': - resolution: {integrity: sha512-ai+01WfZhWqM92UqjnvorkxosZ2aq2u28kHvr+N3gu012XqY2CThD67JPMHnGceRfXPDBmn1HnyqowdpF57bNg==} - - '@codemirror/lang-rust@6.0.1': - resolution: {integrity: sha512-344EMWFBzWArHWdZn/NcgkwMvZIWUR1GEBdwG8FEp++6o6vT6KL9V7vGs2ONsKxxFUPXKI0SPcWhyYyl2zPYxQ==} - - '@codemirror/lang-sass@6.0.2': - resolution: {integrity: sha512-l/bdzIABvnTo1nzdY6U+kPAC51czYQcOErfzQ9zSm9D8GmNPD0WTW8st/CJwBTPLO8jlrbyvlSEcN20dc4iL0Q==} - - '@codemirror/lang-sql@6.6.4': - resolution: {integrity: sha512-n+FVfKGut+frOvor9dU5pFUalcP614WBNQ9IT1kOUj1t6LFLjWHi2I9DdxXnJuxqFV9jTyYF79coDV3ilSJqCw==} - - '@codemirror/lang-vue@0.1.3': - resolution: {integrity: sha512-QSKdtYTDRhEHCfo5zOShzxCmqKJvgGrZwDQSdbvCRJ5pRLWBS7pD/8e/tH44aVQT6FKm0t6RVNoSUWHOI5vNug==} - - '@codemirror/lang-wast@6.0.2': - resolution: {integrity: sha512-Imi2KTpVGm7TKuUkqyJ5NRmeFWF7aMpNiwHnLQe0x9kmrxElndyH0K6H/gXtWwY6UshMRAhpENsgfpSwsgmC6Q==} - - '@codemirror/lang-xml@6.1.0': - resolution: {integrity: sha512-3z0blhicHLfwi2UgkZYRPioSgVTo9PV5GP5ducFH6FaHy0IAJRg+ixj5gTR1gnT/glAIC8xv4w2VL1LoZfs+Jg==} - - '@codemirror/lang-yaml@6.1.1': - resolution: {integrity: sha512-HV2NzbK9bbVnjWxwObuZh5FuPCowx51mEfoFT9y3y+M37fA3+pbxx4I7uePuygFzDsAmCTwQSc/kXh/flab4uw==} - - '@codemirror/language-data@6.5.1': - resolution: {integrity: sha512-0sWxeUSNlBr6OmkqybUTImADFUP0M3P0IiSde4nc24bz/6jIYzqYSgkOSLS+CBIoW1vU8Q9KUWXscBXeoMVC9w==} - - '@codemirror/language@6.10.1': - resolution: {integrity: sha512-5GrXzrhq6k+gL5fjkAwt90nYDmjlzTIJV8THnxNFtNKWotMIlzzN+CpqxqwXOECnUdOndmSeWntVrVcv5axWRQ==} - - '@codemirror/legacy-modes@6.4.0': - resolution: {integrity: sha512-5m/K+1A6gYR0e+h/dEde7LoGimMjRtWXZFg4Lo70cc8HzjSdHe3fLwjWMR0VRl5KFT1SxalSap7uMgPKF28wBA==} - - '@codemirror/lint@6.7.0': - resolution: {integrity: sha512-LTLOL2nT41ADNSCCCCw8Q/UmdAFzB23OUYSjsHTdsVaH0XEo+orhuqbDNWzrzodm14w6FOxqxpmy4LF8Lixqjw==} - - '@codemirror/search@6.5.6': - resolution: {integrity: sha512-rpMgcsh7o0GuCDUXKPvww+muLA1pDJaFrpq/CCHtpQJYz8xopu4D1hPcKRoDD0YlF8gZaqTNIRa4VRBWyhyy7Q==} - - '@codemirror/state@6.4.1': - resolution: {integrity: sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==} - - '@codemirror/view@6.26.3': - resolution: {integrity: sha512-gmqxkPALZjkgSxIeeweY/wGQXBfwTUaLs8h7OKtSwfbj9Ct3L11lD+u1sS7XHppxFQoMDiMDp07P9f3I2jWOHw==} - '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} + '@drizzle-team/brocli@0.8.2': + resolution: {integrity: sha512-zTrFENsqGvOkBOuHDC1pXCkDXNd2UhP4lI3gYGhQ1R1SPeAAfqzPsV1dcpMy4uNU6kB5VpU5NGhvwxVNETR02A==} + + '@electric-sql/pglite@0.2.0': + resolution: {integrity: sha512-9ckSTnr9ChwY03lojiHM3HIOKFen72koxo44hb94Qz/L9fNejg1riwbfl2ROghA/z4ntCuyT+Zwl5pkbrSX3Aw==} + '@esbuild-kit/core-utils@3.3.2': resolution: {integrity: sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==} @@ -1026,6 +1124,9 @@ packages: cpu: [x64] os: [win32] + '@exodus/schemasafe@1.3.0': + resolution: {integrity: sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==} + '@fastify/busboy@2.1.1': resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} engines: {node: '>=14'} @@ -1042,6 +1143,20 @@ packages: '@fontsource-variable/inter@5.0.18': resolution: {integrity: sha512-rJzSrtJ3b7djiGFvRuTe6stDfbYJGhdQSfn2SI2WfXviee7Er0yKAHE5u7FU7OWVQQQ1x3+cxdmx9NdiAkcrcA==} + '@gcornut/valibot-json-schema@0.31.0': + resolution: {integrity: sha512-3xGptCurm23e7nuPQkdrE5rEs1FeTPHhAUsBuwwqG4/YeZLwJOoYZv+fmsppUEfo5y9lzUwNQrNqLS/q7HMc7g==} + hasBin: true + + '@google-cloud/vertexai@1.4.0': + resolution: {integrity: sha512-3D06+qlpbotQINBUbxC5c9zuv5nM5VLnaQZCcktfvSHnue3jsQ1sG1+/ZSkx8E9OidpVNAh5iCcAEZd8N7hPnQ==} + engines: {node: '>=18.0.0'} + + '@hapi/hoek@9.3.0': + resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} + + '@hapi/topo@5.1.0': + resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} + '@inquirer/confirm@3.1.12': resolution: {integrity: sha512-s5Sod79QsBBi5Qm7zxCq9DcAD0i7WRcjd/LzsiIAWqWZKW4+OJTGrCgVSLGIHTulwbZgdxM4AAxpCXe86hv4/Q==} engines: {node: '>=18'} @@ -1090,56 +1205,32 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - '@lezer/common@1.2.1': - resolution: {integrity: sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==} - - '@lezer/cpp@1.1.2': - resolution: {integrity: sha512-macwKtyeUO0EW86r3xWQCzOV9/CF8imJLpJlPv3sDY57cPGeUZ8gXWOWNlJr52TVByMV3PayFQCA5SHEERDmVQ==} - - '@lezer/css@1.1.8': - resolution: {integrity: sha512-7JhxupKuMBaWQKjQoLtzhGj83DdnZY9MckEOG5+/iLKNK2ZJqKc6hf6uc0HjwCX7Qlok44jBNqZhHKDhEhZYLA==} - - '@lezer/go@1.0.0': - resolution: {integrity: sha512-co9JfT3QqX1YkrMmourYw2Z8meGC50Ko4d54QEcQbEYpvdUvN4yb0NBZdn/9ertgvjsySxHsKzH3lbm3vqJ4Jw==} - - '@lezer/highlight@1.2.0': - resolution: {integrity: sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==} - - '@lezer/html@1.3.9': - resolution: {integrity: sha512-MXxeCMPyrcemSLGaTQEZx0dBUH0i+RPl8RN5GwMAzo53nTsd/Unc/t5ZxACeQoyPUM5/GkPLRUs2WliOImzkRA==} + '@lexical/clipboard@0.16.1': + resolution: {integrity: sha512-0dWs/SwKS5KPpuf6fUVVt9vSCl6HAqcDGhSITw/okv0rrIlXTUT6WhVsMJtXfFxTyVvwMeOecJHvQH3i/jRQtA==} - '@lezer/java@1.1.2': - resolution: {integrity: sha512-3j8X70JvYf0BZt8iSRLXLkt0Ry1hVUgH6wT32yBxH/Xi55nW2VMhc1Az4SKwu4YGSmxCm1fsqDDcHTuFjC8pmg==} + '@lexical/history@0.16.1': + resolution: {integrity: sha512-WQhScx0TJeKSQAnEkRpIaWdUXqirrNrom2MxbBUc/32zEUMm9FzV7nRGknvUabEFUo7vZq6xTZpOExQJqHInQA==} - '@lezer/javascript@1.4.16': - resolution: {integrity: sha512-84UXR3N7s11MPQHWgMnjb9571fr19MmXnr5zTv2XX0gHXXUvW3uPJ8GCjKrfTXmSdfktjRK0ayKklw+A13rk4g==} + '@lexical/html@0.16.1': + resolution: {integrity: sha512-vbtAdCvQ3PaAqa5mFmtmrvbiAvjCu1iXBAJ0bsHqFXCF2Sba5LwHVe8dUAOTpfEZEMbiHfjul6b5fj4vNPGF2A==} - '@lezer/json@1.0.2': - resolution: {integrity: sha512-xHT2P4S5eeCYECyKNPhr4cbEL9tc8w83SPwRC373o9uEdrvGKTZoJVAGxpOsZckMlEh9W23Pc72ew918RWQOBQ==} + '@lexical/list@0.16.1': + resolution: {integrity: sha512-i9YhLAh5N6YO9dP+R1SIL9WEdCKeTiQQYVUzj84vDvX5DIBxMPUjTmMn3LXu9T+QO3h1s2L/vJusZASrl45eAw==} - '@lezer/lr@1.4.0': - resolution: {integrity: sha512-Wst46p51km8gH0ZUmeNrtpRYmdlRHUpN1DQd3GFAyKANi8WVz8c2jHYTf1CVScFaCjQw1iO3ZZdqGDxQPRErTg==} + '@lexical/plain-text@0.16.1': + resolution: {integrity: sha512-GjY4ylrBZIaAVIF8IFnmW0XGyHAuRmWA6gKB8iTTlsjgFrCHFIYC74EeJSp309O0Hflg9rRBnKoX1TYruFHVwA==} - '@lezer/markdown@1.3.0': - resolution: {integrity: sha512-ErbEQ15eowmJUyT095e9NJc3BI9yZ894fjSDtHftD0InkfUBGgnKSU6dvan9jqsZuNHg2+ag/1oyDRxNsENupQ==} + '@lexical/selection@0.16.1': + resolution: {integrity: sha512-+nK3RvXtyQvQDq7AZ46JpphmM33pwuulwiRfeXR5T9iFQTtgWOEjsAi/KKX7vGm70BxACfiSxy5QCOgBWFwVJg==} - '@lezer/php@1.0.2': - resolution: {integrity: sha512-GN7BnqtGRpFyeoKSEqxvGvhJQiI4zkgmYnDk/JIyc7H7Ifc1tkPnUn/R2R8meH3h/aBf5rzjvU8ZQoyiNDtDrA==} + '@lexical/table@0.16.1': + resolution: {integrity: sha512-GWb0/MM1sVXpi1p2HWWOBldZXASMQ4c6WRNYnRmq7J/aB5N66HqQgJGKp3m66Kz4k1JjhmZfPs7F018qIBhnFQ==} - '@lezer/python@1.1.13': - resolution: {integrity: sha512-AdbRAtdQq94PfTNd4kqMEJhH2fqa2JdoyyqqVewY6w34w2Gi6dg2JuOtOgR21Bi0zP9r0KjSSHOUq/tP7FVT8A==} + '@lexical/text@0.16.1': + resolution: {integrity: sha512-Os/nKQegORTrKKN6vL3/FMVszyzyqaotlisPynvTaHTUC+yY4uyjM2hlF93i5a2ixxyiPLF9bDroxUP96TMPXg==} - '@lezer/rust@1.0.2': - resolution: {integrity: sha512-Lz5sIPBdF2FUXcWeCu1//ojFAZqzTQNRga0aYv6dYXqJqPfMdCAI0NzajWUd4Xijj1IKJLtjoXRPMvTKWBcqKg==} - - '@lezer/sass@1.0.6': - resolution: {integrity: sha512-w/RCO2dIzZH1To8p+xjs8cE+yfgGus8NZ/dXeWl/QzHyr+TeBs71qiE70KPImEwvTsmEjoWh0A5SxMzKd5BWBQ==} - - '@lezer/xml@1.0.5': - resolution: {integrity: sha512-VFouqOzmUWfIg+tfmpcdV33ewtK+NSwd4ngSe1aG7HFb4BN0ExyY1b8msp+ndFrnlG4V4iC8yXacjFtrwERnaw==} - - '@lezer/yaml@1.0.3': - resolution: {integrity: sha512-GuBLekbw9jDBDhGur82nuwkxKQ+a3W5H0GfaAthDXcAu+XdpS43VlnxA9E9hllkpSP5ellRDKjLLj7Lu9Wr6xA==} + '@lexical/utils@0.16.1': + resolution: {integrity: sha512-BVyJxDQi/rIxFTDjf2zE7rMDKSuEaeJ4dybHRa/hRERt85gavGByQawSLeQlTjLaYLVsy+x7wCcqh2fNhlLf0g==} '@melt-ui/pp@0.3.1': resolution: {integrity: sha512-FiKsJNvPLpZv5yNCXTJJm3yOsJi3Fq6RCWmqitEAPGIGufd7UsMP/qElpMG87LtByyBg7gXikh78iPIXxzyf/g==} @@ -1186,6 +1277,16 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} + '@opentelemetry/api@1.9.0': + resolution: {integrity: sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==} + engines: {node: '>=8.0.0'} + + '@pdf-lib/standard-fonts@1.0.0': + resolution: {integrity: sha512-hU30BK9IUN/su0Mn9VdlVKsWBS6GyhVfqjwl1FjZN4TxP6cCw0jP2w7V3Hf5uX7M0AZJ16vey9yE0ny7Sa59ZA==} + + '@pdf-lib/upng@1.0.1': + resolution: {integrity: sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ==} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -1198,6 +1299,10 @@ packages: '@polka/url@1.0.0-next.25': resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==} + '@poppinss/macroable@1.0.2': + resolution: {integrity: sha512-xhhEcEvhQC8mP5oOr5hbE4CmUgmw/IPV1jhpGg2xSkzoFrt9i8YVqBQt9744EFesi5F7pBheWozg63RUBM/5JA==} + engines: {node: '>=18.16.0'} + '@promptbook/utils@0.49.0': resolution: {integrity: sha512-E/dMOZw5L84BLkODUrIu4f3hwU3QdozZRQ7ea24qYaRqNuOEw2Z8hZ6Wp/2o3Yj1+3+LS+I28zYMjOgv23PHdA==} @@ -1296,60 +1401,254 @@ packages: cpu: [x64] os: [win32] + '@sideway/address@4.1.5': + resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} + + '@sideway/formula@3.0.1': + resolution: {integrity: sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==} + + '@sideway/pinpoint@2.0.0': + resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} + '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sinclair/typebox@0.32.35': + resolution: {integrity: sha512-Ul3YyOTU++to8cgNkttakC0dWvpERr6RYoHO2W47DLbFvrwBDJUY31B1sImH6JZSYc4Kt4PyHtoPNu+vL2r2dA==} + '@sindresorhus/is@5.6.0': resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} engines: {node: '>=14.16'} - '@sqlite.org/sqlite-wasm@3.45.3-build1': - resolution: {integrity: sha512-/eLqlKmyPoHpYZkg5VmEZpknisOShPX59Rm//zKHFVqqCk/7/mYT/i5CrooRQDqzfhq0Bm8IDynC+fbL0C1WfQ==} - hasBin: true + '@smithy/abort-controller@3.1.1': + resolution: {integrity: sha512-MBJBiidoe+0cTFhyxT8g+9g7CeVccLM0IOKKUMCNQ1CNMJ/eIfoo0RTfVrXOONEI1UCN1W+zkiHSbzUNE9dZtQ==} + engines: {node: '>=16.0.0'} - '@sveltejs/adapter-auto@3.2.0': - resolution: {integrity: sha512-She5nKT47kwHE18v9NMe6pbJcvULr82u0V3yZ0ej3n1laWKGgkgdEABE9/ak5iDPs93LqsBkuIo51kkwCLBjJA==} - peerDependencies: - '@sveltejs/kit': ^2.0.0 + '@smithy/config-resolver@3.0.5': + resolution: {integrity: sha512-SkW5LxfkSI1bUC74OtfBbdz+grQXYiPYolyu8VfpLIjEoN/sHVBlLeGXMQ1vX4ejkgfv6sxVbQJ32yF2cl1veA==} + engines: {node: '>=16.0.0'} - '@sveltejs/adapter-cloudflare@4.4.0': - resolution: {integrity: sha512-sh2kSapbQq3QJFOYcva4MtdzZStoAq2Lr93heGFCR924/OywnW2/Ru7/sxByXW806kvLgStZO+hKZh3Va8WVjw==} - peerDependencies: - '@sveltejs/kit': ^2.0.0 - wrangler: ^3.28.4 + '@smithy/core@2.3.2': + resolution: {integrity: sha512-in5wwt6chDBcUv1Lw1+QzZxN9fBffi+qOixfb65yK4sDuKG7zAUO9HAFqmVzsZM3N+3tTyvZjtnDXePpvp007Q==} + engines: {node: '>=16.0.0'} - '@sveltejs/kit@2.5.7': - resolution: {integrity: sha512-6uedTzrb7nQrw6HALxnPrPaXdIN2jJJTzTIl96Z3P5NiG+OAfpdPbrWrvkJ3GN4CfWqrmU4dJqwMMRMTD/C7ow==} - engines: {node: '>=18.13'} - hasBin: true - peerDependencies: - '@sveltejs/vite-plugin-svelte': ^3.0.0 - svelte: ^4.0.0 || ^5.0.0-next.0 - vite: ^5.0.3 + '@smithy/credential-provider-imds@3.2.0': + resolution: {integrity: sha512-0SCIzgd8LYZ9EJxUjLXBmEKSZR/P/w6l7Rz/pab9culE/RWuqelAKGJvn5qUOl8BgX8Yj5HWM50A5hiB/RzsgA==} + engines: {node: '>=16.0.0'} - '@sveltejs/vite-plugin-svelte-inspector@2.1.0': - resolution: {integrity: sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==} - engines: {node: ^18.0.0 || >=20} - peerDependencies: - '@sveltejs/vite-plugin-svelte': ^3.0.0 - svelte: ^4.0.0 || ^5.0.0-next.0 - vite: ^5.0.0 + '@smithy/eventstream-codec@3.1.2': + resolution: {integrity: sha512-0mBcu49JWt4MXhrhRAlxASNy0IjDRFU+aWNDRal9OtUJvJNiwDuyKMUONSOjLjSCeGwZaE0wOErdqULer8r7yw==} - '@sveltejs/vite-plugin-svelte@3.1.0': - resolution: {integrity: sha512-sY6ncCvg+O3njnzbZexcVtUqOBE3iYmQPJ9y+yXSkOwG576QI/xJrBnQSRXFLGwJNBa0T78JEKg5cIR0WOAuUw==} - engines: {node: ^18.0.0 || >=20} - peerDependencies: - svelte: ^4.0.0 || ^5.0.0-next.0 - vite: ^5.0.0 + '@smithy/eventstream-serde-browser@3.0.5': + resolution: {integrity: sha512-dEyiUYL/ekDfk+2Ra4GxV+xNnFoCmk1nuIXg+fMChFTrM2uI/1r9AdiTYzPqgb72yIv/NtAj6C3dG//1wwgakQ==} + engines: {node: '>=16.0.0'} - '@swc/helpers@0.5.11': - resolution: {integrity: sha512-YNlnKRWF2sVojTpIyzwou9XoTNbzbzONwRhOoniEioF1AtaitTvVZblaQRrAzChWQ1bLYyYSWzM18y4WwgzJ+A==} + '@smithy/eventstream-serde-config-resolver@3.0.3': + resolution: {integrity: sha512-NVTYjOuYpGfrN/VbRQgn31x73KDLfCXCsFdad8DiIc3IcdxL+dYA9zEQPyOP7Fy2QL8CPy2WE4WCUD+ZsLNfaQ==} + engines: {node: '>=16.0.0'} - '@szmarczak/http-timer@5.0.1': - resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} - engines: {node: '>=14.16'} + '@smithy/eventstream-serde-node@3.0.4': + resolution: {integrity: sha512-mjlG0OzGAYuUpdUpflfb9zyLrBGgmQmrobNT8b42ZTsGv/J03+t24uhhtVEKG/b2jFtPIHF74Bq+VUtbzEKOKg==} + engines: {node: '>=16.0.0'} - '@tailwindcss/typography@0.5.13': + '@smithy/eventstream-serde-universal@3.0.4': + resolution: {integrity: sha512-Od9dv8zh3PgOD7Vj4T3HSuox16n0VG8jJIM2gvKASL6aCtcS8CfHZDWe1Ik3ZXW6xBouU+45Q5wgoliWDZiJ0A==} + engines: {node: '>=16.0.0'} + + '@smithy/fetch-http-handler@3.2.4': + resolution: {integrity: sha512-kBprh5Gs5h7ug4nBWZi1FZthdqSM+T7zMmsZxx0IBvWUn7dK3diz2SHn7Bs4dQGFDk8plDv375gzenDoNwrXjg==} + + '@smithy/hash-node@3.0.3': + resolution: {integrity: sha512-2ctBXpPMG+B3BtWSGNnKELJ7SH9e4TNefJS0cd2eSkOOROeBnnVBnAy9LtJ8tY4vUEoe55N4CNPxzbWvR39iBw==} + engines: {node: '>=16.0.0'} + + '@smithy/invalid-dependency@3.0.3': + resolution: {integrity: sha512-ID1eL/zpDULmHJbflb864k72/SNOZCADRc9i7Exq3RUNJw6raWUSlFEQ+3PX3EYs++bTxZB2dE9mEHTQLv61tw==} + + '@smithy/is-array-buffer@2.2.0': + resolution: {integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==} + engines: {node: '>=14.0.0'} + + '@smithy/is-array-buffer@3.0.0': + resolution: {integrity: sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==} + engines: {node: '>=16.0.0'} + + '@smithy/middleware-content-length@3.0.5': + resolution: {integrity: sha512-ILEzC2eyxx6ncej3zZSwMpB5RJ0zuqH7eMptxC4KN3f+v9bqT8ohssKbhNR78k/2tWW+KS5Spw+tbPF4Ejyqvw==} + engines: {node: '>=16.0.0'} + + '@smithy/middleware-endpoint@3.1.0': + resolution: {integrity: sha512-5y5aiKCEwg9TDPB4yFE7H6tYvGFf1OJHNczeY10/EFF8Ir8jZbNntQJxMWNfeQjC1mxPsaQ6mR9cvQbf+0YeMw==} + engines: {node: '>=16.0.0'} + + '@smithy/middleware-retry@3.0.14': + resolution: {integrity: sha512-7ZaWZJOjUxa5hgmuMspyt8v/zVsh0GXYuF7OvCmdcbVa/xbnKQoYC+uYKunAqRGTkxjOyuOCw9rmFUFOqqC0eQ==} + engines: {node: '>=16.0.0'} + + '@smithy/middleware-serde@3.0.3': + resolution: {integrity: sha512-puUbyJQBcg9eSErFXjKNiGILJGtiqmuuNKEYNYfUD57fUl4i9+mfmThtQhvFXU0hCVG0iEJhvQUipUf+/SsFdA==} + engines: {node: '>=16.0.0'} + + '@smithy/middleware-stack@3.0.3': + resolution: {integrity: sha512-r4klY9nFudB0r9UdSMaGSyjyQK5adUyPnQN/ZM6M75phTxOdnc/AhpvGD1fQUvgmqjQEBGCwpnPbDm8pH5PapA==} + engines: {node: '>=16.0.0'} + + '@smithy/node-config-provider@3.1.4': + resolution: {integrity: sha512-YvnElQy8HR4vDcAjoy7Xkx9YT8xZP4cBXcbJSgm/kxmiQu08DwUwj8rkGnyoJTpfl/3xYHH+d8zE+eHqoDCSdQ==} + engines: {node: '>=16.0.0'} + + '@smithy/node-http-handler@3.1.4': + resolution: {integrity: sha512-+UmxgixgOr/yLsUxcEKGH0fMNVteJFGkmRltYFHnBMlogyFdpzn2CwqWmxOrfJELhV34v0WSlaqG1UtE1uXlJg==} + engines: {node: '>=16.0.0'} + + '@smithy/property-provider@3.1.3': + resolution: {integrity: sha512-zahyOVR9Q4PEoguJ/NrFP4O7SMAfYO1HLhB18M+q+Z4KFd4V2obiMnlVoUFzFLSPeVt1POyNWneHHrZaTMoc/g==} + engines: {node: '>=16.0.0'} + + '@smithy/protocol-http@4.1.0': + resolution: {integrity: sha512-dPVoHYQ2wcHooGXg3LQisa1hH0e4y0pAddPMeeUPipI1tEOqL6A4N0/G7abeq+K8wrwSgjk4C0wnD1XZpJm5aA==} + engines: {node: '>=16.0.0'} + + '@smithy/querystring-builder@3.0.3': + resolution: {integrity: sha512-vyWckeUeesFKzCDaRwWLUA1Xym9McaA6XpFfAK5qI9DKJ4M33ooQGqvM4J+LalH4u/Dq9nFiC8U6Qn1qi0+9zw==} + engines: {node: '>=16.0.0'} + + '@smithy/querystring-parser@3.0.3': + resolution: {integrity: sha512-zahM1lQv2YjmznnfQsWbYojFe55l0SLG/988brlLv1i8z3dubloLF+75ATRsqPBboUXsW6I9CPGE5rQgLfY0vQ==} + engines: {node: '>=16.0.0'} + + '@smithy/service-error-classification@3.0.3': + resolution: {integrity: sha512-Jn39sSl8cim/VlkLsUhRFq/dKDnRUFlfRkvhOJaUbLBXUsLRLNf9WaxDv/z9BjuQ3A6k/qE8af1lsqcwm7+DaQ==} + engines: {node: '>=16.0.0'} + + '@smithy/shared-ini-file-loader@3.1.4': + resolution: {integrity: sha512-qMxS4hBGB8FY2GQqshcRUy1K6k8aBWP5vwm8qKkCT3A9K2dawUwOIJfqh9Yste/Bl0J2lzosVyrXDj68kLcHXQ==} + engines: {node: '>=16.0.0'} + + '@smithy/signature-v4@3.1.2': + resolution: {integrity: sha512-3BcPylEsYtD0esM4Hoyml/+s7WP2LFhcM3J2AGdcL2vx9O60TtfpDOL72gjb4lU8NeRPeKAwR77YNyyGvMbuEA==} + engines: {node: '>=16.0.0'} + + '@smithy/smithy-client@3.1.12': + resolution: {integrity: sha512-wtm8JtsycthkHy1YA4zjIh2thJgIQ9vGkoR639DBx5lLlLNU0v4GARpQZkr2WjXue74nZ7MiTSWfVrLkyD8RkA==} + engines: {node: '>=16.0.0'} + + '@smithy/types@3.3.0': + resolution: {integrity: sha512-IxvBBCTFDHbVoK7zIxqA1ZOdc4QfM5HM7rGleCuHi7L1wnKv5Pn69xXJQ9hgxH60ZVygH9/JG0jRgtUncE3QUA==} + engines: {node: '>=16.0.0'} + + '@smithy/url-parser@3.0.3': + resolution: {integrity: sha512-pw3VtZtX2rg+s6HMs6/+u9+hu6oY6U7IohGhVNnjbgKy86wcIsSZwgHrFR+t67Uyxvp4Xz3p3kGXXIpTNisq8A==} + + '@smithy/util-base64@3.0.0': + resolution: {integrity: sha512-Kxvoh5Qtt0CDsfajiZOCpJxgtPHXOKwmM+Zy4waD43UoEMA+qPxxa98aE/7ZhdnBFZFXMOiBR5xbcaMhLtznQQ==} + engines: {node: '>=16.0.0'} + + '@smithy/util-body-length-browser@3.0.0': + resolution: {integrity: sha512-cbjJs2A1mLYmqmyVl80uoLTJhAcfzMOyPgjwAYusWKMdLeNtzmMz9YxNl3/jRLoxSS3wkqkf0jwNdtXWtyEBaQ==} + + '@smithy/util-body-length-node@3.0.0': + resolution: {integrity: sha512-Tj7pZ4bUloNUP6PzwhN7K386tmSmEET9QtQg0TgdNOnxhZvCssHji+oZTUIuzxECRfG8rdm2PMw2WCFs6eIYkA==} + engines: {node: '>=16.0.0'} + + '@smithy/util-buffer-from@2.2.0': + resolution: {integrity: sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==} + engines: {node: '>=14.0.0'} + + '@smithy/util-buffer-from@3.0.0': + resolution: {integrity: sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==} + engines: {node: '>=16.0.0'} + + '@smithy/util-config-provider@3.0.0': + resolution: {integrity: sha512-pbjk4s0fwq3Di/ANL+rCvJMKM5bzAQdE5S/6RL5NXgMExFAi6UgQMPOm5yPaIWPpr+EOXKXRonJ3FoxKf4mCJQ==} + engines: {node: '>=16.0.0'} + + '@smithy/util-defaults-mode-browser@3.0.14': + resolution: {integrity: sha512-0iwTgKKmAIf+vFLV8fji21Jb2px11ktKVxbX6LIDPAUJyWQqGqBVfwba7xwa1f2FZUoolYQgLvxQEpJycXuQ5w==} + engines: {node: '>= 10.0.0'} + + '@smithy/util-defaults-mode-node@3.0.14': + resolution: {integrity: sha512-e9uQarJKfXApkTMMruIdxHprhcXivH1flYCe8JRDTzkkLx8dA3V5J8GZlST9yfDiRWkJpZJlUXGN9Rc9Ade3OQ==} + engines: {node: '>= 10.0.0'} + + '@smithy/util-endpoints@2.0.5': + resolution: {integrity: sha512-ReQP0BWihIE68OAblC/WQmDD40Gx+QY1Ez8mTdFMXpmjfxSyz2fVQu3A4zXRfQU9sZXtewk3GmhfOHswvX+eNg==} + engines: {node: '>=16.0.0'} + + '@smithy/util-hex-encoding@3.0.0': + resolution: {integrity: sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ==} + engines: {node: '>=16.0.0'} + + '@smithy/util-middleware@3.0.3': + resolution: {integrity: sha512-l+StyYYK/eO3DlVPbU+4Bi06Jjal+PFLSMmlWM1BEwyLxZ3aKkf1ROnoIakfaA7mC6uw3ny7JBkau4Yc+5zfWw==} + engines: {node: '>=16.0.0'} + + '@smithy/util-retry@3.0.3': + resolution: {integrity: sha512-AFw+hjpbtVApzpNDhbjNG5NA3kyoMs7vx0gsgmlJF4s+yz1Zlepde7J58zpIRIsdjc+emhpAITxA88qLkPF26w==} + engines: {node: '>=16.0.0'} + + '@smithy/util-stream@3.1.3': + resolution: {integrity: sha512-FIv/bRhIlAxC0U7xM1BCnF2aDRPq0UaelqBHkM2lsCp26mcBbgI0tCVTv+jGdsQLUmAMybua/bjDsSu8RQHbmw==} + engines: {node: '>=16.0.0'} + + '@smithy/util-uri-escape@3.0.0': + resolution: {integrity: sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg==} + engines: {node: '>=16.0.0'} + + '@smithy/util-utf8@2.3.0': + resolution: {integrity: sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==} + engines: {node: '>=14.0.0'} + + '@smithy/util-utf8@3.0.0': + resolution: {integrity: sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==} + engines: {node: '>=16.0.0'} + + '@sodaru/yup-to-json-schema@2.0.1': + resolution: {integrity: sha512-lWb0Wiz8KZ9ip/dY1eUqt7fhTPmL24p6Hmv5Fd9pzlzAdw/YNcWZr+tiCT4oZ4Zyxzi9+1X4zv82o7jYvcFxYA==} + + '@sveltejs/adapter-auto@3.2.0': + resolution: {integrity: sha512-She5nKT47kwHE18v9NMe6pbJcvULr82u0V3yZ0ej3n1laWKGgkgdEABE9/ak5iDPs93LqsBkuIo51kkwCLBjJA==} + peerDependencies: + '@sveltejs/kit': ^2.0.0 + + '@sveltejs/adapter-cloudflare@4.4.0': + resolution: {integrity: sha512-sh2kSapbQq3QJFOYcva4MtdzZStoAq2Lr93heGFCR924/OywnW2/Ru7/sxByXW806kvLgStZO+hKZh3Va8WVjw==} + peerDependencies: + '@sveltejs/kit': ^2.0.0 + wrangler: ^3.28.4 + + '@sveltejs/kit@2.5.7': + resolution: {integrity: sha512-6uedTzrb7nQrw6HALxnPrPaXdIN2jJJTzTIl96Z3P5NiG+OAfpdPbrWrvkJ3GN4CfWqrmU4dJqwMMRMTD/C7ow==} + engines: {node: '>=18.13'} + hasBin: true + peerDependencies: + '@sveltejs/vite-plugin-svelte': ^3.0.0 + svelte: ^4.0.0 || ^5.0.0-next.0 + vite: ^5.0.3 + + '@sveltejs/vite-plugin-svelte-inspector@2.1.0': + resolution: {integrity: sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==} + engines: {node: ^18.0.0 || >=20} + peerDependencies: + '@sveltejs/vite-plugin-svelte': ^3.0.0 + svelte: ^4.0.0 || ^5.0.0-next.0 + vite: ^5.0.0 + + '@sveltejs/vite-plugin-svelte@3.1.0': + resolution: {integrity: sha512-sY6ncCvg+O3njnzbZexcVtUqOBE3iYmQPJ9y+yXSkOwG576QI/xJrBnQSRXFLGwJNBa0T78JEKg5cIR0WOAuUw==} + engines: {node: ^18.0.0 || >=20} + peerDependencies: + svelte: ^4.0.0 || ^5.0.0-next.0 + vite: ^5.0.0 + + '@swc/helpers@0.5.11': + resolution: {integrity: sha512-YNlnKRWF2sVojTpIyzwou9XoTNbzbzONwRhOoniEioF1AtaitTvVZblaQRrAzChWQ1bLYyYSWzM18y4WwgzJ+A==} + + '@szmarczak/http-timer@5.0.1': + resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} + engines: {node: '>=14.16'} + + '@tailwindcss/typography@0.5.13': resolution: {integrity: sha512-ADGcJ8dX21dVVHIwTRgzrcunY6YY9uSlAHHGVKvkA+vLc5qLwEszvKts40lx7z0qc4clpjclwLeK5rVCV2P/uw==} peerDependencies: tailwindcss: '>=3.0.0 || insiders' @@ -1416,6 +1715,9 @@ packages: '@types/http-cache-semantics@4.0.4': resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/katex@0.16.7': resolution: {integrity: sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==} @@ -1434,6 +1736,9 @@ packages: '@types/node@20.14.9': resolution: {integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==} + '@types/pg@8.11.6': + resolution: {integrity: sha512-/2WmmBXHLsfRqzfHW7BNZ8SbYzE8OSk7i3WjFYvfgRHj7S1xj+16Je5fUKv3lVdVzk/zn9TXOqf+avFCFIE0yQ==} + '@types/pug@2.0.10': resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==} @@ -1443,6 +1748,9 @@ packages: '@types/statuses@2.0.5': resolution: {integrity: sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==} + '@types/validator@13.12.0': + resolution: {integrity: sha512-nH45Lk7oPIJ1RVOF6JgFI6Dy0QpHEzq4QecZhvguxYPDwT8c93prCMqAtiIttm39voZ+DDR+qkNnMpJmMBRqag==} + '@types/which@2.0.2': resolution: {integrity: sha512-113D3mDkZDjo+EeUEHCFy0qniNc1ZpecGiAU7WSo7YDoSzolZIQKpYFHrPpjkB2nuyahcKfrmLXeQlh7gqJYdw==} @@ -1455,11 +1763,13 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@ungap/structured-clone@1.2.0': - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@vinejs/compiler@2.5.0': + resolution: {integrity: sha512-hg4ekaB5Y2zh+IWzBiC/WCDWrIfpVnKu/ubUvelKlidc/VbulsexoFRw5kJGHZenPVI5YzNnDeTdYSALkTV7jQ==} + engines: {node: '>=18.0.0'} - '@ungap/with-resolvers@0.1.0': - resolution: {integrity: sha512-g7f0IkJdPW2xhY7H4iE72DAsIyfuwEFc6JWc2tYFwKDMWWAF699vGjrM348cwQuOXgHpe1gWFe+Eiyjx/ewvvw==} + '@vinejs/vine@1.8.0': + resolution: {integrity: sha512-Qq3XxbA26jzqS9ICifkqzT399lMQZ2fWtqeV3luI2as+UIK7qDifJFU2Q4W3q3IB5VXoWxgwAZSZEO0em9I/qQ==} + engines: {node: '>=18.16.0'} '@vitest/browser@1.6.0': resolution: {integrity: sha512-3Wpp9h1hf++rRVPvoXevkdHybLhJVn7MwIMKMIh08tVaoDMmT6fnNhbP222Z48V9PptpYeA5zvH9Ct/ZcaAzmQ==} @@ -1570,27 +1880,24 @@ packages: resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} engines: {node: '>= 14'} - ai@3.1.12: - resolution: {integrity: sha512-XlurBw1sdgQCFmCTPYjKjpm+fPS6iY+tLb/PYNUEjZn3bhqosAkcqUkGJTsFP49OMAWO1Lm2oPthCakKcn6Lzw==} + ai@3.3.0: + resolution: {integrity: sha512-ndW4G9jw8ImIsTWK2iderOWMVn4H3B6u+KHlZ7hJEvFBdBYTFQ62qTw10AmHsQefjwHRC/2evr9qf79EkSwo9Q==} engines: {node: '>=18'} peerDependencies: openai: ^4.42.0 - react: ^18.2.0 - solid-js: ^1.7.7 + react: ^18 || ^19 + sswr: ^2.1.0 svelte: ^3.0.0 || ^4.0.0 - vue: ^3.3.4 zod: ^3.0.0 peerDependenciesMeta: openai: optional: true react: optional: true - solid-js: + sswr: optional: true svelte: optional: true - vue: - optional: true zod: optional: true @@ -1643,6 +1950,9 @@ packages: aria-query@5.3.0: resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} + arktype@2.0.0-beta.0: + resolution: {integrity: sha512-fE3ssMiXjr/bLqFPzlDhRlXngdyHQreu7p7i8+dtcY1CA+f8WrVUcue6JxywhnqEJXPG4HOcIwQcC+q4VfeUMQ==} + as-table@1.0.55: resolution: {integrity: sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==} @@ -1704,6 +2014,9 @@ packages: resolution: {integrity: sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==} engines: {node: '>=0.6'} + bignumber.js@9.1.2: + resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} + binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} @@ -1725,6 +2038,9 @@ packages: bluebird@3.4.7: resolution: {integrity: sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==} + bowser@2.11.0: + resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} + brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -1747,6 +2063,9 @@ packages: resolution: {integrity: sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==} engines: {node: '>=8.0.0'} + buffer-equal-constant-time@1.0.1: + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -1776,6 +2095,10 @@ packages: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} + camelcase@8.0.0: + resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} + engines: {node: '>=16'} + caniuse-lite@1.0.30001615: resolution: {integrity: sha512-1IpazM5G3r38meiae0bHRnPhz+CBQ3ZLqbQMtrg+AsTPKAXgW38JNsXkyZ+v8waCsDmPq87lmfun5Q2AGysNEQ==} @@ -1820,10 +2143,6 @@ packages: class-variance-authority@0.7.0: resolution: {integrity: sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==} - cli-color@2.0.4: - resolution: {integrity: sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==} - engines: {node: '>=0.10'} - cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} @@ -1832,6 +2151,9 @@ packages: resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} engines: {node: '>= 12'} + client-only@0.0.1: + resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -1844,12 +2166,6 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} - codemirror@6.0.1: - resolution: {integrity: sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==} - - coincident@1.2.3: - resolution: {integrity: sha512-Uxz3BMTWIslzeWjuQnizGWVg0j6khbvHUQ8+5BdM7WuJEm4ALXwq3wluYoB+uF68uPBz/oUOeJnYURKyfjexlA==} - color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -1909,9 +2225,6 @@ packages: resolution: {integrity: sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==} engines: {node: '>= 14'} - crelt@1.0.6: - resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==} - cross-fetch@4.0.0: resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} @@ -1940,10 +2253,6 @@ packages: csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - d@1.0.2: - resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==} - engines: {node: '>=0.12'} - data-uri-to-buffer@2.0.2: resolution: {integrity: sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==} @@ -1959,6 +2268,9 @@ packages: resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} engines: {node: '>=18'} + dayjs@1.11.12: + resolution: {integrity: sha512-Rt2g+nTbLlDWZTwwrIXjy9MeiZmSDI375FvZs72ngxx8PDC6YXOeR3q5LAuPzjZQxhiWdRKac7RKV+YyQYfYIg==} + debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -2038,9 +2350,6 @@ packages: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - difflib@0.2.4: - resolution: {integrity: sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==} - dlv@1.1.3: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} @@ -2054,16 +2363,12 @@ packages: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} - dreamopt@0.8.0: - resolution: {integrity: sha512-vyJTp8+mC+G+5dfgsY+r3ckxlz+QMX40VjPQsZc5gxVAxLmi64TBoVkP54A/pRAXMXsbu2GMMBrZPxNv23waMg==} - engines: {node: '>=0.4.0'} - - drizzle-kit@0.21.2: - resolution: {integrity: sha512-U87IhZyCt/9d0ZT/Na3KFJVY31tSxtTx/n9UMcWFpW/5c2Ede39xiCG5efNV/0iimsv97UIRtDI0ldLBW5lbcg==} + drizzle-kit@0.24.0: + resolution: {integrity: sha512-rUl5Rf5HLOVkAwHEVEi8xgulIRWzoys0q77RHGCxv5e9v8AI3JGFg7Ug5K1kn513RwNZbuNJMUKOXo0j8kPRgg==} hasBin: true - drizzle-orm@0.30.10: - resolution: {integrity: sha512-IRy/QmMWw9lAQHpwbUh1b8fcn27S/a9zMIzqea1WNOxK9/4EB8gIo+FZWLiPXzl2n9ixGSv8BhsLZiOppWEwBw==} + drizzle-orm@0.33.0: + resolution: {integrity: sha512-SHy72R2Rdkz0LEq0PSG/IdvnT3nGiWuRk+2tXZQ90GVq/XQhpCzu/EFT3V2rox+w8MlkBQxifF8pCStNYnERfA==} peerDependencies: '@aws-sdk/client-rds-data': '>=3' '@cloudflare/workers-types': '>=3' @@ -2073,6 +2378,8 @@ packages: '@op-engineering/op-sqlite': '>=2' '@opentelemetry/api': ^1.4.1 '@planetscale/database': '>=1' + '@prisma/client': '*' + '@tidbcloud/serverless': '*' '@types/better-sqlite3': '*' '@types/pg': '*' '@types/react': '>=18' @@ -2087,6 +2394,7 @@ packages: mysql2: '>=2' pg: '>=8' postgres: '>=3' + prisma: '*' react: '>=18' sql.js: '>=1' sqlite3: '>=5' @@ -2107,6 +2415,10 @@ packages: optional: true '@planetscale/database': optional: true + '@prisma/client': + optional: true + '@tidbcloud/serverless': + optional: true '@types/better-sqlite3': optional: true '@types/pg': @@ -2135,6 +2447,8 @@ packages: optional: true postgres: optional: true + prisma: + optional: true react: optional: true sql.js: @@ -2148,6 +2462,9 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + ecdsa-sig-formatter@1.0.11: + resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} + edge-paths@3.0.5: resolution: {integrity: sha512-sB7vSrDnFa4ezWQk9nZ/n0FdpdUuC6R1EOrlU3DL+bovcNFK28rqu2emmAUjujYEJTWIgQGqgVVWUZXMnc8iWg==} engines: {node: '>=14.0.0'} @@ -2172,32 +2489,20 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} - env-paths@3.0.0: - resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - es5-ext@0.10.64: - resolution: {integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==} - engines: {node: '>=0.10'} - - es6-iterator@2.0.3: - resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} - es6-promise@3.3.1: resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} - es6-symbol@3.1.4: - resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} - engines: {node: '>=0.12'} - - es6-weak-map@2.0.3: - resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} - esbuild-register@3.5.0: resolution: {integrity: sha512-+4G/XmakeBAsvJuDugJvtyF1x+XJT4FMocynNpxrvEBViirpfUn2PgNpCHedfWhF4WokNsO/OvMKrmJOIJsI5A==} peerDependencies: esbuild: '>=0.12 <1' + esbuild-runner@2.2.2: + resolution: {integrity: sha512-fRFVXcmYVmSmtYm2mL8RlUASt2TDkGh3uRcvHFOKNr/T58VrfVeKD9uT9nlgxk96u0LS0ehS/GY7Da/bXWKkhw==} + hasBin: true + peerDependencies: + esbuild: '*' + esbuild@0.17.19: resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} engines: {node: '>=12'} @@ -2238,10 +2543,6 @@ packages: esm-env@1.0.0: resolution: {integrity: sha512-Cf6VksWPsTuW01vU9Mk/3vRue91Zevka5SjyNf3nEpokFRuqt/KjUQoGAwq9qMmhpLTHmXzSIrFRw8zxWzmFBA==} - esniff@2.0.1: - resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==} - engines: {node: '>=0.10'} - esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} @@ -2267,9 +2568,6 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - event-emitter@0.3.5: - resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} - event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} @@ -2294,8 +2592,8 @@ packages: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} - ext@1.7.0: - resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} + extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} extract-zip@2.0.1: resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==} @@ -2312,6 +2610,10 @@ packages: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} + fast-xml-parser@4.2.5: + resolution: {integrity: sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==} + hasBin: true + fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} @@ -2357,6 +2659,12 @@ packages: resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} engines: {node: '>=12.20.0'} + formsnap@1.0.1: + resolution: {integrity: sha512-TvU9CoLSiacW1c7wXhLiyVpyy/LBfG0CEFDbs3M3jrsxBSrkTpsuhbQ8JYKY3CNCmIhZlgxCH+Vqr7RBF9G53w==} + peerDependencies: + svelte: ^4.0.0 || ^5.0.0-next.1 + sveltekit-superforms: ^2.3.0 + fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} @@ -2383,12 +2691,18 @@ packages: fstream@1.0.12: resolution: {integrity: sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==} engines: {node: '>=0.6'} + deprecated: This package is no longer supported. function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - gc-hook@0.3.1: - resolution: {integrity: sha512-E5M+O/h2o7eZzGhzRZGex6hbB3k4NWqO0eA+OzLRLXxhdbYPajZnynPwAtphnh+cRHPwsj5Z80dqZlfI4eK55A==} + gaxios@6.7.0: + resolution: {integrity: sha512-DSrkyMTfAnAm4ks9Go20QGOcXEyW/NmZhvTYBU2rb4afBB393WIMQPWPEDMl/k8xqiNN9HYq2zao3oWXsdl2Tg==} + engines: {node: '>=14'} + + gcp-metadata@6.1.0: + resolution: {integrity: sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==} + engines: {node: '>=14'} geckodriver@4.4.0: resolution: {integrity: sha512-Y/Np2VkAhBkJoFAIY3pKH3rICUcR5rH9VD6EHwh0CqUIh6Opzr/NFwfcQenYfbRT/659R15/35LpA1s6h9wPPg==} @@ -2450,16 +2764,16 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - glob@8.1.0: - resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} - engines: {node: '>=12'} - globalyzer@0.1.0: resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==} globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + google-auth-library@9.13.0: + resolution: {integrity: sha512-p9Y03Uzp/Igcs36zAaB0XTSwZ8Y0/tpYiz5KIde5By+H9DCVUSYtDWZu6aFXsWTqENMb8BD/pDT3hR8NVrPkfA==} + engines: {node: '>=14'} + got@12.6.1: resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} engines: {node: '>=14.16'} @@ -2474,8 +2788,9 @@ packages: resolution: {integrity: sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} - hanji@0.0.5: - resolution: {integrity: sha512-Abxw1Lq+TnYiL4BueXqMau222fPSPMFtya8HdpWsz/xVAhifXou71mPh/kY2+08RgFcVccjG3uZHs6K5HAe3zw==} + gtoken@7.1.0: + resolution: {integrity: sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==} + engines: {node: '>=14.0.0'} has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} @@ -2492,9 +2807,6 @@ packages: headers-polyfill@4.0.3: resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} - heap@0.2.7: - resolution: {integrity: sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==} - highlight.js@11.9.0: resolution: {integrity: sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==} engines: {node: '>=12.0.0'} @@ -2586,9 +2898,6 @@ packages: is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} - is-promise@2.2.2: - resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} - is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} @@ -2618,6 +2927,9 @@ packages: resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true + joi@17.13.3: + resolution: {integrity: sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -2636,12 +2948,15 @@ packages: canvas: optional: true + json-bigint@1.0.0: + resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==} + json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - json-diff@0.9.0: - resolution: {integrity: sha512-cVnggDrVkAAA3OvFfHpFEhOnmcsUpleEKq4d4O8sQWWSH40MBrWstKigVB1kGrgLWzuom+7rRdaCsnBD6VyObQ==} - hasBin: true + json-schema-to-ts@3.1.0: + resolution: {integrity: sha512-UeVN/ery4/JeXI8h4rM8yZPxsH+KqPi/84qFxHfTGHZnWnK9D0UU9ZGYO+6XAaJLqCWMiks+ARuFOKAiSxJCHA==} + engines: {node: '>=16'} json-schema@0.4.0: resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} @@ -2654,6 +2969,15 @@ packages: jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + just-clone@6.2.0: + resolution: {integrity: sha512-1IynUYEc/HAwxhi3WDpIpxJbZpMCvvrrmZVqvj9EhpvbH8lls7HhdhiByjL7DkAaWlLIzpC0Xc/VPvy/UxLNjA==} + + jwa@2.0.0: + resolution: {integrity: sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==} + + jws@4.0.0: + resolution: {integrity: sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==} + katex@0.16.10: resolution: {integrity: sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==} hasBin: true @@ -2677,6 +3001,9 @@ packages: resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==} engines: {node: '>= 0.6.3'} + lexical@0.16.1: + resolution: {integrity: sha512-+R05d3+N945OY8pTUjTqQrWoApjC+ctzvjnmNETtx9WmVAaiW0tQVG+AYLt5pDGY8dQXtd4RPorvnxBTECt9SA==} + lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} @@ -2710,9 +3037,6 @@ packages: lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - lodash.throttle@4.1.1: - resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==} - lodash.zip@4.2.0: resolution: {integrity: sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==} @@ -2745,9 +3069,6 @@ packages: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} - lru-queue@0.1.0: - resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} - lucide-svelte@0.378.0: resolution: {integrity: sha512-T7hV1sfOc94AWE5GOJ6r9wGEsR4h4TJr8d4Z0sM8O0e3IBcmeIvEGRAA6jCp7NGy4PeGrn5Tju6Y2JwJQntNrQ==} peerDependencies: @@ -2774,8 +3095,8 @@ packages: engines: {node: '>= 18'} hasBin: true - memoizee@0.4.15: - resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==} + memoize-weak@1.0.2: + resolution: {integrity: sha512-gj39xkrjEw7nCn4nJ1M5ms6+MyMlyiGmttzsqAUsAKn6bYKwuTHh/AO3cKPF8IBrTIYTxb0wWXFs3E//Y8VoWQ==} merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -2910,9 +3231,6 @@ packages: resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} engines: {node: '>= 0.4.0'} - next-tick@1.1.0: - resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - node-abi@3.62.0: resolution: {integrity: sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==} engines: {node: '>=10'} @@ -2968,6 +3286,9 @@ packages: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} + obuf@1.1.2: + resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} + once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} @@ -2994,6 +3315,9 @@ packages: resolution: {integrity: sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==} engines: {node: '>= 14'} + pako@1.0.11: + resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} + parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -3029,9 +3353,54 @@ packages: pathval@1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + pdf-lib@1.17.1: + resolution: {integrity: sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw==} + pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} + pg-cloudflare@1.1.1: + resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==} + + pg-connection-string@2.6.4: + resolution: {integrity: sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==} + + pg-int8@1.0.1: + resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} + engines: {node: '>=4.0.0'} + + pg-numeric@1.0.2: + resolution: {integrity: sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==} + engines: {node: '>=4'} + + pg-pool@3.6.2: + resolution: {integrity: sha512-Htjbg8BlwXqSBQ9V8Vjtc+vzf/6fVUuak/3/XXKA9oxZprwW3IMDQTGHP+KDmVL7rtd+R1QjbnCFPuTHm3G4hg==} + peerDependencies: + pg: '>=8.0' + + pg-protocol@1.6.1: + resolution: {integrity: sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==} + + pg-types@2.2.0: + resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} + engines: {node: '>=4'} + + pg-types@4.0.2: + resolution: {integrity: sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==} + engines: {node: '>=10'} + + pg@8.12.0: + resolution: {integrity: sha512-A+LHUSnwnxrnL/tZ+OLfqR1SxLN3c/pgDztZ47Rpbsd4jUytsTtwQo/TLPRzPJMp/1pbhYVhH9cuSZLAajNfjQ==} + engines: {node: '>= 8.0.0'} + peerDependencies: + pg-native: '>=3.0.1' + peerDependenciesMeta: + pg-native: + optional: true + + pgpass@1.0.5: + resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} + picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -3105,6 +3474,41 @@ packages: resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} + postgres-array@2.0.0: + resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} + engines: {node: '>=4'} + + postgres-array@3.0.2: + resolution: {integrity: sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==} + engines: {node: '>=12'} + + postgres-bytea@1.0.0: + resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} + engines: {node: '>=0.10.0'} + + postgres-bytea@3.0.0: + resolution: {integrity: sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==} + engines: {node: '>= 6'} + + postgres-date@1.0.7: + resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} + engines: {node: '>=0.10.0'} + + postgres-date@2.1.0: + resolution: {integrity: sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==} + engines: {node: '>=12'} + + postgres-interval@1.2.0: + resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} + engines: {node: '>=0.10.0'} + + postgres-interval@3.0.0: + resolution: {integrity: sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==} + engines: {node: '>=12'} + + postgres-range@1.1.4: + resolution: {integrity: sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==} + prebuild-install@7.1.2: resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} engines: {node: '>=10'} @@ -3200,6 +3604,9 @@ packages: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} + property-expr@2.0.6: + resolution: {integrity: sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==} + proxy-agent@6.3.0: resolution: {integrity: sha512-0LdR757eTj/JfuU7TL2YCuAZnxWXu3tkJbg4Oq3geW/qFNT/32T0sp2HnZ9O0lMR4q3vwAt0+xCA8SR0WAD0og==} engines: {node: '>= 14'} @@ -3211,9 +3618,6 @@ packages: proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - proxy-target@3.0.2: - resolution: {integrity: sha512-FFE1XNwXX/FNC3/P8HiKaJSy/Qk68RitG/QEcLy/bVnTAPlgTAWPZKh0pARLAnpfXQPKyalBhk009NRTgsk8vQ==} - psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} @@ -3436,9 +3840,6 @@ packages: resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} engines: {node: '>= 10'} - sisteransi@1.0.5: - resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - smart-buffer@4.2.0: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} @@ -3454,13 +3855,6 @@ packages: solid-js@1.8.17: resolution: {integrity: sha512-E0FkUgv9sG/gEBWkHr/2XkBluHb1fkrHywUgA6o6XolPDCJ4g1HaLmQufcBBhiF36ee40q+HpG/vCZu7fLpI3Q==} - solid-swr-store@0.10.7: - resolution: {integrity: sha512-A6d68aJmRP471aWqKKPE2tpgOiR5fH4qXQNfKIec+Vap+MGQm3tvXlT8n0I8UgJSlNAsSAUuw2VTviH2h3Vv5g==} - engines: {node: '>=10'} - peerDependencies: - solid-js: ^1.2 - swr-store: ^0.10 - sorcery@0.11.0: resolution: {integrity: sha512-J69LQ22xrQB1cIFJhPfgtLuI6BpWRiWu1Y3vSsIwK/eAScqJxd/+CJlUuHQRdX2C9NGFamq+KqNywGgaThwfHw==} hasBin: true @@ -3493,21 +3887,10 @@ packages: sql.js@1.10.3: resolution: {integrity: sha512-H46aWtQkdyjZwFQgraUruy5h/DyJBbAK3EA/WEMqiqF6PGPfKBSKBj/er3dVyYqVIoYfRf5TFM/loEjtQIrqJg==} - sqlocal@0.9.0: - resolution: {integrity: sha512-/NiXQFa2+H5zkKr06SkIwjeItz5+GJerZh/rGjiT+X21k/J/29HeYd6a++iIeOtZHBd4qI4eSi8iOYq+yNk1YQ==} - peerDependencies: - drizzle-orm: '*' - kysely: '*' - peerDependenciesMeta: - drizzle-orm: - optional: true - kysely: - optional: true - - sswr@2.0.0: - resolution: {integrity: sha512-mV0kkeBHcjcb0M5NqKtKVg/uTIYNlIIniyDfSGrSfxpEdM9C365jK0z55pl9K0xAkNTJi2OAOVFQpgMPUk+V0w==} + sswr@2.1.0: + resolution: {integrity: sha512-Cqc355SYlTAaUt8iDPaC/4DPPXK925PePLMxyBKuWd5kKc5mwsG3nT9+Mq2tyguL5s7b4Jg+IRMpTRsNTAfpSQ==} peerDependencies: - svelte: ^4.0.0 + svelte: ^4.0.0 || ^5.0.0-next.0 stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -3569,14 +3952,18 @@ packages: strip-literal@2.1.0: resolution: {integrity: sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==} - style-mod@4.1.2: - resolution: {integrity: sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==} + strnum@1.0.5: + resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} engines: {node: '>=16 || 14 >=14.17'} hasBin: true + superstruct@2.0.2: + resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==} + engines: {node: '>=14.0.0'} + supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -3595,12 +3982,6 @@ packages: peerDependencies: svelte: ^3.55.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0 - svelte-codemirror-editor@1.3.0: - resolution: {integrity: sha512-Y39m9CsL0d30gGYYjJURWjKwAMEyiH42FojYiAXVKneGQ9cntOwOlloEk2Rhyy9ay29rSYYncskbnhAYNokIqw==} - peerDependencies: - codemirror: ^6.0.0 - svelte: ^3.0.0 || ^4.0.0 - svelte-filepond@0.2.2: resolution: {integrity: sha512-MnXOiX5aiyLzyn+iuG2grZDPrLQsSOyalyQQ/tl04uBzllFu6kkXCbKHMXTx6rdco8SuJzd5b5j+klD7hiY6Zg==} peerDependencies: @@ -3659,16 +4040,18 @@ packages: peerDependencies: svelte: ^3.2.1 || ^4.0.0-next.1 || ^5.0.0-next.94 - svelte@5.0.0-next.123: - resolution: {integrity: sha512-EKdXcqT795J34V8TyyUO5ExI0amjeKBECA2t7Py8QeDTMgS9//pQElD0jKsCT/sfmKV4HEoOwf7sqPYINKEfUQ==} + svelte@5.0.0-next.208: + resolution: {integrity: sha512-gYABb68367fGnY/GIpb/j3DD5DUqhVWi6EodEBVpiRA9wLQTpY8QmuPg04xut/0EHqlFU3a40wbpjJKmpL3Y/g==} engines: {node: '>=18'} - swr-store@0.10.6: - resolution: {integrity: sha512-xPjB1hARSiRaNNlUQvWSVrG5SirCjk2TmaUyzzvk69SZQan9hCJqw/5rG9iL7xElHU784GxRPISClq4488/XVw==} - engines: {node: '>=10'} + sveltekit-superforms@2.16.1: + resolution: {integrity: sha512-RNBdN43xge/ADmc3s7+pfdnRGuZ9gZiqpX6VKAQCnCI+ICc5rrPv5idYbx4iuY1Ia0lRMAq1hP0x2oHaPjB+Kg==} + peerDependencies: + '@sveltejs/kit': 1.x || 2.x + svelte: 3.x || 4.x || >=5.0.0-next.51 - swr@2.2.0: - resolution: {integrity: sha512-AjqHOv2lAhkuUdIiBu9xbuettzAzWXmCEcLONNKJRba87WAefz8Ca9d6ds/SzrPc235n1IxWYdhJ2zF3MNUaoQ==} + swr@2.2.5: + resolution: {integrity: sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg==} peerDependencies: react: ^16.11.0 || ^17.0.0 || ^18.0.0 @@ -3726,8 +4109,8 @@ packages: through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - timers-ext@0.1.7: - resolution: {integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==} + tiny-case@1.0.3: + resolution: {integrity: sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==} tiny-glob@0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} @@ -3751,6 +4134,9 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + toposort@2.0.2: + resolution: {integrity: sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==} + totalist@3.0.1: resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} engines: {node: '>=6'} @@ -3766,9 +4152,22 @@ packages: resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} engines: {node: '>=18'} + ts-algebra@2.0.0: + resolution: {integrity: sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw==} + + ts-deepmerge@7.0.1: + resolution: {integrity: sha512-JBFCmNenZdUCc+TRNCtXVM6N8y/nDQHAcpj5BlwXG/gnogjam1NunulB9ia68mnqYI446giMfpqeBFFkOleh+g==} + engines: {node: '>=14.13.1'} + ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + + tslib@2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} @@ -3795,9 +4194,6 @@ packages: resolution: {integrity: sha512-R6wDsVsoS9xYOpy8vgeBlqpdOyzJ12HNfQhC/aAKWM3YoCV9TtunJzh/QpkMgeDhkoynDcw5f1y+qF9yc/HHyg==} engines: {node: '>=16'} - type@2.7.2: - resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} - typescript@5.4.5: resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} engines: {node: '>=14.17'} @@ -3824,6 +4220,11 @@ packages: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} + unstructured-client@0.14.3: + resolution: {integrity: sha512-+QEkwNm0GtLGs3TdbaG3ES1upR5ygzM8Jtm3epqNlz1cLREruI/jl342jGRwg75N9jkrMWsye3GHgZcN4TpfCw==} + peerDependencies: + zod: '>= 3' + unzipper@0.11.6: resolution: {integrity: sha512-anERl79akvqLbAxfjIFe4hK0wsi0fH4uGLwNEl4QEnG+KKs3QQeApYgOS/f6vH2EdACUlZg35psmd/3xL2duFQ==} @@ -3848,9 +4249,27 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - vite-node@1.6.0: - resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} - engines: {node: ^18.0.0 || >=20.0.0} + uuid@10.0.0: + resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} + hasBin: true + + uuid@9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + hasBin: true + + valibot@0.31.1: + resolution: {integrity: sha512-2YYIhPrnVSz/gfT2/iXVTrSj92HwchCt9Cga/6hX4B26iCz9zkIsGTS0HjDYTZfTi1Un0X6aRvhBi1cfqs/i0Q==} + + valibot@0.35.0: + resolution: {integrity: sha512-+i2aCRkReTrd5KBN/dW2BrPOvFnU5LXTV2xjZnjnqUIO8YUx6P2+MgRrkwF2FhkexgyKq/NIZdPdknhHf5A/Ww==} + + validator@13.12.0: + resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==} + engines: {node: '>= 0.10'} + + vite-node@1.6.0: + resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true vite@5.2.11: @@ -3922,9 +4341,6 @@ packages: typescript: optional: true - w3c-keyname@2.2.8: - resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==} - w3c-xmlserializer@5.0.0: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} @@ -3988,9 +4404,6 @@ packages: engines: {node: '>=8'} hasBin: true - wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - workerd@1.20240419.0: resolution: {integrity: sha512-9yV98KpkQgG+bdEsKEW8i1AYZgxns6NVSfdOVEB2Ue1pTMtIEYfUyqUE+O2amisRrfaC3Pw4EvjtTmVaoetfeg==} engines: {node: '>=16'} @@ -4056,6 +4469,10 @@ packages: xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + xtend@4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + xxhash-wasm@1.0.2: resolution: {integrity: sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A==} @@ -4094,6 +4511,9 @@ packages: youch@3.3.3: resolution: {integrity: sha512-qSFXUk3UZBLfggAW3dJKg0BMblG5biqSF8M34E06o5CSsZtH92u9Hqmj2RzGiHDi64fhe83+4tENFP2DB6t6ZA==} + yup@1.4.0: + resolution: {integrity: sha512-wPbgkJRCqIf+OHyiTBQoJiP5PFuAXaWiJK6AmYkzQAh5/c2K9hzSApBZG5wV9KoKSePF7sAxmNSvh/13YHkFDg==} + zimmerframe@1.1.2: resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} @@ -4106,69 +4526,99 @@ packages: peerDependencies: zod: ^3.22.4 - zod@3.23.6: - resolution: {integrity: sha512-RTHJlZhsRbuA8Hmp/iNL7jnfc4nZishjsanDAfEY1QpDQZCahUp3xDzl+zfweE9BklxMUcgBgS1b7Lvie/ZVwA==} + zod-to-json-schema@3.23.2: + resolution: {integrity: sha512-uSt90Gzc/tUfyNqxnjlfBs8W6WSGpNBv0rVsNxP/BVSMHMKGdthPYff4xtCHYloJGM0CFxFsb3NbC0eqPhfImw==} + peerDependencies: + zod: ^3.23.3 + + zod@3.23.8: + resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} snapshots: '@adobe/css-tools@4.3.3': {} - '@ai-sdk/anthropic@0.0.10(zod@3.23.6)': + '@ai-sdk/amazon-bedrock@0.0.9(zod@3.23.8)': dependencies: - '@ai-sdk/provider': 0.0.3 - '@ai-sdk/provider-utils': 0.0.6(zod@3.23.6) - optionalDependencies: - zod: 3.23.6 + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + '@aws-sdk/client-bedrock-runtime': 3.602.0 + zod: 3.23.8 + transitivePeerDependencies: + - aws-crt - '@ai-sdk/google@0.0.10(zod@3.23.6)': + '@ai-sdk/anthropic@0.0.35(zod@3.23.8)': dependencies: - '@ai-sdk/provider': 0.0.3 - '@ai-sdk/provider-utils': 0.0.6(zod@3.23.6) - optionalDependencies: - zod: 3.23.6 + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + zod: 3.23.8 - '@ai-sdk/mistral@0.0.9(zod@3.23.6)': + '@ai-sdk/azure@0.0.18(zod@3.23.8)': dependencies: - '@ai-sdk/provider': 0.0.3 - '@ai-sdk/provider-utils': 0.0.6(zod@3.23.6) - optionalDependencies: - zod: 3.23.6 + '@ai-sdk/openai': 0.0.40(zod@3.23.8) + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + zod: 3.23.8 - '@ai-sdk/openai@0.0.10(zod@3.23.6)': + '@ai-sdk/cohere@0.0.8(zod@3.23.8)': dependencies: - '@ai-sdk/provider': 0.0.3 - '@ai-sdk/provider-utils': 0.0.6(zod@3.23.6) - optionalDependencies: - zod: 3.23.6 + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + zod: 3.23.8 + + '@ai-sdk/google-vertex@0.0.19(@google-cloud/vertexai@1.4.0)(zod@3.23.8)': + dependencies: + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + '@google-cloud/vertexai': 1.4.0 + json-schema: 0.4.0 + transitivePeerDependencies: + - zod + + '@ai-sdk/google@0.0.30(zod@3.23.8)': + dependencies: + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + zod: 3.23.8 + + '@ai-sdk/mistral@0.0.26(zod@3.23.8)': + dependencies: + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + zod: 3.23.8 - '@ai-sdk/provider-utils@0.0.6(zod@3.23.6)': + '@ai-sdk/openai@0.0.10(zod@3.23.8)': dependencies: '@ai-sdk/provider': 0.0.3 - eventsource-parser: 1.1.2 - nanoid: 3.3.6 - secure-json-parse: 2.7.0 + '@ai-sdk/provider-utils': 0.0.6(zod@3.23.8) optionalDependencies: - zod: 3.23.6 + zod: 3.23.8 - '@ai-sdk/provider-utils@0.0.8(zod@3.23.6)': + '@ai-sdk/openai@0.0.40(zod@3.23.8)': dependencies: - '@ai-sdk/provider': 0.0.5 + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + zod: 3.23.8 + + '@ai-sdk/provider-utils@0.0.6(zod@3.23.8)': + dependencies: + '@ai-sdk/provider': 0.0.3 eventsource-parser: 1.1.2 nanoid: 3.3.6 secure-json-parse: 2.7.0 optionalDependencies: - zod: 3.23.6 + zod: 3.23.8 - '@ai-sdk/provider-utils@1.0.0(zod@3.23.6)': + '@ai-sdk/provider-utils@1.0.5(zod@3.23.8)': dependencies: - '@ai-sdk/provider': 0.0.11 + '@ai-sdk/provider': 0.0.14 eventsource-parser: 1.1.2 nanoid: 3.3.6 secure-json-parse: 2.7.0 optionalDependencies: - zod: 3.23.6 + zod: 3.23.8 - '@ai-sdk/provider@0.0.11': + '@ai-sdk/provider@0.0.14': dependencies: json-schema: 0.4.0 @@ -4176,16 +4626,51 @@ snapshots: dependencies: json-schema: 0.4.0 - '@ai-sdk/provider@0.0.5': + '@ai-sdk/react@0.0.36(react@18.3.1)(zod@3.23.8)': dependencies: - json-schema: 0.4.0 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + '@ai-sdk/ui-utils': 0.0.24(zod@3.23.8) + swr: 2.2.5(react@18.3.1) + optionalDependencies: + react: 18.3.1 + zod: 3.23.8 - '@ai-sdk/ui-utils@0.0.9(zod@3.23.6)': + '@ai-sdk/solid@0.0.27(solid-js@1.8.17)(zod@3.23.8)': dependencies: - '@ai-sdk/provider-utils': 1.0.0(zod@3.23.6) + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + '@ai-sdk/ui-utils': 0.0.24(zod@3.23.8) + optionalDependencies: + solid-js: 1.8.17 + transitivePeerDependencies: + - zod + + '@ai-sdk/svelte@0.0.29(svelte@5.0.0-next.208)(zod@3.23.8)': + dependencies: + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + '@ai-sdk/ui-utils': 0.0.24(zod@3.23.8) + sswr: 2.1.0(svelte@5.0.0-next.208) + optionalDependencies: + svelte: 5.0.0-next.208 + transitivePeerDependencies: + - zod + + '@ai-sdk/ui-utils@0.0.24(zod@3.23.8)': + dependencies: + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) secure-json-parse: 2.7.0 optionalDependencies: - zod: 3.23.6 + zod: 3.23.8 + + '@ai-sdk/vue@0.0.28(vue@3.4.26(typescript@5.4.5))(zod@3.23.8)': + dependencies: + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + '@ai-sdk/ui-utils': 0.0.24(zod@3.23.8) + swrv: 1.0.4(vue@3.4.26(typescript@5.4.5)) + optionalDependencies: + vue: 3.4.26(typescript@5.4.5) + transitivePeerDependencies: + - zod '@alloc/quick-lru@5.2.0': {} @@ -4194,320 +4679,468 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@babel/code-frame@7.24.2': + '@ark/schema@0.2.0': dependencies: - '@babel/highlight': 7.24.5 - picocolors: 1.0.0 - - '@babel/helper-string-parser@7.24.1': {} + '@ark/util': 0.1.0 + optional: true - '@babel/helper-validator-identifier@7.24.5': {} + '@ark/util@0.1.0': + optional: true - '@babel/highlight@7.24.5': + '@aws-crypto/crc32@5.2.0': dependencies: - '@babel/helper-validator-identifier': 7.24.5 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.0.0 + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.598.0 + tslib: 2.6.2 - '@babel/parser@7.24.5': + '@aws-crypto/sha256-browser@5.2.0': dependencies: - '@babel/types': 7.24.5 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-crypto/supports-web-crypto': 5.2.0 + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.598.0 + '@aws-sdk/util-locate-window': 3.568.0 + '@smithy/util-utf8': 2.3.0 + tslib: 2.6.2 - '@babel/runtime@7.24.5': + '@aws-crypto/sha256-js@5.2.0': dependencies: - regenerator-runtime: 0.14.1 + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.598.0 + tslib: 2.6.2 - '@babel/types@7.24.5': + '@aws-crypto/supports-web-crypto@5.2.0': dependencies: - '@babel/helper-string-parser': 7.24.1 - '@babel/helper-validator-identifier': 7.24.5 - to-fast-properties: 2.0.0 + tslib: 2.6.2 - '@bundled-es-modules/cookie@2.0.0': + '@aws-crypto/util@5.2.0': dependencies: - cookie: 0.5.0 + '@aws-sdk/types': 3.598.0 + '@smithy/util-utf8': 2.3.0 + tslib: 2.6.2 - '@bundled-es-modules/statuses@1.0.1': - dependencies: - statuses: 2.0.1 + '@aws-sdk/client-bedrock-runtime@3.602.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/client-sso-oidc': 3.600.0 + '@aws-sdk/client-sts': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0) + '@aws-sdk/core': 3.598.0 + '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)) + '@aws-sdk/middleware-host-header': 3.598.0 + '@aws-sdk/middleware-logger': 3.598.0 + '@aws-sdk/middleware-recursion-detection': 3.598.0 + '@aws-sdk/middleware-user-agent': 3.598.0 + '@aws-sdk/region-config-resolver': 3.598.0 + '@aws-sdk/types': 3.598.0 + '@aws-sdk/util-endpoints': 3.598.0 + '@aws-sdk/util-user-agent-browser': 3.598.0 + '@aws-sdk/util-user-agent-node': 3.598.0 + '@smithy/config-resolver': 3.0.5 + '@smithy/core': 2.3.2 + '@smithy/eventstream-serde-browser': 3.0.5 + '@smithy/eventstream-serde-config-resolver': 3.0.3 + '@smithy/eventstream-serde-node': 3.0.4 + '@smithy/fetch-http-handler': 3.2.4 + '@smithy/hash-node': 3.0.3 + '@smithy/invalid-dependency': 3.0.3 + '@smithy/middleware-content-length': 3.0.5 + '@smithy/middleware-endpoint': 3.1.0 + '@smithy/middleware-retry': 3.0.14 + '@smithy/middleware-serde': 3.0.3 + '@smithy/middleware-stack': 3.0.3 + '@smithy/node-config-provider': 3.1.4 + '@smithy/node-http-handler': 3.1.4 + '@smithy/protocol-http': 4.1.0 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + '@smithy/url-parser': 3.0.3 + '@smithy/util-base64': 3.0.0 + '@smithy/util-body-length-browser': 3.0.0 + '@smithy/util-body-length-node': 3.0.0 + '@smithy/util-defaults-mode-browser': 3.0.14 + '@smithy/util-defaults-mode-node': 3.0.14 + '@smithy/util-endpoints': 2.0.5 + '@smithy/util-middleware': 3.0.3 + '@smithy/util-retry': 3.0.3 + '@smithy/util-stream': 3.1.3 + '@smithy/util-utf8': 3.0.0 + tslib: 2.6.2 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/client-sso-oidc@3.600.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/client-sts': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0) + '@aws-sdk/core': 3.598.0 + '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)) + '@aws-sdk/middleware-host-header': 3.598.0 + '@aws-sdk/middleware-logger': 3.598.0 + '@aws-sdk/middleware-recursion-detection': 3.598.0 + '@aws-sdk/middleware-user-agent': 3.598.0 + '@aws-sdk/region-config-resolver': 3.598.0 + '@aws-sdk/types': 3.598.0 + '@aws-sdk/util-endpoints': 3.598.0 + '@aws-sdk/util-user-agent-browser': 3.598.0 + '@aws-sdk/util-user-agent-node': 3.598.0 + '@smithy/config-resolver': 3.0.5 + '@smithy/core': 2.3.2 + '@smithy/fetch-http-handler': 3.2.4 + '@smithy/hash-node': 3.0.3 + '@smithy/invalid-dependency': 3.0.3 + '@smithy/middleware-content-length': 3.0.5 + '@smithy/middleware-endpoint': 3.1.0 + '@smithy/middleware-retry': 3.0.14 + '@smithy/middleware-serde': 3.0.3 + '@smithy/middleware-stack': 3.0.3 + '@smithy/node-config-provider': 3.1.4 + '@smithy/node-http-handler': 3.1.4 + '@smithy/protocol-http': 4.1.0 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + '@smithy/url-parser': 3.0.3 + '@smithy/util-base64': 3.0.0 + '@smithy/util-body-length-browser': 3.0.0 + '@smithy/util-body-length-node': 3.0.0 + '@smithy/util-defaults-mode-browser': 3.0.14 + '@smithy/util-defaults-mode-node': 3.0.14 + '@smithy/util-endpoints': 2.0.5 + '@smithy/util-middleware': 3.0.3 + '@smithy/util-retry': 3.0.3 + '@smithy/util-utf8': 3.0.0 + tslib: 2.6.2 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/client-sso@3.598.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.598.0 + '@aws-sdk/middleware-host-header': 3.598.0 + '@aws-sdk/middleware-logger': 3.598.0 + '@aws-sdk/middleware-recursion-detection': 3.598.0 + '@aws-sdk/middleware-user-agent': 3.598.0 + '@aws-sdk/region-config-resolver': 3.598.0 + '@aws-sdk/types': 3.598.0 + '@aws-sdk/util-endpoints': 3.598.0 + '@aws-sdk/util-user-agent-browser': 3.598.0 + '@aws-sdk/util-user-agent-node': 3.598.0 + '@smithy/config-resolver': 3.0.5 + '@smithy/core': 2.3.2 + '@smithy/fetch-http-handler': 3.2.4 + '@smithy/hash-node': 3.0.3 + '@smithy/invalid-dependency': 3.0.3 + '@smithy/middleware-content-length': 3.0.5 + '@smithy/middleware-endpoint': 3.1.0 + '@smithy/middleware-retry': 3.0.14 + '@smithy/middleware-serde': 3.0.3 + '@smithy/middleware-stack': 3.0.3 + '@smithy/node-config-provider': 3.1.4 + '@smithy/node-http-handler': 3.1.4 + '@smithy/protocol-http': 4.1.0 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + '@smithy/url-parser': 3.0.3 + '@smithy/util-base64': 3.0.0 + '@smithy/util-body-length-browser': 3.0.0 + '@smithy/util-body-length-node': 3.0.0 + '@smithy/util-defaults-mode-browser': 3.0.14 + '@smithy/util-defaults-mode-node': 3.0.14 + '@smithy/util-endpoints': 2.0.5 + '@smithy/util-middleware': 3.0.3 + '@smithy/util-retry': 3.0.3 + '@smithy/util-utf8': 3.0.0 + tslib: 2.6.2 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/client-sso-oidc': 3.600.0 + '@aws-sdk/core': 3.598.0 + '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)) + '@aws-sdk/middleware-host-header': 3.598.0 + '@aws-sdk/middleware-logger': 3.598.0 + '@aws-sdk/middleware-recursion-detection': 3.598.0 + '@aws-sdk/middleware-user-agent': 3.598.0 + '@aws-sdk/region-config-resolver': 3.598.0 + '@aws-sdk/types': 3.598.0 + '@aws-sdk/util-endpoints': 3.598.0 + '@aws-sdk/util-user-agent-browser': 3.598.0 + '@aws-sdk/util-user-agent-node': 3.598.0 + '@smithy/config-resolver': 3.0.5 + '@smithy/core': 2.3.2 + '@smithy/fetch-http-handler': 3.2.4 + '@smithy/hash-node': 3.0.3 + '@smithy/invalid-dependency': 3.0.3 + '@smithy/middleware-content-length': 3.0.5 + '@smithy/middleware-endpoint': 3.1.0 + '@smithy/middleware-retry': 3.0.14 + '@smithy/middleware-serde': 3.0.3 + '@smithy/middleware-stack': 3.0.3 + '@smithy/node-config-provider': 3.1.4 + '@smithy/node-http-handler': 3.1.4 + '@smithy/protocol-http': 4.1.0 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + '@smithy/url-parser': 3.0.3 + '@smithy/util-base64': 3.0.0 + '@smithy/util-body-length-browser': 3.0.0 + '@smithy/util-body-length-node': 3.0.0 + '@smithy/util-defaults-mode-browser': 3.0.14 + '@smithy/util-defaults-mode-node': 3.0.14 + '@smithy/util-endpoints': 2.0.5 + '@smithy/util-middleware': 3.0.3 + '@smithy/util-retry': 3.0.3 + '@smithy/util-utf8': 3.0.0 + tslib: 2.6.2 + transitivePeerDependencies: + - '@aws-sdk/client-sso-oidc' + - aws-crt - '@cloudflare/kv-asset-handler@0.3.2': + '@aws-sdk/core@3.598.0': dependencies: - mime: 3.0.0 - - '@cloudflare/workerd-darwin-64@1.20240419.0': - optional: true - - '@cloudflare/workerd-darwin-arm64@1.20240419.0': - optional: true - - '@cloudflare/workerd-linux-64@1.20240419.0': - optional: true + '@smithy/core': 2.3.2 + '@smithy/protocol-http': 4.1.0 + '@smithy/signature-v4': 3.1.2 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + fast-xml-parser: 4.2.5 + tslib: 2.6.2 - '@cloudflare/workerd-linux-arm64@1.20240419.0': - optional: true + '@aws-sdk/credential-provider-env@3.598.0': + dependencies: + '@aws-sdk/types': 3.598.0 + '@smithy/property-provider': 3.1.3 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@cloudflare/workerd-windows-64@1.20240419.0': - optional: true + '@aws-sdk/credential-provider-http@3.598.0': + dependencies: + '@aws-sdk/types': 3.598.0 + '@smithy/fetch-http-handler': 3.2.4 + '@smithy/node-http-handler': 3.1.4 + '@smithy/property-provider': 3.1.3 + '@smithy/protocol-http': 4.1.0 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + '@smithy/util-stream': 3.1.3 + tslib: 2.6.2 - '@cloudflare/workers-types@4.20240502.0': {} + '@aws-sdk/credential-provider-ini@3.598.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0))': + dependencies: + '@aws-sdk/client-sts': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0) + '@aws-sdk/credential-provider-env': 3.598.0 + '@aws-sdk/credential-provider-http': 3.598.0 + '@aws-sdk/credential-provider-process': 3.598.0 + '@aws-sdk/credential-provider-sso': 3.598.0(@aws-sdk/client-sso-oidc@3.600.0) + '@aws-sdk/credential-provider-web-identity': 3.598.0(@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)) + '@aws-sdk/types': 3.598.0 + '@smithy/credential-provider-imds': 3.2.0 + '@smithy/property-provider': 3.1.3 + '@smithy/shared-ini-file-loader': 3.1.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + transitivePeerDependencies: + - '@aws-sdk/client-sso-oidc' + - aws-crt + + '@aws-sdk/credential-provider-node@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0))': + dependencies: + '@aws-sdk/credential-provider-env': 3.598.0 + '@aws-sdk/credential-provider-http': 3.598.0 + '@aws-sdk/credential-provider-ini': 3.598.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)) + '@aws-sdk/credential-provider-process': 3.598.0 + '@aws-sdk/credential-provider-sso': 3.598.0(@aws-sdk/client-sso-oidc@3.600.0) + '@aws-sdk/credential-provider-web-identity': 3.598.0(@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)) + '@aws-sdk/types': 3.598.0 + '@smithy/credential-provider-imds': 3.2.0 + '@smithy/property-provider': 3.1.3 + '@smithy/shared-ini-file-loader': 3.1.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + transitivePeerDependencies: + - '@aws-sdk/client-sso-oidc' + - '@aws-sdk/client-sts' + - aws-crt - '@codemirror/autocomplete@6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1)': + '@aws-sdk/credential-provider-process@3.598.0': dependencies: - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - '@lezer/common': 1.2.1 + '@aws-sdk/types': 3.598.0 + '@smithy/property-provider': 3.1.3 + '@smithy/shared-ini-file-loader': 3.1.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@codemirror/commands@6.5.0': + '@aws-sdk/credential-provider-sso@3.598.0(@aws-sdk/client-sso-oidc@3.600.0)': dependencies: - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - '@lezer/common': 1.2.1 + '@aws-sdk/client-sso': 3.598.0 + '@aws-sdk/token-providers': 3.598.0(@aws-sdk/client-sso-oidc@3.600.0) + '@aws-sdk/types': 3.598.0 + '@smithy/property-provider': 3.1.3 + '@smithy/shared-ini-file-loader': 3.1.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + transitivePeerDependencies: + - '@aws-sdk/client-sso-oidc' + - aws-crt - '@codemirror/lang-angular@0.1.3': + '@aws-sdk/credential-provider-web-identity@3.598.0(@aws-sdk/client-sts@3.600.0(@aws-sdk/client-sso-oidc@3.600.0))': dependencies: - '@codemirror/lang-html': 6.4.9 - '@codemirror/lang-javascript': 6.2.2 - '@codemirror/language': 6.10.1 - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 + '@aws-sdk/client-sts': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0) + '@aws-sdk/types': 3.598.0 + '@smithy/property-provider': 3.1.3 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@codemirror/lang-cpp@6.0.2': + '@aws-sdk/middleware-host-header@3.598.0': dependencies: - '@codemirror/language': 6.10.1 - '@lezer/cpp': 1.1.2 + '@aws-sdk/types': 3.598.0 + '@smithy/protocol-http': 4.1.0 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@codemirror/lang-css@6.2.1(@codemirror/view@6.26.3)': + '@aws-sdk/middleware-logger@3.598.0': dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@lezer/common': 1.2.1 - '@lezer/css': 1.1.8 - transitivePeerDependencies: - - '@codemirror/view' + '@aws-sdk/types': 3.598.0 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@codemirror/lang-go@6.0.0(@codemirror/view@6.26.3)': + '@aws-sdk/middleware-recursion-detection@3.598.0': dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@lezer/common': 1.2.1 - '@lezer/go': 1.0.0 - transitivePeerDependencies: - - '@codemirror/view' + '@aws-sdk/types': 3.598.0 + '@smithy/protocol-http': 4.1.0 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@codemirror/lang-html@6.4.9': + '@aws-sdk/middleware-user-agent@3.598.0': dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/lang-css': 6.2.1(@codemirror/view@6.26.3) - '@codemirror/lang-javascript': 6.2.2 - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - '@lezer/common': 1.2.1 - '@lezer/css': 1.1.8 - '@lezer/html': 1.3.9 + '@aws-sdk/types': 3.598.0 + '@aws-sdk/util-endpoints': 3.598.0 + '@smithy/protocol-http': 4.1.0 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@codemirror/lang-java@6.0.1': + '@aws-sdk/region-config-resolver@3.598.0': dependencies: - '@codemirror/language': 6.10.1 - '@lezer/java': 1.1.2 + '@aws-sdk/types': 3.598.0 + '@smithy/node-config-provider': 3.1.4 + '@smithy/types': 3.3.0 + '@smithy/util-config-provider': 3.0.0 + '@smithy/util-middleware': 3.0.3 + tslib: 2.6.2 - '@codemirror/lang-javascript@6.2.2': + '@aws-sdk/token-providers@3.598.0(@aws-sdk/client-sso-oidc@3.600.0)': dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/language': 6.10.1 - '@codemirror/lint': 6.7.0 - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - '@lezer/common': 1.2.1 - '@lezer/javascript': 1.4.16 + '@aws-sdk/client-sso-oidc': 3.600.0 + '@aws-sdk/types': 3.598.0 + '@smithy/property-provider': 3.1.3 + '@smithy/shared-ini-file-loader': 3.1.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@codemirror/lang-json@6.0.1': + '@aws-sdk/types@3.598.0': dependencies: - '@codemirror/language': 6.10.1 - '@lezer/json': 1.0.2 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@codemirror/lang-less@6.0.2(@codemirror/view@6.26.3)': + '@aws-sdk/util-endpoints@3.598.0': dependencies: - '@codemirror/lang-css': 6.2.1(@codemirror/view@6.26.3) - '@codemirror/language': 6.10.1 - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - transitivePeerDependencies: - - '@codemirror/view' - - '@codemirror/lang-liquid@6.2.1': - dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/lang-html': 6.4.9 - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - - '@codemirror/lang-markdown@6.2.5': - dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/lang-html': 6.4.9 - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - '@lezer/common': 1.2.1 - '@lezer/markdown': 1.3.0 - - '@codemirror/lang-php@6.0.1': - dependencies: - '@codemirror/lang-html': 6.4.9 - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@lezer/common': 1.2.1 - '@lezer/php': 1.0.2 - - '@codemirror/lang-python@6.1.6(@codemirror/view@6.26.3)': - dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@lezer/common': 1.2.1 - '@lezer/python': 1.1.13 - transitivePeerDependencies: - - '@codemirror/view' + '@aws-sdk/types': 3.598.0 + '@smithy/types': 3.3.0 + '@smithy/util-endpoints': 2.0.5 + tslib: 2.6.2 - '@codemirror/lang-rust@6.0.1': + '@aws-sdk/util-locate-window@3.568.0': dependencies: - '@codemirror/language': 6.10.1 - '@lezer/rust': 1.0.2 + tslib: 2.6.2 - '@codemirror/lang-sass@6.0.2(@codemirror/view@6.26.3)': + '@aws-sdk/util-user-agent-browser@3.598.0': dependencies: - '@codemirror/lang-css': 6.2.1(@codemirror/view@6.26.3) - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@lezer/common': 1.2.1 - '@lezer/sass': 1.0.6 - transitivePeerDependencies: - - '@codemirror/view' + '@aws-sdk/types': 3.598.0 + '@smithy/types': 3.3.0 + bowser: 2.11.0 + tslib: 2.6.2 - '@codemirror/lang-sql@6.6.4(@codemirror/view@6.26.3)': + '@aws-sdk/util-user-agent-node@3.598.0': dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - transitivePeerDependencies: - - '@codemirror/view' + '@aws-sdk/types': 3.598.0 + '@smithy/node-config-provider': 3.1.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 - '@codemirror/lang-vue@0.1.3': + '@babel/code-frame@7.24.2': dependencies: - '@codemirror/lang-html': 6.4.9 - '@codemirror/lang-javascript': 6.2.2 - '@codemirror/language': 6.10.1 - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 + '@babel/highlight': 7.24.5 + picocolors: 1.0.0 + + '@babel/helper-string-parser@7.24.1': {} + + '@babel/helper-validator-identifier@7.24.5': {} - '@codemirror/lang-wast@6.0.2': + '@babel/highlight@7.24.5': dependencies: - '@codemirror/language': 6.10.1 - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 + '@babel/helper-validator-identifier': 7.24.5 + chalk: 2.4.2 + js-tokens: 4.0.0 + picocolors: 1.0.0 - '@codemirror/lang-xml@6.1.0': + '@babel/parser@7.24.5': dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - '@lezer/common': 1.2.1 - '@lezer/xml': 1.0.5 + '@babel/types': 7.24.5 - '@codemirror/lang-yaml@6.1.1(@codemirror/view@6.26.3)': + '@babel/runtime@7.24.5': dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/language': 6.10.1 - '@codemirror/state': 6.4.1 - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/yaml': 1.0.3 - transitivePeerDependencies: - - '@codemirror/view' - - '@codemirror/language-data@6.5.1(@codemirror/view@6.26.3)': - dependencies: - '@codemirror/lang-angular': 0.1.3 - '@codemirror/lang-cpp': 6.0.2 - '@codemirror/lang-css': 6.2.1(@codemirror/view@6.26.3) - '@codemirror/lang-go': 6.0.0(@codemirror/view@6.26.3) - '@codemirror/lang-html': 6.4.9 - '@codemirror/lang-java': 6.0.1 - '@codemirror/lang-javascript': 6.2.2 - '@codemirror/lang-json': 6.0.1 - '@codemirror/lang-less': 6.0.2(@codemirror/view@6.26.3) - '@codemirror/lang-liquid': 6.2.1 - '@codemirror/lang-markdown': 6.2.5 - '@codemirror/lang-php': 6.0.1 - '@codemirror/lang-python': 6.1.6(@codemirror/view@6.26.3) - '@codemirror/lang-rust': 6.0.1 - '@codemirror/lang-sass': 6.0.2(@codemirror/view@6.26.3) - '@codemirror/lang-sql': 6.6.4(@codemirror/view@6.26.3) - '@codemirror/lang-vue': 0.1.3 - '@codemirror/lang-wast': 6.0.2 - '@codemirror/lang-xml': 6.1.0 - '@codemirror/lang-yaml': 6.1.1(@codemirror/view@6.26.3) - '@codemirror/language': 6.10.1 - '@codemirror/legacy-modes': 6.4.0 - transitivePeerDependencies: - - '@codemirror/view' + regenerator-runtime: 0.14.1 - '@codemirror/language@6.10.1': + '@babel/types@7.24.5': dependencies: - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - style-mod: 4.1.2 + '@babel/helper-string-parser': 7.24.1 + '@babel/helper-validator-identifier': 7.24.5 + to-fast-properties: 2.0.0 - '@codemirror/legacy-modes@6.4.0': + '@bundled-es-modules/cookie@2.0.0': dependencies: - '@codemirror/language': 6.10.1 + cookie: 0.5.0 - '@codemirror/lint@6.7.0': + '@bundled-es-modules/statuses@1.0.1': dependencies: - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - crelt: 1.0.6 + statuses: 2.0.1 - '@codemirror/search@6.5.6': + '@cloudflare/kv-asset-handler@0.3.2': dependencies: - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - crelt: 1.0.6 + mime: 3.0.0 + + '@cloudflare/workerd-darwin-64@1.20240419.0': + optional: true - '@codemirror/state@6.4.1': {} + '@cloudflare/workerd-darwin-arm64@1.20240419.0': + optional: true - '@codemirror/view@6.26.3': - dependencies: - '@codemirror/state': 6.4.1 - style-mod: 4.1.2 - w3c-keyname: 2.2.8 + '@cloudflare/workerd-linux-64@1.20240419.0': + optional: true + + '@cloudflare/workerd-linux-arm64@1.20240419.0': + optional: true + + '@cloudflare/workerd-windows-64@1.20240419.0': + optional: true + + '@cloudflare/workers-types@4.20240502.0': {} '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 + '@drizzle-team/brocli@0.8.2': {} + + '@electric-sql/pglite@0.2.0': {} + '@esbuild-kit/core-utils@3.3.2': dependencies: esbuild: 0.18.20 @@ -4798,6 +5431,9 @@ snapshots: '@esbuild/win32-x64@0.20.2': optional: true + '@exodus/schemasafe@1.3.0': + optional: true + '@fastify/busboy@2.1.1': {} '@floating-ui/core@1.6.1': @@ -4813,6 +5449,30 @@ snapshots: '@fontsource-variable/inter@5.0.18': {} + '@gcornut/valibot-json-schema@0.31.0': + dependencies: + valibot: 0.31.1 + optionalDependencies: + '@types/json-schema': 7.0.15 + esbuild: 0.20.2 + esbuild-runner: 2.2.2(esbuild@0.20.2) + optional: true + + '@google-cloud/vertexai@1.4.0': + dependencies: + google-auth-library: 9.13.0 + transitivePeerDependencies: + - encoding + - supports-color + + '@hapi/hoek@9.3.0': + optional: true + + '@hapi/topo@5.1.0': + dependencies: + '@hapi/hoek': 9.3.0 + optional: true + '@inquirer/confirm@3.1.12': dependencies: '@inquirer/core': 9.0.0 @@ -4879,107 +5539,65 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@lezer/common@1.2.1': {} - - '@lezer/cpp@1.1.2': - dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - - '@lezer/css@1.1.8': - dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - - '@lezer/go@1.0.0': + '@lexical/clipboard@0.16.1': dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 + '@lexical/html': 0.16.1 + '@lexical/list': 0.16.1 + '@lexical/selection': 0.16.1 + '@lexical/utils': 0.16.1 + lexical: 0.16.1 - '@lezer/highlight@1.2.0': + '@lexical/history@0.16.1': dependencies: - '@lezer/common': 1.2.1 + '@lexical/utils': 0.16.1 + lexical: 0.16.1 - '@lezer/html@1.3.9': + '@lexical/html@0.16.1': dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 + '@lexical/selection': 0.16.1 + '@lexical/utils': 0.16.1 + lexical: 0.16.1 - '@lezer/java@1.1.2': + '@lexical/list@0.16.1': dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 + '@lexical/utils': 0.16.1 + lexical: 0.16.1 - '@lezer/javascript@1.4.16': + '@lexical/plain-text@0.16.1': dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 + '@lexical/clipboard': 0.16.1 + '@lexical/selection': 0.16.1 + '@lexical/utils': 0.16.1 + lexical: 0.16.1 - '@lezer/json@1.0.2': + '@lexical/selection@0.16.1': dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 + lexical: 0.16.1 - '@lezer/lr@1.4.0': + '@lexical/table@0.16.1': dependencies: - '@lezer/common': 1.2.1 + '@lexical/utils': 0.16.1 + lexical: 0.16.1 - '@lezer/markdown@1.3.0': + '@lexical/text@0.16.1': dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 + lexical: 0.16.1 - '@lezer/php@1.0.2': + '@lexical/utils@0.16.1': dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 + '@lexical/list': 0.16.1 + '@lexical/selection': 0.16.1 + '@lexical/table': 0.16.1 + lexical: 0.16.1 - '@lezer/python@1.1.13': + '@melt-ui/pp@0.3.1(@melt-ui/svelte@0.77.0(svelte@5.0.0-next.208))(svelte@5.0.0-next.208)': dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - - '@lezer/rust@1.0.2': - dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - - '@lezer/sass@1.0.6': - dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - - '@lezer/xml@1.0.5': - dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - - '@lezer/yaml@1.0.3': - dependencies: - '@lezer/common': 1.2.1 - '@lezer/highlight': 1.2.0 - '@lezer/lr': 1.4.0 - - '@melt-ui/pp@0.3.1(@melt-ui/svelte@0.77.0(svelte@5.0.0-next.123))(svelte@5.0.0-next.123)': - dependencies: - '@melt-ui/svelte': 0.77.0(svelte@5.0.0-next.123) + '@melt-ui/svelte': 0.77.0(svelte@5.0.0-next.208) estree-walker: 3.0.3 magic-string: 0.30.10 - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 - '@melt-ui/svelte@0.76.2(svelte@5.0.0-next.123)': + '@melt-ui/svelte@0.76.2(svelte@5.0.0-next.208)': dependencies: '@floating-ui/core': 1.6.1 '@floating-ui/dom': 1.6.4 @@ -4987,9 +5605,9 @@ snapshots: dequal: 2.0.3 focus-trap: 7.5.4 nanoid: 5.0.7 - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 - '@melt-ui/svelte@0.77.0(svelte@5.0.0-next.123)': + '@melt-ui/svelte@0.77.0(svelte@5.0.0-next.208)': dependencies: '@floating-ui/core': 1.6.1 '@floating-ui/dom': 1.6.4 @@ -4997,7 +5615,7 @@ snapshots: dequal: 2.0.3 focus-trap: 7.5.4 nanoid: 5.0.7 - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 '@mswjs/cookies@1.1.1': {} @@ -5031,6 +5649,16 @@ snapshots: '@open-draft/until@2.1.0': {} + '@opentelemetry/api@1.9.0': {} + + '@pdf-lib/standard-fonts@1.0.0': + dependencies: + pako: 1.0.11 + + '@pdf-lib/upng@1.0.1': + dependencies: + pako: 1.0.11 + '@pkgjs/parseargs@0.11.0': optional: true @@ -5040,11 +5668,15 @@ snapshots: '@polka/url@1.0.0-next.25': {} + '@poppinss/macroable@1.0.2': + optional: true + '@promptbook/utils@0.49.0': dependencies: moment: 2.30.1 prettier: 2.8.1 spacetrim: 0.11.24 + optional: true '@puppeteer/browsers@1.4.6(typescript@5.4.5)': dependencies: @@ -5059,6 +5691,7 @@ snapshots: typescript: 5.4.5 transitivePeerDependencies: - supports-color + optional: true '@puppeteer/browsers@1.9.1': dependencies: @@ -5071,6 +5704,7 @@ snapshots: yargs: 17.7.2 transitivePeerDependencies: - supports-color + optional: true '@rollup/rollup-android-arm-eabi@4.17.2': optional: true @@ -5114,34 +5748,344 @@ snapshots: '@rollup/rollup-win32-arm64-msvc@4.17.2': optional: true - '@rollup/rollup-win32-ia32-msvc@4.17.2': - optional: true + '@rollup/rollup-win32-ia32-msvc@4.17.2': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.17.2': + optional: true + + '@sideway/address@4.1.5': + dependencies: + '@hapi/hoek': 9.3.0 + optional: true + + '@sideway/formula@3.0.1': + optional: true + + '@sideway/pinpoint@2.0.0': + optional: true + + '@sinclair/typebox@0.27.8': {} + + '@sinclair/typebox@0.32.35': + optional: true + + '@sindresorhus/is@5.6.0': + optional: true + + '@smithy/abort-controller@3.1.1': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/config-resolver@3.0.5': + dependencies: + '@smithy/node-config-provider': 3.1.4 + '@smithy/types': 3.3.0 + '@smithy/util-config-provider': 3.0.0 + '@smithy/util-middleware': 3.0.3 + tslib: 2.6.2 + + '@smithy/core@2.3.2': + dependencies: + '@smithy/middleware-endpoint': 3.1.0 + '@smithy/middleware-retry': 3.0.14 + '@smithy/middleware-serde': 3.0.3 + '@smithy/protocol-http': 4.1.0 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + '@smithy/util-middleware': 3.0.3 + tslib: 2.6.2 + + '@smithy/credential-provider-imds@3.2.0': + dependencies: + '@smithy/node-config-provider': 3.1.4 + '@smithy/property-provider': 3.1.3 + '@smithy/types': 3.3.0 + '@smithy/url-parser': 3.0.3 + tslib: 2.6.2 + + '@smithy/eventstream-codec@3.1.2': + dependencies: + '@aws-crypto/crc32': 5.2.0 + '@smithy/types': 3.3.0 + '@smithy/util-hex-encoding': 3.0.0 + tslib: 2.6.2 + + '@smithy/eventstream-serde-browser@3.0.5': + dependencies: + '@smithy/eventstream-serde-universal': 3.0.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/eventstream-serde-config-resolver@3.0.3': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/eventstream-serde-node@3.0.4': + dependencies: + '@smithy/eventstream-serde-universal': 3.0.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/eventstream-serde-universal@3.0.4': + dependencies: + '@smithy/eventstream-codec': 3.1.2 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/fetch-http-handler@3.2.4': + dependencies: + '@smithy/protocol-http': 4.1.0 + '@smithy/querystring-builder': 3.0.3 + '@smithy/types': 3.3.0 + '@smithy/util-base64': 3.0.0 + tslib: 2.6.2 + + '@smithy/hash-node@3.0.3': + dependencies: + '@smithy/types': 3.3.0 + '@smithy/util-buffer-from': 3.0.0 + '@smithy/util-utf8': 3.0.0 + tslib: 2.6.2 + + '@smithy/invalid-dependency@3.0.3': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/is-array-buffer@2.2.0': + dependencies: + tslib: 2.6.2 + + '@smithy/is-array-buffer@3.0.0': + dependencies: + tslib: 2.6.2 + + '@smithy/middleware-content-length@3.0.5': + dependencies: + '@smithy/protocol-http': 4.1.0 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/middleware-endpoint@3.1.0': + dependencies: + '@smithy/middleware-serde': 3.0.3 + '@smithy/node-config-provider': 3.1.4 + '@smithy/shared-ini-file-loader': 3.1.4 + '@smithy/types': 3.3.0 + '@smithy/url-parser': 3.0.3 + '@smithy/util-middleware': 3.0.3 + tslib: 2.6.2 + + '@smithy/middleware-retry@3.0.14': + dependencies: + '@smithy/node-config-provider': 3.1.4 + '@smithy/protocol-http': 4.1.0 + '@smithy/service-error-classification': 3.0.3 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + '@smithy/util-middleware': 3.0.3 + '@smithy/util-retry': 3.0.3 + tslib: 2.6.2 + uuid: 9.0.1 + + '@smithy/middleware-serde@3.0.3': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/middleware-stack@3.0.3': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/node-config-provider@3.1.4': + dependencies: + '@smithy/property-provider': 3.1.3 + '@smithy/shared-ini-file-loader': 3.1.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/node-http-handler@3.1.4': + dependencies: + '@smithy/abort-controller': 3.1.1 + '@smithy/protocol-http': 4.1.0 + '@smithy/querystring-builder': 3.0.3 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/property-provider@3.1.3': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/protocol-http@4.1.0': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/querystring-builder@3.0.3': + dependencies: + '@smithy/types': 3.3.0 + '@smithy/util-uri-escape': 3.0.0 + tslib: 2.6.2 + + '@smithy/querystring-parser@3.0.3': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/service-error-classification@3.0.3': + dependencies: + '@smithy/types': 3.3.0 + + '@smithy/shared-ini-file-loader@3.1.4': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/signature-v4@3.1.2': + dependencies: + '@smithy/is-array-buffer': 3.0.0 + '@smithy/types': 3.3.0 + '@smithy/util-hex-encoding': 3.0.0 + '@smithy/util-middleware': 3.0.3 + '@smithy/util-uri-escape': 3.0.0 + '@smithy/util-utf8': 3.0.0 + tslib: 2.6.2 + + '@smithy/smithy-client@3.1.12': + dependencies: + '@smithy/middleware-endpoint': 3.1.0 + '@smithy/middleware-stack': 3.0.3 + '@smithy/protocol-http': 4.1.0 + '@smithy/types': 3.3.0 + '@smithy/util-stream': 3.1.3 + tslib: 2.6.2 + + '@smithy/types@3.3.0': + dependencies: + tslib: 2.6.2 + + '@smithy/url-parser@3.0.3': + dependencies: + '@smithy/querystring-parser': 3.0.3 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/util-base64@3.0.0': + dependencies: + '@smithy/util-buffer-from': 3.0.0 + '@smithy/util-utf8': 3.0.0 + tslib: 2.6.2 + + '@smithy/util-body-length-browser@3.0.0': + dependencies: + tslib: 2.6.2 + + '@smithy/util-body-length-node@3.0.0': + dependencies: + tslib: 2.6.2 + + '@smithy/util-buffer-from@2.2.0': + dependencies: + '@smithy/is-array-buffer': 2.2.0 + tslib: 2.6.2 + + '@smithy/util-buffer-from@3.0.0': + dependencies: + '@smithy/is-array-buffer': 3.0.0 + tslib: 2.6.2 + + '@smithy/util-config-provider@3.0.0': + dependencies: + tslib: 2.6.2 + + '@smithy/util-defaults-mode-browser@3.0.14': + dependencies: + '@smithy/property-provider': 3.1.3 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + bowser: 2.11.0 + tslib: 2.6.2 + + '@smithy/util-defaults-mode-node@3.0.14': + dependencies: + '@smithy/config-resolver': 3.0.5 + '@smithy/credential-provider-imds': 3.2.0 + '@smithy/node-config-provider': 3.1.4 + '@smithy/property-provider': 3.1.3 + '@smithy/smithy-client': 3.1.12 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/util-endpoints@2.0.5': + dependencies: + '@smithy/node-config-provider': 3.1.4 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/util-hex-encoding@3.0.0': + dependencies: + tslib: 2.6.2 + + '@smithy/util-middleware@3.0.3': + dependencies: + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/util-retry@3.0.3': + dependencies: + '@smithy/service-error-classification': 3.0.3 + '@smithy/types': 3.3.0 + tslib: 2.6.2 + + '@smithy/util-stream@3.1.3': + dependencies: + '@smithy/fetch-http-handler': 3.2.4 + '@smithy/node-http-handler': 3.1.4 + '@smithy/types': 3.3.0 + '@smithy/util-base64': 3.0.0 + '@smithy/util-buffer-from': 3.0.0 + '@smithy/util-hex-encoding': 3.0.0 + '@smithy/util-utf8': 3.0.0 + tslib: 2.6.2 - '@rollup/rollup-win32-x64-msvc@4.17.2': - optional: true + '@smithy/util-uri-escape@3.0.0': + dependencies: + tslib: 2.6.2 - '@sinclair/typebox@0.27.8': {} + '@smithy/util-utf8@2.3.0': + dependencies: + '@smithy/util-buffer-from': 2.2.0 + tslib: 2.6.2 - '@sindresorhus/is@5.6.0': {} + '@smithy/util-utf8@3.0.0': + dependencies: + '@smithy/util-buffer-from': 3.0.0 + tslib: 2.6.2 - '@sqlite.org/sqlite-wasm@3.45.3-build1': {} + '@sodaru/yup-to-json-schema@2.0.1': + optional: true - '@sveltejs/adapter-auto@3.2.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))': + '@sveltejs/adapter-auto@3.2.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))': dependencies: - '@sveltejs/kit': 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)) + '@sveltejs/kit': 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)) import-meta-resolve: 4.1.0 - '@sveltejs/adapter-cloudflare@4.4.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(wrangler@3.53.1(@cloudflare/workers-types@4.20240502.0))': + '@sveltejs/adapter-cloudflare@4.4.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(wrangler@3.53.1(@cloudflare/workers-types@4.20240502.0))': dependencies: '@cloudflare/workers-types': 4.20240502.0 - '@sveltejs/kit': 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)) + '@sveltejs/kit': 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)) esbuild: 0.20.2 worktop: 0.8.0-next.18 wrangler: 3.53.1(@cloudflare/workers-types@4.20240502.0) - '@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9))': + '@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)) + '@sveltejs/vite-plugin-svelte': 3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)) '@types/cookie': 0.6.0 cookie: 0.6.0 devalue: 5.0.0 @@ -5153,28 +6097,28 @@ snapshots: sade: 1.8.1 set-cookie-parser: 2.6.0 sirv: 2.0.4 - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 tiny-glob: 0.2.9 vite: 5.2.11(@types/node@20.14.9) - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9))': + '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)) + '@sveltejs/vite-plugin-svelte': 3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)) debug: 4.3.4 - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 vite: 5.2.11(@types/node@20.14.9) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9))': + '@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9)) + '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)) debug: 4.3.4 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.10 - svelte: 5.0.0-next.123 - svelte-hmr: 0.16.0(svelte@5.0.0-next.123) + svelte: 5.0.0-next.208 + svelte-hmr: 0.16.0(svelte@5.0.0-next.208) vite: 5.2.11(@types/node@20.14.9) vitefu: 0.2.5(vite@5.2.11(@types/node@20.14.9)) transitivePeerDependencies: @@ -5187,6 +6131,7 @@ snapshots: '@szmarczak/http-timer@5.0.1': dependencies: defer-to-connect: 2.0.1 + optional: true '@tailwindcss/typography@0.5.13(tailwindcss@3.4.3)': dependencies: @@ -5220,21 +6165,23 @@ snapshots: optionalDependencies: vitest: 1.6.0(@types/node@20.14.9)(@vitest/browser@1.6.0)(@vitest/ui@1.6.0)(jsdom@24.0.0) - '@testing-library/svelte@5.2.0(svelte@5.0.0-next.123)(vite@5.2.11(@types/node@20.14.9))(vitest@1.6.0(@types/node@20.14.9)(@vitest/browser@1.6.0)(@vitest/ui@1.6.0)(jsdom@24.0.0))': + '@testing-library/svelte@5.2.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9))(vitest@1.6.0(@types/node@20.14.9)(@vitest/browser@1.6.0)(@vitest/ui@1.6.0)(jsdom@24.0.0))': dependencies: '@testing-library/dom': 10.3.0 - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 optionalDependencies: vite: 5.2.11(@types/node@20.14.9) vitest: 1.6.0(@types/node@20.14.9)(@vitest/browser@1.6.0)(@vitest/ui@1.6.0)(jsdom@24.0.0) - '@tootallnate/quickjs-emscripten@0.23.0': {} + '@tootallnate/quickjs-emscripten@0.23.0': + optional: true '@types/aria-query@5.0.4': {} '@types/better-sqlite3@7.6.11': dependencies: '@types/node': 20.14.9 + optional: true '@types/cookie@0.6.0': {} @@ -5245,7 +6192,11 @@ snapshots: '@types/estree@1.0.5': {} - '@types/http-cache-semantics@4.0.4': {} + '@types/http-cache-semantics@4.0.4': + optional: true + + '@types/json-schema@7.0.15': + optional: true '@types/katex@0.16.7': {} @@ -5267,6 +6218,12 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/pg@8.11.6': + dependencies: + '@types/node': 20.14.9 + pg-protocol: 1.6.1 + pg-types: 4.0.2 + '@types/pug@2.0.10': {} '@types/sql.js@1.4.9': @@ -5277,22 +6234,38 @@ snapshots: '@types/statuses@2.0.5': {} - '@types/which@2.0.2': {} + '@types/validator@13.12.0': + optional: true + + '@types/which@2.0.2': + optional: true '@types/wrap-ansi@3.0.0': {} '@types/ws@8.5.10': dependencies: - '@types/node': 20.12.8 + '@types/node': 20.14.9 + optional: true '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.12.8 + '@types/node': 20.14.9 optional: true - '@ungap/structured-clone@1.2.0': {} + '@vinejs/compiler@2.5.0': + optional: true - '@ungap/with-resolvers@0.1.0': {} + '@vinejs/vine@1.8.0': + dependencies: + '@poppinss/macroable': 1.0.2 + '@types/validator': 13.12.0 + '@vinejs/compiler': 2.5.0 + camelcase: 8.0.0 + dayjs: 1.11.12 + dlv: 1.1.3 + normalize-url: 8.0.1 + validator: 13.12.0 + optional: true '@vitest/browser@1.6.0(playwright@1.44.0)(vitest@1.6.0)(webdriverio@8.36.1(typescript@5.4.5))': dependencies: @@ -5408,6 +6381,7 @@ snapshots: import-meta-resolve: 4.1.0 transitivePeerDependencies: - supports-color + optional: true '@wdio/logger@8.28.0': dependencies: @@ -5415,16 +6389,20 @@ snapshots: loglevel: 1.9.1 loglevel-plugin-prefix: 0.8.4 strip-ansi: 7.1.0 + optional: true - '@wdio/protocols@8.32.0': {} + '@wdio/protocols@8.32.0': + optional: true '@wdio/repl@8.24.12': dependencies: - '@types/node': 20.12.8 + '@types/node': 20.14.9 + optional: true '@wdio/types@8.36.1': dependencies: - '@types/node': 20.12.8 + '@types/node': 20.14.9 + optional: true '@wdio/utils@8.36.1': dependencies: @@ -5443,10 +6421,12 @@ snapshots: wait-port: 1.1.0 transitivePeerDependencies: - supports-color + optional: true abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 + optional: true acorn-typescript@1.4.13(acorn@8.11.3): dependencies: @@ -5462,27 +6442,30 @@ snapshots: transitivePeerDependencies: - supports-color - ai@3.1.12(react@18.3.1)(solid-js@1.8.17)(svelte@5.0.0-next.123)(vue@3.4.26(typescript@5.4.5))(zod@3.23.6): + ai@3.3.0(react@18.3.1)(solid-js@1.8.17)(sswr@2.1.0(svelte@5.0.0-next.208))(svelte@5.0.0-next.208)(vue@3.4.26(typescript@5.4.5))(zod@3.23.8): dependencies: - '@ai-sdk/provider': 0.0.5 - '@ai-sdk/provider-utils': 0.0.8(zod@3.23.6) + '@ai-sdk/provider': 0.0.14 + '@ai-sdk/provider-utils': 1.0.5(zod@3.23.8) + '@ai-sdk/react': 0.0.36(react@18.3.1)(zod@3.23.8) + '@ai-sdk/solid': 0.0.27(solid-js@1.8.17)(zod@3.23.8) + '@ai-sdk/svelte': 0.0.29(svelte@5.0.0-next.208)(zod@3.23.8) + '@ai-sdk/ui-utils': 0.0.24(zod@3.23.8) + '@ai-sdk/vue': 0.0.28(vue@3.4.26(typescript@5.4.5))(zod@3.23.8) + '@opentelemetry/api': 1.9.0 eventsource-parser: 1.1.2 json-schema: 0.4.0 jsondiffpatch: 0.6.0 nanoid: 3.3.6 secure-json-parse: 2.7.0 - solid-swr-store: 0.10.7(solid-js@1.8.17)(swr-store@0.10.6) - sswr: 2.0.0(svelte@5.0.0-next.123) - swr: 2.2.0(react@18.3.1) - swr-store: 0.10.6 - swrv: 1.0.4(vue@3.4.26(typescript@5.4.5)) - zod-to-json-schema: 3.22.5(zod@3.23.6) + zod-to-json-schema: 3.22.5(zod@3.23.8) optionalDependencies: react: 18.3.1 - solid-js: 1.8.17 - svelte: 5.0.0-next.123 - vue: 3.4.26(typescript@5.4.5) - zod: 3.23.6 + sswr: 2.1.0(svelte@5.0.0-next.208) + svelte: 5.0.0-next.208 + zod: 3.23.8 + transitivePeerDependencies: + - solid-js + - vue ansi-escapes@4.3.2: dependencies: @@ -5520,6 +6503,7 @@ snapshots: lodash: 4.17.21 normalize-path: 3.0.0 readable-stream: 4.5.2 + optional: true archiver@7.0.1: dependencies: @@ -5530,6 +6514,7 @@ snapshots: readdir-glob: 1.1.3 tar-stream: 3.1.7 zip-stream: 6.0.1 + optional: true arg@5.0.2: {} @@ -5537,6 +6522,12 @@ snapshots: dependencies: dequal: 2.0.3 + arktype@2.0.0-beta.0: + dependencies: + '@ark/schema': 0.2.0 + '@ark/util': 0.1.0 + optional: true + as-table@1.0.55: dependencies: printable-characters: 1.0.42 @@ -5546,6 +6537,7 @@ snapshots: ast-types@0.13.4: dependencies: tslib: 2.6.2 + optional: true async@3.2.5: {} @@ -5565,7 +6557,8 @@ snapshots: dependencies: dequal: 2.0.3 - b4a@1.6.6: {} + b4a@1.6.6: + optional: true balanced-match@1.0.2: {} @@ -5594,37 +6587,47 @@ snapshots: base64-js@1.5.1: {} - basic-ftp@5.0.5: {} + basic-ftp@5.0.5: + optional: true better-sqlite3@10.0.0: dependencies: bindings: 1.5.0 prebuild-install: 7.1.2 + optional: true + + big-integer@1.6.52: + optional: true - big-integer@1.6.52: {} + bignumber.js@9.1.2: {} binary-extensions@2.3.0: {} bindings@1.5.0: dependencies: file-uri-to-path: 1.0.0 + optional: true - bits-ui@0.21.7(svelte@5.0.0-next.123): + bits-ui@0.21.7(svelte@5.0.0-next.208): dependencies: '@internationalized/date': 3.5.3 - '@melt-ui/svelte': 0.76.2(svelte@5.0.0-next.123) + '@melt-ui/svelte': 0.76.2(svelte@5.0.0-next.208) nanoid: 5.0.7 - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 bl@4.1.0: dependencies: buffer: 5.7.1 inherits: 2.0.4 readable-stream: 3.6.2 + optional: true blake3-wasm@2.1.5: {} - bluebird@3.4.7: {} + bluebird@3.4.7: + optional: true + + bowser@2.11.0: {} brace-expansion@1.1.11: dependencies: @@ -5648,7 +6651,10 @@ snapshots: buffer-crc32@0.2.13: {} - buffer-crc32@1.0.0: {} + buffer-crc32@1.0.0: + optional: true + + buffer-equal-constant-time@1.0.1: {} buffer-from@1.1.2: {} @@ -5656,15 +6662,18 @@ snapshots: dependencies: base64-js: 1.5.1 ieee754: 1.2.1 + optional: true buffer@6.0.3: dependencies: base64-js: 1.5.1 ieee754: 1.2.1 + optional: true cac@6.7.14: {} - cacheable-lookup@7.0.0: {} + cacheable-lookup@7.0.0: + optional: true cacheable-request@10.2.14: dependencies: @@ -5675,11 +6684,15 @@ snapshots: mimic-response: 4.0.0 normalize-url: 8.0.1 responselike: 3.0.0 + optional: true callsites@3.1.0: {} camelcase-css@2.0.1: {} + camelcase@8.0.0: + optional: true + caniuse-lite@1.0.30001615: {} capnp-ts@0.7.0: @@ -5733,29 +6746,25 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - chownr@1.1.4: {} + chownr@1.1.4: + optional: true chromium-bidi@0.4.16(devtools-protocol@0.0.1147663): dependencies: devtools-protocol: 0.0.1147663 mitt: 3.0.0 + optional: true class-variance-authority@0.7.0: dependencies: clsx: 2.0.0 - cli-color@2.0.4: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-iterator: 2.0.3 - memoizee: 0.4.15 - timers-ext: 0.1.7 - cli-spinners@2.9.2: {} cli-width@4.1.0: {} + client-only@0.0.1: {} + cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -5766,30 +6775,6 @@ snapshots: clsx@2.1.1: {} - codemirror@6.0.1(@lezer/common@1.2.1): - dependencies: - '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) - '@codemirror/commands': 6.5.0 - '@codemirror/language': 6.10.1 - '@codemirror/lint': 6.7.0 - '@codemirror/search': 6.5.6 - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.26.3 - transitivePeerDependencies: - - '@lezer/common' - - coincident@1.2.3: - dependencies: - '@ungap/structured-clone': 1.2.0 - '@ungap/with-resolvers': 0.1.0 - gc-hook: 0.3.1 - proxy-target: 3.0.2 - optionalDependencies: - ws: 8.17.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - color-convert@1.9.3: dependencies: color-name: 1.1.3 @@ -5810,7 +6795,8 @@ snapshots: commander@8.3.0: {} - commander@9.5.0: {} + commander@9.5.0: + optional: true compress-commons@6.0.2: dependencies: @@ -5819,6 +6805,7 @@ snapshots: is-stream: 2.0.1 normalize-path: 3.0.0 readable-stream: 4.5.2 + optional: true concat-map@0.0.1: {} @@ -5828,22 +6815,24 @@ snapshots: cookie@0.6.0: {} - core-util-is@1.0.3: {} + core-util-is@1.0.3: + optional: true - crc-32@1.2.2: {} + crc-32@1.2.2: + optional: true crc32-stream@6.0.0: dependencies: crc-32: 1.2.2 readable-stream: 4.5.2 - - crelt@1.0.6: {} + optional: true cross-fetch@4.0.0: dependencies: node-fetch: 2.7.0 transitivePeerDependencies: - encoding + optional: true cross-spawn@7.0.3: dependencies: @@ -5851,9 +6840,11 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 - css-shorthand-properties@1.1.1: {} + css-shorthand-properties@1.1.1: + optional: true - css-value@0.0.1: {} + css-value@0.0.1: + optional: true css.escape@1.5.1: {} @@ -5865,51 +6856,57 @@ snapshots: csstype@3.1.3: {} - d@1.0.2: - dependencies: - es5-ext: 0.10.64 - type: 2.7.2 - data-uri-to-buffer@2.0.2: {} - data-uri-to-buffer@4.0.1: {} + data-uri-to-buffer@4.0.1: + optional: true - data-uri-to-buffer@6.0.2: {} + data-uri-to-buffer@6.0.2: + optional: true data-urls@5.0.0: dependencies: whatwg-mimetype: 4.0.0 whatwg-url: 14.0.0 + dayjs@1.11.12: + optional: true + debug@4.3.4: dependencies: ms: 2.1.2 - decamelize@6.0.0: {} + decamelize@6.0.0: + optional: true decimal.js@10.4.3: {} decompress-response@6.0.0: dependencies: mimic-response: 3.1.0 + optional: true deep-eql@4.1.3: dependencies: type-detect: 4.0.8 - deep-extend@0.6.0: {} + deep-extend@0.6.0: + optional: true - deepmerge-ts@5.1.0: {} + deepmerge-ts@5.1.0: + optional: true deepmerge@4.3.1: {} - defer-to-connect@2.0.1: {} + defer-to-connect@2.0.1: + optional: true degenerator@5.0.1: dependencies: ast-types: 0.13.4 escodegen: 2.1.0 esprima: 4.0.1 + optional: true delayed-stream@1.0.0: {} @@ -5917,13 +6914,16 @@ snapshots: detect-indent@6.1.0: {} - detect-libc@2.0.3: {} + detect-libc@2.0.3: + optional: true devalue@5.0.0: {} - devtools-protocol@0.0.1147663: {} + devtools-protocol@0.0.1147663: + optional: true - devtools-protocol@0.0.1282316: {} + devtools-protocol@0.0.1282316: + optional: true didyoumean@1.2.2: {} @@ -5931,10 +6931,6 @@ snapshots: diff-sequences@29.6.3: {} - difflib@0.2.4: - dependencies: - heap: 0.2.7 - dlv@1.1.3: {} dom-accessibility-api@0.5.16: {} @@ -5943,44 +6939,45 @@ snapshots: dotenv@16.4.5: {} - dreamopt@0.8.0: - dependencies: - wordwrap: 1.0.0 - - drizzle-kit@0.21.2: + drizzle-kit@0.24.0: dependencies: + '@drizzle-team/brocli': 0.8.2 '@esbuild-kit/esm-loader': 2.6.5 - commander: 9.5.0 - env-paths: 3.0.0 esbuild: 0.19.12 esbuild-register: 3.5.0(esbuild@0.19.12) - glob: 8.1.0 - hanji: 0.0.5 - json-diff: 0.9.0 - zod: 3.23.6 transitivePeerDependencies: - supports-color - drizzle-orm@0.30.10(@cloudflare/workers-types@4.20240502.0)(@types/better-sqlite3@7.6.11)(@types/sql.js@1.4.9)(better-sqlite3@10.0.0)(kysely@0.27.3)(react@18.3.1)(sql.js@1.10.3): + drizzle-orm@0.33.0(@cloudflare/workers-types@4.20240502.0)(@electric-sql/pglite@0.2.0)(@opentelemetry/api@1.9.0)(@types/better-sqlite3@7.6.11)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(better-sqlite3@10.0.0)(kysely@0.27.3)(pg@8.12.0)(react@18.3.1)(sql.js@1.10.3): optionalDependencies: '@cloudflare/workers-types': 4.20240502.0 + '@electric-sql/pglite': 0.2.0 + '@opentelemetry/api': 1.9.0 '@types/better-sqlite3': 7.6.11 + '@types/pg': 8.11.6 '@types/sql.js': 1.4.9 better-sqlite3: 10.0.0 kysely: 0.27.3 + pg: 8.12.0 react: 18.3.1 sql.js: 1.10.3 duplexer2@0.1.4: dependencies: readable-stream: 2.3.8 + optional: true eastasianwidth@0.2.0: {} + ecdsa-sig-formatter@1.0.11: + dependencies: + safe-buffer: 5.2.1 + edge-paths@3.0.5: dependencies: '@types/which': 2.0.2 which: 2.0.2 + optional: true edgedriver@5.4.0: dependencies: @@ -5990,6 +6987,7 @@ snapshots: node-fetch: 3.3.2 unzipper: 0.11.6 which: 4.0.0 + optional: true electron-to-chromium@1.4.754: {} @@ -6000,38 +6998,12 @@ snapshots: end-of-stream@1.4.4: dependencies: once: 1.4.0 + optional: true entities@4.5.0: {} - env-paths@3.0.0: {} - - es5-ext@0.10.64: - dependencies: - es6-iterator: 2.0.3 - es6-symbol: 3.1.4 - esniff: 2.0.1 - next-tick: 1.1.0 - - es6-iterator@2.0.3: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-symbol: 3.1.4 - es6-promise@3.3.1: {} - es6-symbol@3.1.4: - dependencies: - d: 1.0.2 - ext: 1.7.0 - - es6-weak-map@2.0.3: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-iterator: 2.0.3 - es6-symbol: 3.1.4 - esbuild-register@3.5.0(esbuild@0.19.12): dependencies: debug: 4.3.4 @@ -6039,6 +7011,13 @@ snapshots: transitivePeerDependencies: - supports-color + esbuild-runner@2.2.2(esbuild@0.20.2): + dependencies: + esbuild: 0.20.2 + source-map-support: 0.5.21 + tslib: 2.4.0 + optional: true + esbuild@0.17.19: optionalDependencies: '@esbuild/android-arm': 0.17.19 @@ -6154,24 +7133,20 @@ snapshots: esutils: 2.0.3 optionalDependencies: source-map: 0.6.1 + optional: true esm-env@1.0.0: {} - esniff@2.0.1: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - event-emitter: 0.3.5 - type: 2.7.2 - - esprima@4.0.1: {} + esprima@4.0.1: + optional: true esrap@1.2.2: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 '@types/estree': 1.0.5 - estraverse@5.3.0: {} + estraverse@5.3.0: + optional: true estree-walker@0.6.1: {} @@ -6181,16 +7156,14 @@ snapshots: dependencies: '@types/estree': 1.0.5 - esutils@2.0.3: {} - - event-emitter@0.3.5: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 + esutils@2.0.3: + optional: true - event-target-shim@5.0.1: {} + event-target-shim@5.0.1: + optional: true - events@3.3.0: {} + events@3.3.0: + optional: true eventsource-parser@1.1.2: {} @@ -6208,11 +7181,10 @@ snapshots: exit-hook@2.2.1: {} - expand-template@2.0.3: {} + expand-template@2.0.3: + optional: true - ext@1.7.0: - dependencies: - type: 2.7.2 + extend@3.0.2: {} extract-zip@2.0.1: dependencies: @@ -6223,10 +7195,13 @@ snapshots: '@types/yauzl': 2.10.3 transitivePeerDependencies: - supports-color + optional: true - fast-deep-equal@2.0.1: {} + fast-deep-equal@2.0.1: + optional: true - fast-fifo@1.3.2: {} + fast-fifo@1.3.2: + optional: true fast-glob@3.3.2: dependencies: @@ -6236,6 +7211,10 @@ snapshots: merge2: 1.4.1 micromatch: 4.0.5 + fast-xml-parser@4.2.5: + dependencies: + strnum: 1.0.5 + fastq@1.17.1: dependencies: reusify: 1.0.4 @@ -6243,15 +7222,18 @@ snapshots: fd-slicer@1.1.0: dependencies: pend: 1.2.0 + optional: true fetch-blob@3.2.0: dependencies: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 + optional: true fflate@0.8.2: {} - file-uri-to-path@1.0.0: {} + file-uri-to-path@1.0.0: + optional: true filepond@4.31.1: {} @@ -6270,7 +7252,8 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - form-data-encoder@2.1.4: {} + form-data-encoder@2.1.4: + optional: true form-data@4.0.0: dependencies: @@ -6281,16 +7264,25 @@ snapshots: formdata-polyfill@4.0.10: dependencies: fetch-blob: 3.2.0 + optional: true + + formsnap@1.0.1(svelte@5.0.0-next.208)(sveltekit-superforms@2.16.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)): + dependencies: + nanoid: 5.0.7 + svelte: 5.0.0-next.208 + sveltekit-superforms: 2.16.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208) fraction.js@4.3.7: {} - fs-constants@1.0.0: {} + fs-constants@1.0.0: + optional: true fs-extra@11.2.0: dependencies: graceful-fs: 4.2.11 jsonfile: 6.1.0 universalify: 2.0.1 + optional: true fs.realpath@1.0.0: {} @@ -6306,10 +7298,28 @@ snapshots: inherits: 2.0.4 mkdirp: 0.5.6 rimraf: 2.7.1 + optional: true function-bind@1.1.2: {} - gc-hook@0.3.1: {} + gaxios@6.7.0: + dependencies: + extend: 3.0.2 + https-proxy-agent: 7.0.4 + is-stream: 2.0.1 + node-fetch: 2.7.0 + uuid: 10.0.0 + transitivePeerDependencies: + - encoding + - supports-color + + gcp-metadata@6.1.0: + dependencies: + gaxios: 6.7.0 + json-bigint: 1.0.0 + transitivePeerDependencies: + - encoding + - supports-color geckodriver@4.4.0: dependencies: @@ -6323,12 +7333,14 @@ snapshots: which: 4.0.0 transitivePeerDependencies: - supports-color + optional: true get-caller-file@2.0.5: {} get-func-name@2.0.2: {} - get-port@7.1.0: {} + get-port@7.1.0: + optional: true get-source@2.0.12: dependencies: @@ -6338,8 +7350,10 @@ snapshots: get-stream@5.2.0: dependencies: pump: 3.0.0 + optional: true - get-stream@6.0.1: {} + get-stream@6.0.1: + optional: true get-stream@8.0.1: {} @@ -6355,8 +7369,10 @@ snapshots: fs-extra: 11.2.0 transitivePeerDependencies: - supports-color + optional: true - github-from-package@0.0.0: {} + github-from-package@0.0.0: + optional: true glob-parent@5.1.2: dependencies: @@ -6385,18 +7401,22 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - glob@8.1.0: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.6 - once: 1.4.0 - globalyzer@0.1.0: {} globrex@0.1.2: {} + google-auth-library@9.13.0: + dependencies: + base64-js: 1.5.1 + ecdsa-sig-formatter: 1.0.11 + gaxios: 6.7.0 + gcp-metadata: 6.1.0 + gtoken: 7.1.0 + jws: 4.0.0 + transitivePeerDependencies: + - encoding + - supports-color + got@12.6.1: dependencies: '@sindresorhus/is': 5.6.0 @@ -6410,17 +7430,22 @@ snapshots: lowercase-keys: 3.0.0 p-cancelable: 3.0.0 responselike: 3.0.0 + optional: true graceful-fs@4.2.11: {} - grapheme-splitter@1.0.4: {} + grapheme-splitter@1.0.4: + optional: true graphql@16.9.0: {} - hanji@0.0.5: + gtoken@7.1.0: dependencies: - lodash.throttle: 4.1.1 - sisteransi: 1.0.5 + gaxios: 6.7.0 + jws: 4.0.0 + transitivePeerDependencies: + - encoding + - supports-color has-flag@3.0.0: {} @@ -6432,15 +7457,14 @@ snapshots: headers-polyfill@4.0.3: {} - heap@0.2.7: {} - highlight.js@11.9.0: {} html-encoding-sniffer@4.0.0: dependencies: whatwg-encoding: 3.1.1 - http-cache-semantics@4.1.1: {} + http-cache-semantics@4.1.1: + optional: true http-proxy-agent@7.0.2: dependencies: @@ -6453,6 +7477,7 @@ snapshots: dependencies: quick-lru: 5.1.1 resolve-alpn: 1.2.1 + optional: true https-proxy-agent@7.0.4: dependencies: @@ -6467,7 +7492,8 @@ snapshots: dependencies: safer-buffer: 2.1.2 - ieee754@1.2.1: {} + ieee754@1.2.1: + optional: true import-fresh@3.3.0: dependencies: @@ -6485,12 +7511,14 @@ snapshots: inherits@2.0.4: {} - ini@1.3.8: {} + ini@1.3.8: + optional: true ip-address@9.0.5: dependencies: jsbn: 1.1.0 sprintf-js: 1.1.3 + optional: true is-binary-path@2.1.0: dependencies: @@ -6512,12 +7540,11 @@ snapshots: is-number@7.0.0: {} - is-plain-obj@4.1.0: {} + is-plain-obj@4.1.0: + optional: true is-potential-custom-element-name@1.0.1: {} - is-promise@2.2.2: {} - is-reference@3.0.2: dependencies: '@types/estree': 1.0.5 @@ -6526,11 +7553,13 @@ snapshots: is-stream@3.0.0: {} - isarray@1.0.0: {} + isarray@1.0.0: + optional: true isexe@2.0.0: {} - isexe@3.1.1: {} + isexe@3.1.1: + optional: true jackspeak@2.3.6: dependencies: @@ -6540,11 +7569,21 @@ snapshots: jiti@1.21.0: {} + joi@17.13.3: + dependencies: + '@hapi/hoek': 9.3.0 + '@hapi/topo': 5.1.0 + '@sideway/address': 4.1.5 + '@sideway/formula': 3.0.1 + '@sideway/pinpoint': 2.0.0 + optional: true + js-tokens@4.0.0: {} js-tokens@9.0.0: {} - jsbn@1.1.0: {} + jsbn@1.1.0: + optional: true jsdom@24.0.0: dependencies: @@ -6574,13 +7613,18 @@ snapshots: - supports-color - utf-8-validate - json-buffer@3.0.1: {} + json-bigint@1.0.0: + dependencies: + bignumber.js: 9.1.2 + + json-buffer@3.0.1: + optional: true - json-diff@0.9.0: + json-schema-to-ts@3.1.0: dependencies: - cli-color: 2.0.4 - difflib: 0.2.4 - dreamopt: 0.8.0 + '@babel/runtime': 7.24.5 + ts-algebra: 2.0.0 + optional: true json-schema@0.4.0: {} @@ -6595,6 +7639,20 @@ snapshots: universalify: 2.0.1 optionalDependencies: graceful-fs: 4.2.11 + optional: true + + just-clone@6.2.0: {} + + jwa@2.0.0: + dependencies: + buffer-equal-constant-time: 1.0.1 + ecdsa-sig-formatter: 1.0.11 + safe-buffer: 5.2.1 + + jws@4.0.0: + dependencies: + jwa: 2.0.0 + safe-buffer: 5.2.1 katex@0.16.10: dependencies: @@ -6603,16 +7661,22 @@ snapshots: keyv@4.5.4: dependencies: json-buffer: 3.0.1 + optional: true kleur@4.1.5: {} - ky@0.33.3: {} + ky@0.33.3: + optional: true - kysely@0.27.3: {} + kysely@0.27.3: + optional: true lazystream@1.0.1: dependencies: readable-stream: 2.3.8 + optional: true + + lexical@0.16.1: {} lilconfig@2.1.0: {} @@ -6630,26 +7694,29 @@ snapshots: '@promptbook/utils': 0.49.0 type-fest: 2.13.0 userhome: 1.0.0 + optional: true locate-character@3.0.0: {} lodash.castarray@4.4.0: {} - lodash.clonedeep@4.5.0: {} + lodash.clonedeep@4.5.0: + optional: true lodash.isplainobject@4.0.6: {} lodash.merge@4.6.2: {} - lodash.throttle@4.1.1: {} - - lodash.zip@4.2.0: {} + lodash.zip@4.2.0: + optional: true lodash@4.17.21: {} - loglevel-plugin-prefix@0.8.4: {} + loglevel-plugin-prefix@0.8.4: + optional: true - loglevel@1.9.1: {} + loglevel@1.9.1: + optional: true loose-envify@1.4.0: dependencies: @@ -6659,19 +7726,17 @@ snapshots: dependencies: get-func-name: 2.0.2 - lowercase-keys@3.0.0: {} + lowercase-keys@3.0.0: + optional: true lru-cache@10.2.2: {} - lru-cache@7.18.3: {} - - lru-queue@0.1.0: - dependencies: - es5-ext: 0.10.64 + lru-cache@7.18.3: + optional: true - lucide-svelte@0.378.0(svelte@5.0.0-next.123): + lucide-svelte@0.378.0(svelte@5.0.0-next.208): dependencies: - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 lz-string@1.5.0: {} @@ -6691,16 +7756,7 @@ snapshots: marked@12.0.2: {} - memoizee@0.4.15: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-weak-map: 2.0.3 - event-emitter: 0.3.5 - is-promise: 2.2.2 - lru-queue: 0.1.0 - next-tick: 1.1.0 - timers-ext: 0.1.7 + memoize-weak@1.0.2: {} merge-stream@2.0.0: {} @@ -6721,9 +7777,11 @@ snapshots: mimic-fn@4.0.0: {} - mimic-response@3.1.0: {} + mimic-response@3.1.0: + optional: true - mimic-response@4.0.0: {} + mimic-response@4.0.0: + optional: true min-indent@1.0.1: {} @@ -6740,7 +7798,7 @@ snapshots: workerd: 1.20240419.0 ws: 8.17.0 youch: 3.3.3 - zod: 3.23.6 + zod: 3.23.8 transitivePeerDependencies: - bufferutil - supports-color @@ -6753,6 +7811,7 @@ snapshots: minimatch@5.1.6: dependencies: brace-expansion: 2.0.1 + optional: true minimatch@9.0.4: dependencies: @@ -6762,9 +7821,11 @@ snapshots: minipass@7.0.4: {} - mitt@3.0.0: {} + mitt@3.0.0: + optional: true - mkdirp-classic@0.5.3: {} + mkdirp-classic@0.5.3: + optional: true mkdirp@0.5.6: dependencies: @@ -6777,7 +7838,8 @@ snapshots: pkg-types: 1.1.1 ufo: 1.5.3 - moment@2.30.1: {} + moment@2.30.1: + optional: true mri@1.2.0: {} @@ -6823,17 +7885,19 @@ snapshots: nanoid@5.0.7: {} - napi-build-utils@1.0.2: {} - - netmask@2.0.2: {} + napi-build-utils@1.0.2: + optional: true - next-tick@1.1.0: {} + netmask@2.0.2: + optional: true node-abi@3.62.0: dependencies: semver: 7.6.2 + optional: true - node-domexception@1.0.0: {} + node-domexception@1.0.0: + optional: true node-fetch@2.7.0: dependencies: @@ -6844,6 +7908,7 @@ snapshots: data-uri-to-buffer: 4.0.1 fetch-blob: 3.2.0 formdata-polyfill: 4.0.10 + optional: true node-forge@1.3.1: {} @@ -6853,7 +7918,8 @@ snapshots: normalize-range@0.1.2: {} - normalize-url@8.0.1: {} + normalize-url@8.0.1: + optional: true npm-run-path@5.3.0: dependencies: @@ -6865,6 +7931,8 @@ snapshots: object-hash@3.0.0: {} + obuf@1.1.2: {} + once@1.4.0: dependencies: wrappy: 1.0.2 @@ -6875,7 +7943,8 @@ snapshots: outvariant@1.4.2: {} - p-cancelable@3.0.0: {} + p-cancelable@3.0.0: + optional: true p-limit@5.0.0: dependencies: @@ -6893,11 +7962,15 @@ snapshots: socks-proxy-agent: 8.0.3 transitivePeerDependencies: - supports-color + optional: true pac-resolver@7.0.1: dependencies: degenerator: 5.0.1 netmask: 2.0.2 + optional: true + + pako@1.0.11: {} parent-module@1.0.1: dependencies: @@ -6926,7 +7999,62 @@ snapshots: pathval@1.1.1: {} - pend@1.2.0: {} + pdf-lib@1.17.1: + dependencies: + '@pdf-lib/standard-fonts': 1.0.0 + '@pdf-lib/upng': 1.0.1 + pako: 1.0.11 + tslib: 1.14.1 + + pend@1.2.0: + optional: true + + pg-cloudflare@1.1.1: + optional: true + + pg-connection-string@2.6.4: {} + + pg-int8@1.0.1: {} + + pg-numeric@1.0.2: {} + + pg-pool@3.6.2(pg@8.12.0): + dependencies: + pg: 8.12.0 + + pg-protocol@1.6.1: {} + + pg-types@2.2.0: + dependencies: + pg-int8: 1.0.1 + postgres-array: 2.0.0 + postgres-bytea: 1.0.0 + postgres-date: 1.0.7 + postgres-interval: 1.2.0 + + pg-types@4.0.2: + dependencies: + pg-int8: 1.0.1 + pg-numeric: 1.0.2 + postgres-array: 3.0.2 + postgres-bytea: 3.0.0 + postgres-date: 2.1.0 + postgres-interval: 3.0.0 + postgres-range: 1.1.4 + + pg@8.12.0: + dependencies: + pg-connection-string: 2.6.4 + pg-pool: 3.6.2(pg@8.12.0) + pg-protocol: 1.6.1 + pg-types: 2.2.0 + pgpass: 1.0.5 + optionalDependencies: + pg-cloudflare: 1.1.1 + + pgpass@1.0.5: + dependencies: + split2: 4.2.0 picocolors@1.0.0: {} @@ -6992,6 +8120,28 @@ snapshots: picocolors: 1.0.0 source-map-js: 1.2.0 + postgres-array@2.0.0: {} + + postgres-array@3.0.2: {} + + postgres-bytea@1.0.0: {} + + postgres-bytea@3.0.0: + dependencies: + obuf: 1.1.2 + + postgres-date@1.0.7: {} + + postgres-date@2.1.0: {} + + postgres-interval@1.2.0: + dependencies: + xtend: 4.0.2 + + postgres-interval@3.0.0: {} + + postgres-range@1.1.4: {} + prebuild-install@7.1.2: dependencies: detect-libc: 2.0.3 @@ -7006,19 +8156,21 @@ snapshots: simple-get: 4.0.1 tar-fs: 2.1.1 tunnel-agent: 0.6.0 + optional: true - prettier-plugin-svelte@3.2.3(prettier@3.2.5)(svelte@5.0.0-next.123): + prettier-plugin-svelte@3.2.3(prettier@3.2.5)(svelte@5.0.0-next.208): dependencies: prettier: 3.2.5 - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 - prettier-plugin-tailwindcss@0.5.14(prettier-plugin-svelte@3.2.3(prettier@3.2.5)(svelte@5.0.0-next.123))(prettier@3.2.5): + prettier-plugin-tailwindcss@0.5.14(prettier-plugin-svelte@3.2.3(prettier@3.2.5)(svelte@5.0.0-next.208))(prettier@3.2.5): dependencies: prettier: 3.2.5 optionalDependencies: - prettier-plugin-svelte: 3.2.3(prettier@3.2.5)(svelte@5.0.0-next.123) + prettier-plugin-svelte: 3.2.3(prettier@3.2.5)(svelte@5.0.0-next.208) - prettier@2.8.1: {} + prettier@2.8.1: + optional: true prettier@3.2.5: {} @@ -7036,11 +8188,17 @@ snapshots: printable-characters@1.0.42: {} - process-nextick-args@2.0.1: {} + process-nextick-args@2.0.1: + optional: true + + process@0.11.10: + optional: true - process@0.11.10: {} + progress@2.0.3: + optional: true - progress@2.0.3: {} + property-expr@2.0.6: + optional: true proxy-agent@6.3.0: dependencies: @@ -7054,6 +8212,7 @@ snapshots: socks-proxy-agent: 8.0.3 transitivePeerDependencies: - supports-color + optional: true proxy-agent@6.3.1: dependencies: @@ -7067,10 +8226,10 @@ snapshots: socks-proxy-agent: 8.0.3 transitivePeerDependencies: - supports-color + optional: true - proxy-from-env@1.1.0: {} - - proxy-target@3.0.2: {} + proxy-from-env@1.1.0: + optional: true psl@1.9.0: {} @@ -7078,6 +8237,7 @@ snapshots: dependencies: end-of-stream: 1.4.4 once: 1.4.0 + optional: true punycode@2.3.1: {} @@ -7096,16 +8256,20 @@ snapshots: - encoding - supports-color - utf-8-validate + optional: true - query-selector-shadow-dom@1.0.1: {} + query-selector-shadow-dom@1.0.1: + optional: true querystringify@2.2.0: {} queue-microtask@1.2.3: {} - queue-tick@1.0.1: {} + queue-tick@1.0.1: + optional: true - quick-lru@5.1.1: {} + quick-lru@5.1.1: + optional: true rc@1.2.8: dependencies: @@ -7113,6 +8277,7 @@ snapshots: ini: 1.3.8 minimist: 1.2.8 strip-json-comments: 2.0.1 + optional: true react-is@17.0.2: {} @@ -7135,12 +8300,14 @@ snapshots: safe-buffer: 5.1.2 string_decoder: 1.1.1 util-deprecate: 1.0.2 + optional: true readable-stream@3.6.2: dependencies: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 + optional: true readable-stream@4.5.2: dependencies: @@ -7149,10 +8316,12 @@ snapshots: events: 3.3.0 process: 0.11.10 string_decoder: 1.3.0 + optional: true readdir-glob@1.1.3: dependencies: minimatch: 5.1.6 + optional: true readdirp@3.6.0: dependencies: @@ -7171,7 +8340,8 @@ snapshots: requires-port@1.0.0: {} - resolve-alpn@1.2.1: {} + resolve-alpn@1.2.1: + optional: true resolve-from@4.0.0: {} @@ -7188,14 +8358,17 @@ snapshots: responselike@3.0.0: dependencies: lowercase-keys: 3.0.0 + optional: true resq@1.11.0: dependencies: fast-deep-equal: 2.0.1 + optional: true reusify@1.0.4: {} - rgb2hex@0.2.5: {} + rgb2hex@0.2.5: + optional: true rimraf@2.7.1: dependencies: @@ -7247,9 +8420,11 @@ snapshots: dependencies: mri: 1.2.0 - safaridriver@0.1.2: {} + safaridriver@0.1.2: + optional: true - safe-buffer@5.1.2: {} + safe-buffer@5.1.2: + optional: true safe-buffer@5.2.1: {} @@ -7273,17 +8448,21 @@ snapshots: '@types/node-forge': 1.3.11 node-forge: 1.3.1 - semver@7.6.2: {} + semver@7.6.2: + optional: true serialize-error@11.0.3: dependencies: type-fest: 2.19.0 + optional: true seroval-plugins@1.0.5(seroval@1.0.5): dependencies: seroval: 1.0.5 + optional: true - seroval@1.0.5: {} + seroval@1.0.5: + optional: true set-cookie-parser@2.6.0: {} @@ -7297,13 +8476,15 @@ snapshots: signal-exit@4.1.0: {} - simple-concat@1.0.1: {} + simple-concat@1.0.1: + optional: true simple-get@4.0.1: dependencies: decompress-response: 6.0.0 once: 1.4.0 simple-concat: 1.0.1 + optional: true sirv@2.0.4: dependencies: @@ -7311,9 +8492,8 @@ snapshots: mrmime: 2.0.0 totalist: 3.0.1 - sisteransi@1.0.5: {} - - smart-buffer@4.2.0: {} + smart-buffer@4.2.0: + optional: true socks-proxy-agent@8.0.3: dependencies: @@ -7322,22 +8502,20 @@ snapshots: socks: 2.8.3 transitivePeerDependencies: - supports-color + optional: true socks@2.8.3: dependencies: ip-address: 9.0.5 smart-buffer: 4.2.0 + optional: true solid-js@1.8.17: dependencies: csstype: 3.1.3 seroval: 1.0.5 seroval-plugins: 1.0.5(seroval@1.0.5) - - solid-swr-store@0.10.7(solid-js@1.8.17)(swr-store@0.10.6): - dependencies: - solid-js: 1.8.17 - swr-store: 0.10.6 + optional: true sorcery@0.11.0: dependencies: @@ -7357,30 +8535,20 @@ snapshots: sourcemap-codec@1.4.8: {} - spacetrim@0.11.24: {} + spacetrim@0.11.24: + optional: true split2@4.2.0: {} - sprintf-js@1.1.3: {} + sprintf-js@1.1.3: + optional: true sql.js@1.10.3: optional: true - sqlocal@0.9.0(drizzle-orm@0.30.10(@cloudflare/workers-types@4.20240502.0)(@types/better-sqlite3@7.6.11)(@types/sql.js@1.4.9)(better-sqlite3@10.0.0)(kysely@0.27.3)(react@18.3.1)(sql.js@1.10.3))(kysely@0.27.3): - dependencies: - '@sqlite.org/sqlite-wasm': 3.45.3-build1 - coincident: 1.2.3 - nanoid: 5.0.7 - optionalDependencies: - drizzle-orm: 0.30.10(@cloudflare/workers-types@4.20240502.0)(@types/better-sqlite3@7.6.11)(@types/sql.js@1.4.9)(better-sqlite3@10.0.0)(kysely@0.27.3)(react@18.3.1)(sql.js@1.10.3) - kysely: 0.27.3 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - sswr@2.0.0(svelte@5.0.0-next.123): + sswr@2.1.0(svelte@5.0.0-next.208): dependencies: - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 swrev: 4.0.0 stackback@0.0.2: {} @@ -7402,6 +8570,7 @@ snapshots: queue-tick: 1.0.1 optionalDependencies: bare-events: 2.2.2 + optional: true strict-event-emitter@0.5.1: {} @@ -7420,10 +8589,12 @@ snapshots: string_decoder@1.1.1: dependencies: safe-buffer: 5.1.2 + optional: true string_decoder@1.3.0: dependencies: safe-buffer: 5.2.1 + optional: true strip-ansi@6.0.1: dependencies: @@ -7439,13 +8610,14 @@ snapshots: dependencies: min-indent: 1.0.1 - strip-json-comments@2.0.1: {} + strip-json-comments@2.0.1: + optional: true strip-literal@2.1.0: dependencies: js-tokens: 9.0.0 - style-mod@4.1.2: {} + strnum@1.0.5: {} sucrase@3.35.0: dependencies: @@ -7457,6 +8629,9 @@ snapshots: pirates: 4.0.6 ts-interface-checker: 0.1.13 + superstruct@2.0.2: + optional: true + supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -7467,7 +8642,7 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-check@3.7.1(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.123): + svelte-check@3.7.1(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.208): dependencies: '@jridgewell/trace-mapping': 0.3.25 chokidar: 3.6.0 @@ -7475,8 +8650,8 @@ snapshots: import-fresh: 3.3.0 picocolors: 1.0.0 sade: 1.8.1 - svelte: 5.0.0-next.123 - svelte-preprocess: 5.1.4(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.123)(typescript@5.4.5) + svelte: 5.0.0-next.208 + svelte-preprocess: 5.1.4(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.208)(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: - '@babel/core' @@ -7489,42 +8664,37 @@ snapshots: - stylus - sugarss - svelte-codemirror-editor@1.3.0(codemirror@6.0.1(@lezer/common@1.2.1))(svelte@5.0.0-next.123): - dependencies: - codemirror: 6.0.1(@lezer/common@1.2.1) - svelte: 5.0.0-next.123 - svelte-filepond@0.2.2(filepond@4.31.1): dependencies: filepond: 4.31.1 - svelte-french-toast@1.2.0(svelte@5.0.0-next.123): + svelte-french-toast@1.2.0(svelte@5.0.0-next.208): dependencies: - svelte: 5.0.0-next.123 - svelte-writable-derived: 3.1.1(svelte@5.0.0-next.123) + svelte: 5.0.0-next.208 + svelte-writable-derived: 3.1.1(svelte@5.0.0-next.208) - svelte-hmr@0.16.0(svelte@5.0.0-next.123): + svelte-hmr@0.16.0(svelte@5.0.0-next.208): dependencies: - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 - svelte-preprocess@5.1.4(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.123)(typescript@5.4.5): + svelte-preprocess@5.1.4(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.208)(typescript@5.4.5): dependencies: '@types/pug': 2.0.10 detect-indent: 6.1.0 magic-string: 0.30.10 sorcery: 0.11.0 strip-indent: 3.0.0 - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 optionalDependencies: postcss: 8.4.38 postcss-load-config: 4.0.2(postcss@8.4.38) typescript: 5.4.5 - svelte-writable-derived@3.1.1(svelte@5.0.0-next.123): + svelte-writable-derived@3.1.1(svelte@5.0.0-next.208): dependencies: - svelte: 5.0.0-next.123 + svelte: 5.0.0-next.208 - svelte@5.0.0-next.123: + svelte@5.0.0-next.208: dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.4.15 @@ -7540,12 +8710,32 @@ snapshots: magic-string: 0.30.10 zimmerframe: 1.1.2 - swr-store@0.10.6: - dependencies: - dequal: 2.0.3 - - swr@2.2.0(react@18.3.1): + sveltekit-superforms@2.16.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208): dependencies: + '@sveltejs/kit': 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)))(svelte@5.0.0-next.208)(vite@5.2.11(@types/node@20.14.9)) + devalue: 5.0.0 + just-clone: 6.2.0 + memoize-weak: 1.0.2 + svelte: 5.0.0-next.208 + ts-deepmerge: 7.0.1 + optionalDependencies: + '@exodus/schemasafe': 1.3.0 + '@gcornut/valibot-json-schema': 0.31.0 + '@sinclair/typebox': 0.32.35 + '@sodaru/yup-to-json-schema': 2.0.1 + '@vinejs/vine': 1.8.0 + arktype: 2.0.0-beta.0 + joi: 17.13.3 + json-schema-to-ts: 3.1.0 + superstruct: 2.0.2 + valibot: 0.35.0 + yup: 1.4.0 + zod: 3.23.8 + zod-to-json-schema: 3.23.2(zod@3.23.8) + + swr@2.2.5(react@18.3.1): + dependencies: + client-only: 0.0.1 react: 18.3.1 use-sync-external-store: 1.2.2(react@18.3.1) @@ -7601,12 +8791,14 @@ snapshots: mkdirp-classic: 0.5.3 pump: 3.0.0 tar-stream: 2.2.0 + optional: true tar-fs@3.0.4: dependencies: mkdirp-classic: 0.5.3 pump: 3.0.0 tar-stream: 3.1.7 + optional: true tar-fs@3.0.6: dependencies: @@ -7615,6 +8807,7 @@ snapshots: optionalDependencies: bare-fs: 2.3.0 bare-path: 2.1.2 + optional: true tar-stream@2.2.0: dependencies: @@ -7623,12 +8816,14 @@ snapshots: fs-constants: 1.0.0 inherits: 2.0.4 readable-stream: 3.6.2 + optional: true tar-stream@3.1.7: dependencies: b4a: 1.6.6 fast-fifo: 1.3.2 streamx: 2.16.1 + optional: true thenify-all@1.6.0: dependencies: @@ -7638,12 +8833,11 @@ snapshots: dependencies: any-promise: 1.3.0 - through@2.3.8: {} + through@2.3.8: + optional: true - timers-ext@0.1.7: - dependencies: - es5-ext: 0.10.64 - next-tick: 1.1.0 + tiny-case@1.0.3: + optional: true tiny-glob@0.2.9: dependencies: @@ -7662,6 +8856,9 @@ snapshots: dependencies: is-number: 7.0.0 + toposort@2.0.2: + optional: true + totalist@3.0.1: {} tough-cookie@4.1.4: @@ -7677,26 +8874,37 @@ snapshots: dependencies: punycode: 2.3.1 + ts-algebra@2.0.0: + optional: true + + ts-deepmerge@7.0.1: {} + ts-interface-checker@0.1.13: {} + tslib@1.14.1: {} + + tslib@2.4.0: + optional: true + tslib@2.6.2: {} tunnel-agent@0.6.0: dependencies: safe-buffer: 5.2.1 + optional: true type-detect@4.0.8: {} type-fest@0.21.3: {} - type-fest@2.13.0: {} + type-fest@2.13.0: + optional: true - type-fest@2.19.0: {} + type-fest@2.19.0: + optional: true type-fest@4.20.1: {} - type@2.7.2: {} - typescript@5.4.5: {} ufo@1.5.3: {} @@ -7705,6 +8913,7 @@ snapshots: dependencies: buffer: 5.7.1 through: 2.3.8 + optional: true undici-types@5.26.5: {} @@ -7714,7 +8923,14 @@ snapshots: universalify@0.2.0: {} - universalify@2.0.1: {} + universalify@2.0.1: + optional: true + + unstructured-client@0.14.3(zod@3.23.8): + dependencies: + async: 3.2.5 + pdf-lib: 1.17.1 + zod: 3.23.8 unzipper@0.11.6: dependencies: @@ -7723,6 +8939,7 @@ snapshots: duplexer2: 0.1.4 fstream: 1.0.12 graceful-fs: 4.2.11 + optional: true update-browserslist-db@1.0.14(browserslist@4.23.0): dependencies: @@ -7739,10 +8956,24 @@ snapshots: dependencies: react: 18.3.1 - userhome@1.0.0: {} + userhome@1.0.0: + optional: true util-deprecate@1.0.2: {} + uuid@10.0.0: {} + + uuid@9.0.1: {} + + valibot@0.31.1: + optional: true + + valibot@0.35.0: + optional: true + + validator@13.12.0: + optional: true + vite-node@1.6.0(@types/node@20.14.9): dependencies: cac: 6.7.14 @@ -7819,8 +9050,6 @@ snapshots: optionalDependencies: typescript: 5.4.5 - w3c-keyname@2.2.8: {} - w3c-xmlserializer@5.0.0: dependencies: xml-name-validator: 5.0.0 @@ -7832,12 +9061,14 @@ snapshots: debug: 4.3.4 transitivePeerDependencies: - supports-color + optional: true - web-streams-polyfill@3.3.3: {} + web-streams-polyfill@3.3.3: + optional: true webdriver@8.36.1: dependencies: - '@types/node': 20.12.8 + '@types/node': 20.14.9 '@types/ws': 8.5.10 '@wdio/config': 8.36.1 '@wdio/logger': 8.28.0 @@ -7852,10 +9083,11 @@ snapshots: - bufferutil - supports-color - utf-8-validate + optional: true webdriverio@8.36.1(typescript@5.4.5): dependencies: - '@types/node': 20.12.8 + '@types/node': 20.14.9 '@wdio/config': 8.36.1 '@wdio/logger': 8.28.0 '@wdio/protocols': 8.32.0 @@ -7885,6 +9117,7 @@ snapshots: - supports-color - typescript - utf-8-validate + optional: true webidl-conversions@3.0.1: {} @@ -7913,14 +9146,13 @@ snapshots: which@4.0.0: dependencies: isexe: 3.1.1 + optional: true why-is-node-running@2.2.2: dependencies: siginfo: 2.0.0 stackback: 0.0.2 - wordwrap@1.0.0: {} - workerd@1.20240419.0: optionalDependencies: '@cloudflare/workerd-darwin-64': 1.20240419.0 @@ -7978,7 +9210,8 @@ snapshots: wrappy@1.0.2: {} - ws@8.13.0: {} + ws@8.13.0: + optional: true ws@8.17.0: {} @@ -7986,6 +9219,8 @@ snapshots: xmlchars@2.2.0: {} + xtend@4.0.2: {} + xxhash-wasm@1.0.2: {} y18n@5.0.8: {} @@ -8003,6 +9238,7 @@ snapshots: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 + optional: true yargs@17.7.2: dependencies: @@ -8018,6 +9254,7 @@ snapshots: dependencies: buffer-crc32: 0.2.13 fd-slicer: 1.1.0 + optional: true yocto-queue@1.0.0: {} @@ -8029,6 +9266,14 @@ snapshots: mustache: 4.2.0 stacktracey: 2.1.8 + yup@1.4.0: + dependencies: + property-expr: 2.0.6 + tiny-case: 1.0.3 + toposort: 2.0.2 + type-fest: 2.19.0 + optional: true + zimmerframe@1.1.2: {} zip-stream@6.0.1: @@ -8036,9 +9281,15 @@ snapshots: archiver-utils: 5.0.2 compress-commons: 6.0.2 readable-stream: 4.5.2 + optional: true + + zod-to-json-schema@3.22.5(zod@3.23.8): + dependencies: + zod: 3.23.8 - zod-to-json-schema@3.22.5(zod@3.23.6): + zod-to-json-schema@3.23.2(zod@3.23.8): dependencies: - zod: 3.23.6 + zod: 3.23.8 + optional: true - zod@3.23.6: {} + zod@3.23.8: {} diff --git a/src/components/DeleteDialog.svelte b/src/components/DeleteDialog.svelte index d2be542..62b4447 100644 --- a/src/components/DeleteDialog.svelte +++ b/src/components/DeleteDialog.svelte @@ -1,7 +1,14 @@ - - + + - - - Delete {capitalizeWords(type)} - + + + Delete {capitalizeWords(type)} +

Are you sure you want to delete this {type}?

{capitalizeWords(type)} to be deleted: {name}

This action cannot be undone.

-
- + + - -
-
+ + + diff --git a/src/components/RobotLoader.svelte b/src/components/RobotLoader.svelte new file mode 100644 index 0000000..aba9553 --- /dev/null +++ b/src/components/RobotLoader.svelte @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/components/ui/avatar/avatar-fallback.svelte b/src/components/ui/avatar/avatar-fallback.svelte new file mode 100644 index 0000000..d1f6ad0 --- /dev/null +++ b/src/components/ui/avatar/avatar-fallback.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/src/components/ui/avatar/avatar-image.svelte b/src/components/ui/avatar/avatar-image.svelte new file mode 100644 index 0000000..eaaf6f4 --- /dev/null +++ b/src/components/ui/avatar/avatar-image.svelte @@ -0,0 +1,18 @@ + + + diff --git a/src/components/ui/avatar/avatar.svelte b/src/components/ui/avatar/avatar.svelte new file mode 100644 index 0000000..78166c6 --- /dev/null +++ b/src/components/ui/avatar/avatar.svelte @@ -0,0 +1,18 @@ + + + + + diff --git a/src/components/ui/avatar/index.ts b/src/components/ui/avatar/index.ts new file mode 100644 index 0000000..d06457b --- /dev/null +++ b/src/components/ui/avatar/index.ts @@ -0,0 +1,13 @@ +import Root from "./avatar.svelte"; +import Image from "./avatar-image.svelte"; +import Fallback from "./avatar-fallback.svelte"; + +export { + Root, + Image, + Fallback, + // + Root as Avatar, + Image as AvatarImage, + Fallback as AvatarFallback, +}; diff --git a/src/components/ui/button/button.svelte b/src/components/ui/button/button.svelte index 86827f3..90bdc53 100644 --- a/src/components/ui/button/button.svelte +++ b/src/components/ui/button/button.svelte @@ -1,25 +1,25 @@ - + diff --git a/src/components/ui/card/card-content.svelte b/src/components/ui/card/card-content.svelte index 6dc9097..9c2c471 100644 --- a/src/components/ui/card/card-content.svelte +++ b/src/components/ui/card/card-content.svelte @@ -1,13 +1,15 @@ -
- +
+
diff --git a/src/components/ui/form/form-button.svelte b/src/components/ui/form/form-button.svelte new file mode 100644 index 0000000..71090ce --- /dev/null +++ b/src/components/ui/form/form-button.svelte @@ -0,0 +1,10 @@ + + + + + diff --git a/src/components/ui/form/form-description.svelte b/src/components/ui/form/form-description.svelte new file mode 100644 index 0000000..eadefbc --- /dev/null +++ b/src/components/ui/form/form-description.svelte @@ -0,0 +1,17 @@ + + + + + diff --git a/src/components/ui/form/form-element-field.svelte b/src/components/ui/form/form-element-field.svelte new file mode 100644 index 0000000..ee26649 --- /dev/null +++ b/src/components/ui/form/form-element-field.svelte @@ -0,0 +1,25 @@ + + + + + +
+ +
+
diff --git a/src/components/ui/form/form-field-errors.svelte b/src/components/ui/form/form-field-errors.svelte new file mode 100644 index 0000000..0a9f62a --- /dev/null +++ b/src/components/ui/form/form-field-errors.svelte @@ -0,0 +1,26 @@ + + + + + {#each errors as error} +
{error}
+ {/each} +
+
diff --git a/src/components/ui/form/form-field.svelte b/src/components/ui/form/form-field.svelte new file mode 100644 index 0000000..ae288a7 --- /dev/null +++ b/src/components/ui/form/form-field.svelte @@ -0,0 +1,27 @@ + + + + + + + +
+ +
+
diff --git a/src/components/ui/form/form-fieldset.svelte b/src/components/ui/form/form-fieldset.svelte new file mode 100644 index 0000000..8011e19 --- /dev/null +++ b/src/components/ui/form/form-fieldset.svelte @@ -0,0 +1,30 @@ + + + + + + + diff --git a/src/components/ui/form/form-label.svelte b/src/components/ui/form/form-label.svelte new file mode 100644 index 0000000..077b567 --- /dev/null +++ b/src/components/ui/form/form-label.svelte @@ -0,0 +1,17 @@ + + + diff --git a/src/components/ui/form/form-legend.svelte b/src/components/ui/form/form-legend.svelte new file mode 100644 index 0000000..817318a --- /dev/null +++ b/src/components/ui/form/form-legend.svelte @@ -0,0 +1,17 @@ + + + + + diff --git a/src/components/ui/form/index.ts b/src/components/ui/form/index.ts new file mode 100644 index 0000000..0713927 --- /dev/null +++ b/src/components/ui/form/index.ts @@ -0,0 +1,33 @@ +import * as FormPrimitive from "formsnap"; +import Description from "./form-description.svelte"; +import Label from "./form-label.svelte"; +import FieldErrors from "./form-field-errors.svelte"; +import Field from "./form-field.svelte"; +import Fieldset from "./form-fieldset.svelte"; +import Legend from "./form-legend.svelte"; +import ElementField from "./form-element-field.svelte"; +import Button from "./form-button.svelte"; + +const Control = FormPrimitive.Control; + +export { + Field, + Control, + Label, + Button, + FieldErrors, + Description, + Fieldset, + Legend, + ElementField, + // + Field as FormField, + Control as FormControl, + Description as FormDescription, + Label as FormLabel, + FieldErrors as FormFieldErrors, + Fieldset as FormFieldset, + Legend as FormLegend, + ElementField as FormElementField, + Button as FormButton, +}; diff --git a/src/components/ui/select/select-item.svelte b/src/components/ui/select/select-item.svelte index 991e431..1c875be 100644 --- a/src/components/ui/select/select-item.svelte +++ b/src/components/ui/select/select-item.svelte @@ -1,40 +1,45 @@ - - - - - - - {label || value} - + {#if image} + {label} + {:else} + + + + + + {/if} + + {label || value} + diff --git a/src/components/ui/textarea/textarea.svelte b/src/components/ui/textarea/textarea.svelte index 0d75315..3cb3d13 100644 --- a/src/components/ui/textarea/textarea.svelte +++ b/src/components/ui/textarea/textarea.svelte @@ -1,38 +1,40 @@ diff --git a/src/components/ui/tooltip/index.ts b/src/components/ui/tooltip/index.ts new file mode 100644 index 0000000..7d0444d --- /dev/null +++ b/src/components/ui/tooltip/index.ts @@ -0,0 +1,15 @@ +import { Tooltip as TooltipPrimitive } from "bits-ui"; +import Content from "./tooltip-content.svelte"; + +const Root = TooltipPrimitive.Root; +const Trigger = TooltipPrimitive.Trigger; + +export { + Root, + Trigger, + Content, + // + Root as Tooltip, + Content as TooltipContent, + Trigger as TooltipTrigger, +}; diff --git a/src/components/ui/tooltip/tooltip-content.svelte b/src/components/ui/tooltip/tooltip-content.svelte new file mode 100644 index 0000000..6887098 --- /dev/null +++ b/src/components/ui/tooltip/tooltip-content.svelte @@ -0,0 +1,28 @@ + + + + + diff --git a/src/database/client.ts b/src/database/client.ts index 2f39e40..b6196e6 100644 --- a/src/database/client.ts +++ b/src/database/client.ts @@ -1,21 +1,18 @@ -import { SQLocalDrizzle } from "sqlocal/drizzle"; -import { drizzle, SqliteRemoteDatabase } from "drizzle-orm/sqlite-proxy"; +import { drizzle, type PgliteDatabase } from "drizzle-orm/pglite"; +import { PGlite } from "@electric-sql/pglite"; import * as schema from "./schema"; -import { BaseSQLiteDatabase } from "drizzle-orm/sqlite-core"; -export const SQLITE_FILENAME = "workbench.db"; +let db: PgliteDatabase | undefined = undefined; -let db: SqliteRemoteDatabase | undefined = undefined; - -export function useDb(): BaseSQLiteDatabase { +export function useDb(): PgliteDatabase { if (!db) { - const { driver, batchDriver } = new SQLocalDrizzle(SQLITE_FILENAME); - db = drizzle(driver, batchDriver, { schema }); + const client = new PGlite("idb://workbench-data"); + db = drizzle(client, { schema }); } return db; } -export function useDbFile() { - const { getDatabaseFile, overwriteDatabaseFile } = new SQLocalDrizzle(SQLITE_FILENAME); - return { getDatabaseFile, overwriteDatabaseFile }; -} +// export function useDbFile() { +// const { getDatabaseFile, overwriteDatabaseFile } = new SQLocalDrizzle(SQLITE_FILENAME); +// return { getDatabaseFile, overwriteDatabaseFile }; +// } diff --git a/src/database/index.ts b/src/database/index.ts index 6433ac1..2414db0 100644 --- a/src/database/index.ts +++ b/src/database/index.ts @@ -1,32 +1,33 @@ -import { useDb, useDbFile } from "./client.js"; +import { useDb } from "./client.js"; import * as schema from "./schema.js"; import { sql } from "drizzle-orm/sql"; +import type { PgliteDatabase } from "drizzle-orm/pglite"; export { registerModel, invalidateModel } from "./model.js"; export * from "./schema.js"; export { schema, useDb }; -export async function overwriteDb() { - const { overwriteDatabaseFile } = useDbFile(); -} - -export async function exportDb() { - const { getDatabaseFile } = useDbFile(); - const databaseFile = await getDatabaseFile(); - const fileUrl = URL.createObjectURL(databaseFile); - - const now = new Date(); - const timestamp = now.toISOString().split(".")[0].replace(/\:/g, "-"); - - const a = document.createElement("a"); - a.href = fileUrl; - a.download = `workbench-${timestamp}.db`; - a.click(); - a.remove(); - - URL.revokeObjectURL(fileUrl); -} +// export async function overwriteDb() { +// const { overwriteDatabaseFile } = useDbFile(); +// } +// +// export async function exportDb() { +// const { getDatabaseFile } = useDbFile(); +// const databaseFile = await getDatabaseFile(); +// const fileUrl = URL.createObjectURL(databaseFile); +// +// const now = new Date(); +// const timestamp = now.toISOString().split(".")[0].replace(/\:/g, "-"); +// +// const a = document.createElement("a"); +// a.href = fileUrl; +// a.download = `workbench-${timestamp}.db`; +// a.click(); +// a.remove(); +// +// URL.revokeObjectURL(fileUrl); +// } export function exposeDb() { const db = useDb(); @@ -36,45 +37,61 @@ export function exposeDb() { window.sql = sql; // @ts-expect-error window.db_destroy = async function () { - const rows = await db.all(sql`SELECT name FROM sqlite_master WHERE type='table';`); - console.log("Dropping all tables", rows); - for (const record of rows) { - // drop table - // @ts-ignore - await db.run(sql.raw(`DROP TABLE ${record[0]};`)); - } - }; - // @ts-expect-error - window.db_listTables = async function () { - const rows = await db.all(sql`SELECT name FROM sqlite_master WHERE type='table';`); - console.log("Tables", rows); - for (const record of rows) { - // list count of rows - // @ts-ignore - const count = await db.get(sql.raw(`SELECT COUNT(*) FROM ${record[0]};`)); - // @ts-ignore - console.log(record[0], count); - } - }; - // @ts-expect-error - window.db_download = exportDb; - // @ts-expect-error - window.db_overwrite = function () { - const input = document.createElement("input"); - input.type = "file"; - input.accept = ".db"; - input.onchange = async function (e: any) { - console.log("overwrite", e); - if (!e.target) { - return; - } - const file = e.target.files[0]; - if (!file) { - return; + const db = useDb() as PgliteDatabase; + + // Get all tables in the public schema + const results = await db.execute<{ tablename: string }>(sql` + SELECT tablename + FROM pg_tables + WHERE schemaname = 'public'; + `); + + console.log("Dropping all tables", results.rows); + + // Drop all tables + for (const record of results.rows) { + try { + await db.execute(sql.raw(`DROP TABLE IF EXISTS "${record.tablename}" CASCADE;`)); + console.log(`Dropped table: ${record.tablename}`); + } catch (error) { + console.error(`Error dropping table ${record.tablename}:`, error); } - const { overwriteDatabaseFile } = useDbFile(); - await overwriteDatabaseFile(file); - }; - document.body.appendChild(input); + } + + console.log("All tables dropped"); }; + + // // @ts-expect-error + // window.db_listTables = async function () { + // const rows = await db.all(sql`SELECT name FROM sqlite_master WHERE type='table';`); + // console.log("Tables", rows); + // for (const record of rows) { + // // list count of rows + // // @ts-ignore + // const count = await db.get(sql.raw(`SELECT COUNT(*) FROM ${record[0]};`)); + // // @ts-ignore + // console.log(record[0], count); + // } + // }; + // // @ts-expect-error + // window.db_download = exportDb; + // // @ts-expect-error + // window.db_overwrite = function () { + // const input = document.createElement("input"); + // input.type = "file"; + // input.accept = ".db"; + // input.onchange = async function (e: any) { + // console.log("overwrite", e); + // if (!e.target) { + // return; + // } + // const file = e.target.files[0]; + // if (!file) { + // return; + // } + // const { overwriteDatabaseFile } = useDbFile(); + // await overwriteDatabaseFile(file); + // }; + // document.body.appendChild(input); + // }; } diff --git a/src/database/migrations.test.ts b/src/database/migrations.test.ts deleted file mode 100644 index 8f8c6dd..0000000 --- a/src/database/migrations.test.ts +++ /dev/null @@ -1,447 +0,0 @@ -import { - expect, - describe, - it, - beforeAll, - afterAll, - vi, - onTestFailed, - beforeEach, - afterEach, -} from "vitest"; -import { drizzle } from "drizzle-orm/better-sqlite3"; -import Database from "better-sqlite3"; -import { sql } from "drizzle-orm"; -import { useDb } from "@/database/client"; -import journal from "@/database/migrations/meta/_journal.json"; -import type { BetterSQLite3Database } from "drizzle-orm/better-sqlite3"; -import * as schema from "@/database/schema"; - -describe("Migration Tests", () => { - let sqlite: Database.Database; - let db: BetterSQLite3Database; - - /* - * Test data for all tables. This data will be used to populate the database - * after the initial migration and to verify the data integrity after subsequent migrations. - */ - const testData = { - projects: [ - { - id: "project1", - name: "Test Project 1", - prompt: "Test prompt 1", - createdAt: "2023-01-01T00:00:00Z", - }, - { - id: "project2", - name: "Test Project 2", - prompt: "Test prompt 2", - createdAt: "2023-01-02T00:00:00Z", - }, - { - id: "project3", - name: "Test Project 3", - prompt: "Test prompt 3", - createdAt: "2023-01-03T00:00:00Z", - }, - ], - services: [ - { - id: "service1", - name: "Test Service 1", - providerId: "provider1", - baseURL: "http://test1.com", - apiKey: "testkey1", - createdAt: "2023-01-01T00:00:00Z", - }, - { - id: "service2", - name: "Test Service 2", - providerId: "provider2", - baseURL: "http://test2.com", - apiKey: "testkey2", - createdAt: "2023-01-02T00:00:00Z", - }, - ], - models: [ - { - id: "model1", - serviceId: "service1", - name: "Test Model 1", - visible: 1, - createdAt: "2023-01-01T00:00:00Z", - }, - { - id: "model2", - serviceId: "service1", - name: "Test Model 2", - visible: 0, - createdAt: "2023-01-02T00:00:00Z", - }, - { - id: "model3", - serviceId: "service2", - name: "Test Model 3", - visible: 1, - createdAt: "2023-01-03T00:00:00Z", - }, - ], - responses: [ - { - id: "response1", - projectId: "project1", - modelId: "model1", - createdAt: "2023-01-01T00:00:00Z", - }, - { - id: "response2", - projectId: "project1", - modelId: "model2", - createdAt: "2023-01-02T00:00:00Z", - }, - { - id: "response3", - projectId: "project2", - modelId: "model1", - createdAt: "2023-01-03T00:00:00Z", - }, - { - id: "response4", - projectId: "project3", - modelId: "model3", - createdAt: "2023-01-04T00:00:00Z", - }, - ], - responseMessages: [ - { - id: "message1", - index: 0, - responseId: "response1", - role: "user", - content: "Test message 1", - createdAt: "2023-01-01T00:00:00Z", - }, - { - id: "message2", - index: 1, - responseId: "response1", - role: "assistant", - content: "Test reply 1", - createdAt: "2023-01-01T00:00:01Z", - }, - { - id: "message3", - index: 0, - responseId: "response2", - role: "user", - content: "Test message 2", - createdAt: "2023-01-02T00:00:00Z", - }, - { - id: "message4", - index: 0, - responseId: "response3", - role: "user", - content: "Test message 3", - createdAt: "2023-01-03T00:00:00Z", - }, - { - id: "message5", - index: 1, - responseId: "response3", - role: "assistant", - content: "Test reply 3", - createdAt: "2023-01-03T00:00:01Z", - }, - ], - }; - - let initialProjectCount: number; - let initialServiceCount: number; - let initialModelCount: number; - let initialResponseCount: number; - let initialMessageCount: number; - - function insertTestData() { - for (const project of testData.projects) { - db.run( - sql`INSERT INTO project (id, name, prompt, createdAt) VALUES (${project.id}, ${project.name}, ${project.prompt}, ${project.createdAt})`, - ); - } - for (const service of testData.services) { - db.run( - sql`INSERT INTO service (id, name, providerId, baseURL, apiKey, createdAt) VALUES (${service.id}, ${service.name}, ${service.providerId}, ${service.baseURL}, ${service.apiKey}, ${service.createdAt})`, - ); - } - for (const model of testData.models) { - db.run( - sql`INSERT INTO model (id, serviceId, name, visible, createdAt) VALUES (${model.id}, ${model.serviceId}, ${model.name}, ${model.visible}, ${model.createdAt})`, - ); - } - for (const response of testData.responses) { - db.run( - sql`INSERT INTO response (id, projectId, modelId, createdAt) VALUES (${response.id}, ${response.projectId}, ${response.modelId}, ${response.createdAt})`, - ); - } - for (const message of testData.responseMessages) { - db.run( - sql`INSERT INTO responseMessage (id, "index", responseId, role, content, createdAt) VALUES (${message.id}, ${message.index}, ${message.responseId}, ${message.role}, ${message.content}, ${message.createdAt})`, - ); - } - /* - * Verify that the initial data was inserted correctly. - * This establishes a baseline for comparison after migrations. - */ - initialProjectCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM project`, - ).count; - initialServiceCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM service`, - ).count; - initialModelCount = db.get<{ count: number }>(sql`SELECT COUNT(*) as count FROM model`).count; - initialResponseCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM response`, - ).count; - initialMessageCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM responseMessage`, - ).count; - - expect(initialProjectCount).toBe(testData.projects.length); - expect(initialServiceCount).toBe(testData.services.length); - expect(initialModelCount).toBe(testData.models.length); - expect(initialResponseCount).toBe(testData.responses.length); - expect(initialMessageCount).toBe(testData.responseMessages.length); - } - - vi.mock("@/database/client"); - - beforeEach(async () => { - sqlite = new Database(":memory:"); - db = drizzle(sqlite); - vi.mocked(useDb).mockReturnValue(db); - - // run initial migration and insert test data - await runMigration(journal.entries[0].tag); - insertTestData(); - }); - - afterEach(() => { - sqlite.close(); - vi.resetAllMocks(); - }); - - async function runMigration(migration: string) { - const migrationSql = (await import(`@/database/migrations/${migration}.sql?raw`)).default; - db.run(sql`PRAGMA foreign_keys = OFF;`); - await Promise.all( - migrationSql.split("--> statement-breakpoint").map((s: string) => db.run(sql.raw(s))), - ); - db.run(sql`PRAGMA foreign_keys = ON;`); - } - - it("0000_careful_smiling_tiger", async () => { - /* - * Check for unique and other indexes after the first migration - * This ensures that the initial schema is set up correctly with all necessary constraints - */ - const documentNameUniqueIndex = db.get<{ name: string } | undefined>( - sql`SELECT name FROM sqlite_master WHERE type='index' AND name='document_name_unique'`, - ); - expect(documentNameUniqueIndex).toBeTruthy(); - - const serviceNameUniqueIndex = db.get<{ name: string } | undefined>( - sql`SELECT name FROM sqlite_master WHERE type='index' AND name='serviceName_unique'`, - ); - expect(serviceNameUniqueIndex).toBeTruthy(); - }); - - it("0001_nosy_earthquake", async () => { - await runMigration(journal.entries[1].tag); - - /* - * Verify data integrity after the second migration. - * The record counts should remain the same as no data was added or removed. - */ - const secondMigrationResponseCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM response`, - ).count; - const secondMigrationMessageCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM responseMessage`, - ).count; - const secondMigrationModelCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM model`, - ).count; - - expect(secondMigrationResponseCount).toBe(initialResponseCount); - expect(secondMigrationMessageCount).toBe(initialMessageCount); - expect(secondMigrationModelCount).toBe(initialModelCount); - - /* - * Verify that the new indexes were created. - * This is crucial for ensuring the migration successfully improved query performance. - */ - const responseIndex = db.get<{ name: string } | undefined>( - sql`SELECT name FROM sqlite_master WHERE type='index' AND name='projectId_idx'`, - ); - const messageIndex = db.get<{ name: string } | undefined>( - sql`SELECT name FROM sqlite_master WHERE type='index' AND name='responseId_idx'`, - ); - const modelIndex = db.get<{ name: string } | undefined>( - sql`SELECT name FROM sqlite_master WHERE type='index' AND name='serviceId_idx'`, - ); - - expect(responseIndex).toBeTruthy(); - expect(messageIndex).toBeTruthy(); - expect(modelIndex).toBeTruthy(); - - /* - * Check the structure of the new tables after the second migration - * This verifies that the tables were recreated with the correct structure - */ - const responseColumns = db.all<{ name: string; type: string }>( - sql`PRAGMA table_info(response)`, - ); - expect(responseColumns).toContainEqual( - expect.objectContaining({ name: "error", type: "TEXT" }), - ); - - const responseMessageColumns = db.all<{ name: string; type: string }>( - sql`PRAGMA table_info(responseMessage)`, - ); - expect(responseMessageColumns).toContainEqual( - expect.objectContaining({ name: "index", type: "INTEGER" }), - ); - - const modelColumns = db.all<{ name: string; type: string }>(sql`PRAGMA table_info(model)`); - expect(modelColumns).toContainEqual( - expect.objectContaining({ name: "visible", type: "INTEGER" }), - ); - - /* - * Test the UNIQUE constraint on the model table - * This ensures that the unique constraint on (serviceId, name) is working correctly - */ - expect(() => - db.run(sql` - INSERT INTO model (id, serviceId, name, visible, createdAt) - VALUES ('model4', 'service1', 'Test Model 1', 1, '2023-01-04T00:00:00Z') - `), - ).toThrow(); - }); - - it("0002_overjoyed_mordo", async () => { - await runMigration(journal.entries[1].tag); - await runMigration(journal.entries[2].tag); - - /* - * Verify that the 'project' table was successfully renamed to 'chat'. - * The count of records in 'chat' should match the original 'project' count. - */ - const thirdMigrationChatCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM chat`, - ).count; - expect(thirdMigrationChatCount).toBe(initialProjectCount); - - /* - * Confirm that the 'project' table no longer exists. - * This ensures the renaming was done correctly and didn't leave behind the old table. - */ - const projectTableExists = db.get<{ name: string } | undefined>( - sql`SELECT name FROM sqlite_master WHERE type='table' AND name='project'`, - ); - expect(projectTableExists).toBeFalsy(); - - /* - * Verify that the 'response' table wasn't affected by the renaming. - * Its record count should remain the same. - */ - const thirdMigrationResponseCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM response`, - ).count; - expect(thirdMigrationResponseCount).toBe(initialResponseCount); - - /* - * Check that the 'response' table now has a 'chatId' column instead of 'projectId'. - * This verifies that the foreign key was updated correctly. - */ - const chatIdColumn = db.get<{ name: string; type: string } | undefined>( - sql`PRAGMA table_info(response)`, - ); - expect(chatIdColumn).toBeTruthy(); - expect(chatIdColumn?.type).toBe("TEXT"); - - /* - * Verify that the index on 'response' was updated to use 'chatId'. - * This ensures that query performance is maintained after the schema change. - */ - const chatIdIndex = db.get<{ name: string } | undefined>( - sql`SELECT name FROM sqlite_master WHERE type='index' AND name='chatId_idx'`, - ); - expect(chatIdIndex).toBeTruthy(); - - /* - * Verify that the data in the 'chat' table matches the original 'project' data. - * This ensures that no data was lost or corrupted during the renaming process. - */ - const chatData = db.all<{ id: string; name: string; prompt: string }>( - sql`SELECT id, name, prompt FROM chat ORDER BY id`, - ); - expect(chatData).toEqual( - testData.projects.map(({ id, name, prompt }) => ({ id, name, prompt })), - ); - /* - * Verify that the 'response' table data is correct, with 'chatId' replacing 'projectId'. - * This ensures that the foreign key relationships were properly updated. - */ - const responseData = db.all<{ id: string; chatId: string; modelId: string }>( - sql`SELECT id, chatId, modelId FROM response ORDER BY id`, - ); - expect(responseData).toEqual( - testData.responses.map(({ id, projectId: chatId, modelId }) => ({ id, chatId, modelId })), - ); - - /* - * Verify that the 'responseMessage' table data remains unchanged. - * This table wasn't directly affected by the migrations, so its data should be intact. - */ - const messageData = db.all<{ id: string; responseId: string; role: string; content: string }>( - sql`SELECT id, responseId, role, content FROM responseMessage ORDER BY id`, - ); - expect(messageData).toEqual( - testData.responseMessages.map(({ id, responseId, role, content }) => ({ - id, - responseId, - role, - content, - })), - ); - - /* - * Test the ON DELETE CASCADE behavior introduced in the third migration. - * This ensures that when a chat is deleted, its associated responses are also deleted. - */ - await db.run(sql`DELETE FROM chat WHERE id = 'project1'`); - const responseCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM response WHERE chatId = 'project1'`, - ).count; - expect(responseCount).toBe(0); - - /* - * Verify that the deletion of 'project1' didn't affect other chats' responses - */ - const remainingResponseCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM response`, - ).count; - expect(remainingResponseCount).toBe(initialResponseCount - 2); // 'project1' had 2 responses - - /* - * Check that the responseMessages associated with the deleted responses are also removed - * This tests the cascading delete behavior through multiple levels - */ - const remainingMessageCount = db.get<{ count: number }>( - sql`SELECT COUNT(*) as count FROM responseMessage`, - ).count; - expect(remainingMessageCount).toBe(initialMessageCount - 3); // 'project1' had 3 messages - }); -}); diff --git a/src/database/migrations/0000_careful_smiling_tiger.sql b/src/database/migrations/0000_careful_smiling_tiger.sql deleted file mode 100644 index 74f321c..0000000 --- a/src/database/migrations/0000_careful_smiling_tiger.sql +++ /dev/null @@ -1,58 +0,0 @@ -CREATE TABLE `document` ( - `id` text PRIMARY KEY NOT NULL, - `name` text NOT NULL, - `description` text NOT NULL, - `content` text NOT NULL, - `createdAt` text DEFAULT (CURRENT_TIMESTAMP) -); ---> statement-breakpoint -CREATE TABLE `model` ( - `id` text PRIMARY KEY NOT NULL, - `serviceId` text NOT NULL, - `name` text NOT NULL, - `visible` integer NOT NULL, - `createdAt` text DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (`serviceId`) REFERENCES `service`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -CREATE TABLE `project` ( - `id` text PRIMARY KEY NOT NULL, - `name` text NOT NULL, - `prompt` text NOT NULL, - `createdAt` text DEFAULT (CURRENT_TIMESTAMP) -); ---> statement-breakpoint -CREATE TABLE `responseMessage` ( - `id` text PRIMARY KEY NOT NULL, - `index` integer NOT NULL, - `responseId` text NOT NULL, - `role` text NOT NULL, - `content` text NOT NULL, - `createdAt` text DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (`responseId`) REFERENCES `response`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -CREATE TABLE `response` ( - `id` text PRIMARY KEY NOT NULL, - `projectId` text NOT NULL, - `modelId` text NOT NULL, - `error` text, - `createdAt` text DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (`projectId`) REFERENCES `project`(`id`) ON UPDATE no action ON DELETE no action, - FOREIGN KEY (`modelId`) REFERENCES `model`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -CREATE TABLE `service` ( - `id` text PRIMARY KEY NOT NULL, - `name` text NOT NULL, - `providerId` text NOT NULL, - `baseURL` text NOT NULL, - `apiKey` text NOT NULL, - `createdAt` text DEFAULT (CURRENT_TIMESTAMP) -); ---> statement-breakpoint -CREATE UNIQUE INDEX `document_name_unique` ON `document` (`name`);--> statement-breakpoint -CREATE INDEX `serviceId_idx` ON `model` (`serviceId`);--> statement-breakpoint -CREATE UNIQUE INDEX `serviceName_unique` ON `model` (`serviceId`,`name`);--> statement-breakpoint -CREATE INDEX `responseId_idx` ON `responseMessage` (`responseId`);--> statement-breakpoint -CREATE INDEX `projectId_idx` ON `response` (`projectId`); \ No newline at end of file diff --git a/src/database/migrations/0000_nappy_the_liberteens.sql b/src/database/migrations/0000_nappy_the_liberteens.sql new file mode 100644 index 0000000..682d5c9 --- /dev/null +++ b/src/database/migrations/0000_nappy_the_liberteens.sql @@ -0,0 +1,111 @@ +CREATE TABLE IF NOT EXISTS "attachment" ( + "id" text PRIMARY KEY NOT NULL, + "message_id" text NOT NULL, + "document_id" text NOT NULL, + "created_at" text DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT "message_document_unique" UNIQUE("message_id","document_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "chat" ( + "id" text PRIMARY KEY NOT NULL, + "name" text NOT NULL, + "prompt" text NOT NULL, + "created_at" text DEFAULT CURRENT_TIMESTAMP +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "document" ( + "id" text PRIMARY KEY NOT NULL, + "name" text NOT NULL, + "type" text DEFAULT 'document' NOT NULL, + "description" text NOT NULL, + "content" text NOT NULL, + "attributes" jsonb DEFAULT '{}'::jsonb NOT NULL, + "created_at" text DEFAULT CURRENT_TIMESTAMP +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "key" ( + "id" text PRIMARY KEY NOT NULL, + "name" text NOT NULL, + "service_id" text NOT NULL, + "base_url" text, + "api_key" text NOT NULL, + "created_at" text DEFAULT CURRENT_TIMESTAMP +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "message" ( + "id" text PRIMARY KEY NOT NULL, + "index" integer NOT NULL, + "revision_id" text NOT NULL, + "role" text NOT NULL, + "content" text NOT NULL, + "created_at" text DEFAULT CURRENT_TIMESTAMP +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "model" ( + "id" text PRIMARY KEY NOT NULL, + "key_id" text NOT NULL, + "name" text NOT NULL, + "visible" integer NOT NULL, + "created_at" text DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT "account_id_unique" UNIQUE("key_id","name") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "revision" ( + "id" text PRIMARY KEY NOT NULL, + "version" integer NOT NULL, + "chat_id" text NOT NULL, + "error" text, + "created_at" text DEFAULT CURRENT_TIMESTAMP +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "sdk" ( + "id" text PRIMARY KEY NOT NULL, + "slug" text NOT NULL, + "type" text DEFAULT 'model' NOT NULL, + "name" text NOT NULL, + "supported" integer DEFAULT 1 NOT NULL, + CONSTRAINT "slug_unique" UNIQUE("slug") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "service" ( + "id" text PRIMARY KEY NOT NULL, + "name" text NOT NULL, + "sdk_id" text NOT NULL, + "base_url" text, + "created_at" text DEFAULT CURRENT_TIMESTAMP +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "attachment" ADD CONSTRAINT "attachment_message_id_message_id_fk" FOREIGN KEY ("message_id") REFERENCES "public"."message"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "attachment" ADD CONSTRAINT "attachment_document_id_document_id_fk" FOREIGN KEY ("document_id") REFERENCES "public"."document"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "message" ADD CONSTRAINT "message_revision_id_revision_id_fk" FOREIGN KEY ("revision_id") REFERENCES "public"."revision"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "model" ADD CONSTRAINT "model_key_id_key_id_fk" FOREIGN KEY ("key_id") REFERENCES "public"."key"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "revision" ADD CONSTRAINT "revision_chat_id_chat_id_fk" FOREIGN KEY ("chat_id") REFERENCES "public"."chat"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "attachment_message_id_idx" ON "attachment" USING btree ("message_id");--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "message_revision_id_idx" ON "message" USING btree ("revision_id");--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "account_id_idx" ON "model" USING btree ("key_id");--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "revision_chat_id_idx" ON "revision" USING btree ("chat_id"); \ No newline at end of file diff --git a/src/database/migrations/0001_nosy_earthquake.sql b/src/database/migrations/0001_nosy_earthquake.sql deleted file mode 100644 index 556dbf4..0000000 --- a/src/database/migrations/0001_nosy_earthquake.sql +++ /dev/null @@ -1,54 +0,0 @@ -CREATE TABLE new_response ( - id TEXT PRIMARY KEY, - projectId TEXT NOT NULL, - modelId TEXT NOT NULL, - error TEXT, - createdAt TEXT DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (projectId) REFERENCES project(id) ON DELETE CASCADE -); ---> statement-breakpoint -INSERT INTO new_response SELECT * FROM response; ---> statement-breakpoint -DROP TABLE response; ---> statement-breakpoint -ALTER TABLE new_response RENAME TO response; ---> statement-breakpoint -CREATE TABLE new_responseMessage ( - id TEXT PRIMARY KEY, - "index" INTEGER NOT NULL, - responseId TEXT NOT NULL, - role TEXT NOT NULL, - content TEXT NOT NULL, - createdAt TEXT DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (responseId) REFERENCES response(id) ON DELETE CASCADE -); ---> statement-breakpoint -INSERT INTO new_responseMessage SELECT * FROM responseMessage; ---> statement-breakpoint -DROP TABLE responseMessage; ---> statement-breakpoint -ALTER TABLE new_responseMessage RENAME TO responseMessage; ---> statement-breakpoint -CREATE TABLE new_model ( - id TEXT PRIMARY KEY, - serviceId TEXT NOT NULL, - name TEXT NOT NULL, - visible INTEGER NOT NULL, - createdAt TEXT DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (serviceId) REFERENCES service(id) ON DELETE CASCADE, - UNIQUE (serviceId, name) -); ---> statement-breakpoint -INSERT INTO new_model SELECT * FROM model; ---> statement-breakpoint -DROP TABLE model; ---> statement-breakpoint -ALTER TABLE new_model RENAME TO model; ---> statement-breakpoint -CREATE INDEX projectId_idx ON response(projectId); ---> statement-breakpoint -CREATE INDEX responseId_idx ON responseMessage(responseId); ---> statement-breakpoint -CREATE INDEX serviceId_idx ON model(serviceId); ---> statement-breakpoint -CREATE UNIQUE INDEX `serviceName_unique` ON `model` (`serviceId`,`name`); diff --git a/src/database/migrations/0002_overjoyed_mordo.sql b/src/database/migrations/0002_overjoyed_mordo.sql deleted file mode 100644 index 3d79d39..0000000 --- a/src/database/migrations/0002_overjoyed_mordo.sql +++ /dev/null @@ -1,41 +0,0 @@ -ALTER TABLE `project` RENAME TO `chat`; ---> statement-breakpoint -ALTER TABLE `response` RENAME COLUMN `projectId` TO `chatId`; ---> statement-breakpoint -DROP INDEX IF EXISTS `projectId_idx`; ---> statement-breakpoint -CREATE TABLE `new_response` ( - `id` text PRIMARY KEY NOT NULL, - `chatId` text NOT NULL, - `modelId` text NOT NULL, - `error` text, - `createdAt` text DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (`chatId`) REFERENCES `chat`(`id`) ON UPDATE no action ON DELETE cascade -); ---> statement-breakpoint -INSERT INTO `new_response` SELECT * FROM `response`; ---> statement-breakpoint -DROP TABLE `response`; ---> statement-breakpoint -ALTER TABLE `new_response` RENAME TO `response`; ---> statement-breakpoint -CREATE INDEX `chatId_idx` ON `response` (`chatId`); ---> statement-breakpoint --- Must recreate responseMessage so that its foreign key references the new response table -CREATE TABLE `new_responseMessage` ( - `id` text PRIMARY KEY NOT NULL, - `index` integer NOT NULL, - `responseId` text NOT NULL, - `role` text NOT NULL, - `content` text NOT NULL, - `createdAt` text DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (`responseId`) REFERENCES `response`(`id`) ON DELETE CASCADE -); ---> statement-breakpoint -INSERT INTO `new_responseMessage` SELECT * FROM `responseMessage`; ---> statement-breakpoint -DROP TABLE `responseMessage`; ---> statement-breakpoint -ALTER TABLE `new_responseMessage` RENAME TO `responseMessage`; ---> statement-breakpoint -CREATE INDEX `responseId_idx` ON `responseMessage` (`responseId`); diff --git a/src/database/migrations/meta/0000_snapshot.json b/src/database/migrations/meta/0000_snapshot.json index 42c48f9..5ceda9f 100644 --- a/src/database/migrations/meta/0000_snapshot.json +++ b/src/database/migrations/meta/0000_snapshot.json @@ -1,168 +1,226 @@ { - "version": "6", - "dialect": "sqlite", - "id": "e48d9370-c57b-4cce-95ab-c80a492bbe34", + "id": "c8f95801-d339-42a4-a17d-d8ec8c06b21f", "prevId": "00000000-0000-0000-0000-000000000000", + "version": "7", + "dialect": "postgresql", "tables": { - "document": { - "name": "document", + "public.attachment": { + "name": "attachment", + "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "description": { - "name": "description", + "message_id": { + "name": "message_id", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "content": { - "name": "content", + "document_id": { + "name": "document_id", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "createdAt": { - "name": "createdAt", + "created_at": { + "name": "created_at", "type": "text", "primaryKey": false, "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" + "default": "CURRENT_TIMESTAMP" } }, "indexes": { - "document_name_unique": { - "name": "document_name_unique", + "attachment_message_id_idx": { + "name": "attachment_message_id_idx", "columns": [ - "name" + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } ], - "isUnique": true + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "attachment_message_id_message_id_fk": { + "name": "attachment_message_id_message_id_fk", + "tableFrom": "attachment", + "tableTo": "message", + "columnsFrom": [ + "message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "attachment_document_id_document_id_fk": { + "name": "attachment_document_id_document_id_fk", + "tableFrom": "attachment", + "tableTo": "document", + "columnsFrom": [ + "document_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" } }, - "foreignKeys": {}, "compositePrimaryKeys": {}, - "uniqueConstraints": {} + "uniqueConstraints": { + "message_document_unique": { + "name": "message_document_unique", + "nullsNotDistinct": false, + "columns": [ + "message_id", + "document_id" + ] + } + } }, - "model": { - "name": "model", + "public.chat": { + "name": "chat", + "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, - "notNull": true, - "autoincrement": false + "notNull": true }, - "serviceId": { - "name": "serviceId", + "name": { + "name": "name", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.document": { + "name": "document", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, "notNull": true, - "autoincrement": false + "default": "'document'" }, - "visible": { - "name": "visible", - "type": "integer", + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "attributes": { + "name": "attributes", + "type": "jsonb", "primaryKey": false, "notNull": true, - "autoincrement": false + "default": "'{}'::jsonb" }, - "createdAt": { - "name": "createdAt", + "created_at": { + "name": "created_at", "type": "text", "primaryKey": false, "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": { - "serviceId_idx": { - "name": "serviceId_idx", - "columns": [ - "serviceId" - ], - "isUnique": false - }, - "serviceName_unique": { - "name": "serviceName_unique", - "columns": [ - "serviceId", - "name" - ], - "isUnique": true - } - }, - "foreignKeys": { - "model_serviceId_service_id_fk": { - "name": "model_serviceId_service_id_fk", - "tableFrom": "model", - "tableTo": "service", - "columnsFrom": [ - "serviceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" + "default": "CURRENT_TIMESTAMP" } }, + "indexes": {}, + "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "project": { - "name": "project", + "public.key": { + "name": "key", + "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, - "notNull": true, - "autoincrement": false + "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "prompt": { - "name": "prompt", + "service_id": { + "name": "service_id", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true + }, + "base_url": { + "name": "base_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "api_key": { + "name": "api_key", + "type": "text", + "primaryKey": false, + "notNull": true }, - "createdAt": { - "name": "createdAt", + "created_at": { + "name": "created_at", "type": "text", "primaryKey": false, "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" + "default": "CURRENT_TIMESTAMP" } }, "indexes": {}, @@ -170,205 +228,318 @@ "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "responseMessage": { - "name": "responseMessage", + "public.message": { + "name": "message", + "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, - "notNull": true, - "autoincrement": false + "notNull": true }, "index": { "name": "index", "type": "integer", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "responseId": { - "name": "responseId", + "revision_id": { + "name": "revision_id", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, "role": { "name": "role", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, "content": { "name": "content", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "createdAt": { - "name": "createdAt", + "created_at": { + "name": "created_at", "type": "text", "primaryKey": false, "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" + "default": "CURRENT_TIMESTAMP" } }, "indexes": { - "responseId_idx": { - "name": "responseId_idx", + "message_revision_id_idx": { + "name": "message_revision_id_idx", "columns": [ - "responseId" + { + "expression": "revision_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } ], - "isUnique": false + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { - "responseMessage_responseId_response_id_fk": { - "name": "responseMessage_responseId_response_id_fk", - "tableFrom": "responseMessage", - "tableTo": "response", + "message_revision_id_revision_id_fk": { + "name": "message_revision_id_revision_id_fk", + "tableFrom": "message", + "tableTo": "revision", "columnsFrom": [ - "responseId" + "revision_id" ], "columnsTo": [ "id" ], - "onDelete": "no action", + "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "response": { - "name": "response", + "public.model": { + "name": "model", + "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, - "notNull": true, - "autoincrement": false + "notNull": true }, - "projectId": { - "name": "projectId", + "key_id": { + "name": "key_id", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "modelId": { - "name": "modelId", + "name": { + "name": "name", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "error": { - "name": "error", - "type": "text", + "visible": { + "name": "visible", + "type": "integer", "primaryKey": false, - "notNull": false, - "autoincrement": false + "notNull": true }, - "createdAt": { - "name": "createdAt", + "created_at": { + "name": "created_at", "type": "text", "primaryKey": false, "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" + "default": "CURRENT_TIMESTAMP" } }, "indexes": { - "projectId_idx": { - "name": "projectId_idx", + "account_id_idx": { + "name": "account_id_idx", "columns": [ - "projectId" + { + "expression": "key_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } ], - "isUnique": false + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": { - "response_projectId_project_id_fk": { - "name": "response_projectId_project_id_fk", - "tableFrom": "response", - "tableTo": "project", + "model_key_id_key_id_fk": { + "name": "model_key_id_key_id_fk", + "tableFrom": "model", + "tableTo": "key", "columnsFrom": [ - "projectId" + "key_id" ], "columnsTo": [ "id" ], - "onDelete": "no action", + "onDelete": "cascade", "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "account_id_unique": { + "name": "account_id_unique", + "nullsNotDistinct": false, + "columns": [ + "key_id", + "name" + ] + } + } + }, + "public.revision": { + "name": "revision", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true }, - "response_modelId_model_id_fk": { - "name": "response_modelId_model_id_fk", - "tableFrom": "response", - "tableTo": "model", + "chat_id": { + "name": "chat_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + } + }, + "indexes": { + "revision_chat_id_idx": { + "name": "revision_chat_id_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "revision_chat_id_chat_id_fk": { + "name": "revision_chat_id_chat_id_fk", + "tableFrom": "revision", + "tableTo": "chat", "columnsFrom": [ - "modelId" + "chat_id" ], "columnsTo": [ "id" ], - "onDelete": "no action", + "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "service": { - "name": "service", + "public.sdk": { + "name": "sdk", + "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, "notNull": true, - "autoincrement": false + "default": "'model'" }, "name": { "name": "name", "type": "text", "primaryKey": false, + "notNull": true + }, + "supported": { + "name": "supported", + "type": "integer", + "primaryKey": false, "notNull": true, - "autoincrement": false + "default": 1 + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "slug_unique": { + "name": "slug_unique", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + } + }, + "public.service": { + "name": "service", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true }, - "providerId": { - "name": "providerId", + "name": { + "name": "name", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "baseURL": { - "name": "baseURL", + "sdk_id": { + "name": "sdk_id", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": true }, - "apiKey": { - "name": "apiKey", + "base_url": { + "name": "base_url", "type": "text", "primaryKey": false, - "notNull": true, - "autoincrement": false + "notNull": false }, - "createdAt": { - "name": "createdAt", + "created_at": { + "name": "created_at", "type": "text", "primaryKey": false, "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" + "default": "CURRENT_TIMESTAMP" } }, "indexes": {}, @@ -378,9 +549,11 @@ } }, "enums": {}, + "schemas": {}, + "sequences": {}, "_meta": { + "columns": {}, "schemas": {}, - "tables": {}, - "columns": {} + "tables": {} } } \ No newline at end of file diff --git a/src/database/migrations/meta/0001_snapshot.json b/src/database/migrations/meta/0001_snapshot.json deleted file mode 100644 index 0729d67..0000000 --- a/src/database/migrations/meta/0001_snapshot.json +++ /dev/null @@ -1,373 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "bfc7699b-dda4-4c1f-836b-145406d9d2f2", - "prevId": "e48d9370-c57b-4cce-95ab-c80a492bbe34", - "tables": { - "document": { - "name": "document", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": { - "document_name_unique": { - "name": "document_name_unique", - "columns": [ - "name" - ], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "serviceId": { - "name": "serviceId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "visible": { - "name": "visible", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": { - "serviceId_idx": { - "name": "serviceId_idx", - "columns": [ - "serviceId" - ], - "isUnique": false - }, - "serviceName_unique": { - "name": "serviceName_unique", - "columns": [ - "serviceId", - "name" - ], - "isUnique": true - } - }, - "foreignKeys": { - "model_serviceId_service_id_fk": { - "name": "model_serviceId_service_id_fk", - "tableFrom": "model", - "tableTo": "service", - "columnsFrom": [ - "serviceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "project": { - "name": "project", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "prompt": { - "name": "prompt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "responseMessage": { - "name": "responseMessage", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "index": { - "name": "index", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "responseId": { - "name": "responseId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": { - "responseId_idx": { - "name": "responseId_idx", - "columns": [ - "responseId" - ], - "isUnique": false - } - }, - "foreignKeys": { - "responseMessage_responseId_response_id_fk": { - "name": "responseMessage_responseId_response_id_fk", - "tableFrom": "responseMessage", - "tableTo": "response", - "columnsFrom": [ - "responseId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "response": { - "name": "response", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "projectId": { - "name": "projectId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "modelId": { - "name": "modelId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": { - "projectId_idx": { - "name": "projectId_idx", - "columns": [ - "projectId" - ], - "isUnique": false - } - }, - "foreignKeys": { - "response_projectId_project_id_fk": { - "name": "response_projectId_project_id_fk", - "tableFrom": "response", - "tableTo": "project", - "columnsFrom": [ - "projectId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "service": { - "name": "service", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "providerId": { - "name": "providerId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "baseURL": { - "name": "baseURL", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - } -} \ No newline at end of file diff --git a/src/database/migrations/meta/0002_snapshot.json b/src/database/migrations/meta/0002_snapshot.json deleted file mode 100644 index 661b3d8..0000000 --- a/src/database/migrations/meta/0002_snapshot.json +++ /dev/null @@ -1,377 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "0de01fd3-0bed-4287-a8d0-dcd9494d7fd3", - "prevId": "bfc7699b-dda4-4c1f-836b-145406d9d2f2", - "tables": { - "chat": { - "name": "chat", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "prompt": { - "name": "prompt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "document": { - "name": "document", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": { - "document_name_unique": { - "name": "document_name_unique", - "columns": [ - "name" - ], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "serviceId": { - "name": "serviceId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "visible": { - "name": "visible", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": { - "serviceId_idx": { - "name": "serviceId_idx", - "columns": [ - "serviceId" - ], - "isUnique": false - }, - "serviceName_unique": { - "name": "serviceName_unique", - "columns": [ - "serviceId", - "name" - ], - "isUnique": true - } - }, - "foreignKeys": { - "model_serviceId_service_id_fk": { - "name": "model_serviceId_service_id_fk", - "tableFrom": "model", - "tableTo": "service", - "columnsFrom": [ - "serviceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "responseMessage": { - "name": "responseMessage", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "index": { - "name": "index", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "responseId": { - "name": "responseId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": { - "responseId_idx": { - "name": "responseId_idx", - "columns": [ - "responseId" - ], - "isUnique": false - } - }, - "foreignKeys": { - "responseMessage_responseId_response_id_fk": { - "name": "responseMessage_responseId_response_id_fk", - "tableFrom": "responseMessage", - "tableTo": "response", - "columnsFrom": [ - "responseId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "response": { - "name": "response", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "chatId": { - "name": "chatId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "modelId": { - "name": "modelId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": { - "chatId_idx": { - "name": "chatId_idx", - "columns": [ - "chatId" - ], - "isUnique": false - } - }, - "foreignKeys": { - "response_chatId_chat_id_fk": { - "name": "response_chatId_chat_id_fk", - "tableFrom": "response", - "tableTo": "chat", - "columnsFrom": [ - "chatId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "service": { - "name": "service", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "providerId": { - "name": "providerId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "baseURL": { - "name": "baseURL", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": { - "\"project\"": "\"chat\"" - }, - "columns": { - "\"response\".\"projectId\"": "\"response\".\"chatId\"" - } - } -} \ No newline at end of file diff --git a/src/database/migrations/meta/_journal.json b/src/database/migrations/meta/_journal.json index 119769f..f6e5ab9 100644 --- a/src/database/migrations/meta/_journal.json +++ b/src/database/migrations/meta/_journal.json @@ -1,26 +1,12 @@ { - "version": "6", - "dialect": "sqlite", + "version": "7", + "dialect": "postgresql", "entries": [ { "idx": 0, - "version": "6", - "when": 1716023408078, - "tag": "0000_careful_smiling_tiger", - "breakpoints": true - }, - { - "idx": 1, - "version": "6", - "when": 1720013980037, - "tag": "0001_nosy_earthquake", - "breakpoints": true - }, - { - "idx": 2, - "version": "6", - "when": 1720063831479, - "tag": "0002_overjoyed_mordo", + "version": "7", + "when": 1723548717244, + "tag": "0000_nappy_the_liberteens", "breakpoints": true } ] diff --git a/src/database/migrator.ts b/src/database/migrator.ts index 9574630..c5d7312 100644 --- a/src/database/migrator.ts +++ b/src/database/migrator.ts @@ -2,42 +2,55 @@ import { sql } from "drizzle-orm/sql"; import journal from "./migrations/meta/_journal.json"; import { useDb } from "@/database/client"; import { seed } from "@/database/seed"; +import type { PgliteDatabase } from "drizzle-orm/pglite"; export async function runMigrations(skipSeed = false) { - const haveMigrationsTable = await useDb().get( - sql.raw("SELECT name FROM sqlite_master WHERE type='table' AND name='migrations';"), + const db = useDb(); + const result = await db.execute<{ exists: boolean }>( + sql`SELECT EXISTS ( + SELECT FROM information_schema.tables + WHERE table_schema = 'public' + AND table_name = 'migrations' + );`, ); - let shouldSeed = false; + + const haveMigrationsTable = result.rows[0]?.exists ?? false; + if (!haveMigrationsTable) { - await useDb().run(sql.raw("CREATE TABLE `migrations` (`name` text PRIMARY KEY NOT NULL);")); - shouldSeed = true; + await db.execute(sql`CREATE TABLE migrations (name text PRIMARY KEY NOT NULL);`); } + for (const entry of journal.entries) { - await applyMigration(entry.idx, entry.tag); + await applyMigration(db, entry.tag, skipSeed); } - if (shouldSeed && !skipSeed) { - await seed(); - } - // console.log("Migrations applied"); } -async function applyMigration(idx: number, migration: string) { - // check if migration is already applied - const checkQuery = `SELECT name FROM migrations WHERE name='${migration}'`; - // console.log("checkQuery", checkQuery); - const hasMigration = await useDb().get(sql.raw(checkQuery)); - // console.log("hasMigration", hasMigration); - if (!hasMigration) { +async function applyMigration(db: PgliteDatabase, tag: string, skipSeed: boolean) { + // check if tag is already applied + const result = await db.execute<{ name: string }>( + sql`SELECT name FROM migrations WHERE name = ${tag}`, + ); + + if (result.rows.length === 0) { try { - await useDb().transaction(async (tx) => { - const migrationSql = (await import(`./migrations/${migration}.sql?raw`)).default; - // console.log("Applying migration", migration); - // split statements for better-sqlite3 compatibility - await Promise.all( - migrationSql.split("--> statement-breakpoint").map((s: string) => tx.run(sql.raw(s))), - ); - // record migration in migrations table - await tx.run(sql.raw(`INSERT INTO migrations (name) VALUES ('${migration}');`)); + await db.transaction(async (tx) => { + const migrationSql = (await import(`./migrations/${tag}.sql?raw`)).default; + // Split the tag SQL into individual statements + const statements = migrationSql + .split("--> statement-breakpoint") + .filter((statement: any) => statement.trim() !== ""); + + for (const statement of statements) { + await tx.execute(sql.raw(statement)); + } + + await tx.execute(sql`INSERT INTO migrations (name) VALUES (${tag})`); + + const num = tag.split("_")[0]; + if (num in seed && !skipSeed) { + // @ts-expect-error + await seed[num](tx); + } }); } catch (e) { console.error(e); diff --git a/src/database/model.ts b/src/database/model.ts index c2aaf91..7b8ea32 100644 --- a/src/database/model.ts +++ b/src/database/model.ts @@ -3,6 +3,7 @@ import { createTableRelationsHelpers, extractTablesRelationalConfig, getTableName, + getTableUniqueName, type Table, } from "drizzle-orm"; import { invalidate } from "$app/navigation"; @@ -20,9 +21,8 @@ export function registerModel(table: Table, view: Model | Model[], depends: Depe const table = relationalConfig.tables[relationalConfig.tableNamesMap[tableName]]; for (const key of Object.keys(table.relations)) { if (record[key]) { - const referencedTableName = table.relations[key].referencedTableName; register( - referencedTableName, + getTableUniqueName(table.relations[key].referencedTable), Array.isArray(record[key]) ? record[key] : [record[key]], depends, ); @@ -31,10 +31,10 @@ export function registerModel(table: Table, view: Model | Model[], depends: Depe } } - const tableName = getTableName(table); + const tableName = getTableUniqueName(table); register(tableName, Array.isArray(view) ? view : [view], depends); } export function invalidateModel(table: Table, model: Model) { - return invalidate(`model:${getTableName(table)}:${model.id}`); + return invalidate(`model:${getTableUniqueName(table)}:${model.id}`); } diff --git a/src/database/schema.ts b/src/database/schema.ts index f7ebe17..c319490 100644 --- a/src/database/schema.ts +++ b/src/database/schema.ts @@ -1,84 +1,125 @@ -import { sqliteTable, text, int, primaryKey, index, unique } from "drizzle-orm/sqlite-core"; -import { type InferSelectModel, relations } from "drizzle-orm"; +import { pgTable, text, integer, primaryKey, index, unique, jsonb } from "drizzle-orm/pg-core"; +import { type InferInsertModel, type InferSelectModel, relations } from "drizzle-orm"; import { sql } from "drizzle-orm/sql"; /** * Tables */ -export const documentTable = sqliteTable("document", { +export const documentTable = pgTable("document", { id: text("id").primaryKey(), - name: text("name").notNull().unique(), + name: text("name").notNull(), + type: text("type").notNull().default("document"), description: text("description").notNull(), content: text("content").notNull(), - // data: text("data").notNull(), - createdAt: text("createdAt").default(sql`(CURRENT_TIMESTAMP)`), + attributes: jsonb("attributes").notNull().default({}), + createdAt: text("created_at").default(sql`CURRENT_TIMESTAMP`), }); -export const responseTable = sqliteTable( - "response", +export const revisionTable = pgTable( + "revision", { id: text("id").primaryKey(), - chatId: text("chatId") + version: integer("version").notNull(), + chatId: text("chat_id") .notNull() .references(() => chatTable.id, { onDelete: "cascade" }), - modelId: text("modelId").notNull(), error: text("error"), - createdAt: text("createdAt").default(sql`(CURRENT_TIMESTAMP)`), + createdAt: text("created_at").default(sql`CURRENT_TIMESTAMP`), }, (table) => ({ - chatIdIdx: index("chatId_idx").on(table.chatId), + chatIdIdx: index("revision_chat_id_idx").on(table.chatId), }), ); -export const responseMessageTable = sqliteTable( - "responseMessage", +export const messageTable = pgTable( + "message", { id: text("id").primaryKey(), - index: int("index").notNull(), - responseId: text("responseId") + index: integer("index").notNull(), + revisionId: text("revision_id") .notNull() - .references(() => responseTable.id, { onDelete: "cascade" }), + .references(() => revisionTable.id, { onDelete: "cascade" }), role: text("role").notNull(), content: text("content").notNull(), - createdAt: text("createdAt").default(sql`(CURRENT_TIMESTAMP)`), + createdAt: text("created_at").default(sql`CURRENT_TIMESTAMP`), }, (table) => ({ - responseIdIdx: index("responseId_idx").on(table.responseId), + revisionIdIdx: index("message_revision_id_idx").on(table.revisionId), }), ); -export const modelTable = sqliteTable( +export const attachmentTable = pgTable( + "attachment", + { + id: text("id").primaryKey(), + messageId: text("message_id") + .notNull() + .references(() => messageTable.id, { onDelete: "cascade" }), + documentId: text("document_id") + .notNull() + .references(() => documentTable.id, { onDelete: "cascade" }), + createdAt: text("created_at").default(sql`CURRENT_TIMESTAMP`), + }, + (table) => ({ + messageDocumentUnique: unique("message_document_unique").on(table.messageId, table.documentId), + messageIdIdx: index("attachment_message_id_idx").on(table.messageId), + }), +); + +export const modelTable = pgTable( "model", { id: text("id").notNull().primaryKey(), - serviceId: text("serviceId") + keyId: text("key_id") .notNull() - .references(() => serviceTable.id, { onDelete: "cascade" }), + .references(() => keyTable.id, { onDelete: "cascade" }), name: text("name").notNull(), - visible: int("visible").notNull(), - createdAt: text("createdAt").default(sql`(CURRENT_TIMESTAMP)`), + visible: integer("visible").notNull(), + createdAt: text("created_at").default(sql`CURRENT_TIMESTAMP`), }, (table) => ({ - serviceNameUnique: unique("serviceName_unique").on(table.serviceId, table.name), - serviceIdx: index("serviceId_idx").on(table.serviceId), + keyId_unique: unique("account_id_unique").on(table.keyId, table.name), + keyId_idx: index("account_id_idx").on(table.keyId), }), ); -export const serviceTable = sqliteTable("service", { +export const keyTable = pgTable("key", { id: text("id").primaryKey(), name: text("name").notNull(), - providerId: text("providerId").notNull(), - baseURL: text("baseURL").notNull(), - apiKey: text("apiKey").notNull(), - createdAt: text("createdAt").default(sql`(CURRENT_TIMESTAMP)`), + serviceId: text("service_id").notNull(), + baseURL: text("base_url"), + apiKey: text("api_key").notNull(), + createdAt: text("created_at").default(sql`CURRENT_TIMESTAMP`), }); -export const chatTable = sqliteTable("chat", { +export const serviceTable = pgTable("service", { + id: text("id").primaryKey(), + name: text("name").notNull(), + sdkId: text("sdk_id").notNull(), + baseURL: text("base_url"), + createdAt: text("created_at").default(sql`CURRENT_TIMESTAMP`), +}); + +export const sdkTable = pgTable( + "sdk", + { + id: text("id").primaryKey(), + slug: text("slug").notNull(), + type: text("type").notNull().default("model"), + name: text("name").notNull(), + supported: integer("supported").notNull().default(1), + }, + (table) => ({ + slugUnique: unique("slug_unique").on(table.slug), + }), +); + +export const chatTable = pgTable("chat", { id: text("id").primaryKey(), name: text("name").notNull(), prompt: text("prompt").notNull(), - createdAt: text("createdAt").default(sql`(CURRENT_TIMESTAMP)`), + createdAt: text("created_at").default(sql`CURRENT_TIMESTAMP`), }); /** @@ -86,10 +127,13 @@ export const chatTable = sqliteTable("chat", { */ export type Document = InferSelectModel; -export type Response = InferSelectModel; -export type ResponseMessage = InferSelectModel; +export type Revision = InferSelectModel; +export type Message = InferSelectModel; +export type InsertMessage = InferInsertModel; export type Model = InferSelectModel; +export type Key = InferSelectModel; export type Service = InferSelectModel; +export type Sdk = InferSelectModel; export type Chat = InferSelectModel; // export type Eval = InferSelectModel; @@ -98,35 +142,59 @@ export type Chat = InferSelectModel; */ export const chatRelations = relations(chatTable, ({ many }) => ({ - responses: many(responseTable), + revisions: many(revisionTable), })); -export const responseRelations = relations(responseTable, ({ one, many }) => ({ - chat: one(chatTable, { - fields: [responseTable.chatId], - references: [chatTable.id], - }), - model: one(modelTable, { - fields: [responseTable.modelId], - references: [modelTable.id], +export const modelRelations = relations(modelTable, ({ one }) => ({ + key: one(keyTable, { + fields: [modelTable.keyId], + references: [keyTable.id], }), - messages: many(responseMessageTable), })); -export const modelRelations = relations(modelTable, ({ one }) => ({ +export const keyRelations = relations(keyTable, ({ many, one }) => ({ + models: many(modelTable), service: one(serviceTable, { - fields: [modelTable.serviceId], + fields: [keyTable.serviceId], references: [serviceTable.id], }), })); -export const serviceRelations = relations(serviceTable, ({ many }) => ({ - models: many(modelTable), +export const serviceRelations = relations(serviceTable, ({ many, one }) => ({ + accounts: many(keyTable), + sdk: one(sdkTable, { + fields: [serviceTable.sdkId], + references: [sdkTable.id], + }), +})); + +export const sdkRelations = relations(sdkTable, ({ many }) => ({ + service: many(serviceTable), +})); + +export const revisionRelations = relations(revisionTable, ({ one, many }) => ({ + chat: one(chatTable, { + fields: [revisionTable.chatId], + references: [chatTable.id], + }), + messages: many(messageTable), })); -export const responseMessageRelations = relations(responseMessageTable, ({ one }) => ({ - response: one(responseTable, { - fields: [responseMessageTable.responseId], - references: [responseTable.id], +export const messageRelations = relations(messageTable, ({ one, many }) => ({ + revision: one(revisionTable, { + fields: [messageTable.revisionId], + references: [revisionTable.id], + }), + attachments: many(attachmentTable), +})); + +export const attachmentRelations = relations(attachmentTable, ({ one, many }) => ({ + message: one(messageTable, { + fields: [attachmentTable.messageId], + references: [messageTable.id], + }), + document: one(documentTable, { + fields: [attachmentTable.documentId], + references: [documentTable.id], }), })); diff --git a/src/database/seed.ts b/src/database/seed.ts index ef6367b..e6cfe16 100644 --- a/src/database/seed.ts +++ b/src/database/seed.ts @@ -1,15 +1,41 @@ -import { chatTable } from "@/database/schema"; -import { useDb } from "@/database/client"; +import { sql } from "drizzle-orm"; import { nanoid } from "nanoid"; +import { PgTransaction } from "drizzle-orm/pg-core"; -export function seed() { - // create first chat - return useDb().transaction(async (tx) => { - await tx.insert(chatTable).values({ - id: nanoid(10), - name: "Untitled", - prompt: "", - createdAt: new Date().toISOString(), - }); - }); -} +export const seed = { + "0000": async (tx: PgTransaction) => { + await tx.execute(sql`INSERT INTO sdk (id, slug, name, type, supported) VALUES + ('openai', 'openai', 'OpenAI', 'model', 1), + ('azure', 'azure', 'Azure', 'model', 0), + ('anthropic', 'anthropic', 'Anthropic', 'model', 1), + ('amazon', 'amazon', 'Amazon Bedrock', 'model', 0), + ('google-gen-ai', 'google-gen-ai', 'Google Generative AI', 'model', 1), + ('google-vertex', 'google-vertex', 'Google Vertex AI', 'model', 0), + ('mistral', 'mistral', 'Mistral', 'model', 1), + ('cohere', 'cohere', 'Cohere', 'model', 1), + ('unstructured', 'unstructured', 'Unstructured', 'document', 1); + `); + + await tx.execute(sql`INSERT INTO service (id, name, sdk_id, base_url) VALUES + ('openai', 'OpenAI', 'openai', NULL), + ('azure', 'Azure OpenAI', 'azure', NULL), + ('anthropic', 'Anthropic', 'anthropic', NULL), + ('amazon-bedrock', 'Amazon Bedrock', 'amazon', NULL), + ('google-gen-ai', 'Google Generative AI', 'google-gen-ai', NULL), + ('google-vertex', 'Google Vertex AI', 'google-vertex', NULL), + ('mistral', 'Mistral', 'mistral', NULL), + ('groq', 'Groq', 'openai', 'https://api.groq.com/openai/v1'), + ('perplexity', 'Perplexity', 'openai', 'https://api.perplexity.ai/'), + ('fireworks', 'Fireworks', 'openai', 'https://api.fireworks.ai/inference/v1'), + ('nvidia', 'Nvidia', 'openai', 'https://integrate.api.nvidia.com/v1'), + ('cohere', 'Cohere', 'cohere', NULL), + ('unstructured', 'Unstructured', 'unstructured', NULL); + `); + + const chatId = nanoid(10); + await tx.execute(sql`INSERT INTO chat (id, name, prompt) VALUES + (${chatId}, 'Untitled', '');`); + await tx.execute(sql`INSERT INTO revision (id, version, chat_id) VALUES + (${nanoid(10)}, 1, ${chatId});`); + }, +}; diff --git a/src/lib/attachment-service.svelte.ts b/src/lib/attachment-service.svelte.ts new file mode 100644 index 0000000..c645d34 --- /dev/null +++ b/src/lib/attachment-service.svelte.ts @@ -0,0 +1,191 @@ +import type { MessageAttachment } from "$lib/chat-service.svelte"; +import type { Service } from "@/database"; +import { toast } from "svelte-french-toast"; +import { readBlobAsDataURL } from "./util/blob"; +import { compressImage } from "$lib/util/image"; +import { nanoid } from "nanoid"; +import { humanType } from "$lib/util/mime"; + +export class Attachment { + id: string = nanoid(10); + type: string; + name: string; + content: string; + attributes: Record; + loading: boolean = $state(true); + error: Error | undefined = $state(undefined); + + constructor( + type: string, + name: string, + content: string = "", + attributes: Record = {}, + ) { + this.type = type; + this.name = name; + this.content = content; + if (content !== "") { + this.loading = false; + } + this.attributes = attributes; + } +} + +export class AttachmentService { + fileInput: HTMLInputElement | undefined; + attachments: Attachment[] = $state([]); + + private services: Service[]; + + constructor(services: Service[] = []) { + this.services = services; + } + + clear() { + this.attachments = []; + } + + remove = (index: number) => { + this.attachments = this.attachments.filter((a, i) => i !== index); + }; + + handlePasteClick = () => { + console.log("handlePasteClick"); + }; + + handleUploadClick = () => { + if (this.fileInput) { + this.fileInput.click(); + this.fileInput.addEventListener("change", this.handleFileChange); + } else { + console.error("File input not found"); + } + }; + + handlePaste = (event: ClipboardEvent) => { + if (!event.clipboardData) { + return; + } + + const content = event.clipboardData.getData("text/plain"); + if (content.length > 1000) { + event.preventDefault(); + this.attachments.push( + new Attachment("text/plain", `Pasted ${new Date().toLocaleString()}`, content), + ); + return; + } + + const results: any[] = []; + const items = Array.from(event.clipboardData.items); + for (const item of items) { + console.log("item", item.kind, item.type); + if (item.kind === "file") { + results.push(this.handleFile(item.getAsFile()!)); + } + } + + // Prevent default paste behavior if we handled any items + if (results.some((result) => result)) { + event.preventDefault(); + } + }; + + handleFileChange = (event: Event) => { + const target = event.target as HTMLInputElement; + if (!target.files || target.files.length === 0) { + return; + } + + Array.from(target.files).forEach((file) => { + this.handleFile(file); + }); + + // Reset the file input + if (this.fileInput) { + this.fileInput.value = ""; + } + }; + + private async handleFile(file: File) { + let type: string = file.type; + let name: string = file.name; + + const isComplex = !(type.startsWith("text/") || type.startsWith("image/")); + if (isComplex && this.services.length === 0) { + toast.error( + `Document processing service required to process ${humanType(type)} files. Add API keys in the settings.`, + ); + return; + } + + const attachment = new Attachment(type, name); + this.attachments.push(attachment); + + try { + if (type.startsWith("text/")) { + attachment.loading = false; + attachment.content = await file.text(); + return attachment.content.length > 1000; + } else if (type.startsWith("image/")) { + await this.loadImage(file, attachment); + return true; + } else { + await this.loadDocument(file, attachment); + return true; + } + } catch (error) { + console.error("Error processing file:", error); + attachment.error = + error instanceof Error ? error : new Error("Unknown error processing file"); + } finally { + attachment.loading = false; + } + } + + private async loadImage(file: File, attachment: Attachment) { + const originalSizeMB = file.size / (1024 * 1024); + if (originalSizeMB > 10) { + throw new Error(`Image too large: ${originalSizeMB.toFixed(2)} MB.`); + } + console.log(`Original image size: ${originalSizeMB.toFixed(2)} MB`); + + let blob: Blob = file; + if (originalSizeMB > 0.5) { + blob = await compressImage(file); + const compressedSizeMB = blob.size / (1024 * 1024); + toast.success( + `Large image compressed from ${originalSizeMB.toFixed(2)} MB to ${compressedSizeMB.toFixed(2)} MB`, + ); + } + + attachment.content = await readBlobAsDataURL(blob); + } + + private async loadDocument(file: File, attachment: Attachment) { + try { + // TODO: use the document processor service key as the API key + const data = await readBlobAsDataURL(file); + const response = await fetch("/api/parse", { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: "YOUR_API_KEY_HERE", // Replace with actual API key or fetch from environment + }, + body: JSON.stringify({ + data, + fileName: file.name, + language: "eng", // You might want to make this configurable + }), + }); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const result = await response.json(); + attachment.content = JSON.stringify(result, null, 2); + attachment.attributes.parsedContent = result; + } catch (error) { + throw new Error(error instanceof Error ? error.message : "Unknown error"); + } + } +} diff --git a/src/lib/auto-scroller.ts b/src/lib/auto-scroller.ts new file mode 100644 index 0000000..fae64aa --- /dev/null +++ b/src/lib/auto-scroller.ts @@ -0,0 +1,53 @@ +import type { Action } from "svelte/action"; +import { tick } from "svelte"; + +export class AutoScroller { + private node: HTMLElement | null = null; + private userHasScrolled = false; + private lastScrollTop = 0; + + constructor(private scrollImmediate = false) {} + + private handleScroll = () => { + if (!this.node) return; + if ( + this.node.scrollHeight > this.node.clientHeight && + this.node.scrollTop < this.lastScrollTop + ) { + this.userHasScrolled = true; + } else if (this.node.scrollHeight - this.node.scrollTop === this.node.clientHeight) { + this.userHasScrolled = false; + } + this.lastScrollTop = this.node.scrollTop; + }; + + private scrollToBottom() { + if (this.node && !this.userHasScrolled) { + this.node.scrollTop = this.node.scrollHeight; + } + } + + public action: Action = (node) => { + this.node = node; + this.node.addEventListener("scroll", this.handleScroll); + // wait for the editor to render the message before scrolling to the bottom + tick().then(() => { + if (this.scrollImmediate) { + this.scrollToBottom(); + } + }); + + return { + destroy: () => { + this.node?.removeEventListener("scroll", this.handleScroll); + this.node = null; + }, + }; + }; + + public onLoading = () => { + this.userHasScrolled = false; + this.scrollToBottom(); + }; + public onMessageUpdate = () => this.scrollToBottom(); +} diff --git a/src/lib/chat-service.svelte.ts b/src/lib/chat-service.svelte.ts new file mode 100644 index 0000000..980445c --- /dev/null +++ b/src/lib/chat-service.svelte.ts @@ -0,0 +1,529 @@ +import type { + ChatRequest, + ChatRequestOptions, + CreateMessage, + FetchFunction, + FunctionCallHandler, + IdGenerator, + JSONValue, + Message as AIMessage, + Attachment as AIAttachment, + ToolCallHandler, +} from "@ai-sdk/ui-utils"; +import { callChatApi, processChatStream } from "@ai-sdk/ui-utils"; +import { nanoid } from "nanoid"; +import { toTitleCase } from "$lib/string"; +import { untrack } from "svelte"; + +// todo remove tool and function calling until the library is stable and we need it + +export type MessageAttachment = { + id: string; + type: string; + name: string; + content: string; + attributes: Record; +}; +export type ChatMessage = AIMessage & { + attachments: MessageAttachment[]; +}; + +export type { CreateMessage }; + +type Mode = { type: "edit"; index: number } | { type: "append" }; + +interface ToolCall$1 { + toolCallId: string; + toolName: NAME; + args: ARGS; +} + +export type ChatOptions = { + /** + * A unique identifier for the chat. Changes will be cached to local storage using this id. + */ + id: string; + /** + * The version of the chat. Changes will be cached to local storage using this version. + */ + version: number; + /** + * The API endpoint that accepts a `{ messages: Message[] }` object and returns + * a stream of tokens of the AI chat response. Defaults to `/api/chat`. + */ + api?: string; + /** + * Initial messages of the chat. Useful to load an existing chat history. + */ + initialMessages?: ChatMessage[]; + /** + * Initial input of the chat. + */ + initialInput?: string; + /** + * Mode of the chat. Can be "edit" or "append". If "edit" then index is required. + */ + mode?: Mode; + /** + * @deprecated Use AI SDK 3.1 `streamText` and `onToolCall` instead. + * + * Callback function to be called when a function call is received. + * If the function returns a `ChatRequest` object, the request will be sent + * automatically to the API and will be used to update the chat. + */ + experimental_onFunctionCall?: FunctionCallHandler; + /** + * @deprecated Use AI SDK 3.1 `streamText` and `onToolCall` instead. + * + * Callback function to be called when a tool call is received. + * If the function returns a `ChatRequest` object, the request will be sent + * automatically to the API and will be used to update the chat. + */ + experimental_onToolCall?: ToolCallHandler; + /** + Optional callback function that is invoked when a tool call is received. + Intended for automatic client-side tool execution. + + You can optionally return a result for the tool call, + either synchronously or asynchronously. + */ + onToolCall?: ({ + toolCall, + }: { + toolCall: ToolCall$1; + }) => void | Promise | unknown; + /** + * Callback function to be called when the chat starts loading. + */ + onLoading?: () => void; + /** + * Callback function to be called when response should append to the current revision + */ + onAppend?: () => void; + /** + * Callback function to be called when response should create a new revision + */ + onRevision?: () => void; + /** + * Callback function to be called when an error is encountered. + */ + onError?: (error: Error) => void; + /** Callback function to be called when a message is updated */ + onMessageUpdate?: (messages: ChatMessage[]) => void; + /** + * A way to provide a function that is going to be used for ids for messages. + * If not provided nanoid is used by default. + */ + generateId?: IdGenerator; + /** + * The credentials mode to be used for the fetch request. + * Possible values are: 'omit', 'same-origin', 'include'. + * Defaults to 'same-origin'. + */ + credentials?: RequestCredentials; + /** + * HTTP headers to be sent with the API request. + */ + headers?: Record | Headers; + /** + * Whether to send extra message fields such as `message.id` and `message.createdAt` to the API. + * Defaults to `false`. When set to `true`, the API endpoint might need to + * handle the extra fields before forwarding the request to the AI service. + */ + sendExtraMessageFields?: boolean; + /** Stream mode (default to "stream-data") */ + streamProtocol?: "data" | "text"; + /** + Custom fetch implementation. You can use it as a middleware to intercept requests, + or to provide a custom fetch implementation for e.g. testing. + */ + fetch?: FetchFunction; +}; + +const getStreamedResponse = async ( + api: string, + chatRequest: ChatRequest, + mutate: (messages: ChatMessage[]) => void, + mutateStreamData: (data: JSONValue[] | undefined) => void, + existingData: JSONValue[] | undefined, + extraMetadata: { + credentials?: RequestCredentials; + headers?: Record | Headers; + body?: any; + }, + previousMessages: ChatMessage[], + abortControllerRef: AbortController | null, + generateId: IdGenerator, + streamProtocol: "data" | "text" | undefined, + onFinish: ((message: ChatMessage) => void) | undefined, + onResponse: ((response: Response) => void | Promise) | undefined, + sendExtraMessageFields: boolean | undefined, + fetch: FetchFunction | undefined, +) => { + const constructedMessagesPayload = sendExtraMessageFields + ? chatRequest.messages + : chatRequest.messages.map( + ({ + role, + content, + experimental_attachments, + name, + data, + annotations, + function_call, + tool_calls, + tool_call_id, + }) => ({ + role, + content, + ...(name !== undefined && { name }), + ...(experimental_attachments !== undefined && { experimental_attachments }), + ...(data !== undefined && { data }), + ...(annotations !== undefined && { annotations }), + // outdated function/tool call handling (TODO deprecate): + tool_call_id, + ...(function_call !== undefined && { function_call }), + ...(tool_calls !== undefined && { tool_calls }), + }), + ); + + console.log("chatRequest", chatRequest); + console.log("constructedMessagesPayload", constructedMessagesPayload); + + return await callChatApi({ + api, + body: { + messages: constructedMessagesPayload, + data: chatRequest.data, + ...extraMetadata.body, + ...chatRequest.options?.body, + ...(chatRequest.functions !== undefined && { + functions: chatRequest.functions, + }), + ...(chatRequest.function_call !== undefined && { + function_call: chatRequest.function_call, + }), + ...(chatRequest.tools !== undefined && { + tools: chatRequest.tools, + }), + ...(chatRequest.tool_choice !== undefined && { + tool_choice: chatRequest.tool_choice, + }), + }, + streamProtocol, + credentials: extraMetadata.credentials, + headers: { + ...extraMetadata.headers, + ...chatRequest.options?.headers, + }, + abortController: () => abortControllerRef, + restoreMessagesOnFailure() { + mutate(previousMessages); + }, + onResponse, + onUpdate(merged, data) { + mutate([...previousMessages, ...merged.map((m) => ({ ...m, attachments: [] }))]); + mutateStreamData([...(existingData || []), ...(data || [])]); + }, + onFinish: (message) => onFinish && onFinish({ ...message, attachments: [] }), + generateId, + onToolCall: undefined, // not implemented yet + fetch, + }); +}; + +export class ChatService { + version: number; + messages: ChatMessage[] = $state([]); + error: undefined | Error = $state(undefined); + isLoading: boolean = $state(false); + data: JSONValue[] | undefined = $state(undefined); + metadata?: Object; + hasEdits: boolean = $state(false); + + private id: string; + private api: string; + private generateId: IdGenerator; + private abortController: AbortController | null; + private sendExtraMessageFields: boolean | undefined; + private experimental_onFunctionCall: FunctionCallHandler | undefined; + private experimental_onToolCall: ToolCallHandler | undefined; + private streamProtocol: "data" | "text" | undefined; + private onLoading: (() => void) | undefined; + private onAppend: (() => void) | undefined; + private onRevision: (() => void) | undefined; + private onError: ((error: Error) => void) | undefined; + private onMessageUpdate: ((messages: ChatMessage[]) => void) | undefined; + private credentials: RequestCredentials | undefined; + private headers: Record | Headers | undefined; + private fetch: FetchFunction | undefined; + + // initial snapshot of messages before any changes + private initialState: string | undefined; + private initialLength: number; + + constructor({ + id, + version, + api = "/api/chat", + initialMessages = [], + sendExtraMessageFields, + experimental_onFunctionCall, + experimental_onToolCall, + streamProtocol, + onLoading, + onAppend, + onRevision, + onError, + onMessageUpdate, + credentials, + headers, + generateId = () => nanoid(10), + fetch, + }: ChatOptions) { + // assign options + this.id = id; + this.version = version; + this.api = api; + this.sendExtraMessageFields = sendExtraMessageFields; + this.experimental_onFunctionCall = experimental_onFunctionCall; + this.experimental_onToolCall = experimental_onToolCall; + this.streamProtocol = streamProtocol; + this.onLoading = onLoading; + this.onAppend = onAppend; + this.onRevision = onRevision; + this.onError = onError; + this.onMessageUpdate = onMessageUpdate; + this.credentials = credentials; + this.headers = headers; + this.messages = initialMessages || []; + this.data = []; + this.metadata = undefined; + this.isLoading = false; + this.error = undefined; + this.abortController = new AbortController(); + this.generateId = generateId; + this.fetch = fetch; + this.initialLength = initialMessages.length; + + this.initialState = JSON.stringify(this.messages); + this.tryLoadFromCache(); + + $effect.root(() => { + $effect(() => { + const currentState = JSON.stringify(this.messages); + untrack(() => { + // has edits if initial messages have been modified + this.hasEdits = + JSON.stringify(this.messages.slice(0, this.initialLength)) !== this.initialState; + if (currentState !== this.initialState) { + // cache changes to local storage + if (!this.isLoading) { + console.log("caching changes"); + localStorage.setItem(this.cacheKey, JSON.stringify(this.messages)); + } + } else { + // if no edits, remove the cache + localStorage.removeItem(this.cacheKey); + } + }); + }); + }); + } + + tryLoadFromCache() { + const cachedState = localStorage.getItem(this.cacheKey); + if (cachedState) { + console.log("Applying cached state", this.cacheKey); + // if the last user message is empty, remove it + const messages = JSON.parse(cachedState); + const lastMessage = messages[messages.length - 1]; + if (lastMessage && lastMessage.role === "user" && lastMessage.content.trim() === "") { + messages.pop(); + } + this.messages = messages; + } + } + + get key() { + return `${this.api}|${this.id}`; + } + + markAsSaved() { + // clear cache + localStorage.removeItem(this.cacheKey); + // reset initial state + this.initialLength = this.messages.length; + this.initialState = JSON.stringify(this.messages); + } + + /** + * Reload the last AI chat response for the given chat history. If the last + * message isn't from the assistant, it will request the API to generate a + * new response. + */ + async reload(requestOptions: ChatRequestOptions = {}): Promise { + // remove messages after edit + if (this.messages[this.messages.length - 1].role === "assistant") { + this.messages.splice(this.messages.length - 1); + } + return this.triggerRequest(this.createChatRequest(requestOptions)); + } + + /** + * Abort the current request immediately, keep the generated tokens if any. + */ + stop(): void { + if (this.abortController) { + this.abortController.abort(); + this.abortController = null; + } + } + + /** + * Update the `messages` state locally. This is useful when you want to + * edit the messages on the client, and then trigger the `reload` method + * manually to regenerate the AI response. + */ + setMessages(key: string, messages: ChatMessage[]): void { + this.messages = messages; + if (this.onMessageUpdate) { + this.onMessageUpdate(messages); + } + } + + createChatRequest({ + options, + functions, + function_call, + tools, + tool_choice, + data, + }: ChatRequestOptions = {}) { + // inline attachments into message content surrounded by tags + const messages = this.messages.map((message) => { + let content = message.content; + let experimental_attachments: AIAttachment[] | undefined = undefined; + if (message.attachments) { + const attachmentContent = message.attachments + .filter( + (attachment) => + !attachment.type.startsWith("image/") && attachment.content.trim() !== "", + ) // Exclude empty attachments + .map((attachment) => { + const escapedContent = attachment.content.replace(//g, ">"); + const attributes = Object.entries(attachment.attributes) + .map(([key, value]) => `${key}="${value}"`) + .join(" "); + return `<${toTitleCase(attachment.type)}${attributes ? " " : ""}${attributes}>\n${escapedContent}\n`; + }) + .join("\n\n"); + if (attachmentContent.length > 0) { + content = `${attachmentContent}\n\n${content}`; + } + experimental_attachments = message.attachments + .filter((attachment) => attachment.type.startsWith("image/")) + .map((attachment) => ({ + name: attachment.name, + contentType: attachment.type, + url: attachment.content, + })); + console.log("experimental_attachments", experimental_attachments); + } + return { ...message, content, experimental_attachments }; + }); + return { + messages, + options, + data, + ...(functions !== undefined && { functions }), + ...(function_call !== undefined && { function_call }), + ...(tools !== undefined && { tools }), + ...(tool_choice !== undefined && { tool_choice }), + }; + } + + submit(requestOptions: ChatRequestOptions = {}) { + return this.triggerRequest(this.createChatRequest(requestOptions)); + } + + handleOnFinish = () => { + if (this.hasEdits) { + if (this.onRevision) { + this.onRevision(); + } + } else { + if (this.onAppend) { + this.onAppend(); + } + } + }; + + get cacheKey() { + return `chat-${this.id}-v${this.version}`; + } + + private async triggerRequest(chatRequest: ChatRequest): Promise { + try { + this.error = undefined; + this.isLoading = true; + + // Call the onLoading handler if it is defined + if (this.onLoading) { + this.onLoading(); + } + + this.abortController = new AbortController(); + + const extraMetadata = { + credentials: this.credentials, + headers: this.headers, + }; + + await processChatStream({ + getStreamedResponse: () => + getStreamedResponse( + this.api || "/api/chat", + chatRequest, + (messages: ChatMessage[]) => this.setMessages(this.key, messages), + (data) => { + this.data = data; + }, + this.data, + extraMetadata, + this.messages, + this.abortController, + this.generateId, + this.streamProtocol, + this.handleOnFinish, + () => {}, + this.sendExtraMessageFields, + this.fetch, + ), + experimental_onFunctionCall: this.experimental_onFunctionCall, + experimental_onToolCall: this.experimental_onToolCall, + updateChatRequest: (chatRequestParam) => { + chatRequest = chatRequestParam; + }, + getCurrentMessages: () => this.messages, + }); + this.abortController = null; + return null; + } catch (err) { + // Ignore abort errors as they are expected. + if ((err as any).name === "AbortError") { + this.abortController = null; + this.handleOnFinish(); + return null; + } + + if (this.onError && err instanceof Error) { + this.onError(err); + } + + this.error = err as Error; + } finally { + this.isLoading = false; + } + } +} diff --git a/src/lib/clipboard.ts b/src/lib/clipboard.ts new file mode 100644 index 0000000..c0c6811 --- /dev/null +++ b/src/lib/clipboard.ts @@ -0,0 +1,9 @@ +export async function getClipboardContent() { + try { + const content = await navigator.clipboard.readText(); + return { error: null, content }; + } catch (error) { + console.error("Failed to read clipboard contents: ", error); + return { error: "Failed to read clipboard contents" }; + } +} diff --git a/src/lib/date.ts b/src/lib/date.ts new file mode 100644 index 0000000..28fec53 --- /dev/null +++ b/src/lib/date.ts @@ -0,0 +1,10 @@ +// 4:30pm +export function formatTime(date: Date): string { + return date + .toLocaleTimeString("en-US", { + hour: "numeric", + minute: "2-digit", + hour12: true, + }) + .toLowerCase(); +} diff --git a/src/lib/route.ts b/src/lib/route.ts new file mode 100644 index 0000000..6ddce01 --- /dev/null +++ b/src/lib/route.ts @@ -0,0 +1,140 @@ +import { resolveRoute } from "$app/paths"; +import type RouteMetadata from "$lib/../../.svelte-kit/types/route_meta_data.json"; +type RouteMetadata = typeof RouteMetadata; + +// eslint-disable-next-line @typescript-eslint/ban-types +type Prettify = { [K in keyof T]: T[K] } & {}; +type ParseParam = T extends `...${infer Name}` ? Name : T; + +type ParseParams = T extends `${infer A}[[${infer Param}]]${infer B}` + ? ParseParams & { [K in ParseParam]?: string } & ParseParams + : T extends `${infer A}[${infer Param}]${infer B}` + ? ParseParams & { [K in ParseParam]: string } & ParseParams + : // eslint-disable-next-line @typescript-eslint/ban-types + {}; + +type RemoveGroups = T extends `${infer A}/(${string})${infer B}` ? `${A}${RemoveGroups}` : T; + +export type RouteId = RemoveGroups; +// export type RouteId = keyof RouteMetadata; + +export type Routes = { + [K in RouteId]: Prettify>; +}; + +type RouteParams = Pick> & + Partial>>; + +type RequiredKeys = { [K in keyof T]-?: {} extends Pick ? never : K }[keyof T]; +type OptionalKeys = { [K in keyof T]-?: {} extends Pick ? K : never }[keyof T]; + +type ExtraOptions = { + $query?: Record; + $hash?: string; +}; + +type RouteOptions = RouteParams & ExtraOptions; + +// Helper type to determine if options are required +type HasRequiredParams = RequiredKeys extends never ? false : true; + +// Overloaded function signatures +export function route(routeId: T): string; +export function route( + routeId: T, + options: HasRequiredParams extends true ? RouteOptions : RouteOptions | ExtraOptions, +): string; + +// Implementation +export function route( + routeId: T, + options?: RouteOptions | ExtraOptions, +): string { + if (!options) { + return resolveRoute(routeId, {}); + } + + const { $query, $hash, ...params } = options; + + // Use type assertion to ensure params matches what resolveRoute expects + const path = resolveRoute(routeId, params as Record); + + // @ts-expect-error allow for type casting in $query + const search = $query && new URLSearchParams($query).toString(); + return path + (search ? `?${search}` : "") + ($hash ? `#${$hash}` : ""); +} + +export function match(pattern: RouteId, routeId: string): boolean { + // Remove group prefixes from the routeId + const cleanRouteId = routeId.replace(/\/\([^)]+\)/g, ""); + + const patternParts = pattern.split("/").filter(Boolean); + const routeParts = cleanRouteId.split("/").filter(Boolean); + + let patternIndex = 0; + let routeIndex = 0; + + while (patternIndex < patternParts.length && routeIndex < routeParts.length) { + const patternPart = patternParts[patternIndex]; + const routePart = routeParts[routeIndex]; + + if (patternPart === "[...rest]") { + patternIndex++; + if (patternIndex === patternParts.length) return true; + while ( + routeIndex < routeParts.length && + routeParts[routeIndex] !== patternParts[patternIndex] + ) { + routeIndex++; + } + } else if (patternPart.startsWith("[") && patternPart.endsWith("]")) { + patternIndex++; + routeIndex++; + } else if (patternPart === routePart) { + patternIndex++; + routeIndex++; + } else { + return false; + } + } + + return patternIndex === patternParts.length && routeIndex === routeParts.length; +} + +export function extractParams(pattern: RouteId, routeId: string): Record | null { + const patternParts = pattern.split("/").filter(Boolean); + const routeParts = routeId.split("/").filter(Boolean); + const params: Record = {}; + + let patternIndex = 0; + let routeIndex = 0; + + while (patternIndex < patternParts.length && routeIndex < routeParts.length) { + const patternPart = patternParts[patternIndex]; + const routePart = routeParts[routeIndex]; + + if (patternPart === "[...rest]") { + const restParts = []; + while ( + routeIndex < routeParts.length && + (patternIndex === patternParts.length - 1 || + routeParts[routeIndex] !== patternParts[patternIndex + 1]) + ) { + restParts.push(routeParts[routeIndex++]); + } + params["rest"] = restParts.join("/"); + patternIndex++; + } else if (patternPart.startsWith("[") && patternPart.endsWith("]")) { + params[patternPart.slice(1, -1)] = routePart; + patternIndex++; + routeIndex++; + } else if (patternPart === routePart) { + patternIndex++; + routeIndex++; + } else { + return null; + } + } + + return patternIndex === patternParts.length && routeIndex === routeParts.length ? params : null; +} diff --git a/src/lib/string.ts b/src/lib/string.ts new file mode 100644 index 0000000..cea2fec --- /dev/null +++ b/src/lib/string.ts @@ -0,0 +1,6 @@ +export function toTitleCase(input: string): string { + return input + .split(/[^a-zA-Z0-9]+/) + .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) + .join(""); +} diff --git a/src/lib/use-chat.svelte.ts b/src/lib/use-chat.svelte.ts deleted file mode 100644 index 6d402df..0000000 --- a/src/lib/use-chat.svelte.ts +++ /dev/null @@ -1,344 +0,0 @@ -import type { - ChatRequest, - ChatRequestOptions, - CreateMessage, - FetchFunction, - IdGenerator, - JSONValue, - Message, - UseChatOptions, -} from "@ai-sdk/ui-utils"; -import { callChatApi, generateId as generateIdFunc, processChatStream } from "@ai-sdk/ui-utils"; - -export type { CreateMessage, Message, UseChatOptions }; - -export type UseChatHelpers = { - /** Current messages in the chat */ - // messages: Readable; - messages: Message[]; - /** The error object of the API request */ - // error: Readable; - error: undefined | Error; - /** - * Append a user message to the chat list. This triggers the API call to fetch - * the assistant's response. - * @param message The message to append - * @param chatRequestOptions Additional options to pass to the API call - */ - append: ( - message: Message | CreateMessage, - chatRequestOptions?: ChatRequestOptions, - ) => Promise; - /** - * Reload the last AI chat response for the given chat history. If the last - * message isn't from the assistant, it will request the API to generate a - * new response. - */ - reload: (chatRequestOptions?: ChatRequestOptions) => Promise; - /** - * Abort the current request immediately, keep the generated tokens if any. - */ - stop: () => void; - /** - * Update the `messages` state locally. This is useful when you want to - * edit the messages on the client, and then trigger the `reload` method - * manually to regenerate the AI response. - */ - setMessages: (messages: Message[]) => void; - /** The current value of the input */ - input: string; - - /** Form submission handler to automatically reset input and append a user message */ - handleSubmit: ( - event?: { preventDefault?: () => void }, - chatRequestOptions?: ChatRequestOptions, - ) => void; - metadata?: Object; - /** Whether the API request is in progress */ - isLoading: boolean | undefined; - - /** Additional data added on the server via StreamData */ - data: JSONValue[] | undefined; -}; -const getStreamedResponse = async ( - api: string, - chatRequest: ChatRequest, - mutate: (messages: Message[]) => void, - mutateStreamData: (data: JSONValue[] | undefined) => void, - existingData: JSONValue[] | undefined, - extraMetadata: { - credentials?: RequestCredentials; - headers?: Record | Headers; - body?: any; - }, - previousMessages: Message[], - abortControllerRef: AbortController | null, - generateId: IdGenerator, - streamMode: "stream-data" | "text" | undefined, - onFinish: ((message: Message) => void) | undefined, - onResponse: ((response: Response) => void | Promise) | undefined, - sendExtraMessageFields: boolean | undefined, - fetch: FetchFunction | undefined, -) => { - // Do an optimistic update to the chat state to show the updated messages - // immediately. - mutate(chatRequest.messages); - - const constructedMessagesPayload = sendExtraMessageFields - ? chatRequest.messages - : chatRequest.messages.map( - ({ role, content, name, data, annotations, function_call, tool_calls, tool_call_id }) => ({ - role, - content, - ...(name !== undefined && { name }), - ...(data !== undefined && { data }), - ...(annotations !== undefined && { annotations }), - // outdated function/tool call handling (TODO deprecate): - tool_call_id, - ...(function_call !== undefined && { function_call }), - ...(tool_calls !== undefined && { tool_calls }), - }), - ); - - return await callChatApi({ - api, - body: { - messages: constructedMessagesPayload, - data: chatRequest.data, - ...extraMetadata.body, - ...chatRequest.options?.body, - ...(chatRequest.functions !== undefined && { - functions: chatRequest.functions, - }), - ...(chatRequest.function_call !== undefined && { - function_call: chatRequest.function_call, - }), - ...(chatRequest.tools !== undefined && { - tools: chatRequest.tools, - }), - ...(chatRequest.tool_choice !== undefined && { - tool_choice: chatRequest.tool_choice, - }), - }, - streamMode, - credentials: extraMetadata.credentials, - headers: { - ...extraMetadata.headers, - ...chatRequest.options?.headers, - }, - abortController: () => abortControllerRef, - restoreMessagesOnFailure() { - mutate(previousMessages); - }, - onResponse, - onUpdate(merged, data) { - mutate([...chatRequest.messages, ...merged]); - mutateStreamData([...(existingData || []), ...(data || [])]); - }, - onFinish, - generateId, - onToolCall: undefined, // not implemented yet - fetch, - }); -}; - -let uniqueId = 0; - -const store: Record = {}; - -export function useChat({ - api = "/api/chat", - id, - initialMessages = [], - initialInput = "", - sendExtraMessageFields, - experimental_onFunctionCall, - experimental_onToolCall, - streamMode, - onResponse, - onFinish, - onError, - credentials, - headers, - body, - generateId = generateIdFunc, - fetch, -}: UseChatOptions = {}): UseChatHelpers { - // Generate a unique id for the chat if not provided. - const chatId = id || `chat-${uniqueId++}`; - - const key = `${api}|${chatId}`; - - const state = $state({ - messages: initialMessages, - input: initialInput, - data: [], - metadata: undefined, - isLoading: false, - error: undefined, - reload: async () => null, - stop: () => {}, - setMessages: () => {}, - append: async () => null, - handleSubmit: () => {}, - }); - - const mutate = (data: Message[]) => { - store[key] = data; - state.messages = data; - return data; - }; - - // Abort controller to cancel the current API call. - let abortController: AbortController | null = null; - - const extraMetadata = { - credentials, - headers, - body, - }; - - // Actual mutation hook to send messages to the API endpoint and update the - // chat state. - async function triggerRequest(chatRequest: ChatRequest) { - try { - state.error = undefined; - state.isLoading = true; - abortController = new AbortController(); - - await processChatStream({ - getStreamedResponse: () => - getStreamedResponse( - api, - chatRequest, - mutate, - (data) => { - state.data = data; - }, - state.data, - extraMetadata, - state.messages, - abortController, - generateId, - streamMode, - onFinish, - onResponse, - sendExtraMessageFields, - fetch, - ), - experimental_onFunctionCall, - experimental_onToolCall, - updateChatRequest: (chatRequestParam) => { - chatRequest = chatRequestParam; - }, - getCurrentMessages: () => state.messages, - }); - - abortController = null; - - return null; - } catch (err) { - // Ignore abort errors as they are expected. - if ((err as any).name === "AbortError") { - abortController = null; - return null; - } - - if (onError && err instanceof Error) { - onError(err); - } - - state.error = err as Error; - } finally { - state.isLoading = false; - } - } - - state.append = async ( - message: Message | CreateMessage, - { options, functions, function_call, tools, tool_choice, data }: ChatRequestOptions = {}, - ) => { - if (!message.id) { - message.id = generateId(); - } - - const chatRequest: ChatRequest = { - messages: state.messages.concat(message as Message), - options, - data, - ...(functions !== undefined && { functions }), - ...(function_call !== undefined && { function_call }), - ...(tools !== undefined && { tools }), - ...(tool_choice !== undefined && { tool_choice }), - }; - return triggerRequest(chatRequest); - }; - - state.reload = async ({ - options, - functions, - function_call, - tools, - tool_choice, - }: ChatRequestOptions = {}) => { - const messagesSnapshot = state.messages; - if (messagesSnapshot.length === 0) return null; - - // Remove last assistant message and retry last user message. - const lastMessage = messagesSnapshot.at(-1); - if (lastMessage?.role === "assistant") { - const chatRequest: ChatRequest = { - messages: messagesSnapshot.slice(0, -1), - options, - ...(functions !== undefined && { functions }), - ...(function_call !== undefined && { function_call }), - ...(tools !== undefined && { tools }), - ...(tool_choice !== undefined && { tool_choice }), - }; - - return triggerRequest(chatRequest); - } - const chatRequest: ChatRequest = { - messages: messagesSnapshot, - options, - ...(functions !== undefined && { functions }), - ...(function_call !== undefined && { function_call }), - ...(tools !== undefined && { tools }), - ...(tool_choice !== undefined && { tool_choice }), - }; - - return triggerRequest(chatRequest); - }; - - state.stop = () => { - if (abortController) { - abortController.abort(); - abortController = null; - } - }; - - state.setMessages = (messages: Message[]) => { - mutate(messages); - }; - - state.handleSubmit = ( - event?: { preventDefault?: () => void }, - options: ChatRequestOptions = {}, - ) => { - event?.preventDefault?.(); - const inputValue = state.input; - if (!inputValue) return; - - state.append( - { - content: inputValue, - role: "user", - createdAt: new Date(), - }, - options, - ); - state.input = ""; - }; - - return state; -} diff --git a/src/lib/util/blob.ts b/src/lib/util/blob.ts new file mode 100644 index 0000000..a25c546 --- /dev/null +++ b/src/lib/util/blob.ts @@ -0,0 +1,14 @@ +export async function readBlobAsDataURL(blob: Blob): Promise { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onload = (event) => { + if (event.target && typeof event.target.result === "string") { + resolve(event.target.result); + } else { + reject(new Error("Failed to read file as Data URL")); + } + }; + reader.onerror = (error) => reject(error); + reader.readAsDataURL(blob); + }); +} diff --git a/src/lib/util/image.ts b/src/lib/util/image.ts new file mode 100644 index 0000000..5616dfe --- /dev/null +++ b/src/lib/util/image.ts @@ -0,0 +1,29 @@ +export async function compressImage(file: Blob, quality: number = 0.7): Promise { + return new Promise((resolve, reject) => { + const img = new Image(); + img.onload = () => { + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + if (!ctx) { + reject(new Error("Failed to get canvas context")); + return; + } + canvas.width = img.width; + canvas.height = img.height; + ctx.drawImage(img, 0, 0); + canvas.toBlob( + (blob) => { + if (blob) { + resolve(blob); + } else { + reject(new Error("Failed to compress image")); + } + }, + "image/jpeg", + quality, + ); + }; + img.onerror = () => reject(new Error("Failed to load image")); + img.src = URL.createObjectURL(file); + }); +} diff --git a/src/lib/util/mime.ts b/src/lib/util/mime.ts new file mode 100644 index 0000000..1a4c089 --- /dev/null +++ b/src/lib/util/mime.ts @@ -0,0 +1,6 @@ +export function humanType(type: string) { + if (type.startsWith("image/") || type.startsWith("application/pdf")) { + return type.split("/")[1]; + } + return type; +} diff --git a/src/routes/(app)/$data.test.ts b/src/routes/(app)/$data.test.ts index 5bb4338..5c99499 100644 --- a/src/routes/(app)/$data.test.ts +++ b/src/routes/(app)/$data.test.ts @@ -1,81 +1,115 @@ -import { afterEach, beforeEach, describe, expect, it, vi, onTestFailed } from "vitest"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { duplicateChat, newChat, removeChat } from "./$data"; -import Database from "better-sqlite3"; -import { type BetterSQLite3Database, drizzle } from "drizzle-orm/better-sqlite3"; +import { drizzle } from "drizzle-orm/pglite"; import { nanoid } from "nanoid"; import * as schema from "@/database/schema"; -import { chatTable, responseMessageTable, responseTable } from "@/database/schema"; +import { chatTable, messageTable, revisionTable } from "@/database/schema"; import { runMigrations } from "@/database/migrator"; import { eq } from "drizzle-orm"; import { invalidate } from "$app/navigation"; import { sql } from "drizzle-orm/sql"; import { useDb } from "@/database"; +import { PGlite } from "@electric-sql/pglite"; +import type { PgliteDatabase } from "drizzle-orm/pglite"; describe("(app)/$data", () => { vi.mock("@/database/client"); vi.mock("$app/navigation"); vi.mock("nanoid"); - let sqlite: Database.Database; - let db: BetterSQLite3Database; + let pglite: PGlite; + let db: PgliteDatabase; - beforeEach(async () => { - // Create an in-memory SQLite database - sqlite = new Database(":memory:"); - db = drizzle(sqlite, { schema }); + beforeAll(async () => { + pglite = new PGlite(); + db = drizzle(pglite, { schema }); + }); + beforeEach(async () => { vi.mocked(useDb).mockReturnValue(db); - db.run(sql.raw("PRAGMA foreign_keys=off;")); await runMigrations(true); - db.run(sql.raw("PRAGMA foreign_keys=on;")); - await db.delete(schema.responseMessageTable); - await db.delete(schema.responseTable); + await db.delete(schema.messageTable); + await db.delete(schema.revisionTable); await db.delete(schema.chatTable); await db.delete(schema.modelTable); - await db.delete(schema.serviceTable); + await db.delete(schema.keyTable); // Insert dummy data - await db.insert(schema.serviceTable).values([ + await db.insert(schema.sdkTable).values([{ id: "sdk1", name: "Test SDK", slug: "test-sdk" }]); + await db + .insert(schema.serviceTable) + .values([ + { id: "service1", name: "Test Service", sdkId: "sdk1", baseURL: "https://api.test.com" }, + ]); + await db.insert(schema.keyTable).values([ { - id: "service1", - name: "Test Service", - providerId: "provider1", + id: "key1", + name: "Test Key", + serviceId: "service1", baseURL: "https://api.test.com", apiKey: "test-api-key", }, ]); - await db .insert(schema.modelTable) - .values([{ id: "model1", serviceId: "service1", name: "Test Model", visible: 1 }]); + .values([{ id: "model1", keyId: "key1", name: "Test Model", visible: 1 }]); await db.insert(schema.chatTable).values([ { id: "chat1", name: "Chat 1", prompt: "Prompt 1" }, { id: "chat2", name: "Chat 2", prompt: "Prompt 2" }, ]); - await db.insert(schema.responseTable).values([ - { id: "response1", chatId: "chat1", modelId: "model1" }, - { id: "response2", chatId: "chat2", modelId: "model1" }, + await db.insert(schema.revisionTable).values([ + { id: "chat1-revision1", version: 1, chatId: "chat1" }, + { id: "chat2-revision1", version: 1, chatId: "chat2" }, ]); - await db.insert(schema.responseMessageTable).values([ - { id: "message1", index: 0, responseId: "response1", role: "user", content: "Hello" }, - { id: "message2", index: 1, responseId: "response1", role: "assistant", content: "Hi there" }, - { id: "message3", index: 0, responseId: "response2", role: "user", content: "How are you?" }, + await db.insert(schema.messageTable).values([ + { id: "message1", index: 0, revisionId: "chat1-revision1", role: "user", content: "Hello" }, + { + id: "message2", + index: 1, + revisionId: "chat1-revision1", + role: "assistant", + content: "Hi there", + }, + { + id: "message3", + index: 0, + revisionId: "chat2-revision1", + role: "user", + content: "How are you?", + }, ]); }); - afterEach(() => { - sqlite.close(); + afterEach(async () => { + // pglite is slowish to start for each test + // instead drop all the tables + await db.execute(sql`DO $$ + DECLARE + r RECORD; + BEGIN + -- Disable all triggers + EXECUTE 'SET session_replication_role = replica'; + + -- Drop all tables in the current schema + FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP + EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE'; + END LOOP; + + -- Re-enable triggers + EXECUTE 'SET session_replication_role = DEFAULT'; + END $$; + `); vi.resetAllMocks(); }); describe("newChat", () => { it("should create a new chat", async () => { - vi.mocked(nanoid).mockReturnValueOnce("newChatId"); + vi.mocked(nanoid).mockReturnValueOnce("newChatId").mockReturnValueOnce("newRevisionId"); const newChatId = await newChat(); expect(newChatId).toBe("newChatId"); @@ -89,8 +123,6 @@ describe("(app)/$data", () => { prompt: "", createdAt: expect.any(String), }); - - expect(vi.mocked(invalidate)).toHaveBeenCalledWith("view:chats"); }); }); @@ -104,13 +136,13 @@ describe("(app)/$data", () => { }); expect(removedChat).toBeUndefined(); - const removedResponses = await db.query.responseTable.findMany({ - where: eq(responseTable.chatId, "chat1"), + const removedResponses = await db.query.revisionTable.findMany({ + where: eq(revisionTable.chatId, "chat1"), }); expect(removedResponses).toHaveLength(0); - const removedMessages = await db.query.responseMessageTable.findMany({ - where: eq(responseMessageTable.responseId, "response1"), + const removedMessages = await db.query.messageTable.findMany({ + where: eq(messageTable.revisionId, "chat1-revision1"), }); expect(removedMessages).toHaveLength(0); @@ -118,7 +150,7 @@ describe("(app)/$data", () => { }); it("should create a new chat if no chats remain", async () => { - vi.mocked(nanoid).mockReturnValueOnce("newChatId"); + vi.mocked(nanoid).mockReturnValueOnce("newChatId").mockReturnValueOnce("newRevisionId"); await db.delete(schema.chatTable); const nextChatId = await removeChat("non-existent-chat"); @@ -135,7 +167,7 @@ describe("(app)/$data", () => { it("should duplicate a chat and its associated data", async () => { vi.mocked(nanoid) .mockReturnValueOnce("newChatId") - .mockReturnValueOnce("newResponseId") + .mockReturnValueOnce("newRevisionId") .mockReturnValueOnce("newMessageId"); const newChatId = await duplicateChat("chat2"); @@ -144,7 +176,7 @@ describe("(app)/$data", () => { const duplicatedChat = await db.query.chatTable.findFirst({ where: eq(chatTable.id, "newChatId"), with: { - responses: { + revisions: { with: { messages: true, }, @@ -157,18 +189,18 @@ describe("(app)/$data", () => { name: "Chat 2 copy", prompt: "Prompt 2", createdAt: expect.any(String), - responses: [ + revisions: [ { - id: "newResponseId", + id: "newRevisionId", + version: 1, chatId: "newChatId", - modelId: "model1", error: null, createdAt: expect.any(String), messages: [ { id: expect.any(String), index: 0, - responseId: "newResponseId", + revisionId: "newRevisionId", role: "user", content: "How are you?", createdAt: expect.any(String), diff --git a/src/routes/(app)/$data.ts b/src/routes/(app)/$data.ts index 8027b35..89dee88 100644 --- a/src/routes/(app)/$data.ts +++ b/src/routes/(app)/$data.ts @@ -1,24 +1,27 @@ import { useDb } from "@/database/client"; import { asc, desc, eq, not } from "drizzle-orm"; -import { chatTable, responseMessageTable, responseTable } from "@/database/schema"; +import { chatTable, revisionTable, messageTable } from "@/database/schema"; import { nanoid } from "nanoid"; import { invalidate } from "$app/navigation"; export async function newChat() { - const id = nanoid(10); - await useDb().insert(chatTable).values({ - id: id, - name: "Untitled", - prompt: "", + const chatId = nanoid(10); + await useDb().transaction(async (tx) => { + await tx.insert(chatTable).values({ + id: chatId, + name: "Untitled", + prompt: "", + }); + await tx.insert(revisionTable).values({ + id: nanoid(10), + version: 1, + chatId: chatId, + }); }); - await invalidate("view:chats"); - return id; + return chatId; } export async function removeChat(chatId: string) { - // remove responses - await useDb().delete(responseTable).where(eq(responseTable.chatId, chatId)); - // delete chat await useDb().delete(chatTable).where(eq(chatTable.id, chatId)); // find next chat const nextChat = await useDb().query.chatTable.findFirst({ @@ -41,10 +44,10 @@ export async function duplicateChat(id: string) { const chat = await useDb().query.chatTable.findFirst({ where: eq(chatTable.id, id), with: { - responses: { + revisions: { with: { messages: { - orderBy: [asc(responseMessageTable.index)], + orderBy: [asc(messageTable.index)], }, }, }, @@ -60,24 +63,15 @@ export async function duplicateChat(id: string) { name: `${chat.name} copy`, prompt: chat.prompt, }); - for (const response of chat.responses) { - const responseId = nanoid(10); - await tx.insert(responseTable).values({ - id: responseId, - chatId: newChatId, - modelId: response.modelId, - error: null, - }); + for (const revision of chat.revisions) { + const newRevisionId = nanoid(10); + await tx.insert(revisionTable).values({ ...revision, id: newRevisionId, chatId: newChatId }); let index = 0; - for (const message of response.messages) { - const responseMessageId = nanoid(10); - await tx.insert(responseMessageTable).values({ - id: responseMessageId, - index, - responseId: responseId, - role: message.role, - content: message.content, - }); + for (const message of revision.messages) { + const newMessageId = nanoid(10); + await tx + .insert(messageTable) + .values({ ...message, id: newMessageId, revisionId: newRevisionId }); index += 1; } } diff --git a/src/routes/(app)/+layout.ts b/src/routes/(app)/+layout.ts index 7e77f43..1dea5c5 100644 --- a/src/routes/(app)/+layout.ts +++ b/src/routes/(app)/+layout.ts @@ -2,29 +2,36 @@ import "../../app.css"; import "@fontsource-variable/inter"; import { exposeDb, chatTable, registerModel, useDb } from "@/database"; import { sql } from "drizzle-orm/sql"; +import { desc } from "drizzle-orm"; export const ssr = false; let migrated = false; export async function load({ depends }) { exposeDb(); - try { - // only run migrations once - if (!migrated) { - const { runMigrations } = await import("@/database/migrator"); - console.log("Migrating database"); - await runMigrations(); - await useDb().run(sql.raw("PRAGMA foreign_keys=on;")); - console.log("Migration complete"); - migrated = true; - } - } catch (err) { - console.error(err); - } - const chats = await useDb().query.chatTable.findMany({}); + await runMigrations(); + const chats = await useDb().query.chatTable.findMany({ + // limit: 10, + orderBy: [desc(chatTable.createdAt)], + }); registerModel(chatTable, chats, depends); depends("view:chats"); return { chats, }; } + +async function runMigrations() { + if (migrated) { + return; + } + try { + const { runMigrations } = await import("@/database/migrator"); + console.log("Migrating database"); + await runMigrations(); + console.log("Migration complete"); + migrated = true; + } catch (err) { + console.error(err); + } +} diff --git a/src/routes/(app)/+page.ts b/src/routes/(app)/+page.ts index 390103b..d2bbbe6 100644 --- a/src/routes/(app)/+page.ts +++ b/src/routes/(app)/+page.ts @@ -3,5 +3,5 @@ import { redirect } from "@sveltejs/kit"; export async function load({ parent }) { const data = await parent(); const chat = data.chats[data.chats.length - 1]; - redirect(301, `/chat/${chat.id}/revise`); + redirect(301, `/chat/${chat.id}`); } diff --git a/src/routes/(app)/Menu.svelte b/src/routes/(app)/Menu.svelte index 392c015..f9264e7 100644 --- a/src/routes/(app)/Menu.svelte +++ b/src/routes/(app)/Menu.svelte @@ -5,21 +5,21 @@ import * as Dialog from "@/components/ui/dialog/index"; import { page } from "$app/stores"; import { cn } from "$lib/cn"; - import { goto } from "$app/navigation"; + import { goto, invalidate } from "$app/navigation"; import DeleteDialog from "@/components/DeleteDialog.svelte"; import PersistenceAlert from "@/components/PersistenceAlert.svelte"; import { type Chat } from "@/database"; import { duplicateChat, newChat, removeChat } from "./$data"; + import { route } from "$lib/route"; let { chats }: { chats: Chat[] } = $props(); + let chatToDelete: Chat | null = $state(null); let chatId: string | undefined = $derived.by(() => { if ($page.url.pathname.startsWith("/chat")) { return $page.params.id; } }); - - let chatToDelete: Chat | null = $state(null);
@@ -35,13 +35,14 @@ variant="outline" onclick={async () => { const id = await newChat(); - goto(`/chat/${id}`); + await invalidate("view:chats"); + await goto(route(`/chat/[id]`, { id })); }} >
-
+
-{#if chatToDelete} - { - if (chatToDelete) { - const nextId = await removeChat(chatToDelete.id); - await goto(`/chat/${nextId}`); - } - }} - onCancel={() => { + + { + if (chatToDelete) { + const nextId = await removeChat(chatToDelete.id); chatToDelete = null; - }} - /> -{/if} + await goto(route(`/chat/[id]`, { id: nextId })); + } + }} + onOpenChange={(open) => { + if (!open) { + chatToDelete = null; + } + }} +/> diff --git a/src/routes/(app)/api/chat/+server.ts b/src/routes/(app)/api/chat/+server.ts index 756d540..35f065d 100644 --- a/src/routes/(app)/api/chat/+server.ts +++ b/src/routes/(app)/api/chat/+server.ts @@ -1,27 +1,36 @@ -import { StreamingTextResponse, streamText } from "ai"; +import { convertToCoreMessages, StreamingTextResponse, streamText } from "ai"; import type { RequestHandler } from "./$types"; import { createOpenAI } from "@ai-sdk/openai"; import { createAnthropic } from "@ai-sdk/anthropic"; import { createMistral } from "@ai-sdk/mistral"; import { createGoogleGenerativeAI } from "@ai-sdk/google"; +import { createAzure } from "@ai-sdk/azure"; +import { createCohere } from "@ai-sdk/cohere"; export const POST = (async ({ request }) => { - const { messages, providerId, apiKey, baseURL, modelName } = (await request.json()) as { + let { messages, sdkId, apiKey, baseURL, modelName } = (await request.json()) as { messages: any[]; - providerId: string; - baseURL: string; + sdkId: string; + baseURL: string | undefined; apiKey: string; modelName: string; }; - if (!providerId || !baseURL || !modelName) { + baseURL = baseURL || undefined; + + if (!sdkId || !modelName) { return new Response(`Malformed request`, { status: 400, }); } + console.log("chat request", messages, sdkId, apiKey, baseURL, modelName); + let provider; - switch (providerId) { + switch (sdkId) { + case "azure": + provider = createAzure({ apiKey, baseURL }); + break; case "openai": provider = createOpenAI({ apiKey, baseURL }); break; @@ -31,19 +40,22 @@ export const POST = (async ({ request }) => { case "mistral": provider = createMistral({ apiKey, baseURL }); break; - case "google": + case "google-gen-ai": provider = createGoogleGenerativeAI({ apiKey, baseURL }); break; + case "cohere": + provider = createCohere({ apiKey }); + break; default: - return new Response(`Unsupported provider ${providerId}`, { + return new Response(`Unsupported sdk ${sdkId}`, { status: 400, }); } try { const result = await streamText({ - model: provider.chat(modelName), - messages, + model: provider(modelName), + messages: convertToCoreMessages(messages), }); return new StreamingTextResponse(result.toAIStream()); } catch (e: unknown) { diff --git a/src/routes/(app)/api/models/+server.ts b/src/routes/(app)/api/models/+server.ts index 8d95747..3dafd77 100644 --- a/src/routes/(app)/api/models/+server.ts +++ b/src/routes/(app)/api/models/+server.ts @@ -1,12 +1,13 @@ import type { RequestHandler } from "./$types"; export const POST = (async ({ request }) => { - const { providerId, baseURL } = (await request.json()) as { - providerId: string; + const { serviceId, sdkId, baseURL } = (await request.json()) as { + serviceId: string; + sdkId: string; baseURL: string; }; - const apiKey = request.headers.get("X_API_KEY"); + const apiKey = request.headers.get("Authorization"); if (!apiKey) { return new Response("Missing API key", { @@ -14,29 +15,37 @@ export const POST = (async ({ request }) => { }); } - if (!providerId) { + if (!sdkId) { return new Response("Missing service", { status: 400, }); } - if (!baseURL) { - return new Response("Missing baseURL", { - status: 400, - }); + switch (serviceId) { + case "perplexity": + return await fetchPerplexityModels(); } - switch (providerId) { + switch (sdkId) { case "openai": - return await fetchOpenAIModels(apiKey, baseURL); + return await fetchOpenAIModels(apiKey, baseURL || undefined); + case "azure": + if (!baseURL) { + return new Response("Azure OpenAI endpoint is required as the baseURL", { + status: 400, + }); + } + return await fetchAzureModels(apiKey, baseURL); case "anthropic": - return await fetchAnthropicModels(apiKey, baseURL); + return await fetchAnthropicModels(apiKey, baseURL || undefined); + case "cohere": + return await fetchCohereModels(apiKey); case "mistral": - return await fetchMistralModels(apiKey, baseURL); - case "google": - return await fetchGoogleModels(apiKey, baseURL); + return await fetchMistralModels(apiKey, baseURL || undefined); + case "google-gen-ai": + return await fetchGoogleModels(apiKey, baseURL || undefined); default: - return new Response(`Unsupported provider ${providerId}`, { + return new Response(`Unsupported provider ${sdkId}`, { status: 400, }); } @@ -62,6 +71,47 @@ async function fetchOpenAIModels(apiKey: string, baseURL = "https://api.openai.c }); } +// TODO: azure concats the deployment name with the model name, no support for deployment names input yet +async function fetchAzureModels(apiKey: string, baseURL: string) { + const url = `${baseURL}/openai/models?api-version=2024-06-01`; + + try { + const resp = await fetch(url, { + method: "GET", + headers: { + "api-key": apiKey, + "Content-Type": "application/json", + "X-Request-ID": crypto.randomUUID(), + }, + }); + + if (!resp.ok) { + return new Response(resp.statusText, { + status: resp.status, + }); + } + + const data = (await resp.json()) as any; + + // Transform the data to match the format of your OpenAI function + const transformedData = data.data.map((deployment: any) => ({ + name: deployment.id, + })); + + return new Response(JSON.stringify(transformedData), { + status: 200, + headers: { + "Content-Type": "application/json", + }, + }); + } catch (error) { + console.error("Error:", error); + return new Response("An error occurred while fetching models", { + status: 500, + }); + } +} + async function fetchAnthropicModels(apiKey: string, baseUrl = "https://api.anthropic.com") { // does anthropic have a models endpoint? const models = [ @@ -132,3 +182,80 @@ async function fetchGoogleModels( }, ); } + +async function fetchPerplexityModels() { + const models = [ + { + name: "llama-3.1-sonar-small-128k-online", + displayName: "Llama 3.1 Sonar Small 128K Online", + parameters: "8B", + contextWindow: 127072, + type: "Chat Completion", + }, + { + name: "llama-3.1-sonar-small-128k-chat", + displayName: "Llama 3.1 Sonar Small 128K Chat", + parameters: "8B", + contextWindow: 131072, + type: "Chat Completion", + }, + { + name: "llama-3.1-sonar-large-128k-online", + displayName: "Llama 3.1 Sonar Large 128K Online", + parameters: "70B", + contextWindow: 127072, + type: "Chat Completion", + }, + { + name: "llama-3.1-sonar-large-128k-chat", + displayName: "Llama 3.1 Sonar Large 128K Chat", + parameters: "70B", + contextWindow: 131072, + type: "Chat Completion", + }, + ]; + + return new Response(JSON.stringify(models), { + status: 200, + headers: { + "Content-Type": "application/json", + }, + }); +} + +async function fetchCohereModels(apiKey: string) { + const url = "https://api.cohere.ai/v1/models"; + + try { + const response = await fetch(url, { + method: "GET", + headers: { + Authorization: `Bearer ${apiKey}`, + "Content-Type": "application/json", + }, + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const data = (await response.json()) as any; + + // Transform the data to match a similar format to the previous examples + const transformedData = data.models.map((model: any) => ({ + name: model.name, + })); + + return new Response(JSON.stringify(transformedData), { + status: 200, + headers: { + "Content-Type": "application/json", + }, + }); + } catch (error) { + console.error("Error:", error); + return new Response("An error occurred while fetching models", { + status: 500, + }); + } +} diff --git a/src/routes/(app)/api/parse/+server.ts b/src/routes/(app)/api/parse/+server.ts new file mode 100644 index 0000000..92a5e54 --- /dev/null +++ b/src/routes/(app)/api/parse/+server.ts @@ -0,0 +1,61 @@ +import type { RequestHandler } from "@sveltejs/kit"; +import { UnstructuredClient } from "unstructured-client"; +import { Strategy } from "unstructured-client/sdk/models/shared"; + +export const POST = (async ({ request }) => { + let { + data, + fileName, + language = "eng", + baseURL = "https://api.unstructuredapp.io/general/v0/general", + } = (await request.json()) as { + data: string; + fileName: string; + language: string; + baseURL: string; + }; + + const apiKey = request.headers.get("Authorization"); + if (!apiKey) { + return new Response("Missing API key", { + status: 401, + }); + } + + const client = new UnstructuredClient({ + serverURL: baseURL, + security: { + apiKeyAuth: apiKey, + }, + }); + + try { + const resp = await client.general.partition({ + partitionParameters: { + files: { + content: data, + fileName: fileName, + }, + strategy: Strategy.Auto, + languages: [language], + }, + }); + if (resp.statusCode !== 200) { + return new Response(`Unstructured error: ${resp.statusCode}`, { + status: resp.statusCode, + }); + } + const jsonElements = JSON.stringify(resp.elements, null, 2); + console.log("Unstructured response", jsonElements); + return new Response(jsonElements, { + status: 200, + headers: { + "Content-Type": "application/json", + }, + }); + } catch (e: unknown) { + return new Response(e instanceof Error ? e.message : "Unknown error", { + status: 500, + }); + } +}) satisfies RequestHandler; diff --git a/src/routes/(app)/chat/[id]/$data.test.ts b/src/routes/(app)/chat/[id]/$data.test.ts index 6e17e9c..58dc3af 100644 --- a/src/routes/(app)/chat/[id]/$data.test.ts +++ b/src/routes/(app)/chat/[id]/$data.test.ts @@ -1,22 +1,35 @@ -import { afterEach, beforeEach, describe, expect, it, vi, beforeAll, afterAll } from "vitest"; -import { updateChat, updateResponsePrompt, interpolateDocuments, submitPrompt } from "./$data"; -import Database from "better-sqlite3"; -import { type BetterSQLite3Database, drizzle } from "drizzle-orm/better-sqlite3"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { + appendMessages, + createRevision, + getKeys, + getLatestRevision, + getModelKey, + getRevision, + interpolateDocuments, + isTab, + tabRouteId, + updateChat, +} from "./$data"; +import type { PgliteDatabase } from "drizzle-orm/pglite"; +import { drizzle } from "drizzle-orm/pglite"; import * as schema from "@/database/schema"; import { runMigrations } from "@/database/migrator"; import { eq } from "drizzle-orm"; -import { invalidate } from "$app/navigation"; -import { toast } from "svelte-french-toast"; import { nanoid } from "nanoid"; +import type { ChatMessage } from "$lib/chat-service.svelte"; +import { PGlite } from "@electric-sql/pglite"; +import { sql } from "drizzle-orm/sql"; -let sqlite: Database.Database; -let db: BetterSQLite3Database; +let pglite: PGlite; +let db: PgliteDatabase; -beforeEach(async () => { - // Set up database - sqlite = new Database(":memory:"); - db = drizzle(sqlite, { schema }); +beforeAll(async () => { + pglite = new PGlite(); + db = drizzle(pglite, { schema }); +}); +beforeEach(async () => { // Set up mocks vi.mock("$app/navigation", () => ({ invalidate: vi.fn(), @@ -29,7 +42,7 @@ beforeEach(async () => { })); vi.mock("nanoid", () => ({ - nanoid: vi.fn(), + nanoid: vi.fn(() => "mocked-nanoid"), })); // Mock the useDb function @@ -37,14 +50,35 @@ beforeEach(async () => { useDb: vi.fn(() => db), })); + vi.mock("@/database/model", () => ({ + invalidateModel: vi.fn(), + })); + await runMigrations(true); // Insert test data + await db.insert(schema.sdkTable).values([ + { + id: "sdk1", + name: "Test SDK", + slug: "test-sdk", + }, + ]); + await db.insert(schema.serviceTable).values([ { id: "service1", name: "Test Service", - providerId: "provider1", + sdkId: "sdk1", + baseURL: "https://api.test.com", + }, + ]); + + await db.insert(schema.keyTable).values([ + { + id: "key1", + name: "Test Key", + serviceId: "service1", baseURL: "https://api.test.com", apiKey: "test-api-key", }, @@ -52,33 +86,68 @@ beforeEach(async () => { await db .insert(schema.modelTable) - .values([{ id: "model1", serviceId: "service1", name: "Test Model", visible: 1 }]); + .values([{ id: "model1", keyId: "key1", name: "Test Model", visible: 1 }]); await db .insert(schema.chatTable) .values([{ id: "chat1", name: "Test Chat", prompt: "Test prompt with [[doc1]]" }]); - await db - .insert(schema.responseTable) - .values([{ id: "response1", chatId: "chat1", modelId: "model1" }]); + await db.insert(schema.revisionTable).values([ + { id: "revision1", version: 1, chatId: "chat1" }, + { id: "revision2", version: 2, chatId: "chat1" }, + ]); - await db.insert(schema.responseMessageTable).values([ + await db.insert(schema.messageTable).values([ { id: "message1", index: 0, - responseId: "response1", + revisionId: "revision1", role: "user", content: "Original content", }, + { + id: "message2", + index: 1, + revisionId: "revision2", + role: "assistant", + content: "Response content", + }, ]); await db .insert(schema.documentTable) .values([{ id: "doc1", name: "doc1", description: "Test doc", content: "Test content" }]); + + await db.insert(schema.attachmentTable).values([ + { + id: "attachment1", + messageId: "message1", + documentId: "doc1", + }, + ]); }); -afterEach(() => { - sqlite.close(); +afterEach(async () => { + // pglite is slowish to start for each test + // instead drop all the tables + await db.execute(sql`DO $$ + DECLARE + r RECORD; + BEGIN + -- Disable all triggers + EXECUTE 'SET session_replication_role = replica'; + + -- Drop all tables in the current schema + FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP + EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE'; + END LOOP; + + -- Re-enable triggers + EXECUTE 'SET session_replication_role = DEFAULT'; + END $$; + `); + + vi.clearAllMocks(); }); describe("updateChat", () => { @@ -87,34 +156,14 @@ describe("updateChat", () => { id: "chat1", name: "Updated Chat", prompt: "Updated prompt", - createdAt: new Date().toISOString(), }; - await updateChat(updatedChat); + await updateChat(updatedChat.id, updatedChat); const chat = await db.query.chatTable.findFirst({ where: eq(schema.chatTable.id, "chat1"), }); expect(chat).toEqual(expect.objectContaining(updatedChat)); - expect(invalidate).toHaveBeenCalled(); - }); -}); - -describe("updateResponsePrompt", () => { - it("should update the response prompt", async () => { - await updateResponsePrompt("response1"); - - const message = await db.query.responseMessageTable.findFirst({ - where: eq(schema.responseMessageTable.responseId, "response1"), - }); - - expect(message?.content).toBe("Test prompt with Test content"); - expect(toast.error).not.toHaveBeenCalled(); - }); - - it("should show error toast if response is not found", async () => { - await updateResponsePrompt("nonexistent"); - expect(toast.error).toHaveBeenCalledWith("Response not found"); }); }); @@ -131,56 +180,150 @@ describe("interpolateDocuments", () => { }); }); -describe("submitPrompt", () => { - it("should submit a prompt and create a new response", async () => { - vi.mocked(nanoid).mockReturnValueOnce("response2").mockReturnValueOnce("message2"); +describe("loadServices", () => { + it("should load services with their models", async () => { + const keys = await getKeys(); + expect(keys).toHaveLength(1); + expect(keys[0]).toMatchObject({ + id: "key1", + name: "Test Key", + models: [{ id: "model1", name: "Test Model" }], + }); + }); +}); - const chat = { - id: "chat1", - name: "Test Chat", - prompt: "Test prompt with [[doc1]]", - createdAt: new Date().toISOString(), - }; - await submitPrompt(chat, "model1"); +describe("getRevision", () => { + it("should get a specific revision", async () => { + const revision = await getRevision("chat1", 1); + expect(revision).toMatchObject({ + id: "revision1", + version: 1, + chatId: "chat1", + messages: [ + { + id: "message1", + content: "Original content", + attachments: [{ id: "attachment1", documentId: "doc1", document: { id: "doc1" } }], + }, + ], + }); + }); +}); - const response = await db.query.responseTable.findFirst({ - where: eq(schema.responseTable.id, "response2"), +describe("getLatestRevision", () => { + it("should get the latest revision", async () => { + const revision = await getLatestRevision("chat1"); + expect(revision).toMatchObject({ + id: "revision2", + version: 2, + chatId: "chat1", + messages: [{ id: "message2", content: "Response content" }], }); - expect(response).toBeDefined(); + }); +}); - const message = await db.query.responseMessageTable.findFirst({ - where: eq(schema.responseMessageTable.responseId, "response2"), +describe("getModelService", () => { + it("should get a model with its service", async () => { + const modelKey = await getModelKey("model1"); + expect(modelKey).toMatchObject({ + id: "model1", + name: "Test Model", + key: { id: "key1", name: "Test Key" }, }); - expect(message).toEqual( - expect.objectContaining({ - responseId: "response2", - role: "user", - content: "Test prompt with Test content", - }), - ); + }); +}); - expect(invalidate).toHaveBeenCalledWith("view:responses"); +describe("createRevision", () => { + it("should create a new revision", async () => { + vi.mocked(nanoid).mockReturnValueOnce("created-revision-id"); + const newRevision = await createRevision("chat1"); + expect(newRevision).toMatchObject({ + chatId: "chat1", + version: 3, + id: "created-revision-id", + }); }); +}); - it("should show error toast if no model is selected", async () => { - const chat = { - id: "chat1", - name: "Test Chat", - prompt: "Test prompt", - createdAt: new Date().toISOString(), +describe("appendMessage", () => { + it("should append a message to a revision", async () => { + const message = { + id: "new-message", + role: "user" as const, + content: "New message content", + attachments: [], }; - await submitPrompt(chat, null); - expect(toast.error).toHaveBeenCalledWith("No model selected"); + await appendMessages("revision2", [message]); + + const messages = await db.query.messageTable.findMany({ + where: eq(schema.messageTable.revisionId, "revision2"), + }); + expect(messages).toHaveLength(2); + expect(messages[1]).toMatchObject({ + id: "new-message", + role: "user", + content: "New message content", + index: 1, + }); }); - it("should show error toast if selected model is not found", async () => { - const chat = { - id: "chat1", - name: "Test Chat", - prompt: "Test prompt", - createdAt: new Date().toISOString(), - }; - await submitPrompt(chat, "nonexistent"); - expect(toast.error).toHaveBeenCalledWith("Selected model not found"); + // todo + it("should append attachments to the message"); +}); + +describe("newRevision", () => { + it("should create a new revision with messages", async () => { + vi.mocked(nanoid) + .mockReturnValueOnce("revision-with-messages-id") + .mockReturnValueOnce("message-1") + .mockReturnValueOnce("message-2"); + const messages: ChatMessage[] = [ + { id: "new-message1", role: "user", content: "New user message", attachments: [] }, + { id: "new-message2", role: "assistant", content: "New assistant message", attachments: [] }, + ]; + const revision = await createRevision("chat1", messages); + + expect(revision).toMatchObject({ + chatId: "chat1", + version: 3, + id: "revision-with-messages-id", + }); + + const newMessages = await db.query.messageTable.findMany({ + where: eq(schema.messageTable.revisionId, "revision-with-messages-id"), + }); + expect(newMessages).toHaveLength(2); + expect(newMessages[0]).toMatchObject({ + role: "user", + content: "New user message", + index: 0, + }); + expect(newMessages[1]).toMatchObject({ + role: "assistant", + content: "New assistant message", + index: 1, + }); + }); +}); + +describe("isTab", () => { + it("should return true for valid tab values", () => { + expect(isTab("chat")).toBe(true); + expect(isTab("eval")).toBe(true); + expect(isTab("revise")).toBe(true); + }); + + it("should return false for invalid tab values", () => { + expect(isTab("invalid")).toBe(false); + expect(isTab(123)).toBe(false); + expect(isTab(null)).toBe(false); + }); +}); + +describe("tabRouteId", () => { + it("should return correct route ID for each tab", () => { + expect(tabRouteId("chat")).toBe("/chat/[id]"); + expect(tabRouteId("eval")).toBe("/chat/[id]/eval"); + expect(tabRouteId("revise")).toBe("/chat/[id]/revise"); }); }); diff --git a/src/routes/(app)/chat/[id]/$data.ts b/src/routes/(app)/chat/[id]/$data.ts index e879554..25a1dd7 100644 --- a/src/routes/(app)/chat/[id]/$data.ts +++ b/src/routes/(app)/chat/[id]/$data.ts @@ -1,76 +1,151 @@ import { - documentTable, - modelTable, + attachmentTable, type Chat, chatTable, - responseMessageTable, - responseTable, + documentTable, + type InsertMessage, + messageTable, + modelTable, + type Revision, + revisionTable, useDb, } from "@/database"; -import { eq } from "drizzle-orm"; +import { and, desc, eq } from "drizzle-orm"; import { nanoid } from "nanoid"; -import { invalidate } from "$app/navigation"; -import { toast } from "svelte-french-toast"; import { invalidateModel } from "@/database/model"; +import { sql } from "drizzle-orm/sql"; +import type { RouteId } from "$lib/route"; +import type { MessageAttachment, ChatMessage } from "$lib/chat-service.svelte"; + +export type KeysView = Awaited>; + +export type RevisionView = NonNullable>>; + +export type Tab = "chat" | "eval" | "revise"; -export type ServicesView = Awaited>; +export function isTab(tab: any): tab is Tab { + return tab === "chat" || tab === "eval" || tab === "revise"; +} + +export function tabRouteId(tab: Tab): RouteId { + return tab === "chat" ? `/chat/[id]` : `/chat/[id]/${tab}`; +} -export function loadServices() { - return useDb().query.serviceTable.findMany({ +export function getKeys() { + return useDb().query.keyTable.findMany({ with: { models: true, + service: true, + }, + }); +} + +export function toChatMessage(message: RevisionView["messages"][number]): ChatMessage { + return { + ...message, + role: message.role as ChatMessage["role"], + createdAt: message.createdAt ? new Date(message.createdAt) : undefined, + attachments: message.attachments.map((a) => { + return { + id: a.document.id, + type: a.document.type, + name: a.document.name, + content: a.document.content, + attributes: a.document.attributes, + }; + }), + }; +} + +export function getRevision(chatId: string, version: number | null) { + return useDb().query.revisionTable.findFirst({ + where: + version !== null + ? and(eq(revisionTable.chatId, chatId), eq(revisionTable.version, version)) + : eq(revisionTable.chatId, chatId), + with: { + messages: { + with: { + attachments: { + with: { + document: true, + }, + }, + }, + }, + }, + orderBy: [desc(revisionTable.version)], + }); +} + +export function getLatestRevision(chatId: string) { + return useDb().query.revisionTable.findFirst({ + where: eq(revisionTable.chatId, chatId), + with: { + messages: { + with: { + attachments: { + with: { + document: true, + }, + }, + }, + }, + }, + orderBy: [desc(revisionTable.version)], + }); +} + +export function getModelKey(modelId: string) { + return useDb().query.modelTable.findFirst({ + where: eq(modelTable.id, modelId), + with: { + key: { + with: { + service: { + columns: { + id: true, + name: true, + }, + with: { + sdk: { + columns: { + id: true, + name: true, + }, + }, + }, + }, + }, + }, }, }); } -export async function updateChat(chat: Chat) { - console.log("updateChat", chat); +// export async function createRevision(chatId: string) { +// const revisionId = nanoid(10); +// await useDb() +// .insert(revisionTable) +// .values({ +// id: revisionId, +// version: sql`(SELECT COUNT(id) + 1 FROM ${revisionTable} WHERE ${eq(revisionTable.chatId, chatId)})`, +// chatId, +// error: null, +// createdAt: new Date().toISOString(), +// }) +// .execute(); +// return getLatestRevision(chatId); +// } + +export async function updateChat(chatId: string, updates: Partial) { + console.log("updateChat", chatId, updates); const result = await useDb() .update(chatTable) - .set({ ...chat }) - .where(eq(chatTable.id, chat.id)) + .set({ ...updates }) + .where(eq(chatTable.id, chatId)) .returning(); console.log(result); - await invalidateModel(chatTable, chat); -} - -export async function updateResponsePrompt(id: string) { - try { - console.time("updateResponsePrompt"); - const response = await useDb().query.responseTable.findFirst({ - where: eq(responseTable.id, id), - }); - if (!response) { - return toast.error("Response not found"); - } - // get first message - const message = await useDb().query.responseMessageTable.findFirst({ - where: eq(responseMessageTable.responseId, id), - }); - if (!message) { - return toast.error("Message not found"); - } - const chat = await useDb().query.chatTable.findFirst({ - where: eq(chatTable.id, response.chatId), - }); - if (!chat) { - return toast.error("Chat not found"); - } - // interpolate documents into prompt - const content = await interpolateDocuments(chat.prompt); - console.log("updated prompt", content); - await useDb() - .update(responseMessageTable) - .set({ content }) - .where(eq(responseMessageTable.id, message.id)); - } catch (e) { - if (e instanceof Error) { - toast.error(e.message); - } - console.error(e); - } finally { - console.timeEnd("updateResponsePrompt"); - } + await invalidateModel(chatTable, { id: chatId }); } export async function interpolateDocuments(prompt: string) { @@ -95,42 +170,92 @@ export async function interpolateDocuments(prompt: string) { return interpolatedPrompt; } -export async function submitPrompt(chat: Chat, modelId: string | null) { +export async function appendMessages(revisionId: string, messages: ChatMessage[]) { try { - if (!modelId) { - throw new Error("No model selected"); - } - const model = await useDb().query.modelTable.findFirst({ - where: eq(modelTable.id, modelId), - }); - if (!model) { - throw new Error("Selected model not found"); - } - // const model = db.models.get(store.selected.modelId); - // interpolate documents into prompt - const content = await interpolateDocuments(chat.prompt); - console.log("content", content); - await useDb().transaction(async (tx) => { - const responseId = nanoid(10); - await tx.insert(responseTable).values({ - id: responseId, - chatId: chat.id, - modelId: model.id, - error: null, - }); - await tx.insert(responseMessageTable).values({ - id: nanoid(), - index: 0, - responseId, - role: "user", - content, - }); + return await useDb().transaction(async (tx) => { + for (const message of messages) { + await tx + .insert(messageTable) + .values({ + id: message.id, + revisionId, + role: message.role, + content: message.content, + index: sql`(SELECT COUNT(id) FROM ${messageTable} WHERE ${eq(messageTable.revisionId, revisionId)})`, + }) + .execute(); + for (const attachment of message.attachments) { + const documentId = attachment.id; + await tx + .insert(documentTable) + .values({ + id: documentId, + type: attachment.type, + name: `Pasted ${new Date().toLocaleString()}`, + description: "", + content: attachment.content, + }) + .execute(); + await tx.insert(attachmentTable).values({ + id: nanoid(10), + documentId, + messageId: message.id, + }); + } + } }); - await invalidate("view:responses"); } catch (e) { - if (e instanceof Error) { - toast.error(e.message); - } console.error(e); + throw e; } } + +export async function createRevision(chatId: string, messages: ChatMessage[] = []) { + const revisionId = nanoid(10); + await useDb().transaction(async (tx) => { + await tx + .insert(revisionTable) + .values({ + id: revisionId, + version: sql`(SELECT COUNT(id) + 1 FROM ${revisionTable} WHERE ${eq(revisionTable.chatId, chatId)})`, + chatId, + error: null, + }) + .execute(); + for (const message of messages) { + const newMessageId = nanoid(10); + await tx + .insert(messageTable) + .values({ + id: newMessageId, + revisionId, + role: message.role, + content: message.content, + index: sql`(SELECT COUNT(id) FROM ${messageTable} WHERE ${eq(messageTable.revisionId, revisionId)})`, + }) + .execute(); + for (const attachment of message.attachments) { + await tx.insert(attachmentTable).values({ + id: nanoid(10), + documentId: attachment.id, + messageId: newMessageId, + }); + } + } + }); + const revision = await useDb().query.revisionTable.findFirst({ + where: eq(revisionTable.id, revisionId), + with: { + messages: { + with: { + attachments: { + with: { + document: true, + }, + }, + }, + }, + }, + }); + return revision!; +} diff --git a/src/routes/(app)/chat/[id]/+layout.svelte b/src/routes/(app)/chat/[id]/+layout.svelte index c7a5b6b..ec2aa37 100644 --- a/src/routes/(app)/chat/[id]/+layout.svelte +++ b/src/routes/(app)/chat/[id]/+layout.svelte @@ -1,30 +1,42 @@
+ Chat Revise - @@ -40,32 +52,14 @@
- -
- - {#if store.selected.modelId} - - {/if}
-
+
- - - - - - diff --git a/src/routes/(app)/chat/[id]/+layout.ts b/src/routes/(app)/chat/[id]/+layout.ts index 750f0fb..d34c435 100644 --- a/src/routes/(app)/chat/[id]/+layout.ts +++ b/src/routes/(app)/chat/[id]/+layout.ts @@ -1,31 +1,44 @@ import { eq } from "drizzle-orm"; -import { chatTable, registerModel, serviceTable, useDb } from "@/database"; +import { chatTable, keyTable, registerModel, revisionTable, useDb } from "@/database"; import { error } from "@sveltejs/kit"; -import { loadServices } from "./$data"; +import { getKeys, getRevision, type Tab } from "./$data"; +import { match } from "$lib/route"; export async function load({ route, url, params, depends }) { // evaluate tab using route id - let tab; - if (route.id.includes(`[id]/eval`)) { + let tab: Tab; + if (match(`/chat/[id]/eval`, route.id)) { + console.log("tab is eval", route.id); tab = "eval"; - // } else if (route.id.includes(`[id]/eval`)) { - // tab = "chat"; - } else if (route.id.includes(`[id]/revise`)) { + } else if (match(`/chat/[id]/revise`, route.id)) { + console.log("tab is revise", route.id); tab = "revise"; + } else { + console.log("tab is chat", route.id); + tab = "chat"; } const chat = await useDb().query.chatTable.findFirst({ where: eq(chatTable.id, params.id), + with: { + revisions: true, + }, }); if (!chat) { return error(404, `Chat ${params.id} not found`); } registerModel(chatTable, chat, depends); - const services = await loadServices(); - registerModel(serviceTable, services, depends); + const keys = await getKeys(); + registerModel(keyTable, keys, depends); + const version = Number(url.searchParams.get("version")) || null; + const revision = await getRevision(params.id, version); + if (!revision) { + return error(404, `Revision ${version} not found`); + } + registerModel(revisionTable, revision, depends); + depends("view:messages"); depends("view:chat"); - - return { chat, services, tab }; + return { chat, keys, tab, revision, version }; } diff --git a/src/routes/(app)/chat/[id]/+page.svelte b/src/routes/(app)/chat/[id]/+page.svelte new file mode 100644 index 0000000..39eb6c5 --- /dev/null +++ b/src/routes/(app)/chat/[id]/+page.svelte @@ -0,0 +1,14 @@ + + +{#key $page.params.id} + {#key data.version} + + {/key} +{/key} diff --git a/src/routes/(app)/chat/[id]/+page.ts b/src/routes/(app)/chat/[id]/+page.ts index be5565d..42cd5f5 100644 --- a/src/routes/(app)/chat/[id]/+page.ts +++ b/src/routes/(app)/chat/[id]/+page.ts @@ -1,5 +1,14 @@ -import { redirect } from "@sveltejs/kit"; +import { registerModel, serviceTable, useDb } from "@/database"; -export function load({ params }) { - return redirect(301, `/chat/${params.id}/revise`); +export async function load({ params, depends }) { + const services = await useDb().query.serviceTable.findMany({ + with: { + sdk: true, + }, + }); + const documentServices = services.filter((s) => s.sdk.type === "document"); + registerModel(serviceTable, documentServices, depends); + return { + documentServices, + }; } diff --git a/src/routes/(app)/chat/[id]/Attachment.svelte b/src/routes/(app)/chat/[id]/Attachment.svelte new file mode 100644 index 0000000..621a171 --- /dev/null +++ b/src/routes/(app)/chat/[id]/Attachment.svelte @@ -0,0 +1,50 @@ + + +
+
+ {#if onRemove} + + {/if} +
+
+ {#if attachment.loading} + + {:else if attachment.error} +
+

{attachment.error.message}

+
+ {:else if attachment.type.startsWith("image/")} + Pasted + {:else} +

{attachment.content}

+ {/if} +
+
+
+ {humanType(attachment.type)} +
+
+
+
diff --git a/src/routes/(app)/chat/[id]/AttachmentControls.svelte b/src/routes/(app)/chat/[id]/AttachmentControls.svelte new file mode 100644 index 0000000..db43b1f --- /dev/null +++ b/src/routes/(app)/chat/[id]/AttachmentControls.svelte @@ -0,0 +1,25 @@ + + +
+ + + + + + +
diff --git a/src/routes/(app)/chat/[id]/ChatPage.svelte b/src/routes/(app)/chat/[id]/ChatPage.svelte new file mode 100644 index 0000000..c67299e --- /dev/null +++ b/src/routes/(app)/chat/[id]/ChatPage.svelte @@ -0,0 +1,121 @@ + + + +
+
+ {#each chatService.messages as message, index (message.id)} + + {/each} + {#if chatService.isLoading} + + {/if} +
+ +
diff --git a/src/routes/(app)/chat/[id]/ChatTitlebar.svelte b/src/routes/(app)/chat/[id]/ChatTitlebar.svelte new file mode 100644 index 0000000..1e29bd6 --- /dev/null +++ b/src/routes/(app)/chat/[id]/ChatTitlebar.svelte @@ -0,0 +1,112 @@ + + +
+ { + updateChat(chat.id, { name }); + }} + /> + {#if unsavedChanges} + + {/if} +
+ {#if revision} + + v{revision.version} + + {/if} +
+ {#if tab === "revise"} + + {/if} +
diff --git a/src/routes/(app)/chat/[id]/MessageCard.svelte b/src/routes/(app)/chat/[id]/MessageCard.svelte new file mode 100644 index 0000000..8a530db --- /dev/null +++ b/src/routes/(app)/chat/[id]/MessageCard.svelte @@ -0,0 +1,137 @@ + + +{#if message.attachments && message.attachments.length > 0} +
+ {#each message.attachments as attachment, index (index)} + + {/each} +
+{/if} +{#if showAttachmentControls} + { + showAttachmentControls = false; + onPaste && onPaste(); + }} + /> +{/if} + + {#if editable} +
+ + + {message.role} + + + (message.role = "user")}>User + (message.role = "assistant")}> + Assistant + + (message.role = "system")}>System + + +
+ + + +
+ {/if} + + {#if mode === "edit" && editable} + (message.content = content)} + onKeyPress={handleKeyPress} + /> + {:else if format === "markdown"} + + {:else} + {message.content} + {/if} + +
diff --git a/src/routes/(app)/chat/[id]/MessageEditor.svelte b/src/routes/(app)/chat/[id]/MessageEditor.svelte new file mode 100644 index 0000000..ffb8b59 --- /dev/null +++ b/src/routes/(app)/chat/[id]/MessageEditor.svelte @@ -0,0 +1,92 @@ + + +
+
+ {#if showPlaceholder} +
{placeholder}
+ {/if} +
+ + diff --git a/src/routes/(app)/chat/[id]/MessageInput.svelte b/src/routes/(app)/chat/[id]/MessageInput.svelte new file mode 100644 index 0000000..e445ca6 --- /dev/null +++ b/src/routes/(app)/chat/[id]/MessageInput.svelte @@ -0,0 +1,118 @@ + + +
+ + + {#if attachmentService.attachments.length > 0} +
+ {#each attachmentService.attachments as attachment, index (index)} + attachmentService.remove(index)} /> + {/each} +
+ {/if} + {#if isUploadOpen} + + {/if} +
+ + +