@youdotcom-oss/ai-sdk-plugin 1.0.2 → 1.0.3

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 +17 -32
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -1818,10 +1818,6 @@ var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, d
1818
1818
  $ZodCheckNumberFormat.init(inst, def);
1819
1819
  $ZodNumber.init(inst, def);
1820
1820
  });
1821
- var $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
1822
- $ZodType.init(inst, def);
1823
- inst._zod.parse = (payload) => payload;
1824
- });
1825
1821
  var $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
1826
1822
  $ZodType.init(inst, def);
1827
1823
  inst._zod.parse = (payload) => payload;
@@ -2987,11 +2983,6 @@ function _int(Class2, params) {
2987
2983
  ...normalizeParams(params)
2988
2984
  });
2989
2985
  }
2990
- function _any(Class2) {
2991
- return new Class2({
2992
- type: "any"
2993
- });
2994
- }
2995
2986
  function _unknown(Class2) {
2996
2987
  return new Class2({
2997
2988
  type: "unknown"
@@ -3607,7 +3598,6 @@ var numberProcessor = (schema, ctx, _json, _params) => {
3607
3598
  var neverProcessor = (_schema, _ctx, json, _params) => {
3608
3599
  json.not = {};
3609
3600
  };
3610
- var anyProcessor = (_schema, _ctx, _json, _params) => {};
3611
3601
  var unknownProcessor = (_schema, _ctx, _json, _params) => {};
3612
3602
  var enumProcessor = (schema, _ctx, json, _params) => {
3613
3603
  const def = schema._zod.def;
@@ -4181,14 +4171,6 @@ var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def
4181
4171
  function int(params) {
4182
4172
  return _int(ZodNumberFormat, params);
4183
4173
  }
4184
- var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
4185
- $ZodAny.init(inst, def);
4186
- ZodType.init(inst, def);
4187
- inst._zod.processJSONSchema = (ctx, json, params) => anyProcessor(inst, ctx, json, params);
4188
- });
4189
- function any() {
4190
- return _any(ZodAny);
4191
- }
4192
4174
  var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
4193
4175
  $ZodUnknown.init(inst, def);
4194
4176
  ZodType.init(inst, def);
@@ -4529,7 +4511,7 @@ function superRefine(fn) {
4529
4511
  return _superRefine(fn);
4530
4512
  }
4531
4513
 
4532
- // ../../node_modules/.bun/@youdotcom-oss+api@0.0.1/node_modules/@youdotcom-oss/api/src/contents/contents.schemas.ts
4514
+ // ../api/src/contents/contents.schemas.ts
4533
4515
  var ContentsQuerySchema = object({
4534
4516
  urls: array(string2().url()).min(1).describe('Array of webpage URLs to extract content from (e.g., ["https://example.com"])'),
4535
4517
  formats: array(_enum(["markdown", "html", "metadata"])).optional().describe('Output formats: array of "markdown" (text), "html" (layout), or "metadata" (structured data)'),
@@ -4548,12 +4530,12 @@ var ContentsItemSchema = object({
4548
4530
  }).optional().describe("Structured metadata when available")
4549
4531
  });
4550
4532
  var ContentsApiResponseSchema = array(ContentsItemSchema);
4551
- // ../../node_modules/.bun/@youdotcom-oss+api@0.0.1/node_modules/@youdotcom-oss/api/src/shared/api.constants.ts
4533
+ // ../api/src/shared/api.constants.ts
4552
4534
  var SEARCH_API_URL = "https://ydc-index.io/v1/search";
4553
4535
  var EXPRESS_API_URL = "https://api.you.com/v1/agents/runs";
4554
4536
  var CONTENTS_API_URL = "https://ydc-index.io/v1/contents";
4555
4537
 
4556
- // ../../node_modules/.bun/@youdotcom-oss+api@0.0.1/node_modules/@youdotcom-oss/api/src/shared/check-response-for-errors.ts
4538
+ // ../api/src/shared/check-response-for-errors.ts
4557
4539
  var checkResponseForErrors = (responseData) => {
4558
4540
  if (typeof responseData === "object" && responseData !== null && "error" in responseData) {
4559
4541
  const errorMessage = typeof responseData.error === "string" ? responseData.error : JSON.stringify(responseData.error);
@@ -4562,7 +4544,7 @@ var checkResponseForErrors = (responseData) => {
4562
4544
  return responseData;
4563
4545
  };
4564
4546
 
4565
- // ../../node_modules/.bun/@youdotcom-oss+api@0.0.1/node_modules/@youdotcom-oss/api/src/contents/contents.utils.ts
4547
+ // ../api/src/contents/contents.utils.ts
4566
4548
  var fetchContents = async ({
4567
4549
  contentsQuery: { urls, formats, format, crawl_timeout },
4568
4550
  YDC_API_KEY = process.env.YDC_API_KEY,
@@ -4617,7 +4599,7 @@ var fetchContents = async ({
4617
4599
  const parsedResults = ContentsApiResponseSchema.parse(results);
4618
4600
  return parsedResults;
4619
4601
  };
4620
- // ../../node_modules/.bun/@youdotcom-oss+api@0.0.1/node_modules/@youdotcom-oss/api/src/express/express.schemas.ts
4602
+ // ../api/src/express/express.schemas.ts
4621
4603
  var ExpressAgentInputSchema = object({
4622
4604
  input: string2().min(1, "Input is required").describe("Query or prompt"),
4623
4605
  tools: array(object({
@@ -4625,13 +4607,13 @@ var ExpressAgentInputSchema = object({
4625
4607
  })).optional().describe("Tools (web search only)")
4626
4608
  });
4627
4609
  var ApiSearchResultItemSchema = object({
4628
- source_type: string2().optional(),
4610
+ source_type: string2().nullable().optional(),
4629
4611
  citation_uri: string2().optional(),
4630
4612
  url: string2(),
4631
4613
  title: string2(),
4632
4614
  snippet: string2(),
4633
- thumbnail_url: string2().optional(),
4634
- provider: any().optional()
4615
+ thumbnail_url: string2().nullable().optional(),
4616
+ provider: string2().nullable().optional()
4635
4617
  });
4636
4618
  var ExpressAgentApiOutputItemSchema = union([
4637
4619
  object({
@@ -4647,7 +4629,10 @@ var ExpressAgentApiResponseSchema = object({
4647
4629
  output: array(ExpressAgentApiOutputItemSchema),
4648
4630
  agent: string2().optional().describe("Agent identifier"),
4649
4631
  mode: string2().optional().describe("Agent mode"),
4650
- input: array(any()).optional().describe("Input messages")
4632
+ input: array(object({
4633
+ role: _enum(["user"]).describe("User role"),
4634
+ content: string2().describe("User question")
4635
+ })).optional().describe("Input messages")
4651
4636
  }).passthrough();
4652
4637
  var McpSearchResultItemSchema = object({
4653
4638
  url: string2().describe("URL"),
@@ -4661,7 +4646,7 @@ var ExpressAgentMcpResponseSchema = object({
4661
4646
  }).optional().describe("Search results"),
4662
4647
  agent: string2().optional().describe("Agent ID")
4663
4648
  });
4664
- // ../../node_modules/.bun/@youdotcom-oss+api@0.0.1/node_modules/@youdotcom-oss/api/src/express/express.utils.ts
4649
+ // ../api/src/express/express.utils.ts
4665
4650
  var agentThrowOnFailedStatus = async (response) => {
4666
4651
  const errorCode = response.status;
4667
4652
  const errorData = await response.json();
@@ -4727,7 +4712,7 @@ var callExpressAgent = async ({
4727
4712
  }
4728
4713
  return mcpResponse;
4729
4714
  };
4730
- // ../../node_modules/.bun/@youdotcom-oss+api@0.0.1/node_modules/@youdotcom-oss/api/src/search/search.schemas.ts
4715
+ // ../api/src/search/search.schemas.ts
4731
4716
  var SearchQuerySchema = object({
4732
4717
  query: string2().min(1, "Query is required").describe("Search query (supports +, -, site:, filetype:, lang:)"),
4733
4718
  count: number2().int().min(1).max(100).optional().describe("Max results per section"),
@@ -4817,7 +4802,7 @@ var SearchResponseSchema = object({
4817
4802
  }),
4818
4803
  metadata: MetadataSchema.partial()
4819
4804
  });
4820
- // ../../node_modules/.bun/@youdotcom-oss+api@0.0.1/node_modules/@youdotcom-oss/api/src/search/search.utils.ts
4805
+ // ../api/src/search/search.utils.ts
4821
4806
  var fetchSearchResults = async ({
4822
4807
  YDC_API_KEY = process.env.YDC_API_KEY,
4823
4808
  searchQuery: { query, site, fileType, language, exactTerms, excludeTerms, ...rest },
@@ -4867,7 +4852,7 @@ import { tool } from "ai";
4867
4852
  // package.json
4868
4853
  var package_default = {
4869
4854
  name: "@youdotcom-oss/ai-sdk-plugin",
4870
- version: "1.0.2",
4855
+ version: "1.0.3",
4871
4856
  description: "Vercel AI SDK plugin for You.com web search, AI agents, and content extraction via MCP",
4872
4857
  license: "MIT",
4873
4858
  engines: {
@@ -4929,7 +4914,7 @@ var package_default = {
4929
4914
  },
4930
4915
  types: "./dist/main.d.ts",
4931
4916
  dependencies: {
4932
- "@youdotcom-oss/api": "0.0.1"
4917
+ "@youdotcom-oss/api": "0.1.1"
4933
4918
  },
4934
4919
  peerDependencies: {
4935
4920
  ai: "^6.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youdotcom-oss/ai-sdk-plugin",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
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.0.1"
65
+ "@youdotcom-oss/api": "0.1.1"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "ai": "^6.0.0"