victor HF Staff commited on
Commit
4359c33
·
1 Parent(s): 003526f

fix: Resolve TypeScript errors and update dependencies

Browse files

- Fix message part filtering TypeScript errors in message.tsx
- Update modelID import path to use centralized models module
- Add missing 'ai' dependency to package.json
- Update pnpm lockfile with new dependencies

components/message.tsx CHANGED
@@ -233,8 +233,8 @@ const PurePreviewMessage = ({
233
  const getMessageText = () => {
234
  if (!message.parts) return "";
235
  return message.parts
236
- .filter((part: { type: string; }) => part.type === "text")
237
- .map((part: { type: string; text: any; }) => (part.type === "text" ? part.text : ""))
238
  .join("\n\n");
239
  };
240
 
 
233
  const getMessageText = () => {
234
  if (!message.parts) return "";
235
  return message.parts
236
+ .filter((part) => part.type === "text")
237
+ .map((part) => (part.type === "text" ? part.text : ""))
238
  .join("\n\n");
239
  };
240
 
components/textarea.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { modelID } from "@/ai/providers";
2
  import { Textarea as ShadcnTextarea } from "@/components/ui/textarea";
3
  import { ArrowUp, Loader2 } from "lucide-react";
4
  import { ModelPicker } from "./model-picker";
@@ -9,8 +9,8 @@ interface InputProps {
9
  isLoading: boolean;
10
  status: string;
11
  stop: () => void;
12
- selectedModel: modelID;
13
- setSelectedModel: (model: modelID) => void;
14
  }
15
 
16
  export const Textarea = ({
 
1
+ import { ModelID } from "@/lib/models";
2
  import { Textarea as ShadcnTextarea } from "@/components/ui/textarea";
3
  import { ArrowUp, Loader2 } from "lucide-react";
4
  import { ModelPicker } from "./model-picker";
 
9
  isLoading: boolean;
10
  status: string;
11
  stop: () => void;
12
+ selectedModel: ModelID;
13
+ setSelectedModel: (model: ModelID) => void;
14
  }
15
 
16
  export const Textarea = ({
package.json CHANGED
@@ -31,6 +31,7 @@
31
  "@radix-ui/react-tooltip": "^1.2.3",
32
  "@tanstack/react-query": "^5.74.4",
33
  "@vercel/analytics": "^1.5.0",
 
34
  "class-variance-authority": "^0.7.1",
35
  "clsx": "^2.1.1",
36
  "drizzle-orm": "^0.44.1",
 
31
  "@radix-ui/react-tooltip": "^1.2.3",
32
  "@tanstack/react-query": "^5.74.4",
33
  "@vercel/analytics": "^1.5.0",
34
+ "ai": "^4.3.17",
35
  "class-variance-authority": "^0.7.1",
36
  "clsx": "^2.1.1",
37
  "drizzle-orm": "^0.44.1",
pnpm-lock.yaml CHANGED
@@ -62,6 +62,9 @@ importers:
62
  '@vercel/analytics':
63
  specifier: ^1.5.0
64
 
 
 
65
  class-variance-authority:
66
  specifier: ^0.7.1
67
  version: 0.7.1
@@ -2295,6 +2298,9 @@ packages:
2295
  '@types/[email protected]':
2296
  resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==}
2297
 
 
 
 
2298
  '@types/[email protected]':
2299
  resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==}
2300
 
@@ -2562,6 +2568,16 @@ packages:
2562
  resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==}
2563
  engines: {node: '>= 8.0.0'}
2564
 
 
 
 
 
 
 
 
 
 
 
2565
2566
  resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
2567
 
@@ -2723,6 +2739,10 @@ packages:
2723
  resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
2724
  engines: {node: '>=10'}
2725
 
 
 
 
 
2726
2727
  resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==}
2728
 
@@ -2894,6 +2914,9 @@ packages:
2894
2895
  resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==}
2896
 
 
 
 
2897
2898
  resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
2899
  engines: {node: '>=0.10.0'}
@@ -3717,6 +3740,11 @@ packages:
3717
  engines: {node: '>=6'}
3718
  hasBin: true
3719
 
 
 
 
 
 
3720
3721
  resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
3722
  engines: {node: '>=4.0'}
@@ -6719,8 +6747,7 @@ snapshots:
6719
 
6720
  '@nolyfill/[email protected]': {}
6721
 
6722
- '@opentelemetry/[email protected]':
6723
- optional: true
6724
 
6725
  '@radix-ui/[email protected]': {}
6726
 
@@ -7604,6 +7631,8 @@ snapshots:
7604
  dependencies:
7605
  '@types/ms': 2.1.0
7606
 
 
 
7607
  '@types/[email protected]':
7608
  dependencies:
7609
  '@types/estree': 1.0.8
