@camunda/copilot-chat 0.8.1-alpha.3 → 0.8.1-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -53
- package/dist/{highlighted-body-OFNGDK62-CH7N2RUX.js → highlighted-body-OFNGDK62-PP6OFj0v.js} +1 -1
- package/dist/{index-DevZv06y.js → index-CNP5V04Z.js} +8286 -7983
- package/dist/index.css +1 -1
- package/dist/index.d.ts +393 -154
- package/dist/index.js +12 -13
- package/dist/mermaid-GHXKKRXX-Ca3y5wFn.js +4 -0
- package/package.json +1 -1
- package/dist/mermaid-GHXKKRXX-CH-9OuwP.js +0 -4
package/README.md
CHANGED
|
@@ -38,12 +38,19 @@ import {
|
|
|
38
38
|
CopilotConversationPanel,
|
|
39
39
|
createFixtureClient,
|
|
40
40
|
} from '@camunda/copilot-chat';
|
|
41
|
+
import type { OpenDraftReviewInput } from '@camunda/copilot-chat';
|
|
41
42
|
import '@camunda/copilot-chat/style.css';
|
|
42
43
|
import { useState } from 'react';
|
|
43
44
|
|
|
44
45
|
const client = createFixtureClient();
|
|
45
46
|
|
|
46
|
-
function App(
|
|
47
|
+
function App({
|
|
48
|
+
host,
|
|
49
|
+
}: {
|
|
50
|
+
host: {
|
|
51
|
+
openDraftReview(input: OpenDraftReviewInput): void;
|
|
52
|
+
};
|
|
53
|
+
}) {
|
|
47
54
|
const [conversationId, setConversationId] = useState<string | null>(null);
|
|
48
55
|
|
|
49
56
|
return (
|
|
@@ -52,6 +59,7 @@ function App() {
|
|
|
52
59
|
conversationId={conversationId}
|
|
53
60
|
onConversationStarted={setConversationId}
|
|
54
61
|
onSelectConversation={setConversationId}
|
|
62
|
+
openDraftReview={host.openDraftReview}
|
|
55
63
|
/>
|
|
56
64
|
);
|
|
57
65
|
}
|
|
@@ -89,8 +97,8 @@ context in `postMessage`; these props only describe the project.
|
|
|
89
97
|
Pass `readOnlyReason` when the selected conversation can no longer accept
|
|
90
98
|
messages, for example because its project was deleted. The composer is
|
|
91
99
|
disabled and shows the reason, and stale proposals can no longer be reapplied;
|
|
92
|
-
stopping a running turn and
|
|
93
|
-
|
|
100
|
+
stopping a running turn and reading the conversation stay available, as do the
|
|
101
|
+
chat list and new chats.
|
|
94
102
|
|
|
95
103
|
## Naming conversations
|
|
96
104
|
|
|
@@ -102,7 +110,7 @@ elsewhere in Hub: Rename stays disabled until the trimmed name is non-empty and
|
|
|
102
110
|
differs from the current one; Enter renames; Escape, Cancel, or the close
|
|
103
111
|
button leave the name unchanged; focus returns to the actions button. The new
|
|
104
112
|
name shows at once; if the request fails, the previous name returns and the row
|
|
105
|
-
shows an error.
|
|
113
|
+
shows an error.
|
|
106
114
|
|
|
107
115
|
Adapters resolve with the conversation's updated summary. The server trims the
|
|
108
116
|
name and rejects it when blank or longer than `CONVERSATION_NAME_MAX_LENGTH`
|
|
@@ -173,7 +181,7 @@ Streamdown's sanitization, external-link safety and image behavior.
|
|
|
173
181
|
|
|
174
182
|
The host owns authorized project/file resolution, accessibility, current-target
|
|
175
183
|
availability, preview cleanup and explicit navigation. The fragment never supplies
|
|
176
|
-
a project or authorizes access,
|
|
184
|
+
a project or authorizes access, draft application or a new turn.
|
|
177
185
|
Preserve the historical label and explain unavailable targets explicitly rather
|
|
178
186
|
than resolving a different element by name.
|
|
179
187
|
|
|
@@ -183,24 +191,36 @@ and unavailable targets. Its explicitly mocked controls exercise rendering and
|
|
|
183
191
|
keyboard behavior only, not BPMN navigation. Add `?hostless` to exercise inert
|
|
184
192
|
fallback without a renderer.
|
|
185
193
|
|
|
186
|
-
##
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
the
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
## Conversation drafts
|
|
195
|
+
|
|
196
|
+
The conversation snapshot owns one optional `Draft`, with a monotonically
|
|
197
|
+
increasing `generation` and artifact-level access, validation, and live-version
|
|
198
|
+
divergence. When the conversation is idle, the panel shows a compact
|
|
199
|
+
**Proposed changes** row below the transcript with a **Review changes** action.
|
|
200
|
+
The required `openDraftReview` host callback receives only `{ conversationId, draftId }`;
|
|
201
|
+
the host opens the all-files review and checks the current draft and
|
|
202
|
+
permissions. Opening review does not authorize writes or confirm a generation.
|
|
203
|
+
The latest apply appears as a checkpoint in the transcript. Restoring it uses
|
|
204
|
+
`undoApply` for the whole apply, not the host's single-file version action.
|
|
205
|
+
|
|
206
|
+
Applying a draft sends its exact `draftId`, `reviewedGeneration`, and any
|
|
207
|
+
confirmed live fingerprints. The host must reject a stale generation rather
|
|
208
|
+
than apply edits the user has not reviewed. Apply results distinguish success,
|
|
209
|
+
a changed draft that must be reviewed again, and access or policy blocks.
|
|
210
|
+
Discarding selected artifacts, reverting changes from a turn, updating from
|
|
211
|
+
live, and undoing the last apply are separate conversation-scoped operations.
|
|
212
|
+
An open draft does not disable sending another turn; subsequent turns update
|
|
213
|
+
the same draft.
|
|
198
214
|
|
|
199
215
|
While a turn is running, the message input and suggestions are disabled and no
|
|
200
|
-
additional message can be submitted. Stop remains available; sending resumes
|
|
201
|
-
the turn finishes or is stopped
|
|
202
|
-
error and preserve the
|
|
203
|
-
used to interrupt a running turn.
|
|
216
|
+
additional message can be submitted. Stop remains available; sending resumes
|
|
217
|
+
after the turn finishes or is stopped. Rejected submissions show an inline
|
|
218
|
+
error and preserve the prompt for retry. Messages are not queued or
|
|
219
|
+
automatically used to interrupt a running turn.
|
|
220
|
+
|
|
221
|
+
Pending or unconfirmed remote stops block Send, but not Stop. Snapshot polling
|
|
222
|
+
continues even when the transcript is idle so a missed stop-confirmation event
|
|
223
|
+
can recover; polling stops once no turn or unresolved stop remains.
|
|
204
224
|
|
|
205
225
|
Failed chat-list reads (including initial load, reconnect, visibility resume and
|
|
206
226
|
Back navigation) retain cached rows and display a retryable error in the Chats
|
|
@@ -212,40 +232,48 @@ affected files before restoring their earlier state. Cancel or Escape leaves the
|
|
|
212
232
|
unchanged; restoring preserves chat history. Failed restores remain in the dialog
|
|
213
233
|
with an error and can be retried.
|
|
214
234
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
Snapshots, summaries, and events optionally carry a monotonically increasing
|
|
233
|
-
numeric `revision` per conversation. Once a revision is present, older or
|
|
234
|
-
unversioned updates are ignored. Events at the same revision may carry different
|
|
235
|
-
parts of one change; revisions are not event IDs. Hosts must supply consistent
|
|
236
|
-
revisions across all three surfaces to enable this protection. Existing unversioned
|
|
237
|
-
adapters remain supported: events arriving during a snapshot request invalidate
|
|
238
|
-
that response and cause a later refresh. Without server revisions, the library
|
|
239
|
-
cannot identify stale server responses or all delayed events.
|
|
235
|
+
`getConversation(id)` returns the newest message page and an opaque `olderCursor`
|
|
236
|
+
(`null` at the start of history). The panel requests older pages with
|
|
237
|
+
`getOlderMessages(id, cursor)` on demand. Since the initial page, it calls
|
|
238
|
+
`getChanges(id, since)` and merges complete message rows by `messageId` and row
|
|
239
|
+
`revision`, ordered by `sequence`. Changes replace the whole draft when present:
|
|
240
|
+
omitted means unchanged; `null` means cleared.
|
|
241
|
+
|
|
242
|
+
The header `revision` is the covered watermark for `since`, not the largest row
|
|
243
|
+
revision. A read may contain newer rows without covering all intervening changes.
|
|
244
|
+
`observe` delivers only `{ chatId, revision }` notices. Adapters call the optional
|
|
245
|
+
connection callback on connect and reconnect and may report transport failures
|
|
246
|
+
through the optional error callback. The panel coalesces catch-up requests and
|
|
247
|
+
polls every ten seconds while running or while a remote stop is unresolved.
|
|
248
|
+
Synchronization errors block submissions until recovery.
|
|
249
|
+
When the read scope changes, adapters send `{ chatId, revision, reset: true }`
|
|
250
|
+
even if the revision is unchanged. The panel discards cached details and
|
|
251
|
+
in-flight reads from the old scope and loads the newest page again.
|
|
240
252
|
|
|
241
253
|
Polling only repairs browser state from the backend's snapshot. It cannot repair
|
|
242
254
|
a backend that has not persisted completion, and a suspended/offline browser or
|
|
243
255
|
a request that never settles has no bounded convergence guarantee. Unmounting
|
|
244
256
|
stops observation, timers, and browser listeners; it never cancels a turn.
|
|
245
257
|
|
|
246
|
-
`
|
|
247
|
-
|
|
248
|
-
|
|
258
|
+
Fixture scripts may supply `before` for modifications to make the fixture's
|
|
259
|
+
last-apply restore action available; without a known prior value the fixture
|
|
260
|
+
does not offer a partial restore.
|
|
261
|
+
|
|
262
|
+
## Organization availability
|
|
263
|
+
|
|
264
|
+
Adapters implement `getAvailability()` and include snapshot `availability` as
|
|
265
|
+
`{ state: 'enabled' | 'organization_disabled', policyVersion: string }`.
|
|
266
|
+
The panel reconciles both sources by local request order: a response from an
|
|
267
|
+
older request cannot replace a result accepted from a newer request.
|
|
268
|
+
`policyVersion` is opaque and is never sorted. Snapshots omitting availability
|
|
269
|
+
do not replace a known endpoint result.
|
|
270
|
+
|
|
271
|
+
The endpoint is checked before protected actions and on online/visible resume,
|
|
272
|
+
including on the conversation list. Failed lookups block changes and offer
|
|
273
|
+
retry. Disabled availability preserves the transcript and Stop, but blocks new
|
|
274
|
+
prompts, answers, draft apply, live update, revert, and Restore. Draft
|
|
275
|
+
dismissal remains available.
|
|
276
|
+
Denied actions are not automatically replayed.
|
|
249
277
|
|
|
250
278
|
## Questions from Copilot
|
|
251
279
|
|
|
@@ -266,10 +294,8 @@ delivery status. One question may be actionable per conversation. Keep the
|
|
|
266
294
|
conversation `running` and its assistant message `streaming` while awaiting
|
|
267
295
|
input; provider "requires action" is not turn completion.
|
|
268
296
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
from an adapter without that action displays an explicit unsupported message.
|
|
272
|
-
The HTTP client posts the answer fields (excluding the two path identities) to
|
|
297
|
+
`CopilotClient.answerQuestion(AnswerQuestionInput)` sends answers. The HTTP
|
|
298
|
+
client posts the answer fields (excluding the two path identities) to
|
|
273
299
|
`/conversations/{conversationId}/questions/{questionId}/answer` relative to
|
|
274
300
|
`baseUrl`. Hosts with other routes map this action in their adapter.
|
|
275
301
|
|
package/dist/{highlighted-body-OFNGDK62-CH7N2RUX.js → highlighted-body-OFNGDK62-PP6OFj0v.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as c, L as f, A as d } from "./index-
|
|
1
|
+
import { R as c, L as f, A as d } from "./index-CNP5V04Z.js";
|
|
2
2
|
import { useContext as p, useState as L, useEffect as N } from "react";
|
|
3
3
|
import { jsx as x } from "react/jsx-runtime";
|
|
4
4
|
var A = ({ code: s, language: e, raw: a, className: o, startLine: m, lineNumbers: u, ...g }) => {
|