@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
|
@@ -13,9 +13,7 @@ import { Capabilities } from '@dxos/app-framework';
|
|
|
13
13
|
import { useCapability, useAtomCapability, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
14
14
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
15
15
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
16
|
-
import { Process
|
|
17
|
-
import { Filter, Query } from '@dxos/echo';
|
|
18
|
-
import { FeedTraceSink } from '@dxos/functions-runtime';
|
|
16
|
+
import { Process } from '@dxos/compute';
|
|
19
17
|
import { EID } from '@dxos/keys';
|
|
20
18
|
import { type Space } from '@dxos/react-client/echo';
|
|
21
19
|
import { ScrollContainer } from '@dxos/react-ui';
|
|
@@ -27,6 +25,7 @@ import { mx } from '@dxos/ui-theme';
|
|
|
27
25
|
|
|
28
26
|
import { ProcessTree, ProcessTreeProps } from '#components';
|
|
29
27
|
import { buildExecutionGraph, type ExecutionGraph } from '#execution-graph';
|
|
28
|
+
import { useTraceMessages, getTraceMessagesAtom } from '#hooks';
|
|
30
29
|
import { AssistantCapabilities } from '#types';
|
|
31
30
|
|
|
32
31
|
export type TracePanelProps = AppSurface.SpaceArticleProps<Pick<ProcessTreeProps, 'onProcessTerminate'>>;
|
|
@@ -175,33 +174,6 @@ const useExecutionGraph = (space: Space, { eventLimit }: UseExecutionGraphOption
|
|
|
175
174
|
return useAtomValue(atom);
|
|
176
175
|
};
|
|
177
176
|
|
|
178
|
-
/**
|
|
179
|
-
* Atom of the raw trace messages for a space — the exact `Trace.Message[]` fed into
|
|
180
|
-
* `buildExecutionGraph`. Shared by the execution graph and the debug trace export.
|
|
181
|
-
*/
|
|
182
|
-
const getTraceMessagesAtom = (space: Space): Atom.Atom<readonly Trace.Message[]> =>
|
|
183
|
-
pipe(
|
|
184
|
-
space.db.query(FeedTraceSink.query).atom,
|
|
185
|
-
Atom.map(
|
|
186
|
-
(feeds) =>
|
|
187
|
-
// TODO(dmaretskyi): This should be possible in a single query with properly working limit(1) and feed > feed contents traversal.
|
|
188
|
-
space.db.query(
|
|
189
|
-
feeds.length > 0
|
|
190
|
-
? Query.type(Trace.Message).from(feeds[0])
|
|
191
|
-
: (Query.select(Filter.nothing()) as Query.Query<never>),
|
|
192
|
-
).atom,
|
|
193
|
-
),
|
|
194
|
-
(atom) => Atom.make((get) => get(get(atom))),
|
|
195
|
-
);
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Returns the raw trace messages for a space (used by the debug trace export).
|
|
199
|
-
*/
|
|
200
|
-
const useTraceMessages = (space: Space): readonly Trace.Message[] => {
|
|
201
|
-
const atom = useMemo(() => getTraceMessagesAtom(space), [space]);
|
|
202
|
-
return useAtomValue(atom);
|
|
203
|
-
};
|
|
204
|
-
|
|
205
177
|
const getExecutionGraph = (
|
|
206
178
|
space: Space,
|
|
207
179
|
processesAtom: Atom.Atom<readonly Process.Info[]>,
|
|
@@ -250,6 +222,7 @@ const ProcessTreeContainer = ({
|
|
|
250
222
|
return (
|
|
251
223
|
<ProcessTree
|
|
252
224
|
processes={processesDeferred}
|
|
225
|
+
depth={3}
|
|
253
226
|
onProcessSelect={onProcessSelect}
|
|
254
227
|
onProcessTerminate={onProcessTerminate}
|
|
255
228
|
/>
|
|
@@ -44,7 +44,7 @@ const getIconClassNames = (state: TriggerStatusState): string | undefined => {
|
|
|
44
44
|
export type SpaceStatusProps = AppSurface.SpaceArticleProps;
|
|
45
45
|
|
|
46
46
|
export const SpaceStatus = ({ space }: SpaceStatusProps) => {
|
|
47
|
-
const { t } = useTranslation(meta.
|
|
47
|
+
const { t } = useTranslation(meta.profile.key);
|
|
48
48
|
const { state } = useTriggerRuntimeControls(space.db);
|
|
49
49
|
const isEnabled = state?.enabled ?? false;
|
|
50
50
|
const [properties] = useObject(space.properties);
|
|
@@ -115,7 +115,7 @@ const TriggerStatusPopover = ({
|
|
|
115
115
|
currentFunctionName,
|
|
116
116
|
lastInvocation, // TODO(burdon): Show.
|
|
117
117
|
}: TriggerStatusPopoverProps) => {
|
|
118
|
-
const { t } = useTranslation(meta.
|
|
118
|
+
const { t } = useTranslation(meta.profile.key);
|
|
119
119
|
|
|
120
120
|
return (
|
|
121
121
|
<div className='flex flex-col gap-2 p-2 w-[240px]'>
|
package/src/containers/index.ts
CHANGED
|
@@ -13,5 +13,7 @@ export const ChatDialog: ComponentType<any> = lazy(() => import('./ChatDialog'))
|
|
|
13
13
|
export const PlanArticle: ComponentType<any> = lazy(() => import('./PlanArticle'));
|
|
14
14
|
export const RoutineArticle: ComponentType<any> = lazy(() => import('./RoutineArticle'));
|
|
15
15
|
export const RoutineList: ComponentType<any> = lazy(() => import('./RoutineList'));
|
|
16
|
+
export const SpaceHomePrompt: ComponentType<any> = lazy(() => import('./SpaceHomePrompt'));
|
|
17
|
+
export const SpaceHomeSuggestions: ComponentType<any> = lazy(() => import('./SpaceHomeSuggestions'));
|
|
16
18
|
export const TracePanel: ComponentType<any> = lazy(() => import('./TracePanel'));
|
|
17
19
|
export const TriggerStatus: ComponentType<any> = lazy(() => import('./TriggerStatus'));
|
|
@@ -318,6 +318,136 @@ const presentEvent = (event: Trace.FlatEvent, toolCallContext: ToolCallContext):
|
|
|
318
318
|
return undefined;
|
|
319
319
|
};
|
|
320
320
|
|
|
321
|
+
export type CollectProcessActivityOptions = {
|
|
322
|
+
/**
|
|
323
|
+
* When set, messages with a `conversationId` that disagrees are excluded.
|
|
324
|
+
* Messages without `conversationId` still match when their pid is in the subtree.
|
|
325
|
+
*/
|
|
326
|
+
conversationId?: string;
|
|
327
|
+
eventLimit?: number;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Collects human-readable activity lines for a process subtree (root pid and descendants).
|
|
332
|
+
* Used to surface live sub-agent status in the task list.
|
|
333
|
+
*/
|
|
334
|
+
export const collectProcessActivityLines = (
|
|
335
|
+
messages: readonly Trace.Message[],
|
|
336
|
+
rootPid: string,
|
|
337
|
+
options: CollectProcessActivityOptions = {},
|
|
338
|
+
): string[] => {
|
|
339
|
+
const { conversationId, eventLimit = 50 } = options;
|
|
340
|
+
const descendantPids = collectDescendantPids(messages, rootPid);
|
|
341
|
+
const filtered = messages.filter((message) => {
|
|
342
|
+
const pid = message.meta.pid;
|
|
343
|
+
if (!pid || !descendantPids.has(pid)) {
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
if (conversationId && message.meta.conversationId !== undefined && message.meta.conversationId !== conversationId) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
return true;
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
const events = filtered
|
|
353
|
+
.flatMap((message) => Trace.flatten(message))
|
|
354
|
+
.sort((left, right) => left.timestamp - right.timestamp)
|
|
355
|
+
.slice(-eventLimit);
|
|
356
|
+
|
|
357
|
+
const toolCallContext = buildToolCallContext(filtered);
|
|
358
|
+
const lines: string[] = [];
|
|
359
|
+
for (const event of events) {
|
|
360
|
+
const presentation = presentEvent(event, toolCallContext);
|
|
361
|
+
if (presentation) {
|
|
362
|
+
lines.push(presentation.message);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return lines;
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Derives a single in-flight status line from durable trace when ephemeral subscription
|
|
370
|
+
* is unavailable (e.g. between partial blocks or while a child operation is running).
|
|
371
|
+
*/
|
|
372
|
+
export const deriveInFlightActivityLine = (
|
|
373
|
+
messages: readonly Trace.Message[],
|
|
374
|
+
rootPid: string,
|
|
375
|
+
options: CollectProcessActivityOptions = {},
|
|
376
|
+
): string | undefined => {
|
|
377
|
+
const { conversationId, eventLimit = 50 } = options;
|
|
378
|
+
const descendantPids = collectDescendantPids(messages, rootPid);
|
|
379
|
+
const filtered = messages.filter((message) => {
|
|
380
|
+
const pid = message.meta.pid;
|
|
381
|
+
if (!pid || !descendantPids.has(pid)) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
if (conversationId && message.meta.conversationId !== undefined && message.meta.conversationId !== conversationId) {
|
|
385
|
+
return false;
|
|
386
|
+
}
|
|
387
|
+
return true;
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
const events = filtered
|
|
391
|
+
.flatMap((message) => Trace.flatten(message))
|
|
392
|
+
.sort((left, right) => left.timestamp - right.timestamp)
|
|
393
|
+
.slice(-eventLimit);
|
|
394
|
+
|
|
395
|
+
const openOperations = new Map<string, { name: string; timestamp: number }>();
|
|
396
|
+
let agentRequestOpen = false;
|
|
397
|
+
let lastLine: string | undefined;
|
|
398
|
+
|
|
399
|
+
for (const event of events) {
|
|
400
|
+
const pid = event.meta.pid ?? rootPid;
|
|
401
|
+
if (Trace.isOfType(Trace.OperationStart, event)) {
|
|
402
|
+
const key = `${pid}:${event.data.key}`;
|
|
403
|
+
const name = event.data.name ?? event.data.key;
|
|
404
|
+
openOperations.set(key, { name, timestamp: event.timestamp });
|
|
405
|
+
lastLine = `${name}...`;
|
|
406
|
+
continue;
|
|
407
|
+
}
|
|
408
|
+
if (Trace.isOfType(Trace.OperationEnd, event)) {
|
|
409
|
+
openOperations.delete(`${pid}:${event.data.key}`);
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
if (Trace.isOfType(AgentRequestBegin, event)) {
|
|
413
|
+
agentRequestOpen = true;
|
|
414
|
+
lastLine = 'Generating...';
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
if (Trace.isOfType(AgentRequestEnd, event)) {
|
|
418
|
+
agentRequestOpen = false;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (agentRequestOpen) {
|
|
423
|
+
return 'Generating...';
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
const latestOperation = [...openOperations.values()].sort((left, right) => right.timestamp - left.timestamp)[0];
|
|
427
|
+
if (latestOperation) {
|
|
428
|
+
return `${latestOperation.name}...`;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return lastLine;
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
const collectDescendantPids = (messages: readonly Trace.Message[], rootPid: string): Set<string> => {
|
|
435
|
+
const pids = new Set([rootPid]);
|
|
436
|
+
let expanded = true;
|
|
437
|
+
while (expanded) {
|
|
438
|
+
expanded = false;
|
|
439
|
+
for (const message of messages) {
|
|
440
|
+
const pid = message.meta.pid;
|
|
441
|
+
const parentPid = message.meta.parentPid;
|
|
442
|
+
if (pid && parentPid && pids.has(parentPid) && !pids.has(pid)) {
|
|
443
|
+
pids.add(pid);
|
|
444
|
+
expanded = true;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return pids;
|
|
449
|
+
};
|
|
450
|
+
|
|
321
451
|
/**
|
|
322
452
|
* A span is "collapsible" when it would otherwise render as an empty fork-and-merge:
|
|
323
453
|
* exactly two events that form a begin/end pair and no child sub-spans. In that case
|
|
@@ -5,10 +5,20 @@
|
|
|
5
5
|
export {
|
|
6
6
|
CommitSelector,
|
|
7
7
|
buildExecutionGraph,
|
|
8
|
+
collectProcessActivityLines,
|
|
9
|
+
deriveInFlightActivityLine,
|
|
8
10
|
type BuildExecutionGraphParams,
|
|
11
|
+
type CollectProcessActivityOptions,
|
|
9
12
|
type ExecutionGraph,
|
|
10
13
|
type ExecutionGraphDetailsMap,
|
|
11
14
|
} from './execution-graph';
|
|
15
|
+
export {
|
|
16
|
+
estimateTokenCount,
|
|
17
|
+
formatPendingBlockStatus,
|
|
18
|
+
pendingStatusFromEphemeralMessage,
|
|
19
|
+
resolveEphemeralStatusUpdate,
|
|
20
|
+
type EphemeralStatusUpdate,
|
|
21
|
+
} from './pending-block-status';
|
|
12
22
|
export {
|
|
13
23
|
BEGIN_EVENT_TYPES,
|
|
14
24
|
END_EVENT_TYPES,
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { Trace } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
formatPendingBlockStatus,
|
|
11
|
+
pendingStatusFromEphemeralMessage,
|
|
12
|
+
resolveEphemeralStatusUpdate,
|
|
13
|
+
} from './pending-block-status';
|
|
14
|
+
|
|
15
|
+
describe('formatPendingBlockStatus', () => {
|
|
16
|
+
test('formats pending text as generating tokens', ({ expect }) => {
|
|
17
|
+
const status = formatPendingBlockStatus({
|
|
18
|
+
_tag: 'text',
|
|
19
|
+
text: 'Hello world',
|
|
20
|
+
pending: true,
|
|
21
|
+
});
|
|
22
|
+
expect(status).toMatch(/^Generating \d+ tokens\.\.\.\.$/);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('formats pending tool call with byte count', ({ expect }) => {
|
|
26
|
+
const status = formatPendingBlockStatus({
|
|
27
|
+
_tag: 'toolCall',
|
|
28
|
+
toolCallId: 'call-1',
|
|
29
|
+
name: 'create-document',
|
|
30
|
+
input: '{"title":"Haiku"}',
|
|
31
|
+
providerExecuted: false,
|
|
32
|
+
pending: true,
|
|
33
|
+
});
|
|
34
|
+
expect(status).toBe('Calling create-document (17 bytes)...');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('returns undefined for completed blocks', ({ expect }) => {
|
|
38
|
+
expect(
|
|
39
|
+
formatPendingBlockStatus({
|
|
40
|
+
_tag: 'text',
|
|
41
|
+
text: 'Done',
|
|
42
|
+
pending: false,
|
|
43
|
+
}),
|
|
44
|
+
).toBeUndefined();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('formats operation input as calling with byte count', ({ expect }) => {
|
|
48
|
+
const status = pendingStatusFromEphemeralMessage(
|
|
49
|
+
ephemeralMessage([
|
|
50
|
+
{
|
|
51
|
+
type: Trace.OperationInput.key,
|
|
52
|
+
timestamp: Date.now(),
|
|
53
|
+
data: { key: 'org.dxos.function.agent.get-context', name: 'Get Agent Context', input: { foo: 'bar' } },
|
|
54
|
+
},
|
|
55
|
+
]),
|
|
56
|
+
);
|
|
57
|
+
expect(status).toBe('Calling Get Agent Context (13 bytes)...');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('leaves status unchanged (sticky) when partial block stream completes', ({ expect }) => {
|
|
61
|
+
expect(
|
|
62
|
+
resolveEphemeralStatusUpdate(
|
|
63
|
+
ephemeralMessage([
|
|
64
|
+
{
|
|
65
|
+
type: 'assistant.partialBlock',
|
|
66
|
+
timestamp: Date.now(),
|
|
67
|
+
data: {
|
|
68
|
+
messageId: 'msg-1',
|
|
69
|
+
role: 'assistant',
|
|
70
|
+
block: {
|
|
71
|
+
_tag: 'toolCall',
|
|
72
|
+
toolCallId: 'call-1',
|
|
73
|
+
name: 'update-tasks',
|
|
74
|
+
operationName: 'Update tasks',
|
|
75
|
+
input: '{}',
|
|
76
|
+
providerExecuted: false,
|
|
77
|
+
pending: false,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
]),
|
|
82
|
+
),
|
|
83
|
+
).toBe('unchanged');
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('suppresses raw routine ULID status updates', ({ expect }) => {
|
|
87
|
+
expect(
|
|
88
|
+
pendingStatusFromEphemeralMessage(
|
|
89
|
+
ephemeralMessage([
|
|
90
|
+
{
|
|
91
|
+
type: Trace.StatusUpdate.key,
|
|
92
|
+
timestamp: Date.now(),
|
|
93
|
+
data: { message: 'Running 01KVB9WBRG0000000000000000' },
|
|
94
|
+
},
|
|
95
|
+
]),
|
|
96
|
+
),
|
|
97
|
+
).toBeUndefined();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('keeps descriptive status updates', ({ expect }) => {
|
|
101
|
+
expect(
|
|
102
|
+
pendingStatusFromEphemeralMessage(
|
|
103
|
+
ephemeralMessage([
|
|
104
|
+
{ type: Trace.StatusUpdate.key, timestamp: Date.now(), data: { message: 'Thinking about the plan' } },
|
|
105
|
+
]),
|
|
106
|
+
),
|
|
107
|
+
).toBe('Thinking about the plan');
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// `Trace.Message` is an ECHO object type, so a plain test literal does not structurally overlap it;
|
|
112
|
+
// build the minimal ephemeral envelope the status helpers read via a single boundary cast.
|
|
113
|
+
const ephemeralMessage = (events: readonly Trace.Event[]): Trace.Message =>
|
|
114
|
+
({ meta: { pid: 'pid-1' }, isEphemeral: true, events }) as unknown as Trace.Message;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { PartialBlock } from '@dxos/assistant';
|
|
6
|
+
import { Trace } from '@dxos/compute';
|
|
7
|
+
import { type ContentBlock } from '@dxos/types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Approximate streamed token count from partial text (UTF-8 length / 4).
|
|
11
|
+
*/
|
|
12
|
+
export const estimateTokenCount = (text: string): number =>
|
|
13
|
+
Math.max(1, Math.ceil(new TextEncoder().encode(text).length / 4));
|
|
14
|
+
|
|
15
|
+
const formatOperationInputStatus = (data: { key: string; name?: string; input: unknown }): string => {
|
|
16
|
+
const name = data.name ?? data.key;
|
|
17
|
+
const bytes = new TextEncoder().encode(JSON.stringify(data.input)).length;
|
|
18
|
+
return `Calling ${name} (${bytes} bytes)...`;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Raw routine status updates (e.g. `Running 01KVB9WBRG…`) carry an opaque ULID, not a useful label. */
|
|
22
|
+
const ROUTINE_ULID_STATUS = /^Running [0-9A-HJKMNP-TV-Z]{26}$/i;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Formats a pending assistant block for the delegated-task status line.
|
|
26
|
+
*/
|
|
27
|
+
export const formatPendingBlockStatus = (block: ContentBlock.Any): string | undefined => {
|
|
28
|
+
if (!block.pending) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (block._tag === 'text') {
|
|
33
|
+
return `Generating ${estimateTokenCount(block.text)} tokens....`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (block._tag === 'toolCall') {
|
|
37
|
+
const bytes = new TextEncoder().encode(block.input).length;
|
|
38
|
+
const name = block.operationName ?? block.name;
|
|
39
|
+
return `Calling ${name} (${bytes} bytes)...`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return undefined;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Reads the latest pending partial block from an ephemeral trace message.
|
|
47
|
+
*/
|
|
48
|
+
export const pendingStatusFromEphemeralMessage = (message: Trace.Message): string | undefined => {
|
|
49
|
+
for (const event of message.events) {
|
|
50
|
+
if (Trace.isOfType(PartialBlock, event)) {
|
|
51
|
+
const status = formatPendingBlockStatus(event.data.block);
|
|
52
|
+
if (status) {
|
|
53
|
+
return status;
|
|
54
|
+
}
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (Trace.isOfType(Trace.OperationInput, event)) {
|
|
59
|
+
return formatOperationInputStatus(event.data);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (Trace.isOfType(Trace.StatusUpdate, event)) {
|
|
63
|
+
// Suppress opaque routine ULID lines so descriptive partial-block / operation-input lines win.
|
|
64
|
+
if (ROUTINE_ULID_STATUS.test(event.data.message.trim())) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
return event.data.message;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type EphemeralStatusUpdate = 'unchanged' | { readonly line: string };
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Maps an ephemeral trace message to a task-status update.
|
|
77
|
+
*
|
|
78
|
+
* The status line is "sticky": a message without a pending line (e.g. a completed block during an
|
|
79
|
+
* LLM-thinking gap) leaves the previous line in place rather than clearing it, so the row keeps
|
|
80
|
+
* showing the latest meaningful activity until a new line arrives or the subscription ends.
|
|
81
|
+
*/
|
|
82
|
+
export const resolveEphemeralStatusUpdate = (message: Trace.Message): EphemeralStatusUpdate => {
|
|
83
|
+
const line = pendingStatusFromEphemeralMessage(message);
|
|
84
|
+
if (line) {
|
|
85
|
+
return { line };
|
|
86
|
+
}
|
|
87
|
+
return 'unchanged';
|
|
88
|
+
};
|
|
@@ -7,7 +7,7 @@ import { describe, test } from 'vitest';
|
|
|
7
7
|
import { Trace } from '@dxos/compute';
|
|
8
8
|
import { renderTimelineAscii } from '@dxos/react-ui-components';
|
|
9
9
|
|
|
10
|
-
import { buildExecutionGraph } from './execution-graph';
|
|
10
|
+
import { buildExecutionGraph, collectProcessActivityLines, deriveInFlightActivityLine } from './execution-graph';
|
|
11
11
|
import subAgentFixture from './testing/sub-agent-delegation.json';
|
|
12
12
|
|
|
13
13
|
// Real trace captured from a live supervisor → sub-agent delegation via `dxosDumpTrace()`.
|
|
@@ -47,4 +47,19 @@ describe('sub-agent delegation fixture', () => {
|
|
|
47
47
|
"
|
|
48
48
|
`);
|
|
49
49
|
});
|
|
50
|
+
|
|
51
|
+
test('collects sub-agent activity lines for a delegated process pid', ({ expect }) => {
|
|
52
|
+
const subAgentPid = 'cf8f7243-5b1d-4902-b158-70d9107d5f43';
|
|
53
|
+
const lines = collectProcessActivityLines(messages, subAgentPid);
|
|
54
|
+
expect(lines.length).toBeGreaterThan(0);
|
|
55
|
+
expect(lines).toContain('Run Routine');
|
|
56
|
+
expect(lines[lines.length - 1]).toMatch(/Run Routine - Success/);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('derives in-flight operation before completion', ({ expect }) => {
|
|
60
|
+
const subAgentPid = 'cf8f7243-5b1d-4902-b158-70d9107d5f43';
|
|
61
|
+
const partial = messages.slice(0, Math.floor(messages.length / 2));
|
|
62
|
+
const line = deriveInFlightActivityLine(partial, subAgentPid);
|
|
63
|
+
expect(line).toBeDefined();
|
|
64
|
+
});
|
|
50
65
|
});
|