@adecore/agents-react 0.67.1 → 0.69.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/agents/AgentIcon.d.ts +7 -0
- package/dist/agents/AgentIcon.js +70 -31
- package/dist/chat/logic/timeline.d.ts +2 -0
- package/dist/chat/logic/timeline.js +47 -0
- package/dist/chat/subagent-list.d.ts +1 -2
- package/dist/chat/ui/Composer.js +491 -447
- package/dist/chat/ui/Markdown.d.ts +1 -1
- package/dist/chat/ui/Markdown.js +277 -203
- package/dist/chat/ui/PromptEditor.d.ts +3 -1
- package/dist/chat/ui/PromptEditor.js +4 -1
- package/dist/chat/ui/Timeline.js +5 -4
- package/dist/chat/ui/composer/ComposerMenu.js +22 -12
- package/dist/chat/ui/composer/chips.d.ts +2 -1
- package/dist/chat/ui/composer/chips.js +44 -1
- package/dist/chat/ui/composer/key-handler.d.ts +2 -0
- package/dist/chat/ui/composer/key-handler.js +12 -2
- package/dist/chat/ui/composer/placeholder.d.ts +2 -1
- package/dist/chat/ui/composer/placeholder.js +31 -10
- package/dist/chat/ui/composer/use-composer-menus.js +49 -39
- package/dist/chat/ui/composer/use-prompt-menus.d.ts +10 -7
- package/dist/chat/ui/composer/use-prompt-menus.js +183 -157
- package/dist/chat/ui/composer/use-prompt-suggestion.d.ts +16 -0
- package/dist/chat/ui/composer/use-prompt-suggestion.js +55 -0
- package/dist/chat/ui/index.d.ts +1 -1
- package/dist/chat/ui/index.js +1 -1
- package/dist/chat/ui/markdown-cache.d.ts +4 -0
- package/dist/chat/ui/markdown-cache.js +47 -0
- package/dist/chat/ui/reference-lookup.d.ts +2 -1
- package/dist/chat/ui/reference-lookup.js +1 -1
- package/dist/chat/ui/rows/SubagentRow.js +26 -24
- package/dist/chat/ui/rows/TaskRow.d.ts +11 -1
- package/dist/chat/ui/rows/TaskRow.js +281 -197
- package/dist/chat/ui/thread-references.js +12 -9
- package/dist/chat-client.d.ts +3 -1
- package/dist/chat-client.js +82 -30
- package/dist/chat-sink.d.ts +1 -0
- package/dist/host/host-hooks.d.ts +4 -1
- package/dist/host/host-hooks.js +11 -0
- package/dist/host/host.d.ts +18 -0
- package/dist/index.d.ts +1 -1
- package/dist/locales/en/agent-chat.d.ts +1 -0
- package/dist/locales/en/agent-chat.js +2 -1
- package/dist/locales/nl/agent-chat.d.ts +1 -0
- package/dist/locales/nl/agent-chat.js +2 -1
- package/dist/state/chats.d.ts +2 -0
- package/dist/state/chats.js +21 -5
- package/dist/theme.css +6 -0
- package/package.json +9 -9
- package/src/agents/AgentIcon.tsx +6 -2
- package/src/chat/logic/timeline.ts +63 -0
- package/src/chat/subagent-list.ts +1 -4
- package/src/chat/ui/Composer.tsx +15 -2
- package/src/chat/ui/Markdown.tsx +97 -55
- package/src/chat/ui/PromptEditor.tsx +7 -2
- package/src/chat/ui/Timeline.tsx +17 -14
- package/src/chat/ui/composer/ComposerMenu.tsx +14 -6
- package/src/chat/ui/composer/chips.ts +51 -2
- package/src/chat/ui/composer/key-handler.ts +17 -2
- package/src/chat/ui/composer/placeholder.ts +14 -3
- package/src/chat/ui/composer/use-composer-menus.ts +8 -3
- package/src/chat/ui/composer/use-prompt-menus.ts +33 -4
- package/src/chat/ui/composer/use-prompt-suggestion.ts +36 -0
- package/src/chat/ui/index.ts +1 -1
- package/src/chat/ui/markdown-cache.ts +60 -0
- package/src/chat/ui/reference-lookup.ts +4 -2
- package/src/chat/ui/rows/SubagentRow.tsx +1 -1
- package/src/chat/ui/rows/TaskRow.tsx +54 -9
- package/src/chat/ui/thread-references.ts +4 -2
- package/src/chat-client.ts +79 -22
- package/src/chat-sink.ts +6 -1
- package/src/host/host-hooks.ts +19 -1
- package/src/host/host.ts +41 -0
- package/src/index.ts +3 -0
- package/src/locales/en/agent-chat.ts +2 -1
- package/src/locales/nl/agent-chat.ts +2 -1
- package/src/state/chats.ts +22 -6
- package/src/theme.css +6 -0
|
@@ -6,6 +6,7 @@ import { Bot, ChevronRight } from 'lucide-react';
|
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { AgentIcon } from '../../../agents/AgentIcon.js';
|
|
8
8
|
import { modelName, shortModelName } from '../../../agents/model-name.js';
|
|
9
|
+
import { useHostTaskRow } from '../../../host/host-hooks.js';
|
|
9
10
|
import { useChatScope } from '../../../scope.js';
|
|
10
11
|
import { useChats } from '../../../state/chats.js';
|
|
11
12
|
import { useProviders } from '../../../state/providers.js';
|
|
@@ -56,10 +57,11 @@ function Elapsed(t0) {
|
|
|
56
57
|
return t2;
|
|
57
58
|
}
|
|
58
59
|
function StateLine(t0) {
|
|
59
|
-
const $ = _c(
|
|
60
|
+
const $ = _c(11);
|
|
60
61
|
const {
|
|
61
62
|
state,
|
|
62
|
-
task
|
|
63
|
+
task,
|
|
64
|
+
line
|
|
63
65
|
} = t0;
|
|
64
66
|
const {
|
|
65
67
|
t
|
|
@@ -76,308 +78,390 @@ function StateLine(t0) {
|
|
|
76
78
|
t2 = $[1];
|
|
77
79
|
}
|
|
78
80
|
let t3;
|
|
79
|
-
if ($[2] !==
|
|
80
|
-
t3 = until === undefined ? t(`rows.task.${state}`) : t("rows.task.pausedUntil", {
|
|
81
|
+
if ($[2] !== line || $[3] !== now || $[4] !== state || $[5] !== t || $[6] !== until) {
|
|
82
|
+
t3 = line ?? (until === undefined ? t(`rows.task.${state}`) : t("rows.task.pausedUntil", {
|
|
81
83
|
time: formatMoment(until, now)
|
|
82
|
-
});
|
|
83
|
-
$[2] =
|
|
84
|
-
$[3] =
|
|
85
|
-
$[4] =
|
|
86
|
-
$[5] =
|
|
87
|
-
$[6] =
|
|
84
|
+
}));
|
|
85
|
+
$[2] = line;
|
|
86
|
+
$[3] = now;
|
|
87
|
+
$[4] = state;
|
|
88
|
+
$[5] = t;
|
|
89
|
+
$[6] = until;
|
|
90
|
+
$[7] = t3;
|
|
88
91
|
} else {
|
|
89
|
-
t3 = $[
|
|
92
|
+
t3 = $[7];
|
|
90
93
|
}
|
|
91
94
|
let t4;
|
|
92
|
-
if ($[
|
|
95
|
+
if ($[8] !== t2 || $[9] !== t3) {
|
|
93
96
|
t4 = /*#__PURE__*/_jsx("span", {
|
|
94
97
|
className: t2,
|
|
95
98
|
children: t3
|
|
96
99
|
});
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
+
$[8] = t2;
|
|
101
|
+
$[9] = t3;
|
|
102
|
+
$[10] = t4;
|
|
100
103
|
} else {
|
|
101
|
-
t4 = $[
|
|
104
|
+
t4 = $[10];
|
|
102
105
|
}
|
|
103
106
|
return t4;
|
|
104
107
|
}
|
|
108
|
+
function useTaskChild(item) {
|
|
109
|
+
const $ = _c(3);
|
|
110
|
+
const {
|
|
111
|
+
keyOf
|
|
112
|
+
} = useChatScope();
|
|
113
|
+
let t0;
|
|
114
|
+
if ($[0] !== item.childId || $[1] !== keyOf) {
|
|
115
|
+
t0 = s => item.childId === undefined ? undefined : s.statusByKey[keyOf(item.childId)]?.info;
|
|
116
|
+
$[0] = item.childId;
|
|
117
|
+
$[1] = keyOf;
|
|
118
|
+
$[2] = t0;
|
|
119
|
+
} else {
|
|
120
|
+
t0 = $[2];
|
|
121
|
+
}
|
|
122
|
+
return useChats(t0);
|
|
123
|
+
}
|
|
105
124
|
/*
|
|
106
125
|
* The row of a task given to another node: that agent's mark and model, what the task is about and
|
|
107
126
|
* where it stands, read from the status every client gets of the child's chat. A child without one,
|
|
108
|
-
* a terminal or a node that is gone, keeps the task's own words.
|
|
127
|
+
* a terminal or a node that is gone, keeps the task's own words. A host may draw the row itself
|
|
128
|
+
* (`useTaskRow`).
|
|
109
129
|
*/
|
|
110
130
|
export function TaskRow(t0) {
|
|
111
|
-
const $ = _c(
|
|
131
|
+
const $ = _c(17);
|
|
112
132
|
const {
|
|
133
|
+
chatId,
|
|
113
134
|
item,
|
|
114
135
|
task,
|
|
115
136
|
open,
|
|
116
137
|
onPress
|
|
117
138
|
} = t0;
|
|
118
139
|
const {
|
|
119
|
-
|
|
120
|
-
} = useTranslation("agent-chat");
|
|
121
|
-
const {
|
|
122
|
-
keyOf
|
|
140
|
+
id
|
|
123
141
|
} = useChatScope();
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
142
|
+
const t1 = useTaskChild(item);
|
|
143
|
+
let t2;
|
|
144
|
+
if ($[0] !== item || $[1] !== t1 || $[2] !== task) {
|
|
145
|
+
t2 = taskRowStateOf(item, task, t1);
|
|
146
|
+
$[0] = item;
|
|
147
|
+
$[1] = t1;
|
|
148
|
+
$[2] = task;
|
|
149
|
+
$[3] = t2;
|
|
130
150
|
} else {
|
|
131
|
-
|
|
151
|
+
t2 = $[3];
|
|
132
152
|
}
|
|
133
|
-
const
|
|
153
|
+
const state = t2;
|
|
154
|
+
let t3;
|
|
155
|
+
if ($[4] !== chatId || $[5] !== id || $[6] !== item || $[7] !== onPress || $[8] !== open || $[9] !== state || $[10] !== task) {
|
|
156
|
+
t3 = {
|
|
157
|
+
scopeId: id,
|
|
158
|
+
chatId,
|
|
159
|
+
item,
|
|
160
|
+
task,
|
|
161
|
+
state,
|
|
162
|
+
open,
|
|
163
|
+
onPress
|
|
164
|
+
};
|
|
165
|
+
$[4] = chatId;
|
|
166
|
+
$[5] = id;
|
|
167
|
+
$[6] = item;
|
|
168
|
+
$[7] = onPress;
|
|
169
|
+
$[8] = open;
|
|
170
|
+
$[9] = state;
|
|
171
|
+
$[10] = task;
|
|
172
|
+
$[11] = t3;
|
|
173
|
+
} else {
|
|
174
|
+
t3 = $[11];
|
|
175
|
+
}
|
|
176
|
+
const drawn = useHostTaskRow(t3);
|
|
177
|
+
if (drawn !== null && drawn !== undefined) {
|
|
178
|
+
return drawn;
|
|
179
|
+
}
|
|
180
|
+
let t4;
|
|
181
|
+
if ($[12] !== item || $[13] !== onPress || $[14] !== open || $[15] !== task) {
|
|
182
|
+
t4 = /*#__PURE__*/_jsx(TaskRowHead, {
|
|
183
|
+
item: item,
|
|
184
|
+
task: task,
|
|
185
|
+
open: open,
|
|
186
|
+
onPress: onPress
|
|
187
|
+
});
|
|
188
|
+
$[12] = item;
|
|
189
|
+
$[13] = onPress;
|
|
190
|
+
$[14] = open;
|
|
191
|
+
$[15] = task;
|
|
192
|
+
$[16] = t4;
|
|
193
|
+
} else {
|
|
194
|
+
t4 = $[16];
|
|
195
|
+
}
|
|
196
|
+
return t4;
|
|
197
|
+
}
|
|
198
|
+
/*
|
|
199
|
+
* The line of a task's row on its own: the agent's mark with its state, the task, its time and the
|
|
200
|
+
* way into its conversation. `line` takes the place of the words under the task, in the same tone,
|
|
201
|
+
* for a host that knows better what the agent does now.
|
|
202
|
+
*/
|
|
203
|
+
export function TaskRowHead(t0) {
|
|
204
|
+
const $ = _c(69);
|
|
205
|
+
const {
|
|
206
|
+
item,
|
|
207
|
+
task,
|
|
208
|
+
open,
|
|
209
|
+
onPress,
|
|
210
|
+
line
|
|
211
|
+
} = t0;
|
|
212
|
+
const {
|
|
213
|
+
t
|
|
214
|
+
} = useTranslation("agent-chat");
|
|
215
|
+
const child = useTaskChild(item);
|
|
134
216
|
const provider = child?.provider;
|
|
135
217
|
const slug = child?.model ?? child?.selection.model ?? null;
|
|
136
|
-
let
|
|
137
|
-
if ($[
|
|
138
|
-
|
|
218
|
+
let t1;
|
|
219
|
+
if ($[0] !== provider || $[1] !== slug) {
|
|
220
|
+
t1 = s => {
|
|
139
221
|
if (slug === null) {
|
|
140
222
|
return null;
|
|
141
223
|
}
|
|
142
|
-
const models =
|
|
224
|
+
const models = s.providers.find(entry => entry.kind === provider)?.models;
|
|
143
225
|
return shortModelName(modelName(slug, models), models);
|
|
144
226
|
};
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
227
|
+
$[0] = provider;
|
|
228
|
+
$[1] = slug;
|
|
229
|
+
$[2] = t1;
|
|
148
230
|
} else {
|
|
149
|
-
|
|
231
|
+
t1 = $[2];
|
|
150
232
|
}
|
|
151
|
-
const model = useProviders(
|
|
152
|
-
let
|
|
153
|
-
if ($[
|
|
154
|
-
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
233
|
+
const model = useProviders(t1);
|
|
234
|
+
let t2;
|
|
235
|
+
if ($[3] !== child || $[4] !== item || $[5] !== task) {
|
|
236
|
+
t2 = taskRowStateOf(item, task, child);
|
|
237
|
+
$[3] = child;
|
|
238
|
+
$[4] = item;
|
|
239
|
+
$[5] = task;
|
|
240
|
+
$[6] = t2;
|
|
159
241
|
} else {
|
|
160
|
-
|
|
242
|
+
t2 = $[6];
|
|
161
243
|
}
|
|
162
|
-
const state =
|
|
244
|
+
const state = t2;
|
|
163
245
|
let finishedAt;
|
|
164
246
|
let settled;
|
|
165
247
|
let startedAt;
|
|
166
|
-
let
|
|
248
|
+
let t3;
|
|
167
249
|
let t4;
|
|
168
250
|
let t5;
|
|
169
251
|
let t6;
|
|
170
252
|
let t7;
|
|
171
253
|
let t8;
|
|
172
254
|
let t9;
|
|
173
|
-
if ($[
|
|
255
|
+
if ($[7] !== item.description || $[8] !== item.finishedAt || $[9] !== item.startedAt || $[10] !== model || $[11] !== onPress || $[12] !== provider || $[13] !== state || $[14] !== t || $[15] !== task) {
|
|
174
256
|
const title = item.description || t("rows.subagent.task");
|
|
175
257
|
startedAt = task?.createdAt ?? item.startedAt;
|
|
176
258
|
finishedAt = task === null ? item.finishedAt : task.settledAt ?? item.finishedAt;
|
|
177
259
|
settled = state === "done" || state === "failed" || state === "cancelled";
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
let
|
|
181
|
-
if ($[
|
|
182
|
-
|
|
183
|
-
$[
|
|
260
|
+
t7 = "-mx-1 mb-0.5 flex w-[calc(100%+8px)] items-start gap-2 rounded-md px-1 py-1 text-left hover:bg-surface-hover";
|
|
261
|
+
t8 = onPress;
|
|
262
|
+
let t10;
|
|
263
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
264
|
+
t10 = clsx(ROW_GUTTER, "relative text-text");
|
|
265
|
+
$[26] = t10;
|
|
184
266
|
} else {
|
|
185
|
-
|
|
267
|
+
t10 = $[26];
|
|
186
268
|
}
|
|
187
|
-
let
|
|
188
|
-
if ($[
|
|
189
|
-
|
|
269
|
+
let t11;
|
|
270
|
+
if ($[27] !== provider) {
|
|
271
|
+
t11 = provider === undefined ? /*#__PURE__*/_jsx(Icon, {
|
|
190
272
|
icon: Bot,
|
|
191
273
|
size: 14
|
|
192
274
|
}) : /*#__PURE__*/_jsx(AgentIcon, {
|
|
193
275
|
kind: provider,
|
|
194
276
|
size: 14
|
|
195
277
|
});
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
278
|
+
$[27] = provider;
|
|
279
|
+
$[28] = t11;
|
|
198
280
|
} else {
|
|
199
|
-
|
|
281
|
+
t11 = $[28];
|
|
200
282
|
}
|
|
201
|
-
const
|
|
202
|
-
let
|
|
203
|
-
if ($[
|
|
204
|
-
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
283
|
+
const t12 = DOT[state];
|
|
284
|
+
let t13;
|
|
285
|
+
if ($[29] !== t12) {
|
|
286
|
+
t13 = clsx("absolute -right-0.75 bottom-0 size-2 rounded-full ring-2 ring-surface", t12);
|
|
287
|
+
$[29] = t12;
|
|
288
|
+
$[30] = t13;
|
|
207
289
|
} else {
|
|
208
|
-
|
|
290
|
+
t13 = $[30];
|
|
209
291
|
}
|
|
210
|
-
let
|
|
211
|
-
if ($[
|
|
212
|
-
|
|
213
|
-
className:
|
|
292
|
+
let t14;
|
|
293
|
+
if ($[31] !== t13) {
|
|
294
|
+
t14 = /*#__PURE__*/_jsx("span", {
|
|
295
|
+
className: t13
|
|
214
296
|
});
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
297
|
+
$[31] = t13;
|
|
298
|
+
$[32] = t14;
|
|
217
299
|
} else {
|
|
218
|
-
|
|
300
|
+
t14 = $[32];
|
|
219
301
|
}
|
|
220
|
-
if ($[
|
|
221
|
-
|
|
222
|
-
className:
|
|
223
|
-
children: [
|
|
302
|
+
if ($[33] !== t11 || $[34] !== t14) {
|
|
303
|
+
t9 = /*#__PURE__*/_jsxs("span", {
|
|
304
|
+
className: t10,
|
|
305
|
+
children: [t11, t14]
|
|
224
306
|
});
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
307
|
+
$[33] = t11;
|
|
308
|
+
$[34] = t14;
|
|
309
|
+
$[35] = t9;
|
|
228
310
|
} else {
|
|
229
|
-
|
|
311
|
+
t9 = $[35];
|
|
230
312
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
313
|
+
t6 = "flex min-w-0 grow flex-col";
|
|
314
|
+
t3 = "summary";
|
|
315
|
+
t4 = "truncate text-xs font-medium text-text";
|
|
316
|
+
t5 = model === null ? title : t("rows.task.named", {
|
|
235
317
|
model,
|
|
236
318
|
title
|
|
237
319
|
});
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
320
|
+
$[7] = item.description;
|
|
321
|
+
$[8] = item.finishedAt;
|
|
322
|
+
$[9] = item.startedAt;
|
|
323
|
+
$[10] = model;
|
|
324
|
+
$[11] = onPress;
|
|
325
|
+
$[12] = provider;
|
|
326
|
+
$[13] = state;
|
|
327
|
+
$[14] = t;
|
|
328
|
+
$[15] = task;
|
|
329
|
+
$[16] = finishedAt;
|
|
330
|
+
$[17] = settled;
|
|
331
|
+
$[18] = startedAt;
|
|
332
|
+
$[19] = t3;
|
|
333
|
+
$[20] = t4;
|
|
334
|
+
$[21] = t5;
|
|
335
|
+
$[22] = t6;
|
|
336
|
+
$[23] = t7;
|
|
337
|
+
$[24] = t8;
|
|
338
|
+
$[25] = t9;
|
|
257
339
|
} else {
|
|
258
|
-
finishedAt = $[
|
|
259
|
-
settled = $[
|
|
260
|
-
startedAt = $[
|
|
261
|
-
|
|
262
|
-
t4 = $[
|
|
263
|
-
t5 = $[
|
|
264
|
-
t6 = $[
|
|
265
|
-
t7 = $[
|
|
266
|
-
t8 = $[
|
|
267
|
-
t9 = $[
|
|
340
|
+
finishedAt = $[16];
|
|
341
|
+
settled = $[17];
|
|
342
|
+
startedAt = $[18];
|
|
343
|
+
t3 = $[19];
|
|
344
|
+
t4 = $[20];
|
|
345
|
+
t5 = $[21];
|
|
346
|
+
t6 = $[22];
|
|
347
|
+
t7 = $[23];
|
|
348
|
+
t8 = $[24];
|
|
349
|
+
t9 = $[25];
|
|
268
350
|
}
|
|
269
|
-
let
|
|
270
|
-
if ($[
|
|
271
|
-
|
|
272
|
-
"data-find-field":
|
|
273
|
-
className:
|
|
274
|
-
children:
|
|
351
|
+
let t10;
|
|
352
|
+
if ($[36] !== t3 || $[37] !== t4 || $[38] !== t5) {
|
|
353
|
+
t10 = /*#__PURE__*/_jsx("span", {
|
|
354
|
+
"data-find-field": t3,
|
|
355
|
+
className: t4,
|
|
356
|
+
children: t5
|
|
275
357
|
});
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
358
|
+
$[36] = t3;
|
|
359
|
+
$[37] = t4;
|
|
360
|
+
$[38] = t5;
|
|
361
|
+
$[39] = t10;
|
|
280
362
|
} else {
|
|
281
|
-
|
|
363
|
+
t10 = $[39];
|
|
282
364
|
}
|
|
283
|
-
let
|
|
284
|
-
if ($[
|
|
285
|
-
|
|
365
|
+
let t11;
|
|
366
|
+
if ($[40] !== line || $[41] !== state || $[42] !== task) {
|
|
367
|
+
t11 = /*#__PURE__*/_jsx(StateLine, {
|
|
286
368
|
state: state,
|
|
287
|
-
task: task
|
|
369
|
+
task: task,
|
|
370
|
+
line: line
|
|
288
371
|
});
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
372
|
+
$[40] = line;
|
|
373
|
+
$[41] = state;
|
|
374
|
+
$[42] = task;
|
|
375
|
+
$[43] = t11;
|
|
292
376
|
} else {
|
|
293
|
-
|
|
377
|
+
t11 = $[43];
|
|
294
378
|
}
|
|
295
|
-
let
|
|
296
|
-
if ($[
|
|
297
|
-
|
|
298
|
-
className:
|
|
299
|
-
children: [
|
|
379
|
+
let t12;
|
|
380
|
+
if ($[44] !== t10 || $[45] !== t11 || $[46] !== t6) {
|
|
381
|
+
t12 = /*#__PURE__*/_jsxs("span", {
|
|
382
|
+
className: t6,
|
|
383
|
+
children: [t10, t11]
|
|
300
384
|
});
|
|
301
|
-
$[
|
|
385
|
+
$[44] = t10;
|
|
386
|
+
$[45] = t11;
|
|
387
|
+
$[46] = t6;
|
|
302
388
|
$[47] = t12;
|
|
303
|
-
$[48] = t7;
|
|
304
|
-
$[49] = t13;
|
|
305
389
|
} else {
|
|
306
|
-
|
|
390
|
+
t12 = $[47];
|
|
307
391
|
}
|
|
308
|
-
let
|
|
309
|
-
if ($[
|
|
310
|
-
|
|
392
|
+
let t13;
|
|
393
|
+
if ($[48] !== startedAt || $[49] !== state) {
|
|
394
|
+
t13 = (state === "running" || state === "waiting") && startedAt > 0 && /*#__PURE__*/_jsx(Elapsed, {
|
|
311
395
|
startedAt: startedAt
|
|
312
396
|
});
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
397
|
+
$[48] = startedAt;
|
|
398
|
+
$[49] = state;
|
|
399
|
+
$[50] = t13;
|
|
316
400
|
} else {
|
|
317
|
-
|
|
401
|
+
t13 = $[50];
|
|
318
402
|
}
|
|
319
|
-
let
|
|
320
|
-
if ($[
|
|
321
|
-
|
|
403
|
+
let t14;
|
|
404
|
+
if ($[51] !== finishedAt || $[52] !== settled || $[53] !== startedAt) {
|
|
405
|
+
t14 = settled && startedAt > 0 && finishedAt !== null && finishedAt >= startedAt && /*#__PURE__*/_jsx("span", {
|
|
322
406
|
className: "shrink-0 text-xs text-text-faint tabular-nums",
|
|
323
407
|
children: formatElapsedShort(finishedAt - startedAt)
|
|
324
408
|
});
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
409
|
+
$[51] = finishedAt;
|
|
410
|
+
$[52] = settled;
|
|
411
|
+
$[53] = startedAt;
|
|
412
|
+
$[54] = t14;
|
|
329
413
|
} else {
|
|
330
|
-
|
|
414
|
+
t14 = $[54];
|
|
415
|
+
}
|
|
416
|
+
const t15 = open && "rotate-90";
|
|
417
|
+
let t16;
|
|
418
|
+
if ($[55] !== t15) {
|
|
419
|
+
t16 = clsx("shrink-0 text-text-faint transition-transform", t15);
|
|
420
|
+
$[55] = t15;
|
|
421
|
+
$[56] = t16;
|
|
422
|
+
} else {
|
|
423
|
+
t16 = $[56];
|
|
331
424
|
}
|
|
332
|
-
const t16 = open && "rotate-90";
|
|
333
425
|
let t17;
|
|
334
426
|
if ($[57] !== t16) {
|
|
335
|
-
t17 =
|
|
427
|
+
t17 = /*#__PURE__*/_jsx(Icon, {
|
|
428
|
+
icon: ChevronRight,
|
|
429
|
+
size: 12,
|
|
430
|
+
className: t16
|
|
431
|
+
});
|
|
336
432
|
$[57] = t16;
|
|
337
433
|
$[58] = t17;
|
|
338
434
|
} else {
|
|
339
435
|
t17 = $[58];
|
|
340
436
|
}
|
|
341
437
|
let t18;
|
|
342
|
-
if ($[59] !== t17) {
|
|
343
|
-
t18 = /*#__PURE__*/
|
|
344
|
-
icon: ChevronRight,
|
|
345
|
-
size: 12,
|
|
346
|
-
className: t17
|
|
347
|
-
});
|
|
348
|
-
$[59] = t17;
|
|
349
|
-
$[60] = t18;
|
|
350
|
-
} else {
|
|
351
|
-
t18 = $[60];
|
|
352
|
-
}
|
|
353
|
-
let t19;
|
|
354
|
-
if ($[61] !== t14 || $[62] !== t15 || $[63] !== t18) {
|
|
355
|
-
t19 = /*#__PURE__*/_jsxs("span", {
|
|
438
|
+
if ($[59] !== t13 || $[60] !== t14 || $[61] !== t17) {
|
|
439
|
+
t18 = /*#__PURE__*/_jsxs("span", {
|
|
356
440
|
className: "flex h-5 shrink-0 items-center gap-2",
|
|
357
|
-
children: [
|
|
441
|
+
children: [t13, t14, t17]
|
|
358
442
|
});
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
443
|
+
$[59] = t13;
|
|
444
|
+
$[60] = t14;
|
|
445
|
+
$[61] = t17;
|
|
446
|
+
$[62] = t18;
|
|
363
447
|
} else {
|
|
364
|
-
|
|
448
|
+
t18 = $[62];
|
|
365
449
|
}
|
|
366
|
-
let
|
|
367
|
-
if ($[
|
|
368
|
-
|
|
369
|
-
className:
|
|
370
|
-
onClick:
|
|
371
|
-
children: [
|
|
450
|
+
let t19;
|
|
451
|
+
if ($[63] !== t12 || $[64] !== t18 || $[65] !== t7 || $[66] !== t8 || $[67] !== t9) {
|
|
452
|
+
t19 = /*#__PURE__*/_jsxs("button", {
|
|
453
|
+
className: t7,
|
|
454
|
+
onClick: t8,
|
|
455
|
+
children: [t9, t12, t18]
|
|
372
456
|
});
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
457
|
+
$[63] = t12;
|
|
458
|
+
$[64] = t18;
|
|
459
|
+
$[65] = t7;
|
|
460
|
+
$[66] = t8;
|
|
461
|
+
$[67] = t9;
|
|
462
|
+
$[68] = t19;
|
|
379
463
|
} else {
|
|
380
|
-
|
|
464
|
+
t19 = $[68];
|
|
381
465
|
}
|
|
382
|
-
return
|
|
466
|
+
return t19;
|
|
383
467
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useChatHost } from '../../host/host.js';
|
|
3
|
-
import { useHostReferables } from '../../host/host-hooks.js';
|
|
3
|
+
import { useHostReferables, useHostSkills } from '../../host/host-hooks.js';
|
|
4
4
|
import { useChatScope } from '../../scope.js';
|
|
5
5
|
import { useChatRow } from '../../state/chats.js';
|
|
6
6
|
const referencedOf = new WeakMap();
|
|
@@ -35,12 +35,13 @@ export function useReferenceLookup(chatId) {
|
|
|
35
35
|
}
|
|
36
36
|
/* The same for a row that may stand outside a scope. */
|
|
37
37
|
export function useReferenceLookupIn(scopeId, chatId) {
|
|
38
|
-
const $ = _c(
|
|
38
|
+
const $ = _c(14);
|
|
39
39
|
const {
|
|
40
40
|
openReference,
|
|
41
41
|
outsideReference
|
|
42
42
|
} = useChatHost();
|
|
43
43
|
const referables = useHostReferables(scopeId, chatId);
|
|
44
|
+
const skills = useHostSkills(scopeId, chatId);
|
|
44
45
|
const key = useChatRow(chatId, _temp);
|
|
45
46
|
let t0;
|
|
46
47
|
if ($[0] !== openReference || $[1] !== scopeId) {
|
|
@@ -71,20 +72,22 @@ export function useReferenceLookupIn(scopeId, chatId) {
|
|
|
71
72
|
t2 = $[7];
|
|
72
73
|
}
|
|
73
74
|
let t3;
|
|
74
|
-
if ($[8] !== referables.items || $[9] !==
|
|
75
|
+
if ($[8] !== referables.items || $[9] !== skills || $[10] !== t0 || $[11] !== t1 || $[12] !== t2) {
|
|
75
76
|
t3 = {
|
|
76
77
|
items: referables.items,
|
|
77
78
|
open: t0,
|
|
78
79
|
...t1,
|
|
79
|
-
referenced: t2
|
|
80
|
+
referenced: t2,
|
|
81
|
+
skills
|
|
80
82
|
};
|
|
81
83
|
$[8] = referables.items;
|
|
82
|
-
$[9] =
|
|
83
|
-
$[10] =
|
|
84
|
-
$[11] =
|
|
85
|
-
$[12] =
|
|
84
|
+
$[9] = skills;
|
|
85
|
+
$[10] = t0;
|
|
86
|
+
$[11] = t1;
|
|
87
|
+
$[12] = t2;
|
|
88
|
+
$[13] = t3;
|
|
86
89
|
} else {
|
|
87
|
-
t3 = $[
|
|
90
|
+
t3 = $[13];
|
|
88
91
|
}
|
|
89
92
|
return t3;
|
|
90
93
|
}
|
package/dist/chat-client.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare class ChatClient {
|
|
|
31
31
|
private readonly earlier;
|
|
32
32
|
private readonly observers;
|
|
33
33
|
private readonly inspections;
|
|
34
|
+
private readonly skillLists;
|
|
34
35
|
private preferences;
|
|
35
36
|
private checkpoints;
|
|
36
37
|
constructor(transport: ChatTransport, sink: ChatSink, providers?: ProviderSink | null);
|
|
@@ -48,7 +49,7 @@ export declare class ChatClient {
|
|
|
48
49
|
renameBookmark(chatId: string, itemId: string, name: string): Promise<ChatBookmark[]>;
|
|
49
50
|
removeBookmark(chatId: string, itemId: string): Promise<ChatBookmark[]>;
|
|
50
51
|
removeVisual(chatId: string, visualId: string): Promise<ChatVisual[]>;
|
|
51
|
-
listSkills(chatId: string): Promise<ChatSkill[]>;
|
|
52
|
+
listSkills(chatId: string, alike?: string): Promise<ChatSkill[]>;
|
|
52
53
|
clear(chatId: string, force?: boolean): Promise<void>;
|
|
53
54
|
restart(chatId: string): Promise<void>;
|
|
54
55
|
kill(chatId: string): Promise<void>;
|
|
@@ -58,6 +59,7 @@ export declare class ChatClient {
|
|
|
58
59
|
isMounted(chatId: string): boolean;
|
|
59
60
|
dispose(): void;
|
|
60
61
|
private attach;
|
|
62
|
+
private openOnHost;
|
|
61
63
|
private sequence;
|
|
62
64
|
private rememberSequence;
|
|
63
65
|
private sendPreferences;
|