Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
},
"devDependencies": {
"@babel/preset-typescript": "^7.27.1",
"@types/babel__generator": "^7.27.0",
"@types/babel__traverse": "^7.28.0",
},
},
"runtime": {
Expand Down Expand Up @@ -417,6 +419,10 @@

"@ts-rest/open-api": ["@ts-rest/[email protected]", "", { "dependencies": { "@anatine/zod-openapi": "^1.12.0", "openapi3-ts": "^2.0.2" }, "peerDependencies": { "@ts-rest/core": "~3.52.0", "zod": "^3.22.3" } }, "sha512-VY91g6HFzCe1/fNgX4Y3HzaJbIdztCGHTg34drkh7bKgtNOizLJLXV0wwIkMwLGvjhRHojJxnwYxHjGMIkScwg=="],

"@types/babel__generator": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="],

"@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="],

"@types/body-parser": ["@types/[email protected]", "", { "dependencies": { "@types/connect": "*", "@types/node": "*" } }, "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g=="],

"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.2.23" } }, "sha512-le8ueOY5b6VKYf19xT3McVbXqLqmxzPXHsQT/q9JHgikJ2X22wyTW3g3ohz2ZMnp7dod6aduIiq8A14Xyimm0A=="],
Expand Down
7 changes: 7 additions & 0 deletions modules/tool/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ const tool = process.argv[2] || '*';

export const buildAllTools = async () => {
// read all tools, and build them
// check the existence of the tool directory

if (!existsSync(toolsSourceDir)) {
console.log(`Tool directory ${toolsSourceDir} does not exist, skip build`);
return;
}

const tools = await readdir(toolsSourceDir);
const promises: Promise<void>[] = [];
for await (const tool of tools) {
Expand Down
4 changes: 2 additions & 2 deletions modules/tool/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export async function getTool(toolId: string): Promise<ToolType | undefined> {
}

export function getToolTags(): z.infer<typeof ToolTagListSchema> {
return Object.entries(ToolTagsNameMap).map(([type, name]) => ({
type: type as z.infer<typeof ToolTagEnum>,
return Object.entries(ToolTagsNameMap).map(([id, name]) => ({
id: id as z.infer<typeof ToolTagEnum>,
name
}));
}
Expand Down
4 changes: 3 additions & 1 deletion modules/tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"build:marketplace": "bun run ./build/build-json.ts"
},
"devDependencies": {
"@babel/preset-typescript": "^7.27.1"
"@babel/preset-typescript": "^7.27.1",
"@types/babel__generator": "^7.27.0",
"@types/babel__traverse": "^7.28.0"
},
"dependencies": {
"@babel/generator": "^7.28.3",
Expand Down
2 changes: 1 addition & 1 deletion modules/tool/type/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ToolSchema, VersionListItemSchema } from './tool';

export const ToolTagListSchema = z.array(
z.object({
type: z.string(),
id: z.string(),
name: I18nStringStrictSchema
})
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "vitest run",
"build:runtime": "bun --cwd runtime build",
"start": "NODE_ENV=production node --env-file-if-exists=runtime/.env.local dist/index.js",
"build:pkg": "bun --cwd modules/tool build",
"build:pkg": "bun tsc && bun --cwd modules/tool build",
"build:sdk": "bun run --cwd sdk build",
"build:marketplace": "bun run build:pkg && bun ./modules/tool/build/build-json.ts",
"deploy:marketplace-data": "bun --env-file=.env.marketplace.local ./scripts/deploy-marketplace.ts",
Expand Down
6 changes: 6 additions & 0 deletions scripts/install-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ async function installWithConcurrency(tasks: InstallTask[], concurrency: number)
}

async function installInSubdirs(dir: string) {
// check if dir exists
if (!existsSync(dir)) {
console.log(`Directory ${dir} does not exist, skip installation`);
return;
}

const entries = readdirSync(dir, { withFileTypes: true });
const tasks: InstallTask[] = [];

Expand Down
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fastgpt-sdk/plugin",
"version": "0.2.0",
"version": "0.2.1",
"description": "fastgpt-plugin sdk",
"main": "dist/client.js",
"types": "dist/client.d.ts",
Expand Down