@@ -7849,6 +7878,18 @@ snapshots:
7849
  dependencies:
7850
  humanize-ms: 1.2.1
7851
 
 
 
 
 
 
 
 
 
 
 
 
 
7852
7853
  dependencies:
7854
  fast-deep-equal: 3.1.3
@@ -8064,6 +8105,8 @@ snapshots:
8064
  ansi-styles: 4.3.0
8065
  supports-color: 7.2.0
8066
 
 
 
8067
8068
 
8069
@@ -8209,6 +8252,8 @@ snapshots:
8209
  dependencies:
8210
  dequal: 2.0.3
8211
 
 
 
8212
8213
  dependencies:
8214
  esutils: 2.0.3
@@ -9157,6 +9202,12 @@ snapshots:
9157
 
9158
9159
 
 
 
 
 
 
 
9160
9161
  dependencies:
9162
  array-includes: 3.1.9
 
62
  '@vercel/analytics':
63
  specifier: ^1.5.0
64
65
+ ai:
66
+ specifier: ^4.3.17
67
68
  class-variance-authority:
69
  specifier: ^0.7.1
70
  version: 0.7.1
 
2298
  '@types/[email protected]':
2299
  resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==}
2300
 
2301
+ '@types/[email protected]':
2302
+ resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==}
2303
+
2304
  '@types/[email protected]':
2305
  resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==}
2306
 
 
2568
  resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==}
2569
  engines: {node: '>= 8.0.0'}
2570
 
2571
2572
+ resolution: {integrity: sha512-uWqIQ94Nb1GTYtYElGHegJMOzv3r2mCKNFlKrqkft9xrfvIahTI5OdcnD5U9612RFGuUNGmSDTO1/YRNFXobaQ==}
2573
+ engines: {node: '>=18'}
2574
+ peerDependencies:
2575
+ react: ^18 || ^19 || ^19.0.0-rc
2576
+ zod: ^3.23.8
2577
+ peerDependenciesMeta:
2578
+ react:
2579
+ optional: true
2580
+
2581
2582
  resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
2583
 
 
2739
  resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
2740
  engines: {node: '>=10'}
2741
 
2742
2743
+ resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==}
2744
+ engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
2745
+
2746
2747
  resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==}
2748
 
 
2914
2915
  resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==}
2916
 
2917
2918
+ resolution: {integrity: sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==}
2919
+
2920
2921
  resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
2922
  engines: {node: '>=0.10.0'}
 
3740
  engines: {node: '>=6'}
3741
  hasBin: true
3742
 
3743
3744
+ resolution: {integrity: sha512-3QItJOXp2AP1uv7waBkao5nCvhEv+QmJAd38Ybq7wNI74Q+BBmnLn4EDKz6yI9xGAIQoUF87qHt+kc1IVxB4zQ==}
3745
+ engines: {node: ^18.0.0 || >=20.0.0}
3746
+ hasBin: true
3747
+
3748
3749
  resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
3750
  engines: {node: '>=4.0'}
 
6747
 
6748
  '@nolyfill/[email protected]': {}
6749
 
6750
+ '@opentelemetry/[email protected]': {}
 
6751
 
6752
  '@radix-ui/[email protected]': {}
6753
 
 
7631
  dependencies:
7632
  '@types/ms': 2.1.0
7633
 
7634
+ '@types/[email protected]': {}
7635
+
7636
  '@types/[email protected]':
7637
  dependencies:
7638
  '@types/estree': 1.0.8
 
7878
  dependencies:
7879
  humanize-ms: 1.2.1
7880
 
7881
7882
+ dependencies:
7883
+ '@ai-sdk/provider': 1.1.3
7884
+ '@ai-sdk/provider-utils': 2.2.8([email protected])
7885
+ '@ai-sdk/react': 1.2.12([email protected])([email protected])
7886
+ '@ai-sdk/ui-utils': 1.2.11([email protected])
7887
+ '@opentelemetry/api': 1.9.0
7888
+ jsondiffpatch: 0.6.0
7889
+ zod: 3.25.76
7890
+ optionalDependencies:
7891
+ react: 19.1.0
7892
+
7893
7894
  dependencies:
7895
  fast-deep-equal: 3.1.3
 
8105
  ansi-styles: 4.3.0
8106
  supports-color: 7.2.0
8107
 
8108
8109
+
8110
8111
 
8112
 
8252
  dependencies:
8253
  dequal: 2.0.3
8254
 
8255
8256
+
8257
8258
  dependencies:
8259
  esutils: 2.0.3
 
9202
 
9203
9204
 
9205
9206
+ dependencies:
9207
+ '@types/diff-match-patch': 1.0.36
9208
+ chalk: 5.4.1
9209
+ diff-match-patch: 1.0.5
9210
+
9211
9212
  dependencies:
9213
  array-includes: 3.1.9