diff --git a/package.json b/package.json index e6e0a85..2a684b4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "dev:watch": "concurrently -n \"Watch,Dev\" -c \"green,blue\" \"npm run watch\" \"sleep 1 && npm run dev\" ", "build": "cross-env ENV=production webpack --mode=production ", "build:sh": "cross-env webpack --mode=production -c ./webpack.shell.config.cjs", - "deploy": "scp ./dist/app.cjs light:~/apps/codeflow/backend", + "deploy": "rsync -avz --delete ./dist/ light:~/apps/codeflow/backend", "deploy:sh": "", "clean": "rm -rf dist", "reload": "ssh light pm2 restart codeflow", diff --git a/src/index.ts b/src/index.ts index 8f0cf02..50a43af 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,5 +7,5 @@ import { app as aiApp } from '@kevisual/ai-lang/src/index.ts'; export { aiApp }; export { app }; app.listen(config.port, () => { - console.log(`server2 is running at http://localhost:${config.port}`); + console.log(`server is running at http://localhost:${config.port}`); }); diff --git a/src/models/agent.ts b/src/models/agent.ts index b2eaab7..331e253 100644 --- a/src/models/agent.ts +++ b/src/models/agent.ts @@ -2,17 +2,18 @@ import { sequelize } from '@/modules/sequelize.ts'; import { DataTypes, Model } from 'sequelize'; export class AiAgent extends Model { - id: string; - type: string; - model: string; - baseUrl: string; - apiKey: string; - temperature: number; - cache: string; - cacheName: string; - status: string; - data: any; - key: string; + declare id: string; + declare type: string; + declare model: string; + declare baseUrl: string; + declare apiKey: string; + declare temperature: number; + declare cache: string; + declare cacheName: string; + declare status: string; + declare data: any; + declare description: string; + declare key: string; } // 获取AIAgent的属性 @@ -26,6 +27,7 @@ export type AiProperties = { cache?: string; cacheName?: string; data?: any; + description?: string; }; AiAgent.init( { @@ -38,6 +40,10 @@ AiAgent.init( type: DataTypes.STRING, allowNull: false, }, + description: { + type: DataTypes.TEXT, + allowNull: true, + }, status: { type: DataTypes.STRING, defaultValue: 'open', @@ -56,6 +62,8 @@ AiAgent.init( }, key: { type: DataTypes.STRING, + allowNull: false, + unique: true, }, temperature: { type: DataTypes.FLOAT, diff --git a/src/routes/agent/list.ts b/src/routes/agent/list.ts index b4a6257..d26f498 100644 --- a/src/routes/agent/list.ts +++ b/src/routes/agent/list.ts @@ -112,6 +112,7 @@ const initManager = async () => { where: { status: 'open', }, + logging: false, }); const data = list.map((item) => { return { diff --git a/src/routes/container/list.ts b/src/routes/container/list.ts index 44a05c1..398ef43 100644 --- a/src/routes/container/list.ts +++ b/src/routes/container/list.ts @@ -45,12 +45,7 @@ add.run = async (ctx) => { source: '', type: '', sourceType: '', - data: { - className: '', - style: {}, - showChild: true, - shadowRoot: false, - }, + data: {}, }; const container = { ..._data, diff --git a/src/routes/container/models/index.ts b/src/routes/container/models/index.ts index d899ec5..66bb76b 100644 --- a/src/routes/container/models/index.ts +++ b/src/routes/container/models/index.ts @@ -1,12 +1,7 @@ import { sequelize } from '../../../modules/sequelize.ts'; import { DataTypes, Model } from 'sequelize'; -export interface ContainerData { - style?: { [key: string]: string }; - className?: string; - showChild?: boolean; - shadowRoot?: boolean; -} +export interface ContainerData {} export type ContainerPublish = { rid?: string; // resource id name?: string; @@ -20,6 +15,7 @@ export class ContainerModel extends Model { declare title: string; declare description: string; declare type: string; + declare tags: string[]; declare code: string; declare source: string; declare sourceType: string; @@ -43,6 +39,10 @@ ContainerModel.init( type: DataTypes.STRING, defaultValue: '', }, + tags: { + type: DataTypes.JSON, + defaultValue: [], + }, type: { type: DataTypes.STRING, defaultValue: '', diff --git a/webpack.config.cjs b/webpack.config.cjs index ed4c6d9..118e6a8 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -59,6 +59,9 @@ module.exports = { { message: /Critical dependency: the request of a dependency is an expression/, }, + { + message: /[DEP0040] DeprecationWarning: The `punycode`/ + } ], resolve: {