@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
|
@@ -4,375 +4,654 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
writeDocument,
|
|
19
|
-
} from '@dxos/assistant-testing';
|
|
20
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
21
|
-
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
22
|
-
import { invariant } from '@dxos/invariant';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
import { Schema } from 'effect';
|
|
9
|
+
import React, { type FC, useCallback } from 'react';
|
|
10
|
+
|
|
11
|
+
import { EXA_API_KEY } from '@dxos/ai/testing';
|
|
12
|
+
import { Capabilities, Surface, useCapabilities } from '@dxos/app-framework';
|
|
13
|
+
import { AiContextBinder } from '@dxos/assistant';
|
|
14
|
+
import { LINEAR_BLUEPRINT, RESEARCH_BLUEPRINT, ResearchDataTypes, ResearchGraph, agent } from '@dxos/assistant-testing';
|
|
15
|
+
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
16
|
+
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
17
|
+
import { FunctionTrigger, exampleFunctions, serializeFunction } from '@dxos/functions';
|
|
23
18
|
import { log } from '@dxos/log';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
19
|
+
import { Board, BoardPlugin } from '@dxos/plugin-board';
|
|
20
|
+
import { Chess, ChessPlugin } from '@dxos/plugin-chess';
|
|
21
|
+
import * as chessFunctions from '@dxos/plugin-chess/functions';
|
|
26
22
|
import { InboxPlugin } from '@dxos/plugin-inbox';
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
23
|
+
import { Mailbox } from '@dxos/plugin-inbox/types';
|
|
24
|
+
import { Map, MapPlugin } from '@dxos/plugin-map';
|
|
25
|
+
import { createLocationSchema } from '@dxos/plugin-map/testing';
|
|
26
|
+
import { Markdown, MarkdownPlugin } from '@dxos/plugin-markdown';
|
|
27
|
+
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
31
28
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
29
|
+
import { ThreadPlugin } from '@dxos/plugin-thread';
|
|
30
|
+
import { TokenManagerPlugin } from '@dxos/plugin-token-manager';
|
|
32
31
|
import { TranscriptionPlugin } from '@dxos/plugin-transcription';
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
createDataExtensions,
|
|
40
|
-
createMarkdownExtensions,
|
|
41
|
-
createThemeExtensions,
|
|
42
|
-
outliner,
|
|
43
|
-
} from '@dxos/react-ui-editor';
|
|
44
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
32
|
+
import { Transcript } from '@dxos/plugin-transcription/types';
|
|
33
|
+
import { useClient } from '@dxos/react-client';
|
|
34
|
+
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
35
|
+
import { useAsyncEffect, useSignalsMemo } from '@dxos/react-ui';
|
|
36
|
+
import { Stack, StackItem } from '@dxos/react-ui-stack';
|
|
37
|
+
import { Table } from '@dxos/react-ui-table/types';
|
|
45
38
|
import { DataType } from '@dxos/schema';
|
|
46
|
-
import { render
|
|
39
|
+
import { render } from '@dxos/storybook-utils';
|
|
40
|
+
import { isNonNullable, trim } from '@dxos/util';
|
|
47
41
|
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import { useChatProcessor, useChatServices } from '../hooks';
|
|
52
|
-
import { meta as AssistantMeta } from '../meta';
|
|
42
|
+
import { BLUEPRINT_KEY } from '../capabilities';
|
|
43
|
+
import { useContextBinder } from '../hooks';
|
|
44
|
+
import { addTestData, createTestMailbox, createTestTranscription, organizations, testTypes } from '../testing';
|
|
53
45
|
import { translations } from '../translations';
|
|
54
46
|
import { Assistant } from '../types';
|
|
55
47
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<Component />
|
|
82
|
-
</div>
|
|
83
|
-
),
|
|
84
|
-
)}
|
|
85
|
-
</div>
|
|
86
|
-
);
|
|
48
|
+
import {
|
|
49
|
+
BlueprintContainer,
|
|
50
|
+
ChatContainer,
|
|
51
|
+
ChessContainer,
|
|
52
|
+
CommentsContainer,
|
|
53
|
+
type ComponentProps,
|
|
54
|
+
GraphContainer,
|
|
55
|
+
InvocationsContainer,
|
|
56
|
+
LoggingContainer,
|
|
57
|
+
MessageContainer,
|
|
58
|
+
PromptContainer,
|
|
59
|
+
ResearchInputStack,
|
|
60
|
+
ResearchOutputStack,
|
|
61
|
+
TasksContainer,
|
|
62
|
+
TokenManagerContainer,
|
|
63
|
+
TriggersContainer,
|
|
64
|
+
} from './components';
|
|
65
|
+
import { ResearchInputQueue, accessTokensFromEnv, config, getDecorators } from './testing';
|
|
66
|
+
|
|
67
|
+
const panelClassNames = 'bg-baseSurface rounded border border-separator overflow-hidden mbe-[--stack-gap] last:mbe-0';
|
|
68
|
+
|
|
69
|
+
type StoryProps = {
|
|
70
|
+
debug?: boolean;
|
|
71
|
+
deckComponents: (FC<ComponentProps> | 'surfaces')[][];
|
|
72
|
+
blueprints?: string[];
|
|
87
73
|
};
|
|
88
74
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
const ChatContainer = () => {
|
|
94
|
-
const { t } = useTranslation(AssistantMeta.id);
|
|
75
|
+
const DefaultStory = ({ debug = true, deckComponents, blueprints = [] }: StoryProps) => {
|
|
76
|
+
const client = useClient();
|
|
95
77
|
const space = useSpace();
|
|
96
78
|
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
79
|
+
const blueprintsDefinitions = useCapabilities(Capabilities.BlueprintDefinition);
|
|
80
|
+
useAsyncEffect(async () => {
|
|
81
|
+
if (!space) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const { objects: chats = [] } = await space.db.query(Filter.type(Assistant.Chat)).run();
|
|
85
|
+
const chat = chats[0];
|
|
86
|
+
if (!chat) {
|
|
87
|
+
return;
|
|
102
88
|
}
|
|
103
|
-
}, [space]);
|
|
104
|
-
|
|
105
|
-
// TODO(burdon): Memo preset for provider.
|
|
106
|
-
const [online, setOnline] = useState(true);
|
|
107
|
-
const [preset, setPreset] = useState<AiServicePreset>();
|
|
108
|
-
const presets = useMemo(
|
|
109
|
-
() => AiServicePresets.filter((preset) => online === (preset.provider === 'dxos-remote')),
|
|
110
|
-
[online],
|
|
111
|
-
);
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
setPreset(presets[0]);
|
|
114
|
-
}, [presets]);
|
|
115
|
-
|
|
116
|
-
const services = useChatServices({ space });
|
|
117
|
-
const blueprintRegistry = useMemo(() => new Blueprint.Registry([DESIGN_BLUEPRINT, TASK_BLUEPRINT]), []);
|
|
118
|
-
const processor = useChatProcessor({
|
|
119
|
-
preset,
|
|
120
|
-
chat,
|
|
121
|
-
space,
|
|
122
|
-
services,
|
|
123
|
-
blueprintRegistry,
|
|
124
|
-
noPluginArtifacts: true,
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const handleChangePreset = useCallback<NonNullable<ChatPromptProps['onChangePreset']>>(
|
|
128
|
-
(id) => {
|
|
129
|
-
const preset = presets.find((preset) => preset.id === id);
|
|
130
|
-
if (preset) {
|
|
131
|
-
setPreset(preset);
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
[presets],
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
const handleNewChat = useCallback(() => {
|
|
138
|
-
invariant(space);
|
|
139
|
-
const chat = space.db.add(
|
|
140
|
-
Obj.make(Assistant.Chat, {
|
|
141
|
-
queue: Ref.fromDXN(space.queues.create().dxn),
|
|
142
|
-
}),
|
|
143
|
-
);
|
|
144
|
-
setChat(chat);
|
|
145
|
-
}, [space]);
|
|
146
|
-
|
|
147
|
-
const handleBranchChat = useCallback(() => {}, [space]);
|
|
148
|
-
|
|
149
|
-
if (!chat || !processor) {
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return (
|
|
154
|
-
<Chat.Root chat={chat} processor={processor} onEvent={(event) => log.info('event', { event })}>
|
|
155
|
-
<Toolbar.Root classNames='border-b border-subduedSeparator'>
|
|
156
|
-
<Toolbar.IconButton icon='ph--plus--regular' iconOnly label={t('button new thread')} onClick={handleNewChat} />
|
|
157
|
-
<Toolbar.IconButton
|
|
158
|
-
disabled
|
|
159
|
-
icon='ph--git-branch--regular'
|
|
160
|
-
iconOnly
|
|
161
|
-
label={t('button branch thread')}
|
|
162
|
-
onClick={handleBranchChat}
|
|
163
|
-
/>
|
|
164
|
-
</Toolbar.Root>
|
|
165
|
-
<Chat.Thread />
|
|
166
|
-
<div className='p-4'>
|
|
167
|
-
<Chat.Prompt
|
|
168
|
-
classNames='p-2 border border-subduedSeparator rounded focus-within:outline focus-within:border-transparent outline-primary-500'
|
|
169
|
-
expandable
|
|
170
|
-
online={online}
|
|
171
|
-
presets={presets.map(({ id, model, label }) => ({ id, label: label ?? model }))}
|
|
172
|
-
preset={preset?.id}
|
|
173
|
-
onChangeOnline={setOnline}
|
|
174
|
-
onChangePreset={handleChangePreset}
|
|
175
|
-
/>
|
|
176
|
-
</div>
|
|
177
|
-
</Chat.Root>
|
|
178
|
-
);
|
|
179
|
-
};
|
|
180
89
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
90
|
+
// Add blueprints to context.
|
|
91
|
+
const binder = new AiContextBinder(await chat.queue.load());
|
|
92
|
+
const registry = new Blueprint.Registry(blueprintsDefinitions);
|
|
93
|
+
const blueprintObjects = blueprints
|
|
94
|
+
.map((key) => {
|
|
95
|
+
const blueprint = registry.getByKey(key);
|
|
96
|
+
if (blueprint) {
|
|
97
|
+
return space.db.add(Obj.clone(blueprint));
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
.filter(isNonNullable);
|
|
101
|
+
await binder.bind({ blueprints: blueprintObjects.map((blueprint) => Ref.make(blueprint)) });
|
|
102
|
+
}, [space, blueprints, blueprintsDefinitions]);
|
|
103
|
+
|
|
104
|
+
const handleEvent = useCallback<NonNullable<ComponentProps['onEvent']>>((event) => {
|
|
105
|
+
log.info('event', { event });
|
|
106
|
+
switch (event) {
|
|
107
|
+
case 'reset': {
|
|
108
|
+
void client?.reset().then(() => {
|
|
109
|
+
document.location.reload();
|
|
110
|
+
});
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, []);
|
|
188
115
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
<Editor
|
|
195
|
-
id={document.id}
|
|
196
|
-
text={document.content.target}
|
|
197
|
-
classNames='h-full p-2 overflow-hidden'
|
|
198
|
-
extensions={[
|
|
199
|
-
// TODO(burdon): Create util.
|
|
200
|
-
createDataExtensions({ id: document.id, text: createDocAccessor(document.content.target, ['content']) }),
|
|
201
|
-
createBasicExtensions({ readOnly: false }),
|
|
202
|
-
createMarkdownExtensions({ themeMode }),
|
|
203
|
-
createThemeExtensions({ themeMode }),
|
|
204
|
-
outliner(),
|
|
205
|
-
]}
|
|
206
|
-
/>
|
|
207
|
-
</>
|
|
116
|
+
const chats = useQuery(space, Filter.type(Assistant.Chat));
|
|
117
|
+
const binder = useContextBinder(chats.at(-1));
|
|
118
|
+
const objects = useSignalsMemo(
|
|
119
|
+
() => binder?.objects.value.map((ref) => ref.target).filter(isNonNullable) ?? [],
|
|
120
|
+
[binder],
|
|
208
121
|
);
|
|
209
|
-
};
|
|
210
122
|
|
|
211
|
-
|
|
212
|
-
const BlueprintContainer = () => {
|
|
213
|
-
const space = useSpace();
|
|
214
|
-
const [blueprint] = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
215
|
-
if (!blueprint?.instructions.target) {
|
|
123
|
+
if (!space) {
|
|
216
124
|
return null;
|
|
217
125
|
}
|
|
218
126
|
|
|
219
127
|
return (
|
|
220
|
-
<
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
128
|
+
<Stack
|
|
129
|
+
orientation='horizontal'
|
|
130
|
+
size='split'
|
|
131
|
+
rail={false}
|
|
132
|
+
itemsCount={deckComponents.length}
|
|
133
|
+
classNames='absolute inset-0 gap-[--stack-gap]'
|
|
134
|
+
>
|
|
135
|
+
{deckComponents.map((plankComponents, i) => {
|
|
136
|
+
const Components: FC<ComponentProps>[] = plankComponents.filter((item) => item !== 'surfaces');
|
|
137
|
+
const renderSurfaces = plankComponents.includes('surfaces');
|
|
138
|
+
let j = 0;
|
|
139
|
+
return (
|
|
140
|
+
<StackItem.Root order={i + 1} item={{ id: `${i}` }} key={i}>
|
|
141
|
+
<Stack
|
|
142
|
+
orientation='vertical'
|
|
143
|
+
size={i > 0 ? 'contain' : 'split'}
|
|
144
|
+
rail={false}
|
|
145
|
+
itemsCount={plankComponents.length + (i > 0 ? objects.length : 0)}
|
|
146
|
+
>
|
|
147
|
+
{Components.map((Component) => {
|
|
148
|
+
const item = (
|
|
149
|
+
<StackItem.Root key={j} order={j + 1} item={{ id: `${i}:${j}` }} classNames={panelClassNames}>
|
|
150
|
+
<Component space={space} debug={debug} onEvent={handleEvent} />
|
|
151
|
+
</StackItem.Root>
|
|
152
|
+
);
|
|
153
|
+
j += 1;
|
|
154
|
+
return item;
|
|
155
|
+
})}
|
|
156
|
+
|
|
157
|
+
{renderSurfaces &&
|
|
158
|
+
objects.map((object, index) => {
|
|
159
|
+
const k = index + j;
|
|
160
|
+
return (
|
|
161
|
+
<StackItem.Root key={k} order={k + 1} item={{ id: `${k}` }} classNames={panelClassNames}>
|
|
162
|
+
{debug && (
|
|
163
|
+
<div role='heading' className='flex gap-2 items-center text-xs justify-center text-subdued'>
|
|
164
|
+
<span>{Obj.getTypename(object)}</span>
|
|
165
|
+
<span>{object.id}</span>
|
|
166
|
+
</div>
|
|
167
|
+
)}
|
|
168
|
+
<Surface role='section' limit={1} data={{ subject: object }} />
|
|
169
|
+
</StackItem.Root>
|
|
170
|
+
);
|
|
171
|
+
})}
|
|
172
|
+
</Stack>
|
|
173
|
+
</StackItem.Root>
|
|
174
|
+
);
|
|
175
|
+
})}
|
|
176
|
+
</Stack>
|
|
226
177
|
);
|
|
227
178
|
};
|
|
228
179
|
|
|
229
|
-
|
|
230
|
-
// Configuration
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
const meta = {
|
|
180
|
+
const storybook: Meta<typeof DefaultStory> = {
|
|
234
181
|
title: 'plugins/plugin-assistant/Chat',
|
|
235
182
|
render: render(DefaultStory),
|
|
236
|
-
decorators: [],
|
|
237
183
|
parameters: {
|
|
238
184
|
translations,
|
|
239
185
|
controls: { disable: true },
|
|
240
186
|
},
|
|
241
|
-
}
|
|
187
|
+
};
|
|
242
188
|
|
|
243
|
-
export default
|
|
189
|
+
export default storybook;
|
|
244
190
|
|
|
245
|
-
type Story = StoryObj<typeof
|
|
191
|
+
type Story = StoryObj<typeof storybook>;
|
|
246
192
|
|
|
247
193
|
//
|
|
248
|
-
//
|
|
194
|
+
// Stories
|
|
249
195
|
//
|
|
250
196
|
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
197
|
+
const MARKDOWN_DOCUMENT = trim`
|
|
198
|
+
# Hello, world!
|
|
199
|
+
|
|
200
|
+
This is a test document that contains Markdown content. Markdown is a lightweight markup language for writing formatted text in plain text form. Its goal is to be easy to read and write in raw form, easy to convert to HTML.
|
|
201
|
+
|
|
202
|
+
Markdown’s simplicity makes it highly adaptable: it can be written in any text editor, stored in plain .md files, and rendered into HTML, PDF, or other formats with converters. Because of this portability, it’s widely used in software documentation, static site generators, technical blogging, and collaborative platforms like GitHub and Notion.
|
|
203
|
+
|
|
204
|
+
Many applications extend the core syntax with extras (e.g., tables, task lists, math notation), but the core idea remains the same—clean, minimal markup that stays readable even without rendering.
|
|
205
|
+
`;
|
|
206
|
+
|
|
207
|
+
const STYLE_GUIDE = trim`
|
|
208
|
+
# Style Guide
|
|
209
|
+
- Use short, simple sentences.
|
|
210
|
+
- Organize content with headings and bullet points.
|
|
211
|
+
- Avoid jargon and explain technical terms.
|
|
212
|
+
- Use active voice whenever possible.
|
|
213
|
+
- Highlight key points in bold.
|
|
214
|
+
- Keep paragraphs brief and focused on one idea.
|
|
215
|
+
- Proofread for clarity and correctness.
|
|
216
|
+
`;
|
|
217
|
+
|
|
218
|
+
const addSpellingMistakes = (text: string, n: number): string => {
|
|
219
|
+
const words = text.split(' ');
|
|
220
|
+
for (let i = 0; i < n; i++) {
|
|
221
|
+
const idx = Math.floor(Math.random() * words.length);
|
|
222
|
+
const word = words[idx];
|
|
223
|
+
const charIdx = Math.floor(Math.random() * word.length);
|
|
224
|
+
const typoChar = String.fromCharCode(word.charCodeAt(charIdx) + 1);
|
|
225
|
+
words[idx] = word.slice(0, charIdx) + typoChar + word.slice(charIdx + 1);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return words.join(' ');
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export const Default: Story = {
|
|
232
|
+
decorators: getDecorators({
|
|
233
|
+
plugins: [MarkdownPlugin()],
|
|
234
|
+
config: config.remote,
|
|
235
|
+
}),
|
|
236
|
+
args: {
|
|
237
|
+
deckComponents: [[ChatContainer]],
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// Test with prompt: Propose changes to my document based on the style guide.
|
|
242
|
+
export const WithDocument: Story = {
|
|
243
|
+
decorators: getDecorators({
|
|
244
|
+
plugins: [MarkdownPlugin(), ThreadPlugin()],
|
|
245
|
+
config: config.remote, // TODO(burdon): Issue making persistent.
|
|
246
|
+
onInit: async ({ space }) => {
|
|
247
|
+
space.db.add(
|
|
248
|
+
Markdown.makeDocument({
|
|
249
|
+
name: 'My Document',
|
|
250
|
+
content: addSpellingMistakes(MARKDOWN_DOCUMENT, 2),
|
|
251
|
+
}),
|
|
252
|
+
);
|
|
253
|
+
space.db.add(
|
|
254
|
+
Markdown.makeDocument({
|
|
255
|
+
name: 'Style Guide',
|
|
256
|
+
content: STYLE_GUIDE,
|
|
257
|
+
}),
|
|
258
|
+
);
|
|
261
259
|
},
|
|
260
|
+
onChatCreated: async ({ space, binder }) => {
|
|
261
|
+
const { objects } = await space.db.query(Filter.type(Markdown.Document)).run();
|
|
262
|
+
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
263
|
+
},
|
|
264
|
+
}),
|
|
265
|
+
args: {
|
|
266
|
+
deckComponents: [[ChatContainer], ['surfaces', CommentsContainer]],
|
|
267
|
+
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/markdown'],
|
|
262
268
|
},
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
withPluginManager({
|
|
277
|
-
fireEvents: [Events.SetupArtifactDefinition],
|
|
278
|
-
plugins: [
|
|
279
|
-
ClientPlugin({
|
|
280
|
-
config,
|
|
281
|
-
types: [Assistant.Chat, DocumentType, Blueprint.Blueprint],
|
|
282
|
-
onClientInitialized: async (_, client) => {
|
|
283
|
-
await client.halo.createIdentity();
|
|
284
|
-
await client.spaces.waitUntilReady();
|
|
285
|
-
const space = client.spaces.default;
|
|
286
|
-
// ISSUE(burdon): Should not require this.
|
|
287
|
-
// ERROR: invariant violation: Database was not initialized with root object.
|
|
288
|
-
await space.waitUntilReady();
|
|
289
|
-
|
|
290
|
-
// TODO(burdon): Remove need for this boilerplate. Namespace for types?
|
|
291
|
-
const chat = space.db.add(
|
|
292
|
-
Obj.make(Assistant.Chat, {
|
|
293
|
-
queue: Ref.fromDXN(space.queues.create().dxn),
|
|
294
|
-
}),
|
|
295
|
-
);
|
|
296
|
-
const binder = new ContextBinder(await chat.queue.load());
|
|
297
|
-
|
|
298
|
-
const doc = space.db.add(
|
|
299
|
-
Obj.make(DocumentType, {
|
|
300
|
-
name: 'Tasks',
|
|
301
|
-
content: Ref.make(Obj.make(DataType.Text, { content: '' })),
|
|
302
|
-
}),
|
|
303
|
-
);
|
|
304
|
-
if (context) {
|
|
305
|
-
await binder.bind({ objects: [Ref.make(doc)] });
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
for (const blueprint of blueprints) {
|
|
309
|
-
// Clone blueprints and bind to conversation.
|
|
310
|
-
// TODO(dmaretskyi): This should be done by Obj.clone.
|
|
311
|
-
const { id: _id, ...data } = blueprint;
|
|
312
|
-
const obj = space.db.add(Obj.make(Blueprint.Blueprint, data));
|
|
313
|
-
await binder.bind({ blueprints: [Ref.make(obj)] });
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
}),
|
|
317
|
-
IntentPlugin(),
|
|
318
|
-
SettingsPlugin(),
|
|
319
|
-
SpacePlugin(),
|
|
320
|
-
|
|
321
|
-
TranscriptionPlugin(),
|
|
322
|
-
AssistantPlugin(),
|
|
323
|
-
|
|
324
|
-
...plugins,
|
|
325
|
-
],
|
|
326
|
-
capabilities: [contributes(Capabilities.Functions, [readDocument, writeDocument])],
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export const WithBlueprints: Story = {
|
|
272
|
+
decorators: getDecorators({
|
|
273
|
+
plugins: [InboxPlugin(), MarkdownPlugin(), TablePlugin()],
|
|
274
|
+
config: config.remote,
|
|
275
|
+
onInit: async ({ space }) => {
|
|
276
|
+
space.db.add(Markdown.makeDocument({ name: 'Tasks' }));
|
|
277
|
+
},
|
|
278
|
+
onChatCreated: async ({ space, binder }) => {
|
|
279
|
+
const { objects } = await space.db.query(Filter.type(Markdown.Document)).run();
|
|
280
|
+
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
281
|
+
},
|
|
327
282
|
}),
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
283
|
+
args: {
|
|
284
|
+
deckComponents: [[ChatContainer], [TasksContainer, BlueprintContainer]],
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
export const WithChess: Story = {
|
|
289
|
+
decorators: getDecorators({
|
|
290
|
+
plugins: [ChessPlugin()],
|
|
291
|
+
config: config.remote,
|
|
292
|
+
types: [Chess.Game],
|
|
293
|
+
onInit: async ({ space }) => {
|
|
294
|
+
// TODO(burdon): Add player DID (for user and assistant).
|
|
295
|
+
space.db.add(
|
|
296
|
+
Chess.makeGame({
|
|
297
|
+
name: 'Challenge',
|
|
298
|
+
pgn: [
|
|
299
|
+
'1. e4 e5',
|
|
300
|
+
'2. Nf3 Nc6',
|
|
301
|
+
'3. Bc4 Bc5',
|
|
302
|
+
'4. c3 Nf6',
|
|
303
|
+
'5. d4 exd4',
|
|
304
|
+
'6. cxd4 Bb4+',
|
|
305
|
+
'7. Nc3 d5',
|
|
306
|
+
'8. exd5 Nxd5',
|
|
307
|
+
'9. O-O Be6',
|
|
308
|
+
'10. Qb3 Na5',
|
|
309
|
+
'11. Qa4+ c6',
|
|
310
|
+
'12. Bxd5 Bxc3',
|
|
311
|
+
'13. Bxe6 fxe6',
|
|
312
|
+
'*',
|
|
313
|
+
].join(' '),
|
|
314
|
+
}),
|
|
315
|
+
);
|
|
316
|
+
},
|
|
317
|
+
onChatCreated: async ({ space, binder }) => {
|
|
318
|
+
const { objects } = await space.db.query(Filter.type(Chess.Game)).run();
|
|
319
|
+
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
320
|
+
},
|
|
332
321
|
}),
|
|
333
|
-
|
|
322
|
+
args: {
|
|
323
|
+
deckComponents: [[ChatContainer], ['surfaces']],
|
|
324
|
+
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/chess'],
|
|
325
|
+
},
|
|
326
|
+
};
|
|
334
327
|
|
|
335
|
-
//
|
|
336
|
-
|
|
337
|
-
|
|
328
|
+
// Test with prompt: Summarize my mailbox and write the summary in a new document.
|
|
329
|
+
export const WithMail: Story = {
|
|
330
|
+
decorators: getDecorators({
|
|
331
|
+
plugins: [InboxPlugin(), MarkdownPlugin(), ThreadPlugin()],
|
|
332
|
+
config: config.remote,
|
|
333
|
+
types: [Mailbox.Mailbox],
|
|
334
|
+
onInit: async ({ space }) => {
|
|
335
|
+
const queue = space.queues.create();
|
|
336
|
+
const messages = createTestMailbox();
|
|
337
|
+
await queue.append(messages);
|
|
338
|
+
space.db.add(Mailbox.make({ name: 'Mailbox', queue: queue.dxn }));
|
|
339
|
+
},
|
|
340
|
+
onChatCreated: async ({ space, binder }) => {
|
|
341
|
+
const { objects } = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
342
|
+
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
343
|
+
},
|
|
344
|
+
}),
|
|
345
|
+
args: {
|
|
346
|
+
deckComponents: [[ChatContainer], ['surfaces', MessageContainer]],
|
|
347
|
+
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/inbox', 'dxos.org/blueprint/markdown'],
|
|
348
|
+
},
|
|
349
|
+
};
|
|
338
350
|
|
|
339
|
-
|
|
351
|
+
// Test with prompt: Sync my email.
|
|
352
|
+
export const WithGmail: Story = {
|
|
340
353
|
decorators: getDecorators({
|
|
341
|
-
|
|
354
|
+
plugins: [InboxPlugin(), TokenManagerPlugin()],
|
|
355
|
+
config: config.remote,
|
|
356
|
+
types: [Mailbox.Mailbox],
|
|
357
|
+
onInit: async ({ space }) => {
|
|
358
|
+
const queue = space.queues.create();
|
|
359
|
+
space.db.add(Mailbox.make({ name: 'Mailbox', queue: queue.dxn }));
|
|
360
|
+
},
|
|
361
|
+
onChatCreated: async ({ space, binder }) => {
|
|
362
|
+
const { objects } = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
363
|
+
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
364
|
+
},
|
|
342
365
|
}),
|
|
343
366
|
args: {
|
|
344
|
-
|
|
367
|
+
deckComponents: [[ChatContainer], ['surfaces', MessageContainer, TokenManagerContainer]],
|
|
368
|
+
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/inbox'],
|
|
345
369
|
},
|
|
346
|
-
}
|
|
370
|
+
};
|
|
347
371
|
|
|
348
|
-
|
|
372
|
+
// Test with prompt: Create 10 locations.
|
|
373
|
+
export const WithMap: Story = {
|
|
349
374
|
decorators: getDecorators({
|
|
350
|
-
|
|
351
|
-
|
|
375
|
+
plugins: [MapPlugin(), TablePlugin()],
|
|
376
|
+
config: config.remote,
|
|
377
|
+
types: [DataType.View, Map.Map, Table.Table],
|
|
378
|
+
onInit: async ({ space }) => {
|
|
379
|
+
const [schema] = await space.db.schemaRegistry.register([createLocationSchema()]);
|
|
380
|
+
const { view: tableView } = await Table.makeView({ name: 'Table', space, typename: schema.typename });
|
|
381
|
+
const { view: mapView } = await Map.makeView({
|
|
382
|
+
name: 'Map',
|
|
383
|
+
space,
|
|
384
|
+
typename: schema.typename,
|
|
385
|
+
pivotFieldName: 'location',
|
|
386
|
+
});
|
|
387
|
+
space.db.add(tableView);
|
|
388
|
+
space.db.add(mapView);
|
|
389
|
+
},
|
|
390
|
+
onChatCreated: async ({ space, binder }) => {
|
|
391
|
+
const { objects } = await space.db.query(Filter.type(DataType.View)).run();
|
|
392
|
+
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
393
|
+
},
|
|
394
|
+
}),
|
|
395
|
+
args: {
|
|
396
|
+
deckComponents: [[ChatContainer], ['surfaces']],
|
|
397
|
+
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/map'],
|
|
398
|
+
},
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
export const WithTrip: Story = {
|
|
402
|
+
decorators: getDecorators({
|
|
403
|
+
plugins: [MarkdownPlugin(), MapPlugin()],
|
|
404
|
+
config: config.remote,
|
|
405
|
+
types: [Map.Map],
|
|
406
|
+
onInit: async ({ space }) => {
|
|
407
|
+
// TODO(burdon): Table.
|
|
408
|
+
space.db.add(Map.make({ name: 'Trip' }));
|
|
409
|
+
space.db.add(
|
|
410
|
+
Markdown.makeDocument({
|
|
411
|
+
name: 'Itinerary',
|
|
412
|
+
content: trim`
|
|
413
|
+
# Itinerary
|
|
414
|
+
|
|
415
|
+
## Day 1
|
|
416
|
+
- Visit the Sagrada Familia
|
|
417
|
+
- Visit the Park Güell
|
|
418
|
+
- Visit the Casa Batlló
|
|
419
|
+
|
|
420
|
+
## Day 2
|
|
421
|
+
- Visit the Eiffel Tower
|
|
422
|
+
- Visit the Louvre
|
|
423
|
+
- Visit the Musée d'Orsay
|
|
424
|
+
`,
|
|
425
|
+
}),
|
|
426
|
+
);
|
|
427
|
+
space.db.add(
|
|
428
|
+
Markdown.makeDocument({
|
|
429
|
+
name: 'Barcelona',
|
|
430
|
+
content: trim`
|
|
431
|
+
# Barcelona
|
|
432
|
+
|
|
433
|
+
Barcelona is the capital and most populous city of Catalonia, an autonomous community in northeastern Spain.
|
|
434
|
+
It is located on the Mediterranean coast, on the banks of the Llobregat River, in the comarca of the Baix Llobregat.
|
|
435
|
+
The city is known for its rich history, vibrant culture, and stunning architecture, including the Sagrada Familia, Park Güell, and Casa Batlló.
|
|
436
|
+
`,
|
|
437
|
+
}),
|
|
438
|
+
);
|
|
439
|
+
},
|
|
440
|
+
onChatCreated: async ({ space, binder }) => {
|
|
441
|
+
const { objects } = await space.db.query(Filter.or(Filter.type(Map.Map), Filter.type(Markdown.Document))).run();
|
|
442
|
+
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
443
|
+
},
|
|
444
|
+
}),
|
|
445
|
+
args: {
|
|
446
|
+
deckComponents: [[ChatContainer], ['surfaces']],
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
export const WithBoard: Story = {
|
|
451
|
+
decorators: getDecorators({
|
|
452
|
+
plugins: [BoardPlugin()],
|
|
453
|
+
config: config.remote,
|
|
454
|
+
types: [Board.Board],
|
|
455
|
+
onInit: async ({ space }) => {
|
|
456
|
+
space.db.add(Board.makeBoard());
|
|
457
|
+
},
|
|
458
|
+
onChatCreated: async ({ space, binder }) => {
|
|
459
|
+
const { objects } = await space.db.query(Filter.type(Board.Board)).run();
|
|
460
|
+
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
461
|
+
},
|
|
462
|
+
}),
|
|
463
|
+
args: {
|
|
464
|
+
debug: true,
|
|
465
|
+
deckComponents: [[ChatContainer], ['surfaces']],
|
|
466
|
+
},
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
export const WithResearch: Story = {
|
|
470
|
+
decorators: getDecorators({
|
|
471
|
+
plugins: [MarkdownPlugin(), TablePlugin()],
|
|
472
|
+
config: config.persistent,
|
|
473
|
+
types: [...ResearchDataTypes, ResearchGraph],
|
|
474
|
+
accessTokens: [Obj.make(DataType.AccessToken, { source: 'exa.ai', token: EXA_API_KEY })],
|
|
475
|
+
}),
|
|
476
|
+
args: {
|
|
477
|
+
deckComponents: [[ChatContainer], [GraphContainer, LoggingContainer]],
|
|
478
|
+
blueprints: [RESEARCH_BLUEPRINT.key],
|
|
479
|
+
},
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
export const WithSearch: Story = {
|
|
483
|
+
decorators: getDecorators({
|
|
484
|
+
config: config.remote,
|
|
485
|
+
types: testTypes,
|
|
486
|
+
onInit: async ({ space }) => {
|
|
487
|
+
await addTestData(space);
|
|
488
|
+
},
|
|
352
489
|
}),
|
|
353
490
|
args: {
|
|
354
|
-
|
|
491
|
+
deckComponents: [[ChatContainer], [GraphContainer]],
|
|
355
492
|
},
|
|
356
|
-
}
|
|
493
|
+
};
|
|
357
494
|
|
|
358
|
-
export const
|
|
495
|
+
export const WithTranscription: Story = {
|
|
359
496
|
decorators: getDecorators({
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
497
|
+
plugins: [TranscriptionPlugin(), PreviewPlugin()],
|
|
498
|
+
config: config.remote,
|
|
499
|
+
types: [Transcript.Transcript],
|
|
500
|
+
onInit: async ({ space }) => {
|
|
501
|
+
const queue = space.queues.create();
|
|
502
|
+
const messages = createTestTranscription();
|
|
503
|
+
await queue.append(messages);
|
|
504
|
+
space.db.add(Transcript.makeTranscript(queue.dxn));
|
|
505
|
+
},
|
|
506
|
+
onChatCreated: async ({ space, binder }) => {
|
|
507
|
+
const { objects } = await space.db.query(Filter.type(Transcript.Transcript)).run();
|
|
508
|
+
await binder.bind({ objects: objects.map((object) => Ref.make(object)) });
|
|
509
|
+
},
|
|
364
510
|
}),
|
|
365
511
|
args: {
|
|
366
|
-
|
|
512
|
+
deckComponents: [[ChatContainer], ['surfaces']],
|
|
513
|
+
blueprints: [BLUEPRINT_KEY, 'dxos.org/blueprint/transcription'],
|
|
367
514
|
},
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
export const WithLinearSync: Story = {
|
|
518
|
+
decorators: getDecorators({
|
|
519
|
+
plugins: [],
|
|
520
|
+
config: config.remote,
|
|
521
|
+
types: [DataType.Task, DataType.Person, DataType.Project],
|
|
522
|
+
accessTokens: accessTokensFromEnv({
|
|
523
|
+
'linear.app': import.meta.env.VITE_LINEAR_API_KEY,
|
|
524
|
+
}),
|
|
525
|
+
}),
|
|
526
|
+
args: {
|
|
527
|
+
deckComponents: [[ChatContainer], [GraphContainer]],
|
|
528
|
+
blueprints: [LINEAR_BLUEPRINT.key],
|
|
529
|
+
},
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
export const WithTriggers: Story = {
|
|
533
|
+
decorators: getDecorators({
|
|
534
|
+
plugins: [],
|
|
535
|
+
config: config.remote,
|
|
536
|
+
onInit: async ({ space }) => {
|
|
537
|
+
space.db.add(
|
|
538
|
+
Obj.make(FunctionTrigger, {
|
|
539
|
+
function: Ref.make(serializeFunction(exampleFunctions.reply)),
|
|
540
|
+
enabled: true,
|
|
541
|
+
spec: {
|
|
542
|
+
kind: 'timer',
|
|
543
|
+
cron: '*/5 * * * * *', // Every 5 seconds
|
|
544
|
+
},
|
|
545
|
+
}),
|
|
546
|
+
);
|
|
547
|
+
},
|
|
548
|
+
}),
|
|
549
|
+
args: {
|
|
550
|
+
deckComponents: [[ChatContainer], [TriggersContainer, InvocationsContainer]],
|
|
551
|
+
blueprints: [],
|
|
552
|
+
},
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
export const WithChessTrigger: Story = {
|
|
556
|
+
decorators: getDecorators({
|
|
557
|
+
plugins: [ChessPlugin()],
|
|
558
|
+
config: config.remote,
|
|
559
|
+
types: [Chess.Game],
|
|
560
|
+
onInit: async ({ space }) => {
|
|
561
|
+
// TODO(burdon): Add player DID (for user and assistant).
|
|
562
|
+
space.db.add(
|
|
563
|
+
Chess.makeGame({
|
|
564
|
+
name: 'Challenge',
|
|
565
|
+
pgn: [
|
|
566
|
+
'1. e4 e5',
|
|
567
|
+
'2. Nf3 Nc6',
|
|
568
|
+
'3. Bc4 Bc5',
|
|
569
|
+
'4. c3 Nf6',
|
|
570
|
+
'5. d4 exd4',
|
|
571
|
+
'6. cxd4 Bb4+',
|
|
572
|
+
'7. Nc3 d5',
|
|
573
|
+
'8. exd5 Nxd5',
|
|
574
|
+
'9. O-O Be6',
|
|
575
|
+
'10. Qb3 Na5',
|
|
576
|
+
'11. Qa4+ c6',
|
|
577
|
+
'12. Bxd5 Bxc3',
|
|
578
|
+
'13. Bxe6 fxe6',
|
|
579
|
+
'*',
|
|
580
|
+
].join(' '),
|
|
581
|
+
}),
|
|
582
|
+
);
|
|
583
|
+
|
|
584
|
+
space.db.add(
|
|
585
|
+
Obj.make(FunctionTrigger, {
|
|
586
|
+
function: Ref.make(serializeFunction(chessFunctions.play)),
|
|
587
|
+
enabled: true,
|
|
588
|
+
spec: {
|
|
589
|
+
kind: 'subscription',
|
|
590
|
+
query: Query.select(Filter.type(Chess.Game)).ast,
|
|
591
|
+
},
|
|
592
|
+
input: {
|
|
593
|
+
id: '{{event.changedObjectId}}',
|
|
594
|
+
side: 'black', // NOTE: Removing it makes the bot play itself.
|
|
595
|
+
},
|
|
596
|
+
}),
|
|
597
|
+
);
|
|
598
|
+
},
|
|
599
|
+
}),
|
|
600
|
+
args: {
|
|
601
|
+
deckComponents: [[ChessContainer], [TriggersContainer, InvocationsContainer]],
|
|
602
|
+
blueprints: [],
|
|
603
|
+
},
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
export const WithResearchQueue: Story = {
|
|
607
|
+
decorators: getDecorators({
|
|
608
|
+
plugins: [],
|
|
609
|
+
config: config.local,
|
|
610
|
+
types: [...ResearchDataTypes, ResearchGraph, ResearchInputQueue],
|
|
611
|
+
accessTokens: [Obj.make(DataType.AccessToken, { source: 'exa.ai', token: EXA_API_KEY })],
|
|
612
|
+
onInit: async ({ space }) => {
|
|
613
|
+
const researchInputQueue = space.db.add(
|
|
614
|
+
Obj.make(ResearchInputQueue, { queue: Ref.fromDXN(space.queues.create().dxn) }),
|
|
615
|
+
);
|
|
616
|
+
const orgs = organizations.map(({ id: _, ...org }) => Obj.make(DataType.Organization, org));
|
|
617
|
+
await researchInputQueue.queue.target!.append(orgs);
|
|
618
|
+
|
|
619
|
+
const researchPrompt = space.db.add(
|
|
620
|
+
Prompt.make({
|
|
621
|
+
name: 'Research',
|
|
622
|
+
description: 'Research organization',
|
|
623
|
+
input: Schema.Struct({
|
|
624
|
+
org: Schema.Any,
|
|
625
|
+
}),
|
|
626
|
+
output: Schema.Any,
|
|
627
|
+
|
|
628
|
+
instructions: 'Research the organization provided as input.',
|
|
629
|
+
blueprints: [Ref.make(RESEARCH_BLUEPRINT)],
|
|
630
|
+
}),
|
|
631
|
+
);
|
|
632
|
+
|
|
633
|
+
space.db.add(
|
|
634
|
+
Obj.make(FunctionTrigger, {
|
|
635
|
+
function: Ref.make(serializeFunction(agent)),
|
|
636
|
+
enabled: true,
|
|
637
|
+
spec: {
|
|
638
|
+
kind: 'queue',
|
|
639
|
+
queue: researchInputQueue.queue.dxn.toString(),
|
|
640
|
+
},
|
|
641
|
+
input: {
|
|
642
|
+
prompt: Ref.make(researchPrompt),
|
|
643
|
+
input: '{{event.item}}',
|
|
644
|
+
},
|
|
645
|
+
}),
|
|
646
|
+
);
|
|
647
|
+
},
|
|
648
|
+
}),
|
|
649
|
+
args: {
|
|
650
|
+
deckComponents: [
|
|
651
|
+
[ResearchInputStack],
|
|
652
|
+
[TriggersContainer, PromptContainer, InvocationsContainer, LoggingContainer, GraphContainer],
|
|
653
|
+
[ResearchOutputStack],
|
|
654
|
+
],
|
|
655
|
+
blueprints: [RESEARCH_BLUEPRINT.key],
|
|
656
|
+
},
|
|
657
|
+
};
|