diff --git a/.env.template b/.env.template index 600d7ae8..2a8d1253 100644 --- a/.env.template +++ b/.env.template @@ -13,4 +13,8 @@ BEE_FRAMEWORK_LOG_SINGLE_LINE="false" # GROQ_API_KEY= # Tools -CODE_INTERPRETER_URL=http://127.0.0.1:50051 \ No newline at end of file +CODE_INTERPRETER_URL=http://127.0.0.1:50051 + +# For Google Search Tool +# GOOGLE_API_KEY=your-google-api-key +# GOOGLE_CSE_ID=your-custom-search-engine-id \ No newline at end of file diff --git a/README.md b/README.md index 1f0d2ae6..9d4b6ef5 100644 --- a/README.md +++ b/README.md @@ -95,20 +95,21 @@ To run this example, be sure that you have installed [ollama](https://ollama.com ### 🛠️ Tools -| Name | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -| `PythonTool` | Run arbitrary Python code in the remote environment. | -| `WikipediaTool` | Search for data on Wikipedia. | -| `DuckDuckGoTool` | Search for data on DuckDuckGo. | -| `SQLTool` | Executing SQL queries against various databases. [Instructions](./docs/sql-tool.md). | -| `CustomTool` | Runs your own Python function in the remote environment. | -| `LLMTool` | Uses an LLM to process input data. | -| `DynamicTool` | Construct to create dynamic tools. | -| `ArXivTool` | Retrieves research articles published on arXiv. | -| `WebCrawlerTool` | Retrieves content of an arbitrary website. | -| `CustomTool` | Runs your own Python function in the remote environment. | -| `OpenMeteoTool` | Retrieves current, previous, or upcoming weather for a given destination. | -| ➕ [Request](https://github.com/i-am-bee/bee-agent-framework/discussions) | | +| Name | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `PythonTool` | Run arbitrary Python code in the remote environment. | +| `WikipediaTool` | Search for data on Wikipedia. | +| `GoogleSearchTool` | Search for data on Google using Custom Search Engine. | +| `DuckDuckGoTool` | Search for data on DuckDuckGo. | +| `SQLTool` | Execute SQL queries against relational databases. [Instructions](./docs/sql-tool.md). | +| `CustomTool` | Run your own Python function in the remote environment. | +| `LLMTool` | Use an LLM to process input data. | +| `DynamicTool` | Construct to create dynamic tools. | +| `ArXivTool` | Retrieve research articles published on arXiv. | +| `WebCrawlerTool` | Retrieve content of an arbitrary website. | +| `CustomTool` | Run your own Python function in the remote environment. | +| `OpenMeteoTool` | Retrieve current, previous, or upcoming weather for a given destination. | +| ➕ [Request](https://github.com/i-am-bee/bee-agent-framework/discussions) | | ### 🔌️ Adapters (LLM - Inference providers) diff --git a/package.json b/package.json index 1f591c55..49f9777e 100644 --- a/package.json +++ b/package.json @@ -114,6 +114,7 @@ "zod-to-json-schema": "^3.23.3" }, "peerDependencies": { + "@googleapis/customsearch": "^3.2.0", "@ibm-generative-ai/node-sdk": "~3.2.3", "@langchain/community": "~0.2.28", "@langchain/core": "~0.2.27", @@ -129,6 +130,7 @@ "@commitlint/config-conventional": "^19.4.1", "@eslint/js": "^9.9.0", "@eslint/markdown": "^6.0.0", + "@googleapis/customsearch": "^3.2.0", "@ibm-generative-ai/node-sdk": "~3.2.3", "@langchain/community": "~0.2.28", "@langchain/core": "~0.2.27", diff --git a/src/tools/search/googleCustomSearch.test.ts b/src/tools/search/googleCustomSearch.test.ts new file mode 100644 index 00000000..8f37096a --- /dev/null +++ b/src/tools/search/googleCustomSearch.test.ts @@ -0,0 +1,184 @@ +/** + * Copyright 2024 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GoogleSearchTool, GoogleSearchToolOutput } from "@/tools/search/googleCustomSearch.js"; +import { vi, describe, it, expect, beforeEach } from "vitest"; +import { SlidingCache } from "@/cache/slidingCache.js"; +import { verifyDeserialization } from "@tests/e2e/utils.js"; +import { Task } from "promise-based-task"; + +vi.mock("@googleapis/customsearch"); + +describe("GoogleCustomSearch Tool", () => { + let googleSearchTool: GoogleSearchTool; + const mockCustomSearchClient = { + cse: { + list: vi.fn(), + }, + }; + + beforeEach(() => { + vi.clearAllMocks(); + googleSearchTool = new GoogleSearchTool({ + apiKey: "test-api-key", + cseId: "test-cse-id", + maxResultsPerPage: 10, + }); + + Object.defineProperty(googleSearchTool, "client", { + get: () => mockCustomSearchClient, + }); + }); + + const generateResults = (count: number) => { + return { + data: { + items: Array(count) + .fill(null) + .map((_, i) => ({ + title: `Result ${i + 1}`, + snippet: `Description for result ${i + 1}`, + link: `https://example.com/${i + 1}`, + })), + }, + }; + }; + + it("is a valid tool", () => { + expect(googleSearchTool).toBeDefined(); + expect(googleSearchTool.name).toBe("GoogleCustomSearch"); + expect(googleSearchTool.description).toBeDefined(); + }); + + it("retrieves data with the correct number of results", async () => { + const query = "IBM Research"; + const mockResults = generateResults(3); + + mockCustomSearchClient.cse.list.mockResolvedValueOnce(mockResults); + + const response = await googleSearchTool.run({ query }); + + expect(response).toBeInstanceOf(GoogleSearchToolOutput); + expect(response.results.length).toBe(3); + expect(mockCustomSearchClient.cse.list).toHaveBeenCalledWith( + { + cx: "test-cse-id", + q: query, + num: 10, + start: 1, + safe: "active", + }, + { + signal: undefined, + }, + ); + }); + + it("validates maxResultsPerPage range", () => { + expect( + () => + new GoogleSearchTool({ + apiKey: "test-api-key", + cseId: "test-cse-id", + maxResultsPerPage: 0, + }), + ).toThrowError("validation failed"); + expect( + () => + new GoogleSearchTool({ + apiKey: "test-api-key", + cseId: "test-cse-id", + maxResultsPerPage: 11, + }), + ).toThrowError("validation failed"); + }); + + it("paginates correctly", async () => { + const query = "paginated search"; + const mockFirstPageResults = generateResults(10); + const mockSecondPageResults = generateResults(10); + + mockCustomSearchClient.cse.list + .mockResolvedValueOnce(mockFirstPageResults) + .mockResolvedValueOnce(mockSecondPageResults); + + const responsePage1 = await googleSearchTool.run({ query }); + const responsePage2 = await googleSearchTool.run({ query, page: 2 }); + + const combinedResults = [...responsePage1.results, ...responsePage2.results]; + + expect(combinedResults.length).toBe(20); + + expect(mockCustomSearchClient.cse.list).toHaveBeenCalledTimes(2); + expect(mockCustomSearchClient.cse.list).toHaveBeenNthCalledWith( + 1, + { + cx: "test-cse-id", + q: query, + num: 10, + start: 1, + safe: "active", + }, + { + signal: undefined, + }, + ); + expect(mockCustomSearchClient.cse.list).toHaveBeenNthCalledWith( + 2, + { + cx: "test-cse-id", + q: query, + num: 10, + start: 11, + safe: "active", + }, + { + signal: undefined, + }, + ); + }); + + it("Serializes", async () => { + const tool = new GoogleSearchTool({ + apiKey: "test-api-key", + cseId: "test-cse-id", + maxResultsPerPage: 1, + cache: new SlidingCache({ + size: 10, + ttl: 1000, + }), + }); + + await tool.cache!.set( + "A", + Task.resolve( + new GoogleSearchToolOutput([ + { + title: "A", + url: "http://example.com", + description: "A", + }, + ]), + ), + ); + + await tool.cache!.set("B", Task.resolve(new GoogleSearchToolOutput([]))); + const serialized = tool.serialize(); + const deserialized = GoogleSearchTool.fromSerialized(serialized); + expect(await tool.cache.get("A")).toStrictEqual(await deserialized.cache.get("A")); + verifyDeserialization(tool, deserialized); + }); +}); diff --git a/src/tools/search/googleCustomSearch.ts b/src/tools/search/googleCustomSearch.ts new file mode 100644 index 00000000..3901ee4b --- /dev/null +++ b/src/tools/search/googleCustomSearch.ts @@ -0,0 +1,171 @@ +/** + * Copyright 2024 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { customsearch_v1 as GoogleSearchAPI } from "@googleapis/customsearch"; +import { + SearchToolOptions, + SearchToolOutput, + SearchToolResult, + SearchToolRunOptions, +} from "./base.js"; +import { Tool, ToolInput } from "@/tools/base.js"; +import { z } from "zod"; +import { Cache } from "@/cache/decoratorCache.js"; +import { ValueError } from "@/errors.js"; +import { ValidationError } from "ajv"; +import { parseEnv } from "@/internals/env.js"; + +export interface GoogleSearchToolOptions extends SearchToolOptions { + apiKey?: string; + cseId?: string; + maxResultsPerPage: number; +} + +type GoogleSearchToolRunOptions = SearchToolRunOptions; + +export interface GoogleSearchToolResult extends SearchToolResult {} + +export class GoogleSearchToolOutput extends SearchToolOutput { + constructor(public readonly results: GoogleSearchToolResult[]) { + super(results); + } + + static { + this.register(); + } + + createSnapshot() { + return { + results: this.results, + }; + } + + loadSnapshot(snapshot: ReturnType) { + Object.assign(this, snapshot); + } +} + +export class GoogleSearchTool extends Tool< + GoogleSearchToolOutput, + GoogleSearchToolOptions, + GoogleSearchToolRunOptions +> { + name = "GoogleCustomSearch"; + description = `Search a query using Google Custom Search Engine. + Useful for when you need to answer questions or find relevant content on all or specific websites. + Output is a list of relevant websites with descriptions.`; + + @Cache() + inputSchema() { + return z.object({ + query: z.string({ description: `Search query` }).min(1).max(2048), + page: z + .number() + .int() + .min(1) + .max(10) + .describe( + `Search result page (each page contains maximally ${this.options.maxResultsPerPage} results)`, + ) + .default(1) + .optional(), + }); + } + + protected apiKey: string; + protected cseId: string; + + public constructor(options: GoogleSearchToolOptions = { maxResultsPerPage: 10 }) { + super(options); + + this.apiKey = options.apiKey || parseEnv("GOOGLE_API_KEY", z.string()); + this.cseId = options.cseId || parseEnv("GOOGLE_CSE_ID", z.string()); + + if (!this.apiKey || !this.cseId) { + throw new ValueError( + [ + `"apiKey" or "cseId" must both be provided.`, + `Either set them directly or put them in ENV ("WATSONX_ACCESS_TOKEN" / "WATSONX_API_KEY")`, + ].join("\n"), + ); + } + + if (options.maxResultsPerPage < 1 || options.maxResultsPerPage > 10) { + throw new ValidationError([ + { + message: "Property range must be between 1 and 10", + propertyName: "options.maxResultsPerPage", + }, + ]); + } + } + + @Cache() + protected get client(): GoogleSearchAPI.Customsearch { + return new GoogleSearchAPI.Customsearch({ + auth: this.apiKey, + }); + } + + static { + this.register(); + } + + protected async _run( + { query: input, page = 1 }: ToolInput, + options?: GoogleSearchToolRunOptions, + ) { + const startIndex = (page - 1) * this.options.maxResultsPerPage + 1; + const response = await this.client.cse.list( + { + cx: this.cseId, + q: input, + num: this.options.maxResultsPerPage, + start: startIndex, + safe: "active", + }, + { + signal: options?.signal, + }, + ); + + const results = response.data.items || []; + + return new GoogleSearchToolOutput( + results.map((result) => ({ + title: result.title || "", + description: result.snippet || "", + url: result.link || "", + })), + ); + } + + createSnapshot() { + return { + ...super.createSnapshot(), + apiKey: this.apiKey, + cseId: this.cseId, + }; + } + + loadSnapshot({ apiKey, cseId, ...snapshot }: ReturnType) { + super.loadSnapshot(snapshot); + Object.assign(this, { + apiKey, + cseId, + }); + } +} diff --git a/tests/e2e/utils.ts b/tests/e2e/utils.ts index f72521f1..c3985dd7 100644 --- a/tests/e2e/utils.ts +++ b/tests/e2e/utils.ts @@ -29,6 +29,7 @@ import { Emitter } from "@/emitter/emitter.js"; import { toJsonSchema } from "@/internals/helpers/schema.js"; import { OpenAI } from "openai"; import { Groq } from "groq-sdk"; +import { customsearch_v1 } from "@googleapis/customsearch"; interface CallbackOptions { required?: boolean; @@ -110,6 +111,7 @@ export function verifyDeserialization(ref: unknown, deserialized: unknown, paren verifyDeserialization.ignoredClasses = [ Logger, Client, + customsearch_v1.Customsearch, LCBaseLLM, RunContext, Emitter, diff --git a/yarn.lock b/yarn.lock index cb29915d..5fcbb358 100644 --- a/yarn.lock +++ b/yarn.lock @@ -709,6 +709,15 @@ __metadata: languageName: node linkType: hard +"@googleapis/customsearch@npm:^3.2.0": + version: 3.2.0 + resolution: "@googleapis/customsearch@npm:3.2.0" + dependencies: + googleapis-common: "npm:^7.0.0" + checksum: 10c0/2e36586e39388ace8f1aab449c4215fbc3800fccb8678f425ec56b3abc237a449479df976de3b1c4a913fb436e1c0579e03c5a61276156a875322f26d5f1ccc9 + languageName: node + linkType: hard + "@humanwhocodes/module-importer@npm:^1.0.1": version: 1.0.1 resolution: "@humanwhocodes/module-importer@npm:1.0.1" @@ -1584,114 +1593,114 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.22.4" +"@rollup/rollup-android-arm-eabi@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.21.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-android-arm64@npm:4.22.4" +"@rollup/rollup-android-arm64@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-android-arm64@npm:4.21.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-darwin-arm64@npm:4.22.4" +"@rollup/rollup-darwin-arm64@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.21.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-darwin-x64@npm:4.22.4" +"@rollup/rollup-darwin-x64@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.21.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.22.4" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.21.0" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.22.4" +"@rollup/rollup-linux-arm-musleabihf@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.21.0" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.22.4" +"@rollup/rollup-linux-arm64-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.21.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.22.4" +"@rollup/rollup-linux-arm64-musl@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.21.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.22.4" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.21.0" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.22.4" +"@rollup/rollup-linux-riscv64-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.21.0" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.22.4" +"@rollup/rollup-linux-s390x-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.21.0" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.22.4" +"@rollup/rollup-linux-x64-gnu@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.21.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.22.4" +"@rollup/rollup-linux-x64-musl@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.21.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.22.4" +"@rollup/rollup-win32-arm64-msvc@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.21.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.22.4" +"@rollup/rollup-win32-ia32-msvc@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.21.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.22.4": - version: 4.22.4 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.22.4" +"@rollup/rollup-win32-x64-msvc@npm:4.21.0": + version: 4.21.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.21.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -2598,7 +2607,7 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": +"base64-js@npm:^1.3.0, base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 10c0/f23823513b63173a001030fae4f2dabe283b99a9d324ade3ad3d148e218134676f1ee8568c877cd79ec1c53158dcf2d2ba527a97c606618928ba99dd930102bf @@ -2623,6 +2632,7 @@ __metadata: "@connectrpc/connect-node": "npm:^1.4.0" "@eslint/js": "npm:^9.9.0" "@eslint/markdown": "npm:^6.0.0" + "@googleapis/customsearch": "npm:^3.2.0" "@ibm-generative-ai/node-sdk": "npm:~3.2.3" "@langchain/community": "npm:~0.2.28" "@langchain/core": "npm:~0.2.27" @@ -2699,6 +2709,7 @@ __metadata: zod: "npm:^3.23.8" zod-to-json-schema: "npm:^3.23.3" peerDependencies: + "@googleapis/customsearch": ^3.2.0 "@ibm-generative-ai/node-sdk": ~3.2.3 "@langchain/community": ~0.2.28 "@langchain/core": ~0.2.27 @@ -2728,6 +2739,13 @@ __metadata: languageName: node linkType: hard +"bignumber.js@npm:^9.0.0": + version: 9.1.2 + resolution: "bignumber.js@npm:9.1.2" + checksum: 10c0/e17786545433f3110b868725c449fa9625366a6e675cd70eb39b60938d6adbd0158cb4b3ad4f306ce817165d37e63f4aa3098ba4110db1d9a3b9f66abfbaf10d + languageName: node + linkType: hard + "binary-extensions@npm:^2.0.0, binary-extensions@npm:^2.2.0": version: 2.3.0 resolution: "binary-extensions@npm:2.3.0" @@ -2813,6 +2831,13 @@ __metadata: languageName: node linkType: hard +"buffer-equal-constant-time@npm:1.0.1": + version: 1.0.1 + resolution: "buffer-equal-constant-time@npm:1.0.1" + checksum: 10c0/fb2294e64d23c573d0dd1f1e7a466c3e978fe94a4e0f8183937912ca374619773bef8e2aceb854129d2efecbbc515bbd0cc78d2734a3e3031edb0888531bbc8e + languageName: node + linkType: hard + "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -2935,6 +2960,19 @@ __metadata: languageName: node linkType: hard +"call-bind@npm:^1.0.7": + version: 1.0.7 + resolution: "call-bind@npm:1.0.7" + dependencies: + es-define-property: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + get-intrinsic: "npm:^1.2.4" + set-function-length: "npm:^1.2.1" + checksum: 10c0/a3ded2e423b8e2a265983dba81c27e125b48eefb2655e7dfab6be597088da3d47c47976c24bc51b8fd9af1061f8f87b4ab78a314f3c77784b2ae2ba535ad8b8d + languageName: node + linkType: hard + "callsites@npm:^3.0.0, callsites@npm:^3.1.0": version: 3.1.0 resolution: "callsites@npm:3.1.0" @@ -3699,6 +3737,17 @@ __metadata: languageName: node linkType: hard +"define-data-property@npm:^1.1.4": + version: 1.1.4 + resolution: "define-data-property@npm:1.1.4" + dependencies: + es-define-property: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + gopd: "npm:^1.0.1" + checksum: 10c0/dea0606d1483eb9db8d930d4eac62ca0fa16738b0b3e07046cddfacf7d8c868bbe13fa0cb263eb91c7d0d527960dc3f2f2471a69ed7816210307f6744fe62e37 + languageName: node + linkType: hard + "define-lazy-prop@npm:^3.0.0": version: 3.0.0 resolution: "define-lazy-prop@npm:3.0.0" @@ -3830,6 +3879,15 @@ __metadata: languageName: node linkType: hard +"ecdsa-sig-formatter@npm:1.0.11, ecdsa-sig-formatter@npm:^1.0.11": + version: 1.0.11 + resolution: "ecdsa-sig-formatter@npm:1.0.11" + dependencies: + safe-buffer: "npm:^5.0.1" + checksum: 10c0/ebfbf19d4b8be938f4dd4a83b8788385da353d63307ede301a9252f9f7f88672e76f2191618fd8edfc2f24679236064176fab0b78131b161ee73daa37125408c + languageName: node + linkType: hard + "electron-to-chromium@npm:^1.5.4": version: 1.5.13 resolution: "electron-to-chromium@npm:1.5.13" @@ -3906,6 +3964,22 @@ __metadata: languageName: node linkType: hard +"es-define-property@npm:^1.0.0": + version: 1.0.0 + resolution: "es-define-property@npm:1.0.0" + dependencies: + get-intrinsic: "npm:^1.2.4" + checksum: 10c0/6bf3191feb7ea2ebda48b577f69bdfac7a2b3c9bcf97307f55fd6ef1bbca0b49f0c219a935aca506c993d8c5d8bddd937766cb760cd5e5a1071351f2df9f9aa4 + languageName: node + linkType: hard + +"es-errors@npm:^1.3.0": + version: 1.3.0 + resolution: "es-errors@npm:1.3.0" + checksum: 10c0/0a61325670072f98d8ae3b914edab3559b6caa980f08054a3b872052640d91da01d38df55df797fcc916389d77fc92b8d5906cf028f4db46d7e3003abecbca85 + languageName: node + linkType: hard + "esbuild@npm:^0.21.3": version: 0.21.5 resolution: "esbuild@npm:0.21.5" @@ -4378,6 +4452,13 @@ __metadata: languageName: node linkType: hard +"extend@npm:^3.0.2": + version: 3.0.2 + resolution: "extend@npm:3.0.2" + checksum: 10c0/73bf6e27406e80aa3e85b0d1c4fd987261e628064e170ca781125c0b635a3dabad5e05adbf07595ea0cf1e6c5396cacb214af933da7cbaf24fe75ff14818e8f9 + languageName: node + linkType: hard + "external-editor@npm:^3.1.0": version: 3.1.0 resolution: "external-editor@npm:3.1.0" @@ -4726,6 +4807,29 @@ __metadata: languageName: node linkType: hard +"gaxios@npm:^6.0.0, gaxios@npm:^6.0.3, gaxios@npm:^6.1.1": + version: 6.7.1 + resolution: "gaxios@npm:6.7.1" + dependencies: + extend: "npm:^3.0.2" + https-proxy-agent: "npm:^7.0.1" + is-stream: "npm:^2.0.0" + node-fetch: "npm:^2.6.9" + uuid: "npm:^9.0.1" + checksum: 10c0/53e92088470661c5bc493a1de29d05aff58b1f0009ec5e7903f730f892c3642a93e264e61904383741ccbab1ce6e519f12a985bba91e13527678b32ee6d7d3fd + languageName: node + linkType: hard + +"gcp-metadata@npm:^6.1.0": + version: 6.1.0 + resolution: "gcp-metadata@npm:6.1.0" + dependencies: + gaxios: "npm:^6.0.0" + json-bigint: "npm:^1.0.0" + checksum: 10c0/0f84f8c0b974e79d0da0f3063023486e53d7982ce86c4b5871e4ee3b1fc4e7f76fcc05f6342aa0ded5023f1a499c21ab97743a498b31f3aa299905226d1f66ab + languageName: node + linkType: hard + "generative-bayesian-network@npm:^2.1.54": version: 2.1.54 resolution: "generative-bayesian-network@npm:2.1.54" @@ -4757,6 +4861,19 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.4": + version: 1.2.4 + resolution: "get-intrinsic@npm:1.2.4" + dependencies: + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + has-proto: "npm:^1.0.1" + has-symbols: "npm:^1.0.3" + hasown: "npm:^2.0.0" + checksum: 10c0/0a9b82c16696ed6da5e39b1267104475c47e3a9bdbe8b509dfe1710946e38a87be70d759f4bb3cda042d76a41ef47fe769660f3b7c0d1f68750299344ffb15b7 + languageName: node + linkType: hard + "get-stream@npm:^6.0.0, get-stream@npm:^6.0.1": version: 6.0.1 resolution: "get-stream@npm:6.0.1" @@ -4958,6 +5075,43 @@ __metadata: languageName: node linkType: hard +"google-auth-library@npm:^9.7.0": + version: 9.14.1 + resolution: "google-auth-library@npm:9.14.1" + dependencies: + base64-js: "npm:^1.3.0" + ecdsa-sig-formatter: "npm:^1.0.11" + gaxios: "npm:^6.1.1" + gcp-metadata: "npm:^6.1.0" + gtoken: "npm:^7.0.0" + jws: "npm:^4.0.0" + checksum: 10c0/050e16343d93768300a800bc69773d8c451c4e778b0e503fc9dcf72e40e9563c0877f7a79ed06dffad664b49fdd1183080c41f081034b86d54a6795475fb73d2 + languageName: node + linkType: hard + +"googleapis-common@npm:^7.0.0": + version: 7.2.0 + resolution: "googleapis-common@npm:7.2.0" + dependencies: + extend: "npm:^3.0.2" + gaxios: "npm:^6.0.3" + google-auth-library: "npm:^9.7.0" + qs: "npm:^6.7.0" + url-template: "npm:^2.0.8" + uuid: "npm:^9.0.0" + checksum: 10c0/cbbce900582a66c28bb8ccde631bc08202c6fb2e591932b981a23b437b074150051b966d3ad67bcb4b06b4ff5bbbfd8524ac5ca6f7b77b8790f417924bec1f3c + languageName: node + linkType: hard + +"gopd@npm:^1.0.1": + version: 1.0.1 + resolution: "gopd@npm:1.0.1" + dependencies: + get-intrinsic: "npm:^1.1.3" + checksum: 10c0/505c05487f7944c552cee72087bf1567debb470d4355b1335f2c262d218ebbff805cd3715448fe29b4b380bae6912561d0467233e4165830efd28da241418c63 + languageName: node + linkType: hard + "got@npm:13.0.0": version: 13.0.0 resolution: "got@npm:13.0.0" @@ -5013,6 +5167,16 @@ __metadata: languageName: node linkType: hard +"gtoken@npm:^7.0.0": + version: 7.1.0 + resolution: "gtoken@npm:7.1.0" + dependencies: + gaxios: "npm:^6.0.0" + jws: "npm:^4.0.0" + checksum: 10c0/0a3dcacb1a3c4578abe1ee01c7d0bf20bffe8ded3ee73fc58885d53c00f6eb43b4e1372ff179f0da3ed5cfebd5b7c6ab8ae2776f1787e90d943691b4fe57c716 + languageName: node + linkType: hard + "handlebars@npm:^4.7.7": version: 4.7.8 resolution: "handlebars@npm:4.7.8" @@ -5045,6 +5209,29 @@ __metadata: languageName: node linkType: hard +"has-property-descriptors@npm:^1.0.2": + version: 1.0.2 + resolution: "has-property-descriptors@npm:1.0.2" + dependencies: + es-define-property: "npm:^1.0.0" + checksum: 10c0/253c1f59e80bb476cf0dde8ff5284505d90c3bdb762983c3514d36414290475fe3fd6f574929d84de2a8eec00d35cf07cb6776205ff32efd7c50719125f00236 + languageName: node + linkType: hard + +"has-proto@npm:^1.0.1": + version: 1.0.3 + resolution: "has-proto@npm:1.0.3" + checksum: 10c0/35a6989f81e9f8022c2f4027f8b48a552de714938765d019dbea6bb547bd49ce5010a3c7c32ec6ddac6e48fc546166a3583b128f5a7add8b058a6d8b4afec205 + languageName: node + linkType: hard + +"has-symbols@npm:^1.0.3": + version: 1.0.3 + resolution: "has-symbols@npm:1.0.3" + checksum: 10c0/e6922b4345a3f37069cdfe8600febbca791c94988c01af3394d86ca3360b4b93928bbf395859158f88099cb10b19d98e3bbab7c9ff2c1bd09cf665ee90afa2c3 + languageName: node + linkType: hard + "has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -5052,7 +5239,7 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.2": +"hasown@npm:^2.0.0, hasown@npm:^2.0.2": version: 2.0.2 resolution: "hasown@npm:2.0.2" dependencies: @@ -5733,6 +5920,15 @@ __metadata: languageName: node linkType: hard +"json-bigint@npm:^1.0.0": + version: 1.0.0 + resolution: "json-bigint@npm:1.0.0" + dependencies: + bignumber.js: "npm:^9.0.0" + checksum: 10c0/e3f34e43be3284b573ea150a3890c92f06d54d8ded72894556357946aeed9877fd795f62f37fe16509af189fd314ab1104d0fd0f163746ad231b9f378f5b33f4 + languageName: node + linkType: hard + "json-buffer@npm:3.0.1": version: 3.0.1 resolution: "json-buffer@npm:3.0.1" @@ -5837,6 +6033,27 @@ __metadata: languageName: node linkType: hard +"jwa@npm:^2.0.0": + version: 2.0.0 + resolution: "jwa@npm:2.0.0" + dependencies: + buffer-equal-constant-time: "npm:1.0.1" + ecdsa-sig-formatter: "npm:1.0.11" + safe-buffer: "npm:^5.0.1" + checksum: 10c0/6baab823b93c038ba1d2a9e531984dcadbc04e9eb98d171f4901b7a40d2be15961a359335de1671d78cb6d987f07cbe5d350d8143255977a889160c4d90fcc3c + languageName: node + linkType: hard + +"jws@npm:^4.0.0": + version: 4.0.0 + resolution: "jws@npm:4.0.0" + dependencies: + jwa: "npm:^2.0.0" + safe-buffer: "npm:^5.0.1" + checksum: 10c0/f1ca77ea5451e8dc5ee219cb7053b8a4f1254a79cb22417a2e1043c1eb8a569ae118c68f24d72a589e8a3dd1824697f47d6bd4fb4bebb93a3bdf53545e721661 + languageName: node + linkType: hard + "keyv@npm:^4.5.3, keyv@npm:^4.5.4": version: 4.5.4 resolution: "keyv@npm:4.5.4" @@ -7355,7 +7572,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.12, node-fetch@npm:^2.6.7": +"node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.12, node-fetch@npm:^2.6.7, node-fetch@npm:^2.6.9": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" dependencies: @@ -7507,6 +7724,13 @@ __metadata: languageName: node linkType: hard +"object-inspect@npm:^1.13.1": + version: 1.13.2 + resolution: "object-inspect@npm:1.13.2" + checksum: 10c0/b97835b4c91ec37b5fd71add84f21c3f1047d1d155d00c0fcd6699516c256d4fcc6ff17a1aced873197fe447f91a3964178fd2a67a1ee2120cdaf60e81a050b4 + languageName: node + linkType: hard + "ollama@npm:^0.5.8": version: 0.5.8 resolution: "ollama@npm:0.5.8" @@ -8365,6 +8589,15 @@ __metadata: languageName: node linkType: hard +"qs@npm:^6.7.0": + version: 6.13.0 + resolution: "qs@npm:6.13.0" + dependencies: + side-channel: "npm:^1.0.6" + checksum: 10c0/62372cdeec24dc83a9fb240b7533c0fdcf0c5f7e0b83343edd7310f0ab4c8205a5e7c56406531f2e47e1b4878a3821d652be4192c841de5b032ca83619d8f860 + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -8747,25 +8980,25 @@ __metadata: linkType: hard "rollup@npm:^4.19.0, rollup@npm:^4.20.0": - version: 4.22.4 - resolution: "rollup@npm:4.22.4" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.22.4" - "@rollup/rollup-android-arm64": "npm:4.22.4" - "@rollup/rollup-darwin-arm64": "npm:4.22.4" - "@rollup/rollup-darwin-x64": "npm:4.22.4" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.22.4" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.22.4" - "@rollup/rollup-linux-arm64-gnu": "npm:4.22.4" - "@rollup/rollup-linux-arm64-musl": "npm:4.22.4" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.22.4" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.22.4" - "@rollup/rollup-linux-s390x-gnu": "npm:4.22.4" - "@rollup/rollup-linux-x64-gnu": "npm:4.22.4" - "@rollup/rollup-linux-x64-musl": "npm:4.22.4" - "@rollup/rollup-win32-arm64-msvc": "npm:4.22.4" - "@rollup/rollup-win32-ia32-msvc": "npm:4.22.4" - "@rollup/rollup-win32-x64-msvc": "npm:4.22.4" + version: 4.21.0 + resolution: "rollup@npm:4.21.0" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.21.0" + "@rollup/rollup-android-arm64": "npm:4.21.0" + "@rollup/rollup-darwin-arm64": "npm:4.21.0" + "@rollup/rollup-darwin-x64": "npm:4.21.0" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.21.0" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.21.0" + "@rollup/rollup-linux-arm64-gnu": "npm:4.21.0" + "@rollup/rollup-linux-arm64-musl": "npm:4.21.0" + "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.21.0" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.21.0" + "@rollup/rollup-linux-s390x-gnu": "npm:4.21.0" + "@rollup/rollup-linux-x64-gnu": "npm:4.21.0" + "@rollup/rollup-linux-x64-musl": "npm:4.21.0" + "@rollup/rollup-win32-arm64-msvc": "npm:4.21.0" + "@rollup/rollup-win32-ia32-msvc": "npm:4.21.0" + "@rollup/rollup-win32-x64-msvc": "npm:4.21.0" "@types/estree": "npm:1.0.5" fsevents: "npm:~2.3.2" dependenciesMeta: @@ -8805,7 +9038,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 10c0/4c96b6e2e0c5dbe73b4ba899cea894a05115ab8c65ccff631fbbb944e2b3a9f2eb3b99c2dce3dd91b179647df1892ffc44ecee29381ccf155ba8000b22712a32 + checksum: 10c0/984beb858da245c5e3a9027d6d87e67ad6443f1b46eab07685b861d9e49da5856693265c62a6f8262c36d11c9092713a96a9124f43e6de6698eb84d77118496a languageName: node linkType: hard @@ -8976,6 +9209,20 @@ __metadata: languageName: node linkType: hard +"set-function-length@npm:^1.2.1": + version: 1.2.2 + resolution: "set-function-length@npm:1.2.2" + dependencies: + define-data-property: "npm:^1.1.4" + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + get-intrinsic: "npm:^1.2.4" + gopd: "npm:^1.0.1" + has-property-descriptors: "npm:^1.0.2" + checksum: 10c0/82850e62f412a258b71e123d4ed3873fa9377c216809551192bb6769329340176f109c2eeae8c22a8d386c76739855f78e8716515c818bcaef384b51110f0f3c + languageName: node + linkType: hard + "shebang-command@npm:^2.0.0": version: 2.0.0 resolution: "shebang-command@npm:2.0.0" @@ -9005,6 +9252,18 @@ __metadata: languageName: node linkType: hard +"side-channel@npm:^1.0.6": + version: 1.0.6 + resolution: "side-channel@npm:1.0.6" + dependencies: + call-bind: "npm:^1.0.7" + es-errors: "npm:^1.3.0" + get-intrinsic: "npm:^1.2.4" + object-inspect: "npm:^1.13.1" + checksum: 10c0/d2afd163dc733cc0a39aa6f7e39bf0c436293510dbccbff446733daeaf295857dbccf94297092ec8c53e2503acac30f0b78830876f0485991d62a90e9cad305f + languageName: node + linkType: hard + "siginfo@npm:^2.0.0": version: 2.0.0 resolution: "siginfo@npm:2.0.0" @@ -10075,6 +10334,13 @@ __metadata: languageName: node linkType: hard +"url-template@npm:^2.0.8": + version: 2.0.8 + resolution: "url-template@npm:2.0.8" + checksum: 10c0/56a15057eacbcf05d52b0caed8279c8451b3dd9d32856a1fdd91c6dc84dcb1646f12bafc756b7ade62ca5b1564da8efd7baac5add35868bafb43eb024c62805b + languageName: node + linkType: hard + "utf8@npm:^3.0.0": version: 3.0.0 resolution: "utf8@npm:3.0.0" @@ -10107,7 +10373,7 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^9.0.0": +"uuid@npm:^9.0.0, uuid@npm:^9.0.1": version: 9.0.1 resolution: "uuid@npm:9.0.1" bin: