refactor: update web search tool integration tests and improve code formatting

- Changed test query from 'OpenAI GPT' to 'Buster Data' with an increased limit of 10.
- Reorganized import statements in web-search-tool.ts for better readability.
- Enhanced formatting in permission-validator.test.ts for improved code clarity.
This commit is contained in:
dal 2025-07-23 13:12:56 -06:00
parent 341b97f351
commit 9e67fbfaae
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
4 changed files with 11 additions and 11 deletions

View File

@ -13,8 +13,8 @@ describe('webSearch tool integration', () => {
async () => {
const result = await webSearch.execute({
context: {
query: 'OpenAI GPT',
limit: 3,
query: 'Buster Data',
limit: 10,
scrapeContent: true,
formats: ['markdown'],
},

View File

@ -1,12 +1,12 @@
import { createTool } from '@mastra/core/tools';
import type { RuntimeContext } from '@mastra/core/runtime-context';
import { wrapTraced } from 'braintrust';
import { z } from 'zod';
import {
FirecrawlService,
type WebSearchOptions,
type WebSearchResult,
} from '@buster-tools/web-tools';
import type { RuntimeContext } from '@mastra/core/runtime-context';
import { createTool } from '@mastra/core/tools';
import { wrapTraced } from 'braintrust';
import { z } from 'zod';
const inputSchema = z.object({
query: z.string().min(1, 'Search query is required').describe('The search query to execute'),

View File

@ -51,7 +51,10 @@ describe('Permission Validator', () => {
},
] as any);
const result = await validateSqlPermissions('SELECT id, user_id FROM public.orders', 'user123');
const result = await validateSqlPermissions(
'SELECT id, user_id FROM public.orders',
'user123'
);
expect(result).toEqual({
isAuthorized: false,

View File

@ -196,10 +196,7 @@ export class FirecrawlService {
/**
* Search the web using Firecrawl's search endpoint
*/
async webSearch(
query: string,
options?: WebSearchOptions
): Promise<WebSearchResponse> {
async webSearch(query: string, options?: WebSearchOptions): Promise<WebSearchResponse> {
try {
const searchOptions = {
limit: options?.limit || 5,