@adecore/agents-react 0.46.3 → 0.48.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.
Files changed (105) hide show
  1. package/dist/agents/accounts.d.ts +9 -1
  2. package/dist/agents/accounts.js +31 -7
  3. package/dist/chat/account-choice.d.ts +5 -4
  4. package/dist/chat/account-choice.js +47 -39
  5. package/dist/chat/index.d.ts +1 -0
  6. package/dist/chat/index.js +1 -0
  7. package/dist/chat/logic/scrubber.js +12 -0
  8. package/dist/chat/logic/timeline-copy.js +2 -0
  9. package/dist/chat/logic/timeline.d.ts +6 -1
  10. package/dist/chat/logic/timeline.js +36 -10
  11. package/dist/chat/preferences.d.ts +2 -2
  12. package/dist/chat/preferences.js +11 -5
  13. package/dist/chat/ui/AccountPill.js +9 -6
  14. package/dist/chat/ui/ChatActivity.d.ts +2 -1
  15. package/dist/chat/ui/ChatActivity.js +295 -61
  16. package/dist/chat/ui/Composer.d.ts +2 -1
  17. package/dist/chat/ui/Composer.js +492 -486
  18. package/dist/chat/ui/LimitState.js +180 -172
  19. package/dist/chat/ui/PromptEditor.js +4 -1
  20. package/dist/chat/ui/ReferenceChip.d.ts +2 -1
  21. package/dist/chat/ui/ReferenceChip.js +135 -100
  22. package/dist/chat/ui/UnifiedDiff.js +22 -19
  23. package/dist/chat/ui/composer/ComposerControls.js +1 -1
  24. package/dist/chat/ui/composer/ComposerMenu.js +17 -11
  25. package/dist/chat/ui/composer/chips.d.ts +3 -0
  26. package/dist/chat/ui/composer/chips.js +14 -10
  27. package/dist/chat/ui/composer/use-chat-controls.js +70 -67
  28. package/dist/chat/ui/diff/EditorEditDiff.d.ts +3 -1
  29. package/dist/chat/ui/diff/EditorEditDiff.js +24 -18
  30. package/dist/chat/ui/diff/EditorPatchDiff.d.ts +3 -1
  31. package/dist/chat/ui/diff/EditorPatchDiff.js +4 -2
  32. package/dist/chat/ui/diff/diff-props.d.ts +2 -0
  33. package/dist/chat/ui/reference-icons.d.ts +3 -0
  34. package/dist/chat/ui/reference-icons.js +15 -2
  35. package/dist/chat/ui/rows/MessageRows.d.ts +6 -1
  36. package/dist/chat/ui/rows/MessageRows.js +166 -10
  37. package/dist/chat/ui/rows/RowContainer.js +21 -22
  38. package/dist/chat/ui/rows/Rows.js +37 -19
  39. package/dist/chat/ui/rows/WorkflowRow.d.ts +2 -1
  40. package/dist/chat/ui/rows/WorkflowRow.js +197 -191
  41. package/dist/chat/ui/rows/row-rhythm.d.ts +1 -0
  42. package/dist/chat/ui/rows/row-rhythm.js +12 -3
  43. package/dist/chat/workflow-list.d.ts +12 -0
  44. package/dist/chat/workflow-list.js +54 -0
  45. package/dist/host-hooks.d.ts +3 -0
  46. package/dist/host-hooks.js +8 -0
  47. package/dist/host.d.ts +11 -1
  48. package/dist/index.d.ts +1 -1
  49. package/dist/locales/en/agent-chat.d.ts +9 -0
  50. package/dist/locales/en/agent-chat.js +9 -0
  51. package/dist/locales/en/agent-providers.d.ts +5 -0
  52. package/dist/locales/en/agent-providers.js +8 -3
  53. package/dist/locales/nl/agent-chat.d.ts +9 -0
  54. package/dist/locales/nl/agent-chat.js +9 -0
  55. package/dist/locales/nl/agent-providers.d.ts +5 -0
  56. package/dist/locales/nl/agent-providers.js +8 -3
  57. package/dist/providers/AccountOrderList.d.ts +10 -0
  58. package/dist/providers/AccountOrderList.js +158 -0
  59. package/dist/providers/CliDetail.js +55 -61
  60. package/dist/providers/account-actions.d.ts +1 -0
  61. package/dist/providers/account-actions.js +39 -0
  62. package/dist/providers/index.d.ts +1 -1
  63. package/dist/providers/index.js +1 -1
  64. package/dist/usage/limit-groups.js +6 -1
  65. package/package.json +8 -8
  66. package/src/agents/accounts.ts +42 -6
  67. package/src/chat/account-choice.ts +31 -10
  68. package/src/chat/index.ts +1 -0
  69. package/src/chat/logic/scrubber.ts +5 -0
  70. package/src/chat/logic/timeline-copy.ts +2 -0
  71. package/src/chat/logic/timeline.ts +33 -2
  72. package/src/chat/preferences.ts +33 -8
  73. package/src/chat/ui/AccountPill.tsx +3 -3
  74. package/src/chat/ui/ChatActivity.tsx +52 -6
  75. package/src/chat/ui/Composer.tsx +19 -3
  76. package/src/chat/ui/LimitState.tsx +4 -2
  77. package/src/chat/ui/PromptEditor.tsx +3 -1
  78. package/src/chat/ui/ReferenceChip.tsx +15 -5
  79. package/src/chat/ui/UnifiedDiff.tsx +12 -1
  80. package/src/chat/ui/composer/ComposerControls.tsx +1 -1
  81. package/src/chat/ui/composer/ComposerMenu.tsx +4 -2
  82. package/src/chat/ui/composer/chips.ts +15 -9
  83. package/src/chat/ui/composer/use-chat-controls.ts +4 -1
  84. package/src/chat/ui/diff/EditorEditDiff.tsx +9 -4
  85. package/src/chat/ui/diff/EditorPatchDiff.tsx +5 -1
  86. package/src/chat/ui/diff/diff-props.ts +3 -0
  87. package/src/chat/ui/reference-icons.ts +13 -1
  88. package/src/chat/ui/rows/MessageRows.tsx +35 -0
  89. package/src/chat/ui/rows/RowContainer.tsx +2 -2
  90. package/src/chat/ui/rows/Rows.tsx +3 -0
  91. package/src/chat/ui/rows/WorkflowRow.tsx +9 -4
  92. package/src/chat/ui/rows/row-rhythm.ts +12 -3
  93. package/src/chat/workflow-list.ts +65 -0
  94. package/src/host-hooks.ts +13 -0
  95. package/src/host.ts +23 -1
  96. package/src/index.ts +1 -0
  97. package/src/locales/en/agent-chat.ts +9 -0
  98. package/src/locales/en/agent-providers.ts +8 -3
  99. package/src/locales/nl/agent-chat.ts +9 -0
  100. package/src/locales/nl/agent-providers.ts +8 -3
  101. package/src/providers/AccountOrderList.tsx +124 -0
  102. package/src/providers/CliDetail.tsx +33 -28
  103. package/src/providers/account-actions.ts +30 -0
  104. package/src/providers/index.ts +11 -1
  105. package/src/usage/limit-groups.ts +8 -1
