@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,17 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { HighlightStyle, LanguageSupport, syntaxHighlighting } from '@codemirror/language';
|
|
6
|
-
import { styleTags, tags } from '@lezer/highlight';
|
|
7
|
-
import { handlebarsLanguage } from '@xiechao/codemirror-lang-handlebars';
|
|
8
5
|
import React from 'react';
|
|
9
6
|
|
|
10
7
|
import { type Template } from '@dxos/blueprints';
|
|
11
8
|
import { createDocAccessor } from '@dxos/react-client/echo';
|
|
12
|
-
import { useThemeContext, useTranslation
|
|
9
|
+
import { type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
13
10
|
import {
|
|
14
11
|
createBasicExtensions,
|
|
15
12
|
createDataExtensions,
|
|
13
|
+
createMarkdownExtensions,
|
|
16
14
|
createThemeExtensions,
|
|
17
15
|
useTextEditor,
|
|
18
16
|
} from '@dxos/react-ui-editor';
|
|
@@ -21,13 +19,7 @@ import { isNotFalsy } from '@dxos/util';
|
|
|
21
19
|
|
|
22
20
|
import { meta } from '../../meta';
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
props: [
|
|
26
|
-
styleTags({
|
|
27
|
-
'---': tags.lineComment,
|
|
28
|
-
}),
|
|
29
|
-
],
|
|
30
|
-
});
|
|
22
|
+
import { handlebars } from './handlebars-extension';
|
|
31
23
|
|
|
32
24
|
export type TemplateEditorProps = ThemedClassName<{
|
|
33
25
|
id: string;
|
|
@@ -39,53 +31,28 @@ export const TemplateEditor = ({ id, classNames, template }: TemplateEditorProps
|
|
|
39
31
|
const { themeMode } = useThemeContext();
|
|
40
32
|
const { parentRef } = useTextEditor(() => {
|
|
41
33
|
const text = template.source?.target;
|
|
34
|
+
if (!text) {
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
|
|
42
38
|
return {
|
|
43
|
-
initialValue: text
|
|
39
|
+
initialValue: text.content ?? '',
|
|
44
40
|
extensions: [
|
|
45
|
-
text
|
|
46
|
-
createDataExtensions({
|
|
47
|
-
id,
|
|
48
|
-
text: createDocAccessor(text, ['content']),
|
|
49
|
-
}),
|
|
41
|
+
createDataExtensions({ id, text: createDocAccessor(text, ['content']) }),
|
|
50
42
|
createBasicExtensions({
|
|
51
43
|
bracketMatching: false,
|
|
52
44
|
lineNumbers: true,
|
|
53
45
|
lineWrapping: true,
|
|
54
|
-
monospace: true,
|
|
55
46
|
placeholder: t('template placeholder'),
|
|
56
47
|
}),
|
|
57
|
-
createThemeExtensions({
|
|
58
|
-
themeMode,
|
|
59
|
-
}),
|
|
48
|
+
createThemeExtensions({ themeMode }),
|
|
60
49
|
|
|
61
|
-
//
|
|
62
|
-
|
|
50
|
+
// Extend markdown with handlebars support.
|
|
51
|
+
createMarkdownExtensions({ themeMode }),
|
|
52
|
+
handlebars(),
|
|
63
53
|
].filter(isNotFalsy),
|
|
64
54
|
};
|
|
65
55
|
}, [themeMode, template.source?.target]);
|
|
66
56
|
|
|
67
|
-
return <div ref={parentRef} className={mx('
|
|
57
|
+
return <div ref={parentRef} className={mx('bs-full overflow-hidden', classNames)} />;
|
|
68
58
|
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* https://github.com/xiechao/lang-handlebars/blob/direct/src/highlight.js
|
|
72
|
-
*/
|
|
73
|
-
export const handlebarsHighlightStyle = HighlightStyle.define([
|
|
74
|
-
{
|
|
75
|
-
// Braces.
|
|
76
|
-
tag: tags.tagName,
|
|
77
|
-
class: 'text-redText',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
tag: tags.variableName,
|
|
81
|
-
class: 'text-blueText',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
tag: tags.keyword,
|
|
85
|
-
class: 'text-greenText',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
tag: tags.comment,
|
|
89
|
-
class: 'text-subdued',
|
|
90
|
-
},
|
|
91
|
-
]);
|
|
@@ -13,9 +13,10 @@ import { withClientProvider } from '@dxos/react-client/testing';
|
|
|
13
13
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
14
|
import { trim } from '@dxos/util';
|
|
15
15
|
|
|
16
|
-
import { TemplateForm } from './TemplateForm';
|
|
17
16
|
import { translations } from '../../translations';
|
|
18
17
|
|
|
18
|
+
import { TemplateForm } from './TemplateForm';
|
|
19
|
+
|
|
19
20
|
const TEMPLATE = trim`
|
|
20
21
|
You are a machine that is an expert chess player.
|
|
21
22
|
The move history of the current game is: {{history}}
|
|
@@ -30,7 +31,13 @@ const DefaultStory = () => {
|
|
|
30
31
|
const client = useClient();
|
|
31
32
|
const [blueprint] = useState(() => {
|
|
32
33
|
const space = client.spaces.default;
|
|
33
|
-
return space.db.add(
|
|
34
|
+
return space.db.add(
|
|
35
|
+
Blueprint.make({
|
|
36
|
+
key: 'example.com/blueprint/test',
|
|
37
|
+
name: 'Test',
|
|
38
|
+
instructions: Template.make({ source: TEMPLATE }),
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
34
41
|
});
|
|
35
42
|
|
|
36
43
|
return (
|
|
@@ -40,15 +47,15 @@ const DefaultStory = () => {
|
|
|
40
47
|
);
|
|
41
48
|
};
|
|
42
49
|
|
|
43
|
-
const meta
|
|
50
|
+
const meta = {
|
|
44
51
|
title: 'plugins/plugin-assistant/TemplateForm',
|
|
45
52
|
component: TemplateForm,
|
|
46
53
|
render: DefaultStory,
|
|
47
54
|
decorators: [
|
|
48
55
|
withClientProvider({
|
|
56
|
+
types: [Blueprint.Blueprint],
|
|
49
57
|
createIdentity: true,
|
|
50
58
|
createSpace: true,
|
|
51
|
-
types: [Template.Template],
|
|
52
59
|
}),
|
|
53
60
|
withLayout({ fullscreen: true, classNames: 'flex justify-center' }),
|
|
54
61
|
withTheme,
|
|
@@ -56,7 +63,7 @@ const meta: Meta<typeof TemplateForm> = {
|
|
|
56
63
|
parameters: {
|
|
57
64
|
translations,
|
|
58
65
|
},
|
|
59
|
-
}
|
|
66
|
+
} satisfies Meta<typeof TemplateForm>;
|
|
60
67
|
|
|
61
68
|
export default meta;
|
|
62
69
|
|
|
@@ -10,9 +10,10 @@ import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
|
10
10
|
import { attentionSurface, groupBorder, mx } from '@dxos/react-ui-theme';
|
|
11
11
|
import { isNonNullable } from '@dxos/util';
|
|
12
12
|
|
|
13
|
-
import { TemplateEditor } from './TemplateEditor';
|
|
14
13
|
import { meta } from '../../meta';
|
|
15
14
|
|
|
15
|
+
import { TemplateEditor } from './TemplateEditor';
|
|
16
|
+
|
|
16
17
|
export type TemplateFormProps = {
|
|
17
18
|
id: string;
|
|
18
19
|
template: Template.Template;
|
|
@@ -67,6 +68,7 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
67
68
|
</Select.Option>
|
|
68
69
|
))}
|
|
69
70
|
</Select.Viewport>
|
|
71
|
+
<Select.Arrow />
|
|
70
72
|
</Select.Content>
|
|
71
73
|
</Select.Portal>
|
|
72
74
|
</Select.Root>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
type CompletionContext,
|
|
7
|
+
type CompletionResult,
|
|
8
|
+
autocompletion,
|
|
9
|
+
completionKeymap,
|
|
10
|
+
} from '@codemirror/autocomplete';
|
|
11
|
+
import { type Extension } from '@codemirror/state';
|
|
12
|
+
import { Decoration, type DecorationSet, type EditorView, ViewPlugin, type ViewUpdate, keymap } from '@codemirror/view';
|
|
13
|
+
|
|
14
|
+
export type HandlebarsOptions = {};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Simple Handlebars plugin for CodeMirror.
|
|
18
|
+
* Supports:
|
|
19
|
+
* - Comments: {{! comment }}
|
|
20
|
+
* - Commands: {{#command}} {{/command}}
|
|
21
|
+
* - Variables: {{var}}
|
|
22
|
+
* - Commands with variables: {{#each items}} {{/each}}
|
|
23
|
+
*/
|
|
24
|
+
export const handlebars = (_: HandlebarsOptions = {}): Extension => {
|
|
25
|
+
return [
|
|
26
|
+
handlebarsHighlightPlugin,
|
|
27
|
+
autocompletion({
|
|
28
|
+
activateOnTyping: true,
|
|
29
|
+
aboveCursor: true,
|
|
30
|
+
closeOnBlur: true,
|
|
31
|
+
override: [handlebarsCompletions],
|
|
32
|
+
}),
|
|
33
|
+
keymap.of(completionKeymap),
|
|
34
|
+
];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const regex = {
|
|
38
|
+
comment: /\{\{!\s*[^}]*\}\}/g,
|
|
39
|
+
brackets: /\{\{[^}]*\}\}/g,
|
|
40
|
+
command: /\{\{[#/]([^}]+)\}\}/g,
|
|
41
|
+
var: /\{\{(?!\s*!)(\w[^}]*)\}\}/g,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* ViewPlugin that decorates Handlebars syntax.
|
|
46
|
+
*/
|
|
47
|
+
const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
48
|
+
class {
|
|
49
|
+
decorations: DecorationSet;
|
|
50
|
+
|
|
51
|
+
constructor(view: EditorView) {
|
|
52
|
+
this.decorations = this.buildDeco(view);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
buildDeco(view: EditorView) {
|
|
56
|
+
const widgets: any[] = [];
|
|
57
|
+
|
|
58
|
+
for (const { from, to } of view.visibleRanges) {
|
|
59
|
+
const text = view.state.doc.sliceString(from, to);
|
|
60
|
+
|
|
61
|
+
// Match comments: {{! comment }}
|
|
62
|
+
{
|
|
63
|
+
let match;
|
|
64
|
+
while ((match = regex.comment.exec(text)) !== null) {
|
|
65
|
+
const start = from + match.index;
|
|
66
|
+
const end = start + match[0].length;
|
|
67
|
+
widgets.push(Decoration.mark({ class: 'text-subdued' }).range(start, end));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Match brackets: {{ and }}
|
|
72
|
+
{
|
|
73
|
+
let match;
|
|
74
|
+
while ((match = regex.brackets.exec(text)) !== null) {
|
|
75
|
+
const start = from + match.index;
|
|
76
|
+
const end = start + match[0].length;
|
|
77
|
+
widgets.push(Decoration.mark({ class: 'text-subdued' }).range(start, end));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Match commands: {{#command}} and {{/command}}
|
|
82
|
+
{
|
|
83
|
+
let match;
|
|
84
|
+
while ((match = regex.command.exec(text)) !== null) {
|
|
85
|
+
const start = from + match.index + 2;
|
|
86
|
+
let end = start + match[0].length - 4;
|
|
87
|
+
const text = view.state.doc.sliceString(start, end);
|
|
88
|
+
const parts = text.split(/\s+/);
|
|
89
|
+
if (parts.length > 1) {
|
|
90
|
+
const idx = start + parts[0].length;
|
|
91
|
+
widgets.push(Decoration.mark({ class: 'text-greenText' }).range(idx, end));
|
|
92
|
+
end = idx;
|
|
93
|
+
}
|
|
94
|
+
widgets.push(Decoration.mark({ class: 'text-blueText' }).range(start, end));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Match variables: {{var}}
|
|
99
|
+
{
|
|
100
|
+
let match;
|
|
101
|
+
while ((match = regex.var.exec(text)) !== null) {
|
|
102
|
+
const start = from + match.index + 2;
|
|
103
|
+
const end = start + match[0].length - 4;
|
|
104
|
+
widgets.push(Decoration.mark({ class: 'text-greenText' }).range(start, end));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Sort decorations by position to avoid "Ranges must be added sorted" error.
|
|
110
|
+
widgets.sort((a, b) => a.from - b.from || a.startSide - b.startSide);
|
|
111
|
+
return Decoration.set(widgets);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
update(update: ViewUpdate) {
|
|
115
|
+
if (update.docChanged || update.viewportChanged) {
|
|
116
|
+
this.decorations = this.buildDeco(update.view);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
decorations: (v) => v.decorations,
|
|
122
|
+
},
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
// TODO(burdon): Pass in variables.
|
|
126
|
+
const variables = ['this'];
|
|
127
|
+
const commands = ['this', 'each', 'if', 'unless', 'with'];
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Provides completions for Handlebars variables.
|
|
131
|
+
*/
|
|
132
|
+
function handlebarsCompletions(context: CompletionContext): CompletionResult | null {
|
|
133
|
+
const match = context.matchBefore(/\{\{[^}]*/);
|
|
134
|
+
if (!match || match.from === match.to) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let type = 'variable';
|
|
139
|
+
let text = match.text.slice(2);
|
|
140
|
+
let from = match.from + 2;
|
|
141
|
+
let matches = [];
|
|
142
|
+
if (text.startsWith('#') || text.startsWith('/')) {
|
|
143
|
+
const idx = text.lastIndexOf(' ');
|
|
144
|
+
if (idx !== -1) {
|
|
145
|
+
type = 'variable';
|
|
146
|
+
matches = variables;
|
|
147
|
+
text = text.slice(idx + 1);
|
|
148
|
+
from += idx + 1;
|
|
149
|
+
} else {
|
|
150
|
+
type = 'command';
|
|
151
|
+
text = text.slice(1);
|
|
152
|
+
matches = commands;
|
|
153
|
+
from += 1;
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
type = 'variable';
|
|
157
|
+
matches = variables;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const options = matches.filter((name) => name.startsWith(text)).map((name) => ({ type, label: name }));
|
|
161
|
+
return {
|
|
162
|
+
from,
|
|
163
|
+
options,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { fullyQualifiedId } from '@dxos/react-client/echo';
|
|
8
|
+
import { MenuProvider, ToolbarMenu } from '@dxos/react-ui-menu';
|
|
9
|
+
|
|
10
|
+
import { type ChatToolbarActionsProps, useChatToolbarActions } from './useChatToolbarActions';
|
|
11
|
+
|
|
12
|
+
export const Toolbar = ({ chat, companionTo, onReset }: ChatToolbarActionsProps) => {
|
|
13
|
+
const menu = useChatToolbarActions({ chat, companionTo, onReset });
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<MenuProvider {...menu} attendableId={companionTo ? fullyQualifiedId(companionTo) : fullyQualifiedId(chat)}>
|
|
17
|
+
<ToolbarMenu />
|
|
18
|
+
</MenuProvider>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
+
import { Effect } from 'effect';
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
|
|
9
|
+
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
10
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
11
|
+
import { invariant } from '@dxos/invariant';
|
|
12
|
+
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
13
|
+
import { getSpace, useQuery } from '@dxos/react-client/echo';
|
|
14
|
+
import { MenuBuilder, useMenuActions } from '@dxos/react-ui-menu';
|
|
15
|
+
|
|
16
|
+
import { meta } from '../../meta';
|
|
17
|
+
import { Assistant, AssistantAction } from '../../types';
|
|
18
|
+
|
|
19
|
+
export type ChatToolbarActionsProps = {
|
|
20
|
+
chat: Assistant.Chat;
|
|
21
|
+
companionTo?: Obj.Any;
|
|
22
|
+
onReset?: () => void;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const useChatToolbarActions = ({ chat, companionTo, onReset }: ChatToolbarActionsProps) => {
|
|
26
|
+
const { dispatch } = useIntentDispatcher();
|
|
27
|
+
const space = getSpace(chat);
|
|
28
|
+
const query = companionTo
|
|
29
|
+
? Query.select(Filter.ids(companionTo.id)).targetOf(Assistant.CompanionTo).source()
|
|
30
|
+
: Query.select(Filter.nothing());
|
|
31
|
+
// TODO(wittjosiah): Query in react vs query in rx?
|
|
32
|
+
const chats = useQuery(space, query);
|
|
33
|
+
|
|
34
|
+
return useMenuActions(
|
|
35
|
+
useMemo(
|
|
36
|
+
() =>
|
|
37
|
+
Rx.make(() => {
|
|
38
|
+
const builder = MenuBuilder.make()
|
|
39
|
+
.root({
|
|
40
|
+
label: ['chat toolbar title', { ns: meta.id }],
|
|
41
|
+
})
|
|
42
|
+
.action(
|
|
43
|
+
'new',
|
|
44
|
+
{
|
|
45
|
+
label: ['button new thread', { ns: meta.id }],
|
|
46
|
+
icon: 'ph--plus--regular',
|
|
47
|
+
type: 'new',
|
|
48
|
+
},
|
|
49
|
+
() =>
|
|
50
|
+
Effect.gen(function* () {
|
|
51
|
+
invariant(space);
|
|
52
|
+
const { object } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
53
|
+
yield* dispatch(createIntent(SpaceAction.AddObject, { object, target: space, hidden: true }));
|
|
54
|
+
if (companionTo) {
|
|
55
|
+
yield* dispatch(
|
|
56
|
+
createIntent(SpaceAction.AddRelation, {
|
|
57
|
+
space,
|
|
58
|
+
schema: Assistant.CompanionTo,
|
|
59
|
+
source: object,
|
|
60
|
+
target: companionTo,
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
yield* dispatch(createIntent(AssistantAction.SetCurrentChat, { companionTo, chat: object }));
|
|
64
|
+
}
|
|
65
|
+
}).pipe(Effect.runPromise),
|
|
66
|
+
)
|
|
67
|
+
.action(
|
|
68
|
+
'branch',
|
|
69
|
+
{
|
|
70
|
+
label: ['button branch thread', { ns: meta.id }],
|
|
71
|
+
icon: 'ph--git-branch--regular',
|
|
72
|
+
type: 'branch',
|
|
73
|
+
disabled: true,
|
|
74
|
+
},
|
|
75
|
+
() => {},
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
if (chats.length > 0) {
|
|
79
|
+
builder.group(
|
|
80
|
+
'chats',
|
|
81
|
+
{
|
|
82
|
+
label: ['chat history label', { ns: meta.id }],
|
|
83
|
+
icon: 'ph--clock-counter-clockwise--regular',
|
|
84
|
+
selectCardinality: 'single',
|
|
85
|
+
variant: 'dropdownMenu',
|
|
86
|
+
},
|
|
87
|
+
(builder) => {
|
|
88
|
+
chats
|
|
89
|
+
// TODO(wittjosiah): This should be the default sort order.
|
|
90
|
+
.toSorted((a, b) => a.id.localeCompare(b.id))
|
|
91
|
+
.forEach((chat) => {
|
|
92
|
+
builder.action(
|
|
93
|
+
chat.id,
|
|
94
|
+
{
|
|
95
|
+
label: Obj.getLabel(chat) ?? ['object name placeholder', { ns: Assistant.Chat.typename }],
|
|
96
|
+
},
|
|
97
|
+
() =>
|
|
98
|
+
Effect.gen(function* () {
|
|
99
|
+
invariant(companionTo);
|
|
100
|
+
yield* dispatch(createIntent(AssistantAction.SetCurrentChat, { companionTo, chat }));
|
|
101
|
+
}).pipe(Effect.runPromise),
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (onReset) {
|
|
109
|
+
builder.action(
|
|
110
|
+
'reset',
|
|
111
|
+
{
|
|
112
|
+
label: ['button reset', { ns: meta.id }],
|
|
113
|
+
icon: 'ph--trash--regular',
|
|
114
|
+
type: 'reset',
|
|
115
|
+
},
|
|
116
|
+
onReset,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return builder.build();
|
|
121
|
+
}),
|
|
122
|
+
[chats],
|
|
123
|
+
),
|
|
124
|
+
);
|
|
125
|
+
};
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import { IntentPlugin,
|
|
10
|
+
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
12
|
import { capabilities } from '@dxos/assistant-testing';
|
|
13
13
|
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
@@ -17,29 +17,23 @@ import { SpacePlugin } from '@dxos/plugin-space';
|
|
|
17
17
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
18
18
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
19
19
|
|
|
20
|
-
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
21
20
|
import { translations } from '../../translations';
|
|
22
21
|
|
|
22
|
+
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
23
|
+
|
|
23
24
|
const DefaultStory = (props: ToolboxProps) => {
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<Toolbox
|
|
27
|
-
{...props}
|
|
28
|
-
artifacts={artifactDefinitions}
|
|
29
|
-
classNames='w-[30rem] h-[15rem] rounded-sm border border-separator py-1'
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
25
|
+
return <Toolbox {...props} classNames='w-[30rem] h-[15rem] rounded-sm border border-separator py-1' />;
|
|
32
26
|
};
|
|
33
27
|
|
|
34
|
-
const meta
|
|
28
|
+
const meta = {
|
|
35
29
|
title: 'plugins/plugin-assistant/Toolbox',
|
|
36
|
-
component: Toolbox,
|
|
30
|
+
component: Toolbox as any,
|
|
37
31
|
render: DefaultStory,
|
|
38
32
|
decorators: [
|
|
39
33
|
withPluginManager({
|
|
40
34
|
plugins: [
|
|
41
35
|
ClientPlugin({
|
|
42
|
-
onClientInitialized: async (
|
|
36
|
+
onClientInitialized: async ({ client }) => {
|
|
43
37
|
await client.halo.createIdentity();
|
|
44
38
|
},
|
|
45
39
|
}),
|
|
@@ -59,10 +53,10 @@ const meta: Meta<typeof Toolbox> = {
|
|
|
59
53
|
layout: 'centered',
|
|
60
54
|
translations,
|
|
61
55
|
},
|
|
62
|
-
}
|
|
56
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
63
57
|
|
|
64
58
|
export default meta;
|
|
65
59
|
|
|
66
|
-
type Story =
|
|
60
|
+
type Story = StoryObj<typeof meta>;
|
|
67
61
|
|
|
68
62
|
export const Default: Story = {};
|