@cicctencent/agent-midway 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +280 -0
- package/dist/adapters/express.d.ts +8 -0
- package/dist/adapters/express.js +91 -0
- package/dist/adapters/index.d.ts +5 -0
- package/dist/adapters/index.js +21 -0
- package/dist/adapters/koa.d.ts +3 -0
- package/dist/adapters/koa.js +75 -0
- package/dist/adapters/midway.d.ts +5 -0
- package/dist/adapters/midway.js +11 -0
- package/dist/adapters/next.d.ts +12 -0
- package/dist/adapters/next.js +89 -0
- package/dist/adapters/shared.d.ts +4 -0
- package/dist/adapters/shared.js +31 -0
- package/dist/channel/dingtalk.d.ts +18 -0
- package/dist/channel/dingtalk.js +68 -0
- package/dist/channel/feishu.d.ts +20 -0
- package/dist/channel/feishu.js +96 -0
- package/dist/channel/index.d.ts +46 -0
- package/dist/channel/index.js +311 -0
- package/dist/channel/types.d.ts +77 -0
- package/dist/channel/types.js +7 -0
- package/dist/channel/wecom.d.ts +22 -0
- package/dist/channel/wecom.js +106 -0
- package/dist/component.d.ts +49 -0
- package/dist/component.js +129 -0
- package/dist/connector/calendar-adapter.d.ts +19 -0
- package/dist/connector/calendar-adapter.js +236 -0
- package/dist/connector/db-adapter.d.ts +28 -0
- package/dist/connector/db-adapter.js +193 -0
- package/dist/connector/email-adapter.d.ts +23 -0
- package/dist/connector/email-adapter.js +192 -0
- package/dist/connector/fs-adapter.d.ts +15 -0
- package/dist/connector/fs-adapter.js +199 -0
- package/dist/connector/http-adapter.d.ts +29 -0
- package/dist/connector/http-adapter.js +181 -0
- package/dist/connector/index.d.ts +24 -0
- package/dist/connector/index.js +454 -0
- package/dist/connector/mcp-adapter.d.ts +27 -0
- package/dist/connector/mcp-adapter.js +156 -0
- package/dist/connector/mq-adapter.d.ts +25 -0
- package/dist/connector/mq-adapter.js +181 -0
- package/dist/connector/types.d.ts +205 -0
- package/dist/connector/types.js +9 -0
- package/dist/controller/a2a.controller.d.ts +41 -0
- package/dist/controller/a2a.controller.js +150 -0
- package/dist/controller/agent-profile.controller.d.ts +97 -0
- package/dist/controller/agent-profile.controller.js +200 -0
- package/dist/controller/agent.controller.d.ts +199 -0
- package/dist/controller/agent.controller.js +414 -0
- package/dist/controller/application.controller.d.ts +113 -0
- package/dist/controller/application.controller.js +217 -0
- package/dist/controller/automation.controller.d.ts +113 -0
- package/dist/controller/automation.controller.js +246 -0
- package/dist/controller/channel.controller.d.ts +73 -0
- package/dist/controller/channel.controller.js +183 -0
- package/dist/controller/chat.controller.d.ts +188 -0
- package/dist/controller/chat.controller.js +375 -0
- package/dist/controller/connector.controller.d.ts +134 -0
- package/dist/controller/connector.controller.js +257 -0
- package/dist/controller/knowledge-base.controller.d.ts +157 -0
- package/dist/controller/knowledge-base.controller.js +278 -0
- package/dist/controller/mcp-server.controller.d.ts +115 -0
- package/dist/controller/mcp-server.controller.js +236 -0
- package/dist/controller/model-config.controller.d.ts +139 -0
- package/dist/controller/model-config.controller.js +274 -0
- package/dist/controller/observability.controller.d.ts +124 -0
- package/dist/controller/observability.controller.js +142 -0
- package/dist/controller/security.controller.d.ts +91 -0
- package/dist/controller/security.controller.js +172 -0
- package/dist/controller/settings.controller.d.ts +83 -0
- package/dist/controller/settings.controller.js +280 -0
- package/dist/core/ai-workstation.d.ts +17 -0
- package/dist/core/ai-workstation.js +129 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +20 -0
- package/dist/core/service-container.d.ts +12 -0
- package/dist/core/service-container.js +54 -0
- package/dist/core/sse.d.ts +6 -0
- package/dist/core/sse.js +56 -0
- package/dist/core/types.d.ts +72 -0
- package/dist/core/types.js +2 -0
- package/dist/dto/agent.dto.d.ts +21 -0
- package/dist/dto/agent.dto.js +79 -0
- package/dist/dto/ai-config.dto.d.ts +67 -0
- package/dist/dto/ai-config.dto.js +249 -0
- package/dist/dto/chat.dto.d.ts +40 -0
- package/dist/dto/chat.dto.js +122 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +195 -0
- package/dist/memory/db-store.d.ts +33 -0
- package/dist/memory/db-store.js +143 -0
- package/dist/memory/index.d.ts +187 -0
- package/dist/memory/index.js +443 -0
- package/dist/model/ai-agent-profile.entity.d.ts +32 -0
- package/dist/model/ai-agent-profile.entity.js +289 -0
- package/dist/model/ai-application.entity.d.ts +20 -0
- package/dist/model/ai-application.entity.js +166 -0
- package/dist/model/ai-chat-memory.entity.d.ts +16 -0
- package/dist/model/ai-chat-memory.entity.js +123 -0
- package/dist/model/ai-chat-message.entity.d.ts +16 -0
- package/dist/model/ai-chat-message.entity.js +122 -0
- package/dist/model/ai-chat-skill.entity.d.ts +19 -0
- package/dist/model/ai-chat-skill.entity.js +155 -0
- package/dist/model/ai-chat-thread.entity.d.ts +15 -0
- package/dist/model/ai-chat-thread.entity.js +113 -0
- package/dist/model/ai-chat-workspace.entity.d.ts +17 -0
- package/dist/model/ai-chat-workspace.entity.js +136 -0
- package/dist/model/ai-kb-document.entity.d.ts +16 -0
- package/dist/model/ai-kb-document.entity.js +122 -0
- package/dist/model/ai-knowledge-base.entity.d.ts +22 -0
- package/dist/model/ai-knowledge-base.entity.js +185 -0
- package/dist/model/ai-mcp-server.entity.d.ts +23 -0
- package/dist/model/ai-mcp-server.entity.js +198 -0
- package/dist/model/ai-model-config.entity.d.ts +24 -0
- package/dist/model/ai-model-config.entity.js +200 -0
- package/dist/service/a2a.service.d.ts +142 -0
- package/dist/service/a2a.service.js +537 -0
- package/dist/service/agent-profile.service.d.ts +34 -0
- package/dist/service/agent-profile.service.js +110 -0
- package/dist/service/agent-server.service.d.ts +91 -0
- package/dist/service/agent-server.service.js +634 -0
- package/dist/service/agent-task-queue.service.d.ts +98 -0
- package/dist/service/agent-task-queue.service.js +283 -0
- package/dist/service/ai-chat.service.d.ts +103 -0
- package/dist/service/ai-chat.service.js +431 -0
- package/dist/service/ai-skill.service.d.ts +116 -0
- package/dist/service/ai-skill.service.js +457 -0
- package/dist/service/application.service.d.ts +42 -0
- package/dist/service/application.service.js +139 -0
- package/dist/service/automation.service.d.ts +37 -0
- package/dist/service/automation.service.js +196 -0
- package/dist/service/connector.service.d.ts +136 -0
- package/dist/service/connector.service.js +524 -0
- package/dist/service/knowledge-base.service.d.ts +138 -0
- package/dist/service/knowledge-base.service.js +528 -0
- package/dist/service/mcp-server.service.d.ts +39 -0
- package/dist/service/mcp-server.service.js +143 -0
- package/dist/service/model-config.service.d.ts +57 -0
- package/dist/service/model-config.service.js +168 -0
- package/dist/service/observability.service.d.ts +145 -0
- package/dist/service/observability.service.js +281 -0
- package/dist/service/openai.service.d.ts +88 -0
- package/dist/service/openai.service.js +406 -0
- package/dist/service/prompt-builder.service.d.ts +50 -0
- package/dist/service/prompt-builder.service.js +246 -0
- package/dist/tools/code-exec.tool.d.ts +37 -0
- package/dist/tools/code-exec.tool.js +162 -0
- package/dist/tools/datetime.tool.d.ts +21 -0
- package/dist/tools/datetime.tool.js +379 -0
- package/dist/tools/http-request.tool.d.ts +43 -0
- package/dist/tools/http-request.tool.js +455 -0
- package/dist/tools/registry.d.ts +71 -0
- package/dist/tools/registry.js +77 -0
- package/dist/tools/text-process.tool.d.ts +7 -0
- package/dist/tools/text-process.tool.js +366 -0
- package/dist/tools/web-search.tool.d.ts +28 -0
- package/dist/tools/web-search.tool.js +304 -0
- package/dist/types.d.ts +70 -0
- package/dist/types.js +7 -0
- package/package.json +69 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const baseORM_1 = __importDefault(require("@fefeding/common/dist/models/base/baseORM"));
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
/**
|
|
18
|
+
* AI 对话消息实体
|
|
19
|
+
* @table t_work_chat_message
|
|
20
|
+
*/
|
|
21
|
+
let AIChatMessageEntity = class AIChatMessageEntity extends baseORM_1.default {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.id = 0;
|
|
25
|
+
this.applicationId = 0;
|
|
26
|
+
this.userId = '';
|
|
27
|
+
this.threadId = 0;
|
|
28
|
+
this.role = 'user';
|
|
29
|
+
this.type = 'text';
|
|
30
|
+
this.content = '';
|
|
31
|
+
this.meta = null;
|
|
32
|
+
this.isDeleted = 0;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
37
|
+
name: 'id',
|
|
38
|
+
type: 'int',
|
|
39
|
+
comment: '消息ID',
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], AIChatMessageEntity.prototype, "id", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({
|
|
45
|
+
name: 'Fapplication_id',
|
|
46
|
+
type: 'int',
|
|
47
|
+
comment: '所属应用ID',
|
|
48
|
+
default: 0,
|
|
49
|
+
}),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], AIChatMessageEntity.prototype, "applicationId", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({
|
|
54
|
+
name: 'Fuser_id',
|
|
55
|
+
type: 'varchar',
|
|
56
|
+
length: 64,
|
|
57
|
+
comment: '用户ID',
|
|
58
|
+
default: '',
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], AIChatMessageEntity.prototype, "userId", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({
|
|
64
|
+
name: 'Fthread_id',
|
|
65
|
+
type: 'int',
|
|
66
|
+
comment: '所属线程ID',
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], AIChatMessageEntity.prototype, "threadId", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({
|
|
72
|
+
name: 'Frole',
|
|
73
|
+
type: 'varchar',
|
|
74
|
+
length: 16,
|
|
75
|
+
comment: '角色:user/assistant/system',
|
|
76
|
+
default: 'user',
|
|
77
|
+
}),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], AIChatMessageEntity.prototype, "role", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({
|
|
82
|
+
name: 'Ftype',
|
|
83
|
+
type: 'varchar',
|
|
84
|
+
length: 32,
|
|
85
|
+
comment: '消息类型:text/tool_call/image',
|
|
86
|
+
default: 'text',
|
|
87
|
+
}),
|
|
88
|
+
__metadata("design:type", Object)
|
|
89
|
+
], AIChatMessageEntity.prototype, "type", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, typeorm_1.Column)({
|
|
92
|
+
name: 'Fcontent',
|
|
93
|
+
type: 'longtext',
|
|
94
|
+
comment: '消息内容',
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], AIChatMessageEntity.prototype, "content", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({
|
|
100
|
+
name: 'Fmeta',
|
|
101
|
+
type: 'json',
|
|
102
|
+
comment: '附加元数据(工具调用信息等)',
|
|
103
|
+
nullable: true,
|
|
104
|
+
}),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], AIChatMessageEntity.prototype, "meta", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, typeorm_1.Column)({
|
|
109
|
+
name: 'Fis_deleted',
|
|
110
|
+
type: 'smallint',
|
|
111
|
+
comment: '删除标记:0-正常,1-已删除',
|
|
112
|
+
default: 0,
|
|
113
|
+
}),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], AIChatMessageEntity.prototype, "isDeleted", void 0);
|
|
116
|
+
AIChatMessageEntity = __decorate([
|
|
117
|
+
(0, typeorm_1.Entity)('t_work_chat_message'),
|
|
118
|
+
(0, typeorm_1.Index)(['applicationId']),
|
|
119
|
+
(0, typeorm_1.Index)(['applicationId', 'userId', 'threadId']),
|
|
120
|
+
(0, typeorm_1.Index)(['applicationId', 'threadId'])
|
|
121
|
+
], AIChatMessageEntity);
|
|
122
|
+
exports.default = AIChatMessageEntity;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import BaseEntity from '@fefeding/common/dist/models/base/baseORM';
|
|
2
|
+
/**
|
|
3
|
+
* Agent Skill 实体
|
|
4
|
+
* @table t_work_chat_skill
|
|
5
|
+
*/
|
|
6
|
+
export default class AIChatSkillEntity extends BaseEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
category: string;
|
|
11
|
+
contentType: string;
|
|
12
|
+
content: string;
|
|
13
|
+
agentTypes: string;
|
|
14
|
+
injectionMode: string;
|
|
15
|
+
toolSchema: any;
|
|
16
|
+
isActive: number;
|
|
17
|
+
isDeleted: number;
|
|
18
|
+
sort: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const baseORM_1 = __importDefault(require("@fefeding/common/dist/models/base/baseORM"));
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
/**
|
|
18
|
+
* Agent Skill 实体
|
|
19
|
+
* @table t_work_chat_skill
|
|
20
|
+
*/
|
|
21
|
+
let AIChatSkillEntity = class AIChatSkillEntity extends baseORM_1.default {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.id = 0;
|
|
25
|
+
this.name = '';
|
|
26
|
+
this.description = '';
|
|
27
|
+
this.category = 'prompt';
|
|
28
|
+
this.contentType = 'text';
|
|
29
|
+
this.content = '';
|
|
30
|
+
this.agentTypes = '';
|
|
31
|
+
this.injectionMode = 'prompt';
|
|
32
|
+
this.toolSchema = null;
|
|
33
|
+
this.isActive = 1;
|
|
34
|
+
this.isDeleted = 0;
|
|
35
|
+
this.sort = 0;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
40
|
+
name: 'id',
|
|
41
|
+
type: 'int',
|
|
42
|
+
comment: 'Skill ID',
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], AIChatSkillEntity.prototype, "id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({
|
|
48
|
+
name: 'Fname',
|
|
49
|
+
type: 'varchar',
|
|
50
|
+
length: 128,
|
|
51
|
+
comment: 'Skill 名称',
|
|
52
|
+
default: '',
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], AIChatSkillEntity.prototype, "name", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({
|
|
58
|
+
name: 'Fdescription',
|
|
59
|
+
type: 'varchar',
|
|
60
|
+
length: 512,
|
|
61
|
+
comment: 'Skill 描述',
|
|
62
|
+
default: '',
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], AIChatSkillEntity.prototype, "description", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({
|
|
68
|
+
name: 'Fcategory',
|
|
69
|
+
type: 'varchar',
|
|
70
|
+
length: 32,
|
|
71
|
+
comment: '分类: prompt/rule/tool',
|
|
72
|
+
default: 'prompt',
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], AIChatSkillEntity.prototype, "category", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({
|
|
78
|
+
name: 'Fcontent_type',
|
|
79
|
+
type: 'varchar',
|
|
80
|
+
length: 16,
|
|
81
|
+
comment: '内容格式: text/json/markdown',
|
|
82
|
+
default: 'text',
|
|
83
|
+
}),
|
|
84
|
+
__metadata("design:type", Object)
|
|
85
|
+
], AIChatSkillEntity.prototype, "contentType", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({
|
|
88
|
+
name: 'Fcontent',
|
|
89
|
+
type: 'longtext',
|
|
90
|
+
comment: 'Skill 具体内容',
|
|
91
|
+
}),
|
|
92
|
+
__metadata("design:type", Object)
|
|
93
|
+
], AIChatSkillEntity.prototype, "content", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, typeorm_1.Column)({
|
|
96
|
+
name: 'Fagent_types',
|
|
97
|
+
type: 'varchar',
|
|
98
|
+
length: 256,
|
|
99
|
+
comment: '适用的 Agent 类型,逗号分隔,如 "data-analyst,chat"',
|
|
100
|
+
default: '',
|
|
101
|
+
}),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], AIChatSkillEntity.prototype, "agentTypes", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({
|
|
106
|
+
name: 'Finjection_mode',
|
|
107
|
+
type: 'varchar',
|
|
108
|
+
length: 16,
|
|
109
|
+
comment: '注入方式: prompt/tool/both',
|
|
110
|
+
default: 'prompt',
|
|
111
|
+
}),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], AIChatSkillEntity.prototype, "injectionMode", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Column)({
|
|
116
|
+
name: 'Ftool_schema',
|
|
117
|
+
type: 'json',
|
|
118
|
+
comment: '当 injection_mode 包含 tool 时,定义 ToolDefinition 的 parameters',
|
|
119
|
+
nullable: true,
|
|
120
|
+
}),
|
|
121
|
+
__metadata("design:type", Object)
|
|
122
|
+
], AIChatSkillEntity.prototype, "toolSchema", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, typeorm_1.Column)({
|
|
125
|
+
name: 'Fis_active',
|
|
126
|
+
type: 'smallint',
|
|
127
|
+
comment: '是否启用: 0-禁用, 1-启用',
|
|
128
|
+
default: 1,
|
|
129
|
+
}),
|
|
130
|
+
__metadata("design:type", Object)
|
|
131
|
+
], AIChatSkillEntity.prototype, "isActive", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, typeorm_1.Column)({
|
|
134
|
+
name: 'Fis_deleted',
|
|
135
|
+
type: 'smallint',
|
|
136
|
+
comment: '删除标记: 0-正常, 1-已删除',
|
|
137
|
+
default: 0,
|
|
138
|
+
}),
|
|
139
|
+
__metadata("design:type", Object)
|
|
140
|
+
], AIChatSkillEntity.prototype, "isDeleted", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, typeorm_1.Column)({
|
|
143
|
+
name: 'Fsort',
|
|
144
|
+
type: 'int',
|
|
145
|
+
comment: '排序权重',
|
|
146
|
+
default: 0,
|
|
147
|
+
}),
|
|
148
|
+
__metadata("design:type", Object)
|
|
149
|
+
], AIChatSkillEntity.prototype, "sort", void 0);
|
|
150
|
+
AIChatSkillEntity = __decorate([
|
|
151
|
+
(0, typeorm_1.Entity)('t_work_chat_skill'),
|
|
152
|
+
(0, typeorm_1.Index)(['category', 'isActive']),
|
|
153
|
+
(0, typeorm_1.Index)(['agentTypes'])
|
|
154
|
+
], AIChatSkillEntity);
|
|
155
|
+
exports.default = AIChatSkillEntity;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import BaseEntity from '@fefeding/common/dist/models/base/baseORM';
|
|
2
|
+
/**
|
|
3
|
+
* AI 对话线程实体
|
|
4
|
+
* @table t_work_chat_thread
|
|
5
|
+
*/
|
|
6
|
+
export default class AIChatThreadEntity extends BaseEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
applicationId: number;
|
|
9
|
+
userId: string;
|
|
10
|
+
workspaceId: number;
|
|
11
|
+
title: string;
|
|
12
|
+
messageCount: number;
|
|
13
|
+
status: string;
|
|
14
|
+
isDeleted: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const baseORM_1 = __importDefault(require("@fefeding/common/dist/models/base/baseORM"));
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
/**
|
|
18
|
+
* AI 对话线程实体
|
|
19
|
+
* @table t_work_chat_thread
|
|
20
|
+
*/
|
|
21
|
+
let AIChatThreadEntity = class AIChatThreadEntity extends baseORM_1.default {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.id = 0;
|
|
25
|
+
this.applicationId = 0;
|
|
26
|
+
this.userId = '';
|
|
27
|
+
this.workspaceId = 0;
|
|
28
|
+
this.title = '新对话';
|
|
29
|
+
this.messageCount = 0;
|
|
30
|
+
this.status = 'active';
|
|
31
|
+
this.isDeleted = 0;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
36
|
+
name: 'id',
|
|
37
|
+
type: 'int',
|
|
38
|
+
comment: '线程ID',
|
|
39
|
+
}),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], AIChatThreadEntity.prototype, "id", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({
|
|
44
|
+
name: 'Fapplication_id',
|
|
45
|
+
type: 'int',
|
|
46
|
+
comment: '所属应用ID',
|
|
47
|
+
default: 0,
|
|
48
|
+
}),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], AIChatThreadEntity.prototype, "applicationId", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({
|
|
53
|
+
name: 'Fuser_id',
|
|
54
|
+
type: 'varchar',
|
|
55
|
+
length: 64,
|
|
56
|
+
comment: '用户ID',
|
|
57
|
+
default: '',
|
|
58
|
+
}),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], AIChatThreadEntity.prototype, "userId", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({
|
|
63
|
+
name: 'Fworkspace_id',
|
|
64
|
+
type: 'int',
|
|
65
|
+
comment: '所属工作空间ID',
|
|
66
|
+
}),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], AIChatThreadEntity.prototype, "workspaceId", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({
|
|
71
|
+
name: 'Ftitle',
|
|
72
|
+
type: 'varchar',
|
|
73
|
+
length: 256,
|
|
74
|
+
comment: '对话标题',
|
|
75
|
+
default: '新对话',
|
|
76
|
+
}),
|
|
77
|
+
__metadata("design:type", Object)
|
|
78
|
+
], AIChatThreadEntity.prototype, "title", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({
|
|
81
|
+
name: 'Fmessage_count',
|
|
82
|
+
type: 'int',
|
|
83
|
+
comment: '消息数量',
|
|
84
|
+
default: 0,
|
|
85
|
+
}),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], AIChatThreadEntity.prototype, "messageCount", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({
|
|
90
|
+
name: 'Fstatus',
|
|
91
|
+
type: 'varchar',
|
|
92
|
+
length: 16,
|
|
93
|
+
comment: '状态:active/archived',
|
|
94
|
+
default: 'active',
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], AIChatThreadEntity.prototype, "status", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({
|
|
100
|
+
name: 'Fis_deleted',
|
|
101
|
+
type: 'smallint',
|
|
102
|
+
comment: '删除标记:0-正常,1-已删除',
|
|
103
|
+
default: 0,
|
|
104
|
+
}),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], AIChatThreadEntity.prototype, "isDeleted", void 0);
|
|
107
|
+
AIChatThreadEntity = __decorate([
|
|
108
|
+
(0, typeorm_1.Entity)('t_work_chat_thread'),
|
|
109
|
+
(0, typeorm_1.Index)(['applicationId']),
|
|
110
|
+
(0, typeorm_1.Index)(['applicationId', 'userId', 'workspaceId']),
|
|
111
|
+
(0, typeorm_1.Index)(['applicationId', 'userId'])
|
|
112
|
+
], AIChatThreadEntity);
|
|
113
|
+
exports.default = AIChatThreadEntity;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import BaseEntity from '@fefeding/common/dist/models/base/baseORM';
|
|
2
|
+
/**
|
|
3
|
+
* AI 对话工作空间实体
|
|
4
|
+
* @table t_work_chat_workspace
|
|
5
|
+
*/
|
|
6
|
+
export default class AIChatWorkspaceEntity extends BaseEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
applicationId: number;
|
|
9
|
+
userId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
color: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
threadCount: number;
|
|
15
|
+
status: string;
|
|
16
|
+
isDeleted: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const baseORM_1 = __importDefault(require("@fefeding/common/dist/models/base/baseORM"));
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
/**
|
|
18
|
+
* AI 对话工作空间实体
|
|
19
|
+
* @table t_work_chat_workspace
|
|
20
|
+
*/
|
|
21
|
+
let AIChatWorkspaceEntity = class AIChatWorkspaceEntity extends baseORM_1.default {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.id = 0;
|
|
25
|
+
this.applicationId = 0;
|
|
26
|
+
this.userId = '';
|
|
27
|
+
this.name = '';
|
|
28
|
+
this.description = '';
|
|
29
|
+
this.color = '#007bff';
|
|
30
|
+
this.icon = 'folder';
|
|
31
|
+
this.threadCount = 0;
|
|
32
|
+
this.status = 'active';
|
|
33
|
+
this.isDeleted = 0;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
38
|
+
name: 'id',
|
|
39
|
+
type: 'int',
|
|
40
|
+
comment: '工作空间ID',
|
|
41
|
+
}),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], AIChatWorkspaceEntity.prototype, "id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({
|
|
46
|
+
name: 'Fapplication_id',
|
|
47
|
+
type: 'int',
|
|
48
|
+
comment: '所属应用ID',
|
|
49
|
+
default: 0,
|
|
50
|
+
}),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], AIChatWorkspaceEntity.prototype, "applicationId", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({
|
|
55
|
+
name: 'Fuser_id',
|
|
56
|
+
type: 'varchar',
|
|
57
|
+
length: 64,
|
|
58
|
+
comment: '用户ID',
|
|
59
|
+
default: '',
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], AIChatWorkspaceEntity.prototype, "userId", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({
|
|
65
|
+
name: 'Fname',
|
|
66
|
+
type: 'varchar',
|
|
67
|
+
length: 128,
|
|
68
|
+
comment: '工作空间名称',
|
|
69
|
+
default: '',
|
|
70
|
+
}),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], AIChatWorkspaceEntity.prototype, "name", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({
|
|
75
|
+
name: 'Fdescription',
|
|
76
|
+
type: 'varchar',
|
|
77
|
+
length: 512,
|
|
78
|
+
comment: '描述',
|
|
79
|
+
default: '',
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", Object)
|
|
82
|
+
], AIChatWorkspaceEntity.prototype, "description", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({
|
|
85
|
+
name: 'Fcolor',
|
|
86
|
+
type: 'varchar',
|
|
87
|
+
length: 32,
|
|
88
|
+
comment: '主题颜色',
|
|
89
|
+
default: '#007bff',
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], AIChatWorkspaceEntity.prototype, "color", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.Column)({
|
|
95
|
+
name: 'Ficon',
|
|
96
|
+
type: 'varchar',
|
|
97
|
+
length: 64,
|
|
98
|
+
comment: '图标',
|
|
99
|
+
default: 'folder',
|
|
100
|
+
}),
|
|
101
|
+
__metadata("design:type", Object)
|
|
102
|
+
], AIChatWorkspaceEntity.prototype, "icon", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typeorm_1.Column)({
|
|
105
|
+
name: 'Fthread_count',
|
|
106
|
+
type: 'int',
|
|
107
|
+
comment: '线程数量',
|
|
108
|
+
default: 0,
|
|
109
|
+
}),
|
|
110
|
+
__metadata("design:type", Object)
|
|
111
|
+
], AIChatWorkspaceEntity.prototype, "threadCount", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({
|
|
114
|
+
name: 'Fstatus',
|
|
115
|
+
type: 'varchar',
|
|
116
|
+
length: 16,
|
|
117
|
+
comment: '状态:active/archived',
|
|
118
|
+
default: 'active',
|
|
119
|
+
}),
|
|
120
|
+
__metadata("design:type", Object)
|
|
121
|
+
], AIChatWorkspaceEntity.prototype, "status", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, typeorm_1.Column)({
|
|
124
|
+
name: 'Fis_deleted',
|
|
125
|
+
type: 'smallint',
|
|
126
|
+
comment: '删除标记:0-正常,1-已删除',
|
|
127
|
+
default: 0,
|
|
128
|
+
}),
|
|
129
|
+
__metadata("design:type", Object)
|
|
130
|
+
], AIChatWorkspaceEntity.prototype, "isDeleted", void 0);
|
|
131
|
+
AIChatWorkspaceEntity = __decorate([
|
|
132
|
+
(0, typeorm_1.Entity)('t_work_chat_workspace'),
|
|
133
|
+
(0, typeorm_1.Index)(['applicationId']),
|
|
134
|
+
(0, typeorm_1.Index)(['applicationId', 'userId'])
|
|
135
|
+
], AIChatWorkspaceEntity);
|
|
136
|
+
exports.default = AIChatWorkspaceEntity;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import BaseEntity from '@fefeding/common/dist/models/base/baseORM';
|
|
2
|
+
/**
|
|
3
|
+
* 知识库文档实体
|
|
4
|
+
* @table t_ai_kb_document
|
|
5
|
+
*/
|
|
6
|
+
export default class AIKBDocumentEntity extends BaseEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
knowledgeBaseId: number;
|
|
9
|
+
title: string;
|
|
10
|
+
content: string | null;
|
|
11
|
+
sourcePath: string;
|
|
12
|
+
sourceType: string;
|
|
13
|
+
chunkCount: number;
|
|
14
|
+
status: string;
|
|
15
|
+
meta: Record<string, any> | null;
|
|
16
|
+
}
|