@adecore/agents-react 0.75.0 → 0.76.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/timeline.js +3 -0
- package/dist/chat/stop-task.d.ts +1 -0
- package/dist/chat/stop-task.js +34 -0
- package/dist/chat/ui/ChatActivity.js +20 -42
- package/dist/chat/ui/Composer.js +397 -381
- package/dist/chat/ui/composer/QueuedMessages.d.ts +5 -1
- package/dist/chat/ui/composer/QueuedMessages.js +60 -30
- package/dist/chat/ui/rows/MessageRows.d.ts +6 -2
- package/dist/chat/ui/rows/MessageRows.js +122 -45
- package/dist/chat/ui/rows/Rows.js +65 -61
- package/dist/chat/waiting-on.d.ts +6 -0
- package/dist/chat/waiting-on.js +13 -2
- package/dist/host/timeline-row.d.ts +1 -0
- package/dist/locales/en/agent-chat.d.ts +4 -0
- package/dist/locales/en/agent-chat.js +5 -1
- package/dist/locales/nl/agent-chat.d.ts +4 -0
- package/dist/locales/nl/agent-chat.js +5 -1
- package/package.json +9 -9
- package/src/chat/logic/timeline.ts +2 -1
- package/src/chat/stop-task.ts +17 -0
- package/src/chat/ui/ChatActivity.tsx +2 -10
- package/src/chat/ui/Composer.tsx +3 -0
- package/src/chat/ui/composer/QueuedMessages.tsx +21 -1
- package/src/chat/ui/rows/MessageRows.tsx +34 -3
- package/src/chat/ui/rows/Rows.tsx +1 -1
- package/src/chat/waiting-on.ts +13 -2
- package/src/host/timeline-row.ts +1 -1
- package/src/locales/en/agent-chat.ts +5 -1
- package/src/locales/nl/agent-chat.ts +5 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useStopTask(chatId: string): (taskId: string) => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { useChatHost } from '../host/host.js';
|
|
4
|
+
import { useChatActions } from './actions.js';
|
|
5
|
+
/* Stops a command or monitor a chat runs in the background, and tells the person when the host refused. */
|
|
6
|
+
export function useStopTask(chatId) {
|
|
7
|
+
const $ = _c(5);
|
|
8
|
+
const host = useChatHost();
|
|
9
|
+
const {
|
|
10
|
+
t
|
|
11
|
+
} = useTranslation("agent-chat");
|
|
12
|
+
const actions = useChatActions();
|
|
13
|
+
let t0;
|
|
14
|
+
if ($[0] !== actions || $[1] !== chatId || $[2] !== host || $[3] !== t) {
|
|
15
|
+
t0 = taskId => {
|
|
16
|
+
actions.stopTask(chatId, taskId).catch(error => {
|
|
17
|
+
const description = error instanceof Error ? error.message : t("subagents.noAnswer");
|
|
18
|
+
host.notify({
|
|
19
|
+
kind: "error",
|
|
20
|
+
title: t("activity.stopFailed"),
|
|
21
|
+
description
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
$[0] = actions;
|
|
26
|
+
$[1] = chatId;
|
|
27
|
+
$[2] = host;
|
|
28
|
+
$[3] = t;
|
|
29
|
+
$[4] = t0;
|
|
30
|
+
} else {
|
|
31
|
+
t0 = $[4];
|
|
32
|
+
}
|
|
33
|
+
return t0;
|
|
34
|
+
}
|
|
@@ -11,8 +11,8 @@ import { useChatHost } from '../../host/host.js';
|
|
|
11
11
|
import { useHostTask, useHostTasks } from '../../host/host-hooks.js';
|
|
12
12
|
import { useChatScope } from '../../scope.js';
|
|
13
13
|
import { useChatRow, useChats } from '../../state/chats.js';
|
|
14
|
-
import { useChatActions } from '../actions.js';
|
|
15
14
|
import { backgroundCounts, backgroundTaskName, backgroundTaskTime } from '../activity.js';
|
|
15
|
+
import { useStopTask } from '../stop-task.js';
|
|
16
16
|
import { badgeCountOf, entryTimeOf, flyoutSubagents, progressOf, statusWordOf, subagentTitle, summaryWordOf, taskRowStateOf } from '../subagent-list.js';
|
|
17
17
|
import { useSubagentSupport } from '../subagent-support.js';
|
|
18
18
|
import { canOpenSubagent, crumbOf, openFromMain, useSubagentTrail } from '../subagent-view.js';
|
|
@@ -852,43 +852,21 @@ function SubagentEntry(t0) {
|
|
|
852
852
|
}
|
|
853
853
|
/* Only drawn while the flyout is open, so the clock ticks for nobody otherwise. */
|
|
854
854
|
function BackgroundTaskRows(t0) {
|
|
855
|
-
const $ = _c(
|
|
855
|
+
const $ = _c(9);
|
|
856
856
|
const {
|
|
857
857
|
chatId,
|
|
858
858
|
tasks
|
|
859
859
|
} = t0;
|
|
860
|
-
const host = useChatHost();
|
|
861
860
|
const {
|
|
862
861
|
t
|
|
863
862
|
} = useTranslation("agent-chat");
|
|
864
863
|
const now = useNow(1000);
|
|
865
|
-
const
|
|
864
|
+
const stop = useStopTask(chatId);
|
|
866
865
|
let t1;
|
|
867
|
-
if ($[0] !==
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
host.notify({
|
|
872
|
-
kind: "error",
|
|
873
|
-
title: t("activity.stopFailed"),
|
|
874
|
-
description
|
|
875
|
-
});
|
|
876
|
-
});
|
|
877
|
-
};
|
|
878
|
-
$[0] = actions;
|
|
879
|
-
$[1] = chatId;
|
|
880
|
-
$[2] = host;
|
|
881
|
-
$[3] = t;
|
|
882
|
-
$[4] = t1;
|
|
883
|
-
} else {
|
|
884
|
-
t1 = $[4];
|
|
885
|
-
}
|
|
886
|
-
const stop = t1;
|
|
887
|
-
let t2;
|
|
888
|
-
if ($[5] !== now || $[6] !== stop || $[7] !== t || $[8] !== tasks) {
|
|
889
|
-
let t3;
|
|
890
|
-
if ($[10] !== now || $[11] !== stop || $[12] !== t) {
|
|
891
|
-
t3 = task => /*#__PURE__*/_jsx(ActivityRow, {
|
|
866
|
+
if ($[0] !== now || $[1] !== stop || $[2] !== t || $[3] !== tasks) {
|
|
867
|
+
let t2;
|
|
868
|
+
if ($[5] !== now || $[6] !== stop || $[7] !== t) {
|
|
869
|
+
t2 = task => /*#__PURE__*/_jsx(ActivityRow, {
|
|
892
870
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
893
871
|
icon: scheduledWakeupAt(task) !== null ? Clock : task.kind === "shell" ? SquareTerminal : Activity,
|
|
894
872
|
size: 14,
|
|
@@ -905,21 +883,21 @@ function BackgroundTaskRows(t0) {
|
|
|
905
883
|
onClick: () => stop(task.id)
|
|
906
884
|
})
|
|
907
885
|
}, task.id);
|
|
908
|
-
$[
|
|
909
|
-
$[
|
|
910
|
-
$[
|
|
911
|
-
$[
|
|
886
|
+
$[5] = now;
|
|
887
|
+
$[6] = stop;
|
|
888
|
+
$[7] = t;
|
|
889
|
+
$[8] = t2;
|
|
912
890
|
} else {
|
|
913
|
-
|
|
891
|
+
t2 = $[8];
|
|
914
892
|
}
|
|
915
|
-
|
|
916
|
-
$[
|
|
917
|
-
$[
|
|
918
|
-
$[
|
|
919
|
-
$[
|
|
920
|
-
$[
|
|
893
|
+
t1 = tasks.map(t2);
|
|
894
|
+
$[0] = now;
|
|
895
|
+
$[1] = stop;
|
|
896
|
+
$[2] = t;
|
|
897
|
+
$[3] = tasks;
|
|
898
|
+
$[4] = t1;
|
|
921
899
|
} else {
|
|
922
|
-
|
|
900
|
+
t1 = $[4];
|
|
923
901
|
}
|
|
924
|
-
return
|
|
902
|
+
return t1;
|
|
925
903
|
}
|