@xpert-ai/contracts 3.9.0-beta.2 → 3.9.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/index.cjs.js +654 -52
- package/index.esm.js +630 -53
- package/package.json +1 -1
- package/src/agent/graph.d.ts +15 -1
- package/src/ai/assistant-binding.model.d.ts +23 -2
- package/src/ai/chat-event.model.d.ts +10 -0
- package/src/ai/chat-message.model.d.ts +27 -0
- package/src/ai/context-compression.model.d.ts +13 -0
- package/src/ai/index.d.ts +2 -0
- package/src/ai/middleware.model.d.ts +5 -0
- package/src/ai/sandbox-terminal.model.d.ts +108 -0
- package/src/ai/skill.model.d.ts +1 -0
- package/src/ai/types.d.ts +45 -20
- package/src/ai/xpert-chat.model.d.ts +29 -2
- package/src/ai/xpert-template.model.d.ts +63 -0
- package/src/ai/xpert-workspace.model.d.ts +1 -1
- package/src/ai/xpert.model.d.ts +21 -12
- package/src/api-key.model.d.ts +2 -0
- package/src/file-asset.model.d.ts +3 -1
- package/src/plugin.d.ts +7 -0
package/package.json
CHANGED
package/src/agent/graph.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ export declare const STATE_SYS_WORKSPACE_PATH = "workspace_path";
|
|
|
24
24
|
* URL for workspace files in sandbox environment
|
|
25
25
|
*/
|
|
26
26
|
export declare const STATE_SYS_WORKSPACE_URL = "workspace_url";
|
|
27
|
+
/**
|
|
28
|
+
* Current runtime thread id
|
|
29
|
+
*/
|
|
30
|
+
export declare const STATE_SYS_THREAD_ID = "thread_id";
|
|
27
31
|
export declare const STATE_VARIABLE_TITLE_CHANNEL: string;
|
|
28
32
|
export type TMessageChannel = {
|
|
29
33
|
system: string;
|
|
@@ -93,6 +97,16 @@ export type TAgentRunnableConfigurable = {
|
|
|
93
97
|
* Execution id of agent workflow node
|
|
94
98
|
*/
|
|
95
99
|
executionId: string;
|
|
100
|
+
/**
|
|
101
|
+
* Root execution id of the current agent run.
|
|
102
|
+
* Nested subgraphs keep writing steer follow-ups back into this execution.
|
|
103
|
+
*/
|
|
104
|
+
rootExecutionId?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Root agent key of the current agent run.
|
|
107
|
+
* Nested subgraphs use this as the primary transcript/log channel.
|
|
108
|
+
*/
|
|
109
|
+
rootAgentKey?: string;
|
|
96
110
|
/**
|
|
97
111
|
* Sandbox backend context
|
|
98
112
|
*/
|
|
@@ -117,7 +131,7 @@ export declare function messageContentText(content: string | TMessageContentComp
|
|
|
117
131
|
* @returns
|
|
118
132
|
*/
|
|
119
133
|
export declare function getWorkspaceFromRunnable(configurable: TAgentRunnableConfigurable): {
|
|
120
|
-
type?: 'project' | '
|
|
134
|
+
type?: 'project' | 'user';
|
|
121
135
|
id?: string;
|
|
122
136
|
};
|
|
123
137
|
export declare function getToolCallFromConfig(config: any): TToolCall;
|
|
@@ -30,17 +30,38 @@ export interface IAssistantBindingSkillPreference {
|
|
|
30
30
|
workspaceId: string;
|
|
31
31
|
disabledSkillIds: string[];
|
|
32
32
|
}
|
|
33
|
+
export type AssistantBindingToolPreferenceSourceType = 'toolset' | 'middleware';
|
|
34
|
+
export type AssistantBindingToolPreferenceSourceMetadata = {
|
|
35
|
+
toolsetId?: string | null;
|
|
36
|
+
toolsetName: string;
|
|
37
|
+
} | {
|
|
38
|
+
provider: string;
|
|
39
|
+
};
|
|
33
40
|
export interface IAssistantBindingConversationPreferences {
|
|
34
|
-
version:
|
|
41
|
+
version: 2;
|
|
35
42
|
defaultThreadId?: string | null;
|
|
36
43
|
lastThreadId?: string | null;
|
|
44
|
+
defaultFollowUpBehavior?: 'queue' | 'steer';
|
|
37
45
|
}
|
|
38
46
|
export interface IAssistantBindingToolPreferences {
|
|
39
|
-
version:
|
|
47
|
+
version: number;
|
|
40
48
|
toolsets?: Record<string, IAssistantBindingToolsetPreference>;
|
|
41
49
|
middlewares?: Record<string, IAssistantBindingMiddlewarePreference>;
|
|
42
50
|
skills?: Record<string, IAssistantBindingSkillPreference>;
|
|
43
51
|
}
|
|
52
|
+
export declare function normalizeAssistantBindingToolPreferences(value?: IAssistantBindingToolPreferences | null): IAssistantBindingToolPreferences | null;
|
|
53
|
+
export declare function isAssistantBindingToolPreferencesEmpty(preferences?: IAssistantBindingToolPreferences | null): boolean;
|
|
54
|
+
export declare function getAssistantBindingDisabledTools(preferences: IAssistantBindingToolPreferences | null | undefined, sourceType: AssistantBindingToolPreferenceSourceType, nodeKey: string | null | undefined): string[];
|
|
55
|
+
export declare function getAssistantBindingDisabledSkillIds(preferences: IAssistantBindingToolPreferences | null | undefined, workspaceId: string | null | undefined): string[];
|
|
56
|
+
export declare function isAssistantBindingToolEnabled(preferences: IAssistantBindingToolPreferences | null | undefined, sourceType: AssistantBindingToolPreferenceSourceType, nodeKey: string | null | undefined, toolName: string): boolean;
|
|
57
|
+
export declare function isAssistantBindingSkillEnabled(preferences: IAssistantBindingToolPreferences | null | undefined, workspaceId: string | null | undefined, skillId: string): boolean;
|
|
58
|
+
export declare function filterAssistantBindingDisabledTools<T extends {
|
|
59
|
+
name: string;
|
|
60
|
+
}>(tools: T[], preferences: IAssistantBindingToolPreferences | null | undefined, sourceType: AssistantBindingToolPreferenceSourceType, nodeKey: string | null | undefined): T[];
|
|
61
|
+
export declare function filterAssistantBindingDisabledSkillIds(skillIds: string[], preferences: IAssistantBindingToolPreferences | null | undefined, workspaceId: string | null | undefined): string[];
|
|
62
|
+
export declare function updateAssistantBindingToolPreferences(preferences: IAssistantBindingToolPreferences | null | undefined, sourceType: AssistantBindingToolPreferenceSourceType, nodeKey: string | null | undefined, metadata: AssistantBindingToolPreferenceSourceMetadata, toolName: string, enabled: boolean): IAssistantBindingToolPreferences | null;
|
|
63
|
+
export declare function updateAssistantBindingSkillPreferences(preferences: IAssistantBindingToolPreferences | null | undefined, workspaceId: string | null | undefined, skillId: string, enabled: boolean): IAssistantBindingToolPreferences | null;
|
|
64
|
+
export declare function ensureAssistantBindingSkillWorkspacePreference(preferences: IAssistantBindingToolPreferences | null | undefined, workspaceId: string): IAssistantBindingToolPreferences;
|
|
44
65
|
export interface IAssistantBinding extends IBasePerTenantAndOrganizationEntityModel {
|
|
45
66
|
code: AssistantCode;
|
|
46
67
|
scope: AssistantBindingScope;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import type { TChatEventMessage } from '@xpert-ai/chatkit-types';
|
|
2
2
|
export declare const CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE: "thread_context_usage";
|
|
3
3
|
export declare const CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY: "conversation_title_summary";
|
|
4
|
+
export declare const CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED: "follow_up_consumed";
|
|
4
5
|
export type TConversationTitleSummaryEvent = TChatEventMessage & {
|
|
5
6
|
id?: string;
|
|
6
7
|
type: typeof CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY;
|
|
7
8
|
};
|
|
9
|
+
export type TFollowUpConsumedEvent = TChatEventMessage & {
|
|
10
|
+
type: typeof CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED;
|
|
11
|
+
mode: 'queue' | 'steer';
|
|
12
|
+
messageIds: string[];
|
|
13
|
+
clientMessageIds?: string[];
|
|
14
|
+
executionId?: string | null;
|
|
15
|
+
visibleAt?: string | null;
|
|
16
|
+
};
|
|
8
17
|
export declare function createConversationTitleSummaryEvent(event: Omit<TConversationTitleSummaryEvent, 'type'>): TConversationTitleSummaryEvent;
|
|
18
|
+
export declare function createFollowUpConsumedEvent(event: Omit<TFollowUpConsumedEvent, 'type'>): TFollowUpConsumedEvent;
|
|
@@ -12,6 +12,25 @@ export type TSummaryJob = Record<LongTermMemoryTypeEnum, {
|
|
|
12
12
|
progress?: number;
|
|
13
13
|
memoryKey?: string;
|
|
14
14
|
}>;
|
|
15
|
+
export type TChatReferenceBase = {
|
|
16
|
+
id?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
export type TChatCodeReference = TChatReferenceBase & {
|
|
21
|
+
type: 'code';
|
|
22
|
+
path: string;
|
|
23
|
+
startLine: number;
|
|
24
|
+
endLine: number;
|
|
25
|
+
language?: string;
|
|
26
|
+
taskId?: string;
|
|
27
|
+
};
|
|
28
|
+
export type TChatQuoteReference = TChatReferenceBase & {
|
|
29
|
+
type: 'quote';
|
|
30
|
+
messageId?: string;
|
|
31
|
+
source?: string;
|
|
32
|
+
};
|
|
33
|
+
export type TChatReference = TChatCodeReference | TChatQuoteReference;
|
|
15
34
|
/**
|
|
16
35
|
* Chat message entity type
|
|
17
36
|
*/
|
|
@@ -23,6 +42,10 @@ export interface IChatMessage extends IBasePerTenantAndOrganizationEntityModel,
|
|
|
23
42
|
* Files
|
|
24
43
|
*/
|
|
25
44
|
attachments?: IStorageFile[];
|
|
45
|
+
/**
|
|
46
|
+
* Structured references associated with the human input
|
|
47
|
+
*/
|
|
48
|
+
references?: TChatReference[];
|
|
26
49
|
/**
|
|
27
50
|
* Job of summary
|
|
28
51
|
*/
|
|
@@ -42,6 +65,10 @@ export interface IChatMessage extends IBasePerTenantAndOrganizationEntityModel,
|
|
|
42
65
|
conversationId?: string | null;
|
|
43
66
|
executionId?: string;
|
|
44
67
|
execution?: IXpertAgentExecution;
|
|
68
|
+
followUpMode?: 'queue' | 'steer';
|
|
69
|
+
followUpStatus?: 'pending' | 'consumed' | 'canceled';
|
|
70
|
+
targetExecutionId?: string | null;
|
|
71
|
+
visibleAt?: Date | string | null;
|
|
45
72
|
}
|
|
46
73
|
/**
|
|
47
74
|
* @deprecated
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const CONTEXT_COMPRESSION_COMPONENT_TYPE = "context-compression";
|
|
2
|
+
export type TContextCompressionComponentStatus = 'running' | 'success' | 'fail';
|
|
3
|
+
export type TContextCompressionComponentData = {
|
|
4
|
+
category: 'Tool';
|
|
5
|
+
type: typeof CONTEXT_COMPRESSION_COMPONENT_TYPE;
|
|
6
|
+
status: TContextCompressionComponentStatus;
|
|
7
|
+
title?: string;
|
|
8
|
+
message?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
created_date?: string | Date | null;
|
|
11
|
+
end_date?: string | Date | null;
|
|
12
|
+
};
|
|
13
|
+
export declare function isContextCompressionComponentData(value: unknown): value is TContextCompressionComponentData;
|
package/src/ai/index.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from './knowledge-doc.model';
|
|
|
58
58
|
export * from './knowledge-doc-page.model';
|
|
59
59
|
export * from './role-permissions';
|
|
60
60
|
export * from './xpert-agent-execution.model';
|
|
61
|
+
export * from './sandbox-terminal.model';
|
|
61
62
|
export * from './xpert-agent.model';
|
|
62
63
|
export * from './xpert-chat.model';
|
|
63
64
|
export * from './xpert-tool.model';
|
|
@@ -80,5 +81,6 @@ export * from './knowledge-retrieval-log.model';
|
|
|
80
81
|
export * from './knowledge-doc-chunk.model';
|
|
81
82
|
export * from './skill.model';
|
|
82
83
|
export * from './middleware.model';
|
|
84
|
+
export * from './context-compression.model';
|
|
83
85
|
export * from './sandbox';
|
|
84
86
|
export * from './message-content.utils';
|
|
@@ -2,6 +2,8 @@ import { IWorkflowNode, WorkflowNodeTypeEnum } from "./xpert-workflow.model";
|
|
|
2
2
|
import { I18nObject, IconDefinition } from "../types";
|
|
3
3
|
import { TXpertFeatureKey, TXpertGraph, TXpertTeamNode } from "./xpert.model";
|
|
4
4
|
import { JsonSchemaObjectType } from "./types";
|
|
5
|
+
export declare const LEGACY_SANDBOX_COMPRESSION_MIDDLEWARE_NAME = "SandboxCompressionMiddleware";
|
|
6
|
+
export declare const CONTEXT_COMPRESSION_MIDDLEWARE_NAME = "ContextCompressionMiddleware";
|
|
5
7
|
export interface IWFNMiddleware extends IWorkflowNode {
|
|
6
8
|
type: WorkflowNodeTypeEnum.MIDDLEWARE;
|
|
7
9
|
provider: string;
|
|
@@ -13,6 +15,9 @@ export type TMiddlewareToolConfig = {
|
|
|
13
15
|
};
|
|
14
16
|
export declare function isMiddlewareToolEnabled(config?: TMiddlewareToolConfig | boolean): boolean;
|
|
15
17
|
export declare function genXpertMiddlewareKey(): string;
|
|
18
|
+
export declare function normalizeMiddlewareProvider(provider?: string | null): string;
|
|
19
|
+
export declare function normalizeMiddlewareNode<T extends TXpertTeamNode>(node: T): T;
|
|
20
|
+
export declare function normalizeMiddlewareNodes<T extends TXpertTeamNode>(nodes?: T[] | null): T[];
|
|
16
21
|
export type TAgentMiddlewareMeta = {
|
|
17
22
|
name: string;
|
|
18
23
|
label: I18nObject;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export declare const SANDBOX_TERMINAL_NAMESPACE: "sandbox-terminal";
|
|
2
|
+
export declare enum SandboxTerminalClientEvent {
|
|
3
|
+
Open = "open",
|
|
4
|
+
Input = "input",
|
|
5
|
+
Resize = "resize",
|
|
6
|
+
Close = "close"
|
|
7
|
+
}
|
|
8
|
+
export declare enum SandboxTerminalServerEvent {
|
|
9
|
+
Opened = "opened",
|
|
10
|
+
Output = "output",
|
|
11
|
+
Exit = "exit",
|
|
12
|
+
Error = "error",
|
|
13
|
+
Closed = "closed"
|
|
14
|
+
}
|
|
15
|
+
export declare enum SandboxTerminalClosedReason {
|
|
16
|
+
ClientClosed = "client_closed",
|
|
17
|
+
Error = "error",
|
|
18
|
+
OpenFailed = "open_failed",
|
|
19
|
+
ProcessExited = "process_exited",
|
|
20
|
+
SocketDisconnected = "socket_disconnected",
|
|
21
|
+
UnsupportedProvider = "unsupported_provider"
|
|
22
|
+
}
|
|
23
|
+
export declare enum SandboxTerminalErrorCode {
|
|
24
|
+
CloseFailed = "close_failed",
|
|
25
|
+
ConversationNotFound = "conversation_not_found",
|
|
26
|
+
ConversationRequired = "conversation_required",
|
|
27
|
+
InputFailed = "input_failed",
|
|
28
|
+
OpenFailed = "open_failed",
|
|
29
|
+
ProviderUnavailable = "provider_unavailable",
|
|
30
|
+
ResizeFailed = "resize_failed",
|
|
31
|
+
SandboxDisabled = "sandbox_disabled",
|
|
32
|
+
SessionNotFound = "session_not_found",
|
|
33
|
+
UnsupportedProvider = "unsupported_provider"
|
|
34
|
+
}
|
|
35
|
+
export type SandboxTerminalDimensions = {
|
|
36
|
+
cols: number;
|
|
37
|
+
rows: number;
|
|
38
|
+
};
|
|
39
|
+
export type SandboxTerminalOpenRequest = SandboxTerminalDimensions & {
|
|
40
|
+
conversationId: string;
|
|
41
|
+
projectId?: string | null;
|
|
42
|
+
requestId: string;
|
|
43
|
+
};
|
|
44
|
+
export type SandboxTerminalInputRequest = {
|
|
45
|
+
data: string;
|
|
46
|
+
sessionId: string;
|
|
47
|
+
};
|
|
48
|
+
export type SandboxTerminalResizeRequest = SandboxTerminalDimensions & {
|
|
49
|
+
sessionId: string;
|
|
50
|
+
};
|
|
51
|
+
export type SandboxTerminalCloseRequest = {
|
|
52
|
+
sessionId: string;
|
|
53
|
+
};
|
|
54
|
+
export type SandboxTerminalOpenedEvent = {
|
|
55
|
+
provider: string;
|
|
56
|
+
requestId: string;
|
|
57
|
+
sessionId: string;
|
|
58
|
+
workingDirectory: string;
|
|
59
|
+
};
|
|
60
|
+
export type SandboxTerminalOutputEvent = {
|
|
61
|
+
data: string;
|
|
62
|
+
sessionId: string;
|
|
63
|
+
};
|
|
64
|
+
export type SandboxTerminalExitEvent = {
|
|
65
|
+
exitCode: number | null;
|
|
66
|
+
sessionId: string;
|
|
67
|
+
signal?: number | null;
|
|
68
|
+
};
|
|
69
|
+
export type SandboxTerminalErrorEvent = {
|
|
70
|
+
code: SandboxTerminalErrorCode;
|
|
71
|
+
message: string;
|
|
72
|
+
requestId?: string;
|
|
73
|
+
sessionId?: string;
|
|
74
|
+
};
|
|
75
|
+
export type SandboxTerminalClosedEvent = {
|
|
76
|
+
reason: SandboxTerminalClosedReason;
|
|
77
|
+
requestId?: string;
|
|
78
|
+
sessionId?: string;
|
|
79
|
+
};
|
|
80
|
+
export type SandboxTerminalClientMessage = {
|
|
81
|
+
event: SandboxTerminalClientEvent.Open;
|
|
82
|
+
data: SandboxTerminalOpenRequest;
|
|
83
|
+
} | {
|
|
84
|
+
event: SandboxTerminalClientEvent.Input;
|
|
85
|
+
data: SandboxTerminalInputRequest;
|
|
86
|
+
} | {
|
|
87
|
+
event: SandboxTerminalClientEvent.Resize;
|
|
88
|
+
data: SandboxTerminalResizeRequest;
|
|
89
|
+
} | {
|
|
90
|
+
event: SandboxTerminalClientEvent.Close;
|
|
91
|
+
data: SandboxTerminalCloseRequest;
|
|
92
|
+
};
|
|
93
|
+
export type SandboxTerminalServerMessage = {
|
|
94
|
+
event: SandboxTerminalServerEvent.Opened;
|
|
95
|
+
data: SandboxTerminalOpenedEvent;
|
|
96
|
+
} | {
|
|
97
|
+
event: SandboxTerminalServerEvent.Output;
|
|
98
|
+
data: SandboxTerminalOutputEvent;
|
|
99
|
+
} | {
|
|
100
|
+
event: SandboxTerminalServerEvent.Exit;
|
|
101
|
+
data: SandboxTerminalExitEvent;
|
|
102
|
+
} | {
|
|
103
|
+
event: SandboxTerminalServerEvent.Error;
|
|
104
|
+
data: SandboxTerminalErrorEvent;
|
|
105
|
+
} | {
|
|
106
|
+
event: SandboxTerminalServerEvent.Closed;
|
|
107
|
+
data: SandboxTerminalClosedEvent;
|
|
108
|
+
};
|
package/src/ai/skill.model.d.ts
CHANGED
package/src/ai/types.d.ts
CHANGED
|
@@ -38,6 +38,50 @@ export declare enum EmbeddingStatusEnum {
|
|
|
38
38
|
REQUIRED = "required"
|
|
39
39
|
}
|
|
40
40
|
export declare const Attachment_Type_Options: TSelectOption<string, TXpertAttachmentType>[];
|
|
41
|
+
export type JsonSchemaUIExtensions = {
|
|
42
|
+
/**
|
|
43
|
+
* UI component variant, or custom component name
|
|
44
|
+
*/
|
|
45
|
+
component?: 'textarea' | 'select' | 'radio' | 'checkbox' | 'switch' | 'password' | string;
|
|
46
|
+
/**
|
|
47
|
+
* UI component display span (for grid layouts)
|
|
48
|
+
*/
|
|
49
|
+
span?: number;
|
|
50
|
+
/**
|
|
51
|
+
* UI component column count (for grid layouts)
|
|
52
|
+
*/
|
|
53
|
+
cols?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Additional inputs for the Custom UI component
|
|
56
|
+
*/
|
|
57
|
+
inputs?: Record<string, unknown>;
|
|
58
|
+
/**
|
|
59
|
+
* Whether this component supports selecting LangGraph state variables
|
|
60
|
+
*/
|
|
61
|
+
variable?: boolean;
|
|
62
|
+
enumLabels?: Record<string, I18nObject | string>;
|
|
63
|
+
styles?: Record<string, string>;
|
|
64
|
+
/**
|
|
65
|
+
* Help url for this field
|
|
66
|
+
*/
|
|
67
|
+
help?: I18nObject;
|
|
68
|
+
/**
|
|
69
|
+
* Field dependencies
|
|
70
|
+
*/
|
|
71
|
+
depends?: (string | {
|
|
72
|
+
name: string;
|
|
73
|
+
alias?: string;
|
|
74
|
+
})[];
|
|
75
|
+
/**
|
|
76
|
+
* Whether multiple values can be selected (for select component)
|
|
77
|
+
*/
|
|
78
|
+
multiple?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Options values url for remote select component
|
|
81
|
+
*/
|
|
82
|
+
selectUrl?: string;
|
|
83
|
+
revealable?: boolean;
|
|
84
|
+
};
|
|
41
85
|
type JsonSchema7Meta = {
|
|
42
86
|
title?: I18nObject;
|
|
43
87
|
default?: any;
|
|
@@ -46,26 +90,7 @@ type JsonSchema7Meta = {
|
|
|
46
90
|
/**
|
|
47
91
|
* UI schema extensions
|
|
48
92
|
*/
|
|
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
|
-
};
|
|
93
|
+
'x-ui'?: JsonSchemaUIExtensions;
|
|
69
94
|
};
|
|
70
95
|
export type JsonSchemaObjectType = {
|
|
71
96
|
type: "object";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TChatRequestHuman, TInterruptCommand } from '@xpert-ai/chatkit-types';
|
|
2
2
|
import { STATE_VARIABLE_HUMAN } from '@xpert-ai/chatkit-types';
|
|
3
|
+
export type TXpertFollowUpMode = 'queue' | 'steer';
|
|
3
4
|
export type TXpertChatState = {
|
|
4
5
|
[STATE_VARIABLE_HUMAN]?: TChatRequestHuman;
|
|
5
6
|
} & Record<string, any>;
|
|
@@ -43,7 +44,18 @@ export type TXpertChatRetryRequest = {
|
|
|
43
44
|
environmentId?: string;
|
|
44
45
|
checkpointId?: string;
|
|
45
46
|
};
|
|
46
|
-
export type
|
|
47
|
+
export type TXpertChatFollowUpRequest = {
|
|
48
|
+
action: 'follow_up';
|
|
49
|
+
conversationId: string;
|
|
50
|
+
mode: TXpertFollowUpMode;
|
|
51
|
+
message: {
|
|
52
|
+
clientMessageId?: string;
|
|
53
|
+
input: TChatRequestHuman;
|
|
54
|
+
};
|
|
55
|
+
target?: TXpertChatTarget;
|
|
56
|
+
state?: TXpertChatState;
|
|
57
|
+
};
|
|
58
|
+
export type TChatRequest = TXpertChatSendRequest | TXpertChatResumeRequest | TXpertChatRetryRequest | TXpertChatFollowUpRequest;
|
|
47
59
|
export type TXpertAgentChatRunRequest = {
|
|
48
60
|
action: 'run';
|
|
49
61
|
state: TXpertChatState;
|
|
@@ -63,4 +75,19 @@ export type TXpertAgentChatResumeRequest = {
|
|
|
63
75
|
environmentId?: string;
|
|
64
76
|
state?: TXpertChatState;
|
|
65
77
|
};
|
|
66
|
-
export type
|
|
78
|
+
export type TXpertAgentChatFollowUpRequest = {
|
|
79
|
+
action: 'follow_up';
|
|
80
|
+
agentKey: string;
|
|
81
|
+
xpertId: string;
|
|
82
|
+
mode: TXpertFollowUpMode;
|
|
83
|
+
message: {
|
|
84
|
+
clientMessageId?: string;
|
|
85
|
+
input: TChatRequestHuman;
|
|
86
|
+
};
|
|
87
|
+
target?: {
|
|
88
|
+
executionId?: string;
|
|
89
|
+
};
|
|
90
|
+
environmentId?: string;
|
|
91
|
+
state?: TXpertChatState;
|
|
92
|
+
};
|
|
93
|
+
export type TXpertAgentChatRequest = TXpertAgentChatRunRequest | TXpertAgentChatResumeRequest | TXpertAgentChatFollowUpRequest;
|
|
@@ -9,6 +9,69 @@ export interface IXpertTemplate extends IBasePerTenantEntityModel {
|
|
|
9
9
|
visitCount: number;
|
|
10
10
|
lastVisitedAt?: Date;
|
|
11
11
|
}
|
|
12
|
+
export type TemplateSkillSyncMode = 'incremental' | 'full';
|
|
13
|
+
export type TemplateSkillSyncStatus = 'created' | 'updated' | 'unchanged' | 'missing' | 'failed';
|
|
14
|
+
export interface ITemplateSkillSyncItemSummary {
|
|
15
|
+
created: number;
|
|
16
|
+
updated: number;
|
|
17
|
+
unchanged: number;
|
|
18
|
+
missing: number;
|
|
19
|
+
failed: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ITemplateSkillSyncRepositoryResult {
|
|
22
|
+
name: string;
|
|
23
|
+
provider: string;
|
|
24
|
+
repositoryId?: string;
|
|
25
|
+
status: TemplateSkillSyncStatus;
|
|
26
|
+
message?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ITemplateSkillSyncIndexResult {
|
|
29
|
+
repositoryId?: string;
|
|
30
|
+
repositoryName: string;
|
|
31
|
+
provider: string;
|
|
32
|
+
mode: TemplateSkillSyncMode;
|
|
33
|
+
status: TemplateSkillSyncStatus;
|
|
34
|
+
syncedCount?: number;
|
|
35
|
+
message?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ITemplateSkillSyncBundleResult {
|
|
38
|
+
sharedSkillId: string;
|
|
39
|
+
provider: string;
|
|
40
|
+
repositoryName: string;
|
|
41
|
+
skillId: string;
|
|
42
|
+
status: TemplateSkillSyncStatus;
|
|
43
|
+
hash?: string;
|
|
44
|
+
repositoryId?: string;
|
|
45
|
+
indexId?: string;
|
|
46
|
+
message?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ITemplateSkillSyncRefResult {
|
|
49
|
+
provider: string;
|
|
50
|
+
repositoryName: string;
|
|
51
|
+
skillId: string;
|
|
52
|
+
status: TemplateSkillSyncStatus;
|
|
53
|
+
repositoryId?: string;
|
|
54
|
+
indexId?: string;
|
|
55
|
+
message?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ITemplateSkillSyncSummary {
|
|
58
|
+
repositories: ITemplateSkillSyncItemSummary;
|
|
59
|
+
indexes: ITemplateSkillSyncItemSummary;
|
|
60
|
+
bundles: ITemplateSkillSyncItemSummary;
|
|
61
|
+
featuredRefs: ITemplateSkillSyncItemSummary;
|
|
62
|
+
workspaceDefaults: ITemplateSkillSyncItemSummary;
|
|
63
|
+
}
|
|
64
|
+
export interface ITemplateSkillSyncResult {
|
|
65
|
+
mode: TemplateSkillSyncMode;
|
|
66
|
+
validateOnly: boolean;
|
|
67
|
+
fingerprint: string;
|
|
68
|
+
repositories: ITemplateSkillSyncRepositoryResult[];
|
|
69
|
+
indexes: ITemplateSkillSyncIndexResult[];
|
|
70
|
+
bundles: ITemplateSkillSyncBundleResult[];
|
|
71
|
+
featuredRefs: ITemplateSkillSyncRefResult[];
|
|
72
|
+
workspaceDefaults: ITemplateSkillSyncRefResult[];
|
|
73
|
+
summary: ITemplateSkillSyncSummary;
|
|
74
|
+
}
|
|
12
75
|
export type TTemplate = {
|
|
13
76
|
id: string;
|
|
14
77
|
name: string;
|
|
@@ -18,7 +18,7 @@ export interface IXpertWorkspace extends IBasePerTenantAndOrganizationEntityMode
|
|
|
18
18
|
}
|
|
19
19
|
export type TXpertWorkspaceSettings = {
|
|
20
20
|
system?: {
|
|
21
|
-
kind?: 'org-default' | 'user-default';
|
|
21
|
+
kind?: 'org-default' | 'tenant-default' | 'user-default';
|
|
22
22
|
userId?: string;
|
|
23
23
|
};
|
|
24
24
|
};
|
package/src/ai/xpert.model.d.ts
CHANGED
|
@@ -33,6 +33,10 @@ export type TXpertSandboxFeature = {
|
|
|
33
33
|
enabled: boolean;
|
|
34
34
|
provider?: string;
|
|
35
35
|
};
|
|
36
|
+
export type TXpertTitleFeature = {
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
instruction?: string;
|
|
39
|
+
};
|
|
36
40
|
export type TXpertFeatures = {
|
|
37
41
|
opener: {
|
|
38
42
|
enabled: boolean;
|
|
@@ -66,6 +70,10 @@ export type TXpertFeatures = {
|
|
|
66
70
|
* Sandbox feature
|
|
67
71
|
*/
|
|
68
72
|
sandbox?: TXpertSandboxFeature;
|
|
73
|
+
/**
|
|
74
|
+
* Conversation title generation feature
|
|
75
|
+
*/
|
|
76
|
+
title?: TXpertTitleFeature;
|
|
69
77
|
};
|
|
70
78
|
export type TXpertFeatureKey = keyof TXpertFeatures;
|
|
71
79
|
export type TXpert = {
|
|
@@ -209,9 +217,10 @@ export type TXpertOptions = {
|
|
|
209
217
|
/**
|
|
210
218
|
* Config for Agent execution (Langgraph.js)
|
|
211
219
|
*/
|
|
220
|
+
export declare const DEFAULT_XPERT_AGENT_RECURSION_LIMIT = 1000;
|
|
212
221
|
export type TXpertAgentConfig = {
|
|
213
222
|
/**
|
|
214
|
-
* Maximum number of times a call can recurse. If not provided, defaults to
|
|
223
|
+
* Maximum number of times a call can recurse. If not provided, defaults to 1000.
|
|
215
224
|
*/
|
|
216
225
|
recursionLimit?: number;
|
|
217
226
|
/** Maximum number of parallel calls to make. */
|
|
@@ -257,13 +266,6 @@ export type TXpertAgentConfig = {
|
|
|
257
266
|
* Retrieval params for every knowledgebase
|
|
258
267
|
*/
|
|
259
268
|
retrievals?: Record<string, TKBRetrievalSettings>;
|
|
260
|
-
/**
|
|
261
|
-
* Summarize the title of the conversation
|
|
262
|
-
*/
|
|
263
|
-
summarizeTitle?: {
|
|
264
|
-
disable?: boolean;
|
|
265
|
-
instruction?: string;
|
|
266
|
-
};
|
|
267
269
|
tools?: Record<string, {
|
|
268
270
|
/**
|
|
269
271
|
* Memory assigner for tool's results. (save result of tool call into state variable)
|
|
@@ -277,6 +279,17 @@ export type TXpertAgentConfig = {
|
|
|
277
279
|
parameters?: Record<string, any>;
|
|
278
280
|
}>;
|
|
279
281
|
};
|
|
282
|
+
export declare function getXpertAgentRecursionLimit(agentConfig?: {
|
|
283
|
+
recursionLimit?: number | null;
|
|
284
|
+
} | null): number;
|
|
285
|
+
export declare function normalizeXpertAgentConfig(): {
|
|
286
|
+
recursionLimit: number;
|
|
287
|
+
};
|
|
288
|
+
export declare function normalizeXpertAgentConfig<T extends {
|
|
289
|
+
recursionLimit?: number | null;
|
|
290
|
+
}>(agentConfig: T): Omit<T, 'recursionLimit'> & {
|
|
291
|
+
recursionLimit: number;
|
|
292
|
+
};
|
|
280
293
|
export type TStateVariableType = XpertParameterTypeEnum | 'object' | 'array[string]' | 'array[number]' | 'array[object]';
|
|
281
294
|
/**
|
|
282
295
|
*/
|
|
@@ -465,10 +478,6 @@ export type TChatOptions = {
|
|
|
465
478
|
* Call from
|
|
466
479
|
*/
|
|
467
480
|
from?: TChatFrom;
|
|
468
|
-
/**
|
|
469
|
-
* Whether to summarize the conversation title
|
|
470
|
-
*/
|
|
471
|
-
summarizeTitle?: boolean;
|
|
472
481
|
/**
|
|
473
482
|
* Project ID, identify the project where the xpert invoked
|
|
474
483
|
*/
|
package/src/api-key.model.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface IApiKey extends IBasePerTenantAndOrganizationEntityModel {
|
|
|
13
13
|
/**
|
|
14
14
|
* Stable binding target id/code. Examples:
|
|
15
15
|
* - assistant => xpertId
|
|
16
|
+
* - workspace => workspaceId
|
|
16
17
|
* - integration => integrationId
|
|
17
18
|
* - client => clientCode
|
|
18
19
|
*/
|
|
@@ -37,6 +38,7 @@ export declare const API_PRINCIPAL_USER_ID_HEADER = "x-principal-user-id";
|
|
|
37
38
|
*/
|
|
38
39
|
export declare enum ApiKeyBindingType {
|
|
39
40
|
ASSISTANT = "assistant",
|
|
41
|
+
WORKSPACE = "workspace",
|
|
40
42
|
INTEGRATION = "integration",
|
|
41
43
|
CLIENT = "client",
|
|
42
44
|
/**
|
|
@@ -2,7 +2,7 @@ import { IStorageFile } from './storage-file.model';
|
|
|
2
2
|
export type FileAssetStatus = 'success' | 'partial_success' | 'failed';
|
|
3
3
|
export type FileAssetDestinationKind = 'storage' | 'volume' | 'sandbox';
|
|
4
4
|
export type FileAssetSourceKind = 'multipart' | 'storage_file' | 'local_file';
|
|
5
|
-
export type FileUploadVolumeCatalog = 'projects' | 'users' | 'knowledges' | 'skills';
|
|
5
|
+
export type FileUploadVolumeCatalog = 'projects' | 'users' | 'knowledges' | 'skills' | 'xperts';
|
|
6
6
|
export type FileUploadSandboxMode = 'mounted_workspace' | 'backend_upload';
|
|
7
7
|
export interface IFileAssetSource {
|
|
8
8
|
kind: FileAssetSourceKind;
|
|
@@ -49,7 +49,9 @@ export interface IUploadFileVolumeTarget {
|
|
|
49
49
|
catalog: FileUploadVolumeCatalog;
|
|
50
50
|
projectId?: string;
|
|
51
51
|
knowledgeId?: string;
|
|
52
|
+
xpertId?: string;
|
|
52
53
|
userId?: string;
|
|
54
|
+
isolateByUser?: boolean;
|
|
53
55
|
tenantId?: string;
|
|
54
56
|
folder?: string;
|
|
55
57
|
fileName?: string;
|
package/src/plugin.d.ts
CHANGED
|
@@ -107,6 +107,13 @@ export interface IPluginDescriptor {
|
|
|
107
107
|
effectiveInCurrentScope: boolean;
|
|
108
108
|
scopeRelation?: PluginScopeRelation;
|
|
109
109
|
}
|
|
110
|
+
export interface IPluginLatestVersionStatus {
|
|
111
|
+
organizationId?: string;
|
|
112
|
+
name: PluginName;
|
|
113
|
+
packageName?: string;
|
|
114
|
+
latestVersion?: string;
|
|
115
|
+
hasUpdate: boolean;
|
|
116
|
+
}
|
|
110
117
|
export interface IPluginConfiguration<TConfig extends Record<string, any> = Record<string, any>> {
|
|
111
118
|
pluginName: PluginName;
|
|
112
119
|
config: TConfig;
|