@dxos/plugin-assistant 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393
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-5XDDEXMP.mjs +169 -0
- package/dist/lib/neutral/AgentArticle-5XDDEXMP.mjs.map +7 -0
- package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs +100 -0
- package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.mjs +99 -0
- package/dist/lib/neutral/AssistantPlugin.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs +46 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs +40 -0
- package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs.map +7 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs +27 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs.map +7 -0
- package/dist/lib/neutral/ChatCompanion-L33PFOFB.mjs +130 -0
- package/dist/lib/neutral/ChatCompanion-L33PFOFB.mjs.map +7 -0
- package/dist/lib/neutral/ChatContainer-VYVJYPPN.mjs +8 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs +72 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs.map +7 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs +28 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs.map +7 -0
- package/dist/lib/neutral/RoutineArticle-H7ECM7AH.mjs +116 -0
- package/dist/lib/neutral/RoutineArticle-H7ECM7AH.mjs.map +7 -0
- package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs +48 -0
- package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs.map +7 -0
- package/dist/lib/neutral/TracePanel-HYVPDIAA.mjs +565 -0
- package/dist/lib/neutral/TracePanel-HYVPDIAA.mjs.map +7 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs +92 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs.map +7 -0
- package/dist/lib/neutral/ai-service-GJXMI5OI.mjs +22 -0
- package/dist/lib/neutral/ai-service-GJXMI5OI.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-LHRT43KA.mjs +189 -0
- package/dist/lib/neutral/app-graph-builder-LHRT43KA.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs +32 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/blueprints/index.mjs +1 -1
- package/dist/lib/neutral/capabilities/index.mjs +35 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4CQZCMRP.mjs +25 -0
- package/dist/lib/neutral/chunk-4CQZCMRP.mjs.map +7 -0
- package/dist/lib/{browser/chunk-EZRS3J25.mjs → neutral/chunk-5H6UJHLF.mjs} +3 -3
- package/dist/lib/neutral/chunk-5H6UJHLF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-A4SCD32D.mjs +106 -0
- package/dist/lib/neutral/chunk-A4SCD32D.mjs.map +7 -0
- package/dist/lib/neutral/chunk-OT2QDO3T.mjs +8 -0
- package/dist/lib/neutral/chunk-OT2QDO3T.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VHPTYKYD.mjs +361 -0
- package/dist/lib/neutral/chunk-VHPTYKYD.mjs.map +7 -0
- package/dist/lib/neutral/companion-chat-provisioner-2Y6PRSDK.mjs +116 -0
- package/dist/lib/neutral/companion-chat-provisioner-2Y6PRSDK.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +2297 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +29 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/{browser/create-chat-LBZHGVSN.mjs → neutral/create-chat-5VM2UUWY.mjs} +8 -19
- package/dist/lib/neutral/create-chat-5VM2UUWY.mjs.map +7 -0
- package/dist/lib/neutral/create-object-UZCJCPWM.mjs +93 -0
- package/dist/lib/neutral/create-object-UZCJCPWM.mjs.map +7 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs +21 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs.map +7 -0
- package/dist/lib/{browser/ensure-companion-chat-ZEZA34MZ.mjs → neutral/ensure-companion-chat-5S4LZM2H.mjs} +10 -17
- package/dist/lib/neutral/ensure-companion-chat-5S4LZM2H.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +930 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +32 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs +24 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs.map +7 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs +110 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +12 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs +28 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs.map +7 -0
- package/dist/lib/{browser/on-create-space-54RNX5JI.mjs → neutral/on-create-space-Q2R7OSP6.mjs} +5 -8
- package/dist/lib/neutral/on-create-space-Q2R7OSP6.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-2WAPE25I.mjs +174 -0
- package/dist/lib/neutral/react-surface-2WAPE25I.mjs.map +7 -0
- package/dist/lib/{browser/resolve-navigation-targets-NZOD66NY.mjs → neutral/resolve-navigation-targets-VXBSWV5L.mjs} +4 -6
- package/dist/lib/neutral/resolve-navigation-targets-VXBSWV5L.mjs.map +7 -0
- package/dist/lib/{browser/run-prompt-in-new-chat-THLK5YQC.mjs → neutral/run-prompt-in-new-chat-XEPT5MOM.mjs} +14 -50
- package/dist/lib/neutral/run-prompt-in-new-chat-XEPT5MOM.mjs.map +7 -0
- package/dist/lib/{browser/set-current-chat-LRS3VFSH.mjs → neutral/set-current-chat-ZFDCYK5I.mjs} +5 -11
- package/dist/lib/neutral/set-current-chat-ZFDCYK5I.mjs.map +7 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs +28 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs.map +7 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs +28 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs.map +7 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs +14 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +174 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +20 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/{browser/update-chat-name-3Y36KFAS.mjs → neutral/update-chat-name-ENXRUMDJ.mjs} +8 -25
- package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts +1 -0
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.node.d.ts +4 -0
- package/dist/types/src/AssistantPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AssistantPlugin.test.d.ts +2 -0
- package/dist/types/src/AssistantPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- 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/companion-chat-provisioner.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +31 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +27 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +2 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +36 -40
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/context.d.ts +29 -0
- package/dist/types/src/components/Chat/context.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts +12 -0
- package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +7 -5
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +28 -0
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +2 -2
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +3 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +6 -3
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +5 -5
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +18 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +4 -4
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +2 -15
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/defaults.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/defaults.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts +1 -2
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +2 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +0 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/TaskList/TaskList.d.ts +10 -0
- package/dist/types/src/components/TaskList/TaskList.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts +16 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/index.d.ts +2 -0
- package/dist/types/src/components/TaskList/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -2
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +4 -5
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -4
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +3 -3
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.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/AgentArticle/AgentArticle.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -1
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +1 -1
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +1 -1
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts +6 -0
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +6 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +15 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts +6 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts.map +1 -0
- package/dist/types/src/containers/{PromptList/PromptList.stories.d.ts → RoutineList/RoutineList.stories.d.ts} +1 -1
- package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineList/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts +3 -2
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +1 -4
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +1 -1
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts +81 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/testing/index.d.ts +3 -0
- package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +14 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +12 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +5 -4
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -1
- package/dist/types/src/feed-logger.d.ts +13 -0
- package/dist/types/src/feed-logger.d.ts.map +1 -0
- 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/useBlueprintRegistry.d.ts +4 -4
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatKeymap.d.ts +12 -0
- package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +2 -2
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +2 -2
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useDebug.d.ts +10 -0
- package/dist/types/src/hooks/useDebug.d.ts.map +1 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- package/dist/types/src/hooks/useFlush.d.ts +1 -1
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -1
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +3 -3
- package/dist/types/src/operations/create-chat.d.ts.map +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts +3 -3
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -2
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +3 -3
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -1
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +3 -3
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -1
- package/dist/types/src/operations/set-current-chat.d.ts +3 -3
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
- package/dist/types/src/operations/update-chat-name.d.ts +3 -3
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +30 -12
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +2 -3
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-sequence.d.ts +3 -3
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/testing/test-trace.d.ts +5 -0
- package/dist/types/src/testing/test-trace.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +22 -6
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantCapabilities.d.ts +30 -0
- package/dist/types/src/types/AssistantCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AssistantEvents.d.ts +3 -0
- package/dist/types/src/types/AssistantEvents.d.ts.map +1 -0
- package/dist/types/src/{operations/definitions.d.ts → types/AssistantOperation.d.ts} +27 -20
- package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +20 -5
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +156 -117
- package/src/AssistantPlugin.node.ts +44 -0
- package/src/AssistantPlugin.test.ts +35 -0
- package/src/AssistantPlugin.ts +126 -0
- package/src/blueprints/assistant/blueprint.test.ts +3 -3
- package/src/blueprints/assistant/blueprint.ts +4 -4
- package/src/capabilities/app-graph-builder.ts +42 -12
- package/src/capabilities/blueprint-definition.ts +2 -4
- package/src/capabilities/companion-chat-provisioner.ts +4 -5
- package/src/capabilities/create-object.ts +107 -0
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/markdown.ts +1 -1
- package/src/capabilities/migrations.ts +4 -11
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +28 -14
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +3 -2
- package/src/components/AssistantSettings/AssistantSettings.tsx +22 -111
- package/src/components/Chat/Chat.tsx +85 -259
- package/src/components/Chat/context.ts +39 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -10
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +50 -0
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +28 -14
- package/src/components/ChatPrompt/ChatOptions.tsx +100 -60
- package/src/components/ChatPrompt/ChatPrompt.tsx +182 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +4 -4
- package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatPrompt/index.ts +3 -0
- package/src/components/ChatThread/Anchor.stories.tsx +3 -3
- package/src/components/ChatThread/ChatThread.stories.tsx +27 -30
- package/src/components/ChatThread/ChatThread.tsx +31 -18
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/MarkdownStream.stories.tsx +5 -4
- package/src/components/ChatThread/registry.tsx +61 -18
- package/src/components/ChatThread/sync.test.ts +84 -18
- package/src/components/ChatThread/sync.ts +1 -1
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +7 -7
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +3 -1
- package/src/components/ChatThread/widgets/SelectWidget.ts +3 -1
- package/src/components/ChatThread/widgets/StatsWidget.ts +3 -1
- package/src/components/ChatThread/widgets/StatusWidget.ts +5 -83
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +1 -1
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +3 -4
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +2 -1
- package/src/components/ChatThread/widgets/defaults.ts +8 -0
- package/src/components/ChatThread/widgets/index.ts +1 -2
- package/src/components/ProcessTree/ProcessTree.stories.tsx +12 -38
- package/src/components/ProcessTree/ProcessTree.tsx +69 -36
- package/src/components/TaskList/TaskList.stories.tsx +44 -0
- package/src/components/TaskList/TaskList.tsx +45 -0
- package/src/{cli → components/TaskList}/index.ts +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -3
- package/src/components/TemplateEditor/TemplateEditor.tsx +5 -5
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +6 -9
- package/src/components/TemplateEditor/TemplateForm.tsx +51 -72
- package/src/components/Toolbox/Toolbox.stories.tsx +6 -5
- package/src/components/Toolbox/Toolbox.tsx +4 -4
- package/src/components/index.ts +1 -0
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +8 -8
- package/src/containers/AgentArticle/AgentArticle.tsx +12 -8
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +6 -5
- package/src/containers/AgentProperties/AgentProperties.tsx +6 -6
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +1 -1
- package/src/containers/ChatCompanion/ChatCompanion.tsx +13 -26
- package/src/containers/ChatContainer/ChatContainer.tsx +20 -8
- package/src/containers/ChatDialog/ChatDialog.tsx +3 -9
- package/src/containers/PlanArticle/PlanArticle.tsx +33 -0
- package/src/containers/PlanArticle/index.ts +5 -0
- package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +75 -0
- package/src/containers/RoutineArticle/RoutineArticle.tsx +109 -0
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/{PromptList/PromptList.stories.tsx → RoutineList/RoutineList.stories.tsx} +13 -12
- package/src/containers/{PromptList/PromptList.tsx → RoutineList/RoutineList.tsx} +8 -7
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +215 -202
- package/src/containers/TracePanel/TracePanel.tsx +101 -47
- package/src/containers/TracePanel/dxn-extractor.test.ts +7 -7
- package/src/containers/TracePanel/dxn-extractor.ts +11 -11
- package/src/containers/TracePanel/execution-graph.test.ts +382 -0
- package/src/containers/TracePanel/execution-graph.ts +380 -211
- package/src/containers/TracePanel/testing/index.ts +6 -0
- package/src/containers/TracePanel/testing/simulated-agent.ts +114 -0
- package/src/containers/TracePanel/testing/snapshot-playback.ts +45 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +1 -1
- package/src/containers/index.ts +5 -4
- package/src/{queue-logger.ts → feed-logger.ts} +38 -28
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useBlueprintRegistry.ts +4 -4
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +4 -4
- package/src/hooks/useChatServices.ts +1 -1
- package/src/hooks/useChatToolbarActions.ts +1 -1
- package/src/hooks/useContextBinder.ts +4 -4
- package/src/hooks/useContextObjects.ts +2 -2
- package/src/hooks/useDebug.ts +38 -0
- package/src/index.ts +0 -5
- package/src/operations/create-chat.ts +7 -9
- package/src/operations/ensure-companion-chat.ts +49 -47
- package/src/operations/index.ts +1 -3
- package/src/operations/on-create-space.ts +4 -4
- package/src/operations/prompt.test.ts +9 -11
- package/src/operations/resolve-navigation-targets.ts +3 -3
- package/src/operations/run-prompt-in-new-chat.ts +85 -86
- package/src/operations/set-current-chat.ts +4 -5
- package/src/operations/update-chat-name.ts +4 -4
- package/src/plugin.ts +11 -0
- package/src/processor/processor.test.ts +2 -2
- package/src/processor/processor.ts +49 -18
- package/src/testing/data/trace-timeline.dx.json +3737 -1200
- package/src/testing/index.ts +1 -0
- package/src/testing/test-generator.test.ts +41 -52
- package/src/testing/test-generator.ts +177 -192
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-trace.ts +20 -0
- package/src/testing/trace-timeline.conversations.json +1 -1
- package/src/testing/trace-timeline.test.ts +53 -49
- package/src/translations.ts +29 -33
- package/src/types/Assistant.ts +13 -1
- package/src/types/AssistantCapabilities.ts +35 -0
- package/src/types/AssistantEvents.ts +11 -0
- package/src/{operations/definitions.ts → types/AssistantOperation.ts} +5 -4
- package/src/types/Settings.ts +62 -7
- package/src/types/index.ts +5 -3
- package/src/types/service.ts +1 -1
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs +0 -97
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATHYBVGN.mjs +0 -176
- package/dist/lib/browser/chunk-ATHYBVGN.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZRS3J25.mjs.map +0 -7
- package/dist/lib/browser/chunk-LMVTXH54.mjs +0 -154
- package/dist/lib/browser/chunk-LMVTXH54.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -74
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/create-chat-LBZHGVSN.mjs.map +0 -7
- package/dist/lib/browser/ensure-companion-chat-ZEZA34MZ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -3446
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/on-create-space-54RNX5JI.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -13
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs.map +0 -7
- package/dist/lib/browser/run-prompt-in-new-chat-THLK5YQC.mjs.map +0 -7
- package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -20
- package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +0 -7
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +0 -98
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -9
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +0 -32
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs +0 -177
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs +0 -155
- package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -75
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs +0 -83
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs.map +0 -7
- package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs +0 -66
- package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -3447
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs +0 -23
- package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -14
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs +0 -23
- package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs.map +0 -7
- package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs +0 -137
- package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs.map +0 -7
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs +0 -55
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -21
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs +0 -72
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +0 -7
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts +0 -10
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +0 -10
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +0 -1
- package/dist/types/src/components/ChatProgress/index.d.ts +0 -2
- package/dist/types/src/components/ChatProgress/index.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts +0 -15
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +0 -1
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +0 -6
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +0 -1
- package/dist/types/src/containers/PromptArticle/index.d.ts +0 -2
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/PromptList.d.ts +0 -6
- package/dist/types/src/containers/PromptList/PromptList.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/index.d.ts +0 -2
- package/dist/types/src/containers/PromptList/index.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/queue-logger.d.ts +0 -11
- package/dist/types/src/queue-logger.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -32
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/defs.d.ts +0 -2
- package/dist/types/src/types/defs.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/AssistantPlugin.tsx +0 -238
- package/src/cli/plugin.ts +0 -84
- package/src/components/ChatProgress/ChatProgress.tsx +0 -56
- package/src/components/ChatProgress/index.ts +0 -5
- package/src/components/ChatThread/widgets/PromptWidget.ts +0 -30
- package/src/containers/PromptArticle/PromptArticle.tsx +0 -59
- package/src/containers/PromptArticle/index.ts +0 -5
- package/src/containers/PromptList/index.ts +0 -5
- package/src/types/capabilities.ts +0 -35
- package/src/types/defs.ts +0 -5
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser/blueprints/index.mjs.map → neutral/ChatContainer-VYVJYPPN.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{node-esm/blueprints → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
|
@@ -5,27 +5,30 @@
|
|
|
5
5
|
import * as Option from 'effect/Option';
|
|
6
6
|
import React, { type JSX, useCallback, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type
|
|
9
|
-
import { McpServer } from '@dxos/assistant-toolkit';
|
|
10
|
-
import { type Blueprint } from '@dxos/
|
|
8
|
+
import { type AiContext } from '@dxos/assistant';
|
|
9
|
+
import { type Chat as ChatModule, McpServer } from '@dxos/assistant-toolkit';
|
|
10
|
+
import { type Blueprint } from '@dxos/compute';
|
|
11
11
|
import { Annotation, type Database, Filter, Obj, Type } from '@dxos/echo';
|
|
12
|
-
import { useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { useObject, useQuery } from '@dxos/react-client/echo';
|
|
13
13
|
import { IconButton, Input, Popover, Select, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import { Listbox
|
|
14
|
+
import { Listbox } from '@dxos/react-ui-list';
|
|
15
|
+
import { SearchList, useSearchListResults } from '@dxos/react-ui-search';
|
|
15
16
|
import { Tabs } from '@dxos/react-ui-tabs';
|
|
16
17
|
import { getStyles, mx } from '@dxos/ui-theme';
|
|
17
18
|
|
|
18
19
|
import { useActiveBlueprints, useBlueprintHandlers, useBlueprints, useContextObjects, useFilteredTypes } from '#hooks';
|
|
19
20
|
import { meta } from '#meta';
|
|
21
|
+
import { Assistant } from '#types';
|
|
20
22
|
|
|
21
23
|
const styles = {
|
|
22
|
-
panel: 'w-[calc(100dvw-.5rem)] sm:w-max
|
|
23
|
-
toolbar: 'p-
|
|
24
|
+
panel: 'w-[calc(100dvw-.5rem)] sm:w-max max-w-document-width',
|
|
25
|
+
toolbar: 'p-0! gap-0! border-t border-separator',
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
export type ChatOptionsProps = {
|
|
29
|
+
chat?: ChatModule.Chat;
|
|
27
30
|
db: Database.Database;
|
|
28
|
-
context:
|
|
31
|
+
context: AiContext.Binder;
|
|
29
32
|
blueprintRegistry?: Blueprint.Registry;
|
|
30
33
|
presets?: { id: string; label: string }[];
|
|
31
34
|
preset?: string;
|
|
@@ -35,11 +38,19 @@ export type ChatOptionsProps = {
|
|
|
35
38
|
/**
|
|
36
39
|
* Manages the runtime context for the chat.
|
|
37
40
|
*/
|
|
38
|
-
export const ChatOptions = ({
|
|
41
|
+
export const ChatOptions = ({
|
|
42
|
+
chat,
|
|
43
|
+
db,
|
|
44
|
+
context,
|
|
45
|
+
blueprintRegistry,
|
|
46
|
+
presets,
|
|
47
|
+
preset,
|
|
48
|
+
onPresetChange,
|
|
49
|
+
}: ChatOptionsProps) => {
|
|
39
50
|
const { t } = useTranslation(meta.id);
|
|
40
51
|
|
|
41
52
|
return (
|
|
42
|
-
<div
|
|
53
|
+
<div className='flex'>
|
|
43
54
|
<Popover.Root>
|
|
44
55
|
<Popover.Trigger asChild>
|
|
45
56
|
<IconButton variant='ghost' icon='ph--plus--regular' iconOnly label={t('context-objects.button')} />
|
|
@@ -66,37 +77,39 @@ export const ChatOptions = ({ db, context, blueprintRegistry, presets, preset, o
|
|
|
66
77
|
<Popover.Portal>
|
|
67
78
|
<Popover.Content side='top' classNames={styles.panel}>
|
|
68
79
|
<Popover.Viewport>
|
|
69
|
-
<Tabs.Root
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<Tabs.Panel value='model' tabIndex={-1} classNames='dx-focus-ring-inset'>
|
|
80
|
-
<ModelsPanel presets={presets} preset={preset} onPresetChange={onPresetChange} />
|
|
80
|
+
<Tabs.Root
|
|
81
|
+
classNames='flex'
|
|
82
|
+
orientation='horizontal'
|
|
83
|
+
defaultValue='view'
|
|
84
|
+
defaultActivePart='list'
|
|
85
|
+
tabIndex={-1}
|
|
86
|
+
>
|
|
87
|
+
<Tabs.Viewport classNames={mx('grid grid-rows-[1fr_40px] w-full')}>
|
|
88
|
+
<Tabs.Panel tabIndex={-1} classNames='dx-focus-ring-inset overflow-hidden' value='view'>
|
|
89
|
+
<ViewPanel chat={chat} />
|
|
81
90
|
</Tabs.Panel>
|
|
82
|
-
<Tabs.Panel
|
|
91
|
+
<Tabs.Panel tabIndex={-1} classNames='dx-focus-ring-inset overflow-hidden' value='blueprints'>
|
|
92
|
+
<BlueprintsPanel blueprintRegistry={blueprintRegistry} db={db} context={context} />
|
|
93
|
+
</Tabs.Panel>
|
|
94
|
+
<Tabs.Panel tabIndex={-1} classNames='dx-focus-ring-inset overflow-hidden' value='mcp-servers'>
|
|
83
95
|
<McpServersPanel db={db} />
|
|
84
96
|
</Tabs.Panel>
|
|
85
|
-
<Tabs.Panel
|
|
86
|
-
<
|
|
97
|
+
<Tabs.Panel tabIndex={-1} classNames='dx-focus-ring-inset overflow-hidden' value='model'>
|
|
98
|
+
<ModelsPanel presets={presets} preset={preset} onPresetChange={onPresetChange} />
|
|
87
99
|
</Tabs.Panel>
|
|
88
|
-
<Tabs.Tablist classNames={styles.toolbar}>
|
|
89
|
-
<Tabs.IconTab value='
|
|
100
|
+
<Tabs.Tablist classNames={[styles.toolbar]}>
|
|
101
|
+
<Tabs.IconTab value='view' icon='ph--eye--regular' label={t('chat-view.title')} />
|
|
90
102
|
<Tabs.IconTab
|
|
91
103
|
value='blueprints'
|
|
92
104
|
icon='ph--blueprint--regular'
|
|
93
|
-
label={t('blueprints
|
|
105
|
+
label={t('options.blueprints.title')}
|
|
94
106
|
/>
|
|
95
107
|
<Tabs.IconTab
|
|
96
108
|
value='mcp-servers'
|
|
97
109
|
icon='ph--plugs-connected--regular'
|
|
98
|
-
label={t('mcp
|
|
110
|
+
label={t('options.mcp.title')}
|
|
99
111
|
/>
|
|
112
|
+
<Tabs.IconTab value='model' icon='ph--cpu--regular' label={t('options.chat-model.title')} />
|
|
100
113
|
</Tabs.Tablist>
|
|
101
114
|
</Tabs.Viewport>
|
|
102
115
|
</Tabs.Root>
|
|
@@ -126,7 +139,7 @@ const BlueprintsPanel = ({
|
|
|
126
139
|
|
|
127
140
|
return (
|
|
128
141
|
<SearchList.Root onSearch={handleSearch}>
|
|
129
|
-
<SearchList.Content classNames='
|
|
142
|
+
<SearchList.Content classNames='flex flex-col'>
|
|
130
143
|
<SearchList.Viewport>
|
|
131
144
|
{results.map((blueprint) => {
|
|
132
145
|
const isActive = activeBlueprints.has(blueprint.key);
|
|
@@ -142,12 +155,29 @@ const BlueprintsPanel = ({
|
|
|
142
155
|
);
|
|
143
156
|
})}
|
|
144
157
|
</SearchList.Viewport>
|
|
158
|
+
<SearchList.Input placeholder={t('search.placeholder')} classNames='border-t border-separator' autoFocus />
|
|
145
159
|
</SearchList.Content>
|
|
146
|
-
<SearchList.Input placeholder={t('search.placeholder')} classNames='mb-form-chrome' autoFocus />
|
|
147
160
|
</SearchList.Root>
|
|
148
161
|
);
|
|
149
162
|
};
|
|
150
163
|
|
|
164
|
+
const ViewPanel = ({ chat }: Pick<ChatOptionsProps, 'chat'>) => {
|
|
165
|
+
const { t } = useTranslation(meta.id);
|
|
166
|
+
const [view, setView] = useObject(chat, 'view');
|
|
167
|
+
const value = (view as Assistant.ChatView | undefined) ?? 'normal';
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
<Listbox.Root value={value} onValueChange={setView} autoFocus>
|
|
171
|
+
{Assistant.ChatViews.map((view) => (
|
|
172
|
+
<Listbox.Option key={view} value={view}>
|
|
173
|
+
<Listbox.OptionLabel>{t(`chat-view.${view}.label`, { defaultValue: view })}</Listbox.OptionLabel>
|
|
174
|
+
<Listbox.OptionIndicator />
|
|
175
|
+
</Listbox.Option>
|
|
176
|
+
))}
|
|
177
|
+
</Listbox.Root>
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
|
|
151
181
|
const ModelsPanel = ({
|
|
152
182
|
presets,
|
|
153
183
|
preset,
|
|
@@ -184,12 +214,6 @@ const McpServersPanel = ({ db }: McpServersPanelProps) => {
|
|
|
184
214
|
[db],
|
|
185
215
|
);
|
|
186
216
|
|
|
187
|
-
const handleToggle = useCallback((server: McpServer.McpServer, enabled: boolean) => {
|
|
188
|
-
Obj.change(server, (server) => {
|
|
189
|
-
server.enabled = enabled;
|
|
190
|
-
});
|
|
191
|
-
}, []);
|
|
192
|
-
|
|
193
217
|
const handleRemove = useCallback(
|
|
194
218
|
(server: McpServer.McpServer) => {
|
|
195
219
|
db.remove(server);
|
|
@@ -198,31 +222,14 @@ const McpServersPanel = ({ db }: McpServersPanelProps) => {
|
|
|
198
222
|
);
|
|
199
223
|
|
|
200
224
|
return (
|
|
201
|
-
<div className='
|
|
225
|
+
<div className='p-form-chrome'>
|
|
202
226
|
{servers.map((server) => (
|
|
203
|
-
<
|
|
204
|
-
<Input.Root>
|
|
205
|
-
<Input.Label srOnly>{server.name}</Input.Label>
|
|
206
|
-
<Input.Switch
|
|
207
|
-
checked={server.enabled !== false}
|
|
208
|
-
onCheckedChange={(checked) => handleToggle(server, !!checked)}
|
|
209
|
-
/>
|
|
210
|
-
</Input.Root>
|
|
211
|
-
<span className='flex-1 truncate text-sm'>{server.name}</span>
|
|
212
|
-
<span className='truncate text-xs text-description'>{server.url}</span>
|
|
213
|
-
<IconButton
|
|
214
|
-
variant='ghost'
|
|
215
|
-
icon='ph--x--regular'
|
|
216
|
-
iconOnly
|
|
217
|
-
label={t('mcp-server-remove.label')}
|
|
218
|
-
onClick={() => handleRemove(server)}
|
|
219
|
-
/>
|
|
220
|
-
</div>
|
|
227
|
+
<McpServerRow key={server.id} server={server} onRemove={handleRemove} />
|
|
221
228
|
))}
|
|
222
229
|
{adding ? (
|
|
223
230
|
<McpServerForm onSubmit={handleAdd} onCancel={() => setAdding(false)} />
|
|
224
231
|
) : (
|
|
225
|
-
<div
|
|
232
|
+
<div>
|
|
226
233
|
<IconButton
|
|
227
234
|
variant='ghost'
|
|
228
235
|
icon='ph--plus--regular'
|
|
@@ -235,6 +242,39 @@ const McpServersPanel = ({ db }: McpServersPanelProps) => {
|
|
|
235
242
|
);
|
|
236
243
|
};
|
|
237
244
|
|
|
245
|
+
type McpServerRowProps = {
|
|
246
|
+
server: McpServer.McpServer;
|
|
247
|
+
onRemove: (server: McpServer.McpServer) => void;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* `useQuery` returns live objects but only re-renders on result-identity changes,
|
|
252
|
+
* so we must subscribe to the per-server `enabled` field via `useObject` to keep the
|
|
253
|
+
* switch in sync with mutations made through the returned setter.
|
|
254
|
+
*/
|
|
255
|
+
const McpServerRow = ({ server, onRemove }: McpServerRowProps) => {
|
|
256
|
+
const { t } = useTranslation(meta.id);
|
|
257
|
+
const [enabled, setEnabled] = useObject(server, 'enabled');
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<div className='flex items-center gap-2 px-form-chrome'>
|
|
261
|
+
<Input.Root>
|
|
262
|
+
<Input.Label srOnly>{server.name}</Input.Label>
|
|
263
|
+
<Input.Switch checked={enabled !== false} onCheckedChange={(checked) => setEnabled(!!checked)} />
|
|
264
|
+
</Input.Root>
|
|
265
|
+
<span className='flex-1 truncate text-sm'>{server.name}</span>
|
|
266
|
+
<span className='truncate text-xs text-description'>{server.url}</span>
|
|
267
|
+
<IconButton
|
|
268
|
+
variant='ghost'
|
|
269
|
+
icon='ph--x--regular'
|
|
270
|
+
iconOnly
|
|
271
|
+
label={t('mcp-server-remove.label')}
|
|
272
|
+
onClick={() => onRemove(server)}
|
|
273
|
+
/>
|
|
274
|
+
</div>
|
|
275
|
+
);
|
|
276
|
+
};
|
|
277
|
+
|
|
238
278
|
type McpServerFormProps = {
|
|
239
279
|
onSubmit: (name: string, url: string, protocol: 'sse' | 'http', apiKey?: string) => void;
|
|
240
280
|
onCancel: () => void;
|
|
@@ -293,7 +333,7 @@ const McpServerForm = ({ onSubmit, onCancel }: McpServerFormProps) => {
|
|
|
293
333
|
onChange={(event) => setApiKey(event.target.value)}
|
|
294
334
|
/>
|
|
295
335
|
</Input.Root>
|
|
296
|
-
<div
|
|
336
|
+
<div className='flex gap-2'>
|
|
297
337
|
<IconButton
|
|
298
338
|
variant='ghost'
|
|
299
339
|
icon='ph--check--regular'
|
|
@@ -365,7 +405,7 @@ export const ObjectsPanel = ({ db, context }: Pick<ChatOptionsProps, 'db' | 'con
|
|
|
365
405
|
key={object.id}
|
|
366
406
|
value={object.id}
|
|
367
407
|
icon={icon}
|
|
368
|
-
iconClassNames={styles?.
|
|
408
|
+
iconClassNames={styles?.foreground}
|
|
369
409
|
label={Obj.getLabel(object) ?? Obj.getTypename(object) ?? object.id}
|
|
370
410
|
checked={isActive}
|
|
371
411
|
onSelect={() => onUpdateObject?.(Obj.getDXN(object), !isActive)}
|
|
@@ -378,7 +418,7 @@ export const ObjectsPanel = ({ db, context }: Pick<ChatOptionsProps, 'db' | 'con
|
|
|
378
418
|
</SearchList.Viewport>
|
|
379
419
|
</SearchList.Content>
|
|
380
420
|
|
|
381
|
-
<div
|
|
421
|
+
<div className={mx('flex flex-col', styles.toolbar)}>
|
|
382
422
|
<Select.Root value={typename === ANY ? undefined : typename} onValueChange={setTypename}>
|
|
383
423
|
<Select.TriggerButton placeholder={t('type-filter.placeholder')} />
|
|
384
424
|
<Select.Portal>
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
7
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
10
|
+
import { type Event } from '@dxos/async';
|
|
11
|
+
import { type Database } from '@dxos/echo';
|
|
12
|
+
import { type Merge } from '@dxos/effect';
|
|
13
|
+
import { useVoiceInput } from '@dxos/plugin-transcription';
|
|
14
|
+
import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
|
|
15
|
+
import { ChatEditor, type ChatEditorController, type ChatEditorProps } from '@dxos/react-ui-chat';
|
|
16
|
+
import { mx } from '@dxos/ui-theme';
|
|
17
|
+
|
|
18
|
+
import { useChatKeymapExtensions } from '#hooks';
|
|
19
|
+
import { meta } from '#meta';
|
|
20
|
+
|
|
21
|
+
import { type AiChatProcessor } from '../../processor';
|
|
22
|
+
import { type ChatEvent } from '../Chat/events';
|
|
23
|
+
import { ChatActions, type ChatActionsProps } from './ChatActions';
|
|
24
|
+
import { ChatMcpErrors } from './ChatMcpErrors';
|
|
25
|
+
import { ChatOptions } from './ChatOptions';
|
|
26
|
+
import { type ChatPresetsProps } from './ChatPresets';
|
|
27
|
+
import { ChatReferences } from './ChatReferences';
|
|
28
|
+
import { ChatStatusIndicator } from './ChatStatusIndicator';
|
|
29
|
+
|
|
30
|
+
export type ChatPromptProps = ThemedClassName<
|
|
31
|
+
Merge<
|
|
32
|
+
{
|
|
33
|
+
outline?: boolean;
|
|
34
|
+
settings?: boolean;
|
|
35
|
+
expandable?: boolean;
|
|
36
|
+
chat?: Chat.Chat;
|
|
37
|
+
db?: Database.Database;
|
|
38
|
+
processor: AiChatProcessor;
|
|
39
|
+
event: Event<ChatEvent>;
|
|
40
|
+
online?: boolean;
|
|
41
|
+
placeholder?: ChatEditorProps['placeholder'];
|
|
42
|
+
onOnlineChange?: (online: boolean) => void;
|
|
43
|
+
onPresetChange?: ChatPresetsProps['onChange'];
|
|
44
|
+
},
|
|
45
|
+
Omit<ChatPresetsProps, 'onChange'>
|
|
46
|
+
>
|
|
47
|
+
>;
|
|
48
|
+
|
|
49
|
+
export const ChatPrompt = ({
|
|
50
|
+
classNames,
|
|
51
|
+
outline,
|
|
52
|
+
chat,
|
|
53
|
+
db,
|
|
54
|
+
processor,
|
|
55
|
+
event,
|
|
56
|
+
online,
|
|
57
|
+
placeholder,
|
|
58
|
+
onOnlineChange,
|
|
59
|
+
onPresetChange,
|
|
60
|
+
settings = true,
|
|
61
|
+
presets,
|
|
62
|
+
preset,
|
|
63
|
+
}: ChatPromptProps) => {
|
|
64
|
+
const { t } = useTranslation(meta.id);
|
|
65
|
+
|
|
66
|
+
const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
|
|
67
|
+
const streaming = useAtomValue(processor.streaming);
|
|
68
|
+
const active = useAtomValue(processor.active);
|
|
69
|
+
const activeRef = useDynamicRef(active);
|
|
70
|
+
|
|
71
|
+
const editorRef = useRef<ChatEditorController>(null);
|
|
72
|
+
const [recordingState, setRecordingState] = useState(false);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
return event.on((ev) => {
|
|
75
|
+
switch (ev.type) {
|
|
76
|
+
case 'update-prompt':
|
|
77
|
+
if (!editorRef.current?.getText()?.length) {
|
|
78
|
+
editorRef.current?.setText(ev.text);
|
|
79
|
+
editorRef.current?.focus();
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
case 'record-start':
|
|
83
|
+
setRecordingState(true);
|
|
84
|
+
break;
|
|
85
|
+
case 'record-stop':
|
|
86
|
+
setRecordingState(false);
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}, [event]);
|
|
91
|
+
|
|
92
|
+
// TODO(burdon): Configure capability in TranscriptionPlugin.
|
|
93
|
+
const { recording } = useVoiceInput({
|
|
94
|
+
active: recordingState,
|
|
95
|
+
onUpdate: (text) => {
|
|
96
|
+
editorRef.current?.setText(text);
|
|
97
|
+
editorRef.current?.focus();
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const extensions = useChatKeymapExtensions({ event });
|
|
102
|
+
|
|
103
|
+
const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
|
|
104
|
+
(text) => {
|
|
105
|
+
if (!activeRef.current) {
|
|
106
|
+
event.emit({ type: 'submit', text });
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
[event],
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const handleEvent = useCallback<NonNullable<ChatActionsProps['onEvent']>>(
|
|
114
|
+
(ev) => {
|
|
115
|
+
event.emit(ev);
|
|
116
|
+
},
|
|
117
|
+
[event],
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<div
|
|
122
|
+
role='group'
|
|
123
|
+
className={mx(
|
|
124
|
+
'flex flex-col w-full dx-density-fine',
|
|
125
|
+
outline &&
|
|
126
|
+
'bg-group-surface rounded-sm! border border-subdued-separator transition transition-border [&:has(.cm-content:focus)]:border-separator',
|
|
127
|
+
classNames,
|
|
128
|
+
)}
|
|
129
|
+
>
|
|
130
|
+
<ChatMcpErrors processor={processor} />
|
|
131
|
+
|
|
132
|
+
<div className='flex p-2 gap-2'>
|
|
133
|
+
<ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
|
|
134
|
+
<ChatEditor
|
|
135
|
+
ref={editorRef}
|
|
136
|
+
autoFocus
|
|
137
|
+
lineWrapping
|
|
138
|
+
classNames='col-span-2 pt-0.5'
|
|
139
|
+
placeholder={placeholder ?? t('prompt.placeholder')}
|
|
140
|
+
extensions={extensions}
|
|
141
|
+
onSubmit={handleSubmit}
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
{db && settings && (
|
|
146
|
+
<div className='flex items-center overflow-hidden p-1.5'>
|
|
147
|
+
<ChatOptions
|
|
148
|
+
chat={chat}
|
|
149
|
+
db={db}
|
|
150
|
+
blueprintRegistry={processor.blueprintRegistry}
|
|
151
|
+
context={processor.context}
|
|
152
|
+
preset={preset}
|
|
153
|
+
presets={presets}
|
|
154
|
+
onPresetChange={onPresetChange}
|
|
155
|
+
/>
|
|
156
|
+
|
|
157
|
+
<div className='flex h-8 grow overflow-x-auto scrollbar-none'>
|
|
158
|
+
<ChatReferences db={db} context={processor.context} />
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
<ChatActions
|
|
162
|
+
classNames='col-span-2'
|
|
163
|
+
microphone={true}
|
|
164
|
+
recording={recording}
|
|
165
|
+
processing={streaming}
|
|
166
|
+
onEvent={handleEvent}
|
|
167
|
+
>
|
|
168
|
+
{/* TODO(burdon): Move offline switch into dialog. */}
|
|
169
|
+
{online !== undefined && (
|
|
170
|
+
<Input.Root>
|
|
171
|
+
<Input.Label srOnly>{t('online-switch.label')}</Input.Label>
|
|
172
|
+
<Input.Switch classNames='mx-1' checked={online} onCheckedChange={onOnlineChange} />
|
|
173
|
+
</Input.Root>
|
|
174
|
+
)}
|
|
175
|
+
</ChatActions>
|
|
176
|
+
</div>
|
|
177
|
+
)}
|
|
178
|
+
</div>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
ChatPrompt.displayName = 'Chat.Prompt';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Option from 'effect/Option';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { type
|
|
8
|
+
import { type AiContext } from '@dxos/assistant';
|
|
9
9
|
import { Annotation, type Database, Obj } from '@dxos/echo';
|
|
10
10
|
import { Icon, IconButton, type Label, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { getStyles, mx } from '@dxos/ui-theme';
|
|
@@ -14,7 +14,7 @@ import { useContextObjects } from '#hooks';
|
|
|
14
14
|
import { meta } from '#meta';
|
|
15
15
|
|
|
16
16
|
export type ChatReferencesProps = ThemedClassName<{
|
|
17
|
-
context:
|
|
17
|
+
context: AiContext.Binder;
|
|
18
18
|
db: Database.Database;
|
|
19
19
|
}>;
|
|
20
20
|
|
|
@@ -35,13 +35,13 @@ export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps)
|
|
|
35
35
|
const styles = hue ? getStyles(hue) : undefined;
|
|
36
36
|
return (
|
|
37
37
|
<li key={dxn.toString()} className='dx-tag py-0 ps-2 flex items-center gap-1' data-hue='neutral'>
|
|
38
|
-
<Icon icon={icon} size={4} classNames={styles?.
|
|
38
|
+
<Icon icon={icon} size={4} classNames={styles?.foreground} />
|
|
39
39
|
{toLocalizedString(label, t)}
|
|
40
40
|
<IconButton
|
|
41
41
|
icon='ph--x--bold'
|
|
42
42
|
iconOnly
|
|
43
43
|
variant='ghost'
|
|
44
|
-
label={t('remove-object
|
|
44
|
+
label={t('remove-object.label')}
|
|
45
45
|
classNames='p-0 hover:bg-transparent'
|
|
46
46
|
size={3}
|
|
47
47
|
onClick={() => onUpdateObject?.(dxn, false)}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
+
import { ChatStatus as NaturalChatStatus, formatElapsed } from '@dxos/react-ui-chat';
|
|
9
|
+
import { Matrix } from '@dxos/react-ui-sfx';
|
|
10
|
+
import { type ContentBlock } from '@dxos/types';
|
|
11
|
+
import { Unit } from '@dxos/util';
|
|
12
|
+
|
|
13
|
+
import { type ChatRequestTiming, useChatContext } from '../Chat/context';
|
|
14
|
+
|
|
15
|
+
const CHAT_STREAM_STATUS_NAME = 'Chat.StreamStatus';
|
|
16
|
+
const TICK_MS = 1_000;
|
|
17
|
+
|
|
18
|
+
export type ChatStreamStatusProps = ThemedClassName<{
|
|
19
|
+
icon?: boolean;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Live status pill rendered at the bottom of the chat thread.
|
|
24
|
+
*
|
|
25
|
+
* The block-widget host re-mounts this component each time wire's drip queue toggles
|
|
26
|
+
* (`wireDrainingEffect`) — so all visible state is derived from chat-context values that
|
|
27
|
+
* survive the unmount: the latest `stats` block on the chat context's `messages` for token counts,
|
|
28
|
+
* and `requestTiming` (start/end wall-clock timestamps) for the elapsed value.
|
|
29
|
+
*
|
|
30
|
+
* Shows:
|
|
31
|
+
* - elapsed seconds since the most recent request started (frozen at end-of-request)
|
|
32
|
+
* - last completed turn's output token count (from the most recent `stats` content block)
|
|
33
|
+
* - cumulative session total tokens across all `stats` content blocks
|
|
34
|
+
*/
|
|
35
|
+
export const ChatStatus = ({ classNames, icon }: ChatStreamStatusProps) => {
|
|
36
|
+
// Read `messages` from the chat context (combines `useQuery(queue)` + the processor's
|
|
37
|
+
// pending atom) rather than `processor.messages` directly — the latter only contains
|
|
38
|
+
// blocks streamed via the ephemeral `PartialBlock` channel, while finalized blocks
|
|
39
|
+
// (including the per-turn `stats` block we read for token counts) are submitted to the
|
|
40
|
+
// feed via `_submitMessage` and only show up through `useQuery`.
|
|
41
|
+
const { messages, requestTiming } = useChatContext(CHAT_STREAM_STATUS_NAME);
|
|
42
|
+
|
|
43
|
+
const { lastOutputTokens, sessionTotalTokens } = useMemo(() => {
|
|
44
|
+
let last: number | undefined;
|
|
45
|
+
let total = 0;
|
|
46
|
+
for (const message of messages) {
|
|
47
|
+
for (const block of message.blocks) {
|
|
48
|
+
if (isStats(block) && block.usage) {
|
|
49
|
+
last = block.usage.outputTokens;
|
|
50
|
+
total += block.usage.totalTokens ?? 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return { lastOutputTokens: last, sessionTotalTokens: total };
|
|
55
|
+
}, [messages]);
|
|
56
|
+
|
|
57
|
+
const isRunning = requestTiming != null && requestTiming.endedAt == null;
|
|
58
|
+
const show = requestTiming || lastOutputTokens || sessionTotalTokens > 0;
|
|
59
|
+
if (!show) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<NaturalChatStatus.Root defaultRunning={false} classNames={['py-2 gap-2 text-sm', classNames]}>
|
|
65
|
+
{icon && (
|
|
66
|
+
<NaturalChatStatus.Icon>
|
|
67
|
+
<Matrix
|
|
68
|
+
classNames='w-5 h-5'
|
|
69
|
+
dotClassNames='bg-primary-500'
|
|
70
|
+
dim={4}
|
|
71
|
+
dotSize={3}
|
|
72
|
+
count={10}
|
|
73
|
+
interval={500}
|
|
74
|
+
active={isRunning}
|
|
75
|
+
/>
|
|
76
|
+
</NaturalChatStatus.Icon>
|
|
77
|
+
)}
|
|
78
|
+
{show && (
|
|
79
|
+
<div className='flex items-center'>
|
|
80
|
+
{requestTiming && (
|
|
81
|
+
<NaturalChatStatus.Text>
|
|
82
|
+
<Elapsed timing={requestTiming} />
|
|
83
|
+
</NaturalChatStatus.Text>
|
|
84
|
+
)}
|
|
85
|
+
{lastOutputTokens != null && (
|
|
86
|
+
<>
|
|
87
|
+
{requestTiming && <NaturalChatStatus.Separator />}
|
|
88
|
+
<NaturalChatStatus.Text>↓ {Unit.Thousand(lastOutputTokens).toString()}</NaturalChatStatus.Text>
|
|
89
|
+
</>
|
|
90
|
+
)}
|
|
91
|
+
{sessionTotalTokens > 0 && (
|
|
92
|
+
<>
|
|
93
|
+
{(requestTiming || lastOutputTokens != null) && <NaturalChatStatus.Separator />}
|
|
94
|
+
<NaturalChatStatus.Text>Σ {Unit.Thousand(sessionTotalTokens).toString()}</NaturalChatStatus.Text>
|
|
95
|
+
</>
|
|
96
|
+
)}
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
</NaturalChatStatus.Root>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Wall-clock-derived elapsed display. Tick interval forces a re-render every second while
|
|
105
|
+
* the request is active so the displayed value advances; once `endedAt` is set, the value
|
|
106
|
+
* is frozen and the interval is no longer scheduled.
|
|
107
|
+
*/
|
|
108
|
+
const Elapsed = ({ timing }: { timing: ChatRequestTiming }) => {
|
|
109
|
+
const isRunning = timing.endedAt == null;
|
|
110
|
+
const [now, setNow] = useState(Date.now());
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (!isRunning) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const id = setInterval(() => setNow(Date.now()), TICK_MS);
|
|
117
|
+
return () => clearInterval(id);
|
|
118
|
+
}, [isRunning]);
|
|
119
|
+
|
|
120
|
+
return <>{formatElapsed((timing.endedAt ?? now) - timing.startedAt)}</>;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const isStats = (block: ContentBlock.Any): block is ContentBlock.Stats => block._tag === 'stats';
|
|
@@ -30,7 +30,7 @@ export const ChatStatusIndicator = ({ classNames, preset, processing, error, ...
|
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<div
|
|
33
|
+
<div className={mx('relative flex', classNames)}>
|
|
34
34
|
<Spinner duration={period} state={!init ? 'flash' : error ? 'error' : processing ? 'spin' : 'pulse'} {...props} />
|
|
35
35
|
{error && (
|
|
36
36
|
<Tooltip.Trigger asChild content={error.message}>
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
export * from './ChatActions';
|
|
6
|
+
export * from './ChatMcpErrors';
|
|
6
7
|
export * from './ChatOptions';
|
|
7
8
|
export * from './ChatPresets';
|
|
9
|
+
export * from './ChatPrompt';
|
|
8
10
|
export * from './ChatReferences';
|
|
9
11
|
export * from './ChatStatusIndicator';
|
|
12
|
+
export * from './ChatStatus';
|
|
@@ -9,9 +9,9 @@ import React from 'react';
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { Database, Filter, Obj } from '@dxos/echo';
|
|
11
11
|
import { DxAnchor } from '@dxos/lit-ui/react';
|
|
12
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
12
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
13
13
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
14
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
14
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
15
15
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
16
16
|
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
17
17
|
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
@@ -43,7 +43,7 @@ const DefaultStory = () => {
|
|
|
43
43
|
|
|
44
44
|
const dxn = Obj.getDXN(organization).toString();
|
|
45
45
|
return (
|
|
46
|
-
<div
|
|
46
|
+
<div className='flex flex-col gap-2 p-4'>
|
|
47
47
|
<p>
|
|
48
48
|
Click{' '}
|
|
49
49
|
<DxAnchor className='dx-tag--anchor' dxn={dxn}>
|