@dxos/plugin-assistant 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc
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/LICENSE +102 -5
- package/README.md +1 -1
- 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 +10 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs +46 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.mjs +40 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.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/ChatArticle-WVAFZPVI.mjs +8 -0
- package/dist/lib/neutral/ChatCompanion-DFRMRUK3.mjs +133 -0
- package/dist/lib/neutral/ChatCompanion-DFRMRUK3.mjs.map +7 -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-C77SPEIS.mjs +672 -0
- package/dist/lib/neutral/TracePanel-C77SPEIS.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-5QBICPYP.mjs +200 -0
- package/dist/lib/neutral/app-graph-builder-5QBICPYP.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/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +35 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-3FIV362Z.mjs +8 -0
- package/dist/lib/neutral/chunk-3FIV362Z.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/blueprints/index.mjs → neutral/chunk-5H6UJHLF.mjs} +4 -5
- package/dist/lib/neutral/chunk-5H6UJHLF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ITJX2YZZ.mjs +98 -0
- package/dist/lib/neutral/chunk-ITJX2YZZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IZQWGJNG.mjs +380 -0
- package/dist/lib/neutral/chunk-IZQWGJNG.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SLIPV6NN.mjs +106 -0
- package/dist/lib/neutral/chunk-SLIPV6NN.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/{browser/chunk-VK53MITK.mjs → neutral/components/index.mjs} +139 -141
- 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-E2ZLVTLP.mjs → neutral/create-chat-QQZURUBW.mjs} +10 -12
- package/dist/lib/neutral/create-chat-QQZURUBW.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-7GDMXSQW.mjs → neutral/ensure-companion-chat-5S4LZM2H.mjs} +9 -16
- package/dist/lib/neutral/ensure-companion-chat-5S4LZM2H.mjs.map +7 -0
- package/dist/lib/{browser/chunk-M55MBYG7.mjs → neutral/hooks/index.mjs} +106 -111
- 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-4J3KTNAJ.mjs → neutral/on-create-space-Q2R7OSP6.mjs} +4 -7
- 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-T4R65UJU.mjs +174 -0
- package/dist/lib/neutral/react-surface-T4R65UJU.mjs.map +7 -0
- package/dist/lib/{browser/resolve-navigation-targets-3ZPQE6SZ.mjs → neutral/resolve-navigation-targets-VXBSWV5L.mjs} +3 -5
- package/dist/lib/neutral/resolve-navigation-targets-VXBSWV5L.mjs.map +7 -0
- package/dist/lib/{browser/run-prompt-in-new-chat-AA3KPBDN.mjs → neutral/run-prompt-in-new-chat-VJXXZ6SI.mjs} +16 -19
- package/dist/lib/neutral/run-prompt-in-new-chat-VJXXZ6SI.mjs.map +7 -0
- package/dist/lib/{browser/set-current-chat-P4VHI3YF.mjs → neutral/set-current-chat-ZFDCYK5I.mjs} +4 -10
- 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/testing.mjs +8 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs +21 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.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/{browser → neutral}/translations.mjs +5 -2
- 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-VWKNUON7.mjs → neutral/update-chat-name-ENXRUMDJ.mjs} +3 -5
- package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.node.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.workerd.d.ts +4 -0
- package/dist/types/src/AssistantPlugin.workerd.d.ts.map +1 -0
- 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/index.d.ts +27 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +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/components/Chat/Chat.d.ts +11 -5
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +2 -2
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- 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/ChatThread/ChatThread.stories.d.ts +2 -3
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.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/SummaryWidget.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.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/TemplateForm.d.ts +1 -2
- 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/Toolbox/Toolbox.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/{ChatContainer/ChatContainer.d.ts → ChatArticle/ChatArticle.d.ts} +3 -3
- package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.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.map +1 -1
- 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/TracePanel/TracePanel.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts +11 -2
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/span-tree.d.ts +73 -0
- package/dist/types/src/containers/TracePanel/span-tree.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/span-tree.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/span-tree.test.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -3
- package/dist/types/src/containers/index.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/useBlueprintRegistry.d.ts +3 -3
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +1 -1
- 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/index.d.ts +2 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +2 -2
- package/dist/types/src/operations/create-chat.d.ts.map +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts +2 -2
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +0 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +2 -2
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +2 -2
- 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 +2 -2
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
- package/dist/types/src/operations/toggle-trace-panel-debug.d.ts +5 -0
- package/dist/types/src/operations/toggle-trace-panel-debug.d.ts.map +1 -0
- package/dist/types/src/operations/update-chat-name.d.ts +2 -2
- 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 +11 -11
- package/dist/types/src/processor/processor.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.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +1 -0
- 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} +10 -6
- package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +1 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/suggestions.d.ts +9 -0
- package/dist/types/src/util/suggestions.d.ts.map +1 -0
- package/dist/types/src/util/suggestions.test.d.ts +2 -0
- package/dist/types/src/util/suggestions.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +152 -128
- package/src/AssistantPlugin.node.ts +7 -88
- package/src/AssistantPlugin.test.ts +3 -3
- package/src/AssistantPlugin.ts +126 -0
- package/src/AssistantPlugin.workerd.ts +41 -0
- package/src/blueprints/assistant/blueprint.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +48 -9
- package/src/capabilities/companion-chat-provisioner.ts +4 -5
- package/src/capabilities/create-object.ts +107 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/markdown.ts +2 -2
- package/src/capabilities/migrations.ts +3 -3
- package/src/capabilities/react-surface.tsx +15 -7
- package/src/components/Chat/Chat.tsx +35 -5
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +1 -1
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +4 -4
- package/src/components/ChatPrompt/ChatOptions.tsx +12 -11
- package/src/components/ChatPrompt/ChatPrompt.tsx +3 -3
- package/src/components/ChatPrompt/ChatReferences.tsx +3 -3
- package/src/components/ChatPrompt/ChatStatus.tsx +1 -1
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/Anchor.stories.tsx +3 -3
- package/src/components/ChatThread/ChatThread.stories.tsx +25 -29
- package/src/components/ChatThread/ChatThread.tsx +1 -1
- package/src/components/ChatThread/registry.tsx +8 -4
- package/src/components/ChatThread/sync.test.ts +4 -6
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +2 -2
- package/src/components/ChatThread/widgets/StatusWidget.ts +3 -83
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +1 -3
- package/src/components/ProcessTree/ProcessTree.tsx +2 -1
- 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 +1 -1
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +2 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +48 -69
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -4
- package/src/components/Toolbox/Toolbox.tsx +2 -2
- package/src/components/index.ts +1 -0
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +7 -7
- package/src/containers/AgentArticle/AgentArticle.tsx +11 -7
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +4 -4
- package/src/containers/AgentProperties/AgentProperties.tsx +4 -4
- package/src/containers/{ChatContainer/ChatContainer.tsx → ChatArticle/ChatArticle.tsx} +11 -9
- package/src/containers/ChatArticle/index.ts +5 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +20 -29
- 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 +74 -24
- package/src/containers/RoutineList/RoutineList.stories.tsx +3 -3
- package/src/containers/RoutineList/RoutineList.tsx +3 -3
- package/src/containers/TracePanel/TracePanel.stories.tsx +33 -26
- package/src/containers/TracePanel/TracePanel.tsx +72 -33
- package/src/containers/TracePanel/dxn-extractor.ts +7 -7
- package/src/containers/TracePanel/execution-graph.test.ts +218 -213
- package/src/containers/TracePanel/execution-graph.ts +316 -271
- package/src/containers/TracePanel/span-tree.test.ts +166 -0
- package/src/containers/TracePanel/span-tree.ts +214 -0
- package/src/containers/index.ts +4 -3
- package/src/{queue-logger.ts → feed-logger.ts} +37 -27
- package/src/hooks/useBlueprintRegistry.ts +12 -6
- package/src/hooks/useChatProcessor.ts +3 -3
- package/src/hooks/useChatServices.ts +1 -1
- package/src/hooks/useChatToolbarActions.ts +86 -88
- package/src/hooks/useContextBinder.ts +4 -4
- package/src/hooks/useContextObjects.ts +2 -2
- package/src/index.ts +2 -9
- package/src/operations/create-chat.ts +16 -11
- package/src/operations/ensure-companion-chat.ts +47 -45
- package/src/operations/index.ts +1 -2
- package/src/operations/on-create-space.ts +3 -3
- package/src/operations/prompt.test.ts +5 -5
- package/src/operations/resolve-navigation-targets.ts +2 -2
- package/src/operations/run-prompt-in-new-chat.ts +85 -84
- package/src/operations/set-current-chat.ts +3 -4
- package/src/operations/toggle-trace-panel-debug.ts +27 -0
- package/src/operations/update-chat-name.ts +2 -2
- package/src/plugin.ts +11 -0
- package/src/processor/processor.test.ts +1 -1
- package/src/processor/processor.ts +15 -15
- package/src/testing/test-generator.test.ts +41 -52
- package/src/testing/test-generator.ts +174 -189
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/trace-timeline.conversations.json +1 -1
- package/src/testing/trace-timeline.test.ts +3 -5
- package/src/testing.ts +7 -0
- package/src/translations.ts +5 -2
- package/src/types/Assistant.ts +2 -1
- package/src/types/AssistantCapabilities.ts +35 -0
- package/src/types/AssistantEvents.ts +11 -0
- package/src/{operations/definitions.ts → types/AssistantOperation.ts} +15 -0
- package/src/types/Settings.ts +6 -0
- package/src/types/index.ts +5 -2
- package/src/util/suggestions.test.ts +52 -0
- package/src/util/suggestions.ts +42 -0
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-DVOOFAWU.mjs +0 -175
- package/dist/lib/browser/chunk-DVOOFAWU.mjs.map +0 -7
- package/dist/lib/browser/chunk-M55MBYG7.mjs.map +0 -7
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs +0 -195
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs.map +0 -7
- package/dist/lib/browser/chunk-VK53MITK.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -73
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/components/index.mjs +0 -20
- package/dist/lib/browser/create-chat-E2ZLVTLP.mjs.map +0 -7
- package/dist/lib/browser/ensure-companion-chat-7GDMXSQW.mjs.map +0 -7
- package/dist/lib/browser/hooks/index.mjs +0 -39
- package/dist/lib/browser/index.mjs +0 -84
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/on-create-space-4J3KTNAJ.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-3ZPQE6SZ.mjs.map +0 -7
- package/dist/lib/browser/run-prompt-in-new-chat-AA3KPBDN.mjs.map +0 -7
- package/dist/lib/browser/set-current-chat-P4VHI3YF.mjs.map +0 -7
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -18
- package/dist/lib/browser/update-chat-name-VWKNUON7.mjs.map +0 -7
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs +0 -41
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -32
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FWC3ZGPH.mjs +0 -933
- package/dist/lib/node-esm/chunk-FWC3ZGPH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-JKEB3NFZ.mjs +0 -2302
- package/dist/lib/node-esm/chunk-JKEB3NFZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MBDVPB4V.mjs +0 -176
- package/dist/lib/node-esm/chunk-MBDVPB4V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs +0 -196
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -74
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/components/index.mjs +0 -21
- package/dist/lib/node-esm/create-chat-UQQ3542N.mjs +0 -74
- package/dist/lib/node-esm/create-chat-UQQ3542N.mjs.map +0 -7
- package/dist/lib/node-esm/ensure-companion-chat-LVCPD4DJ.mjs +0 -66
- package/dist/lib/node-esm/ensure-companion-chat-LVCPD4DJ.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -40
- package/dist/lib/node-esm/index.mjs +0 -85
- 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-M63UBTTT.mjs +0 -23
- package/dist/lib/node-esm/on-create-space-M63UBTTT.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-HO77CAFT.mjs +0 -23
- package/dist/lib/node-esm/resolve-navigation-targets-HO77CAFT.mjs.map +0 -7
- package/dist/lib/node-esm/run-prompt-in-new-chat-RIRYYYPK.mjs +0 -107
- package/dist/lib/node-esm/run-prompt-in-new-chat-RIRYYYPK.mjs.map +0 -7
- package/dist/lib/node-esm/set-current-chat-Z7GJ52VX.mjs +0 -55
- package/dist/lib/node-esm/set-current-chat-Z7GJ52VX.mjs.map +0 -7
- package/dist/lib/node-esm/translations.mjs +0 -173
- package/dist/lib/node-esm/translations.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -19
- package/dist/lib/node-esm/update-chat-name-GV4HX32Z.mjs +0 -57
- package/dist/lib/node-esm/update-chat-name-GV4HX32Z.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/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -2
- package/dist/types/src/containers/ChatContainer/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/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 -83
- package/src/containers/ChatContainer/index.ts +0 -5
- package/src/types/capabilities.ts +0 -35
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/AssistantPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser → neutral}/AssistantSettings-GG52BLKS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/AssistantSettings-GG52BLKS.mjs.map +0 -0
- /package/dist/lib/{browser/components/index.mjs.map → neutral/ChatArticle-WVAFZPVI.mjs.map} +0 -0
- /package/dist/lib/{browser/hooks → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/components → 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/hooks → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types/index.mjs.map → neutral/testing.mjs.map} +0 -0
|
@@ -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}>
|
|
@@ -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/testing';
|
|
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}>
|
|
@@ -9,15 +9,14 @@ import * as Layer from 'effect/Layer';
|
|
|
9
9
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
10
10
|
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import {
|
|
12
|
+
import { createFeedServiceLayer } from '@dxos/client/echo';
|
|
13
|
+
import { Database, Feed, Filter, Query } from '@dxos/echo';
|
|
13
14
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
17
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
15
|
+
import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
18
17
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
19
18
|
import { random } from '@dxos/random';
|
|
20
|
-
import {
|
|
19
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
21
20
|
import { EditorPreviewProvider } from '@dxos/react-ui-editor';
|
|
22
21
|
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
23
22
|
import { Message, Organization, Person } from '@dxos/types';
|
|
@@ -29,19 +28,25 @@ import { ChatThread, type ChatThreadProps } from './ChatThread';
|
|
|
29
28
|
|
|
30
29
|
random.seed(1);
|
|
31
30
|
|
|
32
|
-
type MessageGenerator = Effect.Effect<void, never, Database.Service |
|
|
31
|
+
type MessageGenerator = Effect.Effect<void, never, Database.Service | Feed.ContextFeedService | Feed.FeedService>;
|
|
33
32
|
|
|
34
33
|
type DefaultStoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
|
|
35
34
|
|
|
36
35
|
const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStoryProps) => {
|
|
37
36
|
const [space] = useSpaces();
|
|
38
|
-
const
|
|
39
|
-
|
|
37
|
+
const feed = useMemo<Feed.Feed | undefined>(
|
|
38
|
+
() => (space ? space.db.add(Feed.make({ name: 'chat' })) : undefined),
|
|
39
|
+
[space],
|
|
40
|
+
);
|
|
41
|
+
const messages = useQuery(
|
|
42
|
+
space?.db,
|
|
43
|
+
feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
|
|
44
|
+
);
|
|
40
45
|
const [done, setDone] = useState(false);
|
|
41
46
|
|
|
42
47
|
// Generate messages.
|
|
43
48
|
useEffect(() => {
|
|
44
|
-
if (!space || !
|
|
49
|
+
if (!space || !feed) {
|
|
45
50
|
return;
|
|
46
51
|
}
|
|
47
52
|
|
|
@@ -55,13 +60,21 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
|
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
setDone(true);
|
|
58
|
-
}).pipe(
|
|
63
|
+
}).pipe(
|
|
64
|
+
Effect.provide(
|
|
65
|
+
Layer.mergeAll(
|
|
66
|
+
Database.layer(space.db),
|
|
67
|
+
Feed.ContextFeedService.layer(feed),
|
|
68
|
+
createFeedServiceLayer(space.queues),
|
|
69
|
+
),
|
|
70
|
+
),
|
|
71
|
+
),
|
|
59
72
|
);
|
|
60
73
|
|
|
61
74
|
return () => {
|
|
62
75
|
void runAndForwardErrors(Fiber.interrupt(fiber));
|
|
63
76
|
};
|
|
64
|
-
}, [space,
|
|
77
|
+
}, [space, feed, generator, delay]);
|
|
65
78
|
|
|
66
79
|
if (wait && !done) {
|
|
67
80
|
return <Loading data={{ wait, done }} />;
|
|
@@ -74,23 +87,6 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
|
|
|
74
87
|
);
|
|
75
88
|
};
|
|
76
89
|
|
|
77
|
-
const useQueueMessages = (queue?: Queue<Message.Message>) => {
|
|
78
|
-
const [messages, setMessages] = useState<Message.Message[]>([]);
|
|
79
|
-
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
if (!queue) {
|
|
82
|
-
setMessages([]);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const update = () => setMessages([...queue.objects]);
|
|
87
|
-
update();
|
|
88
|
-
return queue.subscribe(update);
|
|
89
|
-
}, [queue]);
|
|
90
|
-
|
|
91
|
-
return messages;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
90
|
const meta = {
|
|
95
91
|
title: 'plugins/plugin-assistant/components/ChatThread',
|
|
96
92
|
component: ChatThread,
|
|
@@ -95,7 +95,7 @@ export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThread
|
|
|
95
95
|
);
|
|
96
96
|
|
|
97
97
|
return (
|
|
98
|
-
<div
|
|
98
|
+
<div data-hue={userHue} className='contents'>
|
|
99
99
|
<MarkdownStream
|
|
100
100
|
key={viewType}
|
|
101
101
|
classNames={classNames}
|
|
@@ -98,9 +98,9 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
98
98
|
status: {
|
|
99
99
|
block: true,
|
|
100
100
|
streaming: true,
|
|
101
|
-
factory: ({ children
|
|
101
|
+
factory: ({ children }) => {
|
|
102
102
|
const text = getXmlTextChild(children);
|
|
103
|
-
return text ? new StatusWidget(text
|
|
103
|
+
return text ? new StatusWidget(text) : null;
|
|
104
104
|
},
|
|
105
105
|
},
|
|
106
106
|
|
|
@@ -115,7 +115,7 @@ export const componentRegistry: XmlWidgetRegistry = {
|
|
|
115
115
|
toolCall: {
|
|
116
116
|
block: true,
|
|
117
117
|
Component: (props) => (
|
|
118
|
-
<div
|
|
118
|
+
<div className='py-2'>
|
|
119
119
|
<ToolWidget {...props} />
|
|
120
120
|
</div>
|
|
121
121
|
),
|
|
@@ -159,6 +159,10 @@ export function createBlockRenderer(viewType: Assistant.ChatView | undefined): B
|
|
|
159
159
|
}
|
|
160
160
|
let str = blockToMarkdownImpl(context, message, block);
|
|
161
161
|
if (str && !block.pending) {
|
|
162
|
+
// Use a blank line as the block separator so each rendered block parses as its own
|
|
163
|
+
// markdown block. A single newline lets CommonMark absorb a following `<prompt>` (an
|
|
164
|
+
// HTML type-7 tag, which can't interrupt an open paragraph) into the previous
|
|
165
|
+
// paragraph, rendering the prompt bubble inline next to the prior assistant text.
|
|
162
166
|
return (str += '\n');
|
|
163
167
|
}
|
|
164
168
|
return str;
|
|
@@ -193,7 +197,7 @@ const blockToMarkdownImpl = (context: MessageThreadContext, message: Message.Mes
|
|
|
193
197
|
if (block.disposition === 'synthetic') {
|
|
194
198
|
return renderXMLBlock('synthetic', { content: block.text, pending: block.pending });
|
|
195
199
|
} else {
|
|
196
|
-
return
|
|
200
|
+
return `\n<prompt>${block.text}</prompt>`;
|
|
197
201
|
}
|
|
198
202
|
} else {
|
|
199
203
|
const text = block.text.trim();
|
|
@@ -56,13 +56,13 @@ describe('reducers', () => {
|
|
|
56
56
|
];
|
|
57
57
|
|
|
58
58
|
syncer.update(messages);
|
|
59
|
-
expect(doc.content).toEqual(
|
|
59
|
+
expect(doc.content).toEqual('\n<prompt>Hello</prompt>\nHi there!\n');
|
|
60
60
|
|
|
61
61
|
Obj.update(messages[1], (obj) => {
|
|
62
62
|
obj.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
63
63
|
});
|
|
64
64
|
syncer.update(messages);
|
|
65
|
-
expect(doc.content).toEqual(
|
|
65
|
+
expect(doc.content).toEqual('\n<prompt>Hello</prompt>\nHi there!\nHow can I help?\n');
|
|
66
66
|
}),
|
|
67
67
|
);
|
|
68
68
|
|
|
@@ -78,7 +78,7 @@ describe('reducers', () => {
|
|
|
78
78
|
];
|
|
79
79
|
|
|
80
80
|
syncer.update(messages);
|
|
81
|
-
expect(doc.content).toEqual(
|
|
81
|
+
expect(doc.content).toEqual('\n<prompt>Hello</prompt>\nHi there!');
|
|
82
82
|
|
|
83
83
|
Obj.update(messages[1], (obj) => {
|
|
84
84
|
const block = obj.blocks[0] as Mutable<ContentBlock.Text>;
|
|
@@ -91,9 +91,7 @@ describe('reducers', () => {
|
|
|
91
91
|
obj.blocks.push({ _tag: 'text', text: 'How can I help?' });
|
|
92
92
|
});
|
|
93
93
|
syncer.update(messages);
|
|
94
|
-
expect(doc.content).toEqual(
|
|
95
|
-
['<prompt>Hello</prompt>', 'Hi there! How are you?', 'How can I help?', ''].join('\n'),
|
|
96
|
-
);
|
|
94
|
+
expect(doc.content).toEqual('\n<prompt>Hello</prompt>\nHi there! How are you?\nHow can I help?\n');
|
|
97
95
|
}),
|
|
98
96
|
);
|
|
99
97
|
|
|
@@ -46,10 +46,10 @@ export class ReasoningWidget extends WidgetType {
|
|
|
46
46
|
.attributes({ 'data-trail-container': '' })
|
|
47
47
|
.append(
|
|
48
48
|
Domino.of('div')
|
|
49
|
-
.classNames('relative z-10 bg-base-surface rounded-sm text-sm text-subdued
|
|
49
|
+
.classNames('relative z-10 bg-base-surface rounded-sm text-sm text-subdued py-1')
|
|
50
50
|
.append(
|
|
51
51
|
Domino.of('div')
|
|
52
|
-
.classNames('max-h-[5lh] overflow-y-auto')
|
|
52
|
+
.classNames('px-2 max-h-[5lh] overflow-y-auto dx-scrollbar-thin')
|
|
53
53
|
.text(this.text)
|
|
54
54
|
.attributes({ 'data-reasoning-text': '' }),
|
|
55
55
|
),
|
|
@@ -9,32 +9,15 @@ import { Domino } from '@dxos/ui';
|
|
|
9
9
|
import { styles } from './defaults';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* CodeMirror does not assign persistent IDs to widgets; streaming re-runs the factory each tick.
|
|
14
|
-
*/
|
|
15
|
-
export type StatusWidgetBlockIdProps = {
|
|
16
|
-
id?: string;
|
|
17
|
-
range?: { from: number; to: number };
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* AI reasoning widget.
|
|
12
|
+
* AI status widget.
|
|
22
13
|
*/
|
|
23
14
|
export class StatusWidget extends WidgetType {
|
|
24
|
-
readonly
|
|
25
|
-
/** The timer id last registered for this instance (may differ from the map if superseded). */
|
|
26
|
-
#ownedTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
27
|
-
|
|
28
|
-
constructor(
|
|
29
|
-
private readonly text: string,
|
|
30
|
-
pos: string | number | undefined,
|
|
31
|
-
) {
|
|
15
|
+
constructor(private readonly text: string) {
|
|
32
16
|
super();
|
|
33
|
-
this.#pos = pos === undefined || pos === '' ? 'status' : String(pos);
|
|
34
17
|
}
|
|
35
18
|
|
|
36
19
|
override eq(other: this) {
|
|
37
|
-
return this.text === other.text
|
|
20
|
+
return this.text === other.text;
|
|
38
21
|
}
|
|
39
22
|
|
|
40
23
|
override toDOM() {
|
|
@@ -57,7 +40,6 @@ export class StatusWidget extends WidgetType {
|
|
|
57
40
|
.classNames('relative z-10 rounded-sm text-sm leading-5')
|
|
58
41
|
.attributes({ 'data-status-text': '' })
|
|
59
42
|
.text(this.text),
|
|
60
|
-
Domino.of('div').attributes({ 'data-id': this.#pos }),
|
|
61
43
|
),
|
|
62
44
|
),
|
|
63
45
|
),
|
|
@@ -65,69 +47,7 @@ export class StatusWidget extends WidgetType {
|
|
|
65
47
|
}
|
|
66
48
|
|
|
67
49
|
override updateDOM(dom: HTMLElement) {
|
|
68
|
-
// Update only the text leaf; `dom` may be wrapped in an outer shell, and the trail host is a
|
|
69
|
-
// sibling of the text node inside the wrapper — setting `textContent` on the wrong
|
|
70
|
-
// ancestor would remove `[data-id]`.
|
|
71
50
|
dom.querySelector<HTMLElement>('[data-status-text]')?.replaceChildren(this.text);
|
|
72
|
-
|
|
73
|
-
const trailHost = dom.querySelector<HTMLElement>('[data-id]');
|
|
74
|
-
if (trailHost?.childElementCount === 0) {
|
|
75
|
-
trailHost.append(...createTrailLayers());
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
this.#scheduleTrailRemoval(dom);
|
|
79
51
|
return true;
|
|
80
52
|
}
|
|
81
|
-
|
|
82
|
-
override destroy(_dom: HTMLElement) {
|
|
83
|
-
this.#clearOwnedTrailTimer();
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
#scheduleTrailRemoval(dom: HTMLElement) {
|
|
87
|
-
const previous = trailRemovalTimers.get(this.#pos);
|
|
88
|
-
if (previous !== undefined) {
|
|
89
|
-
clearTimeout(previous);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const timerId = setTimeout(() => {
|
|
93
|
-
if (trailRemovalTimers.get(this.#pos) !== timerId) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
trailRemovalTimers.delete(this.#pos);
|
|
97
|
-
this.#ownedTimerId = null;
|
|
98
|
-
dom.querySelector<HTMLElement>('[data-id]')?.remove();
|
|
99
|
-
}, TRAIL_REMOVAL_DELAY_MS);
|
|
100
|
-
|
|
101
|
-
trailRemovalTimers.set(this.#pos, timerId);
|
|
102
|
-
this.#ownedTimerId = timerId;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
#clearOwnedTrailTimer() {
|
|
106
|
-
const active = trailRemovalTimers.get(this.#pos);
|
|
107
|
-
if (active !== undefined && active === this.#ownedTimerId) {
|
|
108
|
-
clearTimeout(active);
|
|
109
|
-
trailRemovalTimers.delete(this.#pos);
|
|
110
|
-
}
|
|
111
|
-
this.#ownedTimerId = null;
|
|
112
|
-
}
|
|
113
53
|
}
|
|
114
|
-
|
|
115
|
-
const trail = [
|
|
116
|
-
'absolute z-0 aspect-[2/1] w-16',
|
|
117
|
-
'bg-[radial-gradient(at_100%_50%,_theme(colors.green.700),_transparent_80%)]',
|
|
118
|
-
'[offset-anchor:100%_50%] [offset-path:border-box]',
|
|
119
|
-
];
|
|
120
|
-
|
|
121
|
-
/** Delay after the last content update before hiding the trail. */
|
|
122
|
-
const TRAIL_REMOVAL_DELAY_MS = 1_000;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* One pending removal timer per logical block. Streaming creates a new widget instance each tick;
|
|
126
|
-
* `destroy` may run after the next instance has already scheduled, so we must not clear a newer timer.
|
|
127
|
-
*/
|
|
128
|
-
const trailRemovalTimers = new Map<string, ReturnType<typeof setTimeout>>();
|
|
129
|
-
|
|
130
|
-
const createTrailLayers = (): [HTMLElement, HTMLElement] => [
|
|
131
|
-
Domino.of('div').classNames(...trail, 'animate-trail').root,
|
|
132
|
-
Domino.of('div').classNames(...trail, 'animate-trail-offset').root,
|
|
133
|
-
];
|
|
@@ -20,9 +20,7 @@ export const SummaryWidget = ({ children }: XmlWidgetProps<MessageThreadContext>
|
|
|
20
20
|
<TogglePanel.Root classNames={styles.border}>
|
|
21
21
|
<TogglePanel.Header classNames='text-sm bg-group-surface'>{t('summary.label')}</TogglePanel.Header>
|
|
22
22
|
<TogglePanel.Content>
|
|
23
|
-
<div
|
|
24
|
-
{children}
|
|
25
|
-
</div>
|
|
23
|
+
<div className='p-1 text-sm text-subdued'>{children}</div>
|
|
26
24
|
</TogglePanel.Content>
|
|
27
25
|
</TogglePanel.Root>
|
|
28
26
|
);
|
|
@@ -61,6 +61,7 @@ export const ProcessTree = composable<HTMLDivElement, ProcessTreeProps>(
|
|
|
61
61
|
<Tooltip.Trigger className='p-1' content={process.state.toString()}>
|
|
62
62
|
<Icon
|
|
63
63
|
size={4}
|
|
64
|
+
synchronized
|
|
64
65
|
classNames={mx(
|
|
65
66
|
process.state === Process.State.RUNNING && 'animate-spin',
|
|
66
67
|
process.state === Process.State.FAILED && 'text-error-text',
|
|
@@ -78,7 +79,7 @@ export const ProcessTree = composable<HTMLDivElement, ProcessTreeProps>(
|
|
|
78
79
|
)}
|
|
79
80
|
/>
|
|
80
81
|
</Tooltip.Trigger>
|
|
81
|
-
<div
|
|
82
|
+
<div className='flex items-center gap-2 text-xs overflow-hidden'>
|
|
82
83
|
{/* TODO(burdon): Name is too long (and not informative). */}
|
|
83
84
|
<span className='truncate text-description select-none'>
|
|
84
85
|
{process.params.name ?? process.pid.toString()}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Plan } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
10
|
+
|
|
11
|
+
import { TaskList } from './TaskList';
|
|
12
|
+
|
|
13
|
+
type DefaultStoryProps = {
|
|
14
|
+
tasks?: Omit<Plan.Task, 'id'>[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const DefaultStory = ({ tasks = [] }: DefaultStoryProps) => {
|
|
18
|
+
const plan = React.useMemo(() => Plan.makePlan({ tasks }), [tasks]);
|
|
19
|
+
return <TaskList plan={plan} />;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const meta = {
|
|
23
|
+
title: 'plugins/plugin-assistant/components/TaskList',
|
|
24
|
+
render: (args) => <DefaultStory {...args} />,
|
|
25
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
26
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
tasks: [
|
|
35
|
+
{ title: 'Crack the eggs', status: 'done' },
|
|
36
|
+
{ title: 'Whisk with salt and pepper', status: 'done' },
|
|
37
|
+
{ title: 'Heat the pan with butter', status: 'in-progress' },
|
|
38
|
+
{ title: 'Pour and stir continuously', status: 'todo' },
|
|
39
|
+
{ title: 'Plate and serve', status: 'todo' },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const Empty: Story = {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Plan } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { useObject } from '@dxos/react-client/echo';
|
|
9
|
+
import { Icon, Tag, type ThemedClassName } from '@dxos/react-ui';
|
|
10
|
+
import { Row, RowList } from '@dxos/react-ui-list';
|
|
11
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
12
|
+
|
|
13
|
+
export type TaskListProps = ThemedClassName<{
|
|
14
|
+
plan: Plan.Plan;
|
|
15
|
+
}>;
|
|
16
|
+
|
|
17
|
+
export const TaskList = composable<HTMLDivElement, TaskListProps>(({ plan, ...props }, forwardedRef) => {
|
|
18
|
+
const [snapshot] = useObject(plan);
|
|
19
|
+
const tasks = snapshot?.tasks ?? [];
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<RowList.Root>
|
|
23
|
+
<RowList.Viewport {...composableProps(props, { classNames: 'dx-container' })} ref={forwardedRef}>
|
|
24
|
+
<RowList.Content aria-label='Tasks'>
|
|
25
|
+
{tasks.map((task) => (
|
|
26
|
+
<Row key={task.id} id={task.id} classNames='py-0'>
|
|
27
|
+
<div className='flex items-center gap-2'>
|
|
28
|
+
<Icon
|
|
29
|
+
icon={task.status === 'done' ? 'ph--check--regular' : 'ph--circle--regular'}
|
|
30
|
+
classNames={task.status === 'done' ? 'text-success-text' : undefined}
|
|
31
|
+
size={4}
|
|
32
|
+
/>
|
|
33
|
+
<span className='sr-only'>
|
|
34
|
+
{task.status === 'done' ? 'done' : task.status === 'in-progress' ? 'in progress' : 'to do'}
|
|
35
|
+
</span>
|
|
36
|
+
<span className='truncate flex-1'>{task.title}</span>
|
|
37
|
+
{task.status === 'in-progress' && <Tag palette='info'>pending</Tag>}
|
|
38
|
+
</div>
|
|
39
|
+
</Row>
|
|
40
|
+
))}
|
|
41
|
+
</RowList.Content>
|
|
42
|
+
</RowList.Viewport>
|
|
43
|
+
</RowList.Root>
|
|
44
|
+
);
|
|
45
|
+
});
|
|
@@ -48,7 +48,7 @@ const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
|
|
|
48
48
|
const space = client.spaces.get()[0];
|
|
49
49
|
return space.db.add(
|
|
50
50
|
Blueprint.make({
|
|
51
|
-
key: 'example.
|
|
51
|
+
key: 'com.example.blueprint.test',
|
|
52
52
|
name: 'Test',
|
|
53
53
|
instructions: Template.make({ source }),
|
|
54
54
|
}),
|
|
@@ -34,7 +34,7 @@ const DefaultStory = () => {
|
|
|
34
34
|
invariant(space, 'TemplateForm story requires at least one space');
|
|
35
35
|
return space.db.add(
|
|
36
36
|
Blueprint.make({
|
|
37
|
-
key: 'example.
|
|
37
|
+
key: 'com.example.blueprint.test',
|
|
38
38
|
name: 'Test',
|
|
39
39
|
instructions: Template.make({ source: TEMPLATE }),
|
|
40
40
|
}),
|
|
@@ -48,11 +48,7 @@ const DefaultStory = () => {
|
|
|
48
48
|
[blueprint],
|
|
49
49
|
);
|
|
50
50
|
|
|
51
|
-
return
|
|
52
|
-
<div role='none' className='flex w-[40rem] border border-separator overflow-hidden'>
|
|
53
|
-
<TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
51
|
+
return <TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />;
|
|
56
52
|
};
|
|
57
53
|
|
|
58
54
|
const meta = {
|