@xpert-ai/contracts 3.9.3 → 3.9.5

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.
@@ -94,6 +94,10 @@ export interface IWFNKnowledgeBase extends IWorkflowNode {
94
94
  * @deprecated Configure rerank model on the knowledgebase.
95
95
  */
96
96
  rerankModel?: ICopilotModel;
97
+ /**
98
+ * @deprecated Configure chat model on the knowledgebase.
99
+ */
100
+ chatModel?: ICopilotModel;
97
101
  /**
98
102
  * @deprecated Configure vision model on the knowledgebase.
99
103
  */
@@ -5,6 +5,7 @@ import { IKnowledgeDocument } from './knowledge-doc.model';
5
5
  import { IXpert } from './xpert.model';
6
6
  import { IIntegration } from '../integration.model';
7
7
  import { IDocChunkMetadata } from './knowledge-doc-chunk.model';
8
+ import type { GraphRagConfig, KnowledgeGraphStatus } from './knowledge-graph.model';
8
9
  /**
9
10
  * Non-internal types should remain the same as IntegrationEnum.
10
11
  */
@@ -67,6 +68,11 @@ export type TKnowledgebase = {
67
68
  */
68
69
  copilotModel?: ICopilotModel;
69
70
  copilotModelId?: string;
71
+ /**
72
+ * Chat model for knowledgebase LLM tasks.
73
+ */
74
+ chatModel?: ICopilotModel | null;
75
+ chatModelId?: string | null;
70
76
  embeddingCollectionName?: string | null;
71
77
  embeddingModelFingerprint?: string | null;
72
78
  embeddingDimensions?: number | null;
@@ -79,6 +85,10 @@ export type TKnowledgebase = {
79
85
  pendingEmbeddingRevision?: number | null;
80
86
  rebuildTaskId?: string | null;
81
87
  embeddingRebuildError?: string | null;
88
+ graphRag?: GraphRagConfig | null;
89
+ graphStatus?: KnowledgeGraphStatus | null;
90
+ graphRevision?: number | null;
91
+ graphIndexError?: string | null;
82
92
  rerankModel?: ICopilotModel;
83
93
  rerankModelId?: string;
84
94
  visionModel?: ICopilotModel;
@@ -1,7 +1,8 @@
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";
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
+ import type { SkillSlashCommand } from './skill.model';
5
6
  export declare const LEGACY_SANDBOX_COMPRESSION_MIDDLEWARE_NAME = "SandboxCompressionMiddleware";
6
7
  export declare const CONTEXT_COMPRESSION_MIDDLEWARE_NAME = "ContextCompressionMiddleware";
7
8
  export interface IWFNMiddleware extends IWorkflowNode {
@@ -30,5 +31,6 @@ export type TAgentMiddlewareMeta = {
30
31
  description?: I18nObject;
31
32
  configSchema?: JsonSchemaObjectType;
32
33
  features?: TXpertFeatureKey[];
34
+ slashCommands?: SkillSlashCommand[];
33
35
  };
34
36
  export declare function getAgentMiddlewareNodes(graph: TXpertGraph, agentKey: string): TXpertTeamNode[];
@@ -0,0 +1,51 @@
1
+ import { IconDefinition } from '../types';
2
+ import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
3
+ import { SkillSlashCommandAvailability } from './skill.model';
4
+ export type PromptWorkflowVisibility = 'private' | 'team' | 'tenant';
5
+ export type PromptWorkflowSourceType = 'xpert' | 'workspace_prompt_workflow' | 'skill';
6
+ export type PromptWorkflowCommandPriority = 'normal' | 'preferred';
7
+ export type TPromptWorkflow = {
8
+ name: string;
9
+ label?: string;
10
+ description?: string;
11
+ icon?: string | IconDefinition | Record<string, unknown>;
12
+ category?: string;
13
+ aliases?: string[];
14
+ argsHint?: string;
15
+ template: string;
16
+ tags?: string[];
17
+ visibility?: PromptWorkflowVisibility;
18
+ runtimeCapabilities?: unknown;
19
+ archivedAt?: Date | string | null;
20
+ };
21
+ export interface IPromptWorkflow extends IBasePerWorkspaceEntityModel, TPromptWorkflow {
22
+ }
23
+ export type TPromptWorkflowCommandSnapshot = TPromptWorkflow & {
24
+ workflowId?: string;
25
+ workspaceId?: string;
26
+ };
27
+ export type TXpertCommandProfileEntry = {
28
+ id?: string;
29
+ source: PromptWorkflowSourceType;
30
+ enabled?: boolean;
31
+ order?: number;
32
+ priority?: PromptWorkflowCommandPriority;
33
+ workflowId?: string;
34
+ skillCommandName?: string;
35
+ snapshot?: TPromptWorkflowCommandSnapshot;
36
+ name?: string;
37
+ label?: string;
38
+ description?: string;
39
+ icon?: string | IconDefinition | Record<string, unknown>;
40
+ category?: string;
41
+ aliases?: string[];
42
+ argsHint?: string;
43
+ template?: string;
44
+ runtimeCapabilities?: unknown;
45
+ availability?: SkillSlashCommandAvailability;
46
+ };
47
+ export type TXpertCommandProfile = {
48
+ version: 1;
49
+ enabled?: boolean;
50
+ commands?: TXpertCommandProfileEntry[];
51
+ };
@@ -1,8 +1,9 @@
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";
1
+ import type { ChatKitPromptWorkflow, ChatKitSlashCommand, ChatKitSlashCommandAction, ChatKitSlashCommandAvailability, ChatKitSlashCommandCapability, ChatKitSlashCommandKind } from '@xpert-ai/chatkit-types';
2
+ import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
3
+ import { I18nObject, IconDefinition } from '../types';
4
+ import { JsonSchemaObjectType } from './types';
5
+ import { IWorkflowNode, WorkflowNodeTypeEnum } from './xpert-workflow.model';
6
+ import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
6
7
  export type SkillId = string;
7
8
  export declare const WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER = "workspace-public";
8
9
  export declare const WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME = "Workspace Shared Skills";
@@ -21,6 +22,14 @@ export interface ISkillRepositoryIndexPublisher {
21
22
  image?: string;
22
23
  kind?: string;
23
24
  }
25
+ export type SkillSlashCommandCapability = ChatKitSlashCommandCapability;
26
+ export type SkillSlashCommandAction = ChatKitSlashCommandAction;
27
+ export type SkillSlashCommandAvailability = ChatKitSlashCommandAvailability;
28
+ export type SkillSlashCommandKind = ChatKitSlashCommandKind;
29
+ export type SkillPromptWorkflow = ChatKitPromptWorkflow;
30
+ export type SkillSlashCommand = Omit<ChatKitSlashCommand, 'icon'> & {
31
+ icon?: ChatKitSlashCommand['icon'] | IconDefinition;
32
+ };
24
33
  export interface IShareSkillPackageInput {
25
34
  displayName: string;
26
35
  description: string;
@@ -50,6 +59,7 @@ export interface SkillMetadata {
50
59
  permissions?: string[];
51
60
  tools?: string[];
52
61
  };
62
+ commands?: SkillSlashCommand[];
53
63
  mcp?: {
54
64
  servers?: string[];
55
65
  };
@@ -1,18 +1,5 @@
1
- import type { TChatRequestHuman, TInterruptCommand } from '@xpert-ai/chatkit-types';
2
- import { STATE_VARIABLE_HUMAN } from '@xpert-ai/chatkit-types';
3
- export type TXpertFollowUpMode = 'queue' | 'steer';
4
- export type TXpertChatState = {
5
- [STATE_VARIABLE_HUMAN]?: TChatRequestHuman;
6
- } & Record<string, any>;
7
- export type TXpertChatResumeDecision = {
8
- type: 'confirm' | 'reject';
9
- payload?: unknown;
10
- };
11
- export type TXpertChatInterruptPatch = Pick<TInterruptCommand, 'agentKey' | 'toolCalls' | 'update'>;
12
- export type TXpertChatTarget = {
13
- aiMessageId?: string;
14
- executionId?: string;
15
- };
1
+ import type { FollowUpBehavior, TChatRequestHuman, TXpertChatInterruptPatch, TXpertChatResumeDecision, TXpertChatResumeRequest, TXpertChatState, TXpertChatTarget } from '@xpert-ai/chatkit-types';
2
+ export type TXpertFollowUpMode = FollowUpBehavior;
16
3
  export type TXpertChatSource = {
17
4
  aiMessageId?: string;
18
5
  executionId?: string;
@@ -29,14 +16,6 @@ export type TXpertChatSendRequest = {
29
16
  };
30
17
  state?: TXpertChatState;
31
18
  };
32
- export type TXpertChatResumeRequest = {
33
- action: 'resume';
34
- conversationId: string;
35
- target: TXpertChatTarget;
36
- decision: TXpertChatResumeDecision;
37
- patch?: TXpertChatInterruptPatch;
38
- state?: TXpertChatState;
39
- };
40
19
  export type TXpertChatRetryRequest = {
41
20
  action: 'retry';
42
21
  conversationId: string;
@@ -14,6 +14,7 @@ import { IIntegration } from '../integration.model';
14
14
  import { TChatFrom } from './chat.model';
15
15
  import { IWorkflowNode, TVariableAssigner, TWFCase, VariableOperationEnum } from './xpert-workflow.model';
16
16
  import { IEnvironment } from './environment.model';
17
+ import { TXpertCommandProfile } from './prompt-workflow.model';
17
18
  export type ToolCall = LToolCall;
18
19
  export declare enum XpertTypeEnum {
19
20
  /**
@@ -134,6 +135,7 @@ export type TXpert = {
134
135
  */
135
136
  memory?: TLongTermMemory;
136
137
  features?: TXpertFeatures;
138
+ commandProfile?: TXpertCommandProfile;
137
139
  /**
138
140
  * Version of role: '1' '2' '2.1' '2.2'...
139
141
  */
@@ -520,16 +522,21 @@ export type TChatOptions = {
520
522
  * Knowledgebase retrieval settings
521
523
  */
522
524
  export type TKBRetrievalSettings = {
523
- metadata: {
525
+ mode?: 'vector' | 'graph' | 'hybrid';
526
+ neighborHops?: number;
527
+ entityTopK?: number;
528
+ communityTopK?: number;
529
+ graphWeight?: number;
530
+ metadata?: {
524
531
  filtering_mode: 'disabled' | 'automatic' | 'manual';
525
532
  /**
526
533
  * Conditions (filter) when mode is manual
527
534
  */
528
- filtering_conditions: TWFCase;
535
+ filtering_conditions?: TWFCase;
529
536
  /**
530
537
  * Parameter fields (tool call) when mode is automatic
531
538
  */
532
- fields: Record<string, object>;
539
+ fields?: Record<string, object>;
533
540
  };
534
541
  };
535
542
  export declare function isXpertNodeType<T extends TXpertTeamNodeType>(type: T): (node: TXpertTeamNode) => node is NodeOf<T>;
@@ -1,6 +1,6 @@
1
1
  import { IPoint } from '../types';
2
2
  import { IXpertAgent } from './xpert-agent.model';
3
- import { IXpert, TXpertTeamConnection, TXpertTeamDraft, TXpertTeamNode } from './xpert.model';
3
+ import { IXpert, TXpertGraph, TXpertTeamConnection, TXpertTeamDraft, TXpertTeamNode } from './xpert.model';
4
4
  export declare function omitXpertRelations(xpert: Partial<IXpert>): {
5
5
  environmentId?: string;
6
6
  workspaceId?: string;
@@ -32,11 +32,12 @@ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
32
32
  summarize?: import("./xpert.model").TSummarize;
33
33
  memory?: import("./xpert.model").TLongTermMemory;
34
34
  features?: import("./xpert.model").TXpertFeatures;
35
+ commandProfile?: import("./prompt-workflow.model").TXpertCommandProfile;
35
36
  version?: string;
36
37
  latest?: boolean;
37
38
  releaseNotes?: string;
38
39
  exportedTemplate?: import("./xpert.model").TXpertExportedTemplate | null;
39
- graph?: import("./xpert.model").TXpertGraph;
40
+ graph?: TXpertGraph;
40
41
  api?: import("./xpert.model").TChatApi;
41
42
  app?: import("./xpert.model").TChatApp;
42
43
  userId?: string;
@@ -53,6 +54,9 @@ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
53
54
  * @returns
54
55
  */
55
56
  export declare function figureOutXpert(xpert: IXpert, isDraft: boolean): Partial<IXpert>;
57
+ export declare function resolveRuntimeXpert(xpert: IXpert, isDraft: boolean): IXpert;
58
+ export declare function resolveDraftRuntimeGraph(xpert: IXpert, draft: TXpertTeamDraft): TXpertGraph;
59
+ export declare function resolveDraftPrimaryAgent(xpert: IXpert, draft: TXpertTeamDraft, graph: TXpertGraph): IXpertAgent | undefined;
56
60
  export declare function xpertLabel(agent: Partial<IXpert>): string;
57
61
  export declare function createXpertGraph(xpert: IXpert, position: IPoint): {
58
62
  nodes: TXpertTeamNode[];
@@ -1,4 +1,5 @@
1
1
  import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
2
+ import { SecretTokenBindingType } from './secret-token.model';
2
3
  import { IUser } from './user.model';
3
4
  /**
4
5
  * Represents an API key used for authentication and authorization.
@@ -48,8 +49,16 @@ export declare enum ApiKeyBindingType {
48
49
  }
49
50
  export type ApiPrincipalType = 'api_key' | 'client_secret';
50
51
  export interface IApiPrincipal extends IUser {
51
- apiKey: IApiKey;
52
52
  principalType: ApiPrincipalType;
53
+ apiKey?: IApiKey;
54
+ /**
55
+ * Binding target kind for short-lived client_secret principals.
56
+ * Examples:
57
+ * - api_key => secret_token.entityId is the backing ApiKey id
58
+ * - public_xpert => secret_token.entityId is the public xpert id
59
+ */
60
+ clientSecretBindingType?: SecretTokenBindingType | null;
61
+ clientSecretId?: string | null;
53
62
  /**
54
63
  * Resource owner / key creator. Used for audit and ownership metadata.
55
64
  */
@@ -1,11 +1,17 @@
1
- import { IBaseEntityModel } from './base-entity.model';
2
- export interface ISecretToken extends IBaseEntityModel {
1
+ import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
2
+ export declare enum SecretTokenBindingType {
3
+ API_KEY = "api_key",
4
+ PUBLIC_XPERT = "public_xpert"
5
+ }
6
+ export interface ISecretToken extends IBasePerTenantAndOrganizationEntityModel {
3
7
  entityId?: string;
8
+ type?: SecretTokenBindingType;
4
9
  token: string;
5
10
  validUntil?: Date;
6
11
  expired?: boolean;
7
12
  }
8
- export interface ISecretTokenFindInput extends IBaseEntityModel {
13
+ export interface ISecretTokenFindInput extends IBasePerTenantAndOrganizationEntityModel {
9
14
  entityId?: string;
15
+ type?: SecretTokenBindingType;
10
16
  token?: string;
11
17
  }