@metad/contracts 3.6.0-beta.2 → 3.6.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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@metad/contracts",
3
- "version": "3.6.0-beta.2",
3
+ "version": "3.6.0",
4
4
  "license": "AGPL-3.0",
5
5
  "scripts": {
6
6
  "docs": "yarn typedoc --out ./.docs"
7
7
  },
8
8
  "module": "./index.esm.js",
9
9
  "main": "./index.cjs.js"
10
- }
10
+ }
package/src/ai/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export * from './xpert-tool.model';
24
24
  export * from './xpert-toolset.model';
25
25
  export * from './xpert-workspace.model';
26
26
  export * from './xpert.model';
27
+ export * from './xpert.utils';
27
28
  export * from './types';
28
29
  export * from './xpert-template.model';
29
30
  export * from './xpert-task.model';
@@ -152,11 +152,11 @@ export type TKnowledgeDocument = {
152
152
  /**
153
153
  * Document, include file, web pages, folder, virtual, etc.
154
154
  */
155
- export interface IKnowledgeDocument extends TKnowledgeDocument, IBasePerTenantAndOrganizationEntityModel {
155
+ export interface IKnowledgeDocument<T = Metadata> extends TKnowledgeDocument, IBasePerTenantAndOrganizationEntityModel {
156
156
  parent?: IKnowledgeDocument | null;
157
157
  children?: IKnowledgeDocument[];
158
158
  chunks?: DocumentInterface[];
159
- metadata?: Metadata;
159
+ metadata?: T;
160
160
  }
161
161
  export interface IDocumentChunk<Metadata = DocumentMetadata> {
162
162
  id: string;
@@ -1,22 +1,40 @@
1
- import { I18nObject } from '../types';
1
+ import { I18nObject, IconDefinition } from '../types';
2
2
  import { ICopilotModel } from './copilot-model.model';
3
3
  import { KnowledgeStructureEnum } from './knowledgebase.model';
4
4
  import { IWorkflowNode, WorkflowNodeTypeEnum } from './xpert-workflow.model';
5
+ import { TXpertParameter } from './xpert.model';
5
6
  export interface IDocumentNodeProvider {
6
7
  name: string;
7
8
  label: I18nObject;
8
- icon?: {
9
- svg?: string;
10
- color?: string;
11
- };
9
+ icon?: IconDefinition;
12
10
  description?: I18nObject;
13
11
  helpUrl?: string;
14
12
  configSchema: any;
15
13
  }
14
+ /**
15
+ * Category of document source provider
16
+ */
16
17
  export declare enum DocumentSourceProviderCategoryEnum {
18
+ /**
19
+ * Local files uploaded directly to the system
20
+ */
17
21
  LocalFile = "local-file",
18
- RemoteFile = "remote-file",
22
+ /**
23
+ * Remote file systems, e.g. S3, FTP, etc.
24
+ */
25
+ FileSystem = "file-system",
26
+ /**
27
+ * Online documents, e.g. public URLs, Google Docs, etc.
28
+ */
29
+ OnlineDocument = "online-document",
30
+ /**
31
+ * Web crawling from public websites
32
+ */
19
33
  WebCrawl = "web-crawl",
34
+ /**
35
+ * Database connections, e.g. MySQL, PostgreSQL, etc.
36
+ * @deprecated Planning
37
+ */
20
38
  Database = "database"
21
39
  }
22
40
  export interface IDocumentSourceProvider extends IDocumentNodeProvider {
@@ -34,6 +52,7 @@ export interface IDocumentUnderstandingProvider extends IDocumentNodeProvider {
34
52
  export interface IWFNSource extends IWorkflowNode {
35
53
  type: WorkflowNodeTypeEnum.SOURCE;
36
54
  provider: string;
55
+ parameters?: TXpertParameter[];
37
56
  config: any;
38
57
  integrationId?: string;
39
58
  }
@@ -73,6 +73,7 @@ export type TKnowledgebase = {
73
73
  similarityThreshold?: number;
74
74
  vectorSimilarityWeight?: number;
75
75
  /**
76
+ * @deprecated
76
77
  * default parser ID
77
78
  */
78
79
  parserId?: string;
@@ -103,9 +104,22 @@ export interface IKnowledgebase extends TKnowledgebase, IBasePerWorkspaceEntityM
103
104
  integration?: IIntegration;
104
105
  pipeline?: IXpert;
105
106
  }
107
+ /**
108
+ * Knowledgebase permission levels
109
+ */
106
110
  export declare enum KnowledgebasePermission {
111
+ /**
112
+ * Only visible to you
113
+ * @default
114
+ */
107
115
  Private = "private",
116
+ /**
117
+ * Visible to all members in the organization
118
+ */
108
119
  Organization = "organization",
120
+ /**
121
+ * Visible to all members in the tenant
122
+ */
109
123
  Public = "public"
110
124
  }
111
125
  /**
@@ -143,3 +157,4 @@ export declare const KnowledgeTask = "task_id";
143
157
  export declare const KnowledgeSources = "sources";
144
158
  export declare const KnowledgeDocuments = "documents";
145
159
  export declare const KnowledgeFolderId = "folder_id";
160
+ export declare const KNOWLEDGE_STAGE_NAME = "stage";
@@ -1,4 +1,4 @@
1
- import { I18nObject } from "../types";
1
+ 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";
@@ -6,11 +6,7 @@ import { TStateVariable, TXpertParameter } from "./xpert.model";
6
6
  export type TWorkflowNodeMeta = {
7
7
  name: string;
8
8
  label: I18nObject;
9
- icon: {
10
- svg?: string;
11
- remixicon?: string;
12
- color?: string;
13
- };
9
+ icon: IconDefinition;
14
10
  configSchema: any;
15
11
  };
16
12
  export type TWorkflowTriggerMeta = TWorkflowNodeMeta;
@@ -319,6 +319,7 @@ export type TXpertParameter = {
319
319
  title?: string;
320
320
  description?: string | I18nObject;
321
321
  optional?: boolean;
322
+ default?: any;
322
323
  maximum?: number;
323
324
  options?: string[];
324
325
  item?: TXpertParameter[];
@@ -494,73 +495,3 @@ export type TChatOptions = {
494
495
  */
495
496
  tools?: (StructuredToolInterface | RunnableToolLike)[];
496
497
  };
497
- export declare function omitXpertRelations(xpert: Partial<IXpert>): {
498
- environmentId?: string;
499
- environment?: IEnvironment;
500
- knowledgebase?: IKnowledgebase;
501
- workspaceId?: string;
502
- workspace?: import("./xpert-workspace.model").IXpertWorkspace;
503
- publishAt?: Date;
504
- deletedAt?: Date;
505
- organizationId?: string;
506
- organization?: import("..").IOrganization;
507
- tenantId?: string;
508
- tenant?: import("..").ITenant;
509
- id?: string;
510
- createdById?: string;
511
- createdBy?: IUser;
512
- updatedById?: string;
513
- updatedBy?: IUser;
514
- createdAt?: Date;
515
- updatedAt?: Date;
516
- slug?: string;
517
- name?: string;
518
- type?: XpertTypeEnum;
519
- title?: string;
520
- titleCN?: string;
521
- description?: string;
522
- active?: boolean;
523
- avatar?: TAvatar;
524
- starters?: string[];
525
- options?: TXpertOptions;
526
- agentConfig?: TXpertAgentConfig;
527
- summarize?: TSummarize;
528
- memory?: TLongTermMemory;
529
- features?: TXpertFeatures;
530
- version?: string;
531
- latest?: boolean;
532
- releaseNotes?: string;
533
- graph?: TXpertGraph;
534
- api?: TChatApi;
535
- app?: TChatApp;
536
- userId?: string;
537
- user?: IUser;
538
- copilotModel?: ICopilotModel;
539
- copilotModelId?: string;
540
- integrations?: IIntegration<any>[];
541
- tags?: ITag[];
542
- };
543
- export declare function figureOutXpert(xpert: IXpert, isDraft: boolean): Partial<IXpert>;
544
- export declare function xpertLabel(agent: Partial<IXpert>): string;
545
- export declare function createXpertGraph(xpert: IXpert, position: IPoint): {
546
- nodes: TXpertTeamNode[];
547
- size: {
548
- width: number;
549
- height: number;
550
- };
551
- connections: TXpertTeamConnection[];
552
- };
553
- /**
554
- * Create all nodes of xpert and it's area size
555
- *
556
- * @param xpert
557
- * @returns
558
- */
559
- export declare function createXpertNodes(xpert: IXpert, position: IPoint): {
560
- nodes: TXpertTeamNode[];
561
- size: {
562
- width: number;
563
- height: number;
564
- };
565
- };
566
- export declare function createAgentConnections(agent: IXpertAgent, collaborators: IXpert[]): any[];
@@ -0,0 +1,80 @@
1
+ import { IPoint } from '../types';
2
+ import { IXpertAgent } from './xpert-agent.model';
3
+ import { IXpert, TXpertTeamNode } from './xpert.model';
4
+ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
5
+ environmentId?: string;
6
+ environment?: import("./environment.model").IEnvironment;
7
+ knowledgebase?: import("./knowledgebase.model").IKnowledgebase;
8
+ workspaceId?: string;
9
+ workspace?: import("./xpert-workspace.model").IXpertWorkspace;
10
+ publishAt?: Date;
11
+ deletedAt?: Date;
12
+ organizationId?: string;
13
+ organization?: import("..").IOrganization;
14
+ tenantId?: string;
15
+ tenant?: import("..").ITenant;
16
+ id?: string;
17
+ createdById?: string;
18
+ createdBy?: import("..").IUser;
19
+ updatedById?: string;
20
+ updatedBy?: import("..").IUser;
21
+ createdAt?: Date;
22
+ updatedAt?: Date;
23
+ slug?: string;
24
+ name?: string;
25
+ type?: import("./xpert.model").XpertTypeEnum;
26
+ title?: string;
27
+ titleCN?: string;
28
+ description?: string;
29
+ active?: boolean;
30
+ avatar?: import("../types").TAvatar;
31
+ starters?: string[];
32
+ options?: import("./xpert.model").TXpertOptions;
33
+ agentConfig?: import("./xpert.model").TXpertAgentConfig;
34
+ summarize?: import("./xpert.model").TSummarize;
35
+ memory?: import("./xpert.model").TLongTermMemory;
36
+ features?: import("./xpert.model").TXpertFeatures;
37
+ version?: string;
38
+ latest?: boolean;
39
+ releaseNotes?: string;
40
+ graph?: import("./xpert.model").TXpertGraph;
41
+ api?: import("./xpert.model").TChatApi;
42
+ app?: import("./xpert.model").TChatApp;
43
+ userId?: string;
44
+ user?: import("..").IUser;
45
+ copilotModel?: import("./copilot-model.model").ICopilotModel;
46
+ copilotModelId?: string;
47
+ integrations?: import("..").IIntegration<any>[];
48
+ tags?: import("..").ITag[];
49
+ };
50
+ export declare function figureOutXpert(xpert: IXpert, isDraft: boolean): Partial<IXpert>;
51
+ export declare function xpertLabel(agent: Partial<IXpert>): string;
52
+ export declare function createXpertGraph(xpert: IXpert, position: IPoint): {
53
+ nodes: TXpertTeamNode[];
54
+ size: {
55
+ width: number;
56
+ height: number;
57
+ };
58
+ connections: import("./xpert.model").TXpertTeamConnection[];
59
+ };
60
+ export declare function locateNodes(nodes: TXpertTeamNode[], position: IPoint): {
61
+ size: {
62
+ width: number;
63
+ height: number;
64
+ };
65
+ nodes: TXpertTeamNode[];
66
+ };
67
+ /**
68
+ * Create all nodes of xpert and it's area size
69
+ *
70
+ * @param xpert
71
+ * @returns
72
+ */
73
+ export declare function createXpertNodes(xpert: IXpert, position: IPoint): {
74
+ nodes: TXpertTeamNode[];
75
+ size: {
76
+ width: number;
77
+ height: number;
78
+ };
79
+ };
80
+ export declare function createAgentConnections(agent: IXpertAgent, collaborators: IXpert[]): any[];
@@ -3,7 +3,7 @@ import { IOrganization } from './organization.model';
3
3
  import { ID } from './types';
4
4
  import { IUser } from './user.model';
5
5
  export interface IBaseRelationsEntityModel {
6
- readonly relations?: string[];
6
+ relations?: string[];
7
7
  }
8
8
  export interface IBaseSoftDeleteEntityModel {
9
9
  deletedAt?: Date;
@@ -71,8 +71,8 @@ export interface IFeatureToggle {
71
71
  lastSeenAt?: string | null;
72
72
  }
73
73
  export declare enum FeatureEnum {
74
- FEATURE_DASHBOARD = "FEATURE_DASHBOARD",
75
74
  FEATURE_HOME = "FEATURE_HOME",
75
+ FEATURE_DASHBOARD = "FEATURE_DASHBOARD",
76
76
  FEATURE_JOB = "FEATURE_JOB",
77
77
  FEATURE_EMPLOYEES = "FEATURE_EMPLOYEES",
78
78
  FEATURE_MANAGE_INVITE = "FEATURE_MANAGE_INVITE",
package/src/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export * from './seed.model';
23
23
  export * from './tag-entity.model';
24
24
  export * from './tenant.model';
25
25
  export * from './translation.model';
26
- export type { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityModel } from './base-entity.model';
26
+ export type { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityModel, IBaseRelationsEntityModel } from './base-entity.model';
27
27
  export type { IBaseEntityModel as BaseEntityModel } from './base-entity.model';
28
28
  export * from './role.model';
29
29
  export * from './user-organization.model';
@@ -2,7 +2,7 @@ import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
2
2
  import { IOrganizationProjectsUpdateInput } from './organization-projects.model';
3
3
  import { IOrganizationUpdateInput } from './organization.model';
4
4
  import { ITag } from './tag-entity.model';
5
- import { I18nObject, TAvatar, TParameterSchema } from './types';
5
+ import { I18nObject, IconDefinition, TAvatar, TParameterSchema } from './types';
6
6
  export interface IIntegration<T = any> extends IBasePerTenantAndOrganizationEntityModel {
7
7
  name: string;
8
8
  description?: string;
@@ -76,10 +76,7 @@ export type TIntegrationProvider = {
76
76
  label: I18nObject;
77
77
  description?: I18nObject;
78
78
  avatar?: string;
79
- icon?: {
80
- svg: string;
81
- color: string;
82
- };
79
+ icon?: IconDefinition;
83
80
  webhook?: boolean;
84
81
  schema?: TParameterSchema;
85
82
  features?: IntegrationFeatureEnum[];
package/src/plugin.d.ts CHANGED
@@ -4,10 +4,10 @@ export interface PluginMeta {
4
4
  name: PluginName;
5
5
  version: string;
6
6
  icon?: IconDefinition;
7
- category?: 'set' | 'doc-source' | 'agent' | 'tools' | 'model' | 'vlm' | 'vector-store' | 'integration';
7
+ category: 'set' | 'doc-source' | 'agent' | 'tools' | 'model' | 'vlm' | 'vector-store' | 'integration';
8
8
  displayName: string;
9
9
  description: string;
10
10
  keywords?: string[];
11
- author?: string;
11
+ author: string;
12
12
  homepage?: string;
13
13
  }