@adecore/agents-react 0.70.0 → 0.71.0
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/logic/fork.js +1 -0
- package/dist/chat/logic/thread-cards.js +1 -0
- package/dist/chat/logic/timeline.js +7 -0
- package/dist/chat/ui/CodeBlock.d.ts +6 -1
- package/dist/chat/ui/CodeBlock.js +39 -23
- package/dist/chat/ui/intelligent-ui/UiReply.js +11 -2
- package/dist/chat/ui/intelligent-ui/key-caps.d.ts +1 -0
- package/dist/chat/ui/intelligent-ui/key-caps.js +45 -0
- package/dist/chat/ui/intelligent-ui/link-action.d.ts +9 -0
- package/dist/chat/ui/intelligent-ui/link-action.js +32 -0
- package/dist/chat/ui/intelligent-ui/node-text.js +1 -1
- package/dist/chat/ui/intelligent-ui/patch-clip.d.ts +4 -0
- package/dist/chat/ui/intelligent-ui/patch-clip.js +64 -0
- package/dist/chat/ui/intelligent-ui/registry.js +31 -5
- package/dist/chat/ui/intelligent-ui/render-context.d.ts +13 -0
- package/dist/chat/ui/intelligent-ui/renderers/alternatives.d.ts +6 -0
- package/dist/chat/ui/intelligent-ui/renderers/alternatives.js +296 -0
- package/dist/chat/ui/intelligent-ui/renderers/changes.d.ts +4 -0
- package/dist/chat/ui/intelligent-ui/renderers/changes.js +266 -0
- package/dist/chat/ui/intelligent-ui/renderers/chart.js +522 -371
- package/dist/chat/ui/intelligent-ui/renderers/content.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/content.js +94 -43
- package/dist/chat/ui/intelligent-ui/renderers/data.js +478 -245
- package/dist/chat/ui/intelligent-ui/renderers/diff.d.ts +4 -0
- package/dist/chat/ui/intelligent-ui/renderers/diff.js +427 -0
- package/dist/chat/ui/intelligent-ui/renderers/inputs.d.ts +1 -0
- package/dist/chat/ui/intelligent-ui/renderers/inputs.js +354 -110
- package/dist/chat/ui/intelligent-ui/renderers/keys.d.ts +3 -0
- package/dist/chat/ui/intelligent-ui/renderers/keys.js +60 -0
- package/dist/chat/ui/intelligent-ui/renderers/links.d.ts +13 -2
- package/dist/chat/ui/intelligent-ui/renderers/links.js +65 -85
- package/dist/chat/ui/intelligent-ui/renderers/meter.d.ts +4 -0
- package/dist/chat/ui/intelligent-ui/renderers/meter.js +371 -0
- package/dist/chat/ui/intelligent-ui/renderers/quote.d.ts +3 -0
- package/dist/chat/ui/intelligent-ui/renderers/quote.js +123 -0
- package/dist/chat/ui/intelligent-ui/renderers/radio.d.ts +3 -0
- package/dist/chat/ui/intelligent-ui/renderers/radio.js +205 -0
- package/dist/chat/ui/intelligent-ui/renderers/structure.d.ts +2 -0
- package/dist/chat/ui/intelligent-ui/renderers/structure.js +156 -45
- package/dist/chat/ui/intelligent-ui/renderers/text.js +365 -215
- package/dist/chat/ui/intelligent-ui/renderers/tree.d.ts +5 -0
- package/dist/chat/ui/intelligent-ui/renderers/tree.js +284 -0
- package/dist/chat/ui/intelligent-ui/table-data.d.ts +9 -2
- package/dist/chat/ui/intelligent-ui/table-data.js +68 -3
- package/dist/chat/ui/intelligent-ui/tones.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/tones.js +7 -7
- package/dist/chat/ui/intelligent-ui/use-ui-diffs.d.ts +4 -0
- package/dist/chat/ui/intelligent-ui/use-ui-diffs.js +201 -0
- package/dist/chat/ui/rows/MessageRows.d.ts +4 -1
- package/dist/chat/ui/rows/MessageRows.js +92 -1
- package/dist/chat/ui/rows/Rows.js +45 -31
- package/dist/host/host.d.ts +2 -1
- package/dist/host/timeline-row.d.ts +5 -1
- package/dist/locales/en/agent-chat.d.ts +62 -0
- package/dist/locales/en/agent-chat.js +63 -1
- package/dist/locales/nl/agent-chat.d.ts +62 -0
- package/dist/locales/nl/agent-chat.js +63 -1
- package/dist/theme.css +6 -0
- package/package.json +9 -9
- package/src/chat/logic/fork.ts +1 -0
- package/src/chat/logic/thread-cards.ts +1 -0
- package/src/chat/logic/timeline.ts +4 -0
- package/src/chat/ui/CodeBlock.tsx +38 -18
- package/src/chat/ui/intelligent-ui/UiReply.tsx +13 -2
- package/src/chat/ui/intelligent-ui/key-caps.ts +51 -0
- package/src/chat/ui/intelligent-ui/link-action.ts +32 -0
- package/src/chat/ui/intelligent-ui/node-text.ts +1 -0
- package/src/chat/ui/intelligent-ui/patch-clip.ts +83 -0
- package/src/chat/ui/intelligent-ui/registry.ts +31 -4
- package/src/chat/ui/intelligent-ui/render-context.ts +21 -0
- package/src/chat/ui/intelligent-ui/renderers/alternatives.tsx +76 -0
- package/src/chat/ui/intelligent-ui/renderers/changes.tsx +97 -0
- package/src/chat/ui/intelligent-ui/renderers/chart.tsx +122 -46
- package/src/chat/ui/intelligent-ui/renderers/content.tsx +27 -7
- package/src/chat/ui/intelligent-ui/renderers/data.tsx +165 -52
- package/src/chat/ui/intelligent-ui/renderers/diff.tsx +144 -0
- package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +111 -19
- package/src/chat/ui/intelligent-ui/renderers/keys.tsx +26 -0
- package/src/chat/ui/intelligent-ui/renderers/links.tsx +40 -24
- package/src/chat/ui/intelligent-ui/renderers/meter.tsx +105 -0
- package/src/chat/ui/intelligent-ui/renderers/quote.tsx +29 -0
- package/src/chat/ui/intelligent-ui/renderers/radio.tsx +130 -0
- package/src/chat/ui/intelligent-ui/renderers/structure.tsx +54 -7
- package/src/chat/ui/intelligent-ui/renderers/text.tsx +70 -36
- package/src/chat/ui/intelligent-ui/renderers/tree.tsx +85 -0
- package/src/chat/ui/intelligent-ui/table-data.ts +84 -6
- package/src/chat/ui/intelligent-ui/tones.ts +7 -7
- package/src/chat/ui/intelligent-ui/use-ui-diffs.ts +119 -0
- package/src/chat/ui/rows/MessageRows.tsx +23 -0
- package/src/chat/ui/rows/Rows.tsx +3 -0
- package/src/host/host.ts +4 -0
- package/src/host/timeline-row.ts +3 -0
- package/src/locales/en/agent-chat.ts +63 -1
- package/src/locales/nl/agent-chat.ts +63 -1
- package/src/theme.css +6 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UiProps } from '@adecore/intelligent-ui';
|
|
2
2
|
import type { UiRendererProps } from '../render-context.js';
|
|
3
|
-
export declare function CodeBlockRenderer({ node }: UiRendererProps<UiProps<'CodeBlock'>>): import("react").JSX.Element;
|
|
3
|
+
export declare function CodeBlockRenderer({ node, context }: UiRendererProps<UiProps<'CodeBlock'>>): import("react").JSX.Element;
|
|
4
4
|
export declare function ImageRenderer({ node, children, context }: UiRendererProps<UiProps<'Image'>>): import("react").JSX.Element;
|
|
5
5
|
export declare function GalleryRenderer({ node, children }: UiRendererProps<UiProps<'Gallery'>>): import("react").JSX.Element;
|
|
6
6
|
export declare function CompareRenderer({ node, children, context }: UiRendererProps<UiProps<'Compare'>>): import("react").JSX.Element;
|
|
@@ -13,86 +13,137 @@ import { DisplayImage } from '../../DisplayImage.js';
|
|
|
13
13
|
import { ImageGroup, ImageThumb } from '../../ImageView.js';
|
|
14
14
|
import { uiChildrenOf, uiNodeLabel, uiNodeText, uiUrlDomain } from '../node-text.js';
|
|
15
15
|
import { useTruncated } from '../use-truncated.js';
|
|
16
|
+
import { UiLinkChip } from './links.js';
|
|
16
17
|
// The number of every source by its node id, which the list counts in its own order.
|
|
17
18
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
19
|
const SourceNumbers = createContext(new Map());
|
|
19
|
-
/*
|
|
20
|
+
/* What a file is written in, by its extension, for code that names its file and no language. */
|
|
21
|
+
function languageOfFile(path) {
|
|
22
|
+
return /\.([A-Za-z\d]+)$/.exec(path)?.[1]?.toLowerCase();
|
|
23
|
+
}
|
|
24
|
+
/*
|
|
25
|
+
* Plain text in the same measure until the node closes, so highlighting never makes it jump. With a file
|
|
26
|
+
* the header is its chip, which opens the file at `start` once the host checked it, in place of the language.
|
|
27
|
+
*/
|
|
20
28
|
export function CodeBlockRenderer(t0) {
|
|
21
|
-
const $ = _c(
|
|
29
|
+
const $ = _c(28);
|
|
22
30
|
const {
|
|
23
|
-
node
|
|
31
|
+
node,
|
|
32
|
+
context
|
|
24
33
|
} = t0;
|
|
25
34
|
const {
|
|
26
|
-
language
|
|
35
|
+
language,
|
|
36
|
+
file,
|
|
37
|
+
start,
|
|
38
|
+
highlight
|
|
27
39
|
} = node.props;
|
|
40
|
+
const filed = file !== undefined && file !== "";
|
|
41
|
+
const labeled = language !== undefined && language !== "";
|
|
42
|
+
const lined = start !== undefined || highlight !== undefined && highlight.length > 0;
|
|
28
43
|
let t1;
|
|
29
|
-
if ($[0] !== language) {
|
|
30
|
-
t1 =
|
|
31
|
-
className: "chat-ui-flat-inner flex px-1.5 pt-0.5 pb-1.5",
|
|
32
|
-
children: /*#__PURE__*/_jsx(
|
|
44
|
+
if ($[0] !== context || $[1] !== file || $[2] !== filed || $[3] !== labeled || $[4] !== language || $[5] !== start) {
|
|
45
|
+
t1 = (filed || labeled) && /*#__PURE__*/_jsx("div", {
|
|
46
|
+
className: "chat-ui-flat-inner flex min-w-0 px-1.5 pt-0.5 pb-1.5",
|
|
47
|
+
children: filed ? /*#__PURE__*/_jsx(UiLinkChip, {
|
|
48
|
+
target: {
|
|
49
|
+
type: "File",
|
|
50
|
+
path: file,
|
|
51
|
+
line: start
|
|
52
|
+
},
|
|
53
|
+
context: context
|
|
54
|
+
}) : /*#__PURE__*/_jsx("span", {
|
|
33
55
|
className: "rounded-md bg-ui-inset px-1.5 font-mono text-2xs text-text shadow-[inset_0_0_0_1px_var(--border)]",
|
|
34
56
|
children: language
|
|
35
57
|
})
|
|
36
58
|
});
|
|
37
|
-
$[0] =
|
|
38
|
-
$[1] =
|
|
59
|
+
$[0] = context;
|
|
60
|
+
$[1] = file;
|
|
61
|
+
$[2] = filed;
|
|
62
|
+
$[3] = labeled;
|
|
63
|
+
$[4] = language;
|
|
64
|
+
$[5] = start;
|
|
65
|
+
$[6] = t1;
|
|
39
66
|
} else {
|
|
40
|
-
t1 = $[
|
|
67
|
+
t1 = $[6];
|
|
41
68
|
}
|
|
42
69
|
const t2 = !node.complete;
|
|
43
70
|
let t3;
|
|
44
|
-
if ($[
|
|
71
|
+
if ($[7] !== node) {
|
|
45
72
|
let t4;
|
|
46
|
-
if ($[
|
|
73
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47
74
|
t4 = /^\n|\n$/g;
|
|
48
|
-
$[
|
|
75
|
+
$[9] = t4;
|
|
49
76
|
} else {
|
|
50
|
-
t4 = $[
|
|
77
|
+
t4 = $[9];
|
|
51
78
|
}
|
|
52
79
|
t3 = uiNodeText(node).replace(t4, "");
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
80
|
+
$[7] = node;
|
|
81
|
+
$[8] = t3;
|
|
55
82
|
} else {
|
|
56
|
-
t3 = $[
|
|
83
|
+
t3 = $[8];
|
|
84
|
+
}
|
|
85
|
+
let t4;
|
|
86
|
+
if ($[10] !== file || $[11] !== filed || $[12] !== language) {
|
|
87
|
+
t4 = language ?? (filed ? languageOfFile(file) : undefined) ?? "text";
|
|
88
|
+
$[10] = file;
|
|
89
|
+
$[11] = filed;
|
|
90
|
+
$[12] = language;
|
|
91
|
+
$[13] = t4;
|
|
92
|
+
} else {
|
|
93
|
+
t4 = $[13];
|
|
57
94
|
}
|
|
58
|
-
const t4 = language ?? "text";
|
|
59
95
|
let t5;
|
|
60
|
-
if ($[
|
|
61
|
-
t5 =
|
|
96
|
+
if ($[14] !== highlight || $[15] !== lined || $[16] !== start) {
|
|
97
|
+
t5 = lined ? {
|
|
98
|
+
start,
|
|
99
|
+
marked: highlight
|
|
100
|
+
} : undefined;
|
|
101
|
+
$[14] = highlight;
|
|
102
|
+
$[15] = lined;
|
|
103
|
+
$[16] = start;
|
|
104
|
+
$[17] = t5;
|
|
105
|
+
} else {
|
|
106
|
+
t5 = $[17];
|
|
107
|
+
}
|
|
108
|
+
let t6;
|
|
109
|
+
if ($[18] !== t3 || $[19] !== t4 || $[20] !== t5) {
|
|
110
|
+
t6 = /*#__PURE__*/_jsx(CodeBlock, {
|
|
62
111
|
code: t3,
|
|
63
|
-
lang: t4
|
|
112
|
+
lang: t4,
|
|
113
|
+
lines: t5
|
|
64
114
|
});
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
115
|
+
$[18] = t3;
|
|
116
|
+
$[19] = t4;
|
|
117
|
+
$[20] = t5;
|
|
118
|
+
$[21] = t6;
|
|
68
119
|
} else {
|
|
69
|
-
|
|
120
|
+
t6 = $[21];
|
|
70
121
|
}
|
|
71
|
-
let
|
|
72
|
-
if ($[
|
|
73
|
-
|
|
122
|
+
let t7;
|
|
123
|
+
if ($[22] !== t2 || $[23] !== t6) {
|
|
124
|
+
t7 = /*#__PURE__*/_jsx(CodeStreamingContext.Provider, {
|
|
74
125
|
value: t2,
|
|
75
|
-
children:
|
|
126
|
+
children: t6
|
|
76
127
|
});
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
128
|
+
$[22] = t2;
|
|
129
|
+
$[23] = t6;
|
|
130
|
+
$[24] = t7;
|
|
80
131
|
} else {
|
|
81
|
-
|
|
132
|
+
t7 = $[24];
|
|
82
133
|
}
|
|
83
|
-
let
|
|
84
|
-
if ($[
|
|
85
|
-
|
|
134
|
+
let t8;
|
|
135
|
+
if ($[25] !== t1 || $[26] !== t7) {
|
|
136
|
+
t8 = /*#__PURE__*/_jsxs("div", {
|
|
86
137
|
className: "chat-ui-code chat-ui-flat flex flex-col rounded-xl bg-ui-tile p-1.5",
|
|
87
|
-
children: [t1,
|
|
138
|
+
children: [t1, t7]
|
|
88
139
|
});
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
140
|
+
$[25] = t1;
|
|
141
|
+
$[26] = t7;
|
|
142
|
+
$[27] = t8;
|
|
92
143
|
} else {
|
|
93
|
-
|
|
144
|
+
t8 = $[27];
|
|
94
145
|
}
|
|
95
|
-
return
|
|
146
|
+
return t8;
|
|
96
147
|
}
|
|
97
148
|
// Set by a Gallery, so the images inside it draw as cells of its grid.
|
|
98
149
|
const GalleryContext = createContext(false);
|