@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
|
@@ -6,6 +6,8 @@ import { WidgetType } from '@codemirror/view';
|
|
|
6
6
|
|
|
7
7
|
import { Domino } from '@dxos/ui';
|
|
8
8
|
|
|
9
|
+
import { styles } from './defaults';
|
|
10
|
+
|
|
9
11
|
/**
|
|
10
12
|
* Simple prompt widget.
|
|
11
13
|
*/
|
|
@@ -24,7 +26,7 @@ export class SelectWidget extends WidgetType {
|
|
|
24
26
|
override toDOM() {
|
|
25
27
|
return Domino.of('div')
|
|
26
28
|
.attributes({ role: 'group' })
|
|
27
|
-
.classNames('flex flex-wrap
|
|
29
|
+
.classNames(styles.padding, 'flex flex-wrap gap-1')
|
|
28
30
|
.append(
|
|
29
31
|
...this.options.map((option) =>
|
|
30
32
|
Domino.of('button')
|
|
@@ -6,6 +6,8 @@ import { WidgetType } from '@codemirror/view';
|
|
|
6
6
|
|
|
7
7
|
import { Domino } from '@dxos/ui';
|
|
8
8
|
|
|
9
|
+
import { styles } from './defaults';
|
|
10
|
+
|
|
9
11
|
/**
|
|
10
12
|
* Simple stats widget.
|
|
11
13
|
*/
|
|
@@ -19,7 +21,7 @@ export class StatsWidget extends WidgetType {
|
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
override toDOM() {
|
|
22
|
-
return Domino.of('div').classNames('
|
|
24
|
+
return Domino.of('div').classNames(styles.padding, 'text-sm text-placeholder').text(this.text).root;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
override updateDOM(dom: HTMLElement) {
|
|
@@ -6,38 +6,23 @@ import { WidgetType } from '@codemirror/view';
|
|
|
6
6
|
|
|
7
7
|
import { Domino } from '@dxos/ui';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
* Props used to derive a stable key for a reasoning block across CodeMirror widget rebuilds.
|
|
11
|
-
* CodeMirror does not assign persistent IDs to widgets; streaming re-runs the factory each tick.
|
|
12
|
-
*/
|
|
13
|
-
export type StatusWidgetBlockIdProps = {
|
|
14
|
-
id?: string;
|
|
15
|
-
range?: { from: number; to: number };
|
|
16
|
-
};
|
|
9
|
+
import { styles } from './defaults';
|
|
17
10
|
|
|
18
11
|
/**
|
|
19
|
-
* AI
|
|
12
|
+
* AI status widget.
|
|
20
13
|
*/
|
|
21
14
|
export class StatusWidget extends WidgetType {
|
|
22
|
-
readonly
|
|
23
|
-
/** The timer id last registered for this instance (may differ from the map if superseded). */
|
|
24
|
-
#ownedTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
25
|
-
|
|
26
|
-
constructor(
|
|
27
|
-
private readonly text: string,
|
|
28
|
-
pos: string | number | undefined,
|
|
29
|
-
) {
|
|
15
|
+
constructor(private readonly text: string) {
|
|
30
16
|
super();
|
|
31
|
-
this.#pos = pos === undefined || pos === '' ? 'status' : String(pos);
|
|
32
17
|
}
|
|
33
18
|
|
|
34
19
|
override eq(other: this) {
|
|
35
|
-
return this.text === other.text
|
|
20
|
+
return this.text === other.text;
|
|
36
21
|
}
|
|
37
22
|
|
|
38
23
|
override toDOM() {
|
|
39
24
|
return Domino.of('div')
|
|
40
|
-
.classNames(
|
|
25
|
+
.classNames(styles.padding)
|
|
41
26
|
.append(
|
|
42
27
|
Domino.of('div')
|
|
43
28
|
.classNames('relative overflow-hidden rounded-sm')
|
|
@@ -55,7 +40,6 @@ export class StatusWidget extends WidgetType {
|
|
|
55
40
|
.classNames('relative z-10 rounded-sm text-sm leading-5')
|
|
56
41
|
.attributes({ 'data-status-text': '' })
|
|
57
42
|
.text(this.text),
|
|
58
|
-
Domino.of('div').attributes({ 'data-id': this.#pos }),
|
|
59
43
|
),
|
|
60
44
|
),
|
|
61
45
|
),
|
|
@@ -63,69 +47,7 @@ export class StatusWidget extends WidgetType {
|
|
|
63
47
|
}
|
|
64
48
|
|
|
65
49
|
override updateDOM(dom: HTMLElement) {
|
|
66
|
-
// Update only the text leaf; `dom` may be wrapped in an outer shell, and the trail host is a
|
|
67
|
-
// sibling of the text node inside the wrapper — setting `textContent` on the wrong
|
|
68
|
-
// ancestor would remove `[data-id]`.
|
|
69
50
|
dom.querySelector<HTMLElement>('[data-status-text]')?.replaceChildren(this.text);
|
|
70
|
-
|
|
71
|
-
const trailHost = dom.querySelector<HTMLElement>('[data-id]');
|
|
72
|
-
if (trailHost?.childElementCount === 0) {
|
|
73
|
-
trailHost.append(...createTrailLayers());
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
this.#scheduleTrailRemoval(dom);
|
|
77
51
|
return true;
|
|
78
52
|
}
|
|
79
|
-
|
|
80
|
-
override destroy(_dom: HTMLElement) {
|
|
81
|
-
this.#clearOwnedTrailTimer();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
#scheduleTrailRemoval(dom: HTMLElement) {
|
|
85
|
-
const previous = trailRemovalTimers.get(this.#pos);
|
|
86
|
-
if (previous !== undefined) {
|
|
87
|
-
clearTimeout(previous);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const timerId = setTimeout(() => {
|
|
91
|
-
if (trailRemovalTimers.get(this.#pos) !== timerId) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
trailRemovalTimers.delete(this.#pos);
|
|
95
|
-
this.#ownedTimerId = null;
|
|
96
|
-
dom.querySelector<HTMLElement>('[data-id]')?.remove();
|
|
97
|
-
}, TRAIL_REMOVAL_DELAY_MS);
|
|
98
|
-
|
|
99
|
-
trailRemovalTimers.set(this.#pos, timerId);
|
|
100
|
-
this.#ownedTimerId = timerId;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
#clearOwnedTrailTimer() {
|
|
104
|
-
const active = trailRemovalTimers.get(this.#pos);
|
|
105
|
-
if (active !== undefined && active === this.#ownedTimerId) {
|
|
106
|
-
clearTimeout(active);
|
|
107
|
-
trailRemovalTimers.delete(this.#pos);
|
|
108
|
-
}
|
|
109
|
-
this.#ownedTimerId = null;
|
|
110
|
-
}
|
|
111
53
|
}
|
|
112
|
-
|
|
113
|
-
const trail = [
|
|
114
|
-
'absolute z-0 aspect-[2/1] w-16',
|
|
115
|
-
'bg-[radial-gradient(at_100%_50%,_theme(colors.green.700),_transparent_80%)]',
|
|
116
|
-
'[offset-anchor:100%_50%] [offset-path:border-box]',
|
|
117
|
-
];
|
|
118
|
-
|
|
119
|
-
/** Delay after the last content update before hiding the trail. */
|
|
120
|
-
const TRAIL_REMOVAL_DELAY_MS = 1_000;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* One pending removal timer per logical block. Streaming creates a new widget instance each tick;
|
|
124
|
-
* `destroy` may run after the next instance has already scheduled, so we must not clear a newer timer.
|
|
125
|
-
*/
|
|
126
|
-
const trailRemovalTimers = new Map<string, ReturnType<typeof setTimeout>>();
|
|
127
|
-
|
|
128
|
-
const createTrailLayers = (): [HTMLElement, HTMLElement] => [
|
|
129
|
-
Domino.of('div').classNames(...trail, 'animate-trail').root,
|
|
130
|
-
Domino.of('div').classNames(...trail, 'animate-trail-offset').root,
|
|
131
|
-
];
|
|
@@ -19,7 +19,7 @@ export class SuggestionWidget extends WidgetType {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
override toDOM() {
|
|
22
|
-
// NOTE: Container must have `dx-size-container` to support cqi.
|
|
22
|
+
// NOTE: Container must have `dx-inline-size-container` (or `dx-size-container`) to support cqi.
|
|
23
23
|
return Domino.of('span')
|
|
24
24
|
.classNames(mx('inline-flex max-w-[calc(100cqi-8px)] my-1 pe-2 overflow-hidden'))
|
|
25
25
|
.append(
|
|
@@ -11,17 +11,16 @@ import { type XmlWidgetProps } from '@dxos/ui-editor';
|
|
|
11
11
|
import { meta } from '#meta';
|
|
12
12
|
|
|
13
13
|
import { MessageThreadContext } from '../sync';
|
|
14
|
+
import { styles } from './defaults';
|
|
14
15
|
|
|
15
16
|
export const SummaryWidget = ({ children }: XmlWidgetProps<MessageThreadContext>) => {
|
|
16
17
|
const { t } = useTranslation(meta.id);
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
<TogglePanel.Root classNames=
|
|
20
|
+
<TogglePanel.Root classNames={styles.border}>
|
|
20
21
|
<TogglePanel.Header classNames='text-sm bg-group-surface'>{t('summary.label')}</TogglePanel.Header>
|
|
21
22
|
<TogglePanel.Content>
|
|
22
|
-
<div
|
|
23
|
-
{children}
|
|
24
|
-
</div>
|
|
23
|
+
<div className='p-1 text-sm text-subdued'>{children}</div>
|
|
25
24
|
</TogglePanel.Content>
|
|
26
25
|
</TogglePanel.Root>
|
|
27
26
|
);
|
|
@@ -7,7 +7,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
7
7
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
import { type ContentBlock } from '@dxos/types';
|
|
9
9
|
|
|
10
|
-
import { translations } from '
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
|
|
11
12
|
import { ToolWidget, type ToolWidgetProps } from './ToolWidget';
|
|
12
13
|
|
|
13
14
|
const baseWidgetProps = {
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
export * from './FallbackWidget';
|
|
6
|
-
export * from './PromptWidget';
|
|
7
6
|
export * from './ReasoningWidget';
|
|
8
7
|
export * from './ReferenceWidget';
|
|
9
8
|
export * from './SelectWidget';
|
|
10
9
|
export * from './StatsWidget';
|
|
10
|
+
export * from './StatusWidget';
|
|
11
11
|
export * from './SummaryWidget';
|
|
12
12
|
export * from './SuggestionWidget';
|
|
13
13
|
export * from './ToolWidget';
|
|
14
|
-
export * from './StatusWidget';
|
|
@@ -6,24 +6,14 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import * as Option from 'effect/Option';
|
|
7
7
|
|
|
8
8
|
import { Process } from '@dxos/functions-runtime';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
9
10
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
+
import { makeProcess } from '#testing';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
overrides: Partial<Process.Info> & Pick<Process.Info, 'pid' | 'state'> & { name: string },
|
|
15
|
-
): Process.Info => ({
|
|
16
|
-
parentPid: null,
|
|
17
|
-
key: `test.process.${overrides.name}`,
|
|
18
|
-
params: { name: overrides.name, target: null },
|
|
19
|
-
error: null,
|
|
20
|
-
startedAt: Date.now() - 10_000,
|
|
21
|
-
completedAt: Option.none(),
|
|
22
|
-
metrics: { wallTime: 0, inputCount: 0, outputCount: 0 },
|
|
23
|
-
...overrides,
|
|
24
|
-
});
|
|
14
|
+
import { ProcessTree } from './ProcessTree';
|
|
25
15
|
|
|
26
|
-
const
|
|
16
|
+
const processes: Process.Info[] = [
|
|
27
17
|
makeProcess({
|
|
28
18
|
pid: Process.ID.make('97793611-815e-4a67-bc04-60fa67b2c987'),
|
|
29
19
|
name: 'Trigger watcher',
|
|
@@ -73,7 +63,7 @@ const seedProcesses: Process.Info[] = [
|
|
|
73
63
|
const meta: Meta<typeof ProcessTree> = {
|
|
74
64
|
title: 'plugins/plugin-assistant/components/ProcessTree',
|
|
75
65
|
component: ProcessTree,
|
|
76
|
-
decorators: [withLayout({ layout: 'column', classNames: 'w-(--dx-complementary-sidebar-size)' })
|
|
66
|
+
decorators: [withTheme(), withLayout({ layout: 'column', classNames: 'w-(--dx-complementary-sidebar-size)' })],
|
|
77
67
|
} satisfies Meta<typeof ProcessTree>;
|
|
78
68
|
|
|
79
69
|
export default meta;
|
|
@@ -82,28 +72,12 @@ type Story = StoryObj<typeof meta>;
|
|
|
82
72
|
|
|
83
73
|
export const Default: Story = {
|
|
84
74
|
args: {
|
|
85
|
-
processes:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
makeProcess({
|
|
93
|
-
pid: Process.ID.make('1344bac8-745b-44a6-9af6-dc19509a7844'),
|
|
94
|
-
name: 'Agent alpha',
|
|
95
|
-
state: Process.State.RUNNING,
|
|
96
|
-
}),
|
|
97
|
-
makeProcess({
|
|
98
|
-
pid: Process.ID.make('b7c9787a-6705-47dc-a197-d37f1adfa338'),
|
|
99
|
-
name: 'Agent beta',
|
|
100
|
-
state: Process.State.RUNNING,
|
|
101
|
-
}),
|
|
102
|
-
makeProcess({
|
|
103
|
-
pid: Process.ID.make('43493533-a94c-4072-b18f-c0e0fd806bf5'),
|
|
104
|
-
name: 'Agent gamma',
|
|
105
|
-
state: Process.State.RUNNING,
|
|
106
|
-
}),
|
|
107
|
-
],
|
|
75
|
+
processes: processes,
|
|
76
|
+
onProcessSelect: (process) => {
|
|
77
|
+
log.info('select', process);
|
|
78
|
+
},
|
|
79
|
+
onProcessTerminate: (process) => {
|
|
80
|
+
log.info('terminate', process);
|
|
81
|
+
},
|
|
108
82
|
},
|
|
109
83
|
};
|
|
@@ -3,41 +3,47 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Match from 'effect/Match';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
|
|
8
9
|
import { Process } from '@dxos/functions-runtime';
|
|
9
|
-
import { Icon, ScrollArea, Treegrid } from '@dxos/react-ui';
|
|
10
|
+
import { Icon, IconButton, ScrollArea, Tooltip, Treegrid } from '@dxos/react-ui';
|
|
10
11
|
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
12
|
+
import { Unit } from '@dxos/util';
|
|
11
13
|
|
|
12
14
|
export type ProcessTreeProps = {
|
|
15
|
+
// TODO(burdon): Atom.
|
|
13
16
|
processes: readonly Process.Info[];
|
|
14
17
|
onProcessSelect?: (process: Process.Info) => void;
|
|
18
|
+
onProcessTerminate?: (process: Process.Info) => void;
|
|
15
19
|
};
|
|
16
20
|
|
|
17
21
|
export const ProcessTree = composable<HTMLDivElement, ProcessTreeProps>(
|
|
18
|
-
({ processes, onProcessSelect, ...props }, forwardedRef) => {
|
|
19
|
-
const
|
|
22
|
+
({ processes, onProcessSelect, onProcessTerminate, ...props }, forwardedRef) => {
|
|
23
|
+
const sortedProcesses = [
|
|
20
24
|
...processes.filter((process) => [Process.State.RUNNING, Process.State.HYBERNATING].includes(process.state)),
|
|
21
25
|
...processes.filter((process) => [Process.State.IDLE].includes(process.state)).slice(0, 3),
|
|
22
|
-
...processes
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
...processes.filter((process) =>
|
|
27
|
+
[Process.State.SUCCEEDED, Process.State.FAILED, Process.State.TERMINATED].includes(process.state),
|
|
28
|
+
),
|
|
29
|
+
].sort((a, b) => {
|
|
30
|
+
const aCompletedAt = Option.getOrElse(a.completedAt, () => Infinity);
|
|
31
|
+
const bCompletedAt = Option.getOrElse(b.completedAt, () => Infinity);
|
|
32
|
+
return bCompletedAt - aCompletedAt;
|
|
33
|
+
});
|
|
28
34
|
|
|
29
35
|
return (
|
|
30
36
|
<ScrollArea.Root {...composableProps(props, { classNames: 'dx-expander' })} thin ref={forwardedRef}>
|
|
31
37
|
<ScrollArea.Viewport>
|
|
32
38
|
<Treegrid.Root gridTemplateColumns='1fr'>
|
|
33
|
-
{
|
|
39
|
+
{sortedProcesses
|
|
34
40
|
.filter((process) => process.parentPid === null)
|
|
35
41
|
.map((process) => {
|
|
36
|
-
const activeChildren = filteredProcesses.filter(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
);
|
|
42
|
+
// const activeChildren = filteredProcesses.filter(
|
|
43
|
+
// (candidate) =>
|
|
44
|
+
// candidate.parentPid?.toString() === process.pid.toString() &&
|
|
45
|
+
// candidate.state === Process.State.RUNNING,
|
|
46
|
+
// );
|
|
41
47
|
return (
|
|
42
48
|
<Treegrid.Row
|
|
43
49
|
key={process.pid.toString()}
|
|
@@ -46,34 +52,61 @@ export const ProcessTree = composable<HTMLDivElement, ProcessTreeProps>(
|
|
|
46
52
|
>
|
|
47
53
|
<Treegrid.Cell
|
|
48
54
|
indent
|
|
49
|
-
classNames=
|
|
55
|
+
classNames={mx(
|
|
56
|
+
'grid grid-cols-[min-content_1fr_min-content_min-content] items-center gap-1 min-w-0',
|
|
57
|
+
onProcessSelect && 'dx-hover',
|
|
58
|
+
)}
|
|
50
59
|
onClick={() => onProcessSelect?.(process)}
|
|
51
60
|
>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Match.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
<Tooltip.Trigger className='p-1' content={process.state.toString()}>
|
|
62
|
+
<Icon
|
|
63
|
+
size={4}
|
|
64
|
+
synchronized
|
|
65
|
+
classNames={mx(
|
|
66
|
+
process.state === Process.State.RUNNING && 'animate-spin',
|
|
67
|
+
process.state === Process.State.FAILED && 'text-error-text',
|
|
68
|
+
process.state === Process.State.SUCCEEDED && 'text-success-text',
|
|
69
|
+
)}
|
|
70
|
+
icon={Match.value(process.state).pipe(
|
|
71
|
+
Match.when(Process.State.RUNNING, () => 'ph--spinner-gap--regular'),
|
|
72
|
+
Match.when(Process.State.SUCCEEDED, () => 'ph--check-circle--regular'),
|
|
73
|
+
Match.when(Process.State.FAILED, () => 'ph--warning--regular'),
|
|
74
|
+
Match.when(Process.State.HYBERNATING, () => 'ph--spinner--regular'),
|
|
75
|
+
Match.when(Process.State.IDLE, () => 'ph--hourglass--regular'),
|
|
76
|
+
Match.when(Process.State.TERMINATING, () => 'ph--x-circle--regular'),
|
|
77
|
+
Match.when(Process.State.TERMINATED, () => 'ph--x-circle--regular'),
|
|
78
|
+
Match.orElse(() => 'ph--spinner-gap--regular'),
|
|
79
|
+
)}
|
|
80
|
+
/>
|
|
81
|
+
</Tooltip.Trigger>
|
|
82
|
+
<div className='flex items-center gap-2 text-xs overflow-hidden'>
|
|
71
83
|
{/* TODO(burdon): Name is too long (and not informative). */}
|
|
72
|
-
<span className='truncate text-description'>
|
|
84
|
+
<span className='truncate text-description select-none'>
|
|
85
|
+
{process.params.name ?? process.pid.toString()}
|
|
86
|
+
</span>
|
|
73
87
|
{/* {activeChildren.length > 0 && (
|
|
74
88
|
<span className='text-xs text-description ml-1'>{activeChildren[0].params.name}</span>
|
|
75
89
|
)} */}
|
|
76
90
|
</div>
|
|
91
|
+
{([Process.State.FAILED, Process.State.SUCCEEDED].includes(process.state) && (
|
|
92
|
+
<div className='text-xs text-description tabular-nums'>
|
|
93
|
+
{Unit.Millisecond(process.metrics.wallTime).toString()}
|
|
94
|
+
</div>
|
|
95
|
+
)) || <div />}
|
|
96
|
+
{onProcessTerminate && (
|
|
97
|
+
<IconButton
|
|
98
|
+
classNames='min-h-0 p-1'
|
|
99
|
+
icon='ph--x--regular'
|
|
100
|
+
iconOnly
|
|
101
|
+
variant='ghost'
|
|
102
|
+
size={4}
|
|
103
|
+
label='Actions'
|
|
104
|
+
onClick={(event) => {
|
|
105
|
+
event.stopPropagation();
|
|
106
|
+
onProcessTerminate?.(process);
|
|
107
|
+
}}
|
|
108
|
+
/>
|
|
109
|
+
)}
|
|
77
110
|
</Treegrid.Cell>
|
|
78
111
|
</Treegrid.Row>
|
|
79
112
|
);
|
|
@@ -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
|
+
});
|
|
@@ -6,13 +6,14 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { createSystemPrompt } from '@dxos/assistant';
|
|
9
|
-
import { Blueprint, Template } from '@dxos/
|
|
9
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
12
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
13
13
|
import { trim } from '@dxos/util';
|
|
14
14
|
|
|
15
|
-
import { translations } from '
|
|
15
|
+
import { translations } from '#translations';
|
|
16
|
+
|
|
16
17
|
import { TemplateEditor, type TemplateEditorProps } from './TemplateEditor';
|
|
17
18
|
|
|
18
19
|
const FENCE = '```';
|
|
@@ -47,7 +48,7 @@ const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
|
|
|
47
48
|
const space = client.spaces.get()[0];
|
|
48
49
|
return space.db.add(
|
|
49
50
|
Blueprint.make({
|
|
50
|
-
key: 'example.
|
|
51
|
+
key: 'com.example.blueprint.test',
|
|
51
52
|
name: 'Test',
|
|
52
53
|
instructions: Template.make({ source }),
|
|
53
54
|
}),
|
|
@@ -6,7 +6,7 @@ import { defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language'
|
|
|
6
6
|
import { composeRefs } from '@radix-ui/react-compose-refs';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import { type Template } from '@dxos/
|
|
9
|
+
import { type Template } from '@dxos/compute';
|
|
10
10
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
11
11
|
import { useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
@@ -35,17 +35,17 @@ export const TemplateEditor = composable<HTMLDivElement, TemplateEditorProps>(
|
|
|
35
35
|
const { t } = useTranslation(meta.id);
|
|
36
36
|
const { themeMode } = useThemeContext();
|
|
37
37
|
const { parentRef } = useTextEditor(() => {
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
38
|
+
const target = template.source?.target;
|
|
39
|
+
if (!target) {
|
|
40
40
|
return {};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return {
|
|
44
|
-
initialValue:
|
|
44
|
+
initialValue: target.content ?? '',
|
|
45
45
|
extensions: [
|
|
46
46
|
createDataExtensions({
|
|
47
47
|
id,
|
|
48
|
-
text: createDocAccessor(
|
|
48
|
+
text: createDocAccessor(target, ['content']),
|
|
49
49
|
}),
|
|
50
50
|
createBasicExtensions({
|
|
51
51
|
bracketMatching: false,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Meta } from '@storybook/react-vite';
|
|
6
6
|
import React, { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { Blueprint, Template } from '@dxos/
|
|
8
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
@@ -13,7 +13,8 @@ import { withClientProvider } from '@dxos/react-client/testing';
|
|
|
13
13
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
14
|
import { trim } from '@dxos/util';
|
|
15
15
|
|
|
16
|
-
import { translations } from '
|
|
16
|
+
import { translations } from '#translations';
|
|
17
|
+
|
|
17
18
|
import { type TemplateChangeCallback, TemplateForm } from './TemplateForm';
|
|
18
19
|
|
|
19
20
|
const TEMPLATE = trim`
|
|
@@ -33,7 +34,7 @@ const DefaultStory = () => {
|
|
|
33
34
|
invariant(space, 'TemplateForm story requires at least one space');
|
|
34
35
|
return space.db.add(
|
|
35
36
|
Blueprint.make({
|
|
36
|
-
key: 'example.
|
|
37
|
+
key: 'com.example.blueprint.test',
|
|
37
38
|
name: 'Test',
|
|
38
39
|
instructions: Template.make({ source: TEMPLATE }),
|
|
39
40
|
}),
|
|
@@ -42,16 +43,12 @@ const DefaultStory = () => {
|
|
|
42
43
|
|
|
43
44
|
const handleChange: TemplateChangeCallback = useCallback(
|
|
44
45
|
(mutate) => {
|
|
45
|
-
Obj.
|
|
46
|
+
Obj.update(blueprint, (blueprint) => mutate(blueprint.instructions));
|
|
46
47
|
},
|
|
47
48
|
[blueprint],
|
|
48
49
|
);
|
|
49
50
|
|
|
50
|
-
return
|
|
51
|
-
<div role='none' className='flex w-[40rem] border border-separator overflow-hidden'>
|
|
52
|
-
<TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
51
|
+
return <TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />;
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
const meta = {
|