@metad/contracts 3.6.2 → 3.7.0
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 +2 -2
- package/index.cjs.js +260 -464
- package/index.esm.js +245 -465
- package/package.json +2 -2
- package/src/agent/graph.d.ts +3 -0
- package/src/agent/variables.d.ts +4 -2
- package/src/ai/index.d.ts +3 -0
- package/src/ai/knowledge-doc-chunk.model.d.ts +1 -0
- package/src/ai/knowledge-doc.model.d.ts +33 -3
- package/src/ai/knowledgebase.model.d.ts +13 -1
- package/src/ai/middleware.model.d.ts +18 -0
- package/src/ai/skill.model.d.ts +181 -0
- package/src/ai/types.d.ts +33 -1
- package/src/ai/xpert-agent.model.d.ts +12 -0
- package/src/ai/xpert-table.model.d.ts +84 -0
- package/src/ai/xpert-tool-mcp.model.d.ts +5 -0
- package/src/ai/xpert-tool.model.d.ts +7 -0
- package/src/ai/xpert-workflow.model.d.ts +42 -7
- package/src/ai/xpert.model.d.ts +25 -3
- package/src/ai/xpert.utils.d.ts +0 -3
- package/src/analytics/gateway.d.ts +1 -0
- package/src/analytics/indicator.d.ts +5 -6
- package/src/analytics/semantic-model-entity.d.ts +1 -0
- package/src/analytics/semantic-model-member.d.ts +3 -0
- package/src/analytics/semantic-model.d.ts +8 -0
- package/src/plugin.d.ts +1 -1
- package/src/types.d.ts +6 -2
package/package.json
CHANGED
package/src/agent/graph.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ export declare const GRAPH_NODE_SUMMARIZE_CONVERSATION = "summarize_conversation
|
|
|
15
15
|
export declare const GRAPH_NODE_TITLE_CONVERSATION = "title_conversation";
|
|
16
16
|
export declare const STATE_VARIABLE_FILES = "files";
|
|
17
17
|
export declare const STATE_VARIABLE_INPUT = "input";
|
|
18
|
+
export declare const STATE_SYS_VOLUME = "volume";
|
|
19
|
+
export declare const STATE_SYS_WORKSPACE_PATH = "workspace_path";
|
|
20
|
+
export declare const STATE_SYS_WORKSPACE_URL = "workspace_url";
|
|
18
21
|
export declare const STATE_VARIABLE_TITLE_CHANNEL: string;
|
|
19
22
|
export type TMessageChannel = {
|
|
20
23
|
system: string;
|
package/src/agent/variables.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TWorkflowVarGroup } from "../ai";
|
|
1
|
+
import { TWorkflowVarGroup } from "../ai/xpert-workflow.model";
|
|
2
|
+
import { TXpertParameter } from "../ai/xpert.model";
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
4
5
|
* Returns the variable schema for a given variable name.
|
|
@@ -10,5 +11,6 @@ import { TWorkflowVarGroup } from "../ai";
|
|
|
10
11
|
*/
|
|
11
12
|
export declare function getVariableSchema(variables: TWorkflowVarGroup[], variable: string): {
|
|
12
13
|
group: TWorkflowVarGroup;
|
|
13
|
-
variable: import("../ai").TStateVariable;
|
|
14
|
+
variable: import("../ai/xpert.model").TStateVariable;
|
|
14
15
|
};
|
|
16
|
+
export declare const FILE_VARIABLES: TXpertParameter[];
|
package/src/ai/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from './xpert-agent.model';
|
|
|
23
23
|
export * from './xpert-tool.model';
|
|
24
24
|
export * from './xpert-toolset.model';
|
|
25
25
|
export * from './xpert-workspace.model';
|
|
26
|
+
export * from './xpert-table.model';
|
|
26
27
|
export * from './xpert.model';
|
|
27
28
|
export * from './xpert.utils';
|
|
28
29
|
export * from './types';
|
|
@@ -37,3 +38,5 @@ export * from './knowledgebase-task.model';
|
|
|
37
38
|
export * from './knowledge-pipeline';
|
|
38
39
|
export * from './knowledge-retrieval-log.model';
|
|
39
40
|
export * from './knowledge-doc-chunk.model';
|
|
41
|
+
export * from './skill.model';
|
|
42
|
+
export * from './middleware.model';
|
|
@@ -3,11 +3,12 @@ import { IIntegration } from '../integration.model';
|
|
|
3
3
|
import { IStorageFile } from '../storage-file.model';
|
|
4
4
|
import { IKnowledgeDocumentPage } from './knowledge-doc-page.model';
|
|
5
5
|
import { IKnowledgebaseTask } from './knowledgebase-task.model';
|
|
6
|
-
import { IKnowledgebase } from './knowledgebase.model';
|
|
6
|
+
import { IKnowledgebase, KBMetadataFieldDef } from './knowledgebase.model';
|
|
7
7
|
import { TRagWebOptions } from './rag-web';
|
|
8
8
|
import { IKnowledgeDocumentChunk } from './knowledge-doc-chunk.model';
|
|
9
9
|
import { DocumentSourceProviderCategoryEnum } from './knowledge-pipeline';
|
|
10
10
|
import { TCopilotModel } from './copilot-model.model';
|
|
11
|
+
import { I18nObject } from '../types';
|
|
11
12
|
export type DocumentParserConfig = {
|
|
12
13
|
pages?: number[][];
|
|
13
14
|
replaceWhitespace?: boolean;
|
|
@@ -170,14 +171,34 @@ export type TKnowledgeDocument = {
|
|
|
170
171
|
/**
|
|
171
172
|
* Document, include file, web pages, folder, virtual, etc.
|
|
172
173
|
*/
|
|
173
|
-
export interface IKnowledgeDocument<T =
|
|
174
|
+
export interface IKnowledgeDocument<T extends KnowledgeDocumentMetadata = KnowledgeDocumentMetadata> extends TKnowledgeDocument, IBasePerTenantAndOrganizationEntityModel {
|
|
174
175
|
parent?: IKnowledgeDocument | null;
|
|
175
176
|
children?: IKnowledgeDocument[];
|
|
176
177
|
knowledgebase?: IKnowledgebase;
|
|
177
178
|
draft?: TKnowledgeDocument;
|
|
178
179
|
metadata?: T;
|
|
179
180
|
}
|
|
180
|
-
|
|
181
|
+
/**
|
|
182
|
+
* System built-in standard document Metadata structure
|
|
183
|
+
*/
|
|
184
|
+
export interface StandardDocumentMetadata {
|
|
185
|
+
originalFileName?: string;
|
|
186
|
+
originalFileSize?: string | null;
|
|
187
|
+
uploadTime?: string;
|
|
188
|
+
lastUpdatedTime?: string;
|
|
189
|
+
source?: string;
|
|
190
|
+
segmentRule?: string;
|
|
191
|
+
segmentLength?: number;
|
|
192
|
+
averageSegmentLength?: string;
|
|
193
|
+
segmentCount?: number;
|
|
194
|
+
recallRate?: string;
|
|
195
|
+
embedTime?: string;
|
|
196
|
+
embedCost?: string | null;
|
|
197
|
+
tokens?: number;
|
|
198
|
+
}
|
|
199
|
+
export interface KnowledgeDocumentMetadata extends StandardDocumentMetadata {
|
|
200
|
+
[key: string]: any;
|
|
201
|
+
}
|
|
181
202
|
export interface IKnowledgeDocumentCreateInput extends IKnowledgeDocument, IBasePerTenantAndOrganizationEntityModel {
|
|
182
203
|
}
|
|
183
204
|
export interface IKnowledgeDocumentUpdateInput extends Partial<IKnowledgeDocumentCreateInput> {
|
|
@@ -190,3 +211,12 @@ export declare function isImageType(type: string): boolean;
|
|
|
190
211
|
export declare function isVideoType(type: string): boolean;
|
|
191
212
|
export declare function isAudioType(type: string): boolean;
|
|
192
213
|
export declare function classificateDocumentCategory(entity: Partial<IKnowledgeDocument>): KBDocumentCategoryEnum;
|
|
214
|
+
/**
|
|
215
|
+
* System standard Metadata field definition constants
|
|
216
|
+
* It can be used for rendering, validation, sorting, displaying descriptions, etc.
|
|
217
|
+
*/
|
|
218
|
+
export declare const STANDARD_METADATA_FIELDS: {
|
|
219
|
+
group: I18nObject;
|
|
220
|
+
fields: KBMetadataFieldDef[];
|
|
221
|
+
}[];
|
|
222
|
+
export type StandardMetadataFieldKey = typeof STANDARD_METADATA_FIELDS[number]['fields'][number]['key'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICopilotModel } from './copilot-model.model';
|
|
2
|
-
import { TAvatar } from '../types';
|
|
2
|
+
import { I18nObject, TAvatar } from '../types';
|
|
3
3
|
import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
|
|
4
4
|
import { IKnowledgeDocument } from './knowledge-doc.model';
|
|
5
5
|
import { IXpert } from './xpert.model';
|
|
@@ -89,6 +89,10 @@ export type TKnowledgebase = {
|
|
|
89
89
|
*/
|
|
90
90
|
recall?: TKBRecallParams;
|
|
91
91
|
status?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Metadata custom field definition array
|
|
94
|
+
*/
|
|
95
|
+
metadataSchema?: KBMetadataFieldDef[];
|
|
92
96
|
/**
|
|
93
97
|
* API service enabled
|
|
94
98
|
*/
|
|
@@ -145,6 +149,14 @@ export type DocumentMetadata = IDocChunkMetadata & {
|
|
|
145
149
|
score?: number;
|
|
146
150
|
relevanceScore?: number;
|
|
147
151
|
} & Record<string, any>;
|
|
152
|
+
export type MetadataFieldType = 'string' | 'number' | 'boolean' | 'enum' | 'datetime' | 'string[]' | 'number[]' | 'object';
|
|
153
|
+
export type KBMetadataFieldDef = {
|
|
154
|
+
key: string;
|
|
155
|
+
label?: I18nObject;
|
|
156
|
+
type: MetadataFieldType;
|
|
157
|
+
enumValues?: string[];
|
|
158
|
+
description?: string;
|
|
159
|
+
};
|
|
148
160
|
/**
|
|
149
161
|
* Channel name for knowledgebase pipeline
|
|
150
162
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IWorkflowNode, WorkflowNodeTypeEnum } from "./xpert-workflow.model";
|
|
2
|
+
import { I18nObject, IconDefinition } from "../types";
|
|
3
|
+
import { TXpertGraph, TXpertTeamNode } from "./xpert.model";
|
|
4
|
+
import { JsonSchemaObjectType } from "./types";
|
|
5
|
+
export interface IWFNMiddleware extends IWorkflowNode {
|
|
6
|
+
type: WorkflowNodeTypeEnum.MIDDLEWARE;
|
|
7
|
+
provider: string;
|
|
8
|
+
options?: Record<string, any>;
|
|
9
|
+
}
|
|
10
|
+
export declare function genXpertMiddlewareKey(): string;
|
|
11
|
+
export type TAgentMiddlewareMeta = {
|
|
12
|
+
name: string;
|
|
13
|
+
label: I18nObject;
|
|
14
|
+
icon?: IconDefinition;
|
|
15
|
+
description?: I18nObject;
|
|
16
|
+
configSchema?: JsonSchemaObjectType;
|
|
17
|
+
};
|
|
18
|
+
export declare function getAgentMiddlewareNodes(graph: TXpertGraph, agentKey: string): TXpertTeamNode[];
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from "../base-entity.model";
|
|
2
|
+
import { I18nObject, IconDefinition } from "../types";
|
|
3
|
+
import { JsonSchemaObjectType } from "./types";
|
|
4
|
+
import { IWorkflowNode, WorkflowNodeTypeEnum } from "./xpert-workflow.model";
|
|
5
|
+
import { IBasePerWorkspaceEntityModel } from "./xpert-workspace.model";
|
|
6
|
+
export type SkillId = string;
|
|
7
|
+
export interface SkillMetadata {
|
|
8
|
+
name: string;
|
|
9
|
+
displayName?: I18nObject;
|
|
10
|
+
version: string;
|
|
11
|
+
summary?: I18nObject;
|
|
12
|
+
description?: I18nObject;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
author?: {
|
|
15
|
+
name: string;
|
|
16
|
+
email?: string;
|
|
17
|
+
org?: string;
|
|
18
|
+
};
|
|
19
|
+
license?: string;
|
|
20
|
+
visibility: 'private' | 'team' | 'tenant' | 'public';
|
|
21
|
+
categories?: string[];
|
|
22
|
+
runtime?: {
|
|
23
|
+
entry?: string;
|
|
24
|
+
language?: 'js' | 'py' | 'bash';
|
|
25
|
+
permissions?: string[];
|
|
26
|
+
tools?: string[];
|
|
27
|
+
};
|
|
28
|
+
mcp?: {
|
|
29
|
+
servers?: string[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface SkillResourcesIndex {
|
|
33
|
+
files: Array<{
|
|
34
|
+
path: string;
|
|
35
|
+
kind: 'script' | 'template' | 'doc' | 'asset';
|
|
36
|
+
hash: string;
|
|
37
|
+
size: number;
|
|
38
|
+
}>;
|
|
39
|
+
chunks?: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
path: string;
|
|
42
|
+
summary: string;
|
|
43
|
+
tokens: number;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
export interface TSkillPackage {
|
|
47
|
+
metadata: SkillMetadata;
|
|
48
|
+
instructions: {
|
|
49
|
+
system?: string;
|
|
50
|
+
developer?: string;
|
|
51
|
+
examples?: Array<{
|
|
52
|
+
user: string;
|
|
53
|
+
assistant: string;
|
|
54
|
+
}>;
|
|
55
|
+
guidelines?: string[];
|
|
56
|
+
};
|
|
57
|
+
resources?: SkillResourcesIndex;
|
|
58
|
+
abac?: {
|
|
59
|
+
owners: string[];
|
|
60
|
+
readers: string[];
|
|
61
|
+
writers: string[];
|
|
62
|
+
policies?: any;
|
|
63
|
+
};
|
|
64
|
+
signatures?: string[];
|
|
65
|
+
provenance?: any;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* 表示一个仓库(如 anthropics/skills)
|
|
69
|
+
*/
|
|
70
|
+
export interface ISkillRepository<O = Record<string, any>, C = Record<string, any>> extends IBasePerTenantAndOrganizationEntityModel {
|
|
71
|
+
name: string;
|
|
72
|
+
provider: string;
|
|
73
|
+
/**
|
|
74
|
+
* Provider credentials such as GitHub tokens
|
|
75
|
+
*/
|
|
76
|
+
credentials?: C;
|
|
77
|
+
/**
|
|
78
|
+
* Options configured using the strategy's configSchema
|
|
79
|
+
*/
|
|
80
|
+
options?: O;
|
|
81
|
+
lastSyncAt?: string;
|
|
82
|
+
deletedAt?: Date;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 仓库同步扫描得到的技能索引(每个技能目录一条)
|
|
86
|
+
*/
|
|
87
|
+
export interface ISkillRepositoryIndex extends IBasePerTenantAndOrganizationEntityModel {
|
|
88
|
+
repositoryId: string;
|
|
89
|
+
repository?: ISkillRepository;
|
|
90
|
+
skillPath: string;
|
|
91
|
+
skillId: string;
|
|
92
|
+
name?: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
license?: string;
|
|
95
|
+
tags?: string[];
|
|
96
|
+
version?: string;
|
|
97
|
+
resources?: any[];
|
|
98
|
+
deletedAt?: Date;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* 安装后的技能包主记录(skill.yaml)
|
|
102
|
+
*/
|
|
103
|
+
export interface ISkillPackage extends IBasePerWorkspaceEntityModel, TSkillPackage {
|
|
104
|
+
skillIndexId?: SkillId;
|
|
105
|
+
skillIndex?: ISkillRepositoryIndex;
|
|
106
|
+
name?: any;
|
|
107
|
+
visibility: 'private' | 'team' | 'tenant';
|
|
108
|
+
packagePath?: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* 技能的版本(1个 Skill 多版本共存)
|
|
112
|
+
*/
|
|
113
|
+
export interface ISkillVersion extends IBasePerWorkspaceEntityModel {
|
|
114
|
+
packageId: string;
|
|
115
|
+
version: string;
|
|
116
|
+
metadata: any;
|
|
117
|
+
instructions: any;
|
|
118
|
+
installedAt?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 技能资源文件(scripts/templates/assets)记录
|
|
122
|
+
*/
|
|
123
|
+
export interface ISkillResource extends IBasePerWorkspaceEntityModel {
|
|
124
|
+
versionId: string;
|
|
125
|
+
path: string;
|
|
126
|
+
type: 'script' | 'template' | 'asset' | 'doc';
|
|
127
|
+
hash?: string;
|
|
128
|
+
size?: number;
|
|
129
|
+
meta?: any;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* 租户/组织/团队/用户安装行为记录
|
|
133
|
+
*/
|
|
134
|
+
export interface ISkillInstallation extends IBasePerTenantAndOrganizationEntityModel {
|
|
135
|
+
versionId: string;
|
|
136
|
+
installedBy: string;
|
|
137
|
+
visibility: 'private' | 'team' | 'tenant';
|
|
138
|
+
targetScope?: string;
|
|
139
|
+
status: 'pending' | 'installed' | 'failed';
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* 技能安装过程中详细日志
|
|
143
|
+
*/
|
|
144
|
+
export interface ISkillInstallLog extends IBasePerTenantAndOrganizationEntityModel {
|
|
145
|
+
installationId: string;
|
|
146
|
+
level: 'info' | 'warn' | 'error';
|
|
147
|
+
message: string;
|
|
148
|
+
timestamp: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* 技能运行期审计日志
|
|
152
|
+
*/
|
|
153
|
+
export interface ISkillAuditLog extends IBasePerTenantAndOrganizationEntityModel {
|
|
154
|
+
skillId: string;
|
|
155
|
+
versionId: string;
|
|
156
|
+
sessionId: string;
|
|
157
|
+
eventType: string;
|
|
158
|
+
metadata: any;
|
|
159
|
+
}
|
|
160
|
+
export type TSkillSourceMeta = {
|
|
161
|
+
/**
|
|
162
|
+
* Provider name, e.g. github / git / zip / marketplace
|
|
163
|
+
*/
|
|
164
|
+
name: string;
|
|
165
|
+
label: I18nObject;
|
|
166
|
+
icon?: IconDefinition;
|
|
167
|
+
description?: I18nObject;
|
|
168
|
+
/**
|
|
169
|
+
* Optional configuration schema for frontend forms
|
|
170
|
+
*/
|
|
171
|
+
configSchema?: JsonSchemaObjectType;
|
|
172
|
+
/**
|
|
173
|
+
* Credential schema for source authentication
|
|
174
|
+
*/
|
|
175
|
+
credentialSchema?: JsonSchemaObjectType;
|
|
176
|
+
};
|
|
177
|
+
export interface IWFNSkill extends IWorkflowNode {
|
|
178
|
+
type: WorkflowNodeTypeEnum.SKILL;
|
|
179
|
+
skills?: string[];
|
|
180
|
+
}
|
|
181
|
+
export declare function genXpertSkillKey(): string;
|
package/src/ai/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonSchema7TypeUnion } from "zod-to-json-schema";
|
|
2
|
+
import { I18nObject, TSelectOption } from "../types";
|
|
2
3
|
import { TXpertAttachmentType, XpertParameterTypeEnum } from "./xpert.model";
|
|
3
4
|
export type TErrorHandling = {
|
|
4
5
|
type?: null | 'defaultValue' | 'failBranch';
|
|
@@ -37,3 +38,34 @@ export declare enum EmbeddingStatusEnum {
|
|
|
37
38
|
REQUIRED = "required"
|
|
38
39
|
}
|
|
39
40
|
export declare const Attachment_Type_Options: TSelectOption<string, TXpertAttachmentType>[];
|
|
41
|
+
type JsonSchema7Meta = {
|
|
42
|
+
title?: I18nObject;
|
|
43
|
+
default?: any;
|
|
44
|
+
description?: I18nObject;
|
|
45
|
+
markdownDescription?: I18nObject;
|
|
46
|
+
/**
|
|
47
|
+
* UI schema extensions
|
|
48
|
+
*/
|
|
49
|
+
'x-ui'?: {
|
|
50
|
+
/**
|
|
51
|
+
* UI component variant, or custom component name
|
|
52
|
+
*/
|
|
53
|
+
component?: 'textarea' | 'select' | 'radio' | 'checkbox' | 'switch' | 'password' | string;
|
|
54
|
+
/**
|
|
55
|
+
* UI component display span (for grid layouts)
|
|
56
|
+
*/
|
|
57
|
+
span?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Additional inputs for the Custom UI component
|
|
60
|
+
*/
|
|
61
|
+
inputs?: Record<string, unknown>;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export type JsonSchemaObjectType = {
|
|
65
|
+
type: "object";
|
|
66
|
+
properties: Record<string, JsonSchema7Type>;
|
|
67
|
+
additionalProperties?: boolean | JsonSchema7Type;
|
|
68
|
+
required?: string[];
|
|
69
|
+
};
|
|
70
|
+
type JsonSchema7Type = (JsonSchema7TypeUnion | JsonSchemaObjectType) & JsonSchema7Meta;
|
|
71
|
+
export {};
|
|
@@ -144,9 +144,21 @@ export type TXpertAgentOptions = {
|
|
|
144
144
|
*/
|
|
145
145
|
vision?: {
|
|
146
146
|
enabled?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Variable name that store the list of files to be understood
|
|
149
|
+
*/
|
|
147
150
|
variable?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Image resolution for vision tasks
|
|
153
|
+
*/
|
|
148
154
|
resolution?: 'high' | 'low';
|
|
149
155
|
};
|
|
156
|
+
/**
|
|
157
|
+
* Config of middlewares for agent
|
|
158
|
+
*/
|
|
159
|
+
middlewares?: {
|
|
160
|
+
order: string[];
|
|
161
|
+
};
|
|
150
162
|
};
|
|
151
163
|
export type TAgentPromptTemplate = {
|
|
152
164
|
id: string;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { IWorkflowNode, WorkflowNodeTypeEnum } from './xpert-workflow.model';
|
|
2
|
+
import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
|
|
3
|
+
/**
|
|
4
|
+
* Table status
|
|
5
|
+
*/
|
|
6
|
+
export declare enum XpertTableStatus {
|
|
7
|
+
DRAFT = "draft",
|
|
8
|
+
READY = "ready",
|
|
9
|
+
PENDING_ACTIVATION = "pendingActivation",
|
|
10
|
+
ACTIVE = "active",
|
|
11
|
+
NEEDS_MIGRATION = "needsMigration",
|
|
12
|
+
DEPRECATED = "deprecated",
|
|
13
|
+
ERROR = "error"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Custom Table for Xpert
|
|
17
|
+
*/
|
|
18
|
+
export interface IXpertTable extends IBasePerWorkspaceEntityModel, TXpertTable {
|
|
19
|
+
}
|
|
20
|
+
export type TXpertTable = {
|
|
21
|
+
name: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
database?: string;
|
|
24
|
+
schema?: string;
|
|
25
|
+
columns?: TXpertTableColumn[];
|
|
26
|
+
status: XpertTableStatus;
|
|
27
|
+
version?: number;
|
|
28
|
+
activatedAt?: Date;
|
|
29
|
+
message?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Union type for all supported database types
|
|
33
|
+
* Used when database type is not yet determined or needs to support multiple databases
|
|
34
|
+
*/
|
|
35
|
+
export type DatabaseDataType = string;
|
|
36
|
+
export type TXpertTableColumn = {
|
|
37
|
+
name: string;
|
|
38
|
+
type: DatabaseDataType;
|
|
39
|
+
label?: string;
|
|
40
|
+
required?: boolean;
|
|
41
|
+
isPrimaryKey?: boolean;
|
|
42
|
+
isUnique?: boolean;
|
|
43
|
+
autoIncrement?: boolean;
|
|
44
|
+
defaultValue?: string;
|
|
45
|
+
length?: number;
|
|
46
|
+
precision?: number;
|
|
47
|
+
scale?: number;
|
|
48
|
+
enumValues?: string[];
|
|
49
|
+
setValues?: string[];
|
|
50
|
+
};
|
|
51
|
+
export interface IWorkflowNodeDBOperation extends IWorkflowNode {
|
|
52
|
+
tableId: string;
|
|
53
|
+
}
|
|
54
|
+
export interface IWFNDBInsert extends IWorkflowNodeDBOperation {
|
|
55
|
+
type: WorkflowNodeTypeEnum.DB_INSERT;
|
|
56
|
+
columns?: Record<string, {
|
|
57
|
+
type: DatabaseDataType;
|
|
58
|
+
value?: any;
|
|
59
|
+
valueSelector?: string;
|
|
60
|
+
}>;
|
|
61
|
+
}
|
|
62
|
+
export declare function genXpertDBInsertKey(): string;
|
|
63
|
+
export interface IWFNDBUpdate extends IWorkflowNodeDBOperation {
|
|
64
|
+
type: WorkflowNodeTypeEnum.DB_UPDATE;
|
|
65
|
+
columns?: Record<string, {
|
|
66
|
+
type: DatabaseDataType;
|
|
67
|
+
value?: any;
|
|
68
|
+
valueSelector?: string;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
export declare function genXpertDBUpdateKey(): string;
|
|
72
|
+
export interface IWFNDBDelete extends IWorkflowNodeDBOperation {
|
|
73
|
+
type: WorkflowNodeTypeEnum.DB_DELETE;
|
|
74
|
+
}
|
|
75
|
+
export declare function genXpertDBDeleteKey(): string;
|
|
76
|
+
export interface IWFNDBQuery extends IWorkflowNodeDBOperation {
|
|
77
|
+
type: WorkflowNodeTypeEnum.DB_QUERY;
|
|
78
|
+
}
|
|
79
|
+
export declare function genXpertDBQueryKey(): string;
|
|
80
|
+
export interface IWFNDBSql extends IWorkflowNodeDBOperation {
|
|
81
|
+
type: WorkflowNodeTypeEnum.DB_SQL;
|
|
82
|
+
sqlTemplate?: string;
|
|
83
|
+
}
|
|
84
|
+
export declare function genXpertDBSqlKey(): string;
|
|
@@ -51,6 +51,11 @@ export type TMCPServer = {
|
|
|
51
51
|
url?: string;
|
|
52
52
|
headers?: Record<string, string>;
|
|
53
53
|
useNodeEventSource?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Default timeout in milliseconds for tool execution. Must be greater than 0.
|
|
56
|
+
* If not specified, tools will use their own configured timeout values.
|
|
57
|
+
*/
|
|
58
|
+
defaultToolTimeout?: number;
|
|
54
59
|
files?: {
|
|
55
60
|
name: string;
|
|
56
61
|
content: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSONSchema4 } from "json-schema";
|
|
1
2
|
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
3
|
import { I18nObject } from '../types';
|
|
3
4
|
import { AiProviderRole } from './copilot.model';
|
|
@@ -10,6 +11,7 @@ export interface IXpertTool extends IBasePerTenantAndOrganizationEntityModel, Xp
|
|
|
10
11
|
}
|
|
11
12
|
export type XpertToolType = {
|
|
12
13
|
name: string;
|
|
14
|
+
label?: I18nObject | string;
|
|
13
15
|
description?: string;
|
|
14
16
|
avatar?: TAvatar;
|
|
15
17
|
/**
|
|
@@ -93,7 +95,12 @@ export interface ApiToolBundle {
|
|
|
93
95
|
method: string;
|
|
94
96
|
summary?: string;
|
|
95
97
|
operation_id?: string;
|
|
98
|
+
/**
|
|
99
|
+
* parameters
|
|
100
|
+
* @deprecated use schema
|
|
101
|
+
*/
|
|
96
102
|
parameters?: TToolParameter[];
|
|
103
|
+
schema?: JSONSchema4;
|
|
97
104
|
author: string;
|
|
98
105
|
icon?: string;
|
|
99
106
|
openapi: Record<string, any>;
|
|
@@ -2,7 +2,7 @@ import { I18nObject, IconDefinition } from "../types";
|
|
|
2
2
|
import { ICopilotModel } from "./copilot-model.model";
|
|
3
3
|
import { TKBRecallParams } from "./knowledgebase.model";
|
|
4
4
|
import { ApiAuthType, TErrorHandling, TXpertRefParameter } from "./types";
|
|
5
|
-
import { TStateVariable, TXpertParameter } from "./xpert.model";
|
|
5
|
+
import { TKBRetrievalSettings, TStateVariable, TXpertParameter } from "./xpert.model";
|
|
6
6
|
export type TWorkflowNodeMeta = {
|
|
7
7
|
name: string;
|
|
8
8
|
label: I18nObject;
|
|
@@ -26,13 +26,8 @@ export declare enum WorkflowNodeTypeEnum {
|
|
|
26
26
|
LIST_OPERATOR = "list-operator",
|
|
27
27
|
VARIABLE_AGGREGATOR = "variable-aggregator",
|
|
28
28
|
ITERATING = "iterating",
|
|
29
|
-
ANSWER = "answer",
|
|
30
|
-
CODE = "code",
|
|
31
29
|
HTTP = "http",
|
|
32
|
-
KNOWLEDGE = "knowledge",
|
|
33
30
|
SUBFLOW = "subflow",
|
|
34
|
-
TEMPLATE = "template",
|
|
35
|
-
CLASSIFIER = "classifier",
|
|
36
31
|
TOOL = "tool",
|
|
37
32
|
AGENT_TOOL = "agent-tool",
|
|
38
33
|
NOTE = "note",
|
|
@@ -44,7 +39,36 @@ export declare enum WorkflowNodeTypeEnum {
|
|
|
44
39
|
PROCESSOR = "processor",
|
|
45
40
|
CHUNKER = "chunker",
|
|
46
41
|
UNDERSTANDING = "understanding",
|
|
47
|
-
KNOWLEDGE_BASE = "knowledgebase"
|
|
42
|
+
KNOWLEDGE_BASE = "knowledgebase",
|
|
43
|
+
CLASSIFIER = "classifier",
|
|
44
|
+
KNOWLEDGE = "knowledge",
|
|
45
|
+
CODE = "code",
|
|
46
|
+
TEMPLATE = "template",
|
|
47
|
+
ANSWER = "answer",
|
|
48
|
+
JSON_STRINGIFY = "json-stringify",
|
|
49
|
+
JSON_PARSE = "json-parse",
|
|
50
|
+
/**
|
|
51
|
+
* Custom SQL
|
|
52
|
+
*/
|
|
53
|
+
DB_SQL = "db-sql",
|
|
54
|
+
/**
|
|
55
|
+
* Insert data (INSERT)
|
|
56
|
+
*/
|
|
57
|
+
DB_INSERT = "db-insert",
|
|
58
|
+
/**
|
|
59
|
+
* Update data (UPDATE)
|
|
60
|
+
*/
|
|
61
|
+
DB_UPDATE = "db-update",
|
|
62
|
+
/**
|
|
63
|
+
* Delete data (DELETE)
|
|
64
|
+
*/
|
|
65
|
+
DB_DELETE = "db-delete",
|
|
66
|
+
/**
|
|
67
|
+
* Query data (SELECT)
|
|
68
|
+
*/
|
|
69
|
+
DB_QUERY = "db-query",
|
|
70
|
+
MIDDLEWARE = "middleware",
|
|
71
|
+
SKILL = "skill"
|
|
48
72
|
}
|
|
49
73
|
export interface IWorkflowNode {
|
|
50
74
|
id: string;
|
|
@@ -270,6 +294,7 @@ export interface IWFNKnowledgeRetrieval extends IWorkflowNode {
|
|
|
270
294
|
queryVariable: string;
|
|
271
295
|
knowledgebases: string[];
|
|
272
296
|
recall?: TKBRecallParams;
|
|
297
|
+
retrieval?: TKBRetrievalSettings;
|
|
273
298
|
}
|
|
274
299
|
export interface IWFNSubflow extends IWorkflowNode {
|
|
275
300
|
inputParams?: TXpertRefParameter[];
|
|
@@ -355,9 +380,19 @@ export interface IWFNTask extends IWorkflowNode {
|
|
|
355
380
|
descriptionPrefix?: string;
|
|
356
381
|
descriptionSuffix?: string;
|
|
357
382
|
}
|
|
383
|
+
export interface IWFNJSONStringify extends IWorkflowNode {
|
|
384
|
+
type: WorkflowNodeTypeEnum.JSON_STRINGIFY;
|
|
385
|
+
inputVariable: string;
|
|
386
|
+
}
|
|
387
|
+
export interface IWFNJSONParse extends IWorkflowNode {
|
|
388
|
+
type: WorkflowNodeTypeEnum.JSON_PARSE;
|
|
389
|
+
inputVariable: string;
|
|
390
|
+
}
|
|
358
391
|
export declare function genXpertTriggerKey(): string;
|
|
359
392
|
export declare function genListOperatorKey(): string;
|
|
360
393
|
export declare function genVariableAggregatorKey(): string;
|
|
394
|
+
export declare function genJSONStringifyKey(): string;
|
|
395
|
+
export declare function genJSONParseKey(): string;
|
|
361
396
|
export declare function isAgentKey(key: string): boolean;
|
|
362
397
|
export declare function isRouterKey(key: string): boolean;
|
|
363
398
|
export declare function isIteratingKey(key: string): boolean;
|