@camunda/copilot-chat 0.8.1-alpha.3 → 0.8.1-alpha.4

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 CHANGED
@@ -54,81 +54,17 @@ export declare const closeSidecar: () => void;
54
54
 
55
55
  export declare interface Conversation extends ConversationSummary {
56
56
  readonly messages: ReadonlyArray<ConversationMessage>;
57
+ readonly availability?: OrganizationAvailability;
57
58
  readonly verificationHealth?: VerificationHealth | null;
58
59
  readonly sourceChangedMessageId?: string | null;
59
60
  }
60
61
 
61
62
  export declare const CONVERSATION_NAME_MAX_LENGTH = 100;
62
63
 
63
- export declare type ConversationEvent = {
64
- readonly revision?: number;
65
- } & ({
66
- readonly type: 'question_requested' | 'question_answered' | 'question_delivery_changed';
67
- readonly messageId: string;
68
- readonly question: ConversationQuestion;
69
- } | {
70
- readonly type: 'turn_started';
71
- readonly messageId: string;
72
- readonly userMessageId: string;
73
- readonly userContent: string;
74
- } | {
75
- readonly type: 'turn_finished';
76
- readonly messageId: string;
77
- readonly outcome: 'complete' | 'cancelled';
78
- } | {
79
- readonly type: 'candidate_proposed';
80
- readonly messageId: string;
81
- readonly candidateId: string;
82
- } | {
83
- readonly type: 'candidate_resolved';
84
- readonly messageId: string;
85
- readonly candidateId: string;
86
- readonly state: CandidateState;
87
- readonly checkpointId?: string;
88
- } | {
89
- readonly type: 'checkpoint_restored';
90
- readonly checkpointId: string;
91
- readonly contents: ReadonlyArray<{
92
- readonly name: string;
93
- readonly content: string | null;
94
- }>;
95
- } | {
96
- readonly type: 'failed';
97
- readonly messageId: string;
98
- readonly error: CopilotError;
99
- } | {
100
- readonly type: 'text';
101
- readonly messageId: string;
102
- readonly delta: string;
103
- } | {
104
- readonly type: 'activity';
105
- readonly messageId: string;
106
- readonly label: string;
107
- } | {
108
- readonly type: 'step_start';
109
- readonly messageId: string;
110
- readonly stepId: string;
111
- readonly kind: StepKind;
112
- readonly artifacts?: readonly ArtifactRef[];
113
- readonly name?: string;
114
- readonly label: string;
115
- readonly description?: string;
116
- readonly groupId?: string;
117
- readonly startedAt?: string;
118
- } | {
119
- readonly type: 'step_end';
120
- readonly messageId: string;
121
- readonly stepId: string;
122
- readonly status: 'complete' | 'error';
123
- readonly description?: string;
124
- } | {
125
- readonly type: 'step_removed';
126
- readonly messageId: string;
127
- readonly stepId: string;
128
- } | {
129
- readonly type: 'source_changed';
130
- readonly messageId: string;
131
- });
64
+ export declare type ConversationEvent = RevisionedConversationEvent | {
65
+ readonly type: 'availability_changed';
66
+ readonly conversationId: string;
67
+ };
132
68
 
