@youdotcom-oss/ai-sdk-plugin 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +15 -20
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -13567,7 +13567,7 @@ var ContentsItemSchema = object({
13567
13567
  });
13568
13568
  var ContentsApiResponseSchema = array(ContentsItemSchema);
13569
13569
  // ../api/src/shared/api.constants.ts
13570
- var SEARCH_API_URL = process.env.YDC_SEARCH_API_URL || "https://ydc-index.io/v1/search";
13570
+ var SEARCH_API_URL = process.env.YDC_SEARCH_API_URL || "https://api.you.com/v1/agents/search";
13571
13571
  var DEEP_SEARCH_API_URL = process.env.YDC_DEEP_SEARCH_API_URL || "https://api.you.com/v1/deep_search";
13572
13572
  var CONTENTS_API_URL = process.env.YDC_CONTENTS_API_URL || "https://ydc-index.io/v1/contents";
13573
13573
 
@@ -13834,23 +13834,18 @@ var fetchSearchResults = async ({
13834
13834
  } else if (errorCode === 402) {
13835
13835
  let errorMessage = "Free tier limit exceeded. Please upgrade to continue.";
13836
13836
  let upgradeUrl = "https://you.com/platform";
13837
- try {
13838
- const json2 = await response.json();
13839
- const parseResult = ApiErrorResponseSchema.safeParse(json2);
13840
- if (parseResult.success) {
13841
- const errorBody = parseResult.data;
13842
- if (errorBody.message) {
13843
- errorMessage = errorBody.message;
13844
- }
13845
- if (errorBody.upgrade_url) {
13846
- upgradeUrl = errorBody.upgrade_url;
13847
- }
13848
- if (errorBody.reset_at) {
13849
- const resetDate = new Date(errorBody.reset_at).toLocaleDateString();
13850
- errorMessage += ` Limit resets on ${resetDate}.`;
13851
- }
13852
- }
13853
- } catch {}
13837
+ const json2 = await response.json();
13838
+ const errorBody = ApiErrorResponseSchema.parse(json2);
13839
+ if (errorBody.message) {
13840
+ errorMessage = errorBody.message;
13841
+ }
13842
+ if (errorBody.upgrade_url) {
13843
+ upgradeUrl = errorBody.upgrade_url;
13844
+ }
13845
+ if (errorBody.reset_at) {
13846
+ const resetDate = new Date(errorBody.reset_at).toLocaleDateString();
13847
+ errorMessage += ` Limit resets on ${resetDate}.`;
13848
+ }
13854
13849
  throw new Error(`${errorMessage} Upgrade at: ${upgradeUrl}`);
13855
13850
  }
13856
13851
  throw new Error(`Failed to perform search. Error code: ${errorCode}`);
@@ -13865,7 +13860,7 @@ import { tool } from "ai";
13865
13860
  // package.json
13866
13861
  var package_default = {
13867
13862
  name: "@youdotcom-oss/ai-sdk-plugin",
13868
- version: "2.0.5",
13863
+ version: "2.0.7",
13869
13864
  description: "Vercel AI SDK plugin for You.com web search, AI agents, and content extraction via MCP",
13870
13865
  license: "MIT",
13871
13866
  engines: {
@@ -13927,7 +13922,7 @@ var package_default = {
13927
13922
  },
13928
13923
  types: "./dist/main.d.ts",
13929
13924
  dependencies: {
13930
- "@youdotcom-oss/api": "0.3.2"
13925
+ "@youdotcom-oss/api": "0.3.4"
13931
13926
  },
13932
13927
  peerDependencies: {
13933
13928
  ai: "^6.0.83"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youdotcom-oss/ai-sdk-plugin",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "Vercel AI SDK plugin for You.com web search, AI agents, and content extraction via MCP",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "types": "./dist/main.d.ts",
64
64
  "dependencies": {
65
- "@youdotcom-oss/api": "0.3.2"
65
+ "@youdotcom-oss/api": "0.3.4"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "ai": "^6.0.83"