@dxos/plugin-assistant 0.8.4-main.67995b8 → 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/{BlueprintContainer-IZ4AK5EO.mjs → BlueprintContainer-BFNN6K46.mjs} +4 -3
- package/dist/lib/browser/ChatCompanion-YYYCHZYV.mjs +126 -0
- package/dist/lib/browser/ChatCompanion-YYYCHZYV.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-RP3QEXYX.mjs → ChatContainer-G6YHR6GJ.mjs} +34 -13
- package/dist/lib/browser/ChatContainer-G6YHR6GJ.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-ZVLXFHEY.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-XSEOKJLG.mjs → app-graph-builder-3C43MLCD.mjs} +25 -36
- 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 +148 -62
- 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-3GYEHQRP.mjs → react-surface-WNLA2636.mjs} +25 -66
- package/dist/lib/browser/react-surface-WNLA2636.mjs.map +7 -0
- package/dist/lib/browser/{settings-5GTTCVGD.mjs → settings-36V3VUMW.mjs} +6 -5
- package/dist/lib/{node-esm/settings-J2EXEM5H.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/{BlueprintContainer-RGTMNLNX.mjs → BlueprintContainer-X4MRBKDR.mjs} +4 -3
- package/dist/lib/{browser/BlueprintContainer-IZ4AK5EO.mjs.map → node-esm/BlueprintContainer-X4MRBKDR.mjs.map} +1 -1
- 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-W3W6FWV3.mjs → ChatContainer-EZZF7RSQ.mjs} +34 -13
- package/dist/lib/node-esm/ChatContainer-EZZF7RSQ.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-QW4JRKVO.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-PANCJUHV.mjs → app-graph-builder-NM3JDLQ2.mjs} +25 -36
- 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 +148 -62
- 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-QDQWJ7FZ.mjs → react-surface-GP3LU6DX.mjs} +25 -66
- package/dist/lib/node-esm/react-surface-GP3LU6DX.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-J2EXEM5H.mjs → settings-7ZCZ6AS5.mjs} +6 -5
- package/dist/lib/{browser/settings-5GTTCVGD.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/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 -32
- 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 +0 -5
- 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.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 +4 -1
- 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 +25 -202
- 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 +28 -12
- 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 +108 -86
- package/src/AssistantPlugin.tsx +61 -17
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +41 -48
- 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 +45 -23
- package/src/capabilities/local-model-resolver.ts +32 -0
- package/src/capabilities/react-surface.tsx +10 -57
- 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/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 +25 -12
- package/src/components/TemplateEditor/TemplateEditor.tsx +14 -47
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +12 -5
- package/src/components/TemplateEditor/TemplateForm.tsx +3 -1
- 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 +3 -4
- 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 +29 -48
- 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 -308
- 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 +31 -12
- 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-RP3QEXYX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ZVLXFHEY.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs.map +0 -7
- package/dist/lib/browser/chunk-63GG6U6D.mjs +0 -2226
- package/dist/lib/browser/chunk-63GG6U6D.mjs.map +0 -7
- package/dist/lib/browser/chunk-7W7LHTRH.mjs +0 -171
- package/dist/lib/browser/chunk-7W7LHTRH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-KFXSBNZR.mjs +0 -89
- package/dist/lib/browser/chunk-KFXSBNZR.mjs.map +0 -7
- package/dist/lib/browser/chunk-LERGF5YG.mjs +0 -108
- package/dist/lib/browser/chunk-LERGF5YG.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs +0 -75
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3GYEHQRP.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-W3W6FWV3.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QW4JRKVO.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs +0 -2227
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs +0 -109
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs +0 -90
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs +0 -172
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs +0 -76
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs.map +0 -7
- package/dist/types/src/capability-definitions.d.ts +0 -7
- package/dist/types/src/capability-definitions.d.ts.map +0 -1
- 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/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 -120
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capability-definitions.ts +0 -15
- 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/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 -108
- package/src/typings.d.ts +0 -9
- /package/dist/lib/{node-esm/BlueprintContainer-RGTMNLNX.mjs.map → browser/BlueprintContainer-BFNN6K46.mjs.map} +0 -0
|
@@ -2,142 +2,65 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { RegistryContext } from '@effect-rx/rx-react';
|
|
6
|
+
import { type Runtime } from 'effect';
|
|
7
|
+
import { useContext, useMemo } from 'react';
|
|
7
8
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Conversation, createSystemPrompt } from '@dxos/assistant';
|
|
11
|
-
import { type ArtifactDefinition, type AssociatedArtifact, type Blueprint } from '@dxos/blueprints';
|
|
12
|
-
import { FunctionType } from '@dxos/functions';
|
|
9
|
+
import { AiConversation } from '@dxos/assistant';
|
|
10
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
13
11
|
import { log } from '@dxos/log';
|
|
14
|
-
import {
|
|
15
|
-
import { Filter, fullyQualifiedId, type Queue, type Space, useQuery } from '@dxos/react-client/echo';
|
|
16
|
-
import { isNonNullable } from '@dxos/util';
|
|
12
|
+
import { type Queue } from '@dxos/react-client/echo';
|
|
17
13
|
|
|
18
|
-
import { type
|
|
19
|
-
import {
|
|
20
|
-
import { type Assistant, ServiceType } from '../types';
|
|
14
|
+
import { AiChatProcessor, type AiChatServices, type AiServicePreset } from '../processor';
|
|
15
|
+
import { type Assistant } from '../types';
|
|
21
16
|
|
|
22
|
-
type UseChatProcessorProps = {
|
|
23
|
-
preset?: AiServicePreset;
|
|
24
|
-
space?: Space;
|
|
17
|
+
export type UseChatProcessorProps = {
|
|
25
18
|
chat?: Assistant.Chat;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
services?: Layer.Layer<ChatServices>;
|
|
19
|
+
preset?: AiServicePreset;
|
|
20
|
+
services?: () => Promise<Runtime.Runtime<AiChatServices>>;
|
|
29
21
|
blueprintRegistry?: Blueprint.Registry;
|
|
30
|
-
// TODO(burdon): Not currently used.
|
|
31
22
|
settings?: Assistant.Settings;
|
|
32
|
-
|
|
33
|
-
/** @deprecated */
|
|
34
|
-
instructions?: string;
|
|
35
|
-
/** @deprecated */
|
|
36
|
-
artifact?: AssociatedArtifact;
|
|
37
|
-
/** @deprecated */
|
|
38
|
-
noPluginArtifacts?: boolean;
|
|
39
23
|
};
|
|
40
24
|
|
|
41
25
|
/**
|
|
42
|
-
* Configure and create
|
|
26
|
+
* Configure and create AiChatProcessor.
|
|
43
27
|
*/
|
|
44
28
|
export const useChatProcessor = ({
|
|
45
|
-
preset,
|
|
46
|
-
space,
|
|
47
29
|
chat,
|
|
30
|
+
preset,
|
|
48
31
|
services,
|
|
49
32
|
blueprintRegistry,
|
|
50
33
|
settings,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
noPluginArtifacts,
|
|
54
|
-
}: UseChatProcessorProps): ChatProcessor | undefined => {
|
|
55
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
56
|
-
const globalTools = useCapabilities(Capabilities.Tools);
|
|
57
|
-
|
|
58
|
-
// TODO(burdon): Spec artifacts.
|
|
59
|
-
let artifacts: readonly ArtifactDefinition[] = useCapabilities(Capabilities.ArtifactDefinition);
|
|
60
|
-
if (noPluginArtifacts) {
|
|
61
|
-
artifacts = Stable.array;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Services.
|
|
65
|
-
const remoteServices = useQuery(space, Filter.type(ServiceType));
|
|
66
|
-
const [serviceTools, setServiceTools] = useState<ExecutableTool[]>([]);
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
log('creating service tools...');
|
|
69
|
-
queueMicrotask(async () => {
|
|
70
|
-
const tools = await Promise.all(remoteServices.map((service) => createToolsFromService(service)));
|
|
71
|
-
setServiceTools(tools.flat());
|
|
72
|
-
});
|
|
73
|
-
}, [remoteServices]);
|
|
74
|
-
|
|
75
|
-
// Tools and context.
|
|
76
|
-
const config = useConfig();
|
|
77
|
-
const functions = useQuery(space, Filter.type(FunctionType));
|
|
78
|
-
const chatId = useMemo(() => (chat ? fullyQualifiedId(chat) : undefined), [chat]);
|
|
79
|
-
const [tools, extensions] = useMemo(() => {
|
|
80
|
-
log('creating tools...');
|
|
81
|
-
const tools: ExecutableTool[] = [
|
|
82
|
-
...globalTools.flat(),
|
|
83
|
-
...serviceTools,
|
|
84
|
-
...functions
|
|
85
|
-
.map((fn) => convertFunctionToTool(fn, config.values.runtime?.services?.edge?.url ?? '', space?.id))
|
|
86
|
-
.filter(isNonNullable),
|
|
87
|
-
];
|
|
88
|
-
const extensions = { space, dispatch, pivotId: chatId };
|
|
89
|
-
return [tools, extensions];
|
|
90
|
-
}, [dispatch, globalTools, space, chatId, serviceTools, functions]);
|
|
91
|
-
|
|
92
|
-
// TODO(burdon): Create from template.
|
|
93
|
-
const systemPrompt = useMemo(
|
|
94
|
-
() =>
|
|
95
|
-
createSystemPrompt({
|
|
96
|
-
artifacts: artifacts.map((definition) => `${definition.name}\n${definition.instructions}`),
|
|
97
|
-
artifact,
|
|
98
|
-
instructions,
|
|
99
|
-
}),
|
|
100
|
-
[artifacts, artifact, instructions],
|
|
101
|
-
);
|
|
34
|
+
}: UseChatProcessorProps): AiChatProcessor | undefined => {
|
|
35
|
+
const observableRegistry = useContext(RegistryContext);
|
|
102
36
|
|
|
37
|
+
// Create conversation from chat queue.
|
|
103
38
|
const conversation = useMemo(() => {
|
|
104
39
|
if (!chat?.queue.target) {
|
|
105
40
|
return;
|
|
106
41
|
}
|
|
107
42
|
|
|
108
|
-
return new
|
|
43
|
+
return new AiConversation({ queue: chat.queue.target as Queue<any> });
|
|
109
44
|
}, [chat?.queue.target]);
|
|
110
45
|
|
|
111
46
|
// Create processor.
|
|
112
|
-
// TODO(burdon): Updated on each query update above; should just update current processor?
|
|
113
47
|
const processor = useMemo(() => {
|
|
114
48
|
if (!services || !conversation) {
|
|
115
49
|
return undefined;
|
|
116
50
|
}
|
|
117
51
|
|
|
118
|
-
log
|
|
52
|
+
log('creating processor', {
|
|
119
53
|
preset,
|
|
120
|
-
artifacts: artifacts.length,
|
|
121
|
-
systemPrompt: systemPrompt.length,
|
|
122
54
|
model: preset?.model,
|
|
123
55
|
settings,
|
|
124
56
|
});
|
|
125
57
|
|
|
126
|
-
return new
|
|
127
|
-
|
|
128
|
-
extensions,
|
|
58
|
+
return new AiChatProcessor(conversation, services, {
|
|
59
|
+
observableRegistry,
|
|
129
60
|
blueprintRegistry,
|
|
130
|
-
artifacts,
|
|
131
|
-
systemPrompt,
|
|
132
61
|
model: preset?.model,
|
|
133
62
|
});
|
|
134
|
-
}, [services, conversation,
|
|
63
|
+
}, [services, conversation, blueprintRegistry, preset]);
|
|
135
64
|
|
|
136
65
|
return processor;
|
|
137
66
|
};
|
|
138
|
-
|
|
139
|
-
// TODO(dmaretskyi): Extract.
|
|
140
|
-
export const Stable = Object.freeze({
|
|
141
|
-
array: [] as readonly never[],
|
|
142
|
-
object: {} as {},
|
|
143
|
-
});
|
|
@@ -2,66 +2,47 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Effect, type Runtime } from 'effect';
|
|
6
6
|
import { useMemo } from 'react';
|
|
7
|
-
import { useDeepCompareMemoize } from 'use-deep-compare-effect';
|
|
8
7
|
|
|
9
|
-
import {
|
|
10
|
-
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
11
|
-
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
8
|
+
import { useCapability } from '@dxos/app-framework';
|
|
12
9
|
import { type Space } from '@dxos/client/echo';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
CredentialsService,
|
|
16
|
-
DatabaseService,
|
|
17
|
-
LocalFunctionExecutionService,
|
|
18
|
-
QueueService,
|
|
19
|
-
RemoteFunctionExecutionService,
|
|
20
|
-
TracingService,
|
|
21
|
-
} from '@dxos/functions';
|
|
10
|
+
import { TracingService } from '@dxos/functions';
|
|
11
|
+
import { useClient } from '@dxos/react-client';
|
|
22
12
|
|
|
23
|
-
import { AssistantCapabilities } from '../
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// TODO(burdon): Deconstruct into separate layers?
|
|
28
|
-
export type ChatServices =
|
|
29
|
-
| AiService
|
|
30
|
-
| CredentialsService
|
|
31
|
-
| DatabaseService
|
|
32
|
-
| QueueService
|
|
33
|
-
| RemoteFunctionExecutionService
|
|
34
|
-
| ToolResolverService
|
|
35
|
-
| ToolExecutionService
|
|
36
|
-
| TracingService;
|
|
13
|
+
import { AssistantCapabilities } from '../capabilities';
|
|
14
|
+
import { type AiChatServices } from '../processor';
|
|
15
|
+
import { type Assistant } from '../types';
|
|
37
16
|
|
|
38
17
|
export type UseChatServicesProps = {
|
|
39
18
|
space?: Space;
|
|
19
|
+
chat?: Assistant.Chat;
|
|
40
20
|
};
|
|
41
21
|
|
|
42
22
|
/**
|
|
43
23
|
* Construct service layer.
|
|
44
24
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
// TODO(dmaretskyi): Better return type.
|
|
26
|
+
export const useChatServices = ({
|
|
27
|
+
space,
|
|
28
|
+
chat,
|
|
29
|
+
}: UseChatServicesProps): (() => Promise<Runtime.Runtime<AiChatServices>>) | undefined => {
|
|
30
|
+
const client = useClient();
|
|
31
|
+
space ??= client.spaces.default;
|
|
49
32
|
|
|
50
|
-
|
|
51
|
-
return Layer.mergeAll(
|
|
52
|
-
aiServiceLayer,
|
|
53
|
-
makeToolResolverFromFunctions(functions),
|
|
54
|
-
makeToolExecutionServiceFromFunctions(functions),
|
|
33
|
+
const computeRuntimeResolver = useCapability(AssistantCapabilities.ComputeRuntime);
|
|
55
34
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
35
|
+
return useMemo(() => {
|
|
36
|
+
const runtime = computeRuntimeResolver.getRuntime(space.id);
|
|
37
|
+
return () =>
|
|
38
|
+
runtime.runPromise(
|
|
39
|
+
Effect.gen(function* () {
|
|
40
|
+
return yield* Effect.runtime<AiChatServices>().pipe(
|
|
41
|
+
Effect.provide(
|
|
42
|
+
chat?.traceQueue?.target ? TracingService.layerQueue(chat.traceQueue?.target) : TracingService.layerNoop,
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
}),
|
|
46
|
+
);
|
|
47
|
+
}, [space, chat?.traceQueue?.target]);
|
|
67
48
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type { Effect } from 'effect';
|
|
6
|
+
import { useCallback } from 'react';
|
|
7
|
+
|
|
8
|
+
import { useCapability } from '@dxos/app-framework';
|
|
9
|
+
import type { Space } from '@dxos/client/echo';
|
|
10
|
+
|
|
11
|
+
import { AssistantCapabilities } from '../capabilities';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Create an effectful function that has access to compute services
|
|
15
|
+
*/
|
|
16
|
+
export const useComputeRuntimeCallback = <T>(
|
|
17
|
+
space: Space,
|
|
18
|
+
fn: () => Effect.Effect<T, any, AssistantCapabilities.ComputeServices>,
|
|
19
|
+
deps?: React.DependencyList,
|
|
20
|
+
): (() => Promise<T>) => {
|
|
21
|
+
const computeRuntime = useCapability(AssistantCapabilities.ComputeRuntime);
|
|
22
|
+
const runtime = computeRuntime.getRuntime(space.id);
|
|
23
|
+
|
|
24
|
+
return useCallback(() => runtime.runPromise(fn()), [runtime, ...(deps ?? [])]);
|
|
25
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { AiContextBinder } from '@dxos/assistant';
|
|
8
|
+
|
|
9
|
+
import { type Assistant } from '../types';
|
|
10
|
+
|
|
11
|
+
export const useContextBinder = (chat: Assistant.Chat | undefined): AiContextBinder | undefined => {
|
|
12
|
+
const binder = useMemo(() => {
|
|
13
|
+
const queue = chat?.queue.target;
|
|
14
|
+
return queue && new AiContextBinder(queue);
|
|
15
|
+
}, [chat]);
|
|
16
|
+
|
|
17
|
+
return binder;
|
|
18
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AiContextBinder } from '@dxos/assistant';
|
|
8
|
+
import { type DXN, type Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
11
|
+
import { isNonNullable } from '@dxos/util';
|
|
12
|
+
|
|
13
|
+
export type UseContextObjects = {
|
|
14
|
+
objects: Obj.Any[];
|
|
15
|
+
onUpdateObject: (dxn: DXN, checked: boolean) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create reactive map of active object references (by DXN string).
|
|
20
|
+
*/
|
|
21
|
+
export const useContextObjects = ({
|
|
22
|
+
space,
|
|
23
|
+
context,
|
|
24
|
+
}: {
|
|
25
|
+
space?: Space;
|
|
26
|
+
context?: AiContextBinder;
|
|
27
|
+
}): UseContextObjects => {
|
|
28
|
+
const objects = context?.objects.value.map((ref) => ref.target).filter(isNonNullable) ?? [];
|
|
29
|
+
|
|
30
|
+
const handleUpdateObject = useCallback<UseContextObjects['onUpdateObject']>(
|
|
31
|
+
async (dxn: DXN, checked: boolean) => {
|
|
32
|
+
if (!space || !context) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Load the object by DXN/id from the current space.
|
|
37
|
+
const id = dxn.asEchoDXN();
|
|
38
|
+
const object = id && (await space.db.getObjectById(id.echoId));
|
|
39
|
+
if (!object) {
|
|
40
|
+
log.warn('Object not found', { dxn, id });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const ref = Ref.fromDXN(dxn);
|
|
45
|
+
if (checked) {
|
|
46
|
+
await context.bind({ objects: [ref] });
|
|
47
|
+
} else {
|
|
48
|
+
await context.unbind({ objects: [ref] });
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
[space, context],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
objects,
|
|
56
|
+
onUpdateObject: handleUpdateObject,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Queue } from '@dxos/client/echo';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { useQueue } from '@dxos/react-client/echo';
|
|
10
|
+
|
|
11
|
+
import { ExecutionGraph } from '../execution-graph';
|
|
12
|
+
|
|
13
|
+
export const useExecutionGraph = (queueRef?: Queue, lastRequest = false) => {
|
|
14
|
+
const queue = useQueue(queueRef?.dxn);
|
|
15
|
+
return useMemo(() => {
|
|
16
|
+
const graph = new ExecutionGraph();
|
|
17
|
+
graph.addEvents(queue?.objects.filter(Obj.isObject) ?? []);
|
|
18
|
+
return graph.getGraph(lastRequest);
|
|
19
|
+
}, [queue?.objects, lastRequest]);
|
|
20
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useCallback, useRef, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Space } from '@dxos/client/echo';
|
|
8
|
+
|
|
9
|
+
export const useFlush = (space?: Space) => {
|
|
10
|
+
const [state, setState] = useState<'idle' | 'flushing' | 'flushed'>('idle');
|
|
11
|
+
const resetTimer = useRef<NodeJS.Timeout | null>(null);
|
|
12
|
+
|
|
13
|
+
const handleFlush = useCallback(() => {
|
|
14
|
+
if (!space) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
queueMicrotask(async () => {
|
|
19
|
+
if (resetTimer.current) {
|
|
20
|
+
clearTimeout(resetTimer.current);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
setState('flushing');
|
|
24
|
+
await space.db.flush();
|
|
25
|
+
setState('flushed');
|
|
26
|
+
|
|
27
|
+
resetTimer.current = setTimeout(() => {
|
|
28
|
+
setState('idle');
|
|
29
|
+
resetTimer.current = null;
|
|
30
|
+
}, 1_000);
|
|
31
|
+
});
|
|
32
|
+
}, [space]);
|
|
33
|
+
|
|
34
|
+
return { state, handleFlush };
|
|
35
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Option } from 'effect';
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type Type } from '@dxos/echo';
|
|
9
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
10
|
+
import { ItemAnnotation } from '@dxos/schema';
|
|
11
|
+
|
|
12
|
+
// TODO(burdon): Pass in filter.
|
|
13
|
+
export const useItemTypes = (space?: Space): Type.Obj.Any[] => {
|
|
14
|
+
const [types, setTypes] = useState<Type.Obj.Any[]>([]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!space) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return space.db.schemaRegistry.query().subscribe(
|
|
21
|
+
(query) => {
|
|
22
|
+
const types = Array.from(
|
|
23
|
+
new Set(
|
|
24
|
+
[...space.db.graph.schemaRegistry.schemas, ...query.results].filter((type) =>
|
|
25
|
+
Option.isSome(ItemAnnotation.get(type)),
|
|
26
|
+
),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
setTypes(types);
|
|
31
|
+
},
|
|
32
|
+
{ fire: true },
|
|
33
|
+
);
|
|
34
|
+
}, [space]);
|
|
35
|
+
|
|
36
|
+
return types;
|
|
37
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Dispatch, type SetStateAction, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
export const useOnline = (): [boolean, Dispatch<SetStateAction<boolean>>] => {
|
|
8
|
+
const [online, setOnline] = useState(true);
|
|
9
|
+
return [online, setOnline];
|
|
10
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ChatPromptProps } from '../components';
|
|
8
|
+
import { type AiServicePreset, AiServicePresets } from '../processor';
|
|
9
|
+
|
|
10
|
+
export type UsePresets = {
|
|
11
|
+
preset: AiServicePreset | undefined;
|
|
12
|
+
} & Pick<ChatPromptProps, 'presets' | 'onPresetChange'>;
|
|
13
|
+
|
|
14
|
+
export const usePresets = (online: boolean): UsePresets => {
|
|
15
|
+
// TODO(burdon): Memo preset for provider.
|
|
16
|
+
const [preset, setPreset] = useState<AiServicePreset>();
|
|
17
|
+
const presets = useMemo(
|
|
18
|
+
() => AiServicePresets.filter((preset) => online === (preset.provider === 'dxos-remote')),
|
|
19
|
+
[online],
|
|
20
|
+
);
|
|
21
|
+
const presetOptions = useMemo(
|
|
22
|
+
() => presets.map(({ id, model, label }) => ({ id, label: label ?? model })),
|
|
23
|
+
[presets],
|
|
24
|
+
);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setPreset(presets[0]);
|
|
27
|
+
}, [presets]);
|
|
28
|
+
|
|
29
|
+
const handlePresetChange = useCallback<NonNullable<ChatPromptProps['onPresetChange']>>(
|
|
30
|
+
(id) => {
|
|
31
|
+
const preset = presets.find((preset) => preset.id === id);
|
|
32
|
+
if (preset) {
|
|
33
|
+
setPreset(preset);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
[presets],
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
preset: preset,
|
|
41
|
+
presets: presetOptions,
|
|
42
|
+
onPresetChange: handlePresetChange,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -6,15 +6,14 @@ import { useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
8
8
|
import { type Space } from '@dxos/client/echo';
|
|
9
|
-
import { Filter, Obj
|
|
9
|
+
import { Filter, Obj } from '@dxos/echo';
|
|
10
10
|
import { type ReferencesProvider } from '@dxos/react-ui-chat';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Resolve references to objects in the space.
|
|
14
14
|
*/
|
|
15
15
|
export const useReferencesProvider = (space?: Space): ReferencesProvider | undefined => {
|
|
16
|
-
|
|
17
|
-
const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
|
|
16
|
+
const blueprints = useCapabilities(Capabilities.BlueprintDefinition);
|
|
18
17
|
|
|
19
18
|
return useMemo<ReferencesProvider | undefined>((): ReferencesProvider | undefined => {
|
|
20
19
|
if (!space) {
|
|
@@ -23,10 +22,13 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
23
22
|
|
|
24
23
|
return {
|
|
25
24
|
getReferences: async ({ query }) => {
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
// TODO(burdon): Previously we filtered by types declared by the artifact definitions.
|
|
26
|
+
// const schemas = blueprints.map((blueprint) => blueprint.schema).flat();
|
|
27
|
+
// const { objects } = await space.db
|
|
28
|
+
// .query(Filter.or(...schemas.map((schema) => Filter.type(schema as Type.Schema))))
|
|
29
|
+
// .run();
|
|
30
|
+
|
|
31
|
+
const { objects } = await space.db.query(Filter.everything()).run();
|
|
30
32
|
|
|
31
33
|
return (
|
|
32
34
|
objects
|
|
@@ -39,7 +41,7 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
39
41
|
// TODO(dmaretskyi): `Type.getDXN` (at the point of writing) didn't work here as it was schema-only.
|
|
40
42
|
.filter((object) => !!Obj.getDXN(object as Obj.Any))
|
|
41
43
|
.map((object) => ({
|
|
42
|
-
uri: Obj.getDXN(object as any)
|
|
44
|
+
uri: Obj.getDXN(object as any).toString(),
|
|
43
45
|
label: Obj.getLabel(object as any) ?? '',
|
|
44
46
|
}))
|
|
45
47
|
);
|
|
@@ -49,7 +51,7 @@ export const useReferencesProvider = (space?: Space): ReferencesProvider | undef
|
|
|
49
51
|
return { uri, label: Obj.getLabel(object) ?? '' };
|
|
50
52
|
},
|
|
51
53
|
} satisfies ReferencesProvider;
|
|
52
|
-
}, [space,
|
|
54
|
+
}, [space, blueprints]);
|
|
53
55
|
};
|
|
54
56
|
|
|
55
57
|
const stringMatch = (query: string, label: string) => label.toLowerCase().startsWith(query.toLowerCase());
|
package/src/meta.ts
CHANGED
|
@@ -11,7 +11,7 @@ export const ASSISTANT_DIALOG = `${ASSISTANT_PLUGIN}/assistant/dialog`;
|
|
|
11
11
|
export const meta: PluginMeta = {
|
|
12
12
|
id: ASSISTANT_PLUGIN,
|
|
13
13
|
name: 'Assistant',
|
|
14
|
-
description: 'The Assistant
|
|
14
|
+
description: 'The Assistant plugin allows you to chat with your spaces inside of Composer.',
|
|
15
15
|
icon: 'ph--atom--regular',
|
|
16
16
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-assistant',
|
|
17
17
|
tags: ['labs'],
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type ModelName } from '@dxos/ai';
|
|
8
8
|
|
|
9
9
|
const ModelProviders = ['dxos-local', 'dxos-remote', 'lm-studio'] as const;
|
|
10
10
|
|
|
@@ -14,11 +14,11 @@ type ModelProvider = Schema.Schema.Type<typeof ModelProvider>;
|
|
|
14
14
|
export type AiServicePreset = {
|
|
15
15
|
id: string;
|
|
16
16
|
provider: ModelProvider;
|
|
17
|
-
model:
|
|
17
|
+
model: ModelName;
|
|
18
18
|
label?: string;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const createModelLabel = (model:
|
|
21
|
+
const createModelLabel = (model: ModelName) => {
|
|
22
22
|
const parts = model.split('/');
|
|
23
23
|
return parts[parts.length - 1];
|
|
24
24
|
};
|
|
@@ -27,20 +27,28 @@ const createModelLabel = (model: LLMModel) => {
|
|
|
27
27
|
export const AiServicePresets: AiServicePreset[] = [
|
|
28
28
|
{
|
|
29
29
|
provider: 'dxos-remote' as const,
|
|
30
|
-
model: '@anthropic/claude-
|
|
30
|
+
model: '@anthropic/claude-opus-4-0' as const,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
provider: 'dxos-remote' as const,
|
|
34
|
-
model: '@anthropic/claude-
|
|
34
|
+
model: '@anthropic/claude-sonnet-4-0' as const,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
provider: 'dxos-remote' as const,
|
|
38
|
+
model: '@anthropic/claude-3-5-haiku-20241022' as const,
|
|
35
39
|
},
|
|
36
40
|
{
|
|
37
41
|
provider: 'lm-studio' as const,
|
|
38
|
-
model: '@google/gemma-3-
|
|
42
|
+
model: '@google/gemma-3-27b' as const,
|
|
39
43
|
},
|
|
40
44
|
{
|
|
41
45
|
provider: 'lm-studio' as const,
|
|
42
46
|
model: '@mlx-community/llama-3.2-3b-instruct' as const,
|
|
43
47
|
},
|
|
48
|
+
{
|
|
49
|
+
model: 'deepseek-r1:latest' as const,
|
|
50
|
+
provider: 'dxos-local' as const,
|
|
51
|
+
},
|
|
44
52
|
].map(
|
|
45
53
|
({ model, provider }, i) =>
|
|
46
54
|
({
|