@dxos/plugin-assistant 0.8.4-main.5acf9ea → 0.8.4-main.5ea62a8
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-OWUSKPRK.mjs} +4 -3
- package/dist/lib/browser/ChatCompanion-FRCVSLPP.mjs +126 -0
- package/dist/lib/browser/ChatCompanion-FRCVSLPP.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-RP3QEXYX.mjs → ChatContainer-YBJBIVUZ.mjs} +34 -13
- package/dist/lib/browser/ChatContainer-YBJBIVUZ.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-ZVLXFHEY.mjs → ChatDialog-MTPJLEHM.mjs} +26 -9
- package/dist/lib/browser/ChatDialog-MTPJLEHM.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-NRZPTUHO.mjs +22 -0
- package/dist/lib/browser/ai-service-NRZPTUHO.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-XSEOKJLG.mjs → app-graph-builder-7AAWTWGA.mjs} +25 -36
- package/dist/lib/browser/app-graph-builder-7AAWTWGA.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-CRZPIA5A.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-CRZPIA5A.mjs.map +7 -0
- package/dist/lib/browser/chunk-6QMISAU6.mjs +167 -0
- package/dist/lib/browser/chunk-6QMISAU6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LERGF5YG.mjs → chunk-CFXXQM25.mjs} +96 -22
- package/dist/lib/browser/chunk-CFXXQM25.mjs.map +7 -0
- package/dist/lib/browser/chunk-IJAJRAR7.mjs +18 -0
- package/dist/lib/browser/chunk-IJAJRAR7.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-OYFQS7JM.mjs +157 -0
- package/dist/lib/browser/chunk-OYFQS7JM.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/chunk-V5H5CCZA.mjs +218 -0
- package/dist/lib/browser/chunk-V5H5CCZA.mjs.map +7 -0
- package/dist/lib/browser/chunk-XL557TXF.mjs +2332 -0
- package/dist/lib/browser/chunk-XL557TXF.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-E5M3CC46.mjs +22 -0
- package/dist/lib/browser/edge-model-resolver-E5M3CC46.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +134 -59
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-BQO5SVGI.mjs +112 -0
- package/dist/lib/browser/intent-resolver-BQO5SVGI.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-VZ5WZQIC.mjs +21 -0
- package/dist/lib/browser/local-model-resolver-VZ5WZQIC.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-3GYEHQRP.mjs → react-surface-VNCD2H7C.mjs} +25 -66
- package/dist/lib/browser/react-surface-VNCD2H7C.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-D5IVKNYG.mjs +21 -0
- package/dist/lib/browser/state-D5IVKNYG.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-UFVWCRN6.mjs} +4 -3
- package/dist/lib/{browser/BlueprintContainer-IZ4AK5EO.mjs.map → node-esm/BlueprintContainer-UFVWCRN6.mjs.map} +1 -1
- package/dist/lib/node-esm/ChatCompanion-ZNRZEKH5.mjs +127 -0
- package/dist/lib/node-esm/ChatCompanion-ZNRZEKH5.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-W3W6FWV3.mjs → ChatContainer-TUCITJJW.mjs} +34 -13
- package/dist/lib/node-esm/ChatContainer-TUCITJJW.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-QW4JRKVO.mjs → ChatDialog-JLM7RDZQ.mjs} +26 -9
- package/dist/lib/node-esm/ChatDialog-JLM7RDZQ.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-UDEPIPTO.mjs +23 -0
- package/dist/lib/node-esm/ai-service-UDEPIPTO.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-PANCJUHV.mjs → app-graph-builder-PNAFQUYT.mjs} +25 -36
- package/dist/lib/node-esm/app-graph-builder-PNAFQUYT.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-275J3XL2.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-275J3XL2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2X6VEO32.mjs +2333 -0
- package/dist/lib/node-esm/chunk-2X6VEO32.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-CAQKGW3B.mjs +159 -0
- package/dist/lib/node-esm/chunk-CAQKGW3B.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MS3PJARN.mjs → chunk-FNZJJL7G.mjs} +96 -22
- package/dist/lib/node-esm/chunk-FNZJJL7G.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-RLBN4RNR.mjs +168 -0
- package/dist/lib/node-esm/chunk-RLBN4RNR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UWUUZQWJ.mjs +219 -0
- package/dist/lib/node-esm/chunk-UWUUZQWJ.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-YPXEA46Q.mjs +19 -0
- package/dist/lib/node-esm/chunk-YPXEA46Q.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-SZHDLXCT.mjs +23 -0
- package/dist/lib/node-esm/edge-model-resolver-SZHDLXCT.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +134 -59
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-FIS3T5KP.mjs +113 -0
- package/dist/lib/node-esm/intent-resolver-FIS3T5KP.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-2KCBKMYA.mjs +22 -0
- package/dist/lib/node-esm/local-model-resolver-2KCBKMYA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-QDQWJ7FZ.mjs → react-surface-4NLRKNBU.mjs} +25 -66
- package/dist/lib/node-esm/react-surface-4NLRKNBU.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-4VLKPLW3.mjs +22 -0
- package/dist/lib/node-esm/state-4VLKPLW3.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 +19 -0
- package/dist/types/src/capabilities/capabilities.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 +11 -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 +19 -16
- 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/ChatMessage.d.ts +21 -5
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +4 -4
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +108 -30
- 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/ToolBlock.d.ts +12 -12
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +1 -1
- 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/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 +257 -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 +257 -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 +254 -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/Toolbar/Toolbar.d.ts +4 -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 +258 -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 +10 -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 +7 -20
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +4 -5
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- 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 +7 -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/useMatcherExtension.d.ts +3 -0
- package/dist/types/src/hooks/useMatcherExtension.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/hooks/useResolveRef.d.ts +4 -0
- package/dist/types/src/hooks/useResolveRef.d.ts.map +1 -0
- package/dist/types/src/parser/filter-generator.d.ts.map +1 -1
- package/dist/types/src/parser/query-parser.d.ts.map +1 -1
- package/dist/types/src/parser/types.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 +80 -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 +22 -203
- 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/CommentsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/CommentsContainer.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/LoggingContainer.d.ts +4 -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/SurfaceContainer.d.ts +8 -0
- package/dist/types/src/stories/components/SurfaceContainer.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/index.d.ts +11 -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 +5 -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/testing.d.ts +44 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +4 -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-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +26 -11
- 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 +9 -6
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +99 -81
- package/src/AssistantPlugin.tsx +52 -16
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +41 -48
- package/src/capabilities/blueprint-definition.ts +42 -0
- package/src/capabilities/capabilities.ts +31 -0
- package/src/capabilities/edge-model-resolver.ts +27 -0
- package/src/capabilities/index.ts +9 -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 +171 -165
- 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 +11 -7
- 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/ChatMessage.tsx +214 -148
- package/src/components/ChatThread/ChatThread.stories.tsx +244 -104
- package/src/components/ChatThread/ChatThread.tsx +44 -22
- package/src/components/ChatThread/Link.tsx +23 -0
- package/src/components/ChatThread/ToolBlock.tsx +103 -77
- package/src/components/ChatThread/reducers.ts +151 -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/Toolbar/Toolbar.tsx +20 -0
- package/src/components/Toolbar/index.ts +5 -0
- package/src/components/Toolbar/useChatToolbarActions.ts +125 -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 +43 -0
- package/src/hooks/index.ts +10 -4
- package/src/hooks/useBlueprintRegistry.ts +80 -0
- package/src/hooks/useChatProcessor.ts +20 -97
- package/src/hooks/useChatServices.ts +29 -32
- 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/useMatcherExtension.ts +45 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +11 -9
- package/src/hooks/useResolveRef.ts +33 -0
- package/src/meta.ts +1 -1
- package/src/parser/filter-generator.ts +8 -13
- package/src/parser/query-parser.ts +1 -1
- package/src/parser/types.ts +2 -0
- 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 +304 -0
- package/src/queue-logger.ts +5 -5
- package/src/stories/Chat.stories.tsx +391 -293
- package/src/stories/components/BlueprintContainer.tsx +32 -0
- package/src/stories/components/ChatContainer.tsx +57 -0
- package/src/stories/components/CommentsContainer.tsx +25 -0
- package/src/stories/components/GraphContainer.tsx +118 -0
- package/src/stories/components/LoggingContainer.tsx +21 -0
- package/src/stories/components/MessageContainer.tsx +27 -0
- package/src/stories/components/SurfaceContainer.tsx +52 -0
- package/src/stories/components/TasksContainer.tsx +49 -0
- package/src/stories/components/TokenManagerContainer.tsx +14 -0
- package/src/stories/components/index.ts +15 -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/testing.tsx +254 -0
- package/src/testing/index.ts +2 -1
- package/src/testing/test-data.ts +109 -0
- package/src/testing/test-functions.ts +8 -3
- package/src/testing/test-sequence.ts +2 -27
- package/src/translations.ts +30 -11
- 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.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.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/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/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/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/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-OWUSKPRK.mjs.map} +0 -0
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { type FC, Fragment, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { parseToolName, type Tool } from '@dxos/ai';
|
|
8
|
-
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
9
|
-
import { type ArtifactDefinition } from '@dxos/blueprints';
|
|
10
7
|
import { type Blueprint } from '@dxos/blueprints';
|
|
11
8
|
import { type Ref } from '@dxos/echo';
|
|
12
9
|
import { FunctionType } from '@dxos/functions';
|
|
@@ -16,29 +13,19 @@ import { type ThemedClassName } from '@dxos/react-ui';
|
|
|
16
13
|
import { useTranslation } from '@dxos/react-ui';
|
|
17
14
|
import { mx } from '@dxos/react-ui-theme';
|
|
18
15
|
|
|
19
|
-
import { type ChatProcessor } from '../../hooks';
|
|
20
16
|
import { meta } from '../../meta';
|
|
21
|
-
import {
|
|
17
|
+
import { type AiChatProcessor } from '../../processor';
|
|
22
18
|
import { ServiceType } from '../../types';
|
|
23
19
|
|
|
24
20
|
export type ToolboxProps = ThemedClassName<{
|
|
25
|
-
|
|
26
|
-
artifacts?: ArtifactDefinition[];
|
|
27
|
-
services?: { service: ServiceType; tools: Tool[] }[];
|
|
21
|
+
services?: { service: ServiceType }[];
|
|
28
22
|
functions?: FunctionType[];
|
|
23
|
+
// TODO(burdon): Combine into single array.
|
|
24
|
+
blueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
29
25
|
activeBlueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
30
|
-
striped?: boolean;
|
|
31
26
|
}>;
|
|
32
27
|
|
|
33
|
-
export const Toolbox = ({
|
|
34
|
-
classNames,
|
|
35
|
-
artifacts,
|
|
36
|
-
functions,
|
|
37
|
-
services,
|
|
38
|
-
blueprints,
|
|
39
|
-
activeBlueprints,
|
|
40
|
-
striped,
|
|
41
|
-
}: ToolboxProps) => {
|
|
28
|
+
export const Toolbox = ({ classNames, functions, services, blueprints, activeBlueprints }: ToolboxProps) => {
|
|
42
29
|
const { t } = useTranslation(meta.id);
|
|
43
30
|
|
|
44
31
|
return (
|
|
@@ -49,7 +36,7 @@ export const Toolbox = ({
|
|
|
49
36
|
items={blueprints.map(({ target }) => ({
|
|
50
37
|
name: target?.name ?? '',
|
|
51
38
|
description: target?.description ?? '',
|
|
52
|
-
subitems: target?.tools.map((toolId) => ({ name: `∙ ${
|
|
39
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
53
40
|
}))}
|
|
54
41
|
/>
|
|
55
42
|
)}
|
|
@@ -60,18 +47,7 @@ export const Toolbox = ({
|
|
|
60
47
|
items={activeBlueprints.map(({ target }) => ({
|
|
61
48
|
name: target?.name ?? '',
|
|
62
49
|
description: target?.description ?? '',
|
|
63
|
-
subitems: target?.tools.map((toolId) => ({ name: `∙ ${
|
|
64
|
-
}))}
|
|
65
|
-
/>
|
|
66
|
-
)}
|
|
67
|
-
|
|
68
|
-
{artifacts && artifacts.length > 0 && (
|
|
69
|
-
<Section
|
|
70
|
-
title='Artifacts'
|
|
71
|
-
items={artifacts.map(({ name, description, tools }) => ({
|
|
72
|
-
name,
|
|
73
|
-
description,
|
|
74
|
-
subitems: tools.map(({ name, description }) => ({ name: `∙ ${parseToolName(name)}`, description })),
|
|
50
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
75
51
|
}))}
|
|
76
52
|
/>
|
|
77
53
|
)}
|
|
@@ -79,10 +55,10 @@ export const Toolbox = ({
|
|
|
79
55
|
{services && services.length > 0 && (
|
|
80
56
|
<Section
|
|
81
57
|
title='Services'
|
|
82
|
-
items={services.map(({ service: { serviceId, name, description }
|
|
58
|
+
items={services.map(({ service: { serviceId, name, description } }) => ({
|
|
83
59
|
name: name ?? serviceId,
|
|
84
60
|
description,
|
|
85
|
-
subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
61
|
+
// subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
86
62
|
}))}
|
|
87
63
|
/>
|
|
88
64
|
)}
|
|
@@ -90,12 +66,6 @@ export const Toolbox = ({
|
|
|
90
66
|
{functions && functions.length > 0 && (
|
|
91
67
|
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
92
68
|
)}
|
|
93
|
-
|
|
94
|
-
{!blueprints?.length &&
|
|
95
|
-
!activeBlueprints?.length &&
|
|
96
|
-
!artifacts?.length &&
|
|
97
|
-
!services?.length &&
|
|
98
|
-
!functions?.length && <div>{t('no tools')}</div>}
|
|
99
69
|
</div>
|
|
100
70
|
);
|
|
101
71
|
};
|
|
@@ -136,24 +106,21 @@ const Section: FC<{
|
|
|
136
106
|
|
|
137
107
|
export type ToolboxContainerProps = ThemedClassName<{
|
|
138
108
|
space?: Space;
|
|
139
|
-
processor?:
|
|
109
|
+
processor?: AiChatProcessor;
|
|
140
110
|
}>;
|
|
141
111
|
|
|
142
112
|
export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContainerProps) => {
|
|
143
|
-
// Plugin artifacts.
|
|
144
|
-
const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
|
|
145
|
-
|
|
146
113
|
// Registered services.
|
|
147
114
|
const services = useQuery(space, Filter.type(ServiceType));
|
|
148
|
-
const [serviceTools, setServiceTools] = useState<{ service: ServiceType
|
|
115
|
+
const [serviceTools, setServiceTools] = useState<{ service: ServiceType }[]>([]);
|
|
149
116
|
useEffect(() => {
|
|
150
117
|
log('creating service tools...', { services: services.length });
|
|
151
118
|
queueMicrotask(async () => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
)
|
|
155
|
-
|
|
156
|
-
setServiceTools(tools);
|
|
119
|
+
// TODO(burdon): Fix.
|
|
120
|
+
// const tools = await Promise.all(
|
|
121
|
+
// services.map(async (service) => ({ service, tools: await createToolsFromService(service) })),
|
|
122
|
+
// );
|
|
123
|
+
// setServiceTools(tools);
|
|
157
124
|
});
|
|
158
125
|
}, [services]);
|
|
159
126
|
|
|
@@ -164,9 +131,12 @@ export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContai
|
|
|
164
131
|
<Toolbox
|
|
165
132
|
classNames={classNames}
|
|
166
133
|
blueprints={processor?.context.blueprints.value}
|
|
167
|
-
artifacts={artifactDefinitions}
|
|
168
134
|
services={serviceTools}
|
|
169
135
|
functions={functions}
|
|
170
136
|
/>
|
|
171
137
|
);
|
|
172
138
|
};
|
|
139
|
+
|
|
140
|
+
const safeToolId = (name: string) => {
|
|
141
|
+
return name.split('_').pop();
|
|
142
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -6,15 +6,14 @@ import { lazy } from 'react';
|
|
|
6
6
|
|
|
7
7
|
export * from './AssistantSettings';
|
|
8
8
|
export * from './Chat';
|
|
9
|
+
export * from './ChatProgress';
|
|
9
10
|
export * from './PromptSettings';
|
|
10
11
|
export * from './TemplateEditor';
|
|
12
|
+
export * from './Toolbar';
|
|
11
13
|
export * from './Toolbox';
|
|
12
14
|
|
|
13
|
-
// TODO(burdon): Lazy loading causes issues with Tabster.
|
|
14
|
-
// Repro: open assistant dialog then close.
|
|
15
|
-
// https://github.com/microsoft/fluentui/issues/34020
|
|
16
|
-
|
|
17
15
|
export const BlueprintContainer = lazy(() => import('./BlueprintContainer'));
|
|
16
|
+
export const ChatCompanion = lazy(() => import('./ChatCompanion'));
|
|
18
17
|
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
|
19
18
|
export const ChatDialog = lazy(() => import('./ChatDialog'));
|
|
20
19
|
export const SequenceContainer = lazy(() => import('./SequenceContainer'));
|
package/src/events.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { defineEvent } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import { meta } from './meta';
|
|
8
8
|
|
|
9
9
|
export namespace AssistantEvents {
|
|
10
|
-
export const
|
|
10
|
+
export const SetupAiServiceProviders = defineEvent(`${meta.id}/event/setup-ai-service-providers`);
|
|
11
11
|
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { AgentStatus } from '@dxos/ai';
|
|
6
|
+
import { Obj, type Ref } from '@dxos/echo';
|
|
7
|
+
import { MESSAGE_PROPERTY_TOOL_CALL_ID } from '@dxos/functions';
|
|
8
|
+
import { type ObjectId } from '@dxos/keys';
|
|
9
|
+
import { LogLevel } from '@dxos/log';
|
|
10
|
+
import { type Commit } from '@dxos/react-ui-components';
|
|
11
|
+
import { ContentBlock, DataType } from '@dxos/schema';
|
|
12
|
+
import { isNotFalsy } from '@dxos/util';
|
|
13
|
+
|
|
14
|
+
// TODO(burdon): Move to assistant.
|
|
15
|
+
|
|
16
|
+
// TODO(burdon): Add colors?
|
|
17
|
+
enum IconType {
|
|
18
|
+
// General status.
|
|
19
|
+
SUCCESS = 'ph--check-circle--regular',
|
|
20
|
+
WARNING = 'ph--warning-circle--regular',
|
|
21
|
+
ERROR = 'ph--x-circle--regular',
|
|
22
|
+
FLAG = 'ph--flag--regular',
|
|
23
|
+
ROCKET = 'ph--rocket--regular',
|
|
24
|
+
TIMER = 'ph--timer--regular',
|
|
25
|
+
|
|
26
|
+
// Interactions.
|
|
27
|
+
USER = 'ph--user--regular',
|
|
28
|
+
USER_INTERACTION = 'ph--user-sound--regular',
|
|
29
|
+
AGENT = 'ph--robot--regular',
|
|
30
|
+
THINKING = 'ph--brain--regular',
|
|
31
|
+
LINK = 'ph--link--regular',
|
|
32
|
+
TOOL = 'ph--wrench--regular',
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Models the execution graph based on a stream of events.
|
|
37
|
+
*/
|
|
38
|
+
export class ExecutionGraph {
|
|
39
|
+
// TODO(dmaretskyi): Evolve the internal state to support chats, functions, circuit workflows, etc.
|
|
40
|
+
private _commits: Commit[] = [];
|
|
41
|
+
private _branchNames = new Set<string>();
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Adds events to the graph.
|
|
45
|
+
*/
|
|
46
|
+
addEvents(events: Obj.Any[]) {
|
|
47
|
+
for (const event of events) {
|
|
48
|
+
if (Obj.instanceOf(DataType.Message, event)) {
|
|
49
|
+
const messageCommits = messageToCommit(event);
|
|
50
|
+
this._commits.push(...messageCommits);
|
|
51
|
+
messageCommits.map((c) => c.branch).forEach((branch) => this._branchNames.add(branch));
|
|
52
|
+
} else if (Obj.instanceOf(AgentStatus, event)) {
|
|
53
|
+
const branch = getBranchName({ parentMessage: event.parentMessage, toolCallId: event.toolCallId });
|
|
54
|
+
this._branchNames.add(branch);
|
|
55
|
+
this._commits.push({
|
|
56
|
+
id: event.id,
|
|
57
|
+
branch,
|
|
58
|
+
message: event.message,
|
|
59
|
+
icon: IconType.FLAG,
|
|
60
|
+
parents:
|
|
61
|
+
event.parentMessage && event.toolCallId
|
|
62
|
+
? [getToolCallId(event.parentMessage, event.toolCallId)]
|
|
63
|
+
: undefined, // TODO(burdon): Fix.
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Returns the current state of the graph.
|
|
71
|
+
*/
|
|
72
|
+
getGraph(lastRequest = false): { branches: string[]; commits: Commit[] } {
|
|
73
|
+
const idx = lastRequest ? this._commits.findLastIndex((c) => c.tags?.includes('user')) : -1;
|
|
74
|
+
const commits = idx === -1 ? this._commits : this._commits.slice(idx);
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
branches: Array.from(this._branchNames),
|
|
78
|
+
commits: commits,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// TODO(burdon): Pass in AiToolProvider.
|
|
84
|
+
const messageToCommit = (message: DataType.Message): Commit[] => {
|
|
85
|
+
return message.blocks
|
|
86
|
+
.map((block, idx) => {
|
|
87
|
+
const branch = getMessageBranch(message);
|
|
88
|
+
const parent = getParentId(message);
|
|
89
|
+
const parents = parent ? [parent] : [];
|
|
90
|
+
switch (block._tag) {
|
|
91
|
+
case 'text':
|
|
92
|
+
if (!block.text.trim().length) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
id: getGenericBlockId(message.id, idx),
|
|
97
|
+
branch,
|
|
98
|
+
parents,
|
|
99
|
+
...(message.sender.role === 'user'
|
|
100
|
+
? {
|
|
101
|
+
icon: IconType.USER,
|
|
102
|
+
tags: ['user'],
|
|
103
|
+
message: 'Processing request...',
|
|
104
|
+
}
|
|
105
|
+
: {
|
|
106
|
+
icon: IconType.AGENT,
|
|
107
|
+
message: `Response (${block.text.split(' ').length} words)`,
|
|
108
|
+
}),
|
|
109
|
+
} satisfies Commit;
|
|
110
|
+
case 'toolCall':
|
|
111
|
+
return {
|
|
112
|
+
id: getToolCallId(message.id, block.toolCallId),
|
|
113
|
+
branch,
|
|
114
|
+
parents,
|
|
115
|
+
icon: IconType.TOOL,
|
|
116
|
+
level: LogLevel.INFO,
|
|
117
|
+
// TODO(burdon): Lookup tool name/description?
|
|
118
|
+
message: `Calling tool (${block.name})`,
|
|
119
|
+
} satisfies Commit;
|
|
120
|
+
case 'toolResult':
|
|
121
|
+
return {
|
|
122
|
+
id: getToolResultId(message.id, block.toolCallId),
|
|
123
|
+
branch,
|
|
124
|
+
parents,
|
|
125
|
+
icon: block.error ? IconType.ERROR : IconType.SUCCESS,
|
|
126
|
+
level: block.error ? LogLevel.ERROR : LogLevel.INFO,
|
|
127
|
+
message: block.error ? 'Tool error: ' + block.error : 'Tool call succeeded',
|
|
128
|
+
} satisfies Commit;
|
|
129
|
+
case 'summary':
|
|
130
|
+
return {
|
|
131
|
+
id: getGenericBlockId(message.id, idx),
|
|
132
|
+
branch,
|
|
133
|
+
parents,
|
|
134
|
+
icon: IconType.ROCKET,
|
|
135
|
+
level: LogLevel.INFO,
|
|
136
|
+
message: ContentBlock.createSummaryMessage(block),
|
|
137
|
+
} satisfies Commit;
|
|
138
|
+
case 'status':
|
|
139
|
+
return {
|
|
140
|
+
id: getGenericBlockId(message.id, idx),
|
|
141
|
+
branch,
|
|
142
|
+
parents,
|
|
143
|
+
message: block.statusText,
|
|
144
|
+
level: LogLevel.INFO,
|
|
145
|
+
icon: IconType.FLAG,
|
|
146
|
+
} satisfies Commit;
|
|
147
|
+
case 'reasoning':
|
|
148
|
+
return {
|
|
149
|
+
id: getGenericBlockId(message.id, idx),
|
|
150
|
+
branch,
|
|
151
|
+
parents,
|
|
152
|
+
message: block.reasoningText ?? 'Thinking...',
|
|
153
|
+
icon: IconType.THINKING,
|
|
154
|
+
} satisfies Commit;
|
|
155
|
+
case 'reference':
|
|
156
|
+
return {
|
|
157
|
+
id: getGenericBlockId(message.id, idx),
|
|
158
|
+
branch,
|
|
159
|
+
parents,
|
|
160
|
+
icon: IconType.LINK,
|
|
161
|
+
message: stringifyRef(block.reference),
|
|
162
|
+
} satisfies Commit;
|
|
163
|
+
default:
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
})
|
|
167
|
+
.filter(isNotFalsy);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const getToolCallId = (messageId: ObjectId, toolCallId: string) => `${messageId}_toolCall_${toolCallId}`;
|
|
171
|
+
|
|
172
|
+
const getToolResultId = (messageId: ObjectId, toolCallId: string) => `${messageId}_toolResult_${toolCallId}`;
|
|
173
|
+
|
|
174
|
+
const getGenericBlockId = (messageId: ObjectId, idx: number) => `${messageId}_block_${idx}`;
|
|
175
|
+
|
|
176
|
+
const getBranchName = (options: { parentMessage?: ObjectId; toolCallId?: string }) => {
|
|
177
|
+
if (options.parentMessage && options.toolCallId) {
|
|
178
|
+
return `${options.parentMessage}_${options.toolCallId}`;
|
|
179
|
+
} else if (options.parentMessage) {
|
|
180
|
+
return options.parentMessage;
|
|
181
|
+
} else {
|
|
182
|
+
return 'main';
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const getMessageBranch = (message: DataType.Message) => {
|
|
187
|
+
return getBranchName({
|
|
188
|
+
parentMessage: message.parentMessage,
|
|
189
|
+
toolCallId: message.properties?.[MESSAGE_PROPERTY_TOOL_CALL_ID],
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const getParentId = (message: DataType.Message) => {
|
|
194
|
+
if (message.parentMessage && message.properties?.[MESSAGE_PROPERTY_TOOL_CALL_ID]) {
|
|
195
|
+
return getToolCallId(message.parentMessage, message.properties[MESSAGE_PROPERTY_TOOL_CALL_ID]);
|
|
196
|
+
} else {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const stringifyRef = (ref: Ref.Any) => {
|
|
202
|
+
if (ref.target) {
|
|
203
|
+
return stringifyObject(ref.target);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return ref.dxn.asEchoDXN()?.echoId ?? ref.dxn.asQueueDXN()?.objectId ?? '';
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const stringifyObject = (obj: Obj.Any) => {
|
|
210
|
+
return Obj.getLabel(obj) ?? Obj.getTypename(obj) ?? obj.id;
|
|
211
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Effect, Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { defineFunction } from '@dxos/functions';
|
|
8
|
+
import { log } from '@dxos/log';
|
|
9
|
+
|
|
10
|
+
export default defineFunction({
|
|
11
|
+
name: 'dxos.org/function/assistant-analysis',
|
|
12
|
+
description: 'Enter analysis analysis mode.',
|
|
13
|
+
inputSchema: Schema.Struct({
|
|
14
|
+
enable: Schema.Boolean.annotations({ description: 'Enable or disable analysis mode.' }),
|
|
15
|
+
}),
|
|
16
|
+
outputSchema: Schema.Void,
|
|
17
|
+
handler: Effect.fn(function* ({ context, data: { enable } }) {
|
|
18
|
+
log.info('analysis mode', { space: context.space?.id, enable });
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Effect, Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
8
|
+
import { DatabaseService, defineFunction } from '@dxos/functions';
|
|
9
|
+
import { trim } from '@dxos/util';
|
|
10
|
+
|
|
11
|
+
// TODO(burdon): Factor out to space plugin.
|
|
12
|
+
export default defineFunction({
|
|
13
|
+
name: 'dxos.org/function/assistant/list',
|
|
14
|
+
description:
|
|
15
|
+
// TODO(wittjosiah): Find a better way to prompt for looking up typenames before querying with them.
|
|
16
|
+
trim`
|
|
17
|
+
Lists the objects of the given type.
|
|
18
|
+
Check the list-schemas tool for available types before calling this function.
|
|
19
|
+
`,
|
|
20
|
+
inputSchema: Schema.Struct({
|
|
21
|
+
typename: Schema.String.annotations({
|
|
22
|
+
description: 'The typename of the objects to list.',
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
outputSchema: Schema.Struct({
|
|
26
|
+
results: Schema.Array(
|
|
27
|
+
Schema.Struct({
|
|
28
|
+
dxn: Schema.String.annotations({ description: 'The DXN of the object.' }),
|
|
29
|
+
label: Schema.optional(Schema.String.annotations({ description: 'The label of the object.' })),
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
}),
|
|
33
|
+
handler: Effect.fn(function* ({ data: { typename } }) {
|
|
34
|
+
// TODO(wittjosiah): Typename query is not working for dynamic schemas.
|
|
35
|
+
const [schema] = yield* DatabaseService.runSchemaQuery({ typename });
|
|
36
|
+
const filter = schema ? Filter.type(schema) : Filter.typename(typename);
|
|
37
|
+
|
|
38
|
+
const { objects } = yield* DatabaseService.runQuery(Query.select(filter));
|
|
39
|
+
const results = objects.map((object) => ({
|
|
40
|
+
dxn: Obj.getDXN(object).toString(),
|
|
41
|
+
label: Obj.getLabel(object),
|
|
42
|
+
}));
|
|
43
|
+
|
|
44
|
+
return { results };
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Effect, Option, Schema, pipe } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { ArtifactId } from '@dxos/assistant';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import { DatabaseService, defineFunction } from '@dxos/functions';
|
|
10
|
+
import { log } from '@dxos/log';
|
|
11
|
+
|
|
12
|
+
// TODO(burdon): Common error handling.
|
|
13
|
+
// TODO(burdon): Factor out to space plugin.
|
|
14
|
+
export default defineFunction({
|
|
15
|
+
name: 'dxos.org/function/assistant/load',
|
|
16
|
+
description: 'Loads the object.',
|
|
17
|
+
inputSchema: Schema.Struct({
|
|
18
|
+
id: ArtifactId.annotations({
|
|
19
|
+
description: 'The ID of the object.',
|
|
20
|
+
}),
|
|
21
|
+
typename: Schema.String.annotations({
|
|
22
|
+
description: 'The typename of the object.',
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
outputSchema: Schema.Struct({
|
|
26
|
+
// TODO(wittjosiah): Type.Obj.Any | Type.Relation.Any
|
|
27
|
+
object: Schema.Any,
|
|
28
|
+
}),
|
|
29
|
+
handler: Effect.fn(function* ({ data: { id, typename } }) {
|
|
30
|
+
const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id));
|
|
31
|
+
return yield* pipe(
|
|
32
|
+
Option.fromNullable(object),
|
|
33
|
+
Option.flatMap((object) => (Obj.getTypename(object) === typename ? Option.some(object) : Option.none())),
|
|
34
|
+
Option.match({
|
|
35
|
+
onNone: () => Effect.fail('Object not found.'),
|
|
36
|
+
onSome: (object) => {
|
|
37
|
+
log.info('object', { object });
|
|
38
|
+
return Effect.succeed({ object });
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
}),
|
|
43
|
+
});
|
package/src/hooks/index.ts
CHANGED
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './presets';
|
|
7
|
-
|
|
8
|
-
export * from './useBlueprints';
|
|
5
|
+
export * from './useBlueprintRegistry';
|
|
9
6
|
export * from './useChatProcessor';
|
|
10
7
|
export * from './useChatServices';
|
|
8
|
+
export * from './useContextBinder';
|
|
9
|
+
export * from './useContextObjects';
|
|
10
|
+
export * from './useExecutionGraph';
|
|
11
|
+
export * from './useFlush';
|
|
12
|
+
export * from './useItemTypes';
|
|
13
|
+
export * from './useMatcherExtension';
|
|
14
|
+
export * from './useOnline';
|
|
15
|
+
export * from './usePresets';
|
|
11
16
|
export * from './useReferencesProvider';
|
|
17
|
+
export * from './useResolveRef';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useSignalEffect } from '@preact/signals-react';
|
|
6
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
9
|
+
import { type AiContextBinder } from '@dxos/assistant';
|
|
10
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
11
|
+
import { type Space } from '@dxos/client/echo';
|
|
12
|
+
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
13
|
+
import { isNonNullable } from '@dxos/util';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Provide a registry of blueprints from plugins.
|
|
17
|
+
*/
|
|
18
|
+
// TODO(burdon): Reconcile with eventual public registry.
|
|
19
|
+
export const useBlueprintRegistry = () => {
|
|
20
|
+
const blueprints = useCapabilities(Capabilities.BlueprintDefinition);
|
|
21
|
+
return useMemo(() => new Blueprint.Registry(blueprints), [blueprints]);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const useBlueprints = ({ blueprintRegistry }: { blueprintRegistry?: Blueprint.Registry }) =>
|
|
25
|
+
useMemo(() => blueprintRegistry?.query() ?? [], [blueprintRegistry]);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create reactive map of active blueprints (by key).
|
|
29
|
+
*/
|
|
30
|
+
export const useActiveBlueprints = ({ context }: { context?: AiContextBinder }) => {
|
|
31
|
+
const [active, setActive] = useState<Map<string, Blueprint.Blueprint>>(new Map());
|
|
32
|
+
|
|
33
|
+
useSignalEffect(() => {
|
|
34
|
+
const refs = [...(context?.blueprints.value ?? [])];
|
|
35
|
+
const blueprints = refs.map((ref) => ref.target).filter(isNonNullable);
|
|
36
|
+
setActive(new Map(blueprints.map((blueprint) => [blueprint.key, blueprint])));
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return active;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// TODO(burdon): Move logic into binder.
|
|
43
|
+
export const useBlueprintHandlers = ({
|
|
44
|
+
space,
|
|
45
|
+
context,
|
|
46
|
+
blueprintRegistry,
|
|
47
|
+
}: {
|
|
48
|
+
space: Space;
|
|
49
|
+
context?: AiContextBinder;
|
|
50
|
+
blueprintRegistry?: Blueprint.Registry;
|
|
51
|
+
}) => {
|
|
52
|
+
const onUpdateBlueprint = useCallback(
|
|
53
|
+
async (key: string, checked: boolean) => {
|
|
54
|
+
if (!context || !blueprintRegistry) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Find existing cloned blueprint.
|
|
59
|
+
const { objects } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
60
|
+
let storedBlueprint = objects.find((blueprint) => blueprint.key === key);
|
|
61
|
+
if (checked) {
|
|
62
|
+
if (!storedBlueprint) {
|
|
63
|
+
const blueprint = blueprintRegistry.getByKey(key);
|
|
64
|
+
if (!blueprint) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// NOTE: Possible race condition with other peers.
|
|
69
|
+
storedBlueprint = space.db.add(Obj.clone(blueprint));
|
|
70
|
+
}
|
|
71
|
+
await context.bind({ blueprints: [Ref.make(storedBlueprint)] });
|
|
72
|
+
} else if (storedBlueprint) {
|
|
73
|
+
await context.unbind({ blueprints: [Ref.make(storedBlueprint)] });
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
[space, context, blueprintRegistry],
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
return { onUpdateBlueprint };
|
|
80
|
+
};
|