@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
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_CJGJXNY3_exports = {};
|
|
30
|
+
__export(chunk_CJGJXNY3_exports, {
|
|
31
31
|
AiClient: () => AiClient,
|
|
32
32
|
AppGraphBuilder: () => AppGraphBuilder,
|
|
33
33
|
ChatContainer: () => ChatContainer,
|
|
@@ -38,10 +38,10 @@ __export(chunk_NH7STAX6_exports, {
|
|
|
38
38
|
Thread: () => Thread,
|
|
39
39
|
useServices: () => useServices
|
|
40
40
|
});
|
|
41
|
-
module.exports = __toCommonJS(
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
41
|
+
module.exports = __toCommonJS(chunk_CJGJXNY3_exports);
|
|
42
|
+
var import_chunk_U5Z7LFWB = require("./chunk-U5Z7LFWB.cjs");
|
|
43
|
+
var import_chunk_GB7245FH = require("./chunk-GB7245FH.cjs");
|
|
44
|
+
var import_chunk_EQYHOTGG = require("./chunk-EQYHOTGG.cjs");
|
|
45
45
|
var import_react = __toESM(require("react"));
|
|
46
46
|
var import_invariant = require("@dxos/invariant");
|
|
47
47
|
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
@@ -95,22 +95,23 @@ var import_echo_schema4 = require("@dxos/echo-schema");
|
|
|
95
95
|
var import_echo_schema5 = require("@dxos/echo-schema");
|
|
96
96
|
var import_react6 = __toESM(require("react"));
|
|
97
97
|
var import_react_ui = require("@dxos/react-ui");
|
|
98
|
+
var import_react_ui_components = require("@dxos/react-ui-components");
|
|
98
99
|
var import_react_ui_sfx = require("@dxos/react-ui-sfx");
|
|
99
100
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
100
101
|
var import_react7 = __toESM(require("react"));
|
|
101
102
|
var import_invariant6 = require("@dxos/invariant");
|
|
102
|
-
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
103
|
-
var import_react8 = __toESM(require("react"));
|
|
104
|
-
var import_invariant7 = require("@dxos/invariant");
|
|
105
103
|
var import_log6 = require("@dxos/log");
|
|
106
104
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
107
105
|
var import_react_ui_syntax_highlighter = require("@dxos/react-ui-syntax-highlighter");
|
|
108
|
-
var
|
|
106
|
+
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
109
107
|
var import_util3 = require("@dxos/util");
|
|
108
|
+
var import_react8 = __toESM(require("react"));
|
|
109
|
+
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
110
110
|
var import_react9 = __toESM(require("react"));
|
|
111
|
+
var import_react_ui3 = require("@dxos/react-ui");
|
|
111
112
|
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
112
113
|
var import_react10 = __toESM(require("react"));
|
|
113
|
-
var
|
|
114
|
+
var import_react_ui4 = require("@dxos/react-ui");
|
|
114
115
|
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
115
116
|
var import_react11 = __toESM(require("react"));
|
|
116
117
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
@@ -326,10 +327,10 @@ var ChatProcessor = class {
|
|
|
326
327
|
}
|
|
327
328
|
}
|
|
328
329
|
};
|
|
329
|
-
var AiClient = (0, import_app_framework2.lazy)(() => import("./ai-client-
|
|
330
|
-
var AppGraphBuilder = (0, import_app_framework2.lazy)(() => import("./app-graph-builder-
|
|
331
|
-
var IntentResolver = (0, import_app_framework2.lazy)(() => import("./intent-resolver-
|
|
332
|
-
var ReactSurface = (0, import_app_framework2.lazy)(() => import("./react-surface-
|
|
330
|
+
var AiClient = (0, import_app_framework2.lazy)(() => import("./ai-client-FKLPDELV.cjs"));
|
|
331
|
+
var AppGraphBuilder = (0, import_app_framework2.lazy)(() => import("./app-graph-builder-T76NYV42.cjs"));
|
|
332
|
+
var IntentResolver = (0, import_app_framework2.lazy)(() => import("./intent-resolver-C6OKFVEW.cjs"));
|
|
333
|
+
var ReactSurface = (0, import_app_framework2.lazy)(() => import("./react-surface-LWDY7SQG.cjs"));
|
|
333
334
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/tools/function.ts";
|
|
334
335
|
var covertFunctionToTool = (fn, edgeUrl, spaceId) => {
|
|
335
336
|
if (!fn.description || !fn.inputSchema) {
|
|
@@ -748,12 +749,12 @@ var isV3_1 = (document) => {
|
|
|
748
749
|
return document.openapi === "3.0.1";
|
|
749
750
|
};
|
|
750
751
|
var useChatProcessor = (chat) => {
|
|
751
|
-
const aiClient = (0, import_app_framework.useCapability)(
|
|
752
|
+
const aiClient = (0, import_app_framework.useCapability)(import_chunk_U5Z7LFWB.AutomationCapabilities.AiClient);
|
|
752
753
|
const globalTools = (0, import_app_framework.useCapabilities)(import_app_framework.Capabilities.Tools);
|
|
753
754
|
const artifactDefinitions = (0, import_app_framework.useCapabilities)(import_app_framework.Capabilities.ArtifactDefinition);
|
|
754
755
|
const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
|
|
755
756
|
const space = (0, import_echo.getSpace)(chat);
|
|
756
|
-
const services = (0, import_echo.useQuery)(space, import_echo.Filter.schema(
|
|
757
|
+
const services = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_chunk_GB7245FH.ServiceType));
|
|
757
758
|
const [serviceTools, setServiceTools] = (0, import_react2.useState)([]);
|
|
758
759
|
(0, import_react2.useEffect)(() => {
|
|
759
760
|
queueMicrotask(async () => {
|
|
@@ -855,7 +856,7 @@ var VISUAL_CROSSING_CREDENTIALS = {
|
|
|
855
856
|
}
|
|
856
857
|
};
|
|
857
858
|
var TEST_SERVICES = [
|
|
858
|
-
(0, import_echo_schema5.createStatic)(
|
|
859
|
+
(0, import_echo_schema5.createStatic)(import_chunk_GB7245FH.ServiceType, {
|
|
859
860
|
serviceId: "amadeus.com/service/FlightSearch",
|
|
860
861
|
name: "Amadeus Flight Search",
|
|
861
862
|
description: "Search for local and international flights.",
|
|
@@ -868,7 +869,7 @@ var TEST_SERVICES = [
|
|
|
868
869
|
}
|
|
869
870
|
]
|
|
870
871
|
}),
|
|
871
|
-
(0, import_echo_schema5.createStatic)(
|
|
872
|
+
(0, import_echo_schema5.createStatic)(import_chunk_GB7245FH.ServiceType, {
|
|
872
873
|
serviceId: "amadeus.com/service/HotelSearch",
|
|
873
874
|
name: "Amadeus Hotel Search",
|
|
874
875
|
description: "Search for local and international hotels.",
|
|
@@ -881,7 +882,7 @@ var TEST_SERVICES = [
|
|
|
881
882
|
}
|
|
882
883
|
]
|
|
883
884
|
}),
|
|
884
|
-
(0, import_echo_schema5.createStatic)(
|
|
885
|
+
(0, import_echo_schema5.createStatic)(import_chunk_GB7245FH.ServiceType, {
|
|
885
886
|
serviceId: "visualcrossing.com/service/Weather",
|
|
886
887
|
name: "Visual Crossing Weather",
|
|
887
888
|
description: "Search for global weather forecasts.",
|
|
@@ -895,7 +896,7 @@ var TEST_SERVICES = [
|
|
|
895
896
|
]
|
|
896
897
|
}),
|
|
897
898
|
// TODO(burdon): Needs auth.
|
|
898
|
-
(0, import_echo_schema5.createStatic)(
|
|
899
|
+
(0, import_echo_schema5.createStatic)(import_chunk_GB7245FH.ServiceType, {
|
|
899
900
|
serviceId: "abstractapi.com/service/GeoLocation",
|
|
900
901
|
name: "Abstract GeoLocation",
|
|
901
902
|
description: "Get the location of any IP address.",
|
|
@@ -912,11 +913,11 @@ var TEST_SERVICES = [
|
|
|
912
913
|
//
|
|
913
914
|
...Array.from({
|
|
914
915
|
length: 20
|
|
915
|
-
}, (_, i) => (0, import_echo_schema5.createStatic)(
|
|
916
|
+
}, (_, i) => (0, import_echo_schema5.createStatic)(import_chunk_GB7245FH.ServiceType, {
|
|
916
917
|
serviceId: `example.com/service/test-${i}`,
|
|
917
918
|
name: `Test ${i}`,
|
|
918
919
|
description: `Test ${i}`,
|
|
919
|
-
category: Object.keys(
|
|
920
|
+
category: Object.keys(import_chunk_GB7245FH.categoryIcons)[Math.floor(Math.random() * Object.keys(import_chunk_GB7245FH.categoryIcons).length)],
|
|
920
921
|
interfaces: [
|
|
921
922
|
{
|
|
922
923
|
kind: "api",
|
|
@@ -940,81 +941,16 @@ var useServices = (space, query) => {
|
|
|
940
941
|
]);
|
|
941
942
|
return services;
|
|
942
943
|
};
|
|
943
|
-
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/Thread/ScrollContainer.tsx";
|
|
944
|
-
var ScrollContainer = /* @__PURE__ */ (0, import_react7.forwardRef)(({ children, classNames }, forwardedRef) => {
|
|
945
|
-
const containerRef = (0, import_react7.useRef)(null);
|
|
946
|
-
const autoScrollRef = (0, import_react7.useRef)(false);
|
|
947
|
-
(0, import_react7.useImperativeHandle)(forwardedRef, () => ({
|
|
948
|
-
scrollToBottom: () => {
|
|
949
|
-
(0, import_invariant6.invariant)(containerRef.current, void 0, {
|
|
950
|
-
F: __dxlog_file4,
|
|
951
|
-
L: 41,
|
|
952
|
-
S: void 0,
|
|
953
|
-
A: [
|
|
954
|
-
"containerRef.current",
|
|
955
|
-
""
|
|
956
|
-
]
|
|
957
|
-
});
|
|
958
|
-
containerRef.current.scrollTo({
|
|
959
|
-
top: containerRef.current.scrollHeight,
|
|
960
|
-
behavior: "smooth"
|
|
961
|
-
});
|
|
962
|
-
autoScrollRef.current = false;
|
|
963
|
-
}
|
|
964
|
-
}), []);
|
|
965
|
-
const [sticky, setSticky] = (0, import_react7.useState)(true);
|
|
966
|
-
(0, import_react7.useEffect)(() => {
|
|
967
|
-
if (!sticky || !containerRef.current) {
|
|
968
|
-
return;
|
|
969
|
-
}
|
|
970
|
-
autoScrollRef.current = true;
|
|
971
|
-
containerRef.current.scrollTo({
|
|
972
|
-
top: containerRef.current.scrollHeight,
|
|
973
|
-
behavior: "smooth"
|
|
974
|
-
});
|
|
975
|
-
}, [
|
|
976
|
-
children
|
|
977
|
-
]);
|
|
978
|
-
(0, import_react7.useEffect)(() => {
|
|
979
|
-
(0, import_invariant6.invariant)(containerRef.current, void 0, {
|
|
980
|
-
F: __dxlog_file4,
|
|
981
|
-
L: 62,
|
|
982
|
-
S: void 0,
|
|
983
|
-
A: [
|
|
984
|
-
"containerRef.current",
|
|
985
|
-
""
|
|
986
|
-
]
|
|
987
|
-
});
|
|
988
|
-
const handleScrollEnd = () => {
|
|
989
|
-
autoScrollRef.current = false;
|
|
990
|
-
};
|
|
991
|
-
containerRef.current.addEventListener("scrollend", handleScrollEnd);
|
|
992
|
-
return () => containerRef.current?.removeEventListener("scrollend", handleScrollEnd);
|
|
993
|
-
}, []);
|
|
994
|
-
const handleScroll = (0, import_react7.useCallback)((ev) => {
|
|
995
|
-
if (autoScrollRef.current) {
|
|
996
|
-
return;
|
|
997
|
-
}
|
|
998
|
-
const { scrollTop, clientHeight, scrollHeight } = ev.currentTarget;
|
|
999
|
-
const sticky2 = scrollTop + clientHeight >= scrollHeight;
|
|
1000
|
-
setSticky(sticky2);
|
|
1001
|
-
}, []);
|
|
1002
|
-
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1003
|
-
ref: containerRef,
|
|
1004
|
-
onScroll: handleScroll,
|
|
1005
|
-
className: (0, import_react_ui_theme2.mx)("flex flex-col grow overflow-y-scroll scrollbar-none", classNames)
|
|
1006
|
-
}, children);
|
|
1007
|
-
});
|
|
1008
944
|
var emptyLines = [];
|
|
1009
945
|
var StatusLine = ({ classNames, line = -1, lines = emptyLines, transition = 300, advance = 1e3, autoAdvance }) => {
|
|
1010
|
-
const containerRef = (0,
|
|
1011
|
-
const [currentLine, setCurrentLine] = (0,
|
|
1012
|
-
(0,
|
|
946
|
+
const containerRef = (0, import_react8.useRef)(null);
|
|
947
|
+
const [currentLine, setCurrentLine] = (0, import_react8.useState)(line);
|
|
948
|
+
(0, import_react8.useEffect)(() => {
|
|
1013
949
|
setCurrentLine(line);
|
|
1014
950
|
}, [
|
|
1015
951
|
line
|
|
1016
952
|
]);
|
|
1017
|
-
(0,
|
|
953
|
+
(0, import_react8.useEffect)(() => {
|
|
1018
954
|
if (!autoAdvance) {
|
|
1019
955
|
return;
|
|
1020
956
|
}
|
|
@@ -1035,7 +971,7 @@ var StatusLine = ({ classNames, line = -1, lines = emptyLines, transition = 300,
|
|
|
1035
971
|
autoAdvance,
|
|
1036
972
|
advance
|
|
1037
973
|
]);
|
|
1038
|
-
(0,
|
|
974
|
+
(0, import_react8.useEffect)(() => {
|
|
1039
975
|
if (containerRef.current) {
|
|
1040
976
|
containerRef.current.style.transition = `transform ${transition}ms ease-in-out`;
|
|
1041
977
|
containerRef.current.style.transform = `translateY(-${currentLine * 24}px)`;
|
|
@@ -1043,27 +979,118 @@ var StatusLine = ({ classNames, line = -1, lines = emptyLines, transition = 300,
|
|
|
1043
979
|
}, [
|
|
1044
980
|
currentLine
|
|
1045
981
|
]);
|
|
1046
|
-
return /* @__PURE__ */
|
|
1047
|
-
className: (0,
|
|
1048
|
-
}, /* @__PURE__ */
|
|
982
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
983
|
+
className: (0, import_react_ui_theme3.mx)("relative h-[24px] overflow-hidden", classNames)
|
|
984
|
+
}, /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
1049
985
|
ref: containerRef,
|
|
1050
986
|
className: "h-[24px]"
|
|
1051
|
-
}, /* @__PURE__ */
|
|
987
|
+
}, /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
1052
988
|
className: "flex flex-col"
|
|
1053
|
-
}, lines.map((line2, i) => /* @__PURE__ */
|
|
989
|
+
}, lines.map((line2, i) => /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
1054
990
|
key: i,
|
|
1055
|
-
className: (0,
|
|
1056
|
-
}, /* @__PURE__ */
|
|
991
|
+
className: (0, import_react_ui_theme3.mx)("flex h-[24px] items-center")
|
|
992
|
+
}, /* @__PURE__ */ import_react8.default.createElement("span", {
|
|
1057
993
|
className: "truncate"
|
|
1058
994
|
}, line2))))));
|
|
1059
995
|
};
|
|
1060
|
-
var
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
996
|
+
var numbers = [
|
|
997
|
+
{
|
|
998
|
+
regular: "ph--number-circle-zero--thin",
|
|
999
|
+
active: "ph--number-circle-zero--duotone"
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
regular: "ph--number-circle-one--thin",
|
|
1003
|
+
active: "ph--number-circle-one--duotone"
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
regular: "ph--number-circle-two--thin",
|
|
1007
|
+
active: "ph--number-circle-two--duotone"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
regular: "ph--number-circle-three--thin",
|
|
1011
|
+
active: "ph--number-circle-three--duotone"
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
regular: "ph--number-circle-four--thin",
|
|
1015
|
+
active: "ph--number-circle-four--duotone"
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
regular: "ph--number-circle-five--thin",
|
|
1019
|
+
active: "ph--number-circle-five--duotone"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
regular: "ph--number-circle-six--thin",
|
|
1023
|
+
active: "ph--number-circle-six--duotone"
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
regular: "ph--number-circle-seven--thin",
|
|
1027
|
+
active: "ph--number-circle-seven--duotone"
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
regular: "ph--number-circle-eight--thin",
|
|
1031
|
+
active: "ph--number-circle-eight--duotone"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
regular: "ph--number-circle-nine--thin",
|
|
1035
|
+
active: "ph--number-circle-nine--duotone"
|
|
1036
|
+
}
|
|
1037
|
+
];
|
|
1038
|
+
var Tabs = /* @__PURE__ */ (0, import_react9.forwardRef)(({ classNames, length, selected = 0, onSelect }, forwardedRef) => {
|
|
1039
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
1040
|
+
ref: forwardedRef,
|
|
1041
|
+
className: (0, import_react_ui_theme4.mx)("flex flex-col overflow-hidden outline-none", classNames),
|
|
1042
|
+
tabIndex: -1,
|
|
1043
|
+
onKeyDown: (ev) => {
|
|
1044
|
+
switch (ev.key) {
|
|
1045
|
+
case "ArrowDown":
|
|
1046
|
+
case "ArrowRight": {
|
|
1047
|
+
ev.preventDefault();
|
|
1048
|
+
ev.stopPropagation();
|
|
1049
|
+
if (selected < length - 1) {
|
|
1050
|
+
onSelect?.(selected + 1);
|
|
1051
|
+
}
|
|
1052
|
+
break;
|
|
1053
|
+
}
|
|
1054
|
+
case "ArrowUp":
|
|
1055
|
+
case "ArrowLeft": {
|
|
1056
|
+
ev.preventDefault();
|
|
1057
|
+
ev.stopPropagation();
|
|
1058
|
+
if (selected > 0) {
|
|
1059
|
+
onSelect?.(selected - 1);
|
|
1060
|
+
}
|
|
1061
|
+
break;
|
|
1062
|
+
}
|
|
1063
|
+
case "Enter": {
|
|
1064
|
+
ev.preventDefault();
|
|
1065
|
+
ev.stopPropagation();
|
|
1066
|
+
onSelect?.(selected);
|
|
1067
|
+
break;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}, Array.from({
|
|
1072
|
+
length
|
|
1073
|
+
}).map((_, i) => {
|
|
1074
|
+
const icon = numbers[i + 1];
|
|
1075
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
1076
|
+
key: i,
|
|
1077
|
+
className: (0, import_react_ui_theme4.mx)("relative flex w-[24px] h-[28px] justify-center cursor-pointer text-subdued", selected === i && "!text-cyan-550 !dark:text-cyan-300")
|
|
1078
|
+
}, i < length - 1 && /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
1079
|
+
className: "absolute left-[11.5px] top-[21px] w-[1px] h-[10px] bg-neutral-400"
|
|
1080
|
+
}), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Icon, {
|
|
1081
|
+
icon: selected === i ? icon.regular : icon.regular,
|
|
1082
|
+
classNames: "z-10 !p-0 !w-[24px] !h-[24px] outline-none",
|
|
1083
|
+
onClick: () => onSelect?.(i)
|
|
1084
|
+
}));
|
|
1085
|
+
}));
|
|
1086
|
+
});
|
|
1087
|
+
var ToggleContainer = ({ classNames, title, icon, open: _open, duration = 400, shrinkX = false, children, onChangeOpen }) => {
|
|
1088
|
+
const [open, setOpen] = (0, import_react_ui4.useControlledState)(_open);
|
|
1089
|
+
const [expandX, setExpandX] = (0, import_react10.useState)(shrinkX ? open : true);
|
|
1090
|
+
const [expandY, setExpandY] = (0, import_react10.useState)(open);
|
|
1064
1091
|
(0, import_react10.useEffect)(() => {
|
|
1065
1092
|
let t;
|
|
1066
|
-
if (
|
|
1093
|
+
if (open) {
|
|
1067
1094
|
if (shrinkX) {
|
|
1068
1095
|
setExpandX(true);
|
|
1069
1096
|
}
|
|
@@ -1080,16 +1107,23 @@ var ToggleContainer = ({ title, icon, toggle, defaultOpen, duration = 400, shrin
|
|
|
1080
1107
|
}
|
|
1081
1108
|
return () => clearTimeout(t);
|
|
1082
1109
|
}, [
|
|
1083
|
-
|
|
1110
|
+
open
|
|
1084
1111
|
]);
|
|
1112
|
+
const handleToggle = () => {
|
|
1113
|
+
if (onChangeOpen) {
|
|
1114
|
+
onChangeOpen(!open);
|
|
1115
|
+
} else {
|
|
1116
|
+
setOpen((open2) => !open2);
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1085
1119
|
return /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
1086
1120
|
className: (0, import_react_ui_theme5.mx)("overflow-hidden", classNames)
|
|
1087
1121
|
}, title && /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
1088
1122
|
className: "flex gap-1 py-1 items-center text-sm text-subdued cursor-pointer select-none",
|
|
1089
|
-
onClick:
|
|
1090
|
-
},
|
|
1123
|
+
onClick: handleToggle
|
|
1124
|
+
}, /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
1091
1125
|
className: "flex w-[24px] h-[24px] items-center justify-center"
|
|
1092
|
-
}, /* @__PURE__ */ import_react10.default.createElement(
|
|
1126
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui4.Icon, {
|
|
1093
1127
|
size: 4,
|
|
1094
1128
|
icon: "ph--caret-right--regular",
|
|
1095
1129
|
style: {
|
|
@@ -1097,7 +1131,7 @@ var ToggleContainer = ({ title, icon, toggle, defaultOpen, duration = 400, shrin
|
|
|
1097
1131
|
},
|
|
1098
1132
|
classNames: [
|
|
1099
1133
|
"transition transition-transform ease-in-out",
|
|
1100
|
-
|
|
1134
|
+
open ? "rotate-90" : "transform-none"
|
|
1101
1135
|
]
|
|
1102
1136
|
})), /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
1103
1137
|
className: "flex-1 pis-1 pie-1 truncate"
|
|
@@ -1162,72 +1196,74 @@ var MarkdownViewer = ({ classNames, content = "" }) => {
|
|
|
1162
1196
|
}
|
|
1163
1197
|
}, content));
|
|
1164
1198
|
};
|
|
1165
|
-
var
|
|
1199
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/Thread/ThreadMessage.tsx";
|
|
1166
1200
|
var ThreadMessage = ({ classNames, message, collapse, debug, onSuggest, onDelete }) => {
|
|
1167
1201
|
if (typeof message !== "object") {
|
|
1168
|
-
return /* @__PURE__ */
|
|
1169
|
-
className: (0,
|
|
1202
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1203
|
+
className: (0, import_react_ui_theme2.mx)(classNames)
|
|
1170
1204
|
}, message);
|
|
1171
1205
|
}
|
|
1172
1206
|
const { role, content = [] } = message;
|
|
1173
1207
|
const toolBlocks = content.filter((block) => block.type === "tool_use" || block.type === "tool_result");
|
|
1174
1208
|
if (collapse && toolBlocks.length > 0) {
|
|
1175
1209
|
let request;
|
|
1176
|
-
const
|
|
1177
|
-
const lines = toolBlocks.map((block) => {
|
|
1210
|
+
const items = toolBlocks.map((block) => {
|
|
1178
1211
|
switch (block.type) {
|
|
1179
1212
|
case "tool_use": {
|
|
1180
1213
|
request = block;
|
|
1181
|
-
|
|
1182
|
-
|
|
1214
|
+
return {
|
|
1215
|
+
title: `Calling ${block.name}...`,
|
|
1216
|
+
block
|
|
1217
|
+
};
|
|
1183
1218
|
}
|
|
1184
1219
|
case "tool_result": {
|
|
1185
1220
|
if (!request) {
|
|
1186
1221
|
import_log6.log.warn("unexpected message", {
|
|
1187
|
-
|
|
1222
|
+
block
|
|
1188
1223
|
}, {
|
|
1189
|
-
F:
|
|
1190
|
-
L:
|
|
1224
|
+
F: __dxlog_file4,
|
|
1225
|
+
L: 54,
|
|
1191
1226
|
S: void 0,
|
|
1192
1227
|
C: (f, a) => f(...a)
|
|
1193
1228
|
});
|
|
1194
|
-
return
|
|
1229
|
+
return {
|
|
1230
|
+
title: "Error",
|
|
1231
|
+
block
|
|
1232
|
+
};
|
|
1195
1233
|
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1234
|
+
return {
|
|
1235
|
+
title: `Processed ${request.name}`,
|
|
1236
|
+
block
|
|
1237
|
+
};
|
|
1198
1238
|
}
|
|
1199
1239
|
default: {
|
|
1200
1240
|
request = void 0;
|
|
1201
|
-
return
|
|
1241
|
+
return {
|
|
1242
|
+
title: "Error",
|
|
1243
|
+
block
|
|
1244
|
+
};
|
|
1202
1245
|
}
|
|
1203
1246
|
}
|
|
1204
1247
|
});
|
|
1205
|
-
return /* @__PURE__ */
|
|
1206
|
-
className: (0,
|
|
1207
|
-
}, /* @__PURE__ */
|
|
1248
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1249
|
+
className: (0, import_react_ui_theme2.mx)("flex", classNames)
|
|
1250
|
+
}, /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1208
1251
|
className: "w-full p-1 px-2 overflow-hidden rounded-md bg-baseSurface"
|
|
1209
|
-
}, /* @__PURE__ */
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
autoAdvance: true
|
|
1213
|
-
}),
|
|
1214
|
-
toggle: true
|
|
1215
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui_syntax_highlighter.Json, {
|
|
1216
|
-
data: json,
|
|
1217
|
-
classNames: "!p-1 text-xs"
|
|
1218
|
-
}))));
|
|
1252
|
+
}, /* @__PURE__ */ import_react7.default.createElement(TabbedContainer, {
|
|
1253
|
+
items
|
|
1254
|
+
})));
|
|
1219
1255
|
}
|
|
1220
|
-
return /* @__PURE__ */
|
|
1221
|
-
className: (0,
|
|
1222
|
-
}, debug && /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1257
|
+
className: (0, import_react_ui_theme2.mx)("flex flex-col shrink-0 gap-2")
|
|
1258
|
+
}, debug && /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1223
1259
|
className: "text-xs text-subdued"
|
|
1224
|
-
}, message.id, " ", onDelete && /* @__PURE__ */
|
|
1260
|
+
}, message.id, " ", onDelete && /* @__PURE__ */ import_react7.default.createElement("span", {
|
|
1225
1261
|
className: "cursor-pointer underline",
|
|
1226
1262
|
onClick: () => onDelete(message.id)
|
|
1227
|
-
}, "delete")), content.map((block, idx) => /* @__PURE__ */
|
|
1263
|
+
}, "delete")), content.map((block, idx) => /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1228
1264
|
key: idx,
|
|
1229
|
-
className: (0,
|
|
1230
|
-
}, /* @__PURE__ */
|
|
1265
|
+
className: (0, import_react_ui_theme2.mx)("flex", classNames, block.type === "text" && role === "user" && "justify-end")
|
|
1266
|
+
}, /* @__PURE__ */ import_react7.default.createElement(Block, {
|
|
1231
1267
|
role,
|
|
1232
1268
|
block,
|
|
1233
1269
|
onSuggest: onSuggest ?? (() => {
|
|
@@ -1236,9 +1272,9 @@ var ThreadMessage = ({ classNames, message, collapse, debug, onSuggest, onDelete
|
|
|
1236
1272
|
};
|
|
1237
1273
|
var Block = ({ block, role, onSuggest }) => {
|
|
1238
1274
|
const Component = componentMap[block.type] ?? componentMap.default;
|
|
1239
|
-
return /* @__PURE__ */
|
|
1240
|
-
className: (0,
|
|
1241
|
-
}, /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1276
|
+
className: (0, import_react_ui_theme2.mx)("p-1 px-2 overflow-hidden rounded-md", (block.type !== "text" || block.disposition) && "w-full bg-baseSurface", block.type === "text" && role === "user" && "bg-primary-200 dark:bg-primary-500")
|
|
1277
|
+
}, /* @__PURE__ */ import_react7.default.createElement(Component, {
|
|
1242
1278
|
block,
|
|
1243
1279
|
onSuggest
|
|
1244
1280
|
}));
|
|
@@ -1251,9 +1287,9 @@ var titles = {
|
|
|
1251
1287
|
};
|
|
1252
1288
|
var componentMap = {
|
|
1253
1289
|
text: ({ block }) => {
|
|
1254
|
-
(0,
|
|
1255
|
-
F:
|
|
1256
|
-
L:
|
|
1290
|
+
(0, import_invariant6.invariant)(block.type === "text", void 0, {
|
|
1291
|
+
F: __dxlog_file4,
|
|
1292
|
+
L: 128,
|
|
1257
1293
|
S: void 0,
|
|
1258
1294
|
A: [
|
|
1259
1295
|
"block.type === 'text'",
|
|
@@ -1262,23 +1298,22 @@ var componentMap = {
|
|
|
1262
1298
|
});
|
|
1263
1299
|
const title = block.disposition ? titles[block.disposition] : void 0;
|
|
1264
1300
|
if (!title) {
|
|
1265
|
-
return /* @__PURE__ */
|
|
1301
|
+
return /* @__PURE__ */ import_react7.default.createElement(MarkdownViewer, {
|
|
1266
1302
|
content: block.text,
|
|
1267
1303
|
classNames: [
|
|
1268
1304
|
block.disposition === "cot" && "text-sm text-subdued"
|
|
1269
1305
|
]
|
|
1270
1306
|
});
|
|
1271
1307
|
}
|
|
1272
|
-
return /* @__PURE__ */
|
|
1308
|
+
return /* @__PURE__ */ import_react7.default.createElement(ToggleContainer, {
|
|
1273
1309
|
title,
|
|
1274
|
-
icon: block.pending ? /* @__PURE__ */
|
|
1310
|
+
icon: block.pending ? /* @__PURE__ */ import_react7.default.createElement(import_react_ui2.Icon, {
|
|
1275
1311
|
icon: "ph--circle-notch--regular",
|
|
1276
1312
|
classNames: "text-subdued ml-2 animate-spin",
|
|
1277
1313
|
size: 4
|
|
1278
1314
|
}) : void 0,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
}, /* @__PURE__ */ import_react8.default.createElement(MarkdownViewer, {
|
|
1315
|
+
open: block.disposition === "cot"
|
|
1316
|
+
}, /* @__PURE__ */ import_react7.default.createElement(MarkdownViewer, {
|
|
1282
1317
|
content: block.text,
|
|
1283
1318
|
classNames: [
|
|
1284
1319
|
block.disposition === "cot" && "text-sm text-subdued"
|
|
@@ -1286,9 +1321,9 @@ var componentMap = {
|
|
|
1286
1321
|
}));
|
|
1287
1322
|
},
|
|
1288
1323
|
json: ({ block, onSuggest }) => {
|
|
1289
|
-
(0,
|
|
1290
|
-
F:
|
|
1291
|
-
L:
|
|
1324
|
+
(0, import_invariant6.invariant)(block.type === "json", void 0, {
|
|
1325
|
+
F: __dxlog_file4,
|
|
1326
|
+
L: 152,
|
|
1292
1327
|
S: void 0,
|
|
1293
1328
|
A: [
|
|
1294
1329
|
"block.type === 'json'",
|
|
@@ -1298,23 +1333,22 @@ var componentMap = {
|
|
|
1298
1333
|
switch (block.disposition) {
|
|
1299
1334
|
case "suggest": {
|
|
1300
1335
|
const { text = "" } = (0, import_util3.safeParseJson)(block.json ?? "{}") ?? {};
|
|
1301
|
-
return /* @__PURE__ */
|
|
1336
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react_ui2.Button, {
|
|
1302
1337
|
onClick: () => onSuggest(text)
|
|
1303
1338
|
}, text);
|
|
1304
1339
|
}
|
|
1305
1340
|
case "select": {
|
|
1306
1341
|
const { options = [] } = (0, import_util3.safeParseJson)(block.json ?? "{}") ?? {};
|
|
1307
|
-
return /* @__PURE__ */
|
|
1342
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react_ui2.ButtonGroup, null, options.map((option) => /* @__PURE__ */ import_react7.default.createElement(import_react_ui2.Button, {
|
|
1308
1343
|
key: option,
|
|
1309
1344
|
onClick: () => onSuggest(option)
|
|
1310
1345
|
}, option)));
|
|
1311
1346
|
}
|
|
1312
1347
|
default: {
|
|
1313
1348
|
const title = block.disposition ? titles[block.disposition] : void 0;
|
|
1314
|
-
return /* @__PURE__ */
|
|
1315
|
-
title: title ?? "JSON"
|
|
1316
|
-
|
|
1317
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui_syntax_highlighter.Json, {
|
|
1349
|
+
return /* @__PURE__ */ import_react7.default.createElement(ToggleContainer, {
|
|
1350
|
+
title: title ?? "JSON"
|
|
1351
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui_syntax_highlighter.Json, {
|
|
1318
1352
|
data: (0, import_util3.safeParseJson)(block.json ?? block),
|
|
1319
1353
|
classNames: "!p-1 text-xs"
|
|
1320
1354
|
}));
|
|
@@ -1326,17 +1360,54 @@ var componentMap = {
|
|
|
1326
1360
|
if (block.type === "tool_use") {
|
|
1327
1361
|
title = `Tool [${block.name}]`;
|
|
1328
1362
|
}
|
|
1329
|
-
return /* @__PURE__ */
|
|
1330
|
-
title: title ?? "JSON"
|
|
1331
|
-
|
|
1332
|
-
}, /* @__PURE__ */ import_react8.default.createElement(import_react_ui_syntax_highlighter.Json, {
|
|
1363
|
+
return /* @__PURE__ */ import_react7.default.createElement(ToggleContainer, {
|
|
1364
|
+
title: title ?? "JSON"
|
|
1365
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui_syntax_highlighter.Json, {
|
|
1333
1366
|
data: block,
|
|
1334
1367
|
classNames: "!p-1 text-xs"
|
|
1335
1368
|
}));
|
|
1336
1369
|
}
|
|
1337
1370
|
};
|
|
1371
|
+
var TabbedContainer = ({ items }) => {
|
|
1372
|
+
const lines = items.map((item) => item.title);
|
|
1373
|
+
const tabsRef = (0, import_react7.useRef)(null);
|
|
1374
|
+
const [selected, setSelected] = (0, import_react7.useState)(0);
|
|
1375
|
+
const [open, setOpen] = (0, import_react7.useState)(false);
|
|
1376
|
+
(0, import_react7.useEffect)(() => {
|
|
1377
|
+
if (open) {
|
|
1378
|
+
tabsRef.current?.focus();
|
|
1379
|
+
}
|
|
1380
|
+
}, [
|
|
1381
|
+
open
|
|
1382
|
+
]);
|
|
1383
|
+
const handleSelect = (index) => {
|
|
1384
|
+
if (index === selected) {
|
|
1385
|
+
setOpen(false);
|
|
1386
|
+
} else {
|
|
1387
|
+
setSelected(index);
|
|
1388
|
+
}
|
|
1389
|
+
};
|
|
1390
|
+
return /* @__PURE__ */ import_react7.default.createElement(ToggleContainer, {
|
|
1391
|
+
title: /* @__PURE__ */ import_react7.default.createElement(StatusLine, {
|
|
1392
|
+
lines,
|
|
1393
|
+
autoAdvance: true
|
|
1394
|
+
}),
|
|
1395
|
+
open,
|
|
1396
|
+
onChangeOpen: setOpen
|
|
1397
|
+
}, /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
1398
|
+
className: "flex gap-2 w-full"
|
|
1399
|
+
}, /* @__PURE__ */ import_react7.default.createElement(Tabs, {
|
|
1400
|
+
ref: tabsRef,
|
|
1401
|
+
length: items.length,
|
|
1402
|
+
selected,
|
|
1403
|
+
onSelect: handleSelect
|
|
1404
|
+
}), /* @__PURE__ */ import_react7.default.createElement(import_react_ui_syntax_highlighter.Json, {
|
|
1405
|
+
data: items[selected].block,
|
|
1406
|
+
classNames: "!p-1 text-xs"
|
|
1407
|
+
})));
|
|
1408
|
+
};
|
|
1338
1409
|
var Thread = ({ messages, streaming, collapse, debug, onSubmit, onStop, onSuggest, onDelete }) => {
|
|
1339
|
-
const { t } = (0, import_react_ui.useTranslation)(
|
|
1410
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_EQYHOTGG.AUTOMATION_PLUGIN);
|
|
1340
1411
|
const scroller = (0, import_react6.useRef)(null);
|
|
1341
1412
|
const [text, setText] = (0, import_react6.useState)("");
|
|
1342
1413
|
const handleKeyDown = (0, import_react6.useCallback)((ev) => {
|
|
@@ -1418,7 +1489,7 @@ var Thread = ({ messages, streaming, collapse, debug, onSubmit, onStop, onSugges
|
|
|
1418
1489
|
]);
|
|
1419
1490
|
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
1420
1491
|
className: "flex flex-col grow overflow-hidden"
|
|
1421
|
-
}, /* @__PURE__ */ import_react6.default.createElement(ScrollContainer, {
|
|
1492
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui_components.ScrollContainer, {
|
|
1422
1493
|
ref: scroller,
|
|
1423
1494
|
classNames: "py-2 gap-2 overflow-x-hidden"
|
|
1424
1495
|
}, lines.map((message) => /* @__PURE__ */ import_react6.default.createElement(ThreadMessage, {
|
|
@@ -1451,7 +1522,7 @@ var Thread = ({ messages, streaming, collapse, debug, onSubmit, onStop, onSugges
|
|
|
1451
1522
|
iconOnly: true
|
|
1452
1523
|
})));
|
|
1453
1524
|
};
|
|
1454
|
-
var
|
|
1525
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/ChatContainer/ChatContainer.tsx";
|
|
1455
1526
|
var ChatContainer = ({ chat, role }) => {
|
|
1456
1527
|
const processor = useChatProcessor(chat);
|
|
1457
1528
|
const messageQueue = useMessageQueue(chat);
|
|
@@ -1464,7 +1535,7 @@ var ChatContainer = ({ chat, role }) => {
|
|
|
1464
1535
|
await processor.cancel();
|
|
1465
1536
|
}
|
|
1466
1537
|
(0, import_invariant.invariant)(messageQueue, void 0, {
|
|
1467
|
-
F:
|
|
1538
|
+
F: __dxlog_file5,
|
|
1468
1539
|
L: 25,
|
|
1469
1540
|
S: void 0,
|
|
1470
1541
|
A: [
|
|
@@ -1512,4 +1583,4 @@ var ChatContainer_default = ChatContainer;
|
|
|
1512
1583
|
Thread,
|
|
1513
1584
|
useServices
|
|
1514
1585
|
});
|
|
1515
|
-
//# sourceMappingURL=chunk-
|
|
1586
|
+
//# sourceMappingURL=chunk-CJGJXNY3.cjs.map
|