@dxos/plugin-automation 0.7.5-labs.f5080a1 → 0.7.5-labs.ff2ff30
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/lib/browser/AutomationPanel-VW2XIUPU.mjs +8 -0
- package/dist/lib/browser/ChatContainer-5TAVTN3T.mjs +12 -0
- package/dist/lib/browser/{ai-client-UJLNYP7B.mjs → ai-client-5CNY6JBF.mjs} +3 -3
- package/dist/lib/browser/{app-graph-builder-3H5TCRG4.mjs → app-graph-builder-FZGK55G7.mjs} +39 -4
- package/dist/lib/browser/app-graph-builder-FZGK55G7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BQHXJZ4K.mjs → chunk-2H2EUYXL.mjs} +2 -2
- package/dist/lib/browser/{chunk-DL7XA62G.mjs → chunk-DVE33EZL.mjs} +224 -153
- package/dist/lib/browser/{chunk-DL7XA62G.mjs.map → chunk-DVE33EZL.mjs.map} +4 -4
- package/dist/lib/browser/{chunk-PQGFC2ZO.mjs → chunk-MJK7GL5P.mjs} +61 -38
- package/dist/lib/browser/chunk-MJK7GL5P.mjs.map +7 -0
- package/dist/lib/browser/{chunk-Z54KIF6H.mjs → chunk-NQFZ6XRX.mjs} +3 -2
- package/dist/lib/browser/{chunk-Z54KIF6H.mjs.map → chunk-NQFZ6XRX.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-43WRHV2L.mjs → chunk-Q4IMHYGH.mjs} +2 -2
- package/dist/lib/browser/{chunk-DQ7ZSYJJ.mjs → chunk-R4JH4TLE.mjs} +3 -1
- package/dist/lib/browser/chunk-R4JH4TLE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +16 -11
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-5YVZJFS3.mjs → intent-resolver-BWAXKT27.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-WRHRCEV5.mjs → react-surface-ILBDBZCN.mjs} +15 -7
- package/dist/lib/browser/react-surface-ILBDBZCN.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node/{AutomationPanel-CO26O75P.cjs → AutomationPanel-G6EDDYWW.cjs} +7 -7
- package/dist/lib/node/{AutomationPanel-CO26O75P.cjs.map → AutomationPanel-G6EDDYWW.cjs.map} +2 -2
- package/dist/lib/node/{ChatContainer-5URBEXQD.cjs → ChatContainer-EN24W3K4.cjs} +10 -10
- package/dist/lib/node/ChatContainer-EN24W3K4.cjs.map +7 -0
- package/dist/lib/node/{ai-client-AOB6TLNW.cjs → ai-client-FKLPDELV.cjs} +7 -7
- package/dist/lib/node/{app-graph-builder-CDEQJEHY.cjs → app-graph-builder-T76NYV42.cjs} +48 -14
- package/dist/lib/node/app-graph-builder-T76NYV42.cjs.map +7 -0
- package/dist/lib/node/{chunk-NH7STAX6.cjs → chunk-CJGJXNY3.cjs} +245 -174
- package/dist/lib/node/chunk-CJGJXNY3.cjs.map +7 -0
- package/dist/lib/node/{chunk-TQEDPRY5.cjs → chunk-EQYHOTGG.cjs} +7 -4
- package/dist/lib/node/chunk-EQYHOTGG.cjs.map +7 -0
- package/dist/lib/node/{chunk-H3RSMGJG.cjs → chunk-GB7245FH.cjs} +6 -6
- package/dist/lib/node/{chunk-D2QQXWOY.cjs → chunk-HMBKP6VG.cjs} +80 -58
- package/dist/lib/node/chunk-HMBKP6VG.cjs.map +7 -0
- package/dist/lib/node/{chunk-OCW5GAVZ.cjs → chunk-QXIHYOMF.cjs} +8 -7
- package/dist/lib/node/{chunk-OCW5GAVZ.cjs.map → chunk-QXIHYOMF.cjs.map} +2 -2
- package/dist/lib/node/{chunk-AWZVJZ2I.cjs → chunk-U5Z7LFWB.cjs} +6 -6
- package/dist/lib/node/index.cjs +79 -74
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-MJFZT5IU.cjs → intent-resolver-C6OKFVEW.cjs} +8 -8
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-HDAVE6NU.cjs → react-surface-LWDY7SQG.cjs} +23 -17
- package/dist/lib/node/react-surface-LWDY7SQG.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +11 -11
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{AutomationPanel-VQZUKPK2.mjs → AutomationPanel-V3IWQAMO.mjs} +3 -3
- package/dist/lib/node-esm/{ChatContainer-23QIVDG5.mjs → ChatContainer-CNTY3C2D.mjs} +5 -5
- package/dist/lib/node-esm/{ai-client-RUCCJ7JZ.mjs → ai-client-XGNA6SJ5.mjs} +3 -3
- package/dist/lib/node-esm/{app-graph-builder-GR3URVNX.mjs → app-graph-builder-IJQEN7WT.mjs} +39 -4
- package/dist/lib/node-esm/app-graph-builder-IJQEN7WT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-NSVQZ3EH.mjs → chunk-6HLBYDUI.mjs} +3 -2
- package/dist/lib/node-esm/{chunk-NSVQZ3EH.mjs.map → chunk-6HLBYDUI.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-7JO77AAS.mjs → chunk-DNCXRGAF.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-JFHI22MF.mjs → chunk-EMVA6QUT.mjs} +3 -1
- package/dist/lib/node-esm/chunk-EMVA6QUT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LSSWQIQD.mjs → chunk-IJRTDSKN.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-JJFWFS6P.mjs → chunk-QP47VJT6.mjs} +224 -153
- package/dist/lib/node-esm/{chunk-JJFWFS6P.mjs.map → chunk-QP47VJT6.mjs.map} +4 -4
- package/dist/lib/node-esm/{chunk-VN2AFV25.mjs → chunk-ZLIAMW45.mjs} +61 -38
- package/dist/lib/node-esm/chunk-ZLIAMW45.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +16 -11
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-FCKNRTKQ.mjs → intent-resolver-DCP4ZDBA.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-FZ5OFRDE.mjs → react-surface-SBDXFVIN.mjs} +15 -7
- package/dist/lib/node-esm/react-surface-SBDXFVIN.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts +23 -22
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.d.ts +3 -0
- package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.d.ts.map +1 -0
- package/dist/types/src/components/AmbientChatDialog/index.d.ts +2 -0
- package/dist/types/src/components/AmbientChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/Box/StatusLine.d.ts.map +1 -0
- package/dist/types/src/components/Box/StatusLine.stories.d.ts.map +1 -0
- package/dist/types/src/components/Box/Tabbed.d.ts +15 -0
- package/dist/types/src/components/Box/Tabbed.d.ts.map +1 -0
- package/dist/types/src/components/Box/Tabbed.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Thread → Box}/ToggleContainer.d.ts +3 -3
- package/dist/types/src/components/Box/ToggleContainer.d.ts.map +1 -0
- package/dist/types/src/components/Box/ToggleContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/Box/index.d.ts +4 -0
- package/dist/types/src/components/Box/index.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/Prompt.d.ts +7 -0
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +8 -0
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/index.d.ts +2 -0
- package/dist/types/src/components/Prompt/index.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts +20 -0
- package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts.map +1 -0
- package/dist/types/src/components/Thread/Thread.stories.d.ts +1 -0
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +52 -50
- package/src/AutomationPlugin.tsx +5 -5
- package/src/capabilities/app-graph-builder.ts +34 -3
- package/src/capabilities/react-surface.tsx +8 -2
- package/src/components/AmbientChatDialog/AmbientChatDialog.tsx +26 -0
- package/src/components/AmbientChatDialog/index.ts +5 -0
- package/src/components/{Thread → Box}/Tabbed.stories.tsx +1 -2
- package/src/components/Box/Tabbed.tsx +89 -0
- package/src/components/{Thread → Box}/ToggleContainer.stories.tsx +0 -1
- package/src/components/{Thread → Box}/ToggleContainer.tsx +28 -23
- package/src/components/Box/index.ts +7 -0
- package/src/components/Prompt/Prompt.stories.tsx +50 -0
- package/src/components/Prompt/Prompt.tsx +36 -0
- package/src/components/Prompt/index.ts +5 -0
- package/src/components/Prompt/prompt-autocomplete.ts +200 -0
- package/src/components/PromptEditor/PromptEditor.stories.tsx +3 -3
- package/src/components/Thread/Thread.stories.tsx +8 -1
- package/src/components/Thread/Thread.tsx +1 -1
- package/src/components/Thread/ThreadMessage.tsx +41 -19
- package/src/components/TriggerEditor/TriggerEditor.tsx +6 -1
- package/src/components/index.ts +1 -0
- package/src/meta.ts +2 -0
- package/src/translations.ts +1 -0
- package/dist/lib/browser/AutomationPanel-YPD3AGQN.mjs +0 -8
- package/dist/lib/browser/ChatContainer-ODZECATM.mjs +0 -12
- package/dist/lib/browser/app-graph-builder-3H5TCRG4.mjs.map +0 -7
- package/dist/lib/browser/chunk-DQ7ZSYJJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-PQGFC2ZO.mjs.map +0 -7
- package/dist/lib/browser/react-surface-WRHRCEV5.mjs.map +0 -7
- package/dist/lib/node/ChatContainer-5URBEXQD.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-CDEQJEHY.cjs.map +0 -7
- package/dist/lib/node/chunk-D2QQXWOY.cjs.map +0 -7
- package/dist/lib/node/chunk-NH7STAX6.cjs.map +0 -7
- package/dist/lib/node/chunk-TQEDPRY5.cjs.map +0 -7
- package/dist/lib/node/react-surface-HDAVE6NU.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-GR3URVNX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JFHI22MF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VN2AFV25.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-FZ5OFRDE.mjs.map +0 -7
- package/dist/types/src/components/Thread/ScrollContainer.d.ts +0 -15
- package/dist/types/src/components/Thread/ScrollContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/StatusLine.d.ts.map +0 -1
- package/dist/types/src/components/Thread/StatusLine.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Tabbed.d.ts +0 -9
- package/dist/types/src/components/Thread/Tabbed.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Tabbed.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToggleContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToggleContainer.stories.d.ts.map +0 -1
- package/src/components/Thread/ScrollContainer.tsx +0 -92
- package/src/components/Thread/Tabbed.tsx +0 -72
- /package/dist/lib/browser/{AutomationPanel-YPD3AGQN.mjs.map → AutomationPanel-VW2XIUPU.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-ODZECATM.mjs.map → ChatContainer-5TAVTN3T.mjs.map} +0 -0
- /package/dist/lib/browser/{ai-client-UJLNYP7B.mjs.map → ai-client-5CNY6JBF.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-BQHXJZ4K.mjs.map → chunk-2H2EUYXL.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-43WRHV2L.mjs.map → chunk-Q4IMHYGH.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-5YVZJFS3.mjs.map → intent-resolver-BWAXKT27.mjs.map} +0 -0
- /package/dist/lib/node/{ai-client-AOB6TLNW.cjs.map → ai-client-FKLPDELV.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-H3RSMGJG.cjs.map → chunk-GB7245FH.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-AWZVJZ2I.cjs.map → chunk-U5Z7LFWB.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-MJFZT5IU.cjs.map → intent-resolver-C6OKFVEW.cjs.map} +0 -0
- /package/dist/lib/node-esm/{AutomationPanel-VQZUKPK2.mjs.map → AutomationPanel-V3IWQAMO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-23QIVDG5.mjs.map → ChatContainer-CNTY3C2D.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ai-client-RUCCJ7JZ.mjs.map → ai-client-XGNA6SJ5.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-7JO77AAS.mjs.map → chunk-DNCXRGAF.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-LSSWQIQD.mjs.map → chunk-IJRTDSKN.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-FCKNRTKQ.mjs.map → intent-resolver-DCP4ZDBA.mjs.map} +0 -0
- /package/dist/types/src/components/{Thread → Box}/StatusLine.d.ts +0 -0
- /package/dist/types/src/components/{Thread → Box}/StatusLine.stories.d.ts +0 -0
- /package/dist/types/src/components/{Thread → Box}/Tabbed.stories.d.ts +0 -0
- /package/dist/types/src/components/{Thread → Box}/ToggleContainer.stories.d.ts +0 -0
- /package/src/components/{Thread → Box}/StatusLine.stories.tsx +0 -0
- /package/src/components/{Thread → Box}/StatusLine.tsx +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
AutomationCapabilities
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IJRTDSKN.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ServiceType,
|
|
7
7
|
categoryIcons
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DNCXRGAF.mjs";
|
|
9
9
|
import {
|
|
10
10
|
AUTOMATION_PLUGIN
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EMVA6QUT.mjs";
|
|
12
12
|
|
|
13
13
|
// packages/plugins/experimental/plugin-automation/src/components/ChatContainer/ChatContainer.tsx
|
|
14
|
-
import React7, { useCallback as
|
|
15
|
-
import { invariant as
|
|
14
|
+
import React7, { useCallback as useCallback2 } from "react";
|
|
15
|
+
import { invariant as invariant6 } from "@dxos/invariant";
|
|
16
16
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
17
17
|
|
|
18
18
|
// packages/plugins/experimental/plugin-automation/src/hooks/processor.ts
|
|
@@ -243,10 +243,10 @@ import { isNotNullOrUndefined } from "@dxos/util";
|
|
|
243
243
|
|
|
244
244
|
// packages/plugins/experimental/plugin-automation/src/capabilities/index.ts
|
|
245
245
|
import { lazy } from "@dxos/app-framework";
|
|
246
|
-
var AiClient = lazy(() => import("./ai-client-
|
|
247
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
248
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
249
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
246
|
+
var AiClient = lazy(() => import("./ai-client-XGNA6SJ5.mjs"));
|
|
247
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-IJQEN7WT.mjs"));
|
|
248
|
+
var IntentResolver = lazy(() => import("./intent-resolver-DCP4ZDBA.mjs"));
|
|
249
|
+
var ReactSurface = lazy(() => import("./react-surface-SBDXFVIN.mjs"));
|
|
250
250
|
|
|
251
251
|
// packages/plugins/experimental/plugin-automation/src/tools/function.ts
|
|
252
252
|
import { defineTool, ToolResult } from "@dxos/artifact";
|
|
@@ -915,103 +915,34 @@ var useServices = (space, query) => {
|
|
|
915
915
|
};
|
|
916
916
|
|
|
917
917
|
// packages/plugins/experimental/plugin-automation/src/components/Thread/Thread.tsx
|
|
918
|
-
import React6, { useCallback
|
|
918
|
+
import React6, { useCallback, useMemo as useMemo4, useRef as useRef3, useState as useState7 } from "react";
|
|
919
919
|
import { IconButton, Input, useTranslation } from "@dxos/react-ui";
|
|
920
|
+
import { ScrollContainer } from "@dxos/react-ui-components";
|
|
920
921
|
import { Spinner } from "@dxos/react-ui-sfx";
|
|
921
922
|
import { mx as mx6 } from "@dxos/react-ui-theme";
|
|
922
923
|
|
|
923
|
-
// packages/plugins/experimental/plugin-automation/src/components/Thread/ScrollContainer.tsx
|
|
924
|
-
import React, { forwardRef, useCallback, useEffect as useEffect4, useImperativeHandle, useRef, useState as useState4 } from "react";
|
|
925
|
-
import { invariant as invariant5 } from "@dxos/invariant";
|
|
926
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
927
|
-
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/Thread/ScrollContainer.tsx";
|
|
928
|
-
var ScrollContainer = /* @__PURE__ */ forwardRef(({ children, classNames }, forwardedRef) => {
|
|
929
|
-
const containerRef = useRef(null);
|
|
930
|
-
const autoScrollRef = useRef(false);
|
|
931
|
-
useImperativeHandle(forwardedRef, () => ({
|
|
932
|
-
scrollToBottom: () => {
|
|
933
|
-
invariant5(containerRef.current, void 0, {
|
|
934
|
-
F: __dxlog_file4,
|
|
935
|
-
L: 41,
|
|
936
|
-
S: void 0,
|
|
937
|
-
A: [
|
|
938
|
-
"containerRef.current",
|
|
939
|
-
""
|
|
940
|
-
]
|
|
941
|
-
});
|
|
942
|
-
containerRef.current.scrollTo({
|
|
943
|
-
top: containerRef.current.scrollHeight,
|
|
944
|
-
behavior: "smooth"
|
|
945
|
-
});
|
|
946
|
-
autoScrollRef.current = false;
|
|
947
|
-
}
|
|
948
|
-
}), []);
|
|
949
|
-
const [sticky, setSticky] = useState4(true);
|
|
950
|
-
useEffect4(() => {
|
|
951
|
-
if (!sticky || !containerRef.current) {
|
|
952
|
-
return;
|
|
953
|
-
}
|
|
954
|
-
autoScrollRef.current = true;
|
|
955
|
-
containerRef.current.scrollTo({
|
|
956
|
-
top: containerRef.current.scrollHeight,
|
|
957
|
-
behavior: "smooth"
|
|
958
|
-
});
|
|
959
|
-
}, [
|
|
960
|
-
children
|
|
961
|
-
]);
|
|
962
|
-
useEffect4(() => {
|
|
963
|
-
invariant5(containerRef.current, void 0, {
|
|
964
|
-
F: __dxlog_file4,
|
|
965
|
-
L: 62,
|
|
966
|
-
S: void 0,
|
|
967
|
-
A: [
|
|
968
|
-
"containerRef.current",
|
|
969
|
-
""
|
|
970
|
-
]
|
|
971
|
-
});
|
|
972
|
-
const handleScrollEnd = () => {
|
|
973
|
-
autoScrollRef.current = false;
|
|
974
|
-
};
|
|
975
|
-
containerRef.current.addEventListener("scrollend", handleScrollEnd);
|
|
976
|
-
return () => containerRef.current?.removeEventListener("scrollend", handleScrollEnd);
|
|
977
|
-
}, []);
|
|
978
|
-
const handleScroll = useCallback((ev) => {
|
|
979
|
-
if (autoScrollRef.current) {
|
|
980
|
-
return;
|
|
981
|
-
}
|
|
982
|
-
const { scrollTop, clientHeight, scrollHeight } = ev.currentTarget;
|
|
983
|
-
const sticky2 = scrollTop + clientHeight >= scrollHeight;
|
|
984
|
-
setSticky(sticky2);
|
|
985
|
-
}, []);
|
|
986
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
987
|
-
ref: containerRef,
|
|
988
|
-
onScroll: handleScroll,
|
|
989
|
-
className: mx("flex flex-col grow overflow-y-scroll scrollbar-none", classNames)
|
|
990
|
-
}, children);
|
|
991
|
-
});
|
|
992
|
-
|
|
993
924
|
// packages/plugins/experimental/plugin-automation/src/components/Thread/ThreadMessage.tsx
|
|
994
|
-
import React5 from "react";
|
|
995
|
-
import { invariant as
|
|
925
|
+
import React5, { useEffect as useEffect6, useRef as useRef2, useState as useState6 } from "react";
|
|
926
|
+
import { invariant as invariant5 } from "@dxos/invariant";
|
|
996
927
|
import { log as log6 } from "@dxos/log";
|
|
997
|
-
import { Button, ButtonGroup, Icon as
|
|
928
|
+
import { Button, ButtonGroup, Icon as Icon3 } from "@dxos/react-ui";
|
|
998
929
|
import { Json } from "@dxos/react-ui-syntax-highlighter";
|
|
999
930
|
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
1000
931
|
import { safeParseJson } from "@dxos/util";
|
|
1001
932
|
|
|
1002
|
-
// packages/plugins/experimental/plugin-automation/src/components/
|
|
1003
|
-
import
|
|
1004
|
-
import { mx
|
|
933
|
+
// packages/plugins/experimental/plugin-automation/src/components/Box/StatusLine.tsx
|
|
934
|
+
import React, { useEffect as useEffect4, useRef, useState as useState4 } from "react";
|
|
935
|
+
import { mx } from "@dxos/react-ui-theme";
|
|
1005
936
|
var emptyLines = [];
|
|
1006
937
|
var StatusLine = ({ classNames, line = -1, lines = emptyLines, transition = 300, advance = 1e3, autoAdvance }) => {
|
|
1007
|
-
const containerRef =
|
|
1008
|
-
const [currentLine, setCurrentLine] =
|
|
1009
|
-
|
|
938
|
+
const containerRef = useRef(null);
|
|
939
|
+
const [currentLine, setCurrentLine] = useState4(line);
|
|
940
|
+
useEffect4(() => {
|
|
1010
941
|
setCurrentLine(line);
|
|
1011
942
|
}, [
|
|
1012
943
|
line
|
|
1013
944
|
]);
|
|
1014
|
-
|
|
945
|
+
useEffect4(() => {
|
|
1015
946
|
if (!autoAdvance) {
|
|
1016
947
|
return;
|
|
1017
948
|
}
|
|
@@ -1032,7 +963,7 @@ var StatusLine = ({ classNames, line = -1, lines = emptyLines, transition = 300,
|
|
|
1032
963
|
autoAdvance,
|
|
1033
964
|
advance
|
|
1034
965
|
]);
|
|
1035
|
-
|
|
966
|
+
useEffect4(() => {
|
|
1036
967
|
if (containerRef.current) {
|
|
1037
968
|
containerRef.current.style.transition = `transform ${transition}ms ease-in-out`;
|
|
1038
969
|
containerRef.current.style.transform = `translateY(-${currentLine * 24}px)`;
|
|
@@ -1040,32 +971,128 @@ var StatusLine = ({ classNames, line = -1, lines = emptyLines, transition = 300,
|
|
|
1040
971
|
}, [
|
|
1041
972
|
currentLine
|
|
1042
973
|
]);
|
|
1043
|
-
return /* @__PURE__ */
|
|
1044
|
-
className:
|
|
1045
|
-
}, /* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
975
|
+
className: mx("relative h-[24px] overflow-hidden", classNames)
|
|
976
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1046
977
|
ref: containerRef,
|
|
1047
978
|
className: "h-[24px]"
|
|
1048
|
-
}, /* @__PURE__ */
|
|
979
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1049
980
|
className: "flex flex-col"
|
|
1050
|
-
}, lines.map((line2, i) => /* @__PURE__ */
|
|
981
|
+
}, lines.map((line2, i) => /* @__PURE__ */ React.createElement("div", {
|
|
1051
982
|
key: i,
|
|
1052
|
-
className:
|
|
1053
|
-
}, /* @__PURE__ */
|
|
983
|
+
className: mx("flex h-[24px] items-center")
|
|
984
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
1054
985
|
className: "truncate"
|
|
1055
986
|
}, line2))))));
|
|
1056
987
|
};
|
|
1057
988
|
|
|
1058
|
-
// packages/plugins/experimental/plugin-automation/src/components/
|
|
1059
|
-
import
|
|
989
|
+
// packages/plugins/experimental/plugin-automation/src/components/Box/Tabbed.tsx
|
|
990
|
+
import React2, { forwardRef } from "react";
|
|
1060
991
|
import { Icon } from "@dxos/react-ui";
|
|
992
|
+
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
993
|
+
var numbers = [
|
|
994
|
+
{
|
|
995
|
+
regular: "ph--number-circle-zero--thin",
|
|
996
|
+
active: "ph--number-circle-zero--duotone"
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
regular: "ph--number-circle-one--thin",
|
|
1000
|
+
active: "ph--number-circle-one--duotone"
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
regular: "ph--number-circle-two--thin",
|
|
1004
|
+
active: "ph--number-circle-two--duotone"
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
regular: "ph--number-circle-three--thin",
|
|
1008
|
+
active: "ph--number-circle-three--duotone"
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
regular: "ph--number-circle-four--thin",
|
|
1012
|
+
active: "ph--number-circle-four--duotone"
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
regular: "ph--number-circle-five--thin",
|
|
1016
|
+
active: "ph--number-circle-five--duotone"
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
regular: "ph--number-circle-six--thin",
|
|
1020
|
+
active: "ph--number-circle-six--duotone"
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
regular: "ph--number-circle-seven--thin",
|
|
1024
|
+
active: "ph--number-circle-seven--duotone"
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
regular: "ph--number-circle-eight--thin",
|
|
1028
|
+
active: "ph--number-circle-eight--duotone"
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
regular: "ph--number-circle-nine--thin",
|
|
1032
|
+
active: "ph--number-circle-nine--duotone"
|
|
1033
|
+
}
|
|
1034
|
+
];
|
|
1035
|
+
var Tabs = /* @__PURE__ */ forwardRef(({ classNames, length, selected = 0, onSelect }, forwardedRef) => {
|
|
1036
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
1037
|
+
ref: forwardedRef,
|
|
1038
|
+
className: mx2("flex flex-col overflow-hidden outline-none", classNames),
|
|
1039
|
+
tabIndex: -1,
|
|
1040
|
+
onKeyDown: (ev) => {
|
|
1041
|
+
switch (ev.key) {
|
|
1042
|
+
case "ArrowDown":
|
|
1043
|
+
case "ArrowRight": {
|
|
1044
|
+
ev.preventDefault();
|
|
1045
|
+
ev.stopPropagation();
|
|
1046
|
+
if (selected < length - 1) {
|
|
1047
|
+
onSelect?.(selected + 1);
|
|
1048
|
+
}
|
|
1049
|
+
break;
|
|
1050
|
+
}
|
|
1051
|
+
case "ArrowUp":
|
|
1052
|
+
case "ArrowLeft": {
|
|
1053
|
+
ev.preventDefault();
|
|
1054
|
+
ev.stopPropagation();
|
|
1055
|
+
if (selected > 0) {
|
|
1056
|
+
onSelect?.(selected - 1);
|
|
1057
|
+
}
|
|
1058
|
+
break;
|
|
1059
|
+
}
|
|
1060
|
+
case "Enter": {
|
|
1061
|
+
ev.preventDefault();
|
|
1062
|
+
ev.stopPropagation();
|
|
1063
|
+
onSelect?.(selected);
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
}, Array.from({
|
|
1069
|
+
length
|
|
1070
|
+
}).map((_, i) => {
|
|
1071
|
+
const icon = numbers[i + 1];
|
|
1072
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
1073
|
+
key: i,
|
|
1074
|
+
className: mx2("relative flex w-[24px] h-[28px] justify-center cursor-pointer text-subdued", selected === i && "!text-cyan-550 !dark:text-cyan-300")
|
|
1075
|
+
}, i < length - 1 && /* @__PURE__ */ React2.createElement("div", {
|
|
1076
|
+
className: "absolute left-[11.5px] top-[21px] w-[1px] h-[10px] bg-neutral-400"
|
|
1077
|
+
}), /* @__PURE__ */ React2.createElement(Icon, {
|
|
1078
|
+
icon: selected === i ? icon.regular : icon.regular,
|
|
1079
|
+
classNames: "z-10 !p-0 !w-[24px] !h-[24px] outline-none",
|
|
1080
|
+
onClick: () => onSelect?.(i)
|
|
1081
|
+
}));
|
|
1082
|
+
}));
|
|
1083
|
+
});
|
|
1084
|
+
|
|
1085
|
+
// packages/plugins/experimental/plugin-automation/src/components/Box/ToggleContainer.tsx
|
|
1086
|
+
import React3, { useEffect as useEffect5, useState as useState5 } from "react";
|
|
1087
|
+
import { Icon as Icon2, useControlledState } from "@dxos/react-ui";
|
|
1061
1088
|
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
1062
|
-
var ToggleContainer = ({ title, icon,
|
|
1063
|
-
const [
|
|
1064
|
-
const [expandX, setExpandX] =
|
|
1065
|
-
const [expandY, setExpandY] =
|
|
1066
|
-
|
|
1089
|
+
var ToggleContainer = ({ classNames, title, icon, open: _open, duration = 400, shrinkX = false, children, onChangeOpen }) => {
|
|
1090
|
+
const [open, setOpen] = useControlledState(_open);
|
|
1091
|
+
const [expandX, setExpandX] = useState5(shrinkX ? open : true);
|
|
1092
|
+
const [expandY, setExpandY] = useState5(open);
|
|
1093
|
+
useEffect5(() => {
|
|
1067
1094
|
let t;
|
|
1068
|
-
if (
|
|
1095
|
+
if (open) {
|
|
1069
1096
|
if (shrinkX) {
|
|
1070
1097
|
setExpandX(true);
|
|
1071
1098
|
}
|
|
@@ -1082,16 +1109,23 @@ var ToggleContainer = ({ title, icon, toggle, defaultOpen, duration = 400, shrin
|
|
|
1082
1109
|
}
|
|
1083
1110
|
return () => clearTimeout(t);
|
|
1084
1111
|
}, [
|
|
1085
|
-
|
|
1112
|
+
open
|
|
1086
1113
|
]);
|
|
1114
|
+
const handleToggle = () => {
|
|
1115
|
+
if (onChangeOpen) {
|
|
1116
|
+
onChangeOpen(!open);
|
|
1117
|
+
} else {
|
|
1118
|
+
setOpen((open2) => !open2);
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1087
1121
|
return /* @__PURE__ */ React3.createElement("div", {
|
|
1088
1122
|
className: mx3("overflow-hidden", classNames)
|
|
1089
1123
|
}, title && /* @__PURE__ */ React3.createElement("div", {
|
|
1090
1124
|
className: "flex gap-1 py-1 items-center text-sm text-subdued cursor-pointer select-none",
|
|
1091
|
-
onClick:
|
|
1092
|
-
},
|
|
1125
|
+
onClick: handleToggle
|
|
1126
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
1093
1127
|
className: "flex w-[24px] h-[24px] items-center justify-center"
|
|
1094
|
-
}, /* @__PURE__ */ React3.createElement(
|
|
1128
|
+
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
1095
1129
|
size: 4,
|
|
1096
1130
|
icon: "ph--caret-right--regular",
|
|
1097
1131
|
style: {
|
|
@@ -1099,7 +1133,7 @@ var ToggleContainer = ({ title, icon, toggle, defaultOpen, duration = 400, shrin
|
|
|
1099
1133
|
},
|
|
1100
1134
|
classNames: [
|
|
1101
1135
|
"transition transition-transform ease-in-out",
|
|
1102
|
-
|
|
1136
|
+
open ? "rotate-90" : "transform-none"
|
|
1103
1137
|
]
|
|
1104
1138
|
})), /* @__PURE__ */ React3.createElement("div", {
|
|
1105
1139
|
className: "flex-1 pis-1 pie-1 truncate"
|
|
@@ -1173,7 +1207,7 @@ var MarkdownViewer = ({ classNames, content = "" }) => {
|
|
|
1173
1207
|
};
|
|
1174
1208
|
|
|
1175
1209
|
// packages/plugins/experimental/plugin-automation/src/components/Thread/ThreadMessage.tsx
|
|
1176
|
-
var
|
|
1210
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/Thread/ThreadMessage.tsx";
|
|
1177
1211
|
var ThreadMessage = ({ classNames, message, collapse, debug, onSuggest, onDelete }) => {
|
|
1178
1212
|
if (typeof message !== "object") {
|
|
1179
1213
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
@@ -1184,32 +1218,41 @@ var ThreadMessage = ({ classNames, message, collapse, debug, onSuggest, onDelete
|
|
|
1184
1218
|
const toolBlocks = content.filter((block) => block.type === "tool_use" || block.type === "tool_result");
|
|
1185
1219
|
if (collapse && toolBlocks.length > 0) {
|
|
1186
1220
|
let request;
|
|
1187
|
-
const
|
|
1188
|
-
const lines = toolBlocks.map((block) => {
|
|
1221
|
+
const items = toolBlocks.map((block) => {
|
|
1189
1222
|
switch (block.type) {
|
|
1190
1223
|
case "tool_use": {
|
|
1191
1224
|
request = block;
|
|
1192
|
-
|
|
1193
|
-
|
|
1225
|
+
return {
|
|
1226
|
+
title: `Calling ${block.name}...`,
|
|
1227
|
+
block
|
|
1228
|
+
};
|
|
1194
1229
|
}
|
|
1195
1230
|
case "tool_result": {
|
|
1196
1231
|
if (!request) {
|
|
1197
1232
|
log6.warn("unexpected message", {
|
|
1198
|
-
|
|
1233
|
+
block
|
|
1199
1234
|
}, {
|
|
1200
|
-
F:
|
|
1201
|
-
L:
|
|
1235
|
+
F: __dxlog_file4,
|
|
1236
|
+
L: 54,
|
|
1202
1237
|
S: void 0,
|
|
1203
1238
|
C: (f, a) => f(...a)
|
|
1204
1239
|
});
|
|
1205
|
-
return
|
|
1240
|
+
return {
|
|
1241
|
+
title: "Error",
|
|
1242
|
+
block
|
|
1243
|
+
};
|
|
1206
1244
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1245
|
+
return {
|
|
1246
|
+
title: `Processed ${request.name}`,
|
|
1247
|
+
block
|
|
1248
|
+
};
|
|
1209
1249
|
}
|
|
1210
1250
|
default: {
|
|
1211
1251
|
request = void 0;
|
|
1212
|
-
return
|
|
1252
|
+
return {
|
|
1253
|
+
title: "Error",
|
|
1254
|
+
block
|
|
1255
|
+
};
|
|
1213
1256
|
}
|
|
1214
1257
|
}
|
|
1215
1258
|
});
|
|
@@ -1217,16 +1260,9 @@ var ThreadMessage = ({ classNames, message, collapse, debug, onSuggest, onDelete
|
|
|
1217
1260
|
className: mx5("flex", classNames)
|
|
1218
1261
|
}, /* @__PURE__ */ React5.createElement("div", {
|
|
1219
1262
|
className: "w-full p-1 px-2 overflow-hidden rounded-md bg-baseSurface"
|
|
1220
|
-
}, /* @__PURE__ */ React5.createElement(
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
autoAdvance: true
|
|
1224
|
-
}),
|
|
1225
|
-
toggle: true
|
|
1226
|
-
}, /* @__PURE__ */ React5.createElement(Json, {
|
|
1227
|
-
data: json,
|
|
1228
|
-
classNames: "!p-1 text-xs"
|
|
1229
|
-
}))));
|
|
1263
|
+
}, /* @__PURE__ */ React5.createElement(TabbedContainer, {
|
|
1264
|
+
items
|
|
1265
|
+
})));
|
|
1230
1266
|
}
|
|
1231
1267
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
1232
1268
|
className: mx5("flex flex-col shrink-0 gap-2")
|
|
@@ -1262,9 +1298,9 @@ var titles = {
|
|
|
1262
1298
|
};
|
|
1263
1299
|
var componentMap = {
|
|
1264
1300
|
text: ({ block }) => {
|
|
1265
|
-
|
|
1266
|
-
F:
|
|
1267
|
-
L:
|
|
1301
|
+
invariant5(block.type === "text", void 0, {
|
|
1302
|
+
F: __dxlog_file4,
|
|
1303
|
+
L: 128,
|
|
1268
1304
|
S: void 0,
|
|
1269
1305
|
A: [
|
|
1270
1306
|
"block.type === 'text'",
|
|
@@ -1282,13 +1318,12 @@ var componentMap = {
|
|
|
1282
1318
|
}
|
|
1283
1319
|
return /* @__PURE__ */ React5.createElement(ToggleContainer, {
|
|
1284
1320
|
title,
|
|
1285
|
-
icon: block.pending ? /* @__PURE__ */ React5.createElement(
|
|
1321
|
+
icon: block.pending ? /* @__PURE__ */ React5.createElement(Icon3, {
|
|
1286
1322
|
icon: "ph--circle-notch--regular",
|
|
1287
1323
|
classNames: "text-subdued ml-2 animate-spin",
|
|
1288
1324
|
size: 4
|
|
1289
1325
|
}) : void 0,
|
|
1290
|
-
|
|
1291
|
-
toggle: true
|
|
1326
|
+
open: block.disposition === "cot"
|
|
1292
1327
|
}, /* @__PURE__ */ React5.createElement(MarkdownViewer, {
|
|
1293
1328
|
content: block.text,
|
|
1294
1329
|
classNames: [
|
|
@@ -1297,9 +1332,9 @@ var componentMap = {
|
|
|
1297
1332
|
}));
|
|
1298
1333
|
},
|
|
1299
1334
|
json: ({ block, onSuggest }) => {
|
|
1300
|
-
|
|
1301
|
-
F:
|
|
1302
|
-
L:
|
|
1335
|
+
invariant5(block.type === "json", void 0, {
|
|
1336
|
+
F: __dxlog_file4,
|
|
1337
|
+
L: 152,
|
|
1303
1338
|
S: void 0,
|
|
1304
1339
|
A: [
|
|
1305
1340
|
"block.type === 'json'",
|
|
@@ -1323,8 +1358,7 @@ var componentMap = {
|
|
|
1323
1358
|
default: {
|
|
1324
1359
|
const title = block.disposition ? titles[block.disposition] : void 0;
|
|
1325
1360
|
return /* @__PURE__ */ React5.createElement(ToggleContainer, {
|
|
1326
|
-
title: title ?? "JSON"
|
|
1327
|
-
toggle: true
|
|
1361
|
+
title: title ?? "JSON"
|
|
1328
1362
|
}, /* @__PURE__ */ React5.createElement(Json, {
|
|
1329
1363
|
data: safeParseJson(block.json ?? block),
|
|
1330
1364
|
classNames: "!p-1 text-xs"
|
|
@@ -1338,21 +1372,58 @@ var componentMap = {
|
|
|
1338
1372
|
title = `Tool [${block.name}]`;
|
|
1339
1373
|
}
|
|
1340
1374
|
return /* @__PURE__ */ React5.createElement(ToggleContainer, {
|
|
1341
|
-
title: title ?? "JSON"
|
|
1342
|
-
toggle: true
|
|
1375
|
+
title: title ?? "JSON"
|
|
1343
1376
|
}, /* @__PURE__ */ React5.createElement(Json, {
|
|
1344
1377
|
data: block,
|
|
1345
1378
|
classNames: "!p-1 text-xs"
|
|
1346
1379
|
}));
|
|
1347
1380
|
}
|
|
1348
1381
|
};
|
|
1382
|
+
var TabbedContainer = ({ items }) => {
|
|
1383
|
+
const lines = items.map((item) => item.title);
|
|
1384
|
+
const tabsRef = useRef2(null);
|
|
1385
|
+
const [selected, setSelected] = useState6(0);
|
|
1386
|
+
const [open, setOpen] = useState6(false);
|
|
1387
|
+
useEffect6(() => {
|
|
1388
|
+
if (open) {
|
|
1389
|
+
tabsRef.current?.focus();
|
|
1390
|
+
}
|
|
1391
|
+
}, [
|
|
1392
|
+
open
|
|
1393
|
+
]);
|
|
1394
|
+
const handleSelect = (index) => {
|
|
1395
|
+
if (index === selected) {
|
|
1396
|
+
setOpen(false);
|
|
1397
|
+
} else {
|
|
1398
|
+
setSelected(index);
|
|
1399
|
+
}
|
|
1400
|
+
};
|
|
1401
|
+
return /* @__PURE__ */ React5.createElement(ToggleContainer, {
|
|
1402
|
+
title: /* @__PURE__ */ React5.createElement(StatusLine, {
|
|
1403
|
+
lines,
|
|
1404
|
+
autoAdvance: true
|
|
1405
|
+
}),
|
|
1406
|
+
open,
|
|
1407
|
+
onChangeOpen: setOpen
|
|
1408
|
+
}, /* @__PURE__ */ React5.createElement("div", {
|
|
1409
|
+
className: "flex gap-2 w-full"
|
|
1410
|
+
}, /* @__PURE__ */ React5.createElement(Tabs, {
|
|
1411
|
+
ref: tabsRef,
|
|
1412
|
+
length: items.length,
|
|
1413
|
+
selected,
|
|
1414
|
+
onSelect: handleSelect
|
|
1415
|
+
}), /* @__PURE__ */ React5.createElement(Json, {
|
|
1416
|
+
data: items[selected].block,
|
|
1417
|
+
classNames: "!p-1 text-xs"
|
|
1418
|
+
})));
|
|
1419
|
+
};
|
|
1349
1420
|
|
|
1350
1421
|
// packages/plugins/experimental/plugin-automation/src/components/Thread/Thread.tsx
|
|
1351
1422
|
var Thread = ({ messages, streaming, collapse, debug, onSubmit, onStop, onSuggest, onDelete }) => {
|
|
1352
1423
|
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
1353
1424
|
const scroller = useRef3(null);
|
|
1354
1425
|
const [text, setText] = useState7("");
|
|
1355
|
-
const handleKeyDown =
|
|
1426
|
+
const handleKeyDown = useCallback((ev) => {
|
|
1356
1427
|
switch (ev.key) {
|
|
1357
1428
|
case "Escape": {
|
|
1358
1429
|
setText("");
|
|
@@ -1466,7 +1537,7 @@ var Thread = ({ messages, streaming, collapse, debug, onSubmit, onStop, onSugges
|
|
|
1466
1537
|
};
|
|
1467
1538
|
|
|
1468
1539
|
// packages/plugins/experimental/plugin-automation/src/components/ChatContainer/ChatContainer.tsx
|
|
1469
|
-
var
|
|
1540
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/ChatContainer/ChatContainer.tsx";
|
|
1470
1541
|
var ChatContainer = ({ chat, role }) => {
|
|
1471
1542
|
const processor = useChatProcessor(chat);
|
|
1472
1543
|
const messageQueue = useMessageQueue(chat);
|
|
@@ -1474,12 +1545,12 @@ var ChatContainer = ({ chat, role }) => {
|
|
|
1474
1545
|
...messageQueue?.items ?? [],
|
|
1475
1546
|
...processor.messages.value
|
|
1476
1547
|
];
|
|
1477
|
-
const handleSubmit =
|
|
1548
|
+
const handleSubmit = useCallback2(async (text) => {
|
|
1478
1549
|
if (processor.streaming.value) {
|
|
1479
1550
|
await processor.cancel();
|
|
1480
1551
|
}
|
|
1481
|
-
|
|
1482
|
-
F:
|
|
1552
|
+
invariant6(messageQueue, void 0, {
|
|
1553
|
+
F: __dxlog_file5,
|
|
1483
1554
|
L: 25,
|
|
1484
1555
|
S: void 0,
|
|
1485
1556
|
A: [
|
|
@@ -1495,7 +1566,7 @@ var ChatContainer = ({ chat, role }) => {
|
|
|
1495
1566
|
processor,
|
|
1496
1567
|
messageQueue
|
|
1497
1568
|
]);
|
|
1498
|
-
const handleStop =
|
|
1569
|
+
const handleStop = useCallback2(() => {
|
|
1499
1570
|
if (processor.streaming.value) {
|
|
1500
1571
|
void processor.cancel();
|
|
1501
1572
|
}
|
|
@@ -1529,4 +1600,4 @@ export {
|
|
|
1529
1600
|
IntentResolver,
|
|
1530
1601
|
ReactSurface
|
|
1531
1602
|
};
|
|
1532
|
-
//# sourceMappingURL=chunk-
|
|
1603
|
+
//# sourceMappingURL=chunk-QP47VJT6.mjs.map
|