@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,289 @@
|
|
|
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 Profile 实体
|
|
19
|
+
* @table t_agent_profile
|
|
20
|
+
*/
|
|
21
|
+
let AIAgentProfileEntity = class AIAgentProfileEntity extends baseORM_1.default {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.id = 0;
|
|
25
|
+
this.applicationId = 0;
|
|
26
|
+
this.name = '';
|
|
27
|
+
this.description = '';
|
|
28
|
+
this.icon = 'robot';
|
|
29
|
+
this.color = '#6B5CE7';
|
|
30
|
+
this.basePrompt = '';
|
|
31
|
+
this.model = '';
|
|
32
|
+
this.modelConfigId = '';
|
|
33
|
+
this.maxIterations = 15;
|
|
34
|
+
this.maxMessages = 50;
|
|
35
|
+
this.toolTimeout = 30000;
|
|
36
|
+
this.disabledTools = null;
|
|
37
|
+
this.mcpServers = null;
|
|
38
|
+
this.selectedSkills = null;
|
|
39
|
+
this.alwaysInjectSkills = null;
|
|
40
|
+
this.connectorIds = null;
|
|
41
|
+
this.isDefault = 0;
|
|
42
|
+
this.agentType = 'default';
|
|
43
|
+
this.domain = '';
|
|
44
|
+
this.remoteUrl = '';
|
|
45
|
+
this.remoteCard = null;
|
|
46
|
+
this.remoteAuth = null;
|
|
47
|
+
this.a2aProtocol = 'jsonrpc';
|
|
48
|
+
this.restA2AConfig = null;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
53
|
+
name: 'id',
|
|
54
|
+
type: 'int',
|
|
55
|
+
comment: 'Profile ID',
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], AIAgentProfileEntity.prototype, "id", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({
|
|
61
|
+
name: 'Fapplication_id',
|
|
62
|
+
type: 'int',
|
|
63
|
+
comment: '所属应用ID',
|
|
64
|
+
default: 0,
|
|
65
|
+
}),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], AIAgentProfileEntity.prototype, "applicationId", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({
|
|
70
|
+
name: 'Fname',
|
|
71
|
+
type: 'varchar',
|
|
72
|
+
length: 128,
|
|
73
|
+
comment: 'Agent 名称',
|
|
74
|
+
default: '',
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Object)
|
|
77
|
+
], AIAgentProfileEntity.prototype, "name", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({
|
|
80
|
+
name: 'Fdescription',
|
|
81
|
+
type: 'varchar',
|
|
82
|
+
length: 512,
|
|
83
|
+
comment: '描述',
|
|
84
|
+
default: '',
|
|
85
|
+
}),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], AIAgentProfileEntity.prototype, "description", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({
|
|
90
|
+
name: 'Ficon',
|
|
91
|
+
type: 'varchar',
|
|
92
|
+
length: 64,
|
|
93
|
+
comment: '图标',
|
|
94
|
+
default: 'robot',
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], AIAgentProfileEntity.prototype, "icon", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({
|
|
100
|
+
name: 'Fcolor',
|
|
101
|
+
type: 'varchar',
|
|
102
|
+
length: 32,
|
|
103
|
+
comment: '主题颜色',
|
|
104
|
+
default: '#6B5CE7',
|
|
105
|
+
}),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], AIAgentProfileEntity.prototype, "color", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({
|
|
110
|
+
name: 'Fbase_prompt',
|
|
111
|
+
type: 'longtext',
|
|
112
|
+
comment: '基础提示词',
|
|
113
|
+
}),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], AIAgentProfileEntity.prototype, "basePrompt", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typeorm_1.Column)({
|
|
118
|
+
name: 'Fmodel',
|
|
119
|
+
type: 'varchar',
|
|
120
|
+
length: 128,
|
|
121
|
+
comment: '模型名称',
|
|
122
|
+
default: '',
|
|
123
|
+
}),
|
|
124
|
+
__metadata("design:type", Object)
|
|
125
|
+
], AIAgentProfileEntity.prototype, "model", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, typeorm_1.Column)({
|
|
128
|
+
name: 'Fmodel_config_id',
|
|
129
|
+
type: 'varchar',
|
|
130
|
+
length: 128,
|
|
131
|
+
comment: '引用的模型配置 ID',
|
|
132
|
+
default: '',
|
|
133
|
+
}),
|
|
134
|
+
__metadata("design:type", Object)
|
|
135
|
+
], AIAgentProfileEntity.prototype, "modelConfigId", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, typeorm_1.Column)({
|
|
138
|
+
name: 'Fmax_iterations',
|
|
139
|
+
type: 'int',
|
|
140
|
+
comment: '最大迭代次数',
|
|
141
|
+
default: 15,
|
|
142
|
+
}),
|
|
143
|
+
__metadata("design:type", Object)
|
|
144
|
+
], AIAgentProfileEntity.prototype, "maxIterations", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, typeorm_1.Column)({
|
|
147
|
+
name: 'Fmax_messages',
|
|
148
|
+
type: 'int',
|
|
149
|
+
comment: '最大消息数',
|
|
150
|
+
default: 50,
|
|
151
|
+
}),
|
|
152
|
+
__metadata("design:type", Object)
|
|
153
|
+
], AIAgentProfileEntity.prototype, "maxMessages", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, typeorm_1.Column)({
|
|
156
|
+
name: 'Ftool_timeout',
|
|
157
|
+
type: 'int',
|
|
158
|
+
comment: '工具超时时间(ms)',
|
|
159
|
+
default: 30000,
|
|
160
|
+
}),
|
|
161
|
+
__metadata("design:type", Object)
|
|
162
|
+
], AIAgentProfileEntity.prototype, "toolTimeout", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
(0, typeorm_1.Column)({
|
|
165
|
+
name: 'Fdisabled_tools',
|
|
166
|
+
type: 'json',
|
|
167
|
+
comment: '禁用的工具列表',
|
|
168
|
+
nullable: true,
|
|
169
|
+
}),
|
|
170
|
+
__metadata("design:type", Array)
|
|
171
|
+
], AIAgentProfileEntity.prototype, "disabledTools", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, typeorm_1.Column)({
|
|
174
|
+
name: 'Fmcp_servers',
|
|
175
|
+
type: 'json',
|
|
176
|
+
comment: '关联的 MCP Server ID 列表',
|
|
177
|
+
nullable: true,
|
|
178
|
+
}),
|
|
179
|
+
__metadata("design:type", Array)
|
|
180
|
+
], AIAgentProfileEntity.prototype, "mcpServers", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
(0, typeorm_1.Column)({
|
|
183
|
+
name: 'Fselected_skills',
|
|
184
|
+
type: 'json',
|
|
185
|
+
comment: '选定的 Skill ID 列表',
|
|
186
|
+
nullable: true,
|
|
187
|
+
}),
|
|
188
|
+
__metadata("design:type", Array)
|
|
189
|
+
], AIAgentProfileEntity.prototype, "selectedSkills", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, typeorm_1.Column)({
|
|
192
|
+
name: 'Falways_inject_skills',
|
|
193
|
+
type: 'json',
|
|
194
|
+
comment: '始终注入的 Skill ID 列表',
|
|
195
|
+
nullable: true,
|
|
196
|
+
}),
|
|
197
|
+
__metadata("design:type", Array)
|
|
198
|
+
], AIAgentProfileEntity.prototype, "alwaysInjectSkills", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, typeorm_1.Column)({
|
|
201
|
+
name: 'Fconnector_ids',
|
|
202
|
+
type: 'json',
|
|
203
|
+
comment: '选定的连接器 ID 列表',
|
|
204
|
+
nullable: true,
|
|
205
|
+
}),
|
|
206
|
+
__metadata("design:type", Array)
|
|
207
|
+
], AIAgentProfileEntity.prototype, "connectorIds", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
(0, typeorm_1.Column)({
|
|
210
|
+
name: 'Fis_default',
|
|
211
|
+
type: 'smallint',
|
|
212
|
+
comment: '是否为默认 Agent: 0-否, 1-是',
|
|
213
|
+
default: 0,
|
|
214
|
+
}),
|
|
215
|
+
__metadata("design:type", Object)
|
|
216
|
+
], AIAgentProfileEntity.prototype, "isDefault", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
(0, typeorm_1.Column)({
|
|
219
|
+
name: 'Fagent_type',
|
|
220
|
+
type: 'varchar',
|
|
221
|
+
length: 32,
|
|
222
|
+
comment: 'Agent 类型: default/specialist',
|
|
223
|
+
default: 'default',
|
|
224
|
+
}),
|
|
225
|
+
__metadata("design:type", Object)
|
|
226
|
+
], AIAgentProfileEntity.prototype, "agentType", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
(0, typeorm_1.Column)({
|
|
229
|
+
name: 'Fdomain',
|
|
230
|
+
type: 'varchar',
|
|
231
|
+
length: 128,
|
|
232
|
+
comment: '专业领域标签',
|
|
233
|
+
default: '',
|
|
234
|
+
}),
|
|
235
|
+
__metadata("design:type", Object)
|
|
236
|
+
], AIAgentProfileEntity.prototype, "domain", void 0);
|
|
237
|
+
__decorate([
|
|
238
|
+
(0, typeorm_1.Column)({
|
|
239
|
+
name: 'Fremote_url',
|
|
240
|
+
type: 'varchar',
|
|
241
|
+
length: 512,
|
|
242
|
+
comment: '远程 Agent URL(agentType=remote 时必填)',
|
|
243
|
+
default: '',
|
|
244
|
+
}),
|
|
245
|
+
__metadata("design:type", Object)
|
|
246
|
+
], AIAgentProfileEntity.prototype, "remoteUrl", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
(0, typeorm_1.Column)({
|
|
249
|
+
name: 'Fremote_card',
|
|
250
|
+
type: 'json',
|
|
251
|
+
comment: '远程 Agent Card 缓存',
|
|
252
|
+
nullable: true,
|
|
253
|
+
}),
|
|
254
|
+
__metadata("design:type", Object)
|
|
255
|
+
], AIAgentProfileEntity.prototype, "remoteCard", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
(0, typeorm_1.Column)({
|
|
258
|
+
name: 'Fremote_auth',
|
|
259
|
+
type: 'json',
|
|
260
|
+
comment: '远程 Agent 认证配置',
|
|
261
|
+
nullable: true,
|
|
262
|
+
}),
|
|
263
|
+
__metadata("design:type", Object)
|
|
264
|
+
], AIAgentProfileEntity.prototype, "remoteAuth", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
(0, typeorm_1.Column)({
|
|
267
|
+
name: 'Fa2a_protocol',
|
|
268
|
+
type: 'varchar',
|
|
269
|
+
length: 16,
|
|
270
|
+
comment: 'A2A 协议类型: jsonrpc(默认) | rest',
|
|
271
|
+
default: 'jsonrpc',
|
|
272
|
+
}),
|
|
273
|
+
__metadata("design:type", Object)
|
|
274
|
+
], AIAgentProfileEntity.prototype, "a2aProtocol", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
(0, typeorm_1.Column)({
|
|
277
|
+
name: 'Frest_a2a_config',
|
|
278
|
+
type: 'json',
|
|
279
|
+
comment: 'REST 风格 A2A 配置',
|
|
280
|
+
nullable: true,
|
|
281
|
+
}),
|
|
282
|
+
__metadata("design:type", Object)
|
|
283
|
+
], AIAgentProfileEntity.prototype, "restA2AConfig", void 0);
|
|
284
|
+
AIAgentProfileEntity = __decorate([
|
|
285
|
+
(0, typeorm_1.Entity)('t_agent_profile'),
|
|
286
|
+
(0, typeorm_1.Index)(['applicationId']),
|
|
287
|
+
(0, typeorm_1.Index)(['applicationId', 'isDefault'])
|
|
288
|
+
], AIAgentProfileEntity);
|
|
289
|
+
exports.default = AIAgentProfileEntity;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import BaseEntity from '@fefeding/common/dist/models/base/baseORM';
|
|
2
|
+
/**
|
|
3
|
+
* AI 应用实体
|
|
4
|
+
* @table t_application
|
|
5
|
+
*/
|
|
6
|
+
export default class AIApplicationEntity extends BaseEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
key: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
color: string;
|
|
13
|
+
status: string;
|
|
14
|
+
isDefault: number;
|
|
15
|
+
defaultAgentProfileId: number | null;
|
|
16
|
+
agentProfileIds: number[] | null;
|
|
17
|
+
mcpServers: (number | string)[] | null;
|
|
18
|
+
selectedSkills: string[] | null;
|
|
19
|
+
connectorIds: string[] | null;
|
|
20
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
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_application
|
|
20
|
+
*/
|
|
21
|
+
let AIApplicationEntity = class AIApplicationEntity extends baseORM_1.default {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.id = 0;
|
|
25
|
+
this.key = '';
|
|
26
|
+
this.name = '';
|
|
27
|
+
this.description = '';
|
|
28
|
+
this.icon = 'A';
|
|
29
|
+
this.color = '#6B5CE7';
|
|
30
|
+
this.status = 'active';
|
|
31
|
+
this.isDefault = 0;
|
|
32
|
+
this.defaultAgentProfileId = null;
|
|
33
|
+
this.agentProfileIds = null;
|
|
34
|
+
this.mcpServers = null;
|
|
35
|
+
this.selectedSkills = null;
|
|
36
|
+
this.connectorIds = null;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
41
|
+
name: 'id',
|
|
42
|
+
type: 'int',
|
|
43
|
+
comment: '应用ID',
|
|
44
|
+
}),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], AIApplicationEntity.prototype, "id", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
49
|
+
(0, typeorm_1.Column)({
|
|
50
|
+
name: 'Fkey',
|
|
51
|
+
type: 'varchar',
|
|
52
|
+
length: 64,
|
|
53
|
+
comment: '应用唯一标识',
|
|
54
|
+
default: '',
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], AIApplicationEntity.prototype, "key", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({
|
|
60
|
+
name: 'Fname',
|
|
61
|
+
type: 'varchar',
|
|
62
|
+
length: 128,
|
|
63
|
+
comment: '应用名称',
|
|
64
|
+
default: '',
|
|
65
|
+
}),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], AIApplicationEntity.prototype, "name", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({
|
|
70
|
+
name: 'Fdescription',
|
|
71
|
+
type: 'varchar',
|
|
72
|
+
length: 512,
|
|
73
|
+
comment: '描述',
|
|
74
|
+
default: '',
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Object)
|
|
77
|
+
], AIApplicationEntity.prototype, "description", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({
|
|
80
|
+
name: 'Ficon',
|
|
81
|
+
type: 'varchar',
|
|
82
|
+
length: 64,
|
|
83
|
+
comment: '图标',
|
|
84
|
+
default: 'A',
|
|
85
|
+
}),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], AIApplicationEntity.prototype, "icon", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({
|
|
90
|
+
name: 'Fcolor',
|
|
91
|
+
type: 'varchar',
|
|
92
|
+
length: 32,
|
|
93
|
+
comment: '主题色',
|
|
94
|
+
default: '#6B5CE7',
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], AIApplicationEntity.prototype, "color", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({
|
|
100
|
+
name: 'Fstatus',
|
|
101
|
+
type: 'varchar',
|
|
102
|
+
length: 16,
|
|
103
|
+
comment: '状态:active/archived',
|
|
104
|
+
default: 'active',
|
|
105
|
+
}),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], AIApplicationEntity.prototype, "status", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({
|
|
110
|
+
name: 'Fis_default',
|
|
111
|
+
type: 'smallint',
|
|
112
|
+
comment: '是否为默认应用:0-否,1-是',
|
|
113
|
+
default: 0,
|
|
114
|
+
}),
|
|
115
|
+
__metadata("design:type", Object)
|
|
116
|
+
], AIApplicationEntity.prototype, "isDefault", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, typeorm_1.Column)({
|
|
119
|
+
name: 'Fdefault_agent_profile_id',
|
|
120
|
+
type: 'int',
|
|
121
|
+
comment: '默认 Agent Profile ID',
|
|
122
|
+
nullable: true,
|
|
123
|
+
}),
|
|
124
|
+
__metadata("design:type", Number)
|
|
125
|
+
], AIApplicationEntity.prototype, "defaultAgentProfileId", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, typeorm_1.Column)({
|
|
128
|
+
name: 'Fagent_profile_ids',
|
|
129
|
+
type: 'json',
|
|
130
|
+
comment: '关联的 Agent Profile ID 列表',
|
|
131
|
+
nullable: true,
|
|
132
|
+
}),
|
|
133
|
+
__metadata("design:type", Array)
|
|
134
|
+
], AIApplicationEntity.prototype, "agentProfileIds", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.Column)({
|
|
137
|
+
name: 'Fmcp_servers',
|
|
138
|
+
type: 'json',
|
|
139
|
+
comment: '关联的 MCP Server ID 列表',
|
|
140
|
+
nullable: true,
|
|
141
|
+
}),
|
|
142
|
+
__metadata("design:type", Array)
|
|
143
|
+
], AIApplicationEntity.prototype, "mcpServers", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, typeorm_1.Column)({
|
|
146
|
+
name: 'Fselected_skills',
|
|
147
|
+
type: 'json',
|
|
148
|
+
comment: '选定的 Skill 列表',
|
|
149
|
+
nullable: true,
|
|
150
|
+
}),
|
|
151
|
+
__metadata("design:type", Array)
|
|
152
|
+
], AIApplicationEntity.prototype, "selectedSkills", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, typeorm_1.Column)({
|
|
155
|
+
name: 'Fconnector_ids',
|
|
156
|
+
type: 'json',
|
|
157
|
+
comment: '选定的连接器 ID 列表',
|
|
158
|
+
nullable: true,
|
|
159
|
+
}),
|
|
160
|
+
__metadata("design:type", Array)
|
|
161
|
+
], AIApplicationEntity.prototype, "connectorIds", void 0);
|
|
162
|
+
AIApplicationEntity = __decorate([
|
|
163
|
+
(0, typeorm_1.Entity)('t_application'),
|
|
164
|
+
(0, typeorm_1.Index)(['status'])
|
|
165
|
+
], AIApplicationEntity);
|
|
166
|
+
exports.default = AIApplicationEntity;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import BaseEntity from '@fefeding/common/dist/models/base/baseORM';
|
|
2
|
+
/**
|
|
3
|
+
* Agent 记忆实体
|
|
4
|
+
* @table t_work_chat_memory
|
|
5
|
+
*/
|
|
6
|
+
export default class AIChatMemoryEntity extends BaseEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
userId: string;
|
|
9
|
+
threadId: string;
|
|
10
|
+
content: string;
|
|
11
|
+
category: string;
|
|
12
|
+
relevance: number;
|
|
13
|
+
expiresAt: number | null;
|
|
14
|
+
meta: any;
|
|
15
|
+
isDeleted: number;
|
|
16
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
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 记忆实体
|
|
19
|
+
* @table t_work_chat_memory
|
|
20
|
+
*/
|
|
21
|
+
let AIChatMemoryEntity = class AIChatMemoryEntity extends baseORM_1.default {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.id = 0;
|
|
25
|
+
this.userId = '';
|
|
26
|
+
this.threadId = '';
|
|
27
|
+
this.content = '';
|
|
28
|
+
this.category = 'fact';
|
|
29
|
+
this.relevance = 0;
|
|
30
|
+
this.expiresAt = null;
|
|
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
|
+
], AIChatMemoryEntity.prototype, "id", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({
|
|
45
|
+
name: 'Fuser_id',
|
|
46
|
+
type: 'varchar',
|
|
47
|
+
length: 64,
|
|
48
|
+
comment: '用户ID',
|
|
49
|
+
default: '',
|
|
50
|
+
}),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], AIChatMemoryEntity.prototype, "userId", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({
|
|
55
|
+
name: 'Fthread_id',
|
|
56
|
+
type: 'varchar',
|
|
57
|
+
length: 128,
|
|
58
|
+
comment: '线程ID,__long_term__ 表示长期记忆',
|
|
59
|
+
default: '',
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], AIChatMemoryEntity.prototype, "threadId", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({
|
|
65
|
+
name: 'Fcontent',
|
|
66
|
+
type: 'longtext',
|
|
67
|
+
comment: '记忆内容',
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], AIChatMemoryEntity.prototype, "content", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({
|
|
73
|
+
name: 'Fcategory',
|
|
74
|
+
type: 'varchar',
|
|
75
|
+
length: 16,
|
|
76
|
+
comment: '分类:fact/preference/summary/entity/task',
|
|
77
|
+
default: 'fact',
|
|
78
|
+
}),
|
|
79
|
+
__metadata("design:type", Object)
|
|
80
|
+
], AIChatMemoryEntity.prototype, "category", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({
|
|
83
|
+
name: 'Frelevance',
|
|
84
|
+
type: 'float',
|
|
85
|
+
comment: '相关度评分',
|
|
86
|
+
default: 0,
|
|
87
|
+
}),
|
|
88
|
+
__metadata("design:type", Object)
|
|
89
|
+
], AIChatMemoryEntity.prototype, "relevance", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, typeorm_1.Column)({
|
|
92
|
+
name: 'Fexpires_at',
|
|
93
|
+
type: 'bigint',
|
|
94
|
+
comment: '过期时间戳(毫秒),NULL 表示不过期',
|
|
95
|
+
nullable: true,
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", Number)
|
|
98
|
+
], AIChatMemoryEntity.prototype, "expiresAt", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)({
|
|
101
|
+
name: 'Fmeta',
|
|
102
|
+
type: 'json',
|
|
103
|
+
comment: '扩展元数据',
|
|
104
|
+
nullable: true,
|
|
105
|
+
}),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], AIChatMemoryEntity.prototype, "meta", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({
|
|
110
|
+
name: 'Fis_deleted',
|
|
111
|
+
type: 'smallint',
|
|
112
|
+
comment: '删除标记:0-正常,1-已删除',
|
|
113
|
+
default: 0,
|
|
114
|
+
}),
|
|
115
|
+
__metadata("design:type", Object)
|
|
116
|
+
], AIChatMemoryEntity.prototype, "isDeleted", void 0);
|
|
117
|
+
AIChatMemoryEntity = __decorate([
|
|
118
|
+
(0, typeorm_1.Entity)('t_work_chat_memory'),
|
|
119
|
+
(0, typeorm_1.Index)(['userId', 'threadId']),
|
|
120
|
+
(0, typeorm_1.Index)(['userId', 'category']),
|
|
121
|
+
(0, typeorm_1.Index)(['expiresAt'])
|
|
122
|
+
], AIChatMemoryEntity);
|
|
123
|
+
exports.default = AIChatMemoryEntity;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import BaseEntity from '@fefeding/common/dist/models/base/baseORM';
|
|
2
|
+
/**
|
|
3
|
+
* AI 对话消息实体
|
|
4
|
+
* @table t_work_chat_message
|
|
5
|
+
*/
|
|
6
|
+
export default class AIChatMessageEntity extends BaseEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
applicationId: number;
|
|
9
|
+
userId: string;
|
|
10
|
+
threadId: number;
|
|
11
|
+
role: string;
|
|
12
|
+
type: string;
|
|
13
|
+
content: string;
|
|
14
|
+
meta: any;
|
|
15
|
+
isDeleted: number;
|
|
16
|
+
}
|