From fb4c0f91f39bd26bd14f201680e27d1b6db1b259 Mon Sep 17 00:00:00 2001 From: Akihiko Kuroda Date: Fri, 25 Oct 2024 11:26:28 -0400 Subject: [PATCH] feat: restructure directories Signed-off-by: Akihiko Kuroda --- package.json | 2 +- tools/airtable/airtableTool.ts | 2 +- tools/airtable/examples/airTableToolAgent.ts | 5 ++--- tools/openLibrary/examples/manyToolsAgent.ts | 9 +++------ tools/src/tsconfig.json | 13 ------------- tools/tsconfig.json | 13 ------------- tsconfig.json | 3 ++- 7 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 tools/src/tsconfig.json delete mode 100644 tools/tsconfig.json diff --git a/package.json b/package.json index 6ced04a..bf4ff30 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "clean": "rimraf dist", "build": "yarn clean && yarn ts:check && tsup", "ts:check": "tsc --noEmit && tsc -p tsconfig.examples.json --noEmit", - "start": "tsx --tsconfig tsconfig.examples.json", + "start": "tsx", "lint": "yarn eslint", "lint:fix": "yarn eslint --fix", "format": "yarn prettier --check .", diff --git a/tools/airtable/airtableTool.ts b/tools/airtable/airtableTool.ts index 2c8dfe4..48eca72 100644 --- a/tools/airtable/airtableTool.ts +++ b/tools/airtable/airtableTool.ts @@ -15,7 +15,7 @@ */ import { describe, test } from "vitest"; -import { AirtableTool, AirtableToolOptions } from "@/tools/airtable.js"; +import { AirtableTool, AirtableToolOptions } from "@tools/airtable/airtable.js"; import { setupServer } from "msw/node"; diff --git a/tools/airtable/examples/airTableToolAgent.ts b/tools/airtable/examples/airTableToolAgent.ts index 6f8a8ff..9d74112 100644 --- a/tools/airtable/examples/airTableToolAgent.ts +++ b/tools/airtable/examples/airTableToolAgent.ts @@ -17,7 +17,7 @@ import "dotenv/config.js"; import { BAMChatLLM } from "bee-agent-framework/adapters/bam/chat"; import { BeeAgent } from "bee-agent-framework/agents/bee/agent"; -import { createConsoleReader } from "@/helpers/io.js"; +import { createConsoleReader } from "@tools/examples/helpers/io.js"; import { FrameworkError } from "bee-agent-framework/errors"; import { TokenMemory } from "bee-agent-framework/memory/tokenMemory"; import { Logger } from "bee-agent-framework/logger/logger"; @@ -39,8 +39,7 @@ import { DuckDuckGoSearchTool } from "bee-agent-framework/tools/search/duckDuckG import { WikipediaTool } from "bee-agent-framework/tools/search/wikipedia"; // AirTable tool -// import { AirtableTool } from "bee-community-tools/tools/airtable"; -import { AirtableTool } from "bee-community-tools/tools/airtable/airtableTool"; +import { AirtableTool } from "@tools/airtable/airtable.js"; const AIRTABLE_TOKEN: string = parseEnv("AIRTABLE_TOKEN", z.string()); const AIRTABLE_BASE: string = parseEnv("AIRTABLE_BASE", z.string()); diff --git a/tools/openLibrary/examples/manyToolsAgent.ts b/tools/openLibrary/examples/manyToolsAgent.ts index f6548a6..ff60b4e 100644 --- a/tools/openLibrary/examples/manyToolsAgent.ts +++ b/tools/openLibrary/examples/manyToolsAgent.ts @@ -17,7 +17,7 @@ import "dotenv/config.js"; import { BAMChatLLM } from "bee-agent-framework/adapters/bam/chat"; import { BeeAgent } from "bee-agent-framework/agents/bee/agent"; -import { createConsoleReader } from "@/helpers/io.js"; +import { createConsoleReader } from "@helpers/io.js"; import { FrameworkError } from "bee-agent-framework/errors"; import { TokenMemory } from "bee-agent-framework/memory/tokenMemory"; import { Logger } from "bee-agent-framework/logger/logger"; @@ -36,13 +36,10 @@ import { // core tools import { DuckDuckGoSearchTool } from "bee-agent-framework/tools/search/duckDuckGoSearch"; import { WikipediaTool } from "bee-agent-framework/tools/search/wikipedia"; -// import { OpenMeteoTool } from "bee-agent-framework/tools/weather/openMeteo"; -// import { ArXivTool } from "bee-agent-framework/tools/arxiv"; // contrib tools -// import { HelloWorldTool } from "@/tools/helloWorld.js"; -import { OpenLibraryTool } from "bee-community-tools/tools/openLibrary"; -import { ImageDescriptionTool } from "bee-community-tools/tools/imageDescription"; +import { OpenLibraryTool } from "@tools/openLibrary/openLibrary.js"; +import { ImageDescriptionTool } from "@tools/imageDescriptions/imageDescription.js"; Logger.root.level = "silent"; // disable internal logs const logger = new Logger({ name: "app", level: "trace" }); diff --git a/tools/src/tsconfig.json b/tools/src/tsconfig.json deleted file mode 100644 index acd3201..0000000 --- a/tools/src/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "baseUrl": "..", - "rootDir": "..", - "paths": { - "bee-community-tools/*": ["./src/*.js"], - "@/*": ["../../*"] - } - }, - "references": [{ "path": "./src" }], - "exclude": ["../tests", "../**/*.test.ts"] -} diff --git a/tools/tsconfig.json b/tools/tsconfig.json deleted file mode 100644 index aa18c00..0000000 --- a/tools/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "baseUrl": "..", - "rootDir": "..", - "paths": { - "bee-combmunity-tools/*": ["./tools/*"], - "@/*": ["./tools/examples/*"] - } - }, - "references": [{ "path": "./src" }], - "exclude": ["../tests", "../**/*.test.ts"] -} diff --git a/tsconfig.json b/tsconfig.json index 96ac38f..ca03186 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,7 +27,8 @@ "paths": { "@/*": ["./src/*"], "@tests/*": ["./tests/*"], - "@tools/*": ["./tools/*"] + "@tools/*": ["./tools/*"], + "@helpers/*": ["./tools/examples/helpers/*"] }, "useUnknownInCatchVariables": false },