@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.dedc0f3
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/browser/{TemplateContainer-RPJ2LBOB.mjs → BlueprintContainer-BFNN6K46.mjs} +11 -9
- package/dist/lib/browser/BlueprintContainer-BFNN6K46.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-YYYCHZYV.mjs +126 -0
- package/dist/lib/browser/ChatCompanion-YYYCHZYV.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs → ChatContainer-G6YHR6GJ.mjs} +34 -13
- package/dist/lib/browser/ChatContainer-G6YHR6GJ.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs → ChatDialog-HJ7VDRQO.mjs} +28 -12
- package/dist/lib/browser/ChatDialog-HJ7VDRQO.mjs.map +7 -0
- package/dist/lib/browser/{SequenceContainer-3UDVKWPA.mjs → SequenceContainer-TF5QNXYM.mjs} +5 -17
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs.map +7 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs +22 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-JTXBKE7O.mjs → app-graph-builder-3C43MLCD.mjs} +26 -96
- package/dist/lib/browser/app-graph-builder-3C43MLCD.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs +19 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs.map +7 -0
- package/dist/lib/browser/chunk-GLWD66TA.mjs +161 -0
- package/dist/lib/browser/chunk-GLWD66TA.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-O4LUJEDV.mjs +20 -0
- package/dist/lib/browser/{chunk-FDCJSQYF.mjs.map → chunk-O4LUJEDV.mjs.map} +2 -2
- package/dist/lib/browser/chunk-PL4O4ZJU.mjs +1974 -0
- package/dist/lib/browser/chunk-PL4O4ZJU.mjs.map +7 -0
- package/dist/lib/browser/chunk-PPJAIE2T.mjs +299 -0
- package/dist/lib/browser/chunk-PPJAIE2T.mjs.map +7 -0
- package/dist/lib/browser/chunk-PQI3MGDN.mjs +169 -0
- package/dist/lib/browser/chunk-PQI3MGDN.mjs.map +7 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs +216 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs.map +7 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs +202 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs +155 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs +22 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +166 -68
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs +112 -0
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs +21 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-WNLA2636.mjs +109 -0
- package/dist/lib/browser/react-surface-WNLA2636.mjs.map +7 -0
- package/dist/lib/browser/{settings-2DGP3UTS.mjs → settings-36V3VUMW.mjs} +6 -5
- package/dist/lib/{node-esm/settings-47RYZOU4.mjs.map → browser/settings-36V3VUMW.mjs.map} +1 -1
- package/dist/lib/browser/state-AINRYS5W.mjs +21 -0
- package/dist/lib/browser/state-AINRYS5W.mjs.map +7 -0
- package/dist/lib/browser/toolkit-Y5OYX5PO.mjs +191 -0
- package/dist/lib/browser/toolkit-Y5OYX5PO.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -4
- package/dist/lib/node-esm/{TemplateContainer-A3NAQCZE.mjs → BlueprintContainer-X4MRBKDR.mjs} +11 -9
- package/dist/lib/node-esm/BlueprintContainer-X4MRBKDR.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-PUAFRIEC.mjs +127 -0
- package/dist/lib/node-esm/ChatCompanion-PUAFRIEC.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs → ChatContainer-EZZF7RSQ.mjs} +34 -13
- package/dist/lib/node-esm/ChatContainer-EZZF7RSQ.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs → ChatDialog-PTQLZNJU.mjs} +28 -12
- package/dist/lib/node-esm/ChatDialog-PTQLZNJU.mjs.map +7 -0
- package/dist/lib/node-esm/{SequenceContainer-RQQH5XOC.mjs → SequenceContainer-UXOVZPZO.mjs} +5 -17
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs +23 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-OWSOXFTD.mjs → app-graph-builder-NM3JDLQ2.mjs} +26 -96
- package/dist/lib/node-esm/app-graph-builder-NM3JDLQ2.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs +170 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs +203 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs +217 -0
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs +163 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VFY2JG62.mjs +22 -0
- package/dist/lib/node-esm/{chunk-QN2H2EHV.mjs.map → chunk-VFY2JG62.mjs.map} +2 -2
- package/dist/lib/node-esm/chunk-VH3LTD76.mjs +300 -0
- package/dist/lib/node-esm/chunk-VH3LTD76.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs +20 -0
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZIDP7HBI.mjs +1975 -0
- package/dist/lib/node-esm/chunk-ZIDP7HBI.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs +156 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs +23 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +166 -68
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs +113 -0
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs +22 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-GP3LU6DX.mjs +110 -0
- package/dist/lib/node-esm/react-surface-GP3LU6DX.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-47RYZOU4.mjs → settings-7ZCZ6AS5.mjs} +6 -5
- package/dist/lib/{browser/settings-2DGP3UTS.mjs.map → node-esm/settings-7ZCZ6AS5.mjs.map} +1 -1
- package/dist/lib/node-esm/state-EQS5KP6M.mjs +22 -0
- package/dist/lib/node-esm/state-EQS5KP6M.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs +192 -0
- package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -4
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +7 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +32 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +12 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +4 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +8 -0
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +20 -17
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +13 -0
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +4 -4
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +4 -5
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +10 -7
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +115 -74
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts +40 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +261 -2
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +261 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +258 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +11 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -9
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +262 -4
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/execution-graph/execution-graph.d.ts +21 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +2 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/functions/analysis.d.ts +5 -0
- package/dist/types/src/functions/analysis.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/list.d.ts +10 -0
- package/dist/types/src/functions/list.d.ts.map +1 -0
- package/dist/types/src/functions/load.d.ts +8 -0
- package/dist/types/src/functions/load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +9 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +24 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -21
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -6
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts +6 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
- package/dist/types/src/hooks/useItemTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +3 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +2 -2
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +73 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/stories/Chat.stories.d.ts +26 -245
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +4 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/DebugCard.d.ts +8 -0
- package/dist/types/src/stories/components/DebugCard.d.ts.map +1 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts +6 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts +7 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts +4 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts +6 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +4 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts +14 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +16 -0
- package/dist/types/src/stories/components/index.d.ts.map +1 -0
- package/dist/types/src/stories/components/types.d.ts +7 -0
- package/dist/types/src/stories/components/types.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +9 -0
- package/dist/types/src/stories/testing/data.d.ts.map +1 -0
- package/dist/types/src/stories/testing/index.d.ts +3 -0
- package/dist/types/src/stories/testing/index.d.ts.map +1 -0
- package/dist/types/src/stories/testing/schema.d.ts +7 -0
- package/dist/types/src/stories/testing/schema.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +48 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +14 -0
- package/dist/types/src/testing/test-data.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +5 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +7 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +29 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +42 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +107 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +6 -3
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +106 -82
- package/src/AssistantPlugin.tsx +82 -12
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +43 -134
- package/src/capabilities/blueprint-definition.ts +58 -0
- package/src/capabilities/capabilities.ts +71 -0
- package/src/capabilities/compute-runtime.ts +124 -0
- package/src/capabilities/edge-model-resolver.ts +27 -0
- package/src/capabilities/index.ts +10 -0
- package/src/capabilities/intent-resolver.ts +50 -14
- package/src/capabilities/local-model-resolver.ts +32 -0
- package/src/capabilities/react-surface.tsx +17 -64
- package/src/capabilities/state.ts +20 -0
- package/src/capabilities/toolkit.ts +163 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +83 -76
- package/src/components/BlueprintContainer.tsx +24 -0
- package/src/components/Chat/Chat.tsx +175 -174
- package/src/components/Chat/events.ts +7 -0
- package/src/components/ChatCompanion.tsx +111 -0
- package/src/components/ChatContainer.tsx +19 -13
- package/src/components/ChatDialog.tsx +18 -14
- package/src/components/ChatProgress/ChatProgress.tsx +68 -0
- package/src/components/ChatProgress/index.ts +5 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -24
- package/src/components/ChatPrompt/ChatOptions.tsx +233 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +31 -36
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +97 -110
- package/src/components/ChatThread/ChatThread.tsx +65 -29
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/reducers.ts +151 -0
- package/src/components/ChatThread/registry.tsx +189 -0
- package/src/components/ChatThread/sync.test.ts +81 -0
- package/src/components/ChatThread/sync.ts +113 -0
- package/src/components/PromptSettings.tsx +1 -0
- package/src/components/SequenceContainer.tsx +27 -28
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +5 -4
- package/src/components/SequenceEditor/SequenceEditor.tsx +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +27 -14
- package/src/components/TemplateEditor/TemplateEditor.tsx +20 -51
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +15 -8
- package/src/components/TemplateEditor/TemplateForm.tsx +6 -3
- package/src/components/TemplateEditor/handlebars-extension.ts +165 -0
- package/src/components/ToolBlock/ToolBlock.tsx +152 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbar/Toolbar.tsx +21 -0
- package/src/components/Toolbar/index.ts +5 -0
- package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +10 -16
- package/src/components/Toolbox/Toolbox.tsx +21 -51
- package/src/components/index.ts +4 -5
- package/src/events.ts +2 -2
- package/src/execution-graph/execution-graph.ts +211 -0
- package/src/execution-graph/index.ts +5 -0
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +46 -0
- package/src/functions/load.ts +42 -0
- package/src/hooks/index.ts +9 -4
- package/src/hooks/useBlueprintRegistry.ts +80 -0
- package/src/hooks/useChatProcessor.ts +21 -98
- package/src/hooks/useChatServices.ts +28 -71
- package/src/hooks/useComputeRuntimeCallback.ts +25 -0
- package/src/hooks/useContextBinder.ts +18 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useExecutionGraph.ts +20 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +11 -9
- package/src/meta.ts +1 -1
- package/src/processor/index.ts +6 -0
- package/src/{hooks → processor}/presets.ts +14 -6
- package/src/processor/processor.test.ts +77 -0
- package/src/processor/processor.ts +302 -0
- package/src/queue-logger.ts +10 -10
- package/src/stories/Chat.stories.tsx +594 -315
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +74 -0
- package/src/stories/components/ChessContainer.tsx +17 -0
- package/src/stories/components/CommentsContainer.tsx +25 -0
- package/src/stories/components/DebugCard.tsx +61 -0
- package/src/stories/components/GraphContainer.tsx +119 -0
- package/src/stories/components/InvocationsContainer.tsx +17 -0
- package/src/stories/components/LoggingContainer.tsx +33 -0
- package/src/stories/components/MessageContainer.tsx +22 -0
- package/src/stories/components/PromptContainer.tsx +52 -0
- package/src/stories/components/ResearchInputStack.tsx +30 -0
- package/src/stories/components/ResearchOutputStack.tsx +29 -0
- package/src/stories/components/TasksContainer.tsx +49 -0
- package/src/stories/components/TokenManagerContainer.tsx +14 -0
- package/src/stories/components/TriggersContainer.tsx +75 -0
- package/src/stories/components/index.ts +20 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/testing/data.ts +142 -0
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/schema.ts +17 -0
- package/src/stories/testing/testing.tsx +279 -0
- package/src/testing/index.ts +3 -1
- package/src/testing/test-data.ts +245 -0
- package/src/testing/test-functions.ts +8 -3
- package/src/testing/test-generator.ts +257 -0
- package/src/testing/test-sequence.ts +2 -27
- package/src/translations.ts +32 -22
- package/src/types/Assistant.ts +61 -0
- package/src/types/AssistantAction.ts +62 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -1
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEAEKWOC.mjs +0 -98
- package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +0 -7
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs +0 -108
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-JQBVLTM5.mjs +0 -158
- package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
- package/dist/lib/browser/chunk-OWY4CUQY.mjs +0 -2245
- package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs +0 -60
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-66VY37YQ.mjs +0 -150
- package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs +0 -99
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs +0 -159
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs +0 -109
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs +0 -2246
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs +0 -61
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs +0 -151
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +0 -7
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -8
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -86
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -88
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatThread/ChatMessage.tsx +0 -268
- package/src/components/ChatThread/ToolBlock.tsx +0 -121
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/TemplateContainer.tsx +0 -24
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/chat-processor.ts +0 -314
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -95
- package/src/typings.d.ts +0 -9
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
8
|
+
import { Filter, Obj } from '@dxos/echo';
|
|
9
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
10
|
+
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { descriptionMessage, mx } from '@dxos/react-ui-theme';
|
|
12
|
+
|
|
13
|
+
import { TemplateEditor } from '../../components';
|
|
14
|
+
import { meta } from '../../meta';
|
|
15
|
+
|
|
16
|
+
import { type ComponentProps } from './types';
|
|
17
|
+
|
|
18
|
+
export const BlueprintContainer = ({ space }: ComponentProps) => {
|
|
19
|
+
const [blueprint] = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
20
|
+
const { t } = useTranslation(meta.id);
|
|
21
|
+
|
|
22
|
+
return !blueprint?.instructions ? (
|
|
23
|
+
<p className={mx(descriptionMessage, 'm-trimLg')}>{t('no blueprint message')}</p>
|
|
24
|
+
) : (
|
|
25
|
+
<div className='flex flex-col h-full'>
|
|
26
|
+
<Toolbar.Root classNames='density-coarse border-b border-subduedSeparator'>
|
|
27
|
+
<h2>{Obj.getLabel(blueprint)}</h2>
|
|
28
|
+
<div className='flex-1' />
|
|
29
|
+
<Toolbar.IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' />
|
|
30
|
+
</Toolbar.Root>
|
|
31
|
+
<TemplateEditor id={blueprint.id} template={blueprint.instructions} />
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Filter } from '@dxos/echo';
|
|
8
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
9
|
+
import { IconButton, Popover } from '@dxos/react-ui';
|
|
10
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
|
+
|
|
12
|
+
import { Chat, Toolbar } from '../../components';
|
|
13
|
+
import { useBlueprintRegistry, useChatProcessor, useChatServices } from '../../hooks';
|
|
14
|
+
import { useOnline, usePresets } from '../../hooks';
|
|
15
|
+
import { Assistant } from '../../types';
|
|
16
|
+
|
|
17
|
+
import { LoggingContainer } from './LoggingContainer';
|
|
18
|
+
import { type ComponentProps } from './types';
|
|
19
|
+
|
|
20
|
+
export const ChatContainer = ({ space, onEvent }: ComponentProps) => {
|
|
21
|
+
const [online, setOnline] = useOnline();
|
|
22
|
+
const { preset, ...chatProps } = usePresets(online);
|
|
23
|
+
|
|
24
|
+
const chats = useQuery(space, Filter.type(Assistant.Chat));
|
|
25
|
+
const chat = chats.at(-1);
|
|
26
|
+
|
|
27
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
28
|
+
const services = useChatServices({ space, chat });
|
|
29
|
+
const processor = useChatProcessor({ chat, preset, services, blueprintRegistry });
|
|
30
|
+
|
|
31
|
+
const handleUpdateName = useCallback(() => {
|
|
32
|
+
if (chat) {
|
|
33
|
+
void processor?.updateName(chat);
|
|
34
|
+
}
|
|
35
|
+
}, [processor, chat]);
|
|
36
|
+
|
|
37
|
+
return !chat || !processor ? null : (
|
|
38
|
+
<StackItem.Content toolbar>
|
|
39
|
+
<div role='none' className='flex items-center gap-2 pie-2'>
|
|
40
|
+
<Toolbar classNames='is-min grow' chat={chat} onReset={() => onEvent?.('reset')} />
|
|
41
|
+
<Popover.Root>
|
|
42
|
+
<Popover.Trigger asChild>
|
|
43
|
+
<IconButton icon='ph--sort-ascending--regular' label='Logs' variant='ghost' />
|
|
44
|
+
</Popover.Trigger>
|
|
45
|
+
<Popover.Portal>
|
|
46
|
+
<Popover.Content>
|
|
47
|
+
<LoggingContainer space={space} />
|
|
48
|
+
<Popover.Arrow />
|
|
49
|
+
</Popover.Content>
|
|
50
|
+
</Popover.Portal>
|
|
51
|
+
</Popover.Root>
|
|
52
|
+
<div className='truncate text-subdued'>{chat.name ?? 'no name'}</div>
|
|
53
|
+
<IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Update name' onClick={handleUpdateName} />
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div role='none' className='relative'>
|
|
57
|
+
<Chat.Root chat={chat} processor={processor} classNames='absolute inset-0'>
|
|
58
|
+
<Chat.Thread />
|
|
59
|
+
{/* <ChatProgress chat={chat} /> */}
|
|
60
|
+
<div className='flex justify-center p-4'>
|
|
61
|
+
<Chat.Prompt
|
|
62
|
+
{...chatProps}
|
|
63
|
+
outline
|
|
64
|
+
classNames='max-is-prose'
|
|
65
|
+
preset={preset?.id}
|
|
66
|
+
online={online}
|
|
67
|
+
onOnlineChange={setOnline}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
</Chat.Root>
|
|
71
|
+
</div>
|
|
72
|
+
</StackItem.Content>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type FC } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface } from '@dxos/app-framework';
|
|
8
|
+
import { Filter } from '@dxos/echo';
|
|
9
|
+
import { Chess } from '@dxos/plugin-chess';
|
|
10
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
|
|
12
|
+
import type { ComponentProps } from './types';
|
|
13
|
+
|
|
14
|
+
export const ChessContainer: FC<ComponentProps> = ({ space }) => {
|
|
15
|
+
const chess = useQuery(space, Filter.type(Chess.Game));
|
|
16
|
+
return <Surface role='section' limit={1} data={{ subject: chess.at(-1) }} />;
|
|
17
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface } from '@dxos/app-framework';
|
|
8
|
+
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
9
|
+
|
|
10
|
+
import { useContextBinder } from '../../hooks';
|
|
11
|
+
import { Assistant } from '../../types';
|
|
12
|
+
|
|
13
|
+
import { type ComponentProps } from './types';
|
|
14
|
+
|
|
15
|
+
export const CommentsContainer = ({ space }: ComponentProps) => {
|
|
16
|
+
const chats = useQuery(space, Filter.type(Assistant.Chat));
|
|
17
|
+
const binder = useContextBinder(chats.at(-1));
|
|
18
|
+
const object = binder?.objects.value[0]?.target;
|
|
19
|
+
const data = useMemo(() => ({ subject: 'comments', companionTo: object }), [object]);
|
|
20
|
+
if (!object) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return <Surface role='article' data={data} />;
|
|
25
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Obj, type Relation } from '@dxos/echo';
|
|
8
|
+
import { type ObjectId } from '@dxos/keys';
|
|
9
|
+
|
|
10
|
+
interface DebugCardProps {
|
|
11
|
+
obj: Obj.Any | Relation.Any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const DebugCard = ({ obj }: DebugCardProps) => {
|
|
15
|
+
return (
|
|
16
|
+
<div className='border border-separator rounded-lg p-4 bg-surface'>
|
|
17
|
+
<div className='flex items-center justify-between mb-2'>
|
|
18
|
+
<h3 className='font-medium text-lg'>{Obj.getLabel(obj)}</h3>
|
|
19
|
+
<p className='flex gap-2 items-center'>
|
|
20
|
+
<span className='text-sm font-mono dx-text-hue' data-hue={colors[insecureIdHash(obj.id, colors.length)]}>
|
|
21
|
+
#{obj.id.slice(-6)}
|
|
22
|
+
</span>
|
|
23
|
+
<span className='text-sm text-description bg-neutral-800 px-2 py-1 rounded'>{Obj.getTypename(obj)}</span>
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
<details className='group'>
|
|
27
|
+
<summary className='cursor-pointer text-sm text-primary hover:text-primaryHover'>View JSON</summary>
|
|
28
|
+
<pre className='mt-2 text-xs p-3 rounded overflow-x-auto'>{JSON.stringify(obj, null, 2)}</pre>
|
|
29
|
+
</details>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const insecureIdHash = (id: ObjectId, modulo: number) => {
|
|
35
|
+
let hash = 0;
|
|
36
|
+
for (let i = 0; i < id.length; i++) {
|
|
37
|
+
const num = id.charCodeAt(i);
|
|
38
|
+
hash = (hash ^ num) | 0;
|
|
39
|
+
}
|
|
40
|
+
return Math.abs(hash) % modulo;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const colors = [
|
|
44
|
+
'red',
|
|
45
|
+
'orange',
|
|
46
|
+
'amber',
|
|
47
|
+
'yellow',
|
|
48
|
+
'lime',
|
|
49
|
+
'green',
|
|
50
|
+
'emerald',
|
|
51
|
+
'teal',
|
|
52
|
+
'cyan',
|
|
53
|
+
'sky',
|
|
54
|
+
'blue',
|
|
55
|
+
'indigo',
|
|
56
|
+
'violet',
|
|
57
|
+
'purple',
|
|
58
|
+
'fuchsia',
|
|
59
|
+
'pink',
|
|
60
|
+
'rose',
|
|
61
|
+
];
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Match } from 'effect';
|
|
6
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { ResearchGraph } from '@dxos/assistant-testing';
|
|
9
|
+
import { Filter, Query } from '@dxos/echo';
|
|
10
|
+
import { D3ForceGraph, useGraphModel } from '@dxos/plugin-explorer';
|
|
11
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { IconButton, Toolbar } from '@dxos/react-ui';
|
|
13
|
+
import { ChatEditor, type ChatEditorController, type ChatEditorProps } from '@dxos/react-ui-chat';
|
|
14
|
+
import { useMatcherExtension } from '@dxos/react-ui-components';
|
|
15
|
+
import { type Expression, QueryParser, createFilter } from '@dxos/react-ui-components';
|
|
16
|
+
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
17
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
+
|
|
19
|
+
import { useFlush } from '../../hooks';
|
|
20
|
+
|
|
21
|
+
import { type ComponentProps } from './types';
|
|
22
|
+
|
|
23
|
+
export const GraphContainer = ({ space }: ComponentProps) => {
|
|
24
|
+
const [ast, setAst] = useState<Expression | undefined>();
|
|
25
|
+
const [filter, setFilter] = useState<Filter.Any>();
|
|
26
|
+
const [open, setOpen] = useState(false);
|
|
27
|
+
|
|
28
|
+
const [researchGraph] = useQuery(space, Query.type(ResearchGraph));
|
|
29
|
+
const queue = researchGraph?.queue.target;
|
|
30
|
+
|
|
31
|
+
const model = useGraphModel(space, undefined, undefined, queue);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
model?.setFilter(filter ?? Filter.everything());
|
|
34
|
+
}, [model, filter]);
|
|
35
|
+
|
|
36
|
+
const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
|
|
37
|
+
(text) => {
|
|
38
|
+
try {
|
|
39
|
+
const parser = new QueryParser(text);
|
|
40
|
+
const ast = parser.parse();
|
|
41
|
+
setAst(ast);
|
|
42
|
+
const filter = createFilter(ast);
|
|
43
|
+
setFilter(filter);
|
|
44
|
+
setOpen(true);
|
|
45
|
+
} catch {
|
|
46
|
+
// TODO(mykola): Make hybrid search.
|
|
47
|
+
const filter = Filter.text(text, { type: 'vector' });
|
|
48
|
+
setFilter(filter);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
[space],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className={mx('relative grid h-full', open && 'grid-rows-[min-content_1fr]')}>
|
|
56
|
+
<SearchBar space={space} onSubmit={handleSubmit} />
|
|
57
|
+
<D3ForceGraph model={model} />
|
|
58
|
+
|
|
59
|
+
{/* TODO(burdon): Create component with context state for story. */}
|
|
60
|
+
{(open && (
|
|
61
|
+
<div className='absolute left-2 right-2 bottom-2 h-[8rem] flex overflow-hidden bg-baseSurface border border-subduedSeparator'>
|
|
62
|
+
<SyntaxHighlighter language='json' classNames='text-sm'>
|
|
63
|
+
{JSON.stringify({ ast, filter }, null, 2)}
|
|
64
|
+
</SyntaxHighlighter>
|
|
65
|
+
<div className='absolute bottom-1 right-1'>
|
|
66
|
+
<IconButton variant='ghost' icon='ph--x--regular' iconOnly label='Close' onClick={() => setOpen(false)} />
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
)) || (
|
|
70
|
+
<div className='absolute bottom-3 right-3'>
|
|
71
|
+
<IconButton
|
|
72
|
+
variant='ghost'
|
|
73
|
+
icon='ph--arrow-line-up--regular'
|
|
74
|
+
iconOnly
|
|
75
|
+
label='Open'
|
|
76
|
+
onClick={() => setOpen(true)}
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
)}
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const SearchBar = ({ space, onSubmit }: ComponentProps & Pick<ChatEditorProps, 'onSubmit'>) => {
|
|
85
|
+
const { state: flushState, handleFlush } = useFlush(space);
|
|
86
|
+
const extensions = useMatcherExtension(space);
|
|
87
|
+
const editorRef = useRef<ChatEditorController>(null);
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<Toolbar.Root classNames='density-coarse border-b border-subduedSeparator'>
|
|
91
|
+
<ChatEditor
|
|
92
|
+
ref={editorRef}
|
|
93
|
+
autoFocus
|
|
94
|
+
placeholder='Search'
|
|
95
|
+
extensions={extensions}
|
|
96
|
+
fireIfEmpty
|
|
97
|
+
onSubmit={onSubmit}
|
|
98
|
+
/>
|
|
99
|
+
<Toolbar.IconButton
|
|
100
|
+
icon='ph--magnifying-glass--regular'
|
|
101
|
+
iconOnly
|
|
102
|
+
label='Search'
|
|
103
|
+
onClick={() => onSubmit?.(editorRef.current?.getText() ?? '')}
|
|
104
|
+
/>
|
|
105
|
+
<Toolbar.IconButton
|
|
106
|
+
disabled={flushState === 'flushing'}
|
|
107
|
+
icon={Match.value(flushState).pipe(
|
|
108
|
+
Match.when('idle', () => 'ph--floppy-disk--regular'),
|
|
109
|
+
Match.when('flushing', () => 'ph--spinner--regular'),
|
|
110
|
+
Match.when('flushed', () => 'ph--check--regular'),
|
|
111
|
+
Match.exhaustive,
|
|
112
|
+
)}
|
|
113
|
+
iconOnly
|
|
114
|
+
label='flush'
|
|
115
|
+
onClick={handleFlush}
|
|
116
|
+
/>
|
|
117
|
+
</Toolbar.Root>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
8
|
+
|
|
9
|
+
import type { ComponentProps } from './types';
|
|
10
|
+
|
|
11
|
+
export const InvocationsContainer = ({ space }: ComponentProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<div className='flex bs-full min-bs-[20rem] items-center justify-center'>
|
|
14
|
+
<InvocationTraceContainer space={space} />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Filter } from '@dxos/echo';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { InvocationTraceStartEvent } from '@dxos/functions';
|
|
10
|
+
import { type Queue, useQuery, useQueue } from '@dxos/react-client/echo';
|
|
11
|
+
import { Timeline } from '@dxos/react-ui-components';
|
|
12
|
+
|
|
13
|
+
import { useExecutionGraph } from '../../hooks';
|
|
14
|
+
import { Assistant } from '../../types';
|
|
15
|
+
|
|
16
|
+
import { type ComponentProps } from './types';
|
|
17
|
+
|
|
18
|
+
export const LoggingContainer = ({ space, traceQueue }: ComponentProps & { traceQueue?: Queue }) => {
|
|
19
|
+
const [chat] = useQuery(space, Filter.type(Assistant.Chat));
|
|
20
|
+
const invocations =
|
|
21
|
+
useQueue(space.properties?.invocationTraceQueue?.dxn)?.objects.filter(Obj.instanceOf(InvocationTraceStartEvent)) ??
|
|
22
|
+
[];
|
|
23
|
+
const { branches, commits } = useExecutionGraph(
|
|
24
|
+
traceQueue ?? invocations?.at(-1)?.invocationTraceQueue?.target ?? chat?.traceQueue?.target,
|
|
25
|
+
true,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className='flex flex-col h-full'>
|
|
30
|
+
<Timeline branches={branches} commits={commits} />
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { Filter } from '@dxos/echo';
|
|
9
|
+
import { InboxCapabilities } from '@dxos/plugin-inbox';
|
|
10
|
+
import { Mailbox } from '@dxos/plugin-inbox/types';
|
|
11
|
+
import { fullyQualifiedId, useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
|
|
13
|
+
import { type ComponentProps } from './types';
|
|
14
|
+
|
|
15
|
+
export const MessageContainer = ({ space }: ComponentProps) => {
|
|
16
|
+
const [mailbox] = useQuery(space, Filter.type(Mailbox.Mailbox));
|
|
17
|
+
const state = useCapability(InboxCapabilities.MailboxState);
|
|
18
|
+
const message = mailbox && state[fullyQualifiedId(mailbox)];
|
|
19
|
+
const data = useMemo(() => ({ subject: message ?? 'message', companionTo: mailbox }), [message, mailbox]);
|
|
20
|
+
|
|
21
|
+
return <Surface role='section' data={data} limit={1} />;
|
|
22
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Predicate } from 'effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Prompt } from '@dxos/blueprints';
|
|
9
|
+
import { Filter } from '@dxos/echo';
|
|
10
|
+
import { type Space, createDocAccessor, useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
12
|
+
import {
|
|
13
|
+
createBasicExtensions,
|
|
14
|
+
createDataExtensions,
|
|
15
|
+
createMarkdownExtensions,
|
|
16
|
+
createThemeExtensions,
|
|
17
|
+
useTextEditor,
|
|
18
|
+
} from '@dxos/react-ui-editor';
|
|
19
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
20
|
+
|
|
21
|
+
export const PromptContainer = ({ space }: { space: Space }) => {
|
|
22
|
+
const [prompt] = useQuery(space, Filter.type(Prompt.Prompt));
|
|
23
|
+
if (!prompt) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return (
|
|
27
|
+
<div style={{ minHeight: '300px' }}>
|
|
28
|
+
<PromptEditor prompt={prompt} />
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const PromptEditor = ({ prompt, classNames }: ThemedClassName<{ prompt: Prompt.Prompt }>) => {
|
|
34
|
+
const { themeMode } = useThemeContext();
|
|
35
|
+
const { parentRef } = useTextEditor(() => {
|
|
36
|
+
return {
|
|
37
|
+
initialValue: prompt.instructions ?? '',
|
|
38
|
+
extensions: [
|
|
39
|
+
createDataExtensions({ id: prompt.id, text: createDocAccessor(prompt, ['instructions']) }),
|
|
40
|
+
createBasicExtensions({
|
|
41
|
+
bracketMatching: false,
|
|
42
|
+
lineNumbers: true,
|
|
43
|
+
lineWrapping: true,
|
|
44
|
+
}),
|
|
45
|
+
createThemeExtensions({ themeMode }),
|
|
46
|
+
createMarkdownExtensions(),
|
|
47
|
+
].filter(Predicate.isTruthy),
|
|
48
|
+
};
|
|
49
|
+
}, [themeMode, prompt]);
|
|
50
|
+
|
|
51
|
+
return <div ref={parentRef} className={mx('bs-full overflow-hidden', classNames)} />;
|
|
52
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Filter } from '@dxos/echo';
|
|
8
|
+
import { useQuery, useQueue } from '@dxos/react-client/echo';
|
|
9
|
+
|
|
10
|
+
import { ResearchInputQueue } from '../testing';
|
|
11
|
+
|
|
12
|
+
import { DebugCard } from './DebugCard';
|
|
13
|
+
import type { ComponentProps } from './types';
|
|
14
|
+
|
|
15
|
+
export const ResearchInputStack = ({ space }: ComponentProps) => {
|
|
16
|
+
const [researchInput] = useQuery(space, Filter.type(ResearchInputQueue));
|
|
17
|
+
const queue = useQueue(researchInput?.queue.dxn);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className='p-4 overflow-y-auto h-full'>
|
|
21
|
+
<ul className='space-y-4 '>
|
|
22
|
+
{queue?.objects.map((object) => (
|
|
23
|
+
<li key={object.id}>
|
|
24
|
+
<DebugCard obj={object} />
|
|
25
|
+
</li>
|
|
26
|
+
))}
|
|
27
|
+
</ul>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface } from '@dxos/app-framework';
|
|
8
|
+
import { ResearchGraph } from '@dxos/assistant-testing';
|
|
9
|
+
import { Filter } from '@dxos/echo';
|
|
10
|
+
import { useQuery, useQueue } from '@dxos/react-client/echo';
|
|
11
|
+
|
|
12
|
+
import type { ComponentProps } from './types';
|
|
13
|
+
|
|
14
|
+
export const ResearchOutputStack = ({ space }: ComponentProps) => {
|
|
15
|
+
const [researchGraph] = useQuery(space, Filter.type(ResearchGraph));
|
|
16
|
+
const queue = useQueue(researchGraph?.queue.dxn);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className='p-4 overflow-y-auto h-full'>
|
|
20
|
+
<ul className='space-y-4 '>
|
|
21
|
+
{queue?.objects.map((object) => (
|
|
22
|
+
<li key={object.id}>
|
|
23
|
+
<Surface role='card' data={{ subject: object }} limit={1} />
|
|
24
|
+
</li>
|
|
25
|
+
))}
|
|
26
|
+
</ul>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Filter, Obj } from '@dxos/echo';
|
|
8
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
9
|
+
import { createDocAccessor, useQuery } from '@dxos/react-client/echo';
|
|
10
|
+
import { Toolbar, useThemeContext } from '@dxos/react-ui';
|
|
11
|
+
import {
|
|
12
|
+
Editor,
|
|
13
|
+
createBasicExtensions,
|
|
14
|
+
createDataExtensions,
|
|
15
|
+
createMarkdownExtensions,
|
|
16
|
+
createThemeExtensions,
|
|
17
|
+
outliner,
|
|
18
|
+
} from '@dxos/react-ui-editor';
|
|
19
|
+
|
|
20
|
+
import { type ComponentProps } from './types';
|
|
21
|
+
|
|
22
|
+
export const TasksContainer = ({ space }: ComponentProps) => {
|
|
23
|
+
const { themeMode } = useThemeContext();
|
|
24
|
+
const [document] = useQuery(space, Filter.type(Markdown.Document));
|
|
25
|
+
if (!document?.content.target) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<Toolbar.Root classNames='border-b border-subduedSeparator'>
|
|
32
|
+
<h2>{Obj.getLabel(document)}</h2>
|
|
33
|
+
</Toolbar.Root>
|
|
34
|
+
<Editor
|
|
35
|
+
id={document.id}
|
|
36
|
+
text={document.content.target}
|
|
37
|
+
classNames='h-full p-2 overflow-hidden'
|
|
38
|
+
extensions={[
|
|
39
|
+
// TODO(burdon): Create util.
|
|
40
|
+
createDataExtensions({ id: document.id, text: createDocAccessor(document.content.target, ['content']) }),
|
|
41
|
+
createBasicExtensions({ readOnly: false }),
|
|
42
|
+
createMarkdownExtensions(),
|
|
43
|
+
createThemeExtensions({ themeMode }),
|
|
44
|
+
outliner(),
|
|
45
|
+
]}
|
|
46
|
+
/>
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface } from '@dxos/app-framework';
|
|
8
|
+
import { meta } from '@dxos/plugin-token-manager';
|
|
9
|
+
|
|
10
|
+
export const TokenManagerContainer = () => {
|
|
11
|
+
const data = useMemo(() => ({ subject: `${meta.id}/space-settings` }), []);
|
|
12
|
+
|
|
13
|
+
return <Surface role='article' data={data} limit={1} />;
|
|
14
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Effect } from 'effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Filter } from '@dxos/echo';
|
|
9
|
+
import { FunctionTrigger, TriggerDispatcher } from '@dxos/functions';
|
|
10
|
+
import { AutomationPanel } from '@dxos/plugin-automation';
|
|
11
|
+
import { type Space, useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { Input, Toolbar, useAsyncState } from '@dxos/react-ui';
|
|
13
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
14
|
+
|
|
15
|
+
import { useComputeRuntimeCallback } from '../../hooks';
|
|
16
|
+
import { meta } from '../../meta';
|
|
17
|
+
|
|
18
|
+
import type { ComponentProps } from './types';
|
|
19
|
+
|
|
20
|
+
export const TriggersContainer = ({ space }: ComponentProps) => {
|
|
21
|
+
const { t } = useTranslation(meta.id);
|
|
22
|
+
const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);
|
|
23
|
+
return (
|
|
24
|
+
<div className='flex flex-col p-2'>
|
|
25
|
+
<Toolbar.Root>
|
|
26
|
+
<Input.Root>
|
|
27
|
+
<div>{isRunning ? t('trigger dispatcher running') : t('trigger dispatcher stopped')}</div>
|
|
28
|
+
<Input.Switch classNames='mis-2 mie-2' checked={isRunning} onCheckedChange={isRunning ? stop : start} />
|
|
29
|
+
</Input.Root>
|
|
30
|
+
</Toolbar.Root>
|
|
31
|
+
|
|
32
|
+
<AutomationPanel classNames='p-2' space={space} />
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
interface TriggerRuntimeControls {
|
|
38
|
+
triggers: FunctionTrigger[];
|
|
39
|
+
isRunning: boolean;
|
|
40
|
+
start: () => void;
|
|
41
|
+
stop: () => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const useTriggerRuntimeControls = (space: Space): TriggerRuntimeControls => {
|
|
45
|
+
const triggers = useQuery(space, Filter.type(FunctionTrigger));
|
|
46
|
+
|
|
47
|
+
const [isRunningState, setIsRunningState] = useAsyncState(
|
|
48
|
+
useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const start = useComputeRuntimeCallback(
|
|
52
|
+
space,
|
|
53
|
+
Effect.fnUntraced(function* () {
|
|
54
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
55
|
+
yield* dispatcher.start();
|
|
56
|
+
setIsRunningState(true);
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const stop = useComputeRuntimeCallback(
|
|
61
|
+
space,
|
|
62
|
+
Effect.fnUntraced(function* () {
|
|
63
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
64
|
+
yield* dispatcher.stop();
|
|
65
|
+
setIsRunningState(false);
|
|
66
|
+
}),
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
triggers,
|
|
71
|
+
isRunning: isRunningState ?? false,
|
|
72
|
+
start: () => void start(),
|
|
73
|
+
stop: () => void stop(),
|
|
74
|
+
};
|
|
75
|
+
};
|