@@ -2,6 +2,7 @@ import { c as _c } from "react/compiler-runtime";
2
2
  import { useRef, useState } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useChatHost } from '../../../host.js';
5
+ import { useHostCanReorderAccounts } from '../../../host-hooks.js';
5
6
  import { useChatScope } from '../../../scope.js';
6
7
  import { errorCode } from '../../../transport.js';
7
8
  import { useChatActions } from '../../actions.js';
@@ -9,7 +10,7 @@ import { rememberChatAccount, rememberChatSelection } from '../../preferences.js
9
10
  import { composerStopOf } from '../../subagent-list.js';
10
11
  /* What the composer does to the chat rather than to its draft: its settings, a stop, a clear and a compaction. */
11
12
  export function useChatControls(t0) {
12
- const $ = _c(50);
13
+ const $ = _c(51);
13
14
  const {
14
15
  chatId,
15
16
  info,
@@ -25,6 +26,7 @@ export function useChatControls(t0) {
25
26
  } = useTranslation("agent-chat");
26
27
  const host = useChatHost();
27
28
  const scope = useChatScope();
29
+ const ordered = useHostCanReorderAccounts(scope.id);
28
30
  const actions = useChatActions();
29
31
  const configuring = useRef(false);
30
32
  const [configurationPending, setConfigurationPending] = useState(false);
@@ -50,13 +52,13 @@ export function useChatControls(t0) {
50
52
  }
51
53
  const runConfiguration = t2;
52
54
  let t3;
53
- if ($[2] !== actions || $[3] !== chatId || $[4] !== info || $[5] !== runConfiguration || $[6] !== scope) {
55
+ if ($[2] !== actions || $[3] !== chatId || $[4] !== info || $[5] !== ordered || $[6] !== runConfiguration || $[7] !== scope.id) {
54
56
  t3 = patch => {
55
57
  runConfiguration(() => actions.configure(chatId, patch).then(() => {
56
58
  if (patch.selection) {
57
59
  rememberChatSelection(info.provider, patch.selection);
58
60
  }
59
- if (patch.account) {
61
+ if (patch.account && !ordered) {
60
62
  rememberChatAccount(scope.id, info.provider, patch.account);
61
63
  }
62
64
  }));
@@ -64,15 +66,16 @@ export function useChatControls(t0) {
64
66
  $[2] = actions;
65
67
  $[3] = chatId;
66
68
  $[4] = info;
67
- $[5] = runConfiguration;
68
- $[6] = scope;
69
- $[7] = t3;
69
+ $[5] = ordered;
70
+ $[6] = runConfiguration;
71
+ $[7] = scope.id;
72
+ $[8] = t3;
70
73
  } else {
71
- t3 = $[7];
74
+ t3 = $[8];
72
75
  }
73
76
  const configure = t3;
74
77
  let t4;
75
- if ($[8] !== configure || $[9] !== info || $[10] !== onRetarget || $[11] !== runConfiguration) {
78
+ if ($[9] !== configure || $[10] !== info || $[11] !== onRetarget || $[12] !== runConfiguration) {
76
79
  t4 = (provider, slug) => {
77
80
  const selection = {
78
81
  model: slug,
@@ -86,17 +89,17 @@ export function useChatControls(t0) {
86
89
  selection
87
90
  });
88
91
  };
89
- $[8] = configure;
90
- $[9] = info;
91
- $[10] = onRetarget;
92
- $[11] = runConfiguration;
93
- $[12] = t4;
92
+ $[9] = configure;
93
+ $[10] = info;
94
+ $[11] = onRetarget;
95
+ $[12] = runConfiguration;
96
+ $[13] = t4;
94
97
  } else {
95
- t4 = $[12];
98
+ t4 = $[13];
96
99
  }
97
100
  const chooseModel = t4;
98
101
  let t5;
99
- if ($[13] !== actions || $[14] !== chatId || $[15] !== host || $[16] !== scope || $[17] !== showError) {
102
+ if ($[14] !== actions || $[15] !== chatId || $[16] !== host || $[17] !== scope.id || $[18] !== showError) {
100
103
  t5 = shiftKey => {
101
104
  if (composerStopOf(shiftKey) === "turn") {
102
105
  actions.stopTurn(chatId, false).catch(showError);
@@ -104,18 +107,18 @@ export function useChatControls(t0) {
104
107
  }
105
108
  host.confirm.stopSubagents(scope.id, chatId, () => void actions.stopTurn(chatId, true).catch(showError));
106
109
  };
107
- $[13] = actions;
108
- $[14] = chatId;
109
- $[15] = host;
110
- $[16] = scope;
111
- $[17] = showError;
112
- $[18] = t5;
110
+ $[14] = actions;
111
+ $[15] = chatId;
112
+ $[16] = host;
113
+ $[17] = scope.id;
114
+ $[18] = showError;
115
+ $[19] = t5;
113
116
  } else {
114
- t5 = $[18];
117
+ t5 = $[19];
115
118
  }
116
119
  const stop = t5;
117
120
  let t6;
118
- if ($[19] !== actions || $[20] !== chatId || $[21] !== setNotice || $[22] !== t) {
121
+ if ($[20] !== actions || $[21] !== chatId || $[22] !== setNotice || $[23] !== t) {
119
122
  t6 = async () => {
120
123
  ;
121
124
  try {
@@ -129,44 +132,44 @@ export function useChatControls(t0) {
129
132
  setNotice(t("composer.notice.clearFailed"));
130
133
  }
131
134
  };
132
- $[19] = actions;
133
- $[20] = chatId;
134
- $[21] = setNotice;
135
- $[22] = t;
136
- $[23] = t6;
135
+ $[20] = actions;
136
+ $[21] = chatId;
137
+ $[22] = setNotice;
138
+ $[23] = t;
139
+ $[24] = t6;
137
140
  } else {
138
- t6 = $[23];
141
+ t6 = $[24];
139
142
  }
140
143
  const clearThread = t6;
141
144
  let t7;
142
- if ($[24] !== actions || $[25] !== chatId) {
145
+ if ($[25] !== actions || $[26] !== chatId) {
143
146
  t7 = async () => {
144
147
  await actions.clear(chatId, true);
145
148
  setConfirmClear(false);
146
149
  };
147
- $[24] = actions;
148
- $[25] = chatId;
149
- $[26] = t7;
150
+ $[25] = actions;
151
+ $[26] = chatId;
152
+ $[27] = t7;
150
153
  } else {
151
- t7 = $[26];
154
+ t7 = $[27];
152
155
  }
153
156
  const forceClearThread = t7;
154
157
  let t8;
155
- if ($[27] !== actions || $[28] !== chatId || $[29] !== setNotice || $[30] !== t) {
158
+ if ($[28] !== actions || $[29] !== chatId || $[30] !== setNotice || $[31] !== t) {
156
159
  t8 = () => {
157
160
  actions.compact(chatId).catch(() => setNotice(t("composer.notice.compactFailed")));
158
161
  };
159
- $[27] = actions;
160
- $[28] = chatId;
161
- $[29] = setNotice;
162
- $[30] = t;
163
- $[31] = t8;
162
+ $[28] = actions;
163
+ $[29] = chatId;
164
+ $[30] = setNotice;
165
+ $[31] = t;
166
+ $[32] = t8;
164
167
  } else {
165
- t8 = $[31];
168
+ t8 = $[32];
166
169
  }
167
170
  const compact = t8;
168
171
  let t9;
169
- if ($[32] !== actions || $[33] !== chatId || $[34] !== clearThread) {
172
+ if ($[33] !== actions || $[34] !== chatId || $[35] !== clearThread) {
170
173
  t9 = name => {
171
174
  switch (name) {
172
175
  case "model":
@@ -190,33 +193,33 @@ export function useChatControls(t0) {
190
193
  }
191
194
  }
192
195
  };
193
- $[32] = actions;
194
- $[33] = chatId;
195
- $[34] = clearThread;
196
- $[35] = t9;
196
+ $[33] = actions;
197
+ $[34] = chatId;
198
+ $[35] = clearThread;
199
+ $[36] = t9;
197
200
  } else {
198
- t9 = $[35];
201
+ t9 = $[36];
199
202
  }
200
203
  const runCommand = t9;
201
204
  let t10;
202
- if ($[36] !== configure) {
205
+ if ($[37] !== configure) {
203
206
  t10 = account => configure({
204
207
  account
205
208
  });
206
- $[36] = configure;
207
- $[37] = t10;
209
+ $[37] = configure;
210
+ $[38] = t10;
208
211
  } else {
209
- t10 = $[37];
212
+ t10 = $[38];
210
213
  }
211
214
  let t11;
212
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
215
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
213
216
  t11 = () => setConfirmClear(false);
214
- $[38] = t11;
217
+ $[39] = t11;
215
218
  } else {
216
- t11 = $[38];
219
+ t11 = $[39];
217
220
  }
218
221
  let t12;
219
- if ($[39] !== chooseModel || $[40] !== compact || $[41] !== configurationPending || $[42] !== configure || $[43] !== confirmClear || $[44] !== forceClearThread || $[45] !== modelPickerOpen || $[46] !== runCommand || $[47] !== stop || $[48] !== t10) {
222
+ if ($[40] !== chooseModel || $[41] !== compact || $[42] !== configurationPending || $[43] !== configure || $[44] !== confirmClear || $[45] !== forceClearThread || $[46] !== modelPickerOpen || $[47] !== runCommand || $[48] !== stop || $[49] !== t10) {
220
223
  t12 = {
221
224
  configurationPending,
222
225
  configure,
@@ -231,19 +234,19 @@ export function useChatControls(t0) {
231
234
  cancelClear: t11,
232
235
  forceClearThread
233
236
  };
234
- $[39] = chooseModel;
235
- $[40] = compact;
236
- $[41] = configurationPending;
237
- $[42] = configure;
238
- $[43] = confirmClear;
239
- $[44] = forceClearThread;
240
- $[45] = modelPickerOpen;
241
- $[46] = runCommand;
242
- $[47] = stop;
243
- $[48] = t10;
244
- $[49] = t12;
237
+ $[40] = chooseModel;
238
+ $[41] = compact;
239
+ $[42] = configurationPending;
240
+ $[43] = configure;
241
+ $[44] = confirmClear;
242
+ $[45] = forceClearThread;
243
+ $[46] = modelPickerOpen;
244
+ $[47] = runCommand;
245
+ $[48] = stop;
246
+ $[49] = t10;
247
+ $[50] = t12;
245
248
  } else {
246
- t12 = $[49];
249
+ t12 = $[50];
247
250
  }
248
251
  return t12;
249
252
  }
@@ -1,9 +1,10 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { EditorEngine } from '@adecore/editor';
3
+ import { type DiffSource } from '@adecore/editor-react';
3
4
  import { type DiffDocument } from '@adecore/merge';
4
5
  import type { FileChange } from '../../logic/tools.js';
5
6
  type EngineLoader = () => Promise<EditorEngine>;
6
- export declare function EditorDocumentDiff({ document, path, loadEngine, fallback, wrap, fill, layout, maxHeight }: {
7
+ export declare function EditorDocumentDiff({ document, path, loadEngine, fallback, wrap, fill, layout, maxHeight, onSource }: {
7
8
  document: DiffDocument;
8
9
  path: string;
9
10
  loadEngine: EngineLoader;
@@ -12,6 +13,7 @@ export declare function EditorDocumentDiff({ document, path, loadEngine, fallbac
12
13
  fill?: boolean;
13
14
  layout?: 'unified' | 'split';
14
15
  maxHeight?: number;
16
+ onSource?(source: DiffSource): void | (() => void);
15
17
  }): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
16
18
  export default function EditorEditDiff({ change, loadEngine, fallback, maxHeight, sourceChecked }: {
17
19
  change: FileChange;
@@ -14,7 +14,7 @@ import { useHostCodeMode, useHostCodeThemes } from '../../../host-hooks.js';
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  const engines = new WeakMap();
16
16
  function ReadyDiff(t0) {
17
- const $ = _c(15);
17
+ const $ = _c(16);
18
18
  const {
19
19
  document,
20
20
  path,
@@ -22,7 +22,8 @@ function ReadyDiff(t0) {
22
22
  wrap,
23
23
  fill,
24
24
  layout,
25
- maxHeight
25
+ maxHeight,
26
+ onSource
26
27
  } = t0;
27
28
  useReviewSettled();
28
29
  const {
@@ -52,7 +53,7 @@ function ReadyDiff(t0) {
52
53
  t2 = $[4];
53
54
  }
54
55
  let t3;
55
- if ($[5] !== document || $[6] !== engine || $[7] !== fill || $[8] !== layout || $[9] !== maxHeight || $[10] !== t2 || $[11] !== theme || $[12] !== tokens || $[13] !== wrap) {
56
+ if ($[5] !== document || $[6] !== engine || $[7] !== fill || $[8] !== layout || $[9] !== maxHeight || $[10] !== onSource || $[11] !== t2 || $[12] !== theme || $[13] !== tokens || $[14] !== wrap) {
56
57
  t3 = /*#__PURE__*/_jsx(DiffView, {
57
58
  engine: engine,
58
59
  document: document,
@@ -64,25 +65,27 @@ function ReadyDiff(t0) {
64
65
  layout: layout,
65
66
  wrap: wrap,
66
67
  fill: fill,
67
- className: "chat-diff select-text"
68
+ className: "chat-diff select-text",
69
+ onSource: onSource
68
70
  });
69
71
  $[5] = document;
70
72
  $[6] = engine;
71
73
  $[7] = fill;
72
74
  $[8] = layout;
73
75
  $[9] = maxHeight;
74
- $[10] = t2;
75
- $[11] = theme;
76
- $[12] = tokens;
77
- $[13] = wrap;
78
- $[14] = t3;
76
+ $[10] = onSource;
77
+ $[11] = t2;
78
+ $[12] = theme;
79
+ $[13] = tokens;
80
+ $[14] = wrap;
81
+ $[15] = t3;
79
82
  } else {
80
- t3 = $[14];
83
+ t3 = $[15];
81
84
  }
82
85
  return t3;
83
86
  }
84
87
  export function EditorDocumentDiff(t0) {
85
- const $ = _c(24);
88
+ const $ = _c(25);
86
89
  const {
87
90
  document,
88
91
  path,
@@ -91,7 +94,8 @@ export function EditorDocumentDiff(t0) {
91
94
  wrap: t1,
92
95
  fill: t2,
93
96
  layout: t3,
94
- maxHeight: t4
97
+ maxHeight: t4,
98
+ onSource
95
99
  } = t0;
96
100
  const wrap = t1 === undefined ? true : t1;
97
101
  const fill = t2 === undefined ? false : t2;
@@ -195,7 +199,7 @@ export function EditorDocumentDiff(t0) {
195
199
  return t10;
196
200
  }
197
201
  let t9;
198
- if ($[15] !== document || $[16] !== engine_0 || $[17] !== fallback || $[18] !== fill || $[19] !== layout || $[20] !== maxHeight || $[21] !== path || $[22] !== wrap) {
202
+ if ($[15] !== document || $[16] !== engine_0 || $[17] !== fallback || $[18] !== fill || $[19] !== layout || $[20] !== maxHeight || $[21] !== onSource || $[22] !== path || $[23] !== wrap) {
199
203
  t9 = engine_0 === null ? fallback : /*#__PURE__*/_jsx(ReadyDiff, {
200
204
  document: document,
201
205
  path: path,
@@ -203,7 +207,8 @@ export function EditorDocumentDiff(t0) {
203
207
  wrap: wrap,
204
208
  fill: fill,
205
209
  layout: layout,
206
- maxHeight: maxHeight
210
+ maxHeight: maxHeight,
211
+ onSource: onSource
207
212
  });
208
213
  $[15] = document;
209
214
  $[16] = engine_0;
@@ -211,11 +216,12 @@ export function EditorDocumentDiff(t0) {
211
216
  $[18] = fill;
212
217
  $[19] = layout;
213
218
  $[20] = maxHeight;
214
- $[21] = path;
215
- $[22] = wrap;
216
- $[23] = t9;
219
+ $[21] = onSource;
220
+ $[22] = path;
221
+ $[23] = wrap;
222
+ $[24] = t9;
217
223
  } else {
218
- t9 = $[23];
224
+ t9 = $[24];
219
225
  }
220
226
  return t9;
221
227
  }
@@ -1,8 +1,9 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { ChatFileChange } from '@adecore/agent-contracts';
3
3
  import type { EditorEngine } from '@adecore/editor';
4
+ import type { DiffSource } from '@adecore/editor-react';
4
5
  import type { DiffContents } from '../full-diff.js';
5
- export default function EditorPatchDiff({ change, sourceChecked, contents, ignoreWhitespace, wrap, fill, maxHeight, layout, loadEngine, fallback }: {
6
+ export default function EditorPatchDiff({ change, sourceChecked, contents, ignoreWhitespace, wrap, fill, maxHeight, layout, loadEngine, fallback, onSource }: {
6
7
  change: ChatFileChange;
7
8
  sourceChecked?: boolean;
8
9
  contents?: DiffContents;
@@ -13,4 +14,5 @@ export default function EditorPatchDiff({ change, sourceChecked, contents, ignor
13
14
  maxHeight?: number;
14
15
  loadEngine: () => Promise<EditorEngine>;
15
16
  fallback: ReactNode;
17
+ onSource?(source: DiffSource): void | (() => void);
16
18
  }): import("react").JSX.Element;
@@ -14,7 +14,8 @@ export default function EditorPatchDiff({
14
14
  maxHeight,
15
15
  layout = 'unified',
16
16
  loadEngine,
17
- fallback
17
+ fallback,
18
+ onSource
18
19
  }) {
19
20
  const oldText = contents?.old;
20
21
  const newText = contents?.new;
@@ -40,6 +41,7 @@ export default function EditorPatchDiff({
40
41
  wrap: wrap,
41
42
  fill: fill,
42
43
  layout: layout,
43
- maxHeight: maxHeight
44
+ maxHeight: maxHeight,
45
+ onSource: onSource
44
46
  });
45
47
  }
@@ -1,4 +1,5 @@
1
1
  import type { ChatFileChange } from '@adecore/agent-contracts';
2
+ import type { DiffSource } from '@adecore/editor-react';
2
3
  import type { DiffContents } from '../full-diff.js';
3
4
  export interface UnifiedDiffProps {
4
5
  allowEditor?: boolean;
@@ -9,4 +10,5 @@ export interface UnifiedDiffProps {
9
10
  diffStyle?: 'unified' | 'split';
10
11
  fill?: boolean;
11
12
  contents?: DiffContents;
13
+ onSource?(source: DiffSource): void | (() => void);
12
14
  }
@@ -1,3 +1,6 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
1
2
  import { type LucideIcon } from 'lucide-react';
3
+ import type { ReferenceIconProps } from '../../host.js';
2
4
  import type { ReferableKind } from '../chat-references.js';
3
5
  export declare const REFERENCE_ICONS: Record<ReferableKind, LucideIcon>;
6
+ export declare function referenceGlyph(HostIcon: ComponentType<ReferenceIconProps> | null | undefined, props: ReferenceIconProps): ReactNode;
@@ -1,5 +1,7 @@
1
+ import { createElement } from 'react';
1
2
  import { Database, FileText, Frame, Globe, MessageSquare, PenTool, Smartphone, StickyNote, Terminal, Type, Workflow } from 'lucide-react';
2
- /* The mark of what a `#` points at, in the picker and on its chip. */
3
+ import { Icon } from '@adecore/ui';
4
+ /* The mark of what a `#` points at, in the picker and on its chip, when the host draws none of its own. */
3
5
  export const REFERENCE_ICONS = {
4
6
  canvas: Frame,
5
7
  chat: MessageSquare,
@@ -12,4 +14,15 @@ export const REFERENCE_ICONS = {
12
14
  device: Smartphone,
13
15
  file: FileText,
14
16
  database: Database
15
- };
17
+ };
18
+ /* The host's mark of a reference, or the mark of its kind. */
19
+ export function referenceGlyph(HostIcon, props) {
20
+ if (HostIcon) {
21
+ return createElement(HostIcon, props);
22
+ }
23
+ return createElement(Icon, {
24
+ icon: REFERENCE_ICONS[props.kind],
25
+ size: props.size,
26
+ className: props.className
27
+ });
28
+ }
@@ -1,8 +1,13 @@
1
- import type { ChatApprovalItem, ChatAssistantItem, ChatQuestionItem, ChatThinkingItem, ChatUserItem } from '@adecore/agent-contracts';
1
+ import type { ChatApprovalItem, ChatAssistantItem, ChatNoteMessage, ChatQuestionItem, ChatThinkingItem, ChatUserItem } from '@adecore/agent-contracts';
2
2
  export declare function UserRow({ chatId, item }: {
3
3
  chatId: string;
4
4
  item: ChatUserItem;
5
5
  }): import("react").JSX.Element;
6
+ export declare function SentMessageRow({ chatId, id, message }: {
7
+ chatId: string;
8
+ id: string;
9
+ message: ChatNoteMessage;
10
+ }): import("react").JSX.Element;
6
11
  export declare function ReportRow({ id, text }: {
7
12
  id: string;
8
13
  text: string;