@dxos/plugin-assistant 0.8.4-staging.60fe92afc8 → 0.9.1-main.c7dcc2e112
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/neutral/{AgentArticle-K7XM46OQ.mjs → AgentArticle-2BEPWUMN.mjs} +9 -7
- package/dist/lib/neutral/AgentArticle-2BEPWUMN.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.mjs +1 -1
- package/dist/lib/neutral/{AssistantSettings-GG52BLKS.mjs → AssistantSettings-7ALY4BMS.mjs} +3 -3
- package/dist/lib/neutral/AssistantSettings-7ALY4BMS.mjs.map +7 -0
- package/dist/lib/neutral/{ChatArticle-VNVZCDUR.mjs → ChatArticle-KT46SUFU.mjs} +2 -2
- package/dist/lib/neutral/{ChatCompanion-LBUHYWQG.mjs → ChatCompanion-YHC43RYQ.mjs} +4 -4
- package/dist/lib/neutral/ChatCompanion-YHC43RYQ.mjs.map +7 -0
- package/dist/lib/neutral/{ChatDialog-DCA6FLOV.mjs → ChatDialog-YZDZLIQA.mjs} +5 -4
- package/dist/lib/neutral/ChatDialog-YZDZLIQA.mjs.map +7 -0
- package/dist/lib/neutral/{PlanArticle-TS5ULWYS.mjs → PlanArticle-VPK2IYWU.mjs} +8 -2
- package/dist/lib/neutral/PlanArticle-VPK2IYWU.mjs.map +7 -0
- package/dist/lib/neutral/{RoutineArticle-5NYXHRG6.mjs → RoutineArticle-FK5BXQN5.mjs} +3 -3
- package/dist/lib/neutral/RoutineArticle-FK5BXQN5.mjs.map +7 -0
- package/dist/lib/neutral/SpaceHomePrompt-HTWQKLGI.mjs +113 -0
- package/dist/lib/neutral/SpaceHomePrompt-HTWQKLGI.mjs.map +7 -0
- package/dist/lib/neutral/SpaceHomeSuggestions-6G4E7GNJ.mjs +50 -0
- package/dist/lib/neutral/SpaceHomeSuggestions-6G4E7GNJ.mjs.map +7 -0
- package/dist/lib/neutral/TracePanel-T552TAOH.mjs +12 -0
- package/dist/lib/neutral/TracePanel-T552TAOH.mjs.map +7 -0
- package/dist/lib/neutral/{TriggerStatus-X7Y5JFZJ.mjs → TriggerStatus-RBOHHDOK.mjs} +3 -3
- package/dist/lib/neutral/TriggerStatus-RBOHHDOK.mjs.map +7 -0
- package/dist/lib/neutral/{agent-service-WCAP5MLI.mjs → agent-service-WV5CSHAG.mjs} +4 -2
- package/dist/lib/neutral/{agent-service-WCAP5MLI.mjs.map → agent-service-WV5CSHAG.mjs.map} +3 -3
- package/dist/lib/neutral/{app-graph-builder-WUFHQH3Y.mjs → app-graph-builder-PTSRZXRN.mjs} +13 -13
- package/dist/lib/neutral/app-graph-builder-PTSRZXRN.mjs.map +7 -0
- package/dist/lib/neutral/{blueprint-definition-MH2QLYQH.mjs → blueprint-definition-2XPYI35X.mjs} +4 -3
- package/dist/lib/neutral/blueprint-definition-2XPYI35X.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +8 -8
- package/dist/lib/neutral/capabilities/index.mjs.map +2 -2
- package/dist/lib/neutral/{chunk-HLANPOBA.mjs → chunk-35EL65O4.mjs} +3 -3
- package/dist/lib/neutral/chunk-35EL65O4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-54W7N6M6.mjs +445 -0
- package/dist/lib/neutral/chunk-54W7N6M6.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-YXRGZYYH.mjs → chunk-5KB2WRI2.mjs} +6 -6
- package/dist/lib/neutral/chunk-5KB2WRI2.mjs.map +7 -0
- package/dist/lib/neutral/{TracePanel-KTZJ6JNR.mjs → chunk-5LKNH7FD.mjs} +5 -20
- package/dist/lib/neutral/chunk-5LKNH7FD.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-SMFJD7BP.mjs → chunk-7FQT4XMI.mjs} +2 -2
- package/dist/lib/neutral/{chunk-RKVVK3R3.mjs → chunk-H77JTXAN.mjs} +17 -9
- package/dist/lib/neutral/chunk-H77JTXAN.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-QAZMOFPI.mjs → chunk-IQZJ5TTM.mjs} +4 -4
- package/dist/lib/neutral/chunk-IQZJ5TTM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZNDQVYUN.mjs +53 -0
- package/dist/lib/neutral/chunk-ZNDQVYUN.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +296 -109
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/containers/index.mjs +12 -8
- package/dist/lib/neutral/containers/index.mjs.map +3 -3
- package/dist/lib/neutral/{create-chat-SGGQ6HVN.mjs → create-chat-Z3FNA6OJ.mjs} +2 -2
- package/dist/lib/neutral/{create-chat-SGGQ6HVN.mjs.map → create-chat-Z3FNA6OJ.mjs.map} +2 -2
- package/dist/lib/neutral/{create-object-U2SOFZLR.mjs → create-object-BJUDDKQQ.mjs} +2 -2
- package/dist/lib/neutral/execution-graph/index.mjs +156 -0
- package/dist/lib/neutral/execution-graph/index.mjs.map +4 -4
- package/dist/lib/neutral/{fork-chat-34KEF4ZJ.mjs → fork-chat-UYXYT6BT.mjs} +4 -4
- package/dist/lib/neutral/fork-chat-UYXYT6BT.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +233 -438
- package/dist/lib/neutral/hooks/index.mjs.map +4 -4
- package/dist/lib/neutral/index.mjs +3 -3
- package/dist/lib/neutral/markdown-extension-IJ5RQMQ4.mjs +126 -0
- package/dist/lib/neutral/markdown-extension-IJ5RQMQ4.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/{react-surface-XRTBW5OJ.mjs → react-surface-ES7UHZ65.mjs} +29 -17
- package/dist/lib/neutral/react-surface-ES7UHZ65.mjs.map +7 -0
- package/dist/lib/neutral/{run-prompt-in-new-chat-D5IIE2C7.mjs → run-prompt-in-new-chat-NIAGCKQV.mjs} +11 -8
- package/dist/lib/neutral/run-prompt-in-new-chat-NIAGCKQV.mjs.map +7 -0
- package/dist/lib/neutral/{settings-W4BLWQ53.mjs → settings-7Q3RITIT.mjs} +3 -3
- package/dist/lib/neutral/{settings-W4BLWQ53.mjs.map → settings-7Q3RITIT.mjs.map} +3 -3
- package/dist/lib/neutral/{state-H3G7QCU6.mjs → state-XO2UYSSG.mjs} +2 -2
- package/dist/lib/neutral/{state-H3G7QCU6.mjs.map → state-XO2UYSSG.mjs.map} +3 -3
- package/dist/lib/neutral/testing.mjs +1 -1
- package/dist/lib/neutral/translations.mjs +18 -11
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +17 -57
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +6 -3
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.stories.d.ts +32 -0
- package/dist/types/src/components/Chat/Chat.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +6 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/TaskList/TaskList.d.ts +8 -0
- package/dist/types/src/components/TaskList/TaskList.d.ts.map +1 -1
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts +3 -0
- package/dist/types/src/components/TaskList/TaskList.stories.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/containers/ChatArticle/ChatArticle.d.ts +2 -2
- package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +2 -2
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceHomePrompt/SpaceHomePrompt.d.ts +15 -0
- package/dist/types/src/containers/SpaceHomePrompt/SpaceHomePrompt.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceHomePrompt/index.d.ts +2 -0
- package/dist/types/src/containers/SpaceHomePrompt/index.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceHomeSuggestions/SpaceHomeSuggestions.d.ts +13 -0
- package/dist/types/src/containers/SpaceHomeSuggestions/SpaceHomeSuggestions.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceHomeSuggestions/index.d.ts +2 -0
- package/dist/types/src/containers/SpaceHomeSuggestions/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +2 -0
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/execution-graph/execution-graph.d.ts +18 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -1
- package/dist/types/src/execution-graph/index.d.ts +2 -1
- package/dist/types/src/execution-graph/index.d.ts.map +1 -1
- package/dist/types/src/execution-graph/pending-block-status.d.ts +26 -0
- package/dist/types/src/execution-graph/pending-block-status.d.ts.map +1 -0
- package/dist/types/src/execution-graph/pending-block-status.test.d.ts +2 -0
- package/dist/types/src/execution-graph/pending-block-status.test.d.ts.map +1 -0
- package/dist/types/src/extensions/prompt-extension.d.ts +1 -1
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -1
- package/dist/types/src/feed-logger.d.ts +3 -2
- package/dist/types/src/feed-logger.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useProcessEphemeralStatus.d.ts +10 -0
- package/dist/types/src/hooks/useProcessEphemeralStatus.d.ts.map +1 -0
- package/dist/types/src/hooks/useTraceMessages.d.ts +12 -0
- package/dist/types/src/hooks/useTraceMessages.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +28 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -1
- package/dist/types/src/paths.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +23 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +1 -1
- package/dist/types/src/types/AssistantCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/AssistantEvents.d.ts.map +1 -1
- package/dist/types/src/types/AssistantOperation.d.ts +7 -7
- package/dist/types/src/util/error-cause.d.ts +3 -0
- package/dist/types/src/util/error-cause.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +38 -0
- package/package.json +71 -70
- package/src/AssistantPlugin.conversations.json +1 -1
- package/src/AssistantPlugin.test.ts +1 -1
- package/src/AssistantPlugin.ts +2 -2
- package/src/capabilities/agent-service.ts +5 -1
- package/src/capabilities/app-graph-builder.ts +15 -20
- package/src/capabilities/blueprint-definition.ts +2 -0
- package/src/capabilities/index.ts +1 -7
- package/src/capabilities/markdown-extension.ts +5 -1
- package/src/capabilities/react-surface.tsx +38 -23
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/state.ts +1 -1
- package/src/components/AgentProperties/AgentProperties.tsx +1 -1
- package/src/components/AssistantSettings/AssistantSettings.tsx +2 -2
- package/src/components/Chat/Chat.stories.tsx +94 -0
- package/src/components/Chat/Chat.tsx +39 -6
- package/src/components/ChatPrompt/ChatActions.tsx +4 -2
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +1 -1
- package/src/components/ChatPrompt/ChatOptions.tsx +26 -29
- package/src/components/ChatPrompt/ChatPrompt.tsx +1 -1
- package/src/components/ChatPrompt/ChatReferences.tsx +1 -1
- package/src/components/ChatThread/Anchor.stories.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +1 -1
- package/src/components/ChatThread/DEBUG.md +23 -0
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +1 -1
- package/src/components/ChatThread/widgets/ToolWidget.tsx +1 -1
- package/src/components/ProcessTree/ProcessTree.stories.tsx +7 -0
- package/src/components/ProcessTree/ProcessTree.tsx +191 -88
- package/src/components/TaskList/TaskList.stories.tsx +23 -2
- package/src/components/TaskList/TaskList.tsx +122 -28
- package/src/components/TemplateEditor/TemplateEditor.tsx +1 -1
- package/src/components/TemplateEditor/TemplateForm.tsx +1 -1
- package/src/components/ToolBlock/ToolBlock.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +4 -4
- package/src/containers/AgentArticle/AgentArticle.tsx +9 -9
- package/src/containers/ChatArticle/ChatArticle.tsx +18 -10
- package/src/containers/ChatCompanion/ChatCompanion.tsx +2 -2
- package/src/containers/ChatDialog/ChatDialog.tsx +5 -3
- package/src/containers/PlanArticle/PlanArticle.tsx +5 -1
- package/src/containers/RoutineArticle/RoutineArticle.tsx +2 -2
- package/src/containers/SpaceHomePrompt/SpaceHomePrompt.tsx +105 -0
- package/src/containers/SpaceHomePrompt/index.ts +5 -0
- package/src/containers/SpaceHomeSuggestions/SpaceHomeSuggestions.tsx +69 -0
- package/src/containers/SpaceHomeSuggestions/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.tsx +3 -30
- package/src/containers/TriggerStatus/TriggerStatus.tsx +2 -2
- package/src/containers/index.ts +2 -0
- package/src/execution-graph/execution-graph.ts +130 -0
- package/src/execution-graph/index.ts +10 -0
- package/src/execution-graph/pending-block-status.test.ts +114 -0
- package/src/execution-graph/pending-block-status.ts +88 -0
- package/src/execution-graph/sub-agent-delegation.test.ts +16 -1
- package/src/extensions/prompt-extension.ts +102 -73
- package/src/feed-logger.ts +21 -19
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useChatProcessor.ts +1 -1
- package/src/hooks/useChatServices.ts +2 -2
- package/src/hooks/useChatToolbarActions.ts +5 -5
- package/src/hooks/useContextBinder.ts +1 -1
- package/src/hooks/useProcessEphemeralStatus.ts +192 -0
- package/src/hooks/useTraceMessages.ts +41 -0
- package/src/meta.ts +3 -31
- package/src/operations/create-chat.ts +1 -1
- package/src/operations/fork-chat.ts +3 -3
- package/src/operations/run-prompt-in-new-chat.ts +5 -3
- package/src/paths.ts +2 -2
- package/src/processor/processor.node.test.ts +71 -1
- package/src/processor/processor.ts +58 -2
- package/src/testing/data/trace-timeline-multiple.dx.json +1 -1
- package/src/testing/data/trace-timeline-remote.dx.json +1 -1
- package/src/testing/data/trace-timeline.dx.json +0 -1
- package/src/translations.ts +18 -10
- package/src/types/AssistantCapabilities.ts +3 -3
- package/src/types/AssistantEvents.ts +1 -1
- package/src/types/AssistantOperation.ts +1 -1
- package/src/util/error-cause.ts +21 -0
- package/dist/lib/neutral/AgentArticle-K7XM46OQ.mjs.map +0 -7
- package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs.map +0 -7
- package/dist/lib/neutral/ChatCompanion-LBUHYWQG.mjs.map +0 -7
- package/dist/lib/neutral/ChatDialog-DCA6FLOV.mjs.map +0 -7
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs.map +0 -7
- package/dist/lib/neutral/RoutineArticle-5NYXHRG6.mjs.map +0 -7
- package/dist/lib/neutral/TracePanel-KTZJ6JNR.mjs.map +0 -7
- package/dist/lib/neutral/TriggerStatus-X7Y5JFZJ.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-WUFHQH3Y.mjs.map +0 -7
- package/dist/lib/neutral/blueprint-definition-MH2QLYQH.mjs.map +0 -7
- package/dist/lib/neutral/chunk-HLANPOBA.mjs.map +0 -7
- package/dist/lib/neutral/chunk-QAZMOFPI.mjs.map +0 -7
- package/dist/lib/neutral/chunk-RKVVK3R3.mjs.map +0 -7
- package/dist/lib/neutral/chunk-VTK5R4H3.mjs +0 -9
- package/dist/lib/neutral/chunk-VTK5R4H3.mjs.map +0 -7
- package/dist/lib/neutral/chunk-XYHPOGTK.mjs +0 -43
- package/dist/lib/neutral/chunk-XYHPOGTK.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YXRGZYYH.mjs.map +0 -7
- package/dist/lib/neutral/fork-chat-34KEF4ZJ.mjs.map +0 -7
- package/dist/lib/neutral/markdown-extension-YMIFDMYF.mjs +0 -110
- package/dist/lib/neutral/markdown-extension-YMIFDMYF.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-XRTBW5OJ.mjs.map +0 -7
- package/dist/lib/neutral/run-prompt-in-new-chat-D5IIE2C7.mjs.map +0 -7
- package/src/testing/trace-timeline.node.conversations.json +0 -1
- /package/dist/lib/neutral/{ChatArticle-VNVZCDUR.mjs.map → ChatArticle-KT46SUFU.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-SMFJD7BP.mjs.map → chunk-7FQT4XMI.mjs.map} +0 -0
- /package/dist/lib/neutral/{create-object-U2SOFZLR.mjs.map → create-object-BJUDDKQQ.mjs.map} +0 -0
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
TracePanel
|
|
3
|
+
} from "../chunk-5LKNH7FD.mjs";
|
|
4
|
+
import {
|
|
5
|
+
AiUsageQuotaError,
|
|
2
6
|
ChatContextProvider,
|
|
3
7
|
useChatContext
|
|
4
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-54W7N6M6.mjs";
|
|
5
9
|
import "../chunk-J5LGTIGS.mjs";
|
|
6
10
|
|
|
7
11
|
// src/components/index.ts
|
|
@@ -19,7 +23,7 @@ import { Form } from "@dxos/react-ui-form";
|
|
|
19
23
|
import { FeedAnnotation } from "@dxos/schema";
|
|
20
24
|
import { meta } from "#meta";
|
|
21
25
|
var AgentProperties = ({ agent }) => {
|
|
22
|
-
const { t } = useTranslation(meta.
|
|
26
|
+
const { t } = useTranslation(meta.profile.key);
|
|
23
27
|
const db = Obj.getDatabase(agent);
|
|
24
28
|
const feedFilter = useMemo(() => {
|
|
25
29
|
if (!db) {
|
|
@@ -75,16 +79,17 @@ var AgentProperties = ({ agent }) => {
|
|
|
75
79
|
import { useAtomValue as useAtomValue4 } from "@effect-atom/atom-react";
|
|
76
80
|
import * as Array from "effect/Array";
|
|
77
81
|
import * as Option3 from "effect/Option";
|
|
78
|
-
import React16, { useCallback as useCallback7, useEffect as useEffect6, useMemo as
|
|
82
|
+
import React16, { useCallback as useCallback7, useEffect as useEffect6, useMemo as useMemo7, useRef as useRef4, useState as useState7 } from "react";
|
|
79
83
|
import { Agent } from "@dxos/assistant-toolkit";
|
|
80
84
|
import { Event } from "@dxos/async";
|
|
85
|
+
import { getSpace } from "@dxos/client/echo";
|
|
81
86
|
import { Filter as Filter3, Obj as Obj4, Query } from "@dxos/echo";
|
|
82
87
|
import { useQuery as useQuery3 } from "@dxos/react-client/echo";
|
|
83
88
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
84
|
-
import { Toast, composable as composable2, composableProps as composableProps2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
89
|
+
import { Button, Toast, composable as composable2, composableProps as composableProps2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
85
90
|
import { Menu } from "@dxos/react-ui-menu";
|
|
86
91
|
import { Message as Message2 } from "@dxos/types";
|
|
87
|
-
import { useChatKeymapExtensions as useChatKeymapExtensions2, useChatToolbarActions, useDebug } from "#hooks";
|
|
92
|
+
import { useChatKeymapExtensions as useChatKeymapExtensions2, useChatToolbarActions, useDebug, useTraceMessages } from "#hooks";
|
|
88
93
|
import { meta as meta9 } from "#meta";
|
|
89
94
|
|
|
90
95
|
// src/components/ChatPrompt/ChatActions.tsx
|
|
@@ -93,7 +98,7 @@ import { IconButton, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
|
93
98
|
import { mx } from "@dxos/ui-theme";
|
|
94
99
|
import { meta as meta2 } from "#meta";
|
|
95
100
|
var ChatActions = ({ classNames, children, microphone, recording, processing, debug, onEvent }) => {
|
|
96
|
-
const { t } = useTranslation2(meta2.
|
|
101
|
+
const { t } = useTranslation2(meta2.profile.key);
|
|
97
102
|
return /* @__PURE__ */ React2.createElement("div", {
|
|
98
103
|
className: mx("flex items-center", classNames)
|
|
99
104
|
}, children, microphone && /* @__PURE__ */ React2.createElement(IconButton, {
|
|
@@ -130,9 +135,11 @@ var ChatActions = ({ classNames, children, microphone, recording, processing, de
|
|
|
130
135
|
icon: "ph--x--regular",
|
|
131
136
|
iconOnly: true,
|
|
132
137
|
label: t("cancel-processing.button"),
|
|
133
|
-
onClick: () =>
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
onClick: () => {
|
|
139
|
+
onEvent?.({
|
|
140
|
+
type: "cancel"
|
|
141
|
+
});
|
|
142
|
+
}
|
|
136
143
|
}));
|
|
137
144
|
};
|
|
138
145
|
|
|
@@ -142,7 +149,7 @@ import React3, { useCallback as useCallback2 } from "react";
|
|
|
142
149
|
import { Message, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
143
150
|
import { meta as meta3 } from "#meta";
|
|
144
151
|
var ChatMcpErrors = ({ classNames, processor }) => {
|
|
145
|
-
const { t } = useTranslation3(meta3.
|
|
152
|
+
const { t } = useTranslation3(meta3.profile.key);
|
|
146
153
|
const errors = useAtomValue2(processor.mcpErrors);
|
|
147
154
|
const handleDismiss = useCallback2(() => {
|
|
148
155
|
processor.dismissMcpErrors();
|
|
@@ -190,7 +197,7 @@ var styles = {
|
|
|
190
197
|
toolbar: "p-0! gap-0! border-t border-separator"
|
|
191
198
|
};
|
|
192
199
|
var ChatOptions = ({ chat, db, context, registry, presets, preset, onPresetChange }) => {
|
|
193
|
-
const { t } = useTranslation4(meta4.
|
|
200
|
+
const { t } = useTranslation4(meta4.profile.key);
|
|
194
201
|
return /* @__PURE__ */ React4.createElement("div", {
|
|
195
202
|
className: "flex"
|
|
196
203
|
}, /* @__PURE__ */ React4.createElement(Popover.Root, null, /* @__PURE__ */ React4.createElement(Popover.Trigger, {
|
|
@@ -217,7 +224,7 @@ var ChatOptions = ({ chat, db, context, registry, presets, preset, onPresetChang
|
|
|
217
224
|
side: "top",
|
|
218
225
|
classNames: styles.panel
|
|
219
226
|
}, /* @__PURE__ */ React4.createElement(Popover.Viewport, null, /* @__PURE__ */ React4.createElement(Tabs.Root, {
|
|
220
|
-
|
|
227
|
+
asChild: true,
|
|
221
228
|
orientation: "horizontal",
|
|
222
229
|
defaultValue: "view",
|
|
223
230
|
defaultActivePart: "list",
|
|
@@ -275,7 +282,7 @@ var ChatOptions = ({ chat, db, context, registry, presets, preset, onPresetChang
|
|
|
275
282
|
}))))), /* @__PURE__ */ React4.createElement(Popover.Arrow, null)))));
|
|
276
283
|
};
|
|
277
284
|
var BlueprintsPanel = ({ registry, db, context }) => {
|
|
278
|
-
const { t } = useTranslation4(meta4.
|
|
285
|
+
const { t } = useTranslation4(meta4.profile.key);
|
|
279
286
|
const blueprints = useBlueprints({
|
|
280
287
|
registry,
|
|
281
288
|
db
|
|
@@ -314,34 +321,39 @@ var BlueprintsPanel = ({ registry, db, context }) => {
|
|
|
314
321
|
})));
|
|
315
322
|
};
|
|
316
323
|
var ViewPanel = ({ chat }) => {
|
|
317
|
-
const { t } = useTranslation4(meta4.
|
|
318
|
-
const [view, setView] = useObject(chat, "
|
|
324
|
+
const { t } = useTranslation4(meta4.profile.key);
|
|
325
|
+
const [view, setView] = useObject(chat, "viewType");
|
|
319
326
|
const value2 = view ?? "normal";
|
|
320
327
|
return /* @__PURE__ */ React4.createElement(Listbox.Root, {
|
|
321
328
|
value: value2,
|
|
322
329
|
onValueChange: setView,
|
|
323
330
|
autoFocus: true
|
|
324
|
-
},
|
|
331
|
+
}, /* @__PURE__ */ React4.createElement(Listbox.Content, {
|
|
332
|
+
"aria-label": t("chat-view.title")
|
|
333
|
+
}, Assistant.ChatViews.map((view2) => /* @__PURE__ */ React4.createElement(Listbox.Item, {
|
|
325
334
|
key: view2,
|
|
326
|
-
|
|
327
|
-
|
|
335
|
+
id: view2,
|
|
336
|
+
classNames: "px-2 py-1 dx-focus-ring rounded-xs"
|
|
337
|
+
}, /* @__PURE__ */ React4.createElement(Listbox.ItemLabel, null, t(`chat-view.${view2}.label`, {
|
|
328
338
|
defaultValue: view2
|
|
329
|
-
})), /* @__PURE__ */ React4.createElement(Listbox.
|
|
339
|
+
})), /* @__PURE__ */ React4.createElement(Listbox.Indicator, null)))));
|
|
330
340
|
};
|
|
331
341
|
var ModelsPanel = ({ presets, preset, onPresetChange }) => {
|
|
342
|
+
const { t } = useTranslation4(meta4.profile.key);
|
|
332
343
|
return /* @__PURE__ */ React4.createElement(Listbox.Root, {
|
|
333
344
|
value: preset,
|
|
334
345
|
onValueChange: onPresetChange,
|
|
335
346
|
autoFocus: true
|
|
336
|
-
},
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
347
|
+
}, /* @__PURE__ */ React4.createElement(Listbox.Content, {
|
|
348
|
+
"aria-label": t("options.chat-model.title")
|
|
349
|
+
}, presets?.map(({ id, label }) => /* @__PURE__ */ React4.createElement(Listbox.Item, {
|
|
350
|
+
key: id,
|
|
351
|
+
id,
|
|
352
|
+
classNames: "px-2 py-1 dx-focus-ring rounded-xs"
|
|
353
|
+
}, /* @__PURE__ */ React4.createElement(Listbox.ItemLabel, null, label), /* @__PURE__ */ React4.createElement(Listbox.Indicator, null)))));
|
|
342
354
|
};
|
|
343
355
|
var McpServersPanel = ({ db }) => {
|
|
344
|
-
const { t } = useTranslation4(meta4.
|
|
356
|
+
const { t } = useTranslation4(meta4.profile.key);
|
|
345
357
|
const servers = useQuery2(db, Filter2.type(McpServer.McpServer));
|
|
346
358
|
const [adding, setAdding] = useState(false);
|
|
347
359
|
const handleAdd = useCallback3((name, url, protocol, apiKey) => {
|
|
@@ -378,7 +390,7 @@ var McpServersPanel = ({ db }) => {
|
|
|
378
390
|
})));
|
|
379
391
|
};
|
|
380
392
|
var McpServerRow = ({ server, onRemove }) => {
|
|
381
|
-
const { t } = useTranslation4(meta4.
|
|
393
|
+
const { t } = useTranslation4(meta4.profile.key);
|
|
382
394
|
const [enabled, setEnabled] = useObject(server, "enabled");
|
|
383
395
|
return /* @__PURE__ */ React4.createElement("div", {
|
|
384
396
|
className: "flex items-center gap-2 px-form-chrome"
|
|
@@ -400,7 +412,7 @@ var McpServerRow = ({ server, onRemove }) => {
|
|
|
400
412
|
}));
|
|
401
413
|
};
|
|
402
414
|
var McpServerForm = ({ onSubmit, onCancel }) => {
|
|
403
|
-
const { t } = useTranslation4(meta4.
|
|
415
|
+
const { t } = useTranslation4(meta4.profile.key);
|
|
404
416
|
const [name, setName] = useState("");
|
|
405
417
|
const [url, setUrl] = useState("");
|
|
406
418
|
const [protocol, setProtocol] = useState("sse");
|
|
@@ -468,7 +480,7 @@ var McpServerForm = ({ onSubmit, onCancel }) => {
|
|
|
468
480
|
};
|
|
469
481
|
var ANY = "__any__";
|
|
470
482
|
var ObjectsPanel = ({ db, context }) => {
|
|
471
|
-
const { t } = useTranslation4(meta4.
|
|
483
|
+
const { t } = useTranslation4(meta4.profile.key);
|
|
472
484
|
const types = useFilteredTypes(db);
|
|
473
485
|
const typeOptions = useMemo2(() => {
|
|
474
486
|
const options = types.map((type) => {
|
|
@@ -565,7 +577,7 @@ import { getStyles as getStyles2, mx as mx3 } from "@dxos/ui-theme";
|
|
|
565
577
|
import { useContextObjects as useContextObjects2 } from "#hooks";
|
|
566
578
|
import { meta as meta5 } from "#meta";
|
|
567
579
|
var ChatReferences = ({ classNames, context, db }) => {
|
|
568
|
-
const { t } = useTranslation5(meta5.
|
|
580
|
+
const { t } = useTranslation5(meta5.profile.key);
|
|
569
581
|
const { objects, onUpdateObject } = useContextObjects2({
|
|
570
582
|
db,
|
|
571
583
|
context
|
|
@@ -638,7 +650,7 @@ var ChatStatusIndicator = ({ classNames, preset, processing, error, ...props })
|
|
|
638
650
|
|
|
639
651
|
// src/components/ChatPrompt/ChatPrompt.tsx
|
|
640
652
|
var ChatPrompt = ({ classNames, outline, db, chat, processor, event, online, placeholder, onOnlineChange, onPresetChange, settings = true, presets, preset }) => {
|
|
641
|
-
const { t } = useTranslation6(meta6.
|
|
653
|
+
const { t } = useTranslation6(meta6.profile.key);
|
|
642
654
|
const error = useAtomValue3(processor.error).pipe(Option2.getOrUndefined);
|
|
643
655
|
const streaming = useAtomValue3(processor.streaming);
|
|
644
656
|
const active = useAtomValue3(processor.active);
|
|
@@ -1053,7 +1065,7 @@ import { useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
|
1053
1065
|
import { TogglePanel as TogglePanel2 } from "@dxos/react-ui-components";
|
|
1054
1066
|
import { meta as meta7 } from "#meta";
|
|
1055
1067
|
var SummaryWidget = ({ children }) => {
|
|
1056
|
-
const { t } = useTranslation7(meta7.
|
|
1068
|
+
const { t } = useTranslation7(meta7.profile.key);
|
|
1057
1069
|
return /* @__PURE__ */ React11.createElement(TogglePanel2.Root, null, /* @__PURE__ */ React11.createElement(TogglePanel2.Content, {
|
|
1058
1070
|
classNames: styles2.border
|
|
1059
1071
|
}, /* @__PURE__ */ React11.createElement(TogglePanel2.Header, {
|
|
@@ -1093,7 +1105,7 @@ import { JsonHighlighter as JsonHighlighter2 } from "@dxos/react-ui-syntax-highl
|
|
|
1093
1105
|
import { isNonNullable, safeParseJson } from "@dxos/util";
|
|
1094
1106
|
import { meta as meta8 } from "#meta";
|
|
1095
1107
|
var ToolWidget = ({ view, blocks = [] }) => {
|
|
1096
|
-
const { t } = useTranslation8(meta8.
|
|
1108
|
+
const { t } = useTranslation8(meta8.profile.key);
|
|
1097
1109
|
const items = useMemo4(() => {
|
|
1098
1110
|
let lastToolCall;
|
|
1099
1111
|
const tools = [];
|
|
@@ -1611,27 +1623,92 @@ var ChatThread = /* @__PURE__ */ forwardRef(({ classNames, identity, messages =
|
|
|
1611
1623
|
});
|
|
1612
1624
|
|
|
1613
1625
|
// src/components/TaskList/TaskList.tsx
|
|
1614
|
-
import React15 from "react";
|
|
1626
|
+
import React15, { useMemo as useMemo6 } from "react";
|
|
1627
|
+
import { Plan } from "@dxos/assistant-toolkit";
|
|
1615
1628
|
import { useObject as useObject2 } from "@dxos/react-client/echo";
|
|
1616
1629
|
import { Icon as Icon3, Tag } from "@dxos/react-ui";
|
|
1617
1630
|
import { composable, composableProps } from "@dxos/react-ui";
|
|
1618
|
-
import {
|
|
1619
|
-
|
|
1631
|
+
import { TextCrawl as TextCrawl2 } from "@dxos/react-ui-components";
|
|
1632
|
+
import { Listbox as Listbox2 } from "@dxos/react-ui-list";
|
|
1633
|
+
import { collectProcessActivityLines, deriveInFlightActivityLine } from "#execution-graph";
|
|
1634
|
+
import { isTerminalActivityLine, useProcessEphemeralStatus } from "#hooks";
|
|
1635
|
+
var TaskList = composable(({ plan, space, conversationId, traceMessages, ...props }, forwardedRef) => {
|
|
1620
1636
|
const [snapshot] = useObject2(plan);
|
|
1621
1637
|
const tasks = snapshot?.tasks ?? [];
|
|
1622
|
-
return /* @__PURE__ */ React15.createElement(
|
|
1638
|
+
return /* @__PURE__ */ React15.createElement(Listbox2.Root, null, /* @__PURE__ */ React15.createElement(Listbox2.Viewport, {
|
|
1623
1639
|
...composableProps(props, {
|
|
1624
1640
|
classNames: "dx-container"
|
|
1625
1641
|
}),
|
|
1626
1642
|
ref: forwardedRef
|
|
1627
|
-
}, /* @__PURE__ */ React15.createElement(
|
|
1643
|
+
}, /* @__PURE__ */ React15.createElement(Listbox2.Content, {
|
|
1628
1644
|
"aria-label": "Tasks"
|
|
1629
|
-
}, tasks.map((task) => /* @__PURE__ */ React15.createElement(
|
|
1645
|
+
}, tasks.map((task) => /* @__PURE__ */ React15.createElement(TaskListItem, {
|
|
1630
1646
|
key: task.id,
|
|
1647
|
+
task,
|
|
1648
|
+
space,
|
|
1649
|
+
traceMessages,
|
|
1650
|
+
conversationId
|
|
1651
|
+
})))));
|
|
1652
|
+
});
|
|
1653
|
+
var TaskListItem = ({ task, space, traceMessages, conversationId }) => {
|
|
1654
|
+
const durableLines = useMemo6(() => {
|
|
1655
|
+
if (!task.agentPid || !traceMessages?.length) {
|
|
1656
|
+
return [];
|
|
1657
|
+
}
|
|
1658
|
+
const lines = collectProcessActivityLines(traceMessages, String(task.agentPid), {
|
|
1659
|
+
conversationId
|
|
1660
|
+
});
|
|
1661
|
+
if (task.status !== "in-progress") {
|
|
1662
|
+
return lines;
|
|
1663
|
+
}
|
|
1664
|
+
return lines.filter((line) => !isTerminalActivityLine(line));
|
|
1665
|
+
}, [
|
|
1666
|
+
task.agentPid,
|
|
1667
|
+
task.status,
|
|
1668
|
+
traceMessages,
|
|
1669
|
+
conversationId
|
|
1670
|
+
]);
|
|
1671
|
+
const ephemeralLine = useProcessEphemeralStatus(task.delegated === true && task.status === "in-progress" ? task.agentPid : void 0, space);
|
|
1672
|
+
const inFlightLine = useMemo6(() => {
|
|
1673
|
+
if (ephemeralLine || task.status !== "in-progress" || !task.agentPid || !traceMessages?.length) {
|
|
1674
|
+
return void 0;
|
|
1675
|
+
}
|
|
1676
|
+
return deriveInFlightActivityLine(traceMessages, String(task.agentPid), {
|
|
1677
|
+
conversationId
|
|
1678
|
+
});
|
|
1679
|
+
}, [
|
|
1680
|
+
ephemeralLine,
|
|
1681
|
+
task.status,
|
|
1682
|
+
task.agentPid,
|
|
1683
|
+
traceMessages,
|
|
1684
|
+
conversationId
|
|
1685
|
+
]);
|
|
1686
|
+
const activityLines = useMemo6(() => {
|
|
1687
|
+
if (ephemeralLine) {
|
|
1688
|
+
return [
|
|
1689
|
+
ephemeralLine
|
|
1690
|
+
];
|
|
1691
|
+
}
|
|
1692
|
+
if (inFlightLine) {
|
|
1693
|
+
return [
|
|
1694
|
+
inFlightLine
|
|
1695
|
+
];
|
|
1696
|
+
}
|
|
1697
|
+
return durableLines;
|
|
1698
|
+
}, [
|
|
1699
|
+
durableLines,
|
|
1700
|
+
ephemeralLine,
|
|
1701
|
+
inFlightLine
|
|
1702
|
+
]);
|
|
1703
|
+
const agentPid = task.agentPid;
|
|
1704
|
+
const showActivity = task.delegated === true && agentPid != null && activityLines.length > 0;
|
|
1705
|
+
return /* @__PURE__ */ React15.createElement(Listbox2.Item, {
|
|
1631
1706
|
id: task.id,
|
|
1632
1707
|
classNames: "py-0"
|
|
1633
1708
|
}, /* @__PURE__ */ React15.createElement("div", {
|
|
1634
|
-
className: "flex
|
|
1709
|
+
className: "flex flex-col gap-0.5 min-w-0"
|
|
1710
|
+
}, /* @__PURE__ */ React15.createElement("div", {
|
|
1711
|
+
className: "flex items-center gap-2 min-w-0"
|
|
1635
1712
|
}, /* @__PURE__ */ React15.createElement(Icon3, {
|
|
1636
1713
|
icon: task.status === "done" ? "ph--check--regular" : "ph--circle--regular",
|
|
1637
1714
|
classNames: task.status === "done" ? "text-success-text" : void 0,
|
|
@@ -1642,8 +1719,29 @@ var TaskList = composable(({ plan, ...props }, forwardedRef) => {
|
|
|
1642
1719
|
className: "truncate flex-1"
|
|
1643
1720
|
}, task.title), task.status === "in-progress" && /* @__PURE__ */ React15.createElement(Tag, {
|
|
1644
1721
|
palette: "info"
|
|
1645
|
-
}, "pending")
|
|
1646
|
-
|
|
1722
|
+
}, "pending"), task.agentPid && /* @__PURE__ */ React15.createElement(Tag, {
|
|
1723
|
+
palette: "info"
|
|
1724
|
+
}, Plan.formatAgentPidTag(task.agentPid))), showActivity && agentPid != null && /* @__PURE__ */ React15.createElement(DelegatedTaskActivity, {
|
|
1725
|
+
agentPid,
|
|
1726
|
+
lines: activityLines
|
|
1727
|
+
})));
|
|
1728
|
+
};
|
|
1729
|
+
var DelegatedTaskActivity = ({ agentPid, lines }) => {
|
|
1730
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
1731
|
+
className: "flex items-center gap-2 ps-6 min-w-0 text-placeholder"
|
|
1732
|
+
}, /* @__PURE__ */ React15.createElement(Icon3, {
|
|
1733
|
+
icon: "ph--brain--regular",
|
|
1734
|
+
size: 3,
|
|
1735
|
+
classNames: "shrink-0 opacity-70"
|
|
1736
|
+
}), /* @__PURE__ */ React15.createElement(TextCrawl2, {
|
|
1737
|
+
key: `${String(agentPid)}:${lines.length}:${lines[lines.length - 1]}`,
|
|
1738
|
+
lines,
|
|
1739
|
+
autoAdvance: true,
|
|
1740
|
+
greedy: true,
|
|
1741
|
+
size: "sm",
|
|
1742
|
+
classNames: "text-xs text-subdued min-w-0 flex-1"
|
|
1743
|
+
}));
|
|
1744
|
+
};
|
|
1647
1745
|
|
|
1648
1746
|
// src/components/Chat/Chat.tsx
|
|
1649
1747
|
var ChatRoot = ({ children, chat, feed, processor, db: dbFallback, onEvent, onSubmit, ...props }) => {
|
|
@@ -1655,10 +1753,10 @@ var ChatRoot = ({ children, chat, feed, processor, db: dbFallback, onEvent, onSu
|
|
|
1655
1753
|
});
|
|
1656
1754
|
const lastPrompt = useRef4(void 0);
|
|
1657
1755
|
const db = chat && Obj4.getDatabase(chat) || dbFallback;
|
|
1658
|
-
const event =
|
|
1756
|
+
const event = useMemo7(() => new Event(), []);
|
|
1659
1757
|
const feedMessages = useQuery3(db, feed ? Query.select(Filter3.type(Message2.Message)).from(feed) : Query.select(Filter3.nothing()));
|
|
1660
1758
|
const pendingMessages = useAtomValue4(processor.messages);
|
|
1661
|
-
const messages =
|
|
1759
|
+
const messages = useMemo7(() => Array.dedupeWith([
|
|
1662
1760
|
...feedMessages,
|
|
1663
1761
|
...pendingMessages
|
|
1664
1762
|
], ({ id: a }, { id: b }) => a === b), [
|
|
@@ -1792,8 +1890,8 @@ var ChatContent = composable2(({ children, ...props }, forwardedRef) => {
|
|
|
1792
1890
|
});
|
|
1793
1891
|
ChatContent.displayName = CHAT_CONTENT_NAME;
|
|
1794
1892
|
var CHAT_THREAD_NAME = "Chat.Thread";
|
|
1795
|
-
var ChatThread2 = ({ viewType, debug: debugProp, ...props }) => {
|
|
1796
|
-
const { t } = useTranslation9(meta9.
|
|
1893
|
+
var ChatThread2 = ({ viewType, debug: debugProp, onViewUsage, ...props }) => {
|
|
1894
|
+
const { t } = useTranslation9(meta9.profile.key);
|
|
1797
1895
|
const { debug, event, messages, processor } = useChatContext(CHAT_THREAD_NAME);
|
|
1798
1896
|
const extensions = useChatKeymapExtensions2({
|
|
1799
1897
|
event
|
|
@@ -1801,6 +1899,7 @@ var ChatThread2 = ({ viewType, debug: debugProp, ...props }) => {
|
|
|
1801
1899
|
const identity = useIdentity();
|
|
1802
1900
|
const error = useAtomValue4(processor.error).pipe(Option3.getOrUndefined);
|
|
1803
1901
|
const [toastError, setToastError] = useState7(void 0);
|
|
1902
|
+
const toastAction = toastError instanceof AiUsageQuotaError ? toastError.action : void 0;
|
|
1804
1903
|
const debugView = viewType === "debug";
|
|
1805
1904
|
const controllerRef = useRef4(null);
|
|
1806
1905
|
useEffect6(() => {
|
|
@@ -1852,7 +1951,15 @@ var ChatThread2 = ({ viewType, debug: debugProp, ...props }) => {
|
|
|
1852
1951
|
}, /* @__PURE__ */ React16.createElement(Toast.Title, {
|
|
1853
1952
|
icon: "ph--warning--regular",
|
|
1854
1953
|
onClose: () => setToastError(void 0)
|
|
1855
|
-
}, t("ai-service-error.label")), /* @__PURE__ */ React16.createElement(Toast.Description, null, toastError?.message)
|
|
1954
|
+
}, t("ai-service-error.label")), /* @__PURE__ */ React16.createElement(Toast.Description, null, toastError?.message), toastAction && onViewUsage && /* @__PURE__ */ React16.createElement(Toast.Actions, null, /* @__PURE__ */ React16.createElement(Toast.Action, {
|
|
1955
|
+
altText: t(toastAction.labelKey),
|
|
1956
|
+
asChild: true
|
|
1957
|
+
}, /* @__PURE__ */ React16.createElement(Button, {
|
|
1958
|
+
onClick: () => {
|
|
1959
|
+
setToastError(void 0);
|
|
1960
|
+
onViewUsage();
|
|
1961
|
+
}
|
|
1962
|
+
}, t(toastAction.labelKey))))));
|
|
1856
1963
|
};
|
|
1857
1964
|
ChatThread2.displayName = CHAT_THREAD_NAME;
|
|
1858
1965
|
var CHAT_PROMPT_NAME = "Chat.Prompt";
|
|
@@ -1873,12 +1980,18 @@ var ChatTaskList = composable2(({ plan: planProp, ...props }, forwardedRef) => {
|
|
|
1873
1980
|
const parent = chat ? Obj4.getParent(chat) : void 0;
|
|
1874
1981
|
const agent = parent && Obj4.instanceOf(Agent.Agent, parent) ? parent : void 0;
|
|
1875
1982
|
const plan = planProp ?? agent?.plan.target;
|
|
1983
|
+
const space = chat ? getSpace(chat) : void 0;
|
|
1984
|
+
const traceMessages = useTraceMessages(space);
|
|
1985
|
+
const conversationId = chat?.feed?.target?.id;
|
|
1876
1986
|
if (!plan) {
|
|
1877
1987
|
return null;
|
|
1878
1988
|
}
|
|
1879
1989
|
return /* @__PURE__ */ React16.createElement(TaskList, {
|
|
1880
1990
|
...props,
|
|
1881
1991
|
plan,
|
|
1992
|
+
space,
|
|
1993
|
+
traceMessages,
|
|
1994
|
+
conversationId,
|
|
1882
1995
|
ref: forwardedRef
|
|
1883
1996
|
});
|
|
1884
1997
|
});
|
|
@@ -1896,14 +2009,89 @@ var Chat = {
|
|
|
1896
2009
|
// src/components/ProcessTree/ProcessTree.tsx
|
|
1897
2010
|
import * as Match from "effect/Match";
|
|
1898
2011
|
import * as Option4 from "effect/Option";
|
|
1899
|
-
import React17 from "react";
|
|
2012
|
+
import React17, { useMemo as useMemo8 } from "react";
|
|
1900
2013
|
import { Process } from "@dxos/compute";
|
|
1901
|
-
import { Icon as Icon4, IconButton as IconButton4, ScrollArea, Tooltip as Tooltip2, Treegrid } from "@dxos/react-ui";
|
|
1902
|
-
import { composable as composable3, composableProps as composableProps3 } from "@dxos/react-ui";
|
|
2014
|
+
import { Icon as Icon4, IconButton as IconButton4, ScrollArea, Tooltip as Tooltip2, Treegrid, TREEGRID_PATH_SEPARATOR, composable as composable3, composableProps as composableProps3 } from "@dxos/react-ui";
|
|
1903
2015
|
import { mx as mx7 } from "@dxos/ui-theme";
|
|
1904
2016
|
import { Unit as Unit2 } from "@dxos/util";
|
|
1905
|
-
var
|
|
1906
|
-
|
|
2017
|
+
var DEFAULT_DEPTH = 1;
|
|
2018
|
+
var LABEL_INDENT_REM = 0.5;
|
|
2019
|
+
var NESTED_ACTIVE_STATES = /* @__PURE__ */ new Set([
|
|
2020
|
+
Process.State.RUNNING,
|
|
2021
|
+
Process.State.HYBERNATING,
|
|
2022
|
+
Process.State.TERMINATING
|
|
2023
|
+
]);
|
|
2024
|
+
var ProcessTree = /* @__PURE__ */ React17.memo(composable3(({ processes, depth = DEFAULT_DEPTH, onProcessSelect, onProcessTerminate, ...props }, forwardedRef) => {
|
|
2025
|
+
const rows = useMemo8(() => buildProcessTreeRows(processes, depth), [
|
|
2026
|
+
processes,
|
|
2027
|
+
depth
|
|
2028
|
+
]);
|
|
2029
|
+
return /* @__PURE__ */ React17.createElement(ScrollArea.Root, {
|
|
2030
|
+
...composableProps3(props, {
|
|
2031
|
+
classNames: "dx-expander"
|
|
2032
|
+
}),
|
|
2033
|
+
thin: true,
|
|
2034
|
+
ref: forwardedRef
|
|
2035
|
+
}, /* @__PURE__ */ React17.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React17.createElement(Treegrid.Root, {
|
|
2036
|
+
classNames: "grid grid-cols-[min-content_1fr_min-content_min-content]"
|
|
2037
|
+
}, rows.map(({ process, path }) => /* @__PURE__ */ React17.createElement(ProcessTreeRowView, {
|
|
2038
|
+
key: path.join(TREEGRID_PATH_SEPARATOR),
|
|
2039
|
+
process,
|
|
2040
|
+
path,
|
|
2041
|
+
onProcessSelect,
|
|
2042
|
+
onProcessTerminate
|
|
2043
|
+
})))));
|
|
2044
|
+
}));
|
|
2045
|
+
var ProcessTreeRowView = ({ process, path, onProcessSelect, onProcessTerminate }) => {
|
|
2046
|
+
const duration = Unit2.Duration(process.metrics.wallTime);
|
|
2047
|
+
const level = path.length;
|
|
2048
|
+
const nested = level > 1;
|
|
2049
|
+
return /* @__PURE__ */ React17.createElement(Treegrid.Row, {
|
|
2050
|
+
id: path.join(TREEGRID_PATH_SEPARATOR),
|
|
2051
|
+
classNames: mx7("col-span-full grid grid-cols-subgrid gap-2 ps-1", onProcessSelect && "dx-hover")
|
|
2052
|
+
}, /* @__PURE__ */ React17.createElement(Treegrid.Cell, {
|
|
2053
|
+
classNames: "flex items-center gap-0.5"
|
|
2054
|
+
}, nested && /* @__PURE__ */ React17.createElement(Icon4, {
|
|
2055
|
+
icon: "ph--arrow-elbow-down-right--regular",
|
|
2056
|
+
size: 3,
|
|
2057
|
+
classNames: "shrink-0 text-subdued"
|
|
2058
|
+
}), /* @__PURE__ */ React17.createElement(Tooltip2.Trigger, {
|
|
2059
|
+
content: process.state.toString()
|
|
2060
|
+
}, /* @__PURE__ */ React17.createElement(Icon4, {
|
|
2061
|
+
size: 4,
|
|
2062
|
+
synchronized: true,
|
|
2063
|
+
classNames: mx7(process.state === Process.State.RUNNING && "animate-spin", process.state === Process.State.FAILED && "text-error-text", process.state === Process.State.SUCCEEDED && "text-success-text"),
|
|
2064
|
+
icon: Match.value(process.state).pipe(Match.when(Process.State.RUNNING, () => "ph--spinner-gap--regular"), Match.when(Process.State.SUCCEEDED, () => "ph--check-circle--regular"), Match.when(Process.State.FAILED, () => "ph--warning--regular"), Match.when(Process.State.HYBERNATING, () => "ph--spinner--regular"), Match.when(Process.State.IDLE, () => "ph--moon-stars--regular"), Match.when(Process.State.TERMINATING, () => "ph--x-circle--regular"), Match.when(Process.State.TERMINATED, () => "ph--x-circle--regular"), Match.orElse(() => "ph--spinner-gap--regular"))
|
|
2065
|
+
}))), /* @__PURE__ */ React17.createElement(Treegrid.Cell, {
|
|
2066
|
+
classNames: "flex items-center truncate",
|
|
2067
|
+
style: nested ? {
|
|
2068
|
+
paddingInlineStart: `${(level - 1) * LABEL_INDENT_REM}rem`
|
|
2069
|
+
} : void 0,
|
|
2070
|
+
onClick: () => onProcessSelect?.(process)
|
|
2071
|
+
}, /* @__PURE__ */ React17.createElement("span", {
|
|
2072
|
+
className: mx7("truncate text-sm", level === 1 && "font-medium", process.state !== Process.State.RUNNING && "text-description")
|
|
2073
|
+
}, process.params.name ?? process.pid.toString())), /* @__PURE__ */ React17.createElement(Treegrid.Cell, {
|
|
2074
|
+
classNames: "flex items-center justify-end text-xs text-description tabular-nums"
|
|
2075
|
+
}, [
|
|
2076
|
+
Process.State.FAILED,
|
|
2077
|
+
Process.State.SUCCEEDED
|
|
2078
|
+
].includes(process.state) && /* @__PURE__ */ React17.createElement("span", {
|
|
2079
|
+
className: "whitespace-nowrap"
|
|
2080
|
+
}, duration.toString())), /* @__PURE__ */ React17.createElement(Treegrid.Cell, null, onProcessTerminate && /* @__PURE__ */ React17.createElement(IconButton4, {
|
|
2081
|
+
classNames: "min-h-0 p-1",
|
|
2082
|
+
icon: "ph--x--regular",
|
|
2083
|
+
iconOnly: true,
|
|
2084
|
+
variant: "ghost",
|
|
2085
|
+
size: 4,
|
|
2086
|
+
label: "Actions",
|
|
2087
|
+
onClick: (event) => {
|
|
2088
|
+
event.stopPropagation();
|
|
2089
|
+
onProcessTerminate?.(process);
|
|
2090
|
+
}
|
|
2091
|
+
})));
|
|
2092
|
+
};
|
|
2093
|
+
var sortProcesses = (processes) => {
|
|
2094
|
+
return [
|
|
1907
2095
|
...processes.filter((process) => [
|
|
1908
2096
|
Process.State.RUNNING,
|
|
1909
2097
|
Process.State.HYBERNATING
|
|
@@ -1916,61 +2104,59 @@ var ProcessTree = /* @__PURE__ */ React17.memo(composable3(({ processes, onProce
|
|
|
1916
2104
|
Process.State.FAILED,
|
|
1917
2105
|
Process.State.TERMINATED
|
|
1918
2106
|
].includes(process.state))
|
|
1919
|
-
].sort((
|
|
1920
|
-
const
|
|
1921
|
-
const
|
|
1922
|
-
return
|
|
2107
|
+
].sort((left, right) => {
|
|
2108
|
+
const leftCompletedAt = Option4.getOrElse(left.completedAt, () => Infinity);
|
|
2109
|
+
const rightCompletedAt = Option4.getOrElse(right.completedAt, () => Infinity);
|
|
2110
|
+
return rightCompletedAt - leftCompletedAt;
|
|
1923
2111
|
});
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
}
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
}))));
|
|
1973
|
-
}));
|
|
2112
|
+
};
|
|
2113
|
+
var sortNestedActive = (processes) => processes.filter((process) => NESTED_ACTIVE_STATES.has(process.state)).sort((left, right) => {
|
|
2114
|
+
const priority = (state) => state === Process.State.RUNNING ? 0 : state === Process.State.HYBERNATING ? 1 : 2;
|
|
2115
|
+
return priority(left.state) - priority(right.state);
|
|
2116
|
+
});
|
|
2117
|
+
var buildProcessTreeRows = (processes, maxDepth) => {
|
|
2118
|
+
const pidSet = new Set(processes.map((process) => String(process.pid)));
|
|
2119
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
2120
|
+
const roots = [];
|
|
2121
|
+
for (const process of processes) {
|
|
2122
|
+
const parent = process.parentPid;
|
|
2123
|
+
if (parent === null || !pidSet.has(String(parent))) {
|
|
2124
|
+
roots.push(process);
|
|
2125
|
+
continue;
|
|
2126
|
+
}
|
|
2127
|
+
const key = String(parent);
|
|
2128
|
+
const siblings = childrenByParent.get(key) ?? [];
|
|
2129
|
+
siblings.push(process);
|
|
2130
|
+
childrenByParent.set(key, siblings);
|
|
2131
|
+
}
|
|
2132
|
+
const sortedRoots = sortProcesses(roots);
|
|
2133
|
+
const rows = [];
|
|
2134
|
+
const visit = (process, path, level) => {
|
|
2135
|
+
if (level > maxDepth) {
|
|
2136
|
+
return;
|
|
2137
|
+
}
|
|
2138
|
+
rows.push({
|
|
2139
|
+
process,
|
|
2140
|
+
path
|
|
2141
|
+
});
|
|
2142
|
+
if (level >= maxDepth) {
|
|
2143
|
+
return;
|
|
2144
|
+
}
|
|
2145
|
+
const children = sortNestedActive(childrenByParent.get(String(process.pid)) ?? []);
|
|
2146
|
+
for (const child of children) {
|
|
2147
|
+
visit(child, [
|
|
2148
|
+
...path,
|
|
2149
|
+
String(child.pid)
|
|
2150
|
+
], level + 1);
|
|
2151
|
+
}
|
|
2152
|
+
};
|
|
2153
|
+
for (const root of sortedRoots) {
|
|
2154
|
+
visit(root, [
|
|
2155
|
+
String(root.pid)
|
|
2156
|
+
], 1);
|
|
2157
|
+
}
|
|
2158
|
+
return rows;
|
|
2159
|
+
};
|
|
1974
2160
|
|
|
1975
2161
|
// src/components/TemplateEditor/TemplateEditor.tsx
|
|
1976
2162
|
import { defaultHighlightStyle, syntaxHighlighting } from "@codemirror/language";
|
|
@@ -2242,7 +2428,7 @@ var xmlDecoratorPlugin = ViewPlugin2.fromClass(class {
|
|
|
2242
2428
|
|
|
2243
2429
|
// src/components/TemplateEditor/TemplateEditor.tsx
|
|
2244
2430
|
var TemplateEditor = composable4(({ classNames, id, source, lineNumbers = true, ...props }, forwardedRef) => {
|
|
2245
|
-
const { t } = useTranslation10(meta10.
|
|
2431
|
+
const { t } = useTranslation10(meta10.profile.key);
|
|
2246
2432
|
const { themeMode } = useThemeContext();
|
|
2247
2433
|
const { parentRef } = useTextEditor(() => {
|
|
2248
2434
|
const target = source?.target;
|
|
@@ -2393,7 +2579,7 @@ var safeToolId = (name) => {
|
|
|
2393
2579
|
};
|
|
2394
2580
|
|
|
2395
2581
|
// src/components/index.ts
|
|
2396
|
-
var AssistantSettings = lazy(() => import("../AssistantSettings-
|
|
2582
|
+
var AssistantSettings = lazy(() => import("../AssistantSettings-7ALY4BMS.mjs"));
|
|
2397
2583
|
var RoutineProperties = lazy(() => import("../RoutineProperties-FISLMW2R.mjs"));
|
|
2398
2584
|
export {
|
|
2399
2585
|
AgentProperties,
|
|
@@ -2405,6 +2591,7 @@ export {
|
|
|
2405
2591
|
TaskList,
|
|
2406
2592
|
TemplateEditor,
|
|
2407
2593
|
Toolbox,
|
|
2408
|
-
ToolboxPanel
|
|
2594
|
+
ToolboxPanel,
|
|
2595
|
+
TracePanel
|
|
2409
2596
|
};
|
|
2410
2597
|
//# sourceMappingURL=index.mjs.map
|