@camunda/copilot-chat 0.8.1-alpha.4 → 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 +64 -59
- package/dist/{highlighted-body-OFNGDK62-MgzBXhjb.js → highlighted-body-OFNGDK62-PP6OFj0v.js} +1 -1
- package/dist/{index-DAyxug2G.js → index-CNP5V04Z.js} +8296 -8271
- package/dist/index.css +1 -1
- package/dist/index.d.ts +322 -117
- package/dist/index.js +12 -13
- package/dist/mermaid-GHXKKRXX-Ca3y5wFn.js +4 -0
- package/package.json +1 -1
- package/dist/mermaid-GHXKKRXX-DiHcM5a9.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,25 +191,32 @@ 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
|
-
|
|
198
|
-
|
|
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.
|
|
199
214
|
|
|
200
215
|
While a turn is running, the message input and suggestions are disabled and no
|
|
201
|
-
additional message can be submitted. Stop remains available; sending resumes
|
|
202
|
-
the turn finishes or is stopped
|
|
203
|
-
error and preserve the
|
|
204
|
-
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.
|
|
205
220
|
|
|
206
221
|
Pending or unconfirmed remote stops block Send, but not Stop. Snapshot polling
|
|
207
222
|
continues even when the transcript is idle so a missed stop-confirmation event
|
|
@@ -217,46 +232,37 @@ affected files before restoring their earlier state. Cancel or Escape leaves the
|
|
|
217
232
|
unchanged; restoring preserves chat history. Failed restores remain in the dialog
|
|
218
233
|
with an error and can be retried.
|
|
219
234
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
Snapshots, summaries, and events optionally carry a monotonically increasing
|
|
239
|
-
numeric `revision` per conversation. Once a revision is present, older or
|
|
240
|
-
unversioned updates are ignored. Events at the same revision may carry different
|
|
241
|
-
parts of one change; revisions are not event IDs. Hosts must supply consistent
|
|
242
|
-
revisions across all three surfaces to enable this protection. Existing unversioned
|
|
243
|
-
adapters remain supported: events arriving during a snapshot request invalidate
|
|
244
|
-
that response and cause a later refresh. Without server revisions, the library
|
|
245
|
-
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.
|
|
246
252
|
|
|
247
253
|
Polling only repairs browser state from the backend's snapshot. It cannot repair
|
|
248
254
|
a backend that has not persisted completion, and a suspended/offline browser or
|
|
249
255
|
a request that never settles has no bounded convergence guarantee. Unmounting
|
|
250
256
|
stops observation, timers, and browser listeners; it never cancels a turn.
|
|
251
257
|
|
|
252
|
-
`
|
|
253
|
-
|
|
254
|
-
|
|
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.
|
|
255
261
|
|
|
256
262
|
## Organization availability
|
|
257
263
|
|
|
258
|
-
Adapters
|
|
259
|
-
|
|
264
|
+
Adapters implement `getAvailability()` and include snapshot `availability` as
|
|
265
|
+
`{ state: 'enabled' | 'organization_disabled', policyVersion: string }`.
|
|
260
266
|
The panel reconciles both sources by local request order: a response from an
|
|
261
267
|
older request cannot replace a result accepted from a newer request.
|
|
262
268
|
`policyVersion` is opaque and is never sorted. Snapshots omitting availability
|
|
@@ -264,8 +270,9 @@ do not replace a known endpoint result.
|
|
|
264
270
|
|
|
265
271
|
The endpoint is checked before protected actions and on online/visible resume,
|
|
266
272
|
including on the conversation list. Failed lookups block changes and offer
|
|
267
|
-
retry. Disabled availability preserves the transcript
|
|
268
|
-
|
|
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.
|
|
269
276
|
Denied actions are not automatically replayed.
|
|
270
277
|
|
|
271
278
|
## Questions from Copilot
|
|
@@ -287,10 +294,8 @@ delivery status. One question may be actionable per conversation. Keep the
|
|
|
287
294
|
conversation `running` and its assistant message `streaming` while awaiting
|
|
288
295
|
input; provider "requires action" is not turn completion.
|
|
289
296
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
from an adapter without that action displays an explicit unsupported message.
|
|
293
|
-
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
|
|
294
299
|
`/conversations/{conversationId}/questions/{questionId}/answer` relative to
|
|
295
300
|
`baseUrl`. Hosts with other routes map this action in their adapter.
|
|
296
301
|
|
package/dist/{highlighted-body-OFNGDK62-MgzBXhjb.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 }) => {
|