@camunda/copilot-chat 0.5.12-alpha.0 → 0.5.12-alpha.10

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.
@@ -0,0 +1,766 @@
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
+
100
+ export declare interface BpmnElement {
101
+ readonly id: string;
102
+ readonly type: string;
103
+ readonly businessObject: Record<string, unknown>;
104
+ readonly parent?: BpmnElement;
105
+ readonly incoming?: ReadonlyArray<BpmnElement>;
106
+ readonly outgoing?: ReadonlyArray<BpmnElement>;
107
+ readonly children?: ReadonlyArray<BpmnElement>;
108
+ }
109
+
110
+ export declare interface BpmnModeler {
111
+ readonly get: (serviceName: string, strict?: boolean) => unknown;
112
+ readonly saveXML: (options?: {
113
+ format?: boolean;
114
+ }) => Promise<{
115
+ xml: string;
116
+ }>;
117
+ }
118
+
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
+ export declare const CAPABILITY: {
145
+ readonly BPMN_EDITING: "BPMN_EDITING";
146
+ readonly FORM_EDITING: "FORM_EDITING";
147
+ readonly DMN_EDITING: "DMN_EDITING";
148
+ readonly FEEL_EDITING: "FEEL_EDITING";
149
+ readonly BPMN_VIEWING: "BPMN_VIEWING";
150
+ readonly FORM_VIEWING: "FORM_VIEWING";
151
+ readonly DMN_VIEWING: "DMN_VIEWING";
152
+ readonly FILE_OPERATIONS: "FILE_OPERATIONS";
153
+ readonly FILE_CREATION: "FILE_CREATION";
154
+ readonly VALIDATION: "VALIDATION";
155
+ readonly INTEGRATION: "INTEGRATION";
156
+ };
157
+
158
+ export declare type Capability = (typeof CAPABILITY)[keyof typeof CAPABILITY];
159
+
160
+ declare interface ChatActions {
161
+ readonly addUserMessage: (content: string) => string;
162
+ readonly addAssistantMessage: (id: string) => void;
163
+ readonly appendToMessage: (id: string, content: string) => void;
164
+ readonly setMessageContent: (id: string, content: string) => void;
165
+ readonly updateMessageStatus: (id: string, status: MessageStatus) => void;
166
+ readonly updateMessageStatusLabel: (id: string, statusLabel: string) => void;
167
+ readonly setMessageSources: (id: string, sources: readonly SourceReference[]) => void;
168
+ readonly setStreaming: (isStreaming: boolean, messageId?: string | null) => void;
169
+ readonly clearMessages: () => void;
170
+ readonly addThinkingBlock: (messageId: string, blockId: string, label: string) => void;
171
+ readonly appendToThinkingBlock: (messageId: string, blockId: string, content: string) => void;
172
+ readonly completeThinkingBlock: (messageId: string, blockId: string) => void;
173
+ readonly completeAllThinkingBlocks: (messageId: string) => void;
174
+ readonly setMessageError: (id: string, errorMessage: string) => void;
175
+ readonly addToolBlock: (messageId: string, blockId: string, toolName: string, stepNumber: number, toolArguments?: Record<string, unknown>) => void;
176
+ readonly updateToolBlockStatus: (messageId: string, blockId: string, status: ToolBlockStatus) => void;
177
+ readonly updateToolBlockResult: (messageId: string, blockId: string, toolResult: string) => void;
178
+ readonly addErrorBlock: (messageId: string, blockId: string, errorMessage: string) => void;
179
+ readonly setView: (view: ChatView_2) => void;
180
+ readonly setConversationTitle: (title: string) => void;
181
+ readonly loadConversation: (messages: readonly ChatMessage_2[], title: string | null) => void;
182
+ readonly prependMessages: (messages: readonly ChatMessage_2[]) => void;
183
+ readonly rollbackToMessage: (messageId: string) => void;
184
+ readonly addRollbackMessage: (content: string, milestoneId: string) => void;
185
+ readonly setLastAssistantMessageMilestone: (milestoneId: string) => void;
186
+ readonly setLastUserMessageMilestone: (milestoneId: string) => void;
187
+ }
188
+
189
+ export declare const ChatInput: ({ onSend, onStop, isBusy, isDisabled, placeholder, isOpen, }: ChatInputProps) => JSX.Element;
190
+
191
+ declare interface ChatInputProps {
192
+ readonly onSend: (message: string) => void;
193
+ readonly onStop?: () => void;
194
+ readonly isBusy?: boolean;
195
+ readonly isDisabled?: boolean;
196
+ readonly placeholder?: string;
197
+ readonly isOpen?: boolean;
198
+ }
199
+
200
+ export declare const ChatMessage: ({ message, isBusy }: ChatMessageProps) => JSX.Element;
201
+
202
+ declare interface ChatMessage_2 {
203
+ readonly id: string;
204
+ readonly role: MessageRole;
205
+ readonly content: string;
206
+ readonly status: MessageStatus;
207
+ readonly timestamp?: number;
208
+ readonly statusLabel?: string;
209
+ readonly thinkingBlocks?: readonly ThinkingBlock[];
210
+ readonly sources?: readonly SourceReference[];
211
+ readonly milestoneId?: string;
212
+ }
213
+ export { ChatMessage_2 as ChatMessageInterface }
214
+ export { ChatMessage_2 as ChatMessageType }
215
+
216
+ export declare const ChatMessageList: ({ messages, emptyStateTitle, emptyStateDescription, suggestions, onSuggestionClick, onRollback, onSeeVersion, isBusy, hasOlderMessages, isLoadingOlderMessages, onLoadOlderMessages, }: ChatMessageListProps) => JSX.Element;
217
+
218
+ declare interface ChatMessageListProps {
219
+ readonly messages: readonly ChatMessage_2[];
220
+ readonly emptyStateTitle?: string;
221
+ readonly emptyStateDescription?: ReactNode;
222
+ readonly suggestions?: readonly Suggestion[];
223
+ readonly onSuggestionClick?: (suggestion: Suggestion) => void;
224
+ readonly onRollback?: (milestoneId: string) => void;
225
+ readonly onSeeVersion?: (milestoneId: string) => void;
226
+ readonly isBusy?: boolean;
227
+ readonly hasOlderMessages?: boolean;
228
+ readonly isLoadingOlderMessages?: boolean;
229
+ readonly onLoadOlderMessages?: () => void;
230
+ }
231
+
232
+ declare interface ChatMessageProps {
233
+ readonly message: ChatMessage_2;
234
+ readonly isBusy?: boolean;
235
+ }
236
+
237
+ declare interface ChatState {
238
+ readonly view: ChatView_2;
239
+ readonly messages: readonly ChatMessage_2[];
240
+ readonly isStreaming: boolean;
241
+ readonly streamingMessageId: string | null;
242
+ readonly currentThinkingBlockId: string | null;
243
+ readonly conversationTitle: string | null;
244
+ }
245
+
246
+ declare type ChatStore = ChatState & ChatActions;
247
+
248
+ declare type ChatView = 'chat' | 'history';
249
+
250
+ declare type ChatView_2 = 'chat' | 'history';
251
+
252
+ export declare const closeSidecar: () => void;
253
+
254
+ export declare type ContentType = 'TEXT' | 'BPMN';
255
+
256
+ export declare interface ContextItem {
257
+ readonly id?: string;
258
+ readonly label: string;
259
+ }
260
+
261
+ export declare interface Conversation {
262
+ readonly id: string;
263
+ readonly name: string;
264
+ readonly created: string;
265
+ readonly updated: string;
266
+ }
267
+
268
+ export declare interface ConversationMessage {
269
+ readonly id: string;
270
+ readonly type: CopilotMessageType;
271
+ readonly message?: string;
272
+ readonly feel?: string;
273
+ readonly artifactXml?: string;
274
+ readonly artifactJson?: string;
275
+ readonly toolCallId?: string;
276
+ readonly toolName?: string;
277
+ readonly milestoneId?: string;
278
+ readonly created: string;
279
+ }
280
+
281
+ export declare interface ConversationMessagesPage {
282
+ readonly id: string;
283
+ readonly name: string;
284
+ readonly messages: readonly ConversationMessage[];
285
+ readonly nextCursor: number | null;
286
+ readonly hasMore: boolean;
287
+ readonly totalCount: number;
288
+ }
289
+
290
+ export declare interface ConversationsPage {
291
+ readonly conversations: readonly Conversation[];
292
+ readonly page: number;
293
+ readonly size: number;
294
+ readonly totalItems: number;
295
+ }
296
+
297
+ declare interface ConversationTitleResult {
298
+ readonly type: typeof ResultType.CONVERSATION_TITLE;
299
+ readonly conversationTitle: string;
300
+ }
301
+
302
+ export declare const CopilotChat: ({ onSendMessage, kapaAiIntegrationId, onStopGeneration, onResetConversation, isBusy, isDisabled, isOpen, emptyStateTitle, emptyStateDescription, suggestions, className, contextItems, onRemoveContext, onSeeVersion, }: CopilotChatProps) => JSX.Element;
303
+
304
+ export declare interface CopilotChatProps {
305
+ readonly kapaAiIntegrationId?: string | null;
306
+ readonly onSendMessage: (message: string) => void;
307
+ readonly onStopGeneration?: () => void;
308
+ readonly onResetConversation?: () => void;
309
+ readonly onLoadConversation?: (conversationId: string) => Promise<void>;
310
+ readonly isBusy?: boolean;
311
+ readonly isOpen?: boolean;
312
+ readonly isDisabled?: boolean;
313
+ readonly emptyStateTitle?: string;
314
+ readonly emptyStateDescription?: ReactNode;
315
+ readonly suggestions?: ReadonlyArray<Suggestion>;
316
+ readonly className?: string;
317
+ readonly contextItems?: ReadonlyArray<ContextItem>;
318
+ readonly onRemoveContext?: (item: ContextItem) => void;
319
+ readonly onSeeVersion?: (milestoneId: string) => void;
320
+ }
321
+
322
+ export declare const CopilotHeader: ({ onReset, onShowHistory, conversationTitle, view, isBusy, }: CopilotHeaderProps) => JSX.Element;
323
+
324
+ declare interface CopilotHeaderProps {
325
+ onReset?: () => void;
326
+ onShowHistory?: () => void;
327
+ conversationTitle?: string;
328
+ view?: ChatView;
329
+ isBusy?: boolean;
330
+ }
331
+
332
+ declare type CopilotMessageType = 'USER' | 'ASSISTANT' | 'TOOL_CALL' | 'TOOL_OUTPUT' | 'SYSTEM';
333
+
334
+ export declare const CopilotSidecar: ({ children, workareaSelector, headerSelector, zIndex }: CopilotSidecarProps) => JSX.Element;
335
+
336
+ export declare interface CopilotSidecarProps {
337
+ readonly children: (props: SidecarRenderProps) => ReactNode;
338
+ readonly workareaSelector?: string;
339
+ readonly headerSelector?: string;
340
+ readonly zIndex?: number;
341
+ }
342
+
343
+ export declare interface CopilotToolContext {
344
+ readonly modeler: ModelerAccess;
345
+ readonly files: {
346
+ readonly getContent: (fileId: string) => Promise<string>;
347
+ readonly create: (params: {
348
+ readonly name: string;
349
+ readonly type: string;
350
+ readonly content: string;
351
+ readonly projectId: string;
352
+ readonly folderId: string | null;
353
+ }) => Promise<{
354
+ readonly id: string;
355
+ }>;
356
+ readonly list: (projectId: string) => Promise<ReadonlyArray<FileInfo>>;
357
+ };
358
+ readonly templates: {
359
+ readonly getCustom: () => ReadonlyArray<ElementTemplate>;
360
+ readonly getOotbConnectors: () => ReadonlyArray<ElementTemplate>;
361
+ readonly apply: (elementId: string, templateId: string, version?: number) => unknown;
362
+ };
363
+ readonly form: {
364
+ readonly getContent: () => string | null;
365
+ readonly isAvailable: () => boolean;
366
+ readonly getLintErrors: () => Promise<ReadonlyArray<FormLintError>>;
367
+ readonly importSchema: (content: unknown) => void;
368
+ readonly update: () => Promise<void>;
369
+ readonly getParsedContent: (json: string) => unknown;
370
+ readonly getSchema: () => unknown;
371
+ readonly getSelection: () => unknown;
372
+ };
373
+ readonly dmn: {
374
+ readonly createModdle: () => DmnModdle;
375
+ readonly getModeler: () => DmnModeler;
376
+ };
377
+ readonly feel: {
378
+ readonly validate: (expression: string) => Promise<FeelValidationResult>;
379
+ };
380
+ readonly diagram: {
381
+ readonly isBPMN: () => boolean;
382
+ readonly isDMN: () => boolean;
383
+ readonly canEdit: () => boolean;
384
+ readonly getContent: () => string | null;
385
+ readonly importContent: (xml: string) => Promise<ImportResult>;
386
+ readonly saveContent: () => Promise<void>;
387
+ readonly exportXml: () => Promise<string>;
388
+ readonly getLintErrors: () => Promise<ReadonlyArray<LintError>>;
389
+ readonly getDeploymentErrors: () => ReadonlyArray<unknown>;
390
+ readonly ensureExecutionPlatform: () => void;
391
+ };
392
+ readonly project: {
393
+ readonly resolve: () => ProjectContext;
394
+ };
395
+ }
396
+
397
+ export declare const createAllTools: (context: CopilotToolContext) => ReadonlyArray<ToolRegistration_2>;
398
+
399
+ export declare const createModelerAccess: ({ getModeler, is, getBusinessObject }: ModelerAccessOptions) => ModelerAccess;
400
+
401
+ export declare const createWithAutoLayoutAndValidation: (context: CopilotToolContext, layoutProcess: (xml: string) => Promise<string>) => <T extends Record<string, unknown>>(mutationFn: (modeler: BpmnModeler) => T | Promise<T>) => Promise<T & {
402
+ readonly validationErrors: ReadonlyArray<LintError>;
403
+ }>;
404
+
405
+ export declare const createWithValidation: (context: CopilotToolContext) => <T extends Record<string, unknown>>(mutationFn: (modeler: BpmnModeler) => T | Promise<T>) => Promise<T & {
406
+ readonly validationErrors: ReadonlyArray<LintError>;
407
+ }>;
408
+
409
+ export declare type DescriptionFormatter = (args: Record<string, unknown>) => string;
410
+
411
+ declare interface DmnDefinitions extends DmnModdleElement {
412
+ readonly $model: {
413
+ readonly toXML: (definitions: DmnDefinitions, options?: {
414
+ format?: boolean;
415
+ }) => Promise<{
416
+ xml: string;
417
+ }>;
418
+ };
419
+ readonly drgElement?: ReadonlyArray<DmnModdleElement>;
420
+ }
421
+
422
+ declare interface DmnModdle {
423
+ readonly fromXML: (xml: string) => Promise<{
424
+ rootElement: DmnDefinitions;
425
+ }>;
426
+ readonly create: (type: string, properties: Record<string, unknown>) => DmnModdleElement;
427
+ }
428
+
429
+ declare interface DmnModdleElement extends Record<string, unknown> {
430
+ readonly $type: string;
431
+ readonly id?: string;
432
+ }
433
+
434
+ declare interface DmnModeler {
435
+ readonly get: (serviceName: string, strict?: boolean) => unknown;
436
+ readonly getActiveViewer?: () => DmnViewer | null;
437
+ readonly getViews?: () => ReadonlyArray<unknown>;
438
+ readonly saveXML?: (options?: {
439
+ format?: boolean;
440
+ }) => Promise<{
441
+ xml: string;
442
+ }>;
443
+ }
444
+
445
+ declare interface DmnViewer {
446
+ readonly get: (serviceName: string, strict?: boolean) => unknown;
447
+ }
448
+
449
+ export declare interface ElementTemplate {
450
+ readonly id: string;
451
+ readonly name: string;
452
+ readonly description?: string;
453
+ readonly version: number;
454
+ readonly appliesTo: ReadonlyArray<string>;
455
+ readonly elementType?: string;
456
+ readonly properties?: ReadonlyArray<Record<string, unknown>>;
457
+ readonly groups?: ReadonlyArray<Record<string, unknown>>;
458
+ }
459
+
460
+ export declare const EventStatus: {
461
+ readonly IN_PROGRESS: "IN_PROGRESS";
462
+ readonly COMPLETED: "COMPLETED";
463
+ readonly ERROR: "ERROR";
464
+ };
465
+
466
+ export declare type EventStatusValue = (typeof EventStatus)[keyof typeof EventStatus];
467
+
468
+ export declare const EventType: {
469
+ readonly THINKING: "THINKING";
470
+ readonly EXECUTION_PLAN: "EXECUTION_PLAN";
471
+ readonly TOOL_PLANNING: "TOOL_PLANNING";
472
+ readonly TOOL_INVOKE: "TOOL_INVOKE";
473
+ readonly EXTERNAL_TOOL_CALL: "EXTERNAL_TOOL_CALL";
474
+ readonly TOOL_RESULT: "TOOL_RESULT";
475
+ readonly EXECUTION_COMPLETE: "EXECUTION_COMPLETE";
476
+ readonly ERROR: "ERROR";
477
+ readonly CONVERSATION_TITLE: "CONVERSATION_TITLE";
478
+ };
479
+
480
+ export declare type EventTypeValue = (typeof EventType)[keyof typeof EventType];
481
+
482
+ declare interface FeelValidationResult {
483
+ readonly error?: string;
484
+ readonly warnings?: ReadonlyArray<string>;
485
+ }
486
+
487
+ export declare interface FileInfo {
488
+ readonly id: string;
489
+ readonly name: string;
490
+ readonly type: string;
491
+ readonly lastModified?: string;
492
+ }
493
+
494
+ export declare interface FormLintError {
495
+ readonly fieldId: string;
496
+ readonly message: string;
497
+ readonly category: string;
498
+ }
499
+
500
+ export declare const getDefaultStatusLabel: (eventType: EventTypeValue, toolName?: string, eventStatus?: EventStatusValue) => string;
501
+
502
+ export declare interface ImportResult {
503
+ readonly error?: unknown;
504
+ }
505
+
506
+ export declare const isApplyElementTemplateCompleted: (event: AgentEvent) => boolean;
507
+
508
+ export declare const isCurrentFileModified: (event: AgentEvent) => boolean;
509
+
510
+ export declare const isLayoutBpmnXmlCompleted: (event: AgentEvent) => boolean;
511
+
512
+ export declare const isToolAllowedWithCapabilities: (tool: {
513
+ readonly requiredCapabilities?: ReadonlyArray<string>;
514
+ }, capabilities: ReadonlyArray<string>) => boolean;
515
+
516
+ export declare const isWriteArtifactCompleted: (event: AgentEvent) => boolean;
517
+
518
+ declare interface KapaAiSearchResult {
519
+ readonly content: string;
520
+ readonly source_url: string;
521
+ readonly title: string;
522
+ readonly source_type: string;
523
+ }
524
+
525
+ declare interface KapaToolResult {
526
+ readonly sources: readonly KapaAiSearchResult[];
527
+ }
528
+
529
+ export { layoutProcess }
530
+
531
+ export declare interface LintError {
532
+ readonly elementId: string;
533
+ readonly elementName?: string;
534
+ readonly message: string;
535
+ readonly category: string;
536
+ readonly rule: string;
537
+ readonly documentationUrl?: string;
538
+ }
539
+
540
+ export declare const MarkdownRenderer: ({ content, streaming, highlight, ...rest }: MarkdownRendererProps) => JSX.Element | null;
541
+
542
+ declare type MarkdownRendererProps = Omit<MarkdownProps, 'children'> & {
543
+ readonly content: string;
544
+ };
545
+
546
+ declare type MessageErrorCallback = (messageId: string, errorMessage: string) => void;
547
+
548
+ export declare type MessageRole = 'user' | 'assistant';
549
+
550
+ export declare type MessageStatus = 'pending' | 'streaming' | 'complete' | 'error';
551
+
552
+ declare type MessageStatusCallback = (messageId: string, status: 'complete' | 'error') => void;
553
+
554
+ declare type MixedToolHandler = (toolResult: string, onError: (toolName: string, error: Error) => void) => KapaToolResult | null;
555
+
556
+ declare interface MixedToolResultEvent {
557
+ readonly type: typeof ResultType.MIXED_TOOL_RESULT;
558
+ readonly toolName: string;
559
+ readonly toolResult: string;
560
+ }
561
+
562
+ export declare interface ModelerAccess {
563
+ readonly getModeler: () => BpmnModeler;
564
+ readonly getCanvas: () => unknown;
565
+ readonly getElementRegistry: () => {
566
+ readonly get: (id: string) => BpmnElement | undefined;
567
+ readonly getAll: () => ReadonlyArray<BpmnElement>;
568
+ readonly filter: (predicate: (el: BpmnElement) => boolean) => ReadonlyArray<BpmnElement>;
569
+ };
570
+ readonly getModeling: () => unknown;
571
+ readonly getCommandStack: () => unknown;
572
+ readonly getElementFactory: () => unknown;
573
+ readonly getModdle: () => unknown;
574
+ readonly getSelection: () => unknown;
575
+ readonly getElementById: (id: string) => BpmnElement;
576
+ readonly is: (element: unknown, type: string) => boolean;
577
+ readonly getBusinessObject: (element: unknown) => Record<string, unknown>;
578
+ readonly getBpmnRules?: () => unknown;
579
+ }
580
+
581
+ declare interface ModelerAccessOptions {
582
+ readonly getModeler: () => BpmnModeler;
583
+ readonly is: (element: unknown, type: string) => boolean;
584
+ readonly getBusinessObject: (element: unknown) => Record<string, unknown>;
585
+ }
586
+
587
+ export declare const openSidecar: () => void;
588
+
589
+ export declare interface ProjectContext {
590
+ readonly id: string;
591
+ readonly folderId: string | null;
592
+ }
593
+
594
+ export declare class QueryCancelledError extends Error {
595
+ constructor(message?: string);
596
+ }
597
+
598
+ export declare interface RawBpmnLintError {
599
+ readonly id: string;
600
+ readonly name?: string;
601
+ readonly message: string;
602
+ readonly category: string;
603
+ readonly rule: string;
604
+ readonly meta?: {
605
+ readonly documentation?: {
606
+ readonly url?: string;
607
+ };
608
+ };
609
+ }
610
+
611
+ export declare const ResultType: {
612
+ readonly TOOL_INVOKE: "TOOL_INVOKE";
613
+ readonly MIXED_TOOL_RESULT: "MIXED_TOOL_RESULT";
614
+ readonly CONVERSATION_TITLE: "CONVERSATION_TITLE";
615
+ };
616
+
617
+ export declare type ResultTypeValue = (typeof ResultType)[keyof typeof ResultType];
618
+
619
+ export declare interface RollbackResponse {
620
+ readonly milestoneId: string;
621
+ readonly message: string;
622
+ }
623
+
624
+ export declare const selectAgentState: (state: AgentStoreState) => string;
625
+
626
+ export declare const selectIsBusy: (state: AgentStoreState) => boolean;
627
+
628
+ export declare interface SendMessagePayload {
629
+ readonly conversationId: string;
630
+ readonly messageId: string;
631
+ readonly content: string;
632
+ readonly externalTools: readonly BackendToolPayload[];
633
+ readonly context: Record<string, unknown>;
634
+ }
635
+
636
+ export declare const setupBpmnTools: (context: CopilotToolContext, registry: ToolRegistry) => void;
637
+
638
+ export declare interface SidecarRenderProps {
639
+ readonly onMinimize: () => void;
640
+ readonly isOpen: boolean;
641
+ }
642
+
643
+ declare interface SourceReference {
644
+ readonly content: string;
645
+ readonly sourceUrl: string;
646
+ readonly title: string;
647
+ readonly sourceType: string;
648
+ }
649
+
650
+ declare type StatusLabelCallback = (messageId: string, label: string) => void;
651
+
652
+ export declare interface Suggestion {
653
+ readonly label: string;
654
+ }
655
+
656
+ declare interface ThinkingBlock {
657
+ readonly id: string;
658
+ readonly content: string;
659
+ readonly label: string;
660
+ readonly isComplete: boolean;
661
+ readonly kind?: ThinkingBlockKind;
662
+ readonly toolName?: string;
663
+ readonly toolStatus?: ToolBlockStatus;
664
+ readonly stepNumber?: number;
665
+ readonly toolArguments?: Record<string, unknown>;
666
+ readonly toolResult?: string;
667
+ readonly description?: string;
668
+ }
669
+
670
+ declare type ThinkingBlockKind = 'reasoning' | 'tool' | 'error';
671
+
672
+ export declare const ThinkingIndicator: ({ label, completedLabel, content, isComplete, }: ThinkingIndicatorProps) => JSX.Element | null;
673
+
674
+ declare interface ThinkingIndicatorProps {
675
+ readonly label?: string;
676
+ readonly completedLabel?: string;
677
+ readonly content?: string;
678
+ readonly isComplete: boolean;
679
+ }
680
+
681
+ export declare const toggleSidecar: () => void;
682
+
683
+ declare type ToolBlockStatus = 'success' | 'processing' | 'error';
684
+
685
+ export declare type ToolCategory = 'BPMN_CORE' | 'BPMN_MODIFICATION' | 'BPMN_QUERY' | 'DMN_QUERY' | 'DMN_MODIFICATION' | 'FEEL_CORE' | 'FORM_CORE' | 'INTEGRATION' | 'FILE_OPERATION' | 'GENERAL';
686
+
687
+ export declare interface ToolDefinition {
688
+ readonly name: string;
689
+ readonly description: string;
690
+ readonly parameters: Record<string, unknown>;
691
+ readonly type: ToolType;
692
+ readonly contentType: ContentType;
693
+ readonly category: ToolCategory;
694
+ readonly requiredCapabilities?: ReadonlyArray<string>;
695
+ readonly displayName?: string;
696
+ readonly descriptionFormatter?: DescriptionFormatter;
697
+ }
698
+
699
+ export declare type ToolHandler = (args: Record<string, unknown>, onError: (toolName: string, error: Error) => void) => Promise<unknown>;
700
+
701
+ declare type ToolHandler_2 = (args: Record<string, unknown>, onError: (toolName: string, error: Error) => void) => Promise<unknown>;
702
+
703
+ export declare interface ToolInvokeResult {
704
+ readonly type: typeof ResultType.TOOL_INVOKE;
705
+ readonly toolName: string;
706
+ readonly toolCallId?: string;
707
+ readonly toolArguments: Record<string, unknown>;
708
+ }
709
+
710
+ export declare interface ToolRegistration extends ToolDefinition {
711
+ readonly handler: ToolHandler | MixedToolHandler;
712
+ }
713
+
714
+ declare interface ToolRegistration_2 extends ToolDefinition {
715
+ readonly handler: ToolHandler_2;
716
+ }
717
+
718
+ export declare interface ToolRegistry {
719
+ readonly registerTool: (registration: ToolRegistration_2) => void;
720
+ readonly clear: () => void;
721
+ }
722
+
723
+ export declare const toolRegistry: {
724
+ registerTool: (registration: ToolRegistration) => void;
725
+ has: (name: string) => boolean;
726
+ hasHandler: (name: string) => boolean;
727
+ isMixed: (name: string) => boolean;
728
+ getDisplayName: (name: string) => string | undefined;
729
+ getDescription: (name: string, args: Record<string, unknown>) => string;
730
+ hasCustomDescription: (name: string) => boolean;
731
+ getContentType: (name: string) => ContentType;
732
+ getMixedHandler: (name: string) => MixedToolHandler | undefined;
733
+ getHandler: (name: string) => ToolHandler | undefined;
734
+ executeHandler: (name: string, args: Record<string, unknown>, onError: (toolName: string, error: Error) => void) => Promise<unknown>;
735
+ getToolsForBackend: () => readonly BackendToolPayload[];
736
+ clear: () => void;
737
+ };
738
+
739
+ export declare interface ToolResultPayload {
740
+ readonly conversationId: string;
741
+ readonly type: 'TOOL_RESULT';
742
+ readonly toolName: string;
743
+ readonly toolCallId?: string;
744
+ readonly toolResult: string;
745
+ readonly contentType: 'TEXT' | 'BPMN' | 'JSON';
746
+ }
747
+
748
+ export declare type ToolType = 'frontend' | 'mixed';
749
+
750
+ export declare const traverseModdle: (root: DmnModdleElement | Record<string, unknown>, visitor: TraverseVisitor) => void;
751
+
752
+ declare type TraverseVisitor = (element: DmnModdleElement) => void | false;
753
+
754
+ declare interface UpdateConversationPayload {
755
+ readonly conversationName: string;
756
+ }
757
+
758
+ export declare const useAgentAdapter: ({ transport, onToolInvoke, getStatusLabel, }: AgentAdapterConfig) => AgentAdapterReturn;
759
+
760
+ export declare const useAgentStore: UseBoundStore<StoreApi<AgentStore>>;
761
+
762
+ export declare const useChatStore: UseBoundStore<StoreApi<ChatStore>>;
763
+
764
+ export declare const useSidecarOpen: () => boolean;
765
+
766
+ export { }