133
69
  export declare interface ConversationMessage {
134
70
  readonly messageId: string;
@@ -137,6 +73,9 @@ export declare interface ConversationMessage {
137
73
  readonly steps: ReadonlyArray<MessageStep>;
138
74
  readonly createdAt?: string;
139
75
  readonly state?: MessageState;
76
+ readonly phase?: MessagePhase;
77
+ readonly remoteStop?: RemoteStopStatus;
78
+ readonly cancellationReason?: TurnCancellationReason;
140
79
  readonly candidate?: Candidate;
141
80
  readonly error?: CopilotError;
142
81
  readonly questions?: ReadonlyArray<ConversationQuestion>;
@@ -177,6 +116,7 @@ declare interface ConversationStoreState {
177
116
  readonly originArtifact: ArtifactRef | null;
178
117
  readonly preview: string;
179
118
  readonly pendingCandidate: boolean;
119
+ readonly availability: OrganizationAvailability | null;
180
120
  readonly pendingQuestionId?: string;
181
121
  readonly messages: ReadonlyArray<MessageStoreState>;
182
122
  readonly messagesLoaded: boolean;
@@ -205,6 +145,7 @@ export declare interface CopilotBadgeProps {
205
145
  }
206
146
 
207
147
  export declare interface CopilotClient {
148
+ getAvailability?(): Promise<OrganizationAvailability>;
208
149
  answerQuestion?(input: AnswerQuestionInput): Promise<void>;
209
150
  postMessage(input: PostMessageInput): Promise<{
210
151
  conversationId: string;
@@ -251,7 +192,7 @@ export declare interface CopilotError {
251
192
  readonly traceRef?: string;
252
193
  }
253
194
 
254
- export declare type CopilotErrorCode = 'PROVIDER_ERROR' | 'CANCELLED' | 'VALIDATION_FAILED' | 'BUDGET_EXCEEDED' | 'STALE_SOURCE';
195
+ export declare type CopilotErrorCode = 'PROVIDER_ERROR' | 'CANCELLED' | 'VALIDATION_FAILED' | 'BUDGET_EXCEEDED' | 'STALE_SOURCE' | 'SUBMISSION_UNVERIFIED' | 'PERMISSION_POLICY_UNVERIFIED';
255
196
 
256
197
  export declare const CopilotSidecar: ({ children }: CopilotSidecarProps) => JSX.Element;
257
198
 
@@ -293,6 +234,7 @@ export declare interface FixtureScript {
293
234
  readonly error?: CopilotError;
294
235
  readonly stepLabels?: ReadonlyArray<string>;
295
236
  readonly continuationStepLabels?: ReadonlyArray<string>;
237
+ readonly reconcileHistory?: boolean;
296
238
  readonly question?: Pick<ConversationQuestion, 'question' | 'mode' | 'options' | 'allowCustomAnswer'>;
297
239
  }
298
240
 
@@ -308,6 +250,8 @@ export declare interface HttpClientOptions {
308
250
  readonly eventSource?: new (url: string) => EventSourceLike;
309
251
  }
310
252
 
253
+ export declare type MessagePhase = 'reconciling_history';
254
+
311
255
  export declare type MessageState = 'streaming' | 'complete' | 'cancelled' | 'failed';
312
256
 
313
257
  export declare interface MessageStep {
@@ -329,6 +273,9 @@ declare interface MessageStoreState {
329
273
  readonly steps: ReadonlyArray<MessageStep>;
330
274
  readonly createdAt: string | null;
331
275
  readonly activity: string | null;
276
+ readonly phase: MessagePhase | null;
277
+ readonly remoteStop: RemoteStopStatus | null;
278
+ readonly cancellationReason?: ConversationMessage['cancellationReason'];
332
279
  readonly state: MessageState | null;
333
280
  readonly candidate: Candidate | null;
334
281
  readonly error: CopilotError | null;
@@ -337,6 +284,11 @@ declare interface MessageStoreState {
337
284
 
338
285
  export declare const openSidecar: () => void;
339
286
 
287
+ export declare interface OrganizationAvailability {
288
+ readonly state: 'enabled' | 'organization_disabled';
289
+ readonly policyVersion: string;
290
+ }
291
+
340
292
  export declare const parseBpmnElementReference: (destination: string) => {
341
293
  readonly kind: "ordinary";
342
294
  } | {
@@ -353,6 +305,81 @@ export declare interface PostMessageInput {
353
305
  readonly reapplyCandidateId?: string;
354
306
  }
355
307
 
308
+ export declare type RemoteStopStatus = 'not_sent' | 'pending' | 'confirmed' | 'unconfirmed';
309
+
310
+ declare type RevisionedConversationEvent = {
311
+ readonly revision?: number;
312
+ } & ({
313
+ readonly type: 'question_requested' | 'question_answered' | 'question_delivery_changed';
314
+ readonly messageId: string;
315
+ readonly question: ConversationQuestion;
316
+ } | {
317
+ readonly type: 'turn_started';
318
+ readonly messageId: string;
319
+ readonly userMessageId: string;
320
+ readonly userContent: string;
321
+ } | {
322
+ readonly type: 'turn_finished';
323
+ readonly messageId: string;
324
+ readonly outcome: 'complete' | 'cancelled';
325
+ readonly cancellationReason?: TurnCancellationReason;
326
+ } | {
327
+ readonly type: 'candidate_proposed';
328
+ readonly messageId: string;
329
+ readonly candidateId: string;
330
+ } | {
331
+ readonly type: 'candidate_resolved';
332
+ readonly messageId: string;
333
+ readonly candidateId: string;
334
+ readonly state: CandidateState;
335
+ readonly checkpointId?: string;
336
+ } | {
337
+ readonly type: 'checkpoint_restored';
338
+ readonly checkpointId: string;
339
+ readonly contents: ReadonlyArray<{
340
+ readonly name: string;
341
+ readonly content: string | null;
342
+ }>;
343
+ } | {
344
+ readonly type: 'failed';
345
+ readonly messageId: string;
346
+ readonly error: CopilotError;
347
+ } | {
348
+ readonly type: 'text';
349
+ readonly messageId: string;
350
+ readonly delta: string;
351
+ } | {
352
+ readonly type: 'activity';
353
+ readonly messageId: string;
354
+ readonly label?: string;
355
+ readonly phase?: MessagePhase | null;
356
+ readonly remoteStop?: RemoteStopStatus;
357
+ } | {
358
+ readonly type: 'step_start';
359
+ readonly messageId: string;
360
+ readonly stepId: string;
361
+ readonly kind: StepKind;
362
+ readonly artifacts?: readonly ArtifactRef[];
363
+ readonly name?: string;
364
+ readonly label: string;
365
+ readonly description?: string;
366
+ readonly groupId?: string;
367
+ readonly startedAt?: string;
368
+ } | {
369
+ readonly type: 'step_end';
370
+ readonly messageId: string;
371
+ readonly stepId: string;
372
+ readonly status: 'complete' | 'error';
373
+ readonly description?: string;
374
+ } | {
375
+ readonly type: 'step_removed';
376
+ readonly messageId: string;
377
+ readonly stepId: string;
378
+ } | {
379
+ readonly type: 'source_changed';
380
+ readonly messageId: string;
381
+ });
382
+
356
383
  export declare interface SidecarRenderProps {
357
384
  readonly onMinimize: () => void;
358
385
  readonly isOpen: boolean;
@@ -364,9 +391,10 @@ export declare type StepStatus = 'active' | 'complete' | 'error';
364
391
 
365
392
  export declare const toggleSidecar: () => void;
366
393
 
394
+ export declare type TurnCancellationReason = 'organization_disabled';
395
+
367
396
  export declare const useCopilotConversation: ({ client, conversationId, }: UseCopilotConversationOptions) => {
368
- conversationId: string | null;
369
- status: ConversationStatus | null;
397
+ refreshAvailability: () => Promise<OrganizationAvailability | null>;
370
398
  originArtifact: ArtifactRef | null;
371
399
  messages: readonly MessageStoreState[];
372
400
  messagesLoaded: boolean;
@@ -385,6 +413,12 @@ export declare const useCopilotConversation: ({ client, conversationId, }: UseCo
385
413
  reject: (candidateId: string) => Promise<void>;
386
414
  restoreCheckpoint: (checkpointId: string) => Promise<void>;
387
415
  cancelTurn: () => Promise<void>;
416
+ availability: OrganizationAvailability | null;
417
+ availabilityLoading: boolean;
418
+ availabilityError: Error | null;
419
+ availabilityCheckSupported: boolean;
420
+ conversationId: string | null;
421
+ status: ConversationStatus | null;
388
422
  };
389
423
 
390
424
  export declare const useCopilotConversationList: ({ client }: UseCopilotConversationListOptions) => {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as s, a as o, b as t, c as i, d as n, e as r, f as C, g as c, h as l, o as p, i as d, t as S, u as m, j as u, k as E } from "./index-DevZv06y.js";
1
+ import { C as s, a as o, b as t, c as i, d as n, e as r, f as C, g as c, h as l, o as p, i as d, t as S, u as m, j as u, k as E } from "./index-DAyxug2G.js";
2
2
  export {
3
3
  s as CONVERSATION_NAME_MAX_LENGTH,
4
4
  o as CandidateReview,
@@ -0,0 +1,4 @@
1
+ import { p } from "./index-DAyxug2G.js";
2
+ export {
3
+ p as Mermaid
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/copilot-chat",
3
- "version": "0.8.1-alpha.3",
3
+ "version": "0.8.1-alpha.4",
4
4
  "description": "Camunda Copilot Client Library - React components and utilities for Camunda Platform 8",
5
5
  "license": "Camunda License 1.0",
6
6
  "type": "module",
@@ -1,4 +0,0 @@
1
- import { p } from "./index-DevZv06y.js";
2
- export {
3
- p as Mermaid
4
- };