@camunda/copilot-chat 0.5.12-alpha.6 → 0.5.12-alpha.8
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/dist/index.d.ts +525 -19
- package/dist/index.js +10800 -2425
- package/dist/package.json +1 -6
- package/package.json +1 -6
- package/dist/bpmn-tools/index.d.ts +0 -3
- package/dist/bpmn-tools/index.js +0 -7
- package/dist/index-YtFHTHlf.mjs +0 -8327
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { layoutProcess } from 'bpmn-auto-layout';
|
|
3
|
+
import { MarkdownProps } from '@carbon/ai-chat-components/es/react/markdown';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { StoreApi } from 'zustand';
|
|
6
|
+
import { UseBoundStore } from 'zustand';
|
|
7
|
+
|
|
8
|
+
export declare const adaptBpmnLintErrorsForLlm: (rawLintErrors: ReadonlyArray<RawBpmnLintError>) => ReadonlyArray<LintError>;
|
|
9
|
+
|
|
10
|
+
export declare interface AgentAdapterConfig {
|
|
11
|
+
readonly transport: AgentTransport;
|
|
12
|
+
readonly onToolInvoke?: (toolName: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
13
|
+
readonly getStatusLabel?: (eventType: EventTypeValue, toolName?: string, eventStatus?: EventStatusValue) => string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare interface AgentAdapterReturn {
|
|
17
|
+
readonly sendMessage: (content: string, context: Record<string, unknown>) => Promise<void>;
|
|
18
|
+
readonly stopGeneration: () => void;
|
|
19
|
+
readonly resetConversation: () => void;
|
|
20
|
+
readonly loadConversation: (conversationId: string) => Promise<void>;
|
|
21
|
+
readonly isBusy: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare interface AgentEvent {
|
|
25
|
+
readonly conversationId: string;
|
|
26
|
+
readonly type: EventTypeValue;
|
|
27
|
+
readonly status: EventStatusValue;
|
|
28
|
+
readonly content?: string;
|
|
29
|
+
readonly toolName?: string;
|
|
30
|
+
readonly toolCallId?: string;
|
|
31
|
+
readonly toolArguments?: string;
|
|
32
|
+
readonly toolResult?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare type AgentResult = ToolInvokeResult | MixedToolResultEvent | ConversationTitleResult;
|
|
36
|
+
|
|
37
|
+
export declare const AgentState: {
|
|
38
|
+
readonly IDLE: "IDLE";
|
|
39
|
+
readonly BUSY: "BUSY";
|
|
40
|
+
readonly AWAITING_TOOL: "AWAITING_TOOL";
|
|
41
|
+
readonly ERROR: "ERROR";
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export declare type AgentStateType = (typeof AgentState)[keyof typeof AgentState];
|
|
45
|
+
|
|
46
|
+
declare type AgentStore = AgentStoreState & AgentStoreActions & {
|
|
47
|
+
callbacks: AgentStoreCallbacks;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
declare interface AgentStoreActions {
|
|
51
|
+
readonly startConversation: (conversationId: string, messageId: string) => void;
|
|
52
|
+
readonly processEvent: (event: AgentEvent) => AgentResult | null;
|
|
53
|
+
readonly clearPendingTool: () => void;
|
|
54
|
+
readonly setError: (error: string) => void;
|
|
55
|
+
readonly reset: () => void;
|
|
56
|
+
readonly setCallbacks: (callbacks: AgentStoreCallbacks) => void;
|
|
57
|
+
readonly setConversationId: (conversationId: string) => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare interface AgentStoreCallbacks {
|
|
61
|
+
readonly onMessageStatusUpdate?: MessageStatusCallback;
|
|
62
|
+
readonly onStatusLabelClear?: StatusLabelCallback;
|
|
63
|
+
readonly onMessageError?: MessageErrorCallback;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare interface AgentStoreState {
|
|
67
|
+
readonly conversationId: string | null;
|
|
68
|
+
readonly currentMessageId: string | null;
|
|
69
|
+
readonly isBusy: boolean;
|
|
70
|
+
readonly currentEventType: EventTypeValue | null;
|
|
71
|
+
readonly currentToolName: string | null;
|
|
72
|
+
readonly pendingToolInvoke: {
|
|
73
|
+
readonly toolName: string;
|
|
74
|
+
readonly toolCallId?: string;
|
|
75
|
+
readonly toolArguments: Record<string, unknown>;
|
|
76
|
+
} | null;
|
|
77
|
+
readonly error: string | null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare interface AgentTransport {
|
|
81
|
+
subscribe(conversationId: string, onEvent: (event: AgentEvent) => void): void;
|
|
82
|
+
unsubscribe(conversationId: string): void;
|
|
83
|
+
sendMessage(payload: SendMessagePayload): Promise<void>;
|
|
84
|
+
sendToolResult(payload: ToolResultPayload): Promise<void>;
|
|
85
|
+
haltConversation?(conversationId: string): Promise<void>;
|
|
86
|
+
updateConversation?(conversationId: string, payload: UpdateConversationPayload): Promise<void>;
|
|
87
|
+
deleteConversation?(conversationId: string): Promise<void>;
|
|
88
|
+
fetchConversations?(page: number, size: number): Promise<ConversationsPage>;
|
|
89
|
+
fetchConversationMessages?(conversationId: string, cursor?: number | null, limit?: number): Promise<ConversationMessagesPage>;
|
|
90
|
+
rollbackConversation?(conversationId: string, milestoneId: string): Promise<RollbackResponse | undefined>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
declare interface BackendToolPayload {
|
|
94
|
+
readonly name: string;
|
|
95
|
+
readonly description: string;
|
|
96
|
+
readonly parameters: Record<string, unknown>;
|
|
97
|
+
readonly category: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
1
100
|
export declare interface BpmnElement {
|
|
2
101
|
readonly id: string;
|
|
3
102
|
readonly type: string;
|
|
@@ -17,7 +116,213 @@ export declare interface BpmnModeler {
|
|
|
17
116
|
}>;
|
|
18
117
|
}
|
|
19
118
|
|
|
20
|
-
declare
|
|
119
|
+
export declare const camundaDocsSearchTool: {
|
|
120
|
+
readonly name: "camunda_docs_search";
|
|
121
|
+
readonly displayName: "Searching docs";
|
|
122
|
+
readonly description: string;
|
|
123
|
+
readonly parameters: {
|
|
124
|
+
readonly type: "object";
|
|
125
|
+
readonly properties: {
|
|
126
|
+
readonly query: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly description: "The search query to find information in the Camunda knowledge base";
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
readonly required: readonly ["query"];
|
|
132
|
+
};
|
|
133
|
+
readonly type: "frontend";
|
|
134
|
+
readonly contentType: "TEXT";
|
|
135
|
+
readonly category: "GENERAL";
|
|
136
|
+
readonly handler: ToolHandler;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export declare interface camundaDocsSearchToolResult {
|
|
140
|
+
readonly answer: string;
|
|
141
|
+
readonly sources: readonly KapaAiSearchResult[];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
declare interface ChatActions {
|
|
145
|
+
readonly addUserMessage: (content: string) => string;
|
|
146
|
+
readonly addAssistantMessage: (id: string) => void;
|
|
147
|
+
readonly appendToMessage: (id: string, content: string) => void;
|
|
148
|
+
readonly setMessageContent: (id: string, content: string) => void;
|
|
149
|
+
readonly updateMessageStatus: (id: string, status: MessageStatus) => void;
|
|
150
|
+
readonly updateMessageStatusLabel: (id: string, statusLabel: string) => void;
|
|
151
|
+
readonly setMessageSources: (id: string, sources: readonly SourceReference[]) => void;
|
|
152
|
+
readonly setStreaming: (isStreaming: boolean, messageId?: string | null) => void;
|
|
153
|
+
readonly clearMessages: () => void;
|
|
154
|
+
readonly addThinkingBlock: (messageId: string, blockId: string, label: string) => void;
|
|
155
|
+
readonly appendToThinkingBlock: (messageId: string, blockId: string, content: string) => void;
|
|
156
|
+
readonly completeThinkingBlock: (messageId: string, blockId: string) => void;
|
|
157
|
+
readonly completeAllThinkingBlocks: (messageId: string) => void;
|
|
158
|
+
readonly setMessageError: (id: string, errorMessage: string) => void;
|
|
159
|
+
readonly addToolBlock: (messageId: string, blockId: string, toolName: string, stepNumber: number, toolArguments?: Record<string, unknown>) => void;
|
|
160
|
+
readonly updateToolBlockStatus: (messageId: string, blockId: string, status: ToolBlockStatus) => void;
|
|
161
|
+
readonly updateToolBlockResult: (messageId: string, blockId: string, toolResult: string) => void;
|
|
162
|
+
readonly addErrorBlock: (messageId: string, blockId: string, errorMessage: string) => void;
|
|
163
|
+
readonly setView: (view: ChatView_2) => void;
|
|
164
|
+
readonly setConversationTitle: (title: string) => void;
|
|
165
|
+
readonly loadConversation: (messages: readonly ChatMessage_2[], title: string | null) => void;
|
|
166
|
+
readonly prependMessages: (messages: readonly ChatMessage_2[]) => void;
|
|
167
|
+
readonly rollbackToMessage: (messageId: string) => void;
|
|
168
|
+
readonly addRollbackMessage: (content: string, milestoneId: string) => void;
|
|
169
|
+
readonly setLastAssistantMessageMilestone: (milestoneId: string) => void;
|
|
170
|
+
readonly setLastUserMessageMilestone: (milestoneId: string) => void;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export declare const ChatInput: ({ onSend, onStop, isBusy, isDisabled, placeholder, isOpen, }: ChatInputProps) => JSX.Element;
|
|
174
|
+
|
|
175
|
+
declare interface ChatInputProps {
|
|
176
|
+
readonly onSend: (message: string) => void;
|
|
177
|
+
readonly onStop?: () => void;
|
|
178
|
+
readonly isBusy?: boolean;
|
|
179
|
+
readonly isDisabled?: boolean;
|
|
180
|
+
readonly placeholder?: string;
|
|
181
|
+
readonly isOpen?: boolean;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export declare const ChatMessage: ({ message, isBusy }: ChatMessageProps) => JSX.Element;
|
|
185
|
+
|
|
186
|
+
declare interface ChatMessage_2 {
|
|
187
|
+
readonly id: string;
|
|
188
|
+
readonly role: MessageRole;
|
|
189
|
+
readonly content: string;
|
|
190
|
+
readonly status: MessageStatus;
|
|
191
|
+
readonly timestamp?: number;
|
|
192
|
+
readonly statusLabel?: string;
|
|
193
|
+
readonly thinkingBlocks?: readonly ThinkingBlock[];
|
|
194
|
+
readonly sources?: readonly SourceReference[];
|
|
195
|
+
readonly milestoneId?: string;
|
|
196
|
+
}
|
|
197
|
+
export { ChatMessage_2 as ChatMessageInterface }
|
|
198
|
+
export { ChatMessage_2 as ChatMessageType }
|
|
199
|
+
|
|
200
|
+
export declare const ChatMessageList: ({ messages, emptyStateTitle, emptyStateDescription, suggestions, onSuggestionClick, onRollback, onSeeVersion, isBusy, hasOlderMessages, isLoadingOlderMessages, onLoadOlderMessages, }: ChatMessageListProps) => JSX.Element;
|
|
201
|
+
|
|
202
|
+
declare interface ChatMessageListProps {
|
|
203
|
+
readonly messages: readonly ChatMessage_2[];
|
|
204
|
+
readonly emptyStateTitle?: string;
|
|
205
|
+
readonly emptyStateDescription?: ReactNode;
|
|
206
|
+
readonly suggestions?: readonly Suggestion[];
|
|
207
|
+
readonly onSuggestionClick?: (suggestion: Suggestion) => void;
|
|
208
|
+
readonly onRollback?: (milestoneId: string) => void;
|
|
209
|
+
readonly onSeeVersion?: (milestoneId: string) => void;
|
|
210
|
+
readonly isBusy?: boolean;
|
|
211
|
+
readonly hasOlderMessages?: boolean;
|
|
212
|
+
readonly isLoadingOlderMessages?: boolean;
|
|
213
|
+
readonly onLoadOlderMessages?: () => void;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
declare interface ChatMessageProps {
|
|
217
|
+
readonly message: ChatMessage_2;
|
|
218
|
+
readonly isBusy?: boolean;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare interface ChatState {
|
|
222
|
+
readonly view: ChatView_2;
|
|
223
|
+
readonly messages: readonly ChatMessage_2[];
|
|
224
|
+
readonly isStreaming: boolean;
|
|
225
|
+
readonly streamingMessageId: string | null;
|
|
226
|
+
readonly currentThinkingBlockId: string | null;
|
|
227
|
+
readonly conversationTitle: string | null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
declare type ChatStore = ChatState & ChatActions;
|
|
231
|
+
|
|
232
|
+
declare type ChatView = 'chat' | 'history';
|
|
233
|
+
|
|
234
|
+
declare type ChatView_2 = 'chat' | 'history';
|
|
235
|
+
|
|
236
|
+
export declare const closeSidecar: () => void;
|
|
237
|
+
|
|
238
|
+
export declare type ContentType = 'TEXT' | 'BPMN';
|
|
239
|
+
|
|
240
|
+
export declare interface ContextItem {
|
|
241
|
+
readonly id?: string;
|
|
242
|
+
readonly label: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export declare interface Conversation {
|
|
246
|
+
readonly id: string;
|
|
247
|
+
readonly name: string;
|
|
248
|
+
readonly created: string;
|
|
249
|
+
readonly updated: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export declare interface ConversationMessage {
|
|
253
|
+
readonly id: string;
|
|
254
|
+
readonly type: CopilotMessageType;
|
|
255
|
+
readonly message?: string;
|
|
256
|
+
readonly feel?: string;
|
|
257
|
+
readonly artifactXml?: string;
|
|
258
|
+
readonly artifactJson?: string;
|
|
259
|
+
readonly toolCallId?: string;
|
|
260
|
+
readonly toolName?: string;
|
|
261
|
+
readonly milestoneId?: string;
|
|
262
|
+
readonly created: string;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export declare interface ConversationMessagesPage {
|
|
266
|
+
readonly id: string;
|
|
267
|
+
readonly name: string;
|
|
268
|
+
readonly messages: readonly ConversationMessage[];
|
|
269
|
+
readonly nextCursor: number | null;
|
|
270
|
+
readonly hasMore: boolean;
|
|
271
|
+
readonly totalCount: number;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export declare interface ConversationsPage {
|
|
275
|
+
readonly conversations: readonly Conversation[];
|
|
276
|
+
readonly page: number;
|
|
277
|
+
readonly size: number;
|
|
278
|
+
readonly totalItems: number;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare interface ConversationTitleResult {
|
|
282
|
+
readonly type: typeof ResultType.CONVERSATION_TITLE;
|
|
283
|
+
readonly conversationTitle: string;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export declare const CopilotChat: ({ onSendMessage, kapaAiIntegrationId, onStopGeneration, onResetConversation, isBusy, isDisabled, isOpen, emptyStateTitle, emptyStateDescription, suggestions, className, contextItems, onRemoveContext, onSeeVersion, }: CopilotChatProps) => JSX.Element;
|
|
287
|
+
|
|
288
|
+
export declare interface CopilotChatProps {
|
|
289
|
+
readonly kapaAiIntegrationId?: string | null;
|
|
290
|
+
readonly onSendMessage: (message: string) => void;
|
|
291
|
+
readonly onStopGeneration?: () => void;
|
|
292
|
+
readonly onResetConversation?: () => void;
|
|
293
|
+
readonly onLoadConversation?: (conversationId: string) => Promise<void>;
|
|
294
|
+
readonly isBusy?: boolean;
|
|
295
|
+
readonly isOpen?: boolean;
|
|
296
|
+
readonly isDisabled?: boolean;
|
|
297
|
+
readonly emptyStateTitle?: string;
|
|
298
|
+
readonly emptyStateDescription?: ReactNode;
|
|
299
|
+
readonly suggestions?: ReadonlyArray<Suggestion>;
|
|
300
|
+
readonly className?: string;
|
|
301
|
+
readonly contextItems?: ReadonlyArray<ContextItem>;
|
|
302
|
+
readonly onRemoveContext?: (item: ContextItem) => void;
|
|
303
|
+
readonly onSeeVersion?: (milestoneId: string) => void;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export declare const CopilotHeader: ({ onReset, onShowHistory, conversationTitle, view, isBusy, }: CopilotHeaderProps) => JSX.Element;
|
|
307
|
+
|
|
308
|
+
declare interface CopilotHeaderProps {
|
|
309
|
+
onReset?: () => void;
|
|
310
|
+
onShowHistory?: () => void;
|
|
311
|
+
conversationTitle?: string;
|
|
312
|
+
view?: ChatView;
|
|
313
|
+
isBusy?: boolean;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
declare type CopilotMessageType = 'USER' | 'ASSISTANT' | 'TOOL_CALL' | 'TOOL_OUTPUT' | 'SYSTEM';
|
|
317
|
+
|
|
318
|
+
export declare const CopilotSidecar: ({ children, workareaSelector, headerSelector, zIndex }: CopilotSidecarProps) => JSX.Element;
|
|
319
|
+
|
|
320
|
+
export declare interface CopilotSidecarProps {
|
|
321
|
+
readonly children: (props: SidecarRenderProps) => ReactNode;
|
|
322
|
+
readonly workareaSelector?: string;
|
|
323
|
+
readonly headerSelector?: string;
|
|
324
|
+
readonly zIndex?: number;
|
|
325
|
+
}
|
|
21
326
|
|
|
22
327
|
export declare interface CopilotToolContext {
|
|
23
328
|
readonly modeler: ModelerAccess;
|
|
@@ -38,7 +343,6 @@ export declare interface CopilotToolContext {
|
|
|
38
343
|
readonly getCustom: () => ReadonlyArray<ElementTemplate>;
|
|
39
344
|
readonly getOotbConnectors: () => ReadonlyArray<ElementTemplate>;
|
|
40
345
|
readonly apply: (elementId: string, templateId: string, version?: number) => unknown;
|
|
41
|
-
readonly getTemplateModule: () => unknown;
|
|
42
346
|
};
|
|
43
347
|
readonly form: {
|
|
44
348
|
readonly getContent: () => string | null;
|
|
@@ -67,28 +371,26 @@ export declare interface CopilotToolContext {
|
|
|
67
371
|
readonly exportXml: () => Promise<string>;
|
|
68
372
|
readonly getLintErrors: () => Promise<ReadonlyArray<LintError>>;
|
|
69
373
|
readonly getDeploymentErrors: () => ReadonlyArray<unknown>;
|
|
70
|
-
readonly getExecutionPlatform: () => {
|
|
71
|
-
readonly name: string;
|
|
72
|
-
readonly version: string;
|
|
73
|
-
} | null;
|
|
74
374
|
readonly ensureExecutionPlatform: () => void;
|
|
75
375
|
};
|
|
76
376
|
readonly project: {
|
|
77
377
|
readonly resolve: () => ProjectContext;
|
|
78
|
-
readonly getFileId: () => string | null;
|
|
79
|
-
readonly getFileType: () => 'bpmn' | 'dmn' | 'form' | null;
|
|
80
378
|
};
|
|
81
379
|
}
|
|
82
380
|
|
|
83
|
-
export declare const createAllTools: (context: CopilotToolContext) => ReadonlyArray<
|
|
381
|
+
export declare const createAllTools: (context: CopilotToolContext) => ReadonlyArray<ToolRegistration_2>;
|
|
84
382
|
|
|
85
383
|
export declare const createModelerAccess: ({ getModeler, is, getBusinessObject }: ModelerAccessOptions) => ModelerAccess;
|
|
86
384
|
|
|
87
|
-
export declare const createWithAutoLayoutAndValidation: (context: CopilotToolContext, layoutProcess: (xml: string) => Promise<string>) => <T
|
|
385
|
+
export declare const createWithAutoLayoutAndValidation: (context: CopilotToolContext, layoutProcess: (xml: string) => Promise<string>) => <T extends Record<string, unknown>>(mutationFn: (modeler: BpmnModeler) => T | Promise<T>) => Promise<T & {
|
|
386
|
+
readonly validationErrors: ReadonlyArray<LintError>;
|
|
387
|
+
}>;
|
|
388
|
+
|
|
389
|
+
export declare const createWithValidation: (context: CopilotToolContext) => <T extends Record<string, unknown>>(mutationFn: (modeler: BpmnModeler) => T | Promise<T>) => Promise<T & {
|
|
88
390
|
readonly validationErrors: ReadonlyArray<LintError>;
|
|
89
391
|
}>;
|
|
90
392
|
|
|
91
|
-
declare type DescriptionFormatter = (args: Record<string, unknown>) => string;
|
|
393
|
+
export declare type DescriptionFormatter = (args: Record<string, unknown>) => string;
|
|
92
394
|
|
|
93
395
|
declare interface DmnDefinitions extends DmnModdleElement {
|
|
94
396
|
readonly $model: {
|
|
@@ -139,6 +441,28 @@ export declare interface ElementTemplate {
|
|
|
139
441
|
readonly groups?: ReadonlyArray<Record<string, unknown>>;
|
|
140
442
|
}
|
|
141
443
|
|
|
444
|
+
export declare const EventStatus: {
|
|
445
|
+
readonly IN_PROGRESS: "IN_PROGRESS";
|
|
446
|
+
readonly COMPLETED: "COMPLETED";
|
|
447
|
+
readonly ERROR: "ERROR";
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
export declare type EventStatusValue = (typeof EventStatus)[keyof typeof EventStatus];
|
|
451
|
+
|
|
452
|
+
export declare const EventType: {
|
|
453
|
+
readonly THINKING: "THINKING";
|
|
454
|
+
readonly EXECUTION_PLAN: "EXECUTION_PLAN";
|
|
455
|
+
readonly TOOL_PLANNING: "TOOL_PLANNING";
|
|
456
|
+
readonly TOOL_INVOKE: "TOOL_INVOKE";
|
|
457
|
+
readonly EXTERNAL_TOOL_CALL: "EXTERNAL_TOOL_CALL";
|
|
458
|
+
readonly TOOL_RESULT: "TOOL_RESULT";
|
|
459
|
+
readonly EXECUTION_COMPLETE: "EXECUTION_COMPLETE";
|
|
460
|
+
readonly ERROR: "ERROR";
|
|
461
|
+
readonly CONVERSATION_TITLE: "CONVERSATION_TITLE";
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
export declare type EventTypeValue = (typeof EventType)[keyof typeof EventType];
|
|
465
|
+
|
|
142
466
|
declare interface FeelValidationResult {
|
|
143
467
|
readonly error?: string;
|
|
144
468
|
readonly warnings?: ReadonlyArray<string>;
|
|
@@ -157,19 +481,56 @@ export declare interface FormLintError {
|
|
|
157
481
|
readonly category: string;
|
|
158
482
|
}
|
|
159
483
|
|
|
484
|
+
export declare const getDefaultStatusLabel: (eventType: EventTypeValue, toolName?: string, eventStatus?: EventStatusValue) => string;
|
|
485
|
+
|
|
160
486
|
export declare interface ImportResult {
|
|
161
487
|
readonly error?: unknown;
|
|
162
488
|
}
|
|
163
489
|
|
|
490
|
+
declare interface KapaAiSearchResult {
|
|
491
|
+
readonly content: string;
|
|
492
|
+
readonly source_url: string;
|
|
493
|
+
readonly title: string;
|
|
494
|
+
readonly source_type: string;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
declare interface KapaToolResult {
|
|
498
|
+
readonly sources: readonly KapaAiSearchResult[];
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export { layoutProcess }
|
|
502
|
+
|
|
164
503
|
export declare interface LintError {
|
|
165
504
|
readonly elementId: string;
|
|
166
|
-
readonly elementName
|
|
505
|
+
readonly elementName?: string;
|
|
167
506
|
readonly message: string;
|
|
168
507
|
readonly category: string;
|
|
169
508
|
readonly rule: string;
|
|
170
509
|
readonly documentationUrl?: string;
|
|
171
510
|
}
|
|
172
511
|
|
|
512
|
+
export declare const MarkdownRenderer: ({ content, streaming, highlight, ...rest }: MarkdownRendererProps) => JSX.Element | null;
|
|
513
|
+
|
|
514
|
+
declare type MarkdownRendererProps = Omit<MarkdownProps, 'children'> & {
|
|
515
|
+
readonly content: string;
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
declare type MessageErrorCallback = (messageId: string, errorMessage: string) => void;
|
|
519
|
+
|
|
520
|
+
export declare type MessageRole = 'user' | 'assistant';
|
|
521
|
+
|
|
522
|
+
export declare type MessageStatus = 'pending' | 'streaming' | 'complete' | 'error';
|
|
523
|
+
|
|
524
|
+
declare type MessageStatusCallback = (messageId: string, status: 'complete' | 'error') => void;
|
|
525
|
+
|
|
526
|
+
declare type MixedToolHandler = (toolResult: string, onError: (toolName: string, error: Error) => void) => KapaToolResult | null;
|
|
527
|
+
|
|
528
|
+
declare interface MixedToolResultEvent {
|
|
529
|
+
readonly type: typeof ResultType.MIXED_TOOL_RESULT;
|
|
530
|
+
readonly toolName: string;
|
|
531
|
+
readonly toolResult: string;
|
|
532
|
+
}
|
|
533
|
+
|
|
173
534
|
export declare interface ModelerAccess {
|
|
174
535
|
readonly getModeler: () => BpmnModeler;
|
|
175
536
|
readonly getCanvas: () => unknown;
|
|
@@ -195,16 +556,107 @@ declare interface ModelerAccessOptions {
|
|
|
195
556
|
readonly getBusinessObject: (element: unknown) => Record<string, unknown>;
|
|
196
557
|
}
|
|
197
558
|
|
|
559
|
+
export declare const openSidecar: () => void;
|
|
560
|
+
|
|
198
561
|
export declare interface ProjectContext {
|
|
199
562
|
readonly id: string;
|
|
200
563
|
readonly folderId: string | null;
|
|
201
564
|
}
|
|
202
565
|
|
|
566
|
+
export declare class QueryCancelledError extends Error {
|
|
567
|
+
constructor(message?: string);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export declare interface RawBpmnLintError {
|
|
571
|
+
readonly id: string;
|
|
572
|
+
readonly name?: string;
|
|
573
|
+
readonly message: string;
|
|
574
|
+
readonly category: string;
|
|
575
|
+
readonly rule: string;
|
|
576
|
+
readonly meta?: {
|
|
577
|
+
readonly documentation?: {
|
|
578
|
+
readonly url?: string;
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export declare const ResultType: {
|
|
584
|
+
readonly TOOL_INVOKE: "TOOL_INVOKE";
|
|
585
|
+
readonly MIXED_TOOL_RESULT: "MIXED_TOOL_RESULT";
|
|
586
|
+
readonly CONVERSATION_TITLE: "CONVERSATION_TITLE";
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
export declare type ResultTypeValue = (typeof ResultType)[keyof typeof ResultType];
|
|
590
|
+
|
|
591
|
+
export declare interface RollbackResponse {
|
|
592
|
+
readonly milestoneId: string;
|
|
593
|
+
readonly message: string;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
export declare const selectAgentState: (state: AgentStoreState) => string;
|
|
597
|
+
|
|
598
|
+
export declare const selectIsBusy: (state: AgentStoreState) => boolean;
|
|
599
|
+
|
|
600
|
+
export declare interface SendMessagePayload {
|
|
601
|
+
readonly conversationId: string;
|
|
602
|
+
readonly messageId: string;
|
|
603
|
+
readonly content: string;
|
|
604
|
+
readonly externalTools: readonly BackendToolPayload[];
|
|
605
|
+
readonly context: Record<string, unknown>;
|
|
606
|
+
}
|
|
607
|
+
|
|
203
608
|
export declare const setupBpmnTools: (context: CopilotToolContext, registry: ToolRegistry) => void;
|
|
204
609
|
|
|
205
|
-
declare
|
|
610
|
+
export declare interface SidecarRenderProps {
|
|
611
|
+
readonly onMinimize: () => void;
|
|
612
|
+
readonly isOpen: boolean;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
declare interface SourceReference {
|
|
616
|
+
readonly content: string;
|
|
617
|
+
readonly sourceUrl: string;
|
|
618
|
+
readonly title: string;
|
|
619
|
+
readonly sourceType: string;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
declare type StatusLabelCallback = (messageId: string, label: string) => void;
|
|
623
|
+
|
|
624
|
+
export declare interface Suggestion {
|
|
625
|
+
readonly label: string;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
declare interface ThinkingBlock {
|
|
629
|
+
readonly id: string;
|
|
630
|
+
readonly content: string;
|
|
631
|
+
readonly label: string;
|
|
632
|
+
readonly isComplete: boolean;
|
|
633
|
+
readonly kind?: ThinkingBlockKind;
|
|
634
|
+
readonly toolName?: string;
|
|
635
|
+
readonly toolStatus?: ToolBlockStatus;
|
|
636
|
+
readonly stepNumber?: number;
|
|
637
|
+
readonly toolArguments?: Record<string, unknown>;
|
|
638
|
+
readonly toolResult?: string;
|
|
639
|
+
readonly description?: string;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
declare type ThinkingBlockKind = 'reasoning' | 'tool' | 'error';
|
|
643
|
+
|
|
644
|
+
export declare const ThinkingIndicator: ({ label, completedLabel, content, isComplete, }: ThinkingIndicatorProps) => JSX.Element | null;
|
|
645
|
+
|
|
646
|
+
declare interface ThinkingIndicatorProps {
|
|
647
|
+
readonly label?: string;
|
|
648
|
+
readonly completedLabel?: string;
|
|
649
|
+
readonly content?: string;
|
|
650
|
+
readonly isComplete: boolean;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export declare const toggleSidecar: () => void;
|
|
206
654
|
|
|
207
|
-
declare
|
|
655
|
+
declare type ToolBlockStatus = 'success' | 'processing' | 'error';
|
|
656
|
+
|
|
657
|
+
export declare type ToolCategory = 'BPMN_CORE' | 'BPMN_MODIFICATION' | 'BPMN_QUERY' | 'DMN_QUERY' | 'DMN_MODIFICATION' | 'FEEL_CORE' | 'FORM_CORE' | 'INTEGRATION' | 'FILE_OPERATION' | 'GENERAL';
|
|
658
|
+
|
|
659
|
+
export declare interface ToolDefinition {
|
|
208
660
|
readonly name: string;
|
|
209
661
|
readonly description: string;
|
|
210
662
|
readonly parameters: Record<string, unknown>;
|
|
@@ -216,17 +668,71 @@ declare interface ToolDefinition {
|
|
|
216
668
|
readonly descriptionFormatter?: DescriptionFormatter;
|
|
217
669
|
}
|
|
218
670
|
|
|
219
|
-
declare type ToolHandler = (args: Record<string, unknown>, onError: (toolName: string, error: Error) => void) => Promise<unknown>;
|
|
671
|
+
export declare type ToolHandler = (args: Record<string, unknown>, onError: (toolName: string, error: Error) => void) => Promise<unknown>;
|
|
220
672
|
|
|
221
|
-
declare
|
|
222
|
-
|
|
673
|
+
declare type ToolHandler_2 = (args: Record<string, unknown>, onError: (toolName: string, error: Error) => void) => Promise<unknown>;
|
|
674
|
+
|
|
675
|
+
export declare interface ToolInvokeResult {
|
|
676
|
+
readonly type: typeof ResultType.TOOL_INVOKE;
|
|
677
|
+
readonly toolName: string;
|
|
678
|
+
readonly toolCallId?: string;
|
|
679
|
+
readonly toolArguments: Record<string, unknown>;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
export declare interface ToolRegistration extends ToolDefinition {
|
|
683
|
+
readonly handler: ToolHandler | MixedToolHandler;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
declare interface ToolRegistration_2 extends ToolDefinition {
|
|
687
|
+
readonly handler: ToolHandler_2;
|
|
223
688
|
}
|
|
224
689
|
|
|
225
690
|
export declare interface ToolRegistry {
|
|
226
|
-
readonly registerTool: (registration:
|
|
691
|
+
readonly registerTool: (registration: ToolRegistration_2) => void;
|
|
227
692
|
readonly clear: () => void;
|
|
228
693
|
}
|
|
229
694
|
|
|
230
|
-
declare
|
|
695
|
+
export declare const toolRegistry: {
|
|
696
|
+
registerTool: (registration: ToolRegistration) => void;
|
|
697
|
+
has: (name: string) => boolean;
|
|
698
|
+
hasHandler: (name: string) => boolean;
|
|
699
|
+
isMixed: (name: string) => boolean;
|
|
700
|
+
getDisplayName: (name: string) => string | undefined;
|
|
701
|
+
getDescription: (name: string, args: Record<string, unknown>) => string;
|
|
702
|
+
hasCustomDescription: (name: string) => boolean;
|
|
703
|
+
getContentType: (name: string) => ContentType;
|
|
704
|
+
getMixedHandler: (name: string) => MixedToolHandler | undefined;
|
|
705
|
+
getHandler: (name: string) => ToolHandler | undefined;
|
|
706
|
+
executeHandler: (name: string, args: Record<string, unknown>, onError: (toolName: string, error: Error) => void) => Promise<unknown>;
|
|
707
|
+
getToolsForBackend: () => readonly BackendToolPayload[];
|
|
708
|
+
clear: () => void;
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
export declare interface ToolResultPayload {
|
|
712
|
+
readonly conversationId: string;
|
|
713
|
+
readonly type: 'TOOL_RESULT';
|
|
714
|
+
readonly toolName: string;
|
|
715
|
+
readonly toolCallId?: string;
|
|
716
|
+
readonly toolResult: string;
|
|
717
|
+
readonly contentType: 'TEXT' | 'BPMN' | 'JSON';
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export declare type ToolType = 'frontend' | 'mixed';
|
|
721
|
+
|
|
722
|
+
export declare const traverseModdle: (root: DmnModdleElement | Record<string, unknown>, visitor: TraverseVisitor) => void;
|
|
723
|
+
|
|
724
|
+
declare type TraverseVisitor = (element: DmnModdleElement) => void | false;
|
|
725
|
+
|
|
726
|
+
declare interface UpdateConversationPayload {
|
|
727
|
+
readonly conversationName: string;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export declare const useAgentAdapter: ({ transport, onToolInvoke, getStatusLabel, }: AgentAdapterConfig) => AgentAdapterReturn;
|
|
731
|
+
|
|
732
|
+
export declare const useAgentStore: UseBoundStore<StoreApi<AgentStore>>;
|
|
733
|
+
|
|
734
|
+
export declare const useChatStore: UseBoundStore<StoreApi<ChatStore>>;
|
|
735
|
+
|
|
736
|
+
export declare const useSidecarOpen: () => boolean;
|
|
231
737
|
|
|
232
738
|
export { }
|