@adecore/agents-react 0.50.5 → 0.50.7
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/chat/chat-references.d.ts +1 -0
- package/dist/chat/ui/Markdown.js +20 -39
- package/dist/chat/ui/MessageActions.js +69 -51
- package/dist/chat/ui/Timeline.js +38 -25
- package/dist/chat/ui/composer/use-prompt-menus.d.ts +1 -0
- package/dist/chat/ui/composer/use-prompt-menus.js +238 -213
- package/dist/chat/ui/rows/WorkRows.js +46 -0
- package/dist/host-hooks.d.ts +1 -0
- package/dist/host-hooks.js +7 -0
- package/dist/host.d.ts +25 -0
- package/package.json +8 -8
- package/src/chat/chat-references.ts +2 -0
- package/src/chat/ui/Markdown.tsx +2 -1
- package/src/chat/ui/MessageActions.tsx +1 -0
- package/src/chat/ui/Timeline.tsx +2 -0
- package/src/chat/ui/composer/use-prompt-menus.ts +32 -1
- package/src/chat/ui/rows/WorkRows.tsx +11 -0
- package/src/host-hooks.ts +10 -0
- package/src/host.ts +18 -0
package/dist/chat/ui/Markdown.js
CHANGED
|
@@ -455,7 +455,7 @@ function Diagram(t0) {
|
|
|
455
455
|
return t4;
|
|
456
456
|
}
|
|
457
457
|
function MarkdownCode(t0) {
|
|
458
|
-
const $ = _c(
|
|
458
|
+
const $ = _c(7);
|
|
459
459
|
const {
|
|
460
460
|
className,
|
|
461
461
|
children,
|
|
@@ -463,61 +463,42 @@ function MarkdownCode(t0) {
|
|
|
463
463
|
} = t0;
|
|
464
464
|
const plain = t1 === undefined ? false : t1;
|
|
465
465
|
const block = useContext(BlockCodeContext);
|
|
466
|
+
const {
|
|
467
|
+
renderCodeFence
|
|
468
|
+
} = useChatHost();
|
|
466
469
|
const text = String(children ?? "");
|
|
467
470
|
if (block) {
|
|
468
471
|
let t2;
|
|
469
|
-
if ($[0] !== className) {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
} else {
|
|
474
|
-
t2 = $[1];
|
|
475
|
-
}
|
|
476
|
-
const lang = t2;
|
|
477
|
-
let t3;
|
|
478
|
-
if ($[2] !== text) {
|
|
479
|
-
let t4;
|
|
480
|
-
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
481
|
-
t4 = /\n$/;
|
|
482
|
-
$[4] = t4;
|
|
483
|
-
} else {
|
|
484
|
-
t4 = $[4];
|
|
485
|
-
}
|
|
486
|
-
t3 = text.replace(t4, "");
|
|
487
|
-
$[2] = text;
|
|
488
|
-
$[3] = t3;
|
|
489
|
-
} else {
|
|
490
|
-
t3 = $[3];
|
|
491
|
-
}
|
|
492
|
-
const code = t3;
|
|
493
|
-
let t4;
|
|
494
|
-
if ($[5] !== code || $[6] !== lang) {
|
|
495
|
-
t4 = lang === "mermaid" ? /*#__PURE__*/_jsx(Diagram, {
|
|
472
|
+
if ($[0] !== className || $[1] !== renderCodeFence || $[2] !== text) {
|
|
473
|
+
const lang = languageOf(className);
|
|
474
|
+
const code = text.replace(/\n$/, "");
|
|
475
|
+
t2 = renderCodeFence?.(lang, code) ?? (lang === "mermaid" ? /*#__PURE__*/_jsx(Diagram, {
|
|
496
476
|
code: code
|
|
497
477
|
}) : /*#__PURE__*/_jsx(CodeBlock, {
|
|
498
478
|
code: code,
|
|
499
479
|
lang: lang
|
|
500
|
-
});
|
|
501
|
-
$[
|
|
502
|
-
$[
|
|
503
|
-
$[
|
|
480
|
+
}));
|
|
481
|
+
$[0] = className;
|
|
482
|
+
$[1] = renderCodeFence;
|
|
483
|
+
$[2] = text;
|
|
484
|
+
$[3] = t2;
|
|
504
485
|
} else {
|
|
505
|
-
|
|
486
|
+
t2 = $[3];
|
|
506
487
|
}
|
|
507
|
-
return
|
|
488
|
+
return t2;
|
|
508
489
|
}
|
|
509
490
|
let t2;
|
|
510
|
-
if ($[
|
|
491
|
+
if ($[4] !== plain || $[5] !== text) {
|
|
511
492
|
t2 = plain ? /*#__PURE__*/_jsx(PlainCode, {
|
|
512
493
|
text: text
|
|
513
494
|
}) : /*#__PURE__*/_jsx(InlineCode, {
|
|
514
495
|
text: text
|
|
515
496
|
});
|
|
516
|
-
$[
|
|
517
|
-
$[
|
|
518
|
-
$[
|
|
497
|
+
$[4] = plain;
|
|
498
|
+
$[5] = text;
|
|
499
|
+
$[6] = t2;
|
|
519
500
|
} else {
|
|
520
|
-
t2 = $[
|
|
501
|
+
t2 = $[6];
|
|
521
502
|
}
|
|
522
503
|
return t2;
|
|
523
504
|
}
|
|
@@ -18,7 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
const COPIED_MS = 1500;
|
|
19
19
|
/* Hidden actions keep their height, so hovering never forces the virtualizer to remeasure. */
|
|
20
20
|
export function MessageActions(t0) {
|
|
21
|
-
const $ = _c(
|
|
21
|
+
const $ = _c(66);
|
|
22
22
|
const {
|
|
23
23
|
chatId,
|
|
24
24
|
row
|
|
@@ -189,81 +189,99 @@ export function MessageActions(t0) {
|
|
|
189
189
|
t12 = $[38];
|
|
190
190
|
}
|
|
191
191
|
let t13;
|
|
192
|
-
if ($[39] !== row.item.
|
|
193
|
-
t13 =
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
if ($[39] !== chatId || $[40] !== host || $[41] !== row.id || $[42] !== row.item.text || $[43] !== row.kind) {
|
|
193
|
+
t13 = host.renderMessageActions?.({
|
|
194
|
+
chatId,
|
|
195
|
+
id: row.id,
|
|
196
|
+
kind: row.kind,
|
|
197
|
+
text: row.item.text
|
|
198
|
+
});
|
|
199
|
+
$[39] = chatId;
|
|
200
|
+
$[40] = host;
|
|
201
|
+
$[41] = row.id;
|
|
202
|
+
$[42] = row.item.text;
|
|
203
|
+
$[43] = row.kind;
|
|
204
|
+
$[44] = t13;
|
|
196
205
|
} else {
|
|
197
|
-
t13 = $[
|
|
206
|
+
t13 = $[44];
|
|
198
207
|
}
|
|
199
208
|
let t14;
|
|
200
|
-
if ($[
|
|
201
|
-
t14 =
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
209
|
+
if ($[45] !== row.item.createdAt) {
|
|
210
|
+
t14 = formatDateTime(row.item.createdAt, TIMESTAMP_FORMAT);
|
|
211
|
+
$[45] = row.item.createdAt;
|
|
212
|
+
$[46] = t14;
|
|
204
213
|
} else {
|
|
205
|
-
t14 = $[
|
|
214
|
+
t14 = $[46];
|
|
206
215
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
$[
|
|
212
|
-
$[44] = t16;
|
|
216
|
+
let t15;
|
|
217
|
+
if ($[47] !== row.item.createdAt) {
|
|
218
|
+
t15 = new Date(row.item.createdAt).toISOString();
|
|
219
|
+
$[47] = row.item.createdAt;
|
|
220
|
+
$[48] = t15;
|
|
213
221
|
} else {
|
|
214
|
-
|
|
222
|
+
t15 = $[48];
|
|
215
223
|
}
|
|
224
|
+
const t16 = row.kind === "assistant" && "order-first";
|
|
216
225
|
let t17;
|
|
217
|
-
if ($[
|
|
218
|
-
t17 =
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
226
|
+
if ($[49] !== t16) {
|
|
227
|
+
t17 = clsx("shrink-0 text-xs text-text-faint tabular-nums select-none", t16);
|
|
228
|
+
$[49] = t16;
|
|
229
|
+
$[50] = t17;
|
|
221
230
|
} else {
|
|
222
|
-
t17 = $[
|
|
231
|
+
t17 = $[50];
|
|
223
232
|
}
|
|
224
233
|
let t18;
|
|
225
|
-
if ($[
|
|
226
|
-
t18 =
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
children: t17
|
|
230
|
-
});
|
|
231
|
-
$[47] = t14;
|
|
232
|
-
$[48] = t16;
|
|
233
|
-
$[49] = t17;
|
|
234
|
-
$[50] = t18;
|
|
234
|
+
if ($[51] !== row.item.createdAt) {
|
|
235
|
+
t18 = formatClock(row.item.createdAt);
|
|
236
|
+
$[51] = row.item.createdAt;
|
|
237
|
+
$[52] = t18;
|
|
235
238
|
} else {
|
|
236
|
-
t18 = $[
|
|
239
|
+
t18 = $[52];
|
|
237
240
|
}
|
|
238
241
|
let t19;
|
|
239
|
-
if ($[
|
|
240
|
-
t19 = /*#__PURE__*/_jsx(
|
|
241
|
-
|
|
242
|
+
if ($[53] !== t15 || $[54] !== t17 || $[55] !== t18) {
|
|
243
|
+
t19 = /*#__PURE__*/_jsx("time", {
|
|
244
|
+
dateTime: t15,
|
|
245
|
+
className: t17,
|
|
242
246
|
children: t18
|
|
243
247
|
});
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
248
|
+
$[53] = t15;
|
|
249
|
+
$[54] = t17;
|
|
250
|
+
$[55] = t18;
|
|
251
|
+
$[56] = t19;
|
|
247
252
|
} else {
|
|
248
|
-
t19 = $[
|
|
253
|
+
t19 = $[56];
|
|
249
254
|
}
|
|
250
255
|
let t20;
|
|
251
|
-
if ($[
|
|
252
|
-
t20 = /*#__PURE__*/
|
|
256
|
+
if ($[57] !== t14 || $[58] !== t19) {
|
|
257
|
+
t20 = /*#__PURE__*/_jsx(Tooltip, {
|
|
258
|
+
label: t14,
|
|
259
|
+
children: t19
|
|
260
|
+
});
|
|
261
|
+
$[57] = t14;
|
|
262
|
+
$[58] = t19;
|
|
263
|
+
$[59] = t20;
|
|
264
|
+
} else {
|
|
265
|
+
t20 = $[59];
|
|
266
|
+
}
|
|
267
|
+
let t21;
|
|
268
|
+
if ($[60] !== t11 || $[61] !== t12 || $[62] !== t13 || $[63] !== t20 || $[64] !== t9) {
|
|
269
|
+
t21 = /*#__PURE__*/_jsxs("div", {
|
|
253
270
|
role: "toolbar",
|
|
254
271
|
"aria-label": t9,
|
|
255
272
|
className: t11,
|
|
256
|
-
children: [t12,
|
|
273
|
+
children: [t12, t13, t20]
|
|
257
274
|
});
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
275
|
+
$[60] = t11;
|
|
276
|
+
$[61] = t12;
|
|
277
|
+
$[62] = t13;
|
|
278
|
+
$[63] = t20;
|
|
279
|
+
$[64] = t9;
|
|
280
|
+
$[65] = t21;
|
|
263
281
|
} else {
|
|
264
|
-
|
|
282
|
+
t21 = $[65];
|
|
265
283
|
}
|
|
266
|
-
return
|
|
284
|
+
return t21;
|
|
267
285
|
}
|
|
268
286
|
function _temp2(chat_0) {
|
|
269
287
|
return chat_0?.info ?? null;
|
package/dist/chat/ui/Timeline.js
CHANGED
|
@@ -55,10 +55,13 @@ function showRowAtTop(virtualizer, followRef, index) {
|
|
|
55
55
|
* and the folder it works in, so a first question can lean on all three.
|
|
56
56
|
*/
|
|
57
57
|
function EmptyThread(t0) {
|
|
58
|
-
const $ = _c(
|
|
58
|
+
const $ = _c(24);
|
|
59
59
|
const {
|
|
60
60
|
chatId
|
|
61
61
|
} = t0;
|
|
62
|
+
const {
|
|
63
|
+
renderEmptyThread
|
|
64
|
+
} = useChatHost();
|
|
62
65
|
const {
|
|
63
66
|
t
|
|
64
67
|
} = useTranslation("agent-chat");
|
|
@@ -102,8 +105,17 @@ function EmptyThread(t0) {
|
|
|
102
105
|
t3 = $[8];
|
|
103
106
|
}
|
|
104
107
|
let t4;
|
|
105
|
-
if ($[9] !==
|
|
106
|
-
t4 =
|
|
108
|
+
if ($[9] !== chatId || $[10] !== renderEmptyThread) {
|
|
109
|
+
t4 = renderEmptyThread?.(chatId);
|
|
110
|
+
$[9] = chatId;
|
|
111
|
+
$[10] = renderEmptyThread;
|
|
112
|
+
$[11] = t4;
|
|
113
|
+
} else {
|
|
114
|
+
t4 = $[11];
|
|
115
|
+
}
|
|
116
|
+
let t5;
|
|
117
|
+
if ($[12] !== sources || $[13] !== t) {
|
|
118
|
+
t5 = sources.length > 0 && /*#__PURE__*/_jsxs("div", {
|
|
107
119
|
className: "flex max-w-full flex-col items-center gap-1",
|
|
108
120
|
children: [/*#__PURE__*/_jsx(SectionLabel, {
|
|
109
121
|
children: t("timeline.empty.canRead")
|
|
@@ -112,15 +124,15 @@ function EmptyThread(t0) {
|
|
|
112
124
|
children: sources.map(_temp2).join(", ")
|
|
113
125
|
})]
|
|
114
126
|
});
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
127
|
+
$[12] = sources;
|
|
128
|
+
$[13] = t;
|
|
129
|
+
$[14] = t5;
|
|
118
130
|
} else {
|
|
119
|
-
|
|
131
|
+
t5 = $[14];
|
|
120
132
|
}
|
|
121
|
-
let
|
|
122
|
-
if ($[
|
|
123
|
-
|
|
133
|
+
let t6;
|
|
134
|
+
if ($[15] !== hidesFolder || $[16] !== info || $[17] !== t) {
|
|
135
|
+
t6 = info?.cwd && !hidesFolder && /*#__PURE__*/_jsxs("div", {
|
|
124
136
|
className: "flex max-w-full flex-col items-center gap-1",
|
|
125
137
|
children: [/*#__PURE__*/_jsx(SectionLabel, {
|
|
126
138
|
children: t("timeline.empty.worksIn")
|
|
@@ -129,30 +141,31 @@ function EmptyThread(t0) {
|
|
|
129
141
|
children: info.cwd
|
|
130
142
|
})]
|
|
131
143
|
});
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
144
|
+
$[15] = hidesFolder;
|
|
145
|
+
$[16] = info;
|
|
146
|
+
$[17] = t;
|
|
147
|
+
$[18] = t6;
|
|
136
148
|
} else {
|
|
137
|
-
|
|
149
|
+
t6 = $[18];
|
|
138
150
|
}
|
|
139
|
-
let
|
|
140
|
-
if ($[
|
|
141
|
-
|
|
151
|
+
let t7;
|
|
152
|
+
if ($[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6) {
|
|
153
|
+
t7 = /*#__PURE__*/_jsx("div", {
|
|
142
154
|
className: "flex grow items-center justify-center",
|
|
143
155
|
children: /*#__PURE__*/_jsxs("div", {
|
|
144
156
|
className: "flex max-w-sm flex-col items-center gap-3 px-6 py-8 text-center",
|
|
145
|
-
children: [t3, t4, t5]
|
|
157
|
+
children: [t3, t4, t5, t6]
|
|
146
158
|
})
|
|
147
159
|
});
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
160
|
+
$[19] = t3;
|
|
161
|
+
$[20] = t4;
|
|
162
|
+
$[21] = t5;
|
|
163
|
+
$[22] = t6;
|
|
164
|
+
$[23] = t7;
|
|
152
165
|
} else {
|
|
153
|
-
|
|
166
|
+
t7 = $[23];
|
|
154
167
|
}
|
|
155
|
-
return
|
|
168
|
+
return t7;
|
|
156
169
|
}
|
|
157
170
|
/*
|
|
158
171
|
* A row of the thread behind the chapter line of its bookmark. A message, the only row that takes a
|