@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.e098934
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-DOVN34C7.mjs +126 -0
- package/dist/lib/browser/ChatCompanion-DOVN34C7.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs → ChatContainer-XIVJTCC2.mjs} +34 -13
- package/dist/lib/browser/ChatContainer-XIVJTCC2.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs → ChatDialog-EJJMK3WL.mjs} +28 -12
- package/dist/lib/browser/ChatDialog-EJJMK3WL.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-C4Q2RYQM.mjs +1974 -0
- package/dist/lib/browser/chunk-C4Q2RYQM.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-PQI3MGDN.mjs +169 -0
- package/dist/lib/browser/chunk-PQI3MGDN.mjs.map +7 -0
- package/dist/lib/browser/chunk-QD4UUISH.mjs +299 -0
- package/dist/lib/browser/chunk-QD4UUISH.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 +167 -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-E4NAGB6R.mjs +109 -0
- package/dist/lib/browser/react-surface-E4NAGB6R.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-MPUS3U64.mjs +191 -0
- package/dist/lib/browser/toolkit-MPUS3U64.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-ICWYVPRD.mjs +127 -0
- package/dist/lib/node-esm/ChatCompanion-ICWYVPRD.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs → ChatContainer-LMMMQD4K.mjs} +34 -13
- package/dist/lib/node-esm/ChatContainer-LMMMQD4K.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs → ChatDialog-UUE3F7BT.mjs} +28 -12
- package/dist/lib/node-esm/ChatDialog-UUE3F7BT.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-V44ZG7CU.mjs +1975 -0
- package/dist/lib/node-esm/chunk-V44ZG7CU.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-XD4CDA4R.mjs +20 -0
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YU62ZWJN.mjs +300 -0
- package/dist/lib/node-esm/chunk-YU62ZWJN.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 +167 -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-5WQLRTCH.mjs +110 -0
- package/dist/lib/node-esm/react-surface-5WQLRTCH.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-PKVYDZ4H.mjs +192 -0
- package/dist/lib/node-esm/toolkit-PKVYDZ4H.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 +83 -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,58 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
6
|
+
import { templates } from '@dxos/assistant';
|
|
7
|
+
import {
|
|
8
|
+
DISCORD_BLUEPRINT,
|
|
9
|
+
LINEAR_BLUEPRINT,
|
|
10
|
+
RESEARCH_BLUEPRINT,
|
|
11
|
+
fetchDiscordMessages,
|
|
12
|
+
research,
|
|
13
|
+
syncLinearIssues,
|
|
14
|
+
} from '@dxos/assistant-testing';
|
|
15
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
16
|
+
import { type FunctionDefinition } from '@dxos/functions';
|
|
17
|
+
|
|
18
|
+
import { analysis, list, load } from '../functions';
|
|
19
|
+
|
|
20
|
+
const functions: FunctionDefinition[] = [analysis, list, load];
|
|
21
|
+
const tools = [
|
|
22
|
+
'add-to-context',
|
|
23
|
+
// TODO(wittjosiah): Factor out to an ECHO blueprint.
|
|
24
|
+
'get-schemas',
|
|
25
|
+
'add-schema',
|
|
26
|
+
'create-record',
|
|
27
|
+
// TODO(wittjosiah): Factor out to a generic app-framework blueprint.
|
|
28
|
+
'open-item',
|
|
29
|
+
// TODO(burdon): Anthropic only.
|
|
30
|
+
// https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool#example-str-replace-command
|
|
31
|
+
// AI_TOOL_NOT_FOUND: str_replace_based_edit_tool
|
|
32
|
+
// 'str_replace_based_edit_tool',
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export const BLUEPRINT_KEY = 'dxos.org/blueprint/assistant';
|
|
36
|
+
|
|
37
|
+
export const createBlueprint = (): Blueprint.Blueprint =>
|
|
38
|
+
Blueprint.make({
|
|
39
|
+
key: BLUEPRINT_KEY,
|
|
40
|
+
name: 'Assistant',
|
|
41
|
+
tools: Blueprint.toolDefinitions({ functions, tools }),
|
|
42
|
+
instructions: templates.system,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const blueprint = createBlueprint();
|
|
46
|
+
|
|
47
|
+
// TODO(dmaretskyi): Consider splitting into multiple modules.
|
|
48
|
+
export default (): Capability<any>[] => [
|
|
49
|
+
contributes(Capabilities.Functions, functions),
|
|
50
|
+
contributes(Capabilities.Functions, [research]),
|
|
51
|
+
contributes(Capabilities.BlueprintDefinition, blueprint),
|
|
52
|
+
contributes(Capabilities.BlueprintDefinition, RESEARCH_BLUEPRINT),
|
|
53
|
+
// TODO(burdon): Move out of assistant.
|
|
54
|
+
contributes(Capabilities.Functions, [syncLinearIssues]),
|
|
55
|
+
contributes(Capabilities.Functions, [fetchDiscordMessages]),
|
|
56
|
+
contributes(Capabilities.BlueprintDefinition, LINEAR_BLUEPRINT),
|
|
57
|
+
contributes(Capabilities.BlueprintDefinition, DISCORD_BLUEPRINT),
|
|
58
|
+
];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Layer, type ManagedRuntime } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { type AiService, type AiServiceRouter, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
|
|
8
|
+
import { defineCapability } from '@dxos/app-framework';
|
|
9
|
+
import type {
|
|
10
|
+
CredentialsService,
|
|
11
|
+
DatabaseService,
|
|
12
|
+
FunctionImplementationResolver,
|
|
13
|
+
InvocationTracer,
|
|
14
|
+
LocalFunctionExecutionService,
|
|
15
|
+
QueueService,
|
|
16
|
+
RemoteFunctionExecutionService,
|
|
17
|
+
TriggerDispatcher,
|
|
18
|
+
TriggerStateStore,
|
|
19
|
+
} from '@dxos/functions';
|
|
20
|
+
import type { SpaceId } from '@dxos/keys';
|
|
21
|
+
import { type DeepReadonly } from '@dxos/util';
|
|
22
|
+
|
|
23
|
+
import { meta } from '../meta';
|
|
24
|
+
import { type Assistant } from '../types';
|
|
25
|
+
|
|
26
|
+
export namespace AssistantCapabilities {
|
|
27
|
+
export type AssistantState = {
|
|
28
|
+
/** Map of primary object fq id to current chat. */
|
|
29
|
+
currentChat: Record<string, Assistant.Chat>;
|
|
30
|
+
};
|
|
31
|
+
export const State = defineCapability<DeepReadonly<AssistantState>>(`${meta.id}/capability/state`);
|
|
32
|
+
export const MutableState = defineCapability<AssistantState>(`${meta.id}/capability/state`);
|
|
33
|
+
|
|
34
|
+
export type AiServiceLayer = Layer.Layer<AiService.AiService>;
|
|
35
|
+
export const AiServiceLayer = defineCapability<AiServiceLayer>(`${meta.id}/capability/ai-service-factory`);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Plugins can contribute them to provide model resolvers.
|
|
39
|
+
*/
|
|
40
|
+
export const AiModelResolver = defineCapability<Layer.Layer<AiServiceRouter.AiModelResolver>>(
|
|
41
|
+
`${meta.id}/capability/ai-model-resolver`,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Service stack for executing agents, functions, and triggers.
|
|
46
|
+
*/
|
|
47
|
+
export type ComputeServices =
|
|
48
|
+
| TriggerDispatcher
|
|
49
|
+
| AiService.AiService
|
|
50
|
+
| DatabaseService
|
|
51
|
+
| QueueService
|
|
52
|
+
| CredentialsService
|
|
53
|
+
| LocalFunctionExecutionService
|
|
54
|
+
| RemoteFunctionExecutionService
|
|
55
|
+
// TODO(dmaretskyi): This service is private and shouldn't be exposed as a part of public API.
|
|
56
|
+
| FunctionImplementationResolver
|
|
57
|
+
| InvocationTracer
|
|
58
|
+
| TriggerStateStore
|
|
59
|
+
// TODO(dmaretskyi): Those should be provided at AI-chat call site.
|
|
60
|
+
| ToolResolverService
|
|
61
|
+
| ToolExecutionService;
|
|
62
|
+
|
|
63
|
+
export interface ComputeRuntimeProvider {
|
|
64
|
+
getRuntime(spaceId: SpaceId): ManagedRuntime.ManagedRuntime<ComputeServices, never>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Runtime for executing agents, functions, and triggers.
|
|
69
|
+
*/
|
|
70
|
+
export const ComputeRuntime = defineCapability<ComputeRuntimeProvider>(`${meta.id}/capability/compute-runtime`);
|
|
71
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type AiTool, AiToolkit } from '@effect/ai';
|
|
6
|
+
import { BrowserKeyValueStore } from '@effect/platform-browser';
|
|
7
|
+
import { Effect, Layer, ManagedRuntime } from 'effect';
|
|
8
|
+
|
|
9
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
10
|
+
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
11
|
+
import { PropertiesType } from '@dxos/client/echo';
|
|
12
|
+
import { Resource } from '@dxos/context';
|
|
13
|
+
import { Query, Ref } from '@dxos/echo';
|
|
14
|
+
import {
|
|
15
|
+
CredentialsService,
|
|
16
|
+
DatabaseService,
|
|
17
|
+
FunctionImplementationResolver,
|
|
18
|
+
InvocationTracer,
|
|
19
|
+
LocalFunctionExecutionService,
|
|
20
|
+
QueueService,
|
|
21
|
+
RemoteFunctionExecutionService,
|
|
22
|
+
TriggerDispatcher,
|
|
23
|
+
} from '@dxos/functions';
|
|
24
|
+
import { TriggerStateStore } from '@dxos/functions';
|
|
25
|
+
import { invariant } from '@dxos/invariant';
|
|
26
|
+
import { type SpaceId } from '@dxos/keys';
|
|
27
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
28
|
+
|
|
29
|
+
import { AssistantCapabilities } from './capabilities';
|
|
30
|
+
|
|
31
|
+
export default async (context: PluginContext) => {
|
|
32
|
+
const provider = await new ComputeRuntimeProviderImpl(context).open();
|
|
33
|
+
return contributes(AssistantCapabilities.ComputeRuntime, provider, async () => {
|
|
34
|
+
await provider.close();
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
class ComputeRuntimeProviderImpl extends Resource implements AssistantCapabilities.ComputeRuntimeProvider {
|
|
39
|
+
readonly #runtimes = new Map<SpaceId, ManagedRuntime.ManagedRuntime<AssistantCapabilities.ComputeServices, never>>();
|
|
40
|
+
readonly #context: PluginContext;
|
|
41
|
+
|
|
42
|
+
constructor(context: PluginContext) {
|
|
43
|
+
super();
|
|
44
|
+
this.#context = context;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected override async _open() {}
|
|
48
|
+
|
|
49
|
+
protected override async _close() {
|
|
50
|
+
await Promise.all(Array.from(this.#runtimes.values()).map((rt) => rt.dispose()));
|
|
51
|
+
this.#runtimes.clear();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
getRuntime(spaceId: SpaceId): ManagedRuntime.ManagedRuntime<AssistantCapabilities.ComputeServices, never> {
|
|
55
|
+
if (this.#runtimes.has(spaceId)) {
|
|
56
|
+
return this.#runtimes.get(spaceId)!;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const layer = Layer.unwrapEffect(
|
|
60
|
+
Effect.gen(this, function* () {
|
|
61
|
+
const client = this.#context.getCapability(ClientCapabilities.Client);
|
|
62
|
+
const serviceLayer =
|
|
63
|
+
this.#context.getCapability(AssistantCapabilities.AiServiceLayer) ?? Layer.die('AiService not found');
|
|
64
|
+
|
|
65
|
+
// TODO(dmaretskyi): Make those reactive.
|
|
66
|
+
const functions = this.#context.getCapabilities(Capabilities.Functions);
|
|
67
|
+
const toolkits = this.#context.getCapabilities(Capabilities.Toolkit);
|
|
68
|
+
const handlers = this.#context.getCapabilities(Capabilities.ToolkitHandler);
|
|
69
|
+
|
|
70
|
+
const allFunctions = functions.flat();
|
|
71
|
+
// TODO(wittjosiah): Don't cast.
|
|
72
|
+
const toolkit = AiToolkit.merge(...toolkits) as AiToolkit.Any as AiToolkit.AiToolkit<AiTool.Any>;
|
|
73
|
+
const handlersLayer = Layer.mergeAll(Layer.empty, ...handlers);
|
|
74
|
+
|
|
75
|
+
const space = client.spaces.get(spaceId);
|
|
76
|
+
invariant(space);
|
|
77
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
78
|
+
|
|
79
|
+
return Layer.mergeAll(TriggerDispatcher.layer({ timeControl: 'natural' })).pipe(
|
|
80
|
+
Layer.provideMerge(
|
|
81
|
+
Layer.mergeAll(
|
|
82
|
+
IvocationTracerLive,
|
|
83
|
+
TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)),
|
|
84
|
+
serviceLayer,
|
|
85
|
+
makeToolResolverFromFunctions(allFunctions, toolkit),
|
|
86
|
+
makeToolExecutionServiceFromFunctions(allFunctions, toolkit, handlersLayer),
|
|
87
|
+
CredentialsService.layerFromDatabase(),
|
|
88
|
+
),
|
|
89
|
+
),
|
|
90
|
+
Layer.provideMerge(
|
|
91
|
+
Layer.mergeAll(
|
|
92
|
+
space ? DatabaseService.layer(space.db) : DatabaseService.notAvailable,
|
|
93
|
+
space ? QueueService.layer(space.queues) : QueueService.notAvailable,
|
|
94
|
+
LocalFunctionExecutionService.layerLive,
|
|
95
|
+
RemoteFunctionExecutionService.mockLayer,
|
|
96
|
+
),
|
|
97
|
+
),
|
|
98
|
+
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions: allFunctions })),
|
|
99
|
+
);
|
|
100
|
+
}),
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const runtime = ManagedRuntime.make(layer);
|
|
104
|
+
this.#runtimes.set(spaceId, runtime);
|
|
105
|
+
|
|
106
|
+
return runtime;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const IvocationTracerLive = Layer.unwrapEffect(
|
|
111
|
+
Effect.gen(function* () {
|
|
112
|
+
const {
|
|
113
|
+
objects: [properties],
|
|
114
|
+
} = yield* DatabaseService.runQuery(Query.type(PropertiesType));
|
|
115
|
+
invariant(properties);
|
|
116
|
+
if (!properties.invocationTraceQueue) {
|
|
117
|
+
const queue = yield* QueueService.createQueue({ subspaceTag: 'trace' });
|
|
118
|
+
properties.invocationTraceQueue = Ref.fromDXN(queue.dxn);
|
|
119
|
+
}
|
|
120
|
+
const queue = properties.invocationTraceQueue.target;
|
|
121
|
+
invariant(queue);
|
|
122
|
+
return InvocationTracer.layerLive({ invocationTraceQueue: queue });
|
|
123
|
+
}),
|
|
124
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
|
|
6
|
+
import { FetchHttpClient } from '@effect/platform';
|
|
7
|
+
import { Layer } from 'effect';
|
|
8
|
+
|
|
9
|
+
import { AiServiceRouter } from '@dxos/ai';
|
|
10
|
+
import { type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
+
|
|
12
|
+
import { AssistantCapabilities } from './capabilities';
|
|
13
|
+
|
|
14
|
+
export default (): Capability<any>[] => [
|
|
15
|
+
contributes(
|
|
16
|
+
AssistantCapabilities.AiModelResolver,
|
|
17
|
+
AiServiceRouter.AnthropicResolver.pipe(
|
|
18
|
+
Layer.provide(
|
|
19
|
+
AnthropicClient.layer({
|
|
20
|
+
// TODO(dmaretskyi): Read endpoint from config/settings.
|
|
21
|
+
apiUrl: 'https://ai-service.dxos.workers.dev/provider/anthropic',
|
|
22
|
+
}),
|
|
23
|
+
),
|
|
24
|
+
Layer.provide(FetchHttpClient.layer),
|
|
25
|
+
),
|
|
26
|
+
),
|
|
27
|
+
];
|
|
@@ -4,7 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
+
export const AiService = lazy(() => import('./ai-service'));
|
|
7
8
|
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
9
|
+
export const AssistantState = lazy(() => import('./state'));
|
|
10
|
+
export const BlueprintDefinition = lazy(() => import('./blueprint-definition'));
|
|
11
|
+
export const EdgeModelResolver = lazy(() => import('./edge-model-resolver'));
|
|
8
12
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
13
|
+
export const LocalModelResolver = lazy(() => import('./local-model-resolver'));
|
|
9
14
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
10
15
|
export const Settings = lazy(() => import('./settings'));
|
|
16
|
+
export const Toolkit = lazy(() => import('./toolkit'));
|
|
17
|
+
export const ComputeRuntime = lazy(() => import('./compute-runtime'));
|
|
18
|
+
|
|
19
|
+
export * from './blueprint-definition';
|
|
20
|
+
export * from './capabilities';
|
|
@@ -4,42 +4,70 @@
|
|
|
4
4
|
|
|
5
5
|
import { Effect } from 'effect';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createIntent, createResolver
|
|
7
|
+
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
+
import { AiContextBinder } from '@dxos/assistant';
|
|
9
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
10
|
+
import { fullyQualifiedId } from '@dxos/client/echo';
|
|
8
11
|
import { Sequence } from '@dxos/conductor';
|
|
9
|
-
import { Key, Obj, Ref } from '@dxos/echo';
|
|
12
|
+
import { Filter, Key, Obj, Ref } from '@dxos/echo';
|
|
10
13
|
import { CollectionAction } from '@dxos/plugin-space/types';
|
|
11
14
|
|
|
12
|
-
import { Assistant } from '../types';
|
|
15
|
+
import { Assistant, AssistantAction } from '../types';
|
|
16
|
+
|
|
17
|
+
import { BLUEPRINT_KEY, createBlueprint } from './blueprint-definition';
|
|
18
|
+
import { AssistantCapabilities } from './capabilities';
|
|
13
19
|
|
|
14
20
|
export default (context: PluginContext) => [
|
|
15
21
|
contributes(Capabilities.IntentResolver, [
|
|
16
22
|
createResolver({
|
|
17
|
-
intent:
|
|
23
|
+
intent: AssistantAction.OnSpaceCreated,
|
|
18
24
|
resolve: ({ space, rootCollection }) =>
|
|
19
25
|
Effect.gen(function* () {
|
|
20
26
|
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
21
|
-
const { object:
|
|
27
|
+
const { object: chatCollection } = yield* dispatch(
|
|
22
28
|
createIntent(CollectionAction.CreateQueryCollection, { typename: Assistant.Chat.typename }),
|
|
23
29
|
);
|
|
24
|
-
|
|
30
|
+
const { object: blueprintCollection } = yield* dispatch(
|
|
31
|
+
createIntent(CollectionAction.CreateQueryCollection, { typename: Blueprint.Blueprint.typename }),
|
|
32
|
+
);
|
|
33
|
+
rootCollection.objects.push(Ref.make(chatCollection), Ref.make(blueprintCollection));
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
// Create default chat.
|
|
36
|
+
const { object: chat } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
27
37
|
space.db.add(chat);
|
|
28
38
|
}),
|
|
29
39
|
}),
|
|
30
40
|
createResolver({
|
|
31
|
-
intent:
|
|
32
|
-
resolve: ({ space, name }) =>
|
|
41
|
+
intent: AssistantAction.CreateChat,
|
|
42
|
+
resolve: async ({ space, name }) => {
|
|
43
|
+
const queue = space.queues.create();
|
|
44
|
+
const chat = Obj.make(Assistant.Chat, { name, queue: Ref.fromDXN(queue.dxn) });
|
|
45
|
+
const { objects: blueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
46
|
+
// TODO(wittjosiah): This should be a space-level setting.
|
|
47
|
+
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
48
|
+
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === BLUEPRINT_KEY);
|
|
49
|
+
if (!defaultBlueprint) {
|
|
50
|
+
defaultBlueprint = space.db.add(createBlueprint());
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const binder = new AiContextBinder(queue);
|
|
54
|
+
await binder.bind({ blueprints: [Ref.make(defaultBlueprint)] });
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
data: { object: chat },
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
createResolver({
|
|
62
|
+
intent: AssistantAction.CreateBlueprint,
|
|
63
|
+
resolve: ({ key, name, description }) => ({
|
|
33
64
|
data: {
|
|
34
|
-
object:
|
|
35
|
-
name,
|
|
36
|
-
queue: Ref.fromDXN(space.queues.create().dxn),
|
|
37
|
-
}),
|
|
65
|
+
object: Blueprint.make({ key, name, description, instructions: Template.make({ source: '' }) }),
|
|
38
66
|
},
|
|
39
67
|
}),
|
|
40
68
|
}),
|
|
41
69
|
createResolver({
|
|
42
|
-
intent:
|
|
70
|
+
intent: AssistantAction.CreateSequence,
|
|
43
71
|
resolve: ({ name }) => ({
|
|
44
72
|
data: {
|
|
45
73
|
object: Obj.make(Sequence, {
|
|
@@ -54,5 +82,13 @@ export default (context: PluginContext) => [
|
|
|
54
82
|
},
|
|
55
83
|
}),
|
|
56
84
|
}),
|
|
85
|
+
createResolver({
|
|
86
|
+
intent: AssistantAction.SetCurrentChat,
|
|
87
|
+
resolve: ({ companionTo, chat }) =>
|
|
88
|
+
Effect.gen(function* () {
|
|
89
|
+
const state = context.getCapability(AssistantCapabilities.MutableState);
|
|
90
|
+
state.currentChat[fullyQualifiedId(companionTo)] = chat;
|
|
91
|
+
}),
|
|
92
|
+
}),
|
|
57
93
|
]),
|
|
58
94
|
];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OpenAiClient } from '@effect/ai-openai';
|
|
6
|
+
import { FetchHttpClient } from '@effect/platform';
|
|
7
|
+
import { Layer } from 'effect';
|
|
8
|
+
|
|
9
|
+
import { AiServiceRouter } from '@dxos/ai';
|
|
10
|
+
import { type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
+
|
|
12
|
+
import { AssistantCapabilities } from './capabilities';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* To start LM Studio server:
|
|
16
|
+
* ```bash
|
|
17
|
+
* ~/.lmstudio/bin/lms server start --cors
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export default (): Capability<any>[] => [
|
|
21
|
+
contributes(
|
|
22
|
+
AssistantCapabilities.AiModelResolver,
|
|
23
|
+
AiServiceRouter.LMStudioResolver.pipe(
|
|
24
|
+
Layer.provide(
|
|
25
|
+
OpenAiClient.layer({
|
|
26
|
+
apiUrl: AiServiceRouter.LMSTUDIO_ENDPOINT,
|
|
27
|
+
}),
|
|
28
|
+
),
|
|
29
|
+
Layer.provide(FetchHttpClient.layer),
|
|
30
|
+
),
|
|
31
|
+
),
|
|
32
|
+
];
|
|
@@ -2,28 +2,27 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import React, { useEffect, useMemo } from 'react';
|
|
5
|
+
import React from 'react';
|
|
7
6
|
|
|
8
|
-
import { Capabilities, contributes,
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
9
|
+
import { getSpace } from '@dxos/client/echo';
|
|
11
10
|
import { Sequence } from '@dxos/conductor';
|
|
12
11
|
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
13
|
-
import {
|
|
12
|
+
import { Obj } from '@dxos/echo';
|
|
14
13
|
import { SettingsStore } from '@dxos/local-storage';
|
|
15
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
16
14
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
17
15
|
|
|
18
16
|
import {
|
|
19
17
|
AssistantSettings,
|
|
18
|
+
BlueprintContainer,
|
|
19
|
+
ChatCompanion,
|
|
20
20
|
ChatContainer,
|
|
21
21
|
ChatDialog,
|
|
22
22
|
PromptSettings,
|
|
23
23
|
SequenceContainer,
|
|
24
|
-
TemplateContainer,
|
|
25
24
|
} from '../components';
|
|
26
|
-
import {
|
|
25
|
+
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
27
26
|
import { Assistant } from '../types';
|
|
28
27
|
|
|
29
28
|
export default () =>
|
|
@@ -43,59 +42,12 @@ export default () =>
|
|
|
43
42
|
component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
|
|
44
43
|
}),
|
|
45
44
|
createSurface({
|
|
46
|
-
id: `${meta.id}/
|
|
45
|
+
id: `${meta.id}/companion-chat`,
|
|
47
46
|
role: 'article',
|
|
48
47
|
filter: (data): data is { companionTo: Obj.Any; subject: Assistant.Chat | 'assistant-chat' } =>
|
|
49
48
|
Obj.isObject(data.companionTo) &&
|
|
50
49
|
(Obj.instanceOf(Assistant.Chat, data.subject) || data.subject === 'assistant-chat'),
|
|
51
|
-
component: ({ data, role }) => {
|
|
52
|
-
const { dispatch } = useIntentDispatcher();
|
|
53
|
-
const associatedArtifact = useMemo(
|
|
54
|
-
() => ({
|
|
55
|
-
id: fullyQualifiedId(data.companionTo),
|
|
56
|
-
typename: getTypename(data.companionTo) ?? 'unknown',
|
|
57
|
-
spaceId: (getSpace(data.companionTo)?.id ?? 'unknown') as Key.SpaceId,
|
|
58
|
-
}),
|
|
59
|
-
[data.companionTo],
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
// TODO(wittjosiah): Factor out to container.
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
const timeout = setTimeout(async () => {
|
|
65
|
-
const space = getSpace(data.companionTo);
|
|
66
|
-
if (space && data.subject === 'assistant-chat') {
|
|
67
|
-
const result = await space.db
|
|
68
|
-
.query(Query.select(Filter.ids(data.companionTo.id)).targetOf(Assistant.CompanionTo).source())
|
|
69
|
-
.run();
|
|
70
|
-
if (result.objects.length > 0) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const program = Effect.gen(function* () {
|
|
75
|
-
const { object } = yield* dispatch(createIntent(Assistant.CreateChat, { space }));
|
|
76
|
-
yield* dispatch(createIntent(SpaceAction.AddObject, { object, target: space, hidden: true }));
|
|
77
|
-
yield* dispatch(
|
|
78
|
-
createIntent(SpaceAction.AddRelation, {
|
|
79
|
-
space,
|
|
80
|
-
schema: Assistant.CompanionTo,
|
|
81
|
-
source: object,
|
|
82
|
-
target: data.companionTo,
|
|
83
|
-
}),
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
void Effect.runPromise(program);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
return () => clearTimeout(timeout);
|
|
91
|
-
}, [data.subject]);
|
|
92
|
-
|
|
93
|
-
if (data.subject === 'assistant-chat') {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return <ChatContainer role={role} chat={data.subject} artifact={associatedArtifact} />;
|
|
98
|
-
},
|
|
50
|
+
component: ({ data, role }) => <ChatCompanion role={role} data={data} />,
|
|
99
51
|
}),
|
|
100
52
|
createSurface({
|
|
101
53
|
id: `${meta.id}/sequence`,
|
|
@@ -104,10 +56,11 @@ export default () =>
|
|
|
104
56
|
component: ({ data }) => <SequenceContainer sequence={data.subject} />,
|
|
105
57
|
}),
|
|
106
58
|
createSurface({
|
|
107
|
-
id: `${meta.id}/companion
|
|
59
|
+
id: `${meta.id}/companion-logs`,
|
|
108
60
|
role: 'article',
|
|
109
61
|
filter: (data): data is { companionTo: Sequence } =>
|
|
110
62
|
Obj.instanceOf(Sequence, data.companionTo) && data.subject === 'logs',
|
|
63
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
111
64
|
component: ({ data, role }) => {
|
|
112
65
|
const space = getSpace(data.companionTo);
|
|
113
66
|
return (
|
|
@@ -118,16 +71,16 @@ export default () =>
|
|
|
118
71
|
},
|
|
119
72
|
}),
|
|
120
73
|
createSurface({
|
|
121
|
-
id: `${meta.id}/
|
|
74
|
+
id: `${meta.id}/blueprint`,
|
|
122
75
|
role: 'article',
|
|
123
|
-
filter: (data): data is { subject:
|
|
124
|
-
component: ({ data }) => <
|
|
76
|
+
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
77
|
+
component: ({ data }) => <BlueprintContainer blueprint={data.subject} />,
|
|
125
78
|
}),
|
|
126
79
|
createSurface({
|
|
127
80
|
id: `${meta.id}/prompt-settings`,
|
|
128
81
|
role: 'object-settings',
|
|
129
|
-
filter: (data): data is { subject:
|
|
130
|
-
component: ({ data }) => <PromptSettings template={data.subject} />,
|
|
82
|
+
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
83
|
+
component: ({ data }) => <PromptSettings template={data.subject.instructions} />,
|
|
131
84
|
}),
|
|
132
85
|
createSurface({
|
|
133
86
|
id: ASSISTANT_DIALOG,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { contributes } from '@dxos/app-framework';
|
|
6
|
+
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
|
+
|
|
8
|
+
import { meta } from '../meta';
|
|
9
|
+
|
|
10
|
+
import { AssistantCapabilities } from './capabilities';
|
|
11
|
+
|
|
12
|
+
export default () => {
|
|
13
|
+
// NOTE: This needs to be a chat object rather than a string id to avoid a query race.
|
|
14
|
+
// TODO(wittjosiah): Handle serialization and hydration for this so it can be cached.
|
|
15
|
+
const state = new LocalStorageStore<AssistantCapabilities.AssistantState>(meta.id, {
|
|
16
|
+
currentChat: {},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return contributes(AssistantCapabilities.State, state.values, () => state.close());
|
|
20
|
+
};
|