@xpert-ai/contracts 3.9.0-beta.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 +3 -0
- package/index.cjs.js +4945 -0
- package/index.d.ts +1 -0
- package/index.esm.js +4792 -0
- package/package.json +25 -0
- package/src/agent/ai-model.d.ts +9 -0
- package/src/agent/graph.d.ts +182 -0
- package/src/agent/index.d.ts +6 -0
- package/src/agent/interrupt.d.ts +51 -0
- package/src/agent/token.d.ts +21 -0
- package/src/agent/utils.d.ts +19 -0
- package/src/agent/variables.d.ts +16 -0
- package/src/ai/ai-model.model.d.ts +198 -0
- package/src/ai/ai-provider.model.d.ts +43 -0
- package/src/ai/ai.model.d.ts +82 -0
- package/src/ai/assistant-binding.model.d.ts +81 -0
- package/src/ai/chat-event.model.d.ts +8 -0
- package/src/ai/chat-message-feedback.model.d.ts +24 -0
- package/src/ai/chat-message.model.d.ts +93 -0
- package/src/ai/chat.model.d.ts +191 -0
- package/src/ai/copilot-checkpoint.model.d.ts +23 -0
- package/src/ai/copilot-example.model.d.ts +19 -0
- package/src/ai/copilot-model.model.d.ts +30 -0
- package/src/ai/copilot-organization.model.d.ts +17 -0
- package/src/ai/copilot-provider.model.d.ts +31 -0
- package/src/ai/copilot-role.model.d.ts +43 -0
- package/src/ai/copilot-store.model.d.ts +29 -0
- package/src/ai/copilot-user.model.d.ts +27 -0
- package/src/ai/copilot.model.d.ts +36 -0
- package/src/ai/environment.model.d.ts +16 -0
- package/src/ai/feature.model.d.ts +10 -0
- package/src/ai/index.d.ts +84 -0
- package/src/ai/knowledge-doc-chunk.model.d.ts +61 -0
- package/src/ai/knowledge-doc-page.model.d.ts +15 -0
- package/src/ai/knowledge-doc.model.d.ts +222 -0
- package/src/ai/knowledge-pipeline.d.ts +107 -0
- package/src/ai/knowledge-retrieval-log.model.d.ts +10 -0
- package/src/ai/knowledgebase-task.model.d.ts +39 -0
- package/src/ai/knowledgebase.model.d.ts +174 -0
- package/src/ai/message-content.utils.d.ts +58 -0
- package/src/ai/middleware.model.d.ts +24 -0
- package/src/ai/rag-web.d.ts +26 -0
- package/src/ai/rag.d.ts +24 -0
- package/src/ai/role-permissions.d.ts +13 -0
- package/src/ai/sandbox.d.ts +8 -0
- package/src/ai/skill.model.d.ts +241 -0
- package/src/ai/types.d.ts +77 -0
- package/src/ai/xpert-agent-execution.model.d.ts +105 -0
- package/src/ai/xpert-agent.model.d.ts +194 -0
- package/src/ai/xpert-chat.model.d.ts +66 -0
- package/src/ai/xpert-project.model.d.ts +89 -0
- package/src/ai/xpert-table.model.d.ts +84 -0
- package/src/ai/xpert-task.model.d.ts +26 -0
- package/src/ai/xpert-template.model.d.ts +47 -0
- package/src/ai/xpert-tool-mcp.model.d.ts +91 -0
- package/src/ai/xpert-tool.model.d.ts +154 -0
- package/src/ai/xpert-toolset.model.d.ts +200 -0
- package/src/ai/xpert-workflow-task.prompt.d.ts +2 -0
- package/src/ai/xpert-workflow.model.d.ts +445 -0
- package/src/ai/xpert-workspace.model.d.ts +37 -0
- package/src/ai/xpert.model.d.ts +513 -0
- package/src/ai/xpert.utils.d.ts +87 -0
- package/src/analytics/ai.d.ts +73 -0
- package/src/analytics/approval-policy.model.d.ts +30 -0
- package/src/analytics/business-area-user.model.d.ts +35 -0
- package/src/analytics/business-area.d.ts +17 -0
- package/src/analytics/certification.model.d.ts +11 -0
- package/src/analytics/chatbi-conversation.model.d.ts +15 -0
- package/src/analytics/chatbi-model.model.d.ts +18 -0
- package/src/analytics/collection.model.d.ts +6 -0
- package/src/analytics/comment.model.d.ts +10 -0
- package/src/analytics/data-source-type.d.ts +16 -0
- package/src/analytics/data-source.d.ts +62 -0
- package/src/analytics/favorite.d.ts +14 -0
- package/src/analytics/features.d.ts +19 -0
- package/src/analytics/feed-model.d.ts +13 -0
- package/src/analytics/gateway.d.ts +28 -0
- package/src/analytics/index.d.ts +38 -0
- package/src/analytics/indicator-app.d.ts +44 -0
- package/src/analytics/indicator-market.d.ts +4 -0
- package/src/analytics/indicator.d.ts +105 -0
- package/src/analytics/model-query-log.model.d.ts +41 -0
- package/src/analytics/model-query.d.ts +21 -0
- package/src/analytics/notification-destination.d.ts +10 -0
- package/src/analytics/permission-approval-user.model.d.ts +10 -0
- package/src/analytics/permission-approval.model.d.ts +47 -0
- package/src/analytics/project.model.d.ts +50 -0
- package/src/analytics/role-permissions.d.ts +25 -0
- package/src/analytics/schema.d.ts +262 -0
- package/src/analytics/screenshot.model.d.ts +24 -0
- package/src/analytics/semantic-model-entity.d.ts +38 -0
- package/src/analytics/semantic-model-member.d.ts +27 -0
- package/src/analytics/semantic-model.d.ts +183 -0
- package/src/analytics/story-point.d.ts +11 -0
- package/src/analytics/story-template.model.d.ts +28 -0
- package/src/analytics/story-widget.d.ts +12 -0
- package/src/analytics/story.d.ts +93 -0
- package/src/analytics/subscription.d.ts +38 -0
- package/src/analytics/visit.model.d.ts +34 -0
- package/src/analytics/webSocket.d.ts +48 -0
- package/src/api-key.model.d.ts +68 -0
- package/src/base-entity.model.d.ts +27 -0
- package/src/contact.model.d.ts +41 -0
- package/src/core.model.d.ts +97 -0
- package/src/country.model.d.ts +5 -0
- package/src/currency.model.d.ts +579 -0
- package/src/custom-smtp.model.d.ts +23 -0
- package/src/date-picker.model.d.ts +5 -0
- package/src/email-template.model.d.ts +39 -0
- package/src/email.model.d.ts +36 -0
- package/src/employee.model.d.ts +128 -0
- package/src/entity-with-members.model.d.ts +13 -0
- package/src/feature.model.d.ts +93 -0
- package/src/file-asset.model.d.ts +77 -0
- package/src/file-provider.d.ts +31 -0
- package/src/http-status.enum.d.ts +57 -0
- package/src/import-export.model.d.ts +36 -0
- package/src/index.d.ts +53 -0
- package/src/integration/dingtalk.d.ts +2 -0
- package/src/integration/firecrawl.d.ts +2 -0
- package/src/integration/github.d.ts +69 -0
- package/src/integration/index.d.ts +4 -0
- package/src/integration/lark.d.ts +5 -0
- package/src/integration/wecom.d.ts +2 -0
- package/src/integration.model.d.ts +92 -0
- package/src/invite.model.d.ts +125 -0
- package/src/language.model.d.ts +19 -0
- package/src/organization-contact.model.d.ts +72 -0
- package/src/organization-department.model.d.ts +20 -0
- package/src/organization-language.model.d.ts +18 -0
- package/src/organization-projects.model.d.ts +80 -0
- package/src/organization-team-employee-model.d.ts +12 -0
- package/src/organization-team-model.d.ts +19 -0
- package/src/organization.model.d.ts +238 -0
- package/src/password-reset.model.d.ts +18 -0
- package/src/plain-object.model.d.ts +13 -0
- package/src/plugin.d.ts +116 -0
- package/src/role-permission.model.d.ts +61 -0
- package/src/role.model.d.ts +25 -0
- package/src/schedule.d.ts +27 -0
- package/src/scope.model.d.ts +9 -0
- package/src/secret-token.model.d.ts +11 -0
- package/src/seed.model.d.ts +37 -0
- package/src/storage-file.model.d.ts +39 -0
- package/src/tag-entity.model.d.ts +20 -0
- package/src/tenant.model.d.ts +40 -0
- package/src/tools/index.d.ts +1 -0
- package/src/tools/sandbox.d.ts +5 -0
- package/src/translation.model.d.ts +26 -0
- package/src/types.d.ts +248 -0
- package/src/user-group.model.d.ts +7 -0
- package/src/user-me-context.model.d.ts +9 -0
- package/src/user-organization.model.d.ts +28 -0
- package/src/user.model.d.ts +131 -0
- package/src/view-extension/index.d.ts +1 -0
- package/src/view-extension/model.d.ts +183 -0
- package/src/visibility.model.d.ts +6 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { ICopilotModel } from './copilot-model.model';
|
|
2
|
+
import { I18nObject, TAvatar } from '../types';
|
|
3
|
+
import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
|
|
4
|
+
import { IKnowledgeDocument } from './knowledge-doc.model';
|
|
5
|
+
import { IXpert } from './xpert.model';
|
|
6
|
+
import { IIntegration } from '../integration.model';
|
|
7
|
+
import { IDocChunkMetadata } from './knowledge-doc-chunk.model';
|
|
8
|
+
/**
|
|
9
|
+
* Non-internal types should remain the same as IntegrationEnum.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum KnowledgeProviderEnum {
|
|
12
|
+
Internal = "internal"
|
|
13
|
+
}
|
|
14
|
+
export declare enum KnowledgebaseTypeEnum {
|
|
15
|
+
Standard = "standard",
|
|
16
|
+
External = "external"
|
|
17
|
+
}
|
|
18
|
+
export declare enum KnowledgeStructureEnum {
|
|
19
|
+
General = "general",
|
|
20
|
+
ParentChild = "parent-child",
|
|
21
|
+
QA = "qa"
|
|
22
|
+
}
|
|
23
|
+
export type KnowledgebaseParserConfig = {
|
|
24
|
+
pages?: number[][];
|
|
25
|
+
embeddingBatchSize?: number;
|
|
26
|
+
chunkSize: number | null;
|
|
27
|
+
chunkOverlap: number | null;
|
|
28
|
+
delimiter: string | null;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Type of rag knowledgebase
|
|
32
|
+
*/
|
|
33
|
+
export type TKnowledgebase = {
|
|
34
|
+
/**
|
|
35
|
+
* KB name
|
|
36
|
+
*/
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* Type of KB
|
|
40
|
+
*/
|
|
41
|
+
type: KnowledgebaseTypeEnum;
|
|
42
|
+
/**
|
|
43
|
+
* English | Chinese
|
|
44
|
+
*/
|
|
45
|
+
language?: 'Chinese' | 'English' | null;
|
|
46
|
+
/**
|
|
47
|
+
* Avatar object
|
|
48
|
+
*/
|
|
49
|
+
avatar?: TAvatar;
|
|
50
|
+
/**
|
|
51
|
+
* KB description
|
|
52
|
+
*/
|
|
53
|
+
description?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Public in tenant or in organization or private
|
|
56
|
+
* @default private
|
|
57
|
+
*/
|
|
58
|
+
permission?: KnowledgebasePermission;
|
|
59
|
+
/**
|
|
60
|
+
* Copilot model for knowledgebase
|
|
61
|
+
*/
|
|
62
|
+
copilotModel?: ICopilotModel;
|
|
63
|
+
copilotModelId?: string;
|
|
64
|
+
rerankModel?: ICopilotModel;
|
|
65
|
+
rerankModelId?: string;
|
|
66
|
+
visionModel?: ICopilotModel;
|
|
67
|
+
visionModelId?: string;
|
|
68
|
+
documentNum?: number | null;
|
|
69
|
+
tokenNum?: number | null;
|
|
70
|
+
chunkNum?: number | null;
|
|
71
|
+
/**
|
|
72
|
+
*@deprecated use `recall`
|
|
73
|
+
*/
|
|
74
|
+
similarityThreshold?: number;
|
|
75
|
+
vectorSimilarityWeight?: number;
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated
|
|
78
|
+
* default parser ID
|
|
79
|
+
*/
|
|
80
|
+
parserId?: string;
|
|
81
|
+
parserConfig?: KnowledgebaseParserConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Index structure determines how the knowledge base organizes and indexes your document content.
|
|
84
|
+
* @deprecated
|
|
85
|
+
*/
|
|
86
|
+
structure?: KnowledgeStructureEnum;
|
|
87
|
+
/**
|
|
88
|
+
* Recall params for kb chunks
|
|
89
|
+
*/
|
|
90
|
+
recall?: TKBRecallParams;
|
|
91
|
+
status?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Metadata custom field definition array
|
|
94
|
+
*/
|
|
95
|
+
metadataSchema?: KBMetadataFieldDef[];
|
|
96
|
+
/**
|
|
97
|
+
* API service enabled
|
|
98
|
+
*/
|
|
99
|
+
apiEnabled?: boolean;
|
|
100
|
+
documents?: IKnowledgeDocument[];
|
|
101
|
+
integrationId?: string;
|
|
102
|
+
extKnowledgebaseId?: string;
|
|
103
|
+
pipelineId?: string;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Knowledgebase Entity
|
|
107
|
+
*/
|
|
108
|
+
export interface IKnowledgebase extends TKnowledgebase, IBasePerWorkspaceEntityModel {
|
|
109
|
+
xperts?: IXpert[];
|
|
110
|
+
integration?: IIntegration;
|
|
111
|
+
pipeline?: IXpert;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Knowledgebase permission levels
|
|
115
|
+
*/
|
|
116
|
+
export declare enum KnowledgebasePermission {
|
|
117
|
+
/**
|
|
118
|
+
* Only visible to you
|
|
119
|
+
* @default
|
|
120
|
+
*/
|
|
121
|
+
Private = "private",
|
|
122
|
+
/**
|
|
123
|
+
* Visible to all members in the organization
|
|
124
|
+
*/
|
|
125
|
+
Organization = "organization",
|
|
126
|
+
/**
|
|
127
|
+
* Visible to all members in the tenant
|
|
128
|
+
*/
|
|
129
|
+
Public = "public"
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Recall parameters
|
|
133
|
+
*/
|
|
134
|
+
export type TKBRecallParams = {
|
|
135
|
+
/**
|
|
136
|
+
* Top K of result chunks
|
|
137
|
+
*/
|
|
138
|
+
topK?: number;
|
|
139
|
+
/**
|
|
140
|
+
* At least the similarity threshold
|
|
141
|
+
*/
|
|
142
|
+
score?: number;
|
|
143
|
+
/**
|
|
144
|
+
* Weight in EnsembleRetriever
|
|
145
|
+
*/
|
|
146
|
+
weight?: number;
|
|
147
|
+
};
|
|
148
|
+
export type DocumentMetadata = IDocChunkMetadata & {
|
|
149
|
+
score?: number;
|
|
150
|
+
relevanceScore?: number;
|
|
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
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Channel name for knowledgebase pipeline
|
|
162
|
+
*/
|
|
163
|
+
export declare const KnowledgebaseChannel: string;
|
|
164
|
+
/**
|
|
165
|
+
* Task ID of a knowledgebase run
|
|
166
|
+
*/
|
|
167
|
+
export declare const KnowledgeTask = "task_id";
|
|
168
|
+
/**
|
|
169
|
+
* Specify the data source to run
|
|
170
|
+
*/
|
|
171
|
+
export declare const KNOWLEDGE_SOURCES_NAME = "sources";
|
|
172
|
+
export declare const KNOWLEDGE_DOCUMENTS_NAME = "documents";
|
|
173
|
+
export declare const KNOWLEDGE_FOLDER_ID_NAME = "folder_id";
|
|
174
|
+
export declare const KNOWLEDGE_STAGE_NAME = "stage";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { TMessageContent, TMessageContentComplex } from '@xpert-ai/chatkit-types';
|
|
2
|
+
import { CopilotChatMessage } from './chat-message.model';
|
|
3
|
+
export type TMessageJoinHint = 'none' | 'space' | 'line' | 'paragraph';
|
|
4
|
+
export type TMessageAppendContext = {
|
|
5
|
+
source?: string;
|
|
6
|
+
streamId?: string;
|
|
7
|
+
joinHint?: TMessageJoinHint;
|
|
8
|
+
};
|
|
9
|
+
export type TAppendMessageContentOptions = TMessageAppendContext & {
|
|
10
|
+
previous?: TMessageAppendContext | null;
|
|
11
|
+
};
|
|
12
|
+
export type TResolveMessageAppendContextOptions = {
|
|
13
|
+
previous?: TMessageAppendContext | null;
|
|
14
|
+
incoming: string | TMessageContentComplex;
|
|
15
|
+
fallbackSource?: string;
|
|
16
|
+
fallbackStreamId?: string;
|
|
17
|
+
};
|
|
18
|
+
export type TResolvedMessageAppendContext = {
|
|
19
|
+
appendContext: TMessageAppendContext;
|
|
20
|
+
messageContext: TMessageAppendContext;
|
|
21
|
+
};
|
|
22
|
+
export type TMessageAppendContextTracker = {
|
|
23
|
+
resolve: (options: Omit<TResolveMessageAppendContextOptions, 'previous'>) => TResolvedMessageAppendContext;
|
|
24
|
+
reset: () => void;
|
|
25
|
+
current: () => TMessageAppendContext | null;
|
|
26
|
+
};
|
|
27
|
+
export declare function inferMessageAppendContext(content: string | TMessageContentComplex, fallbackSource?: string): TMessageAppendContext;
|
|
28
|
+
export declare function resolveMessageAppendContext(options: TResolveMessageAppendContextOptions): TResolvedMessageAppendContext;
|
|
29
|
+
/**
|
|
30
|
+
* Stateful helper for streaming append.
|
|
31
|
+
*
|
|
32
|
+
* It keeps the previous append context and resolves the current one, so callers
|
|
33
|
+
* can avoid passing `previous` manually for every chunk and still get stable
|
|
34
|
+
* join behavior (for example, same source + same stream -> `joinHint: 'none'`).
|
|
35
|
+
*
|
|
36
|
+
* Call `reset()` at turn/session boundaries to prevent cross-turn contamination.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createMessageAppendContextTracker(initial?: TMessageAppendContext | null): TMessageAppendContextTracker;
|
|
39
|
+
/**
|
|
40
|
+
* Append one incoming chunk into a chat message in place.
|
|
41
|
+
*
|
|
42
|
+
* Behavior:
|
|
43
|
+
* - Keeps `aiMessage` object reference stable (caller may hold this object).
|
|
44
|
+
* - Updates message properties with new references (`content`/`reasoning` arrays)
|
|
45
|
+
* so UI change detection that relies on reference changes can react reliably.
|
|
46
|
+
* - Applies context-aware merge rules for text/reasoning/component chunks.
|
|
47
|
+
* - `previous` must be supplied by caller when same-stream join inference is needed.
|
|
48
|
+
*/
|
|
49
|
+
export declare function appendMessageContent(aiMessage: CopilotChatMessage, incoming: string | TMessageContentComplex, context?: TAppendMessageContentOptions): void;
|
|
50
|
+
export declare function appendMessagePlainText(accumulator: string, incoming: string | TMessageContentComplex, context?: TMessageAppendContext): string;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a display-only content view that reassembles text chunks belonging to
|
|
53
|
+
* the same stream id. This preserves markdown continuity without changing the
|
|
54
|
+
* underlying stored/streamed message structure.
|
|
55
|
+
*/
|
|
56
|
+
export declare function mergeMessageContentForDisplay(content: TMessageContent | TMessageContentComplex | null | undefined): TMessageContentComplex[] | null;
|
|
57
|
+
export declare function stringifyMessageContent(content: TMessageContent | TMessageContentComplex): string;
|
|
58
|
+
export declare function filterMessageText(content: TMessageContent | TMessageContentComplex): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IWorkflowNode, WorkflowNodeTypeEnum } from "./xpert-workflow.model";
|
|
2
|
+
import { I18nObject, IconDefinition } from "../types";
|
|
3
|
+
import { TXpertFeatureKey, 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
|
+
tools?: Record<string, TMiddlewareToolConfig | boolean>;
|
|
10
|
+
}
|
|
11
|
+
export type TMiddlewareToolConfig = {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function isMiddlewareToolEnabled(config?: TMiddlewareToolConfig | boolean): boolean;
|
|
15
|
+
export declare function genXpertMiddlewareKey(): string;
|
|
16
|
+
export type TAgentMiddlewareMeta = {
|
|
17
|
+
name: string;
|
|
18
|
+
label: I18nObject;
|
|
19
|
+
icon?: IconDefinition;
|
|
20
|
+
description?: I18nObject;
|
|
21
|
+
configSchema?: JsonSchemaObjectType;
|
|
22
|
+
features?: TXpertFeatureKey[];
|
|
23
|
+
};
|
|
24
|
+
export declare function getAgentMiddlewareNodes(graph: TXpertGraph, agentKey: string): TXpertTeamNode[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IntegrationEnum } from "../integration.model";
|
|
2
|
+
import { TParameter, TSelectOption } from "../types";
|
|
3
|
+
import { IKnowledgeDocumentPage } from "./knowledge-doc-page.model";
|
|
4
|
+
export declare enum KDocumentWebTypeEnum {
|
|
5
|
+
Playwright = "playwright",
|
|
6
|
+
FireCrawl = "firecrawl",
|
|
7
|
+
Notion = "notion"
|
|
8
|
+
}
|
|
9
|
+
export type TRagWebOptions = {
|
|
10
|
+
url: string;
|
|
11
|
+
params?: Record<string, unknown>;
|
|
12
|
+
};
|
|
13
|
+
export type TKDocumentWebSchema = {
|
|
14
|
+
type: KDocumentWebTypeEnum;
|
|
15
|
+
helpUrl: string;
|
|
16
|
+
options: TParameter[];
|
|
17
|
+
/**
|
|
18
|
+
* Need to provide integration of provider
|
|
19
|
+
*/
|
|
20
|
+
integrationProvider?: IntegrationEnum;
|
|
21
|
+
};
|
|
22
|
+
export type TRagWebResult = {
|
|
23
|
+
docs: IKnowledgeDocumentPage[];
|
|
24
|
+
duration: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const KDocumentWebTypeOptions: TSelectOption<KDocumentWebTypeEnum>[];
|
package/src/ai/rag.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare enum VectorTypeEnum {
|
|
2
|
+
ANALYTICDB = "analyticdb",
|
|
3
|
+
CHROMA = "chroma",
|
|
4
|
+
MILVUS = "milvus",
|
|
5
|
+
MYSCALE = "myscale",
|
|
6
|
+
PGVECTOR = "pgvector",
|
|
7
|
+
PGVECTO_RS = "pgvecto-rs",
|
|
8
|
+
QDRANT = "qdrant",
|
|
9
|
+
RELYT = "relyt",
|
|
10
|
+
TIDB_VECTOR = "tidb_vector",
|
|
11
|
+
WEAVIATE = "weaviate",
|
|
12
|
+
OPENSEARCH = "opensearch",
|
|
13
|
+
TENCENT = "tencent",
|
|
14
|
+
ORACLE = "oracle",
|
|
15
|
+
ELASTICSEARCH = "elasticsearch",
|
|
16
|
+
ELASTICSEARCH_JA = "elasticsearch-ja",
|
|
17
|
+
LINDORM = "lindorm",
|
|
18
|
+
COUCHBASE = "couchbase",
|
|
19
|
+
BAIDU = "baidu",
|
|
20
|
+
VIKINGDB = "vikingdb",
|
|
21
|
+
UPSTASH = "upstash",
|
|
22
|
+
TIDB_ON_QDRANT = "tidb_on_qdrant",
|
|
23
|
+
OCEANBASE = "oceanbase"
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum AIPermissionsEnum {
|
|
2
|
+
/**
|
|
3
|
+
* Create or edit Knowledgebase in organization.
|
|
4
|
+
*/
|
|
5
|
+
KNOWLEDGEBASE_EDIT = "KNOWLEDGEBASE_EDIT",
|
|
6
|
+
COPILOT_VIEW = "COPILOT_VIEW",
|
|
7
|
+
COPILOT_EDIT = "COPILOT_EDIT",
|
|
8
|
+
/**
|
|
9
|
+
* Create or edit Xperts in organization.
|
|
10
|
+
*/
|
|
11
|
+
XPERT_EDIT = "XPERT_EDIT",
|
|
12
|
+
CHAT_VIEW = "CHAT_VIEW"
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { I18nObject, IconDefinition } from '../types';
|
|
2
|
+
export type TSandboxProviderMeta = {
|
|
3
|
+
name: I18nObject;
|
|
4
|
+
description?: I18nObject;
|
|
5
|
+
icon: IconDefinition;
|
|
6
|
+
};
|
|
7
|
+
export declare const SANDBOX_WORK_FOR_TYPES: readonly ["user", "project", "environment"];
|
|
8
|
+
export type TSandboxWorkForType = (typeof SANDBOX_WORK_FOR_TYPES)[number];
|
|
@@ -0,0 +1,241 @@
|
|
|
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 declare const WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER = "workspace-public";
|
|
8
|
+
export declare const WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME = "Workspace Shared Skills";
|
|
9
|
+
export interface ISkillRepositoryIndexStats {
|
|
10
|
+
comments?: number;
|
|
11
|
+
downloads?: number;
|
|
12
|
+
installsAllTime?: number;
|
|
13
|
+
installsCurrent?: number;
|
|
14
|
+
stars?: number;
|
|
15
|
+
versions?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ISkillRepositoryIndexPublisher {
|
|
18
|
+
handle?: string;
|
|
19
|
+
displayName?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
image?: string;
|
|
22
|
+
kind?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface IShareSkillPackageInput {
|
|
25
|
+
displayName: string;
|
|
26
|
+
description: string;
|
|
27
|
+
tags?: string[];
|
|
28
|
+
license?: string;
|
|
29
|
+
version?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SkillMetadata {
|
|
32
|
+
name: string;
|
|
33
|
+
displayName?: I18nObject;
|
|
34
|
+
version: string;
|
|
35
|
+
summary?: I18nObject;
|
|
36
|
+
description?: I18nObject;
|
|
37
|
+
icon?: IconDefinition;
|
|
38
|
+
tags?: string[];
|
|
39
|
+
author?: {
|
|
40
|
+
name: string;
|
|
41
|
+
email?: string;
|
|
42
|
+
org?: string;
|
|
43
|
+
};
|
|
44
|
+
license?: string;
|
|
45
|
+
visibility: 'private' | 'team' | 'tenant' | 'public';
|
|
46
|
+
categories?: string[];
|
|
47
|
+
runtime?: {
|
|
48
|
+
entry?: string;
|
|
49
|
+
language?: 'js' | 'py' | 'bash';
|
|
50
|
+
permissions?: string[];
|
|
51
|
+
tools?: string[];
|
|
52
|
+
};
|
|
53
|
+
mcp?: {
|
|
54
|
+
servers?: string[];
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export interface SkillResourcesIndex {
|
|
58
|
+
files: Array<{
|
|
59
|
+
path: string;
|
|
60
|
+
kind: 'script' | 'template' | 'doc' | 'asset';
|
|
61
|
+
hash: string;
|
|
62
|
+
size: number;
|
|
63
|
+
}>;
|
|
64
|
+
chunks?: Array<{
|
|
65
|
+
id: string;
|
|
66
|
+
path: string;
|
|
67
|
+
summary: string;
|
|
68
|
+
tokens: number;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
export interface TSkillPackage {
|
|
72
|
+
metadata: SkillMetadata;
|
|
73
|
+
instructions: {
|
|
74
|
+
system?: string;
|
|
75
|
+
developer?: string;
|
|
76
|
+
examples?: Array<{
|
|
77
|
+
user: string;
|
|
78
|
+
assistant: string;
|
|
79
|
+
}>;
|
|
80
|
+
guidelines?: string[];
|
|
81
|
+
};
|
|
82
|
+
resources?: SkillResourcesIndex;
|
|
83
|
+
abac?: {
|
|
84
|
+
owners: string[];
|
|
85
|
+
readers: string[];
|
|
86
|
+
writers: string[];
|
|
87
|
+
policies?: Record<string, unknown>;
|
|
88
|
+
};
|
|
89
|
+
signatures?: string[];
|
|
90
|
+
provenance?: Record<string, unknown>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Represents a repository (e.g. anthropics/skills)
|
|
94
|
+
*/
|
|
95
|
+
export interface ISkillRepository<O = Record<string, unknown>, C = Record<string, unknown>> extends IBasePerTenantAndOrganizationEntityModel {
|
|
96
|
+
name: string;
|
|
97
|
+
provider: string;
|
|
98
|
+
/**
|
|
99
|
+
* Provider credentials such as GitHub tokens
|
|
100
|
+
*/
|
|
101
|
+
credentials?: C;
|
|
102
|
+
/**
|
|
103
|
+
* Options configured using the strategy's configSchema
|
|
104
|
+
*/
|
|
105
|
+
options?: O;
|
|
106
|
+
lastSyncAt?: Date;
|
|
107
|
+
deletedAt?: Date;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Skill index produced by repository sync scan (one per skill directory)
|
|
111
|
+
*/
|
|
112
|
+
export interface ISkillRepositoryIndex extends IBasePerTenantAndOrganizationEntityModel {
|
|
113
|
+
repositoryId: string;
|
|
114
|
+
repository?: ISkillRepository;
|
|
115
|
+
skillPath: string;
|
|
116
|
+
skillId: string;
|
|
117
|
+
name?: string;
|
|
118
|
+
link?: string;
|
|
119
|
+
publisher?: ISkillRepositoryIndexPublisher;
|
|
120
|
+
description?: string;
|
|
121
|
+
license?: string;
|
|
122
|
+
tags?: string[];
|
|
123
|
+
version?: string;
|
|
124
|
+
stats?: ISkillRepositoryIndexStats;
|
|
125
|
+
resources?: Array<Record<string, unknown>>;
|
|
126
|
+
deletedAt?: Date;
|
|
127
|
+
}
|
|
128
|
+
export interface ISkillMarketFilterOption {
|
|
129
|
+
value: string;
|
|
130
|
+
label: string;
|
|
131
|
+
description?: string;
|
|
132
|
+
}
|
|
133
|
+
export interface ISkillMarketFilterGroup {
|
|
134
|
+
label: string;
|
|
135
|
+
options: ISkillMarketFilterOption[];
|
|
136
|
+
}
|
|
137
|
+
export interface ISkillMarketFilterGroups {
|
|
138
|
+
roles: ISkillMarketFilterGroup;
|
|
139
|
+
appTypes: ISkillMarketFilterGroup;
|
|
140
|
+
hot: ISkillMarketFilterGroup;
|
|
141
|
+
}
|
|
142
|
+
export interface ISkillMarketFeaturedRef {
|
|
143
|
+
provider: string;
|
|
144
|
+
repositoryName: string;
|
|
145
|
+
skillId: string;
|
|
146
|
+
badge?: string;
|
|
147
|
+
title?: string;
|
|
148
|
+
description?: string;
|
|
149
|
+
avatar?: IconDefinition;
|
|
150
|
+
}
|
|
151
|
+
export interface ISkillMarketFeaturedSkill extends ISkillMarketFeaturedRef {
|
|
152
|
+
skill: ISkillRepositoryIndex;
|
|
153
|
+
}
|
|
154
|
+
export interface ISkillMarketConfig {
|
|
155
|
+
featured: ISkillMarketFeaturedSkill[];
|
|
156
|
+
filters: ISkillMarketFilterGroups;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Installed skill package record (skill.yaml)
|
|
160
|
+
*/
|
|
161
|
+
export interface ISkillPackage extends IBasePerWorkspaceEntityModel, TSkillPackage {
|
|
162
|
+
skillIndexId?: SkillId;
|
|
163
|
+
skillIndex?: ISkillRepositoryIndex;
|
|
164
|
+
name?: string;
|
|
165
|
+
visibility: 'private' | 'team' | 'tenant';
|
|
166
|
+
packagePath?: string;
|
|
167
|
+
sharedSkillId?: string;
|
|
168
|
+
sharedPackagePath?: string;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Skill version (multiple versions can coexist per skill)
|
|
172
|
+
*/
|
|
173
|
+
export interface ISkillVersion extends IBasePerWorkspaceEntityModel {
|
|
174
|
+
packageId: string;
|
|
175
|
+
version: string;
|
|
176
|
+
metadata: SkillMetadata;
|
|
177
|
+
instructions: TSkillPackage['instructions'];
|
|
178
|
+
installedAt?: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Skill resource file record (scripts/templates/assets)
|
|
182
|
+
*/
|
|
183
|
+
export interface ISkillResource extends IBasePerWorkspaceEntityModel {
|
|
184
|
+
versionId: string;
|
|
185
|
+
path: string;
|
|
186
|
+
type: 'script' | 'template' | 'asset' | 'doc';
|
|
187
|
+
hash?: string;
|
|
188
|
+
size?: number;
|
|
189
|
+
meta?: Record<string, unknown>;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Tenant/organization/team/user installation record
|
|
193
|
+
*/
|
|
194
|
+
export interface ISkillInstallation extends IBasePerTenantAndOrganizationEntityModel {
|
|
195
|
+
versionId: string;
|
|
196
|
+
installedBy: string;
|
|
197
|
+
visibility: 'private' | 'team' | 'tenant';
|
|
198
|
+
targetScope?: string;
|
|
199
|
+
status: 'pending' | 'installed' | 'failed';
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Detailed logs during skill installation
|
|
203
|
+
*/
|
|
204
|
+
export interface ISkillInstallLog extends IBasePerTenantAndOrganizationEntityModel {
|
|
205
|
+
installationId: string;
|
|
206
|
+
level: 'info' | 'warn' | 'error';
|
|
207
|
+
message: string;
|
|
208
|
+
timestamp: string;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Runtime audit log for skills
|
|
212
|
+
*/
|
|
213
|
+
export interface ISkillAuditLog extends IBasePerTenantAndOrganizationEntityModel {
|
|
214
|
+
skillId: string;
|
|
215
|
+
versionId: string;
|
|
216
|
+
sessionId: string;
|
|
217
|
+
eventType: string;
|
|
218
|
+
metadata: Record<string, unknown>;
|
|
219
|
+
}
|
|
220
|
+
export type TSkillSourceMeta = {
|
|
221
|
+
/**
|
|
222
|
+
* Provider name, e.g. github / git / zip / marketplace
|
|
223
|
+
*/
|
|
224
|
+
name: string;
|
|
225
|
+
label: I18nObject;
|
|
226
|
+
icon?: IconDefinition;
|
|
227
|
+
description?: I18nObject;
|
|
228
|
+
/**
|
|
229
|
+
* Optional configuration schema for frontend forms
|
|
230
|
+
*/
|
|
231
|
+
configSchema?: JsonSchemaObjectType;
|
|
232
|
+
/**
|
|
233
|
+
* Credential schema for source authentication
|
|
234
|
+
*/
|
|
235
|
+
credentialSchema?: JsonSchemaObjectType;
|
|
236
|
+
};
|
|
237
|
+
export interface IWFNSkill extends IWorkflowNode {
|
|
238
|
+
type: WorkflowNodeTypeEnum.SKILL;
|
|
239
|
+
skills?: string[];
|
|
240
|
+
}
|
|
241
|
+
export declare function genXpertSkillKey(): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { JsonSchema7TypeUnion } from "zod-to-json-schema";
|
|
2
|
+
import { I18nObject, TSelectOption } from "../types";
|
|
3
|
+
import { TXpertAttachmentType, XpertParameterTypeEnum } from "./xpert.model";
|
|
4
|
+
export type TErrorHandling = {
|
|
5
|
+
type?: null | 'defaultValue' | 'failBranch';
|
|
6
|
+
defaultValue?: {
|
|
7
|
+
content?: string;
|
|
8
|
+
} & Record<string, any>;
|
|
9
|
+
failBranch?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare enum ApiAuthType {
|
|
12
|
+
/**
|
|
13
|
+
* Enum class for api provider auth type.
|
|
14
|
+
*/
|
|
15
|
+
NONE = "none",
|
|
16
|
+
API_KEY = "api_key",
|
|
17
|
+
BASIC = "basic"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reference variable (parameter)
|
|
21
|
+
*/
|
|
22
|
+
export type TXpertRefParameter = {
|
|
23
|
+
type?: XpertParameterTypeEnum;
|
|
24
|
+
name: string;
|
|
25
|
+
optional?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Referencing other variable
|
|
28
|
+
*/
|
|
29
|
+
variable?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Embedding status of an entity, such as an bi indicator or kb document.
|
|
33
|
+
*/
|
|
34
|
+
export declare enum EmbeddingStatusEnum {
|
|
35
|
+
PROCESSING = "processing",
|
|
36
|
+
SUCCESS = "success",
|
|
37
|
+
FAILED = "failed",
|
|
38
|
+
REQUIRED = "required"
|
|
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
|
+
* Whether this component supports selecting LangGraph state variables
|
|
64
|
+
*/
|
|
65
|
+
variable?: boolean;
|
|
66
|
+
enumLabels?: Record<string, I18nObject | string>;
|
|
67
|
+
styles?: Record<string, string>;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export type JsonSchemaObjectType = {
|
|
71
|
+
type: "object";
|
|
72
|
+
properties: Record<string, JsonSchema7Type>;
|
|
73
|
+
additionalProperties?: boolean | JsonSchema7Type;
|
|
74
|
+
required?: string[];
|
|
75
|
+
};
|
|
76
|
+
type JsonSchema7Type = (JsonSchema7TypeUnion | JsonSchemaObjectType) & JsonSchema7Meta;
|
|
77
|
+
export {};
|