@dxos/plugin-assistant 0.8.3-staging.0fa589b → 0.8.4-main.1da679c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{TemplateContainer-QQHVOTSI.mjs → BlueprintContainer-6MZHBQ25.mjs} +11 -10
- package/dist/lib/browser/BlueprintContainer-6MZHBQ25.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-B4DLQE6Y.mjs +124 -0
- package/dist/lib/browser/ChatCompanion-B4DLQE6Y.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-Z7A3RKOY.mjs +73 -0
- package/dist/lib/browser/ChatContainer-Z7A3RKOY.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-PL5TSGD5.mjs +86 -0
- package/dist/lib/browser/ChatDialog-PL5TSGD5.mjs.map +7 -0
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs +150 -0
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs.map +7 -0
- package/dist/lib/browser/ai-service-4VESSFNB.mjs +18 -0
- package/dist/lib/browser/ai-service-4VESSFNB.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-BBDHBJXA.mjs +153 -0
- package/dist/lib/browser/app-graph-builder-BBDHBJXA.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-3SATLYJW.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-3SATLYJW.mjs.map +7 -0
- package/dist/lib/browser/chunk-BBT6KNXA.mjs +165 -0
- package/dist/lib/browser/chunk-BBT6KNXA.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-JDI4FEKA.mjs +299 -0
- package/dist/lib/browser/chunk-JDI4FEKA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XOZ7YMO3.mjs → chunk-O4LUJEDV.mjs} +3 -3
- package/dist/lib/browser/{chunk-XOZ7YMO3.mjs.map → chunk-O4LUJEDV.mjs.map} +1 -1
- package/dist/lib/browser/chunk-PQI3MGDN.mjs +169 -0
- package/dist/lib/browser/chunk-PQI3MGDN.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-TMKK6VCA.mjs +216 -0
- package/dist/lib/browser/chunk-TMKK6VCA.mjs.map +7 -0
- package/dist/lib/browser/chunk-YKODYEYR.mjs +16 -0
- package/dist/lib/browser/chunk-YKODYEYR.mjs.map +7 -0
- package/dist/lib/browser/chunk-YOBHCEEI.mjs +1941 -0
- package/dist/lib/browser/chunk-YOBHCEEI.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-6YWYDPTS.mjs +18 -0
- package/dist/lib/browser/edge-model-resolver-6YWYDPTS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +191 -128
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-MRZJU255.mjs +112 -0
- package/dist/lib/browser/intent-resolver-MRZJU255.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-QXLLTV2H.mjs +17 -0
- package/dist/lib/browser/local-model-resolver-QXLLTV2H.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-UKMOARXR.mjs +107 -0
- package/dist/lib/browser/react-surface-UKMOARXR.mjs.map +7 -0
- package/dist/lib/browser/{settings-XRHXVWGB.mjs → settings-4AJ34FKF.mjs} +9 -8
- package/dist/lib/browser/settings-4AJ34FKF.mjs.map +7 -0
- package/dist/lib/browser/state-ABR7YSSA.mjs +21 -0
- package/dist/lib/browser/state-ABR7YSSA.mjs.map +7 -0
- package/dist/lib/browser/toolkit-U7SKGAIC.mjs +191 -0
- package/dist/lib/browser/toolkit-U7SKGAIC.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -20
- package/dist/lib/node-esm/{TemplateContainer-SOEWY2ZN.mjs → BlueprintContainer-MUHW5HNY.mjs} +11 -10
- package/dist/lib/node-esm/BlueprintContainer-MUHW5HNY.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-DK6FULBU.mjs +125 -0
- package/dist/lib/node-esm/ChatCompanion-DK6FULBU.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-7IN7ZICQ.mjs +74 -0
- package/dist/lib/node-esm/ChatContainer-7IN7ZICQ.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-LPE653RZ.mjs +87 -0
- package/dist/lib/node-esm/ChatDialog-LPE653RZ.mjs.map +7 -0
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs +151 -0
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-I5JU4JN2.mjs +19 -0
- package/dist/lib/node-esm/ai-service-I5JU4JN2.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-EMR5JF6Z.mjs +154 -0
- package/dist/lib/node-esm/app-graph-builder-EMR5JF6Z.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-B6UDX5U3.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-B6UDX5U3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs +170 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5MYWJPYA.mjs +167 -0
- package/dist/lib/node-esm/chunk-5MYWJPYA.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-3UEZLJ2V.mjs → chunk-FHRJMZ7L.mjs} +6 -5
- package/dist/lib/node-esm/chunk-FHRJMZ7L.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GCNF3CQU.mjs +217 -0
- package/dist/lib/node-esm/chunk-GCNF3CQU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H3ZC4UL7.mjs +300 -0
- package/dist/lib/node-esm/chunk-H3ZC4UL7.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-BB2TAT4P.mjs → chunk-VFY2JG62.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-BB2TAT4P.mjs.map → chunk-VFY2JG62.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-X2YUKRBE.mjs +1942 -0
- package/dist/lib/node-esm/chunk-X2YUKRBE.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-A7B6QHLL.mjs +19 -0
- package/dist/lib/node-esm/edge-model-resolver-A7B6QHLL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +191 -128
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-CIXO3KMY.mjs +113 -0
- package/dist/lib/node-esm/intent-resolver-CIXO3KMY.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-JCYDHAZY.mjs +18 -0
- package/dist/lib/node-esm/local-model-resolver-JCYDHAZY.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-5NDJAWA2.mjs +108 -0
- package/dist/lib/node-esm/react-surface-5NDJAWA2.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-5IAY6BT4.mjs → settings-K2QW4ATZ.mjs} +9 -8
- package/dist/lib/node-esm/settings-K2QW4ATZ.mjs.map +7 -0
- package/dist/lib/node-esm/state-6UHESJI5.mjs +22 -0
- package/dist/lib/node-esm/state-6UHESJI5.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-LNLRBVDU.mjs +192 -0
- package/dist/lib/node-esm/toolkit-LNLRBVDU.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -20
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +4 -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 +8 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- 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 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- 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 +2 -2
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +5 -6
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +50 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/events.d.ts +35 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +3 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- 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 +7 -7
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts +8 -0
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -0
- 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 +11 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -0
- 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 +11 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +10 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +10 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts +6 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +22 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +282 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -0
- 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/index.d.ts +2 -0
- package/dist/types/src/components/ChatThread/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts +40 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.d.ts +2 -2
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts +8 -0
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +13 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +267 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/index.d.ts +2 -0
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +4 -8
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +261 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +5 -4
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +259 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +11 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +10 -8
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +262 -4
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +9 -12
- 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 -5
- 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 +12 -13
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +13 -0
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts +6 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
- package/dist/types/src/hooks/useItemTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts +7 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -0
- 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/processor/presets.d.ts +13 -0
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +73 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts +5 -5
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/stories/Chat.stories.d.ts +31 -0
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +4 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/DebugCard.d.ts +8 -0
- package/dist/types/src/stories/components/DebugCard.d.ts.map +1 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts +6 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts +7 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts +4 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ProjectContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ProjectContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts +6 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +4 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +17 -0
- package/dist/types/src/stories/components/index.d.ts.map +1 -0
- package/dist/types/src/stories/components/types.d.ts +7 -0
- package/dist/types/src/stories/components/types.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +9 -0
- package/dist/types/src/stories/testing/data.d.ts.map +1 -0
- package/dist/types/src/stories/testing/index.d.ts +3 -0
- package/dist/types/src/stories/testing/index.d.ts.map +1 -0
- package/dist/types/src/stories/testing/schema.d.ts +7 -0
- package/dist/types/src/stories/testing/schema.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +48 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +14 -0
- package/dist/types/src/testing/test-data.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +5 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +7 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +4 -0
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +84 -113
- 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 -3
- 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 +112 -81
- package/src/AssistantPlugin.tsx +86 -43
- package/src/capabilities/ai-service.ts +26 -0
- package/src/capabilities/app-graph-builder.ts +58 -144
- package/src/capabilities/blueprint-definition.ts +61 -0
- package/src/capabilities/capabilities.ts +9 -6
- package/src/capabilities/edge-model-resolver.ts +25 -0
- package/src/capabilities/index.ts +7 -1
- package/src/capabilities/intent-resolver.ts +67 -18
- package/src/capabilities/local-model-resolver.ts +30 -0
- package/src/capabilities/react-surface.tsx +40 -86
- package/src/capabilities/settings.ts +3 -3
- package/src/capabilities/state.ts +20 -0
- package/src/capabilities/toolkit.ts +163 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +86 -79
- package/src/components/BlueprintContainer.tsx +9 -133
- package/src/components/Chat/Chat.tsx +389 -0
- package/src/components/Chat/events.ts +57 -0
- package/src/components/Chat/index.ts +7 -0
- package/src/components/ChatCompanion.tsx +111 -0
- package/src/components/ChatContainer.tsx +33 -21
- package/src/components/ChatDialog.tsx +68 -0
- package/src/components/ChatProgress/ChatProgress.tsx +68 -0
- package/src/components/{AmbientDialog → ChatProgress}/index.ts +1 -1
- package/src/components/ChatPrompt/ChatActions.tsx +57 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +233 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +29 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +48 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +42 -0
- package/src/components/ChatPrompt/index.ts +9 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +130 -0
- package/src/components/ChatThread/ChatThread.tsx +93 -0
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/index.ts +5 -0
- package/src/components/ChatThread/reducers.ts +151 -0
- package/src/components/ChatThread/registry.tsx +189 -0
- package/src/components/ChatThread/sync.test.ts +81 -0
- package/src/components/ChatThread/sync.ts +113 -0
- package/src/components/PromptSettings.tsx +44 -45
- package/src/components/SequenceContainer.tsx +131 -0
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +33 -0
- package/src/components/{BlueprintEditor/BlueprintEditor.tsx → SequenceEditor/SequenceEditor.tsx} +8 -8
- package/src/components/SequenceEditor/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +45 -37
- package/src/components/TemplateEditor/TemplateEditor.tsx +30 -48
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +26 -19
- package/src/components/TemplateEditor/TemplateForm.tsx +52 -57
- package/src/components/TemplateEditor/handlebars-extension.ts +165 -0
- package/src/components/ToolBlock/ToolBlock.tsx +152 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbar/Toolbar.tsx +21 -0
- package/src/{experimental/transcription → components/Toolbar}/index.ts +2 -0
- package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +12 -19
- package/src/components/Toolbox/Toolbox.tsx +53 -27
- package/src/components/index.ts +6 -8
- package/src/events.ts +3 -3
- package/src/execution-graph/execution-graph.ts +211 -0
- package/src/execution-graph/index.ts +5 -0
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +46 -0
- package/src/functions/load.ts +42 -0
- package/src/hooks/index.ts +10 -6
- package/src/hooks/useBlueprintRegistry.ts +80 -0
- package/src/hooks/useChatProcessor.ts +66 -0
- package/src/hooks/useChatServices.ts +48 -0
- package/src/hooks/useContextBinder.ts +18 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useExecutionGraph.ts +20 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/{useContextProvider.ts → useReferencesProvider.ts} +22 -20
- package/src/meta.ts +1 -1
- package/src/processor/index.ts +6 -0
- package/src/processor/presets.ts +60 -0
- package/src/processor/processor.test.ts +77 -0
- package/src/processor/processor.ts +302 -0
- package/src/queue-logger.ts +16 -16
- package/src/stories/Chat.stories.tsx +804 -0
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +74 -0
- package/src/stories/components/ChessContainer.tsx +17 -0
- package/src/stories/components/CommentsContainer.tsx +25 -0
- package/src/stories/components/DebugCard.tsx +61 -0
- package/src/stories/components/GraphContainer.tsx +119 -0
- package/src/stories/components/InvocationsContainer.tsx +17 -0
- package/src/stories/components/LoggingContainer.tsx +33 -0
- package/src/stories/components/MessageContainer.tsx +22 -0
- package/src/stories/components/ProjectContainer.tsx +17 -0
- package/src/stories/components/PromptContainer.tsx +52 -0
- package/src/stories/components/ResearchInputStack.tsx +30 -0
- package/src/stories/components/ResearchOutputStack.tsx +29 -0
- package/src/stories/components/TasksContainer.tsx +49 -0
- package/src/stories/components/TokenManagerContainer.tsx +14 -0
- package/src/stories/components/TriggersContainer.tsx +12 -0
- package/src/stories/components/index.ts +21 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/{test-data.ts → testing/data.ts} +23 -9
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/schema.ts +17 -0
- package/src/stories/testing/testing.tsx +284 -0
- package/src/testing/index.ts +3 -1
- package/src/testing/test-data.ts +255 -0
- package/src/testing/test-functions.ts +9 -4
- package/src/testing/test-generator.ts +257 -0
- package/src/testing/test-sequence.ts +26 -0
- package/src/translations.ts +58 -28
- 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 -3
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs +0 -47
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs.map +0 -7
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs +0 -321
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs +0 -40
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-QQHVOTSI.mjs.map +0 -7
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs +0 -39
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-E4H5DCOJ.mjs +0 -225
- package/dist/lib/browser/app-graph-builder-E4H5DCOJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-AAOKC2JN.mjs +0 -208
- package/dist/lib/browser/chunk-AAOKC2JN.mjs.map +0 -7
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs +0 -157
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-JO4W3MF7.mjs +0 -2101
- package/dist/lib/browser/chunk-JO4W3MF7.mjs.map +0 -7
- package/dist/lib/browser/chunk-JQFUME3B.mjs +0 -87
- package/dist/lib/browser/chunk-JQFUME3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-MEGMOFJB.mjs +0 -16
- package/dist/lib/browser/chunk-MEGMOFJB.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs +0 -96
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs.map +0 -7
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs +0 -15
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs +0 -43
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LXCNUSZN.mjs +0 -159
- package/dist/lib/browser/react-surface-LXCNUSZN.mjs.map +0 -7
- package/dist/lib/browser/settings-XRHXVWGB.mjs.map +0 -7
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs +0 -73
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs.map +0 -7
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs +0 -344
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs +0 -68
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs.map +0 -7
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs +0 -58
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs.map +0 -7
- package/dist/lib/node/ai-client-7HNSMUMT.cjs +0 -53
- package/dist/lib/node/ai-client-7HNSMUMT.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs +0 -235
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs.map +0 -7
- package/dist/lib/node/chunk-4EEWTDQK.cjs +0 -117
- package/dist/lib/node/chunk-4EEWTDQK.cjs.map +0 -7
- package/dist/lib/node/chunk-FUAGEO7Q.cjs +0 -52
- package/dist/lib/node/chunk-FUAGEO7Q.cjs.map +0 -7
- package/dist/lib/node/chunk-HRNIUYVQ.cjs +0 -128
- package/dist/lib/node/chunk-HRNIUYVQ.cjs.map +0 -7
- package/dist/lib/node/chunk-IKZBMHSW.cjs +0 -184
- package/dist/lib/node/chunk-IKZBMHSW.cjs.map +0 -7
- package/dist/lib/node/chunk-LMDJEGZ2.cjs +0 -233
- package/dist/lib/node/chunk-LMDJEGZ2.cjs.map +0 -7
- package/dist/lib/node/chunk-NIDICM57.cjs +0 -2080
- package/dist/lib/node/chunk-NIDICM57.cjs.map +0 -7
- package/dist/lib/node/chunk-P74TWGMG.cjs +0 -44
- package/dist/lib/node/chunk-P74TWGMG.cjs.map +0 -7
- package/dist/lib/node/chunk-QGPWY6GW.cjs +0 -34
- package/dist/lib/node/chunk-QGPWY6GW.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -289
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs +0 -58
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs +0 -172
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs.map +0 -7
- package/dist/lib/node/settings-2JXLKYGE.cjs +0 -36
- package/dist/lib/node/settings-2JXLKYGE.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -54
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs +0 -48
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs +0 -322
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs +0 -41
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-SOEWY2ZN.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs +0 -40
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-3SY5MBIK.mjs +0 -226
- package/dist/lib/node-esm/app-graph-builder-3SY5MBIK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs +0 -18
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3UEZLJ2V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs +0 -98
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs +0 -209
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OD574YIU.mjs +0 -2102
- package/dist/lib/node-esm/chunk-OD574YIU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OYN6HLXZ.mjs +0 -88
- package/dist/lib/node-esm/chunk-OYN6HLXZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs +0 -158
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs +0 -44
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7HA5EDWY.mjs +0 -160
- package/dist/lib/node-esm/react-surface-7HA5EDWY.mjs.map +0 -7
- package/dist/lib/node-esm/settings-5IAY6BT4.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-client.d.ts +0 -5
- package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +0 -10
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +0 -8
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/index.d.ts +0 -2
- package/dist/types/src/components/AmbientDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/AssistantDialog.d.ts +0 -7
- package/dist/types/src/components/AssistantDialog.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts +0 -13
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts +0 -8
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/index.d.ts +0 -2
- package/dist/types/src/components/BlueprintEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +0 -23
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +0 -13
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts +0 -16
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts +0 -9
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/autocomplete.d.ts +0 -25
- package/dist/types/src/components/Prompt/autocomplete.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/index.d.ts +0 -3
- package/dist/types/src/components/Prompt/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/references.d.ts +0 -30
- package/dist/types/src/components/Prompt/references.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -8
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.d.ts +0 -28
- package/dist/types/src/components/Thread/Thread.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.stories.d.ts +0 -11
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +0 -13
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +0 -13
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +0 -1
- package/dist/types/src/components/Thread/index.d.ts +0 -3
- package/dist/types/src/components/Thread/index.d.ts.map +0 -1
- package/dist/types/src/components/Thread/reducer.d.ts +0 -12
- package/dist/types/src/components/Thread/reducer.d.ts.map +0 -1
- package/dist/types/src/experimental/transcription/index.d.ts +0 -1
- package/dist/types/src/experimental/transcription/index.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.d.ts +0 -72
- package/dist/types/src/hooks/processor.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/useContextProvider.d.ts +0 -17
- package/dist/types/src/hooks/useContextProvider.d.ts.map +0 -1
- package/dist/types/src/hooks/useMessageQueue.d.ts +0 -42
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +0 -1
- package/dist/types/src/hooks/useServices.d.ts +0 -7
- package/dist/types/src/hooks/useServices.d.ts.map +0 -1
- package/dist/types/src/hooks/useTextInputEvents.d.ts +0 -13
- package/dist/types/src/hooks/useTextInputEvents.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/stories/Prompt.stories.d.ts +0 -8
- package/dist/types/src/stories/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/stories/Query.stories.d.ts +0 -19
- package/dist/types/src/stories/Query.stories.d.ts.map +0 -1
- package/dist/types/src/stories/Research.stories.d.ts +0 -15
- package/dist/types/src/stories/Research.stories.d.ts.map +0 -1
- package/dist/types/src/stories/test-data.d.ts +0 -3
- package/dist/types/src/stories/test-data.d.ts.map +0 -1
- package/dist/types/src/stories/testing.d.ts +0 -12
- package/dist/types/src/stories/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-blueprint.d.ts +0 -8
- package/dist/types/src/testing/test-blueprint.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/chat.d.ts +0 -23
- package/dist/types/src/types/chat.d.ts.map +0 -1
- package/dist/types/src/types/template.d.ts +0 -56
- package/dist/types/src/types/template.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -50
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/ai-client.ts +0 -42
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +0 -84
- package/src/components/AmbientDialog/AmbientDialog.tsx +0 -117
- package/src/components/AssistantDialog.tsx +0 -37
- package/src/components/BlueprintEditor/BlueprintEditor.stories.tsx +0 -32
- package/src/components/BlueprintEditor/index.ts +0 -5
- package/src/components/Prompt/Prompt.stories.tsx +0 -121
- package/src/components/Prompt/Prompt.tsx +0 -124
- package/src/components/Prompt/PromptBar.stories.tsx +0 -69
- package/src/components/Prompt/PromptBar.tsx +0 -105
- package/src/components/Prompt/autocomplete.ts +0 -218
- package/src/components/Prompt/index.ts +0 -6
- package/src/components/Prompt/references.ts +0 -180
- package/src/components/TemplateContainer.tsx +0 -23
- package/src/components/Thread/Thread.stories.tsx +0 -201
- package/src/components/Thread/Thread.tsx +0 -118
- package/src/components/Thread/ThreadContainer.stories.tsx +0 -283
- package/src/components/Thread/ThreadContainer.tsx +0 -105
- package/src/components/Thread/ThreadMessage.tsx +0 -234
- package/src/components/Thread/ToolInvocations.tsx +0 -106
- package/src/components/Thread/index.ts +0 -6
- package/src/components/Thread/reducer.ts +0 -52
- package/src/hooks/processor.test.ts +0 -15
- package/src/hooks/processor.ts +0 -238
- package/src/hooks/useChatProcessor.tsx +0 -97
- package/src/hooks/useMessageQueue.ts +0 -22
- package/src/hooks/useServices.ts +0 -28
- package/src/hooks/useTextInputEvents.ts +0 -49
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/stories/Prompt.stories.tsx +0 -60
- package/src/stories/Query.stories.tsx +0 -514
- package/src/stories/Research.stories.tsx +0 -482
- package/src/stories/testing.ts +0 -60
- package/src/testing/test-blueprint.ts +0 -58
- 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/chat.ts +0 -32
- package/src/types/template.ts +0 -66
- package/src/types/types.ts +0 -48
- package/src/typings.d.ts +0 -9
- /package/dist/types/src/{hooks → processor}/processor.test.d.ts +0 -0
|
@@ -2,145 +2,21 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import JSON5 from 'json5';
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import React from 'react';
|
|
8
6
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
type Blueprint,
|
|
13
|
-
type BlueprintDefinition,
|
|
14
|
-
BlueprintMachine,
|
|
15
|
-
createLocalSearchTool,
|
|
16
|
-
createExaTool,
|
|
17
|
-
createGraphWriterTool,
|
|
18
|
-
} from '@dxos/assistant';
|
|
19
|
-
import { getSpace } from '@dxos/client/echo';
|
|
20
|
-
import { DXN, Key } from '@dxos/echo';
|
|
21
|
-
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
22
|
-
import { getSelectionSet, useSelectionManager } from '@dxos/react-ui-attention';
|
|
23
|
-
import { StackItem, type StackItemContentProps } from '@dxos/react-ui-stack';
|
|
7
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
8
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
24
9
|
|
|
25
|
-
import {
|
|
26
|
-
import { AssistantCapabilities } from '../capabilities';
|
|
27
|
-
import { meta } from '../meta';
|
|
28
|
-
import { QueueLogger } from '../queue-logger';
|
|
10
|
+
import { TemplateEditor } from './TemplateEditor';
|
|
29
11
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// TODO(burdon): Validate.
|
|
34
|
-
const parseBlueprint = (text: string): BlueprintDefinition | undefined => {
|
|
35
|
-
try {
|
|
36
|
-
const json = JSON5.parse(text);
|
|
37
|
-
const { steps } = json;
|
|
38
|
-
return { steps };
|
|
39
|
-
} catch (error) {
|
|
40
|
-
// Ignore.
|
|
41
|
-
}
|
|
12
|
+
export type BlueprintContainerProps = {
|
|
13
|
+
blueprint: Blueprint.Blueprint;
|
|
42
14
|
};
|
|
43
15
|
|
|
44
|
-
export const BlueprintContainer = ({
|
|
45
|
-
role,
|
|
46
|
-
blueprint,
|
|
47
|
-
}: Pick<StackItemContentProps, 'role'> & { blueprint: Blueprint }) => {
|
|
48
|
-
const { t } = useTranslation(meta.id);
|
|
49
|
-
const aiClient = useCapability(AssistantCapabilities.AiClient);
|
|
50
|
-
const selectionManager = useSelectionManager();
|
|
51
|
-
const [definition, setDefinition] = useState<BlueprintDefinition>();
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
setDefinition({
|
|
54
|
-
steps: blueprint.steps.map(({ instructions, tools }) => ({ instructions, tools })),
|
|
55
|
-
});
|
|
56
|
-
}, [blueprint]);
|
|
57
|
-
|
|
58
|
-
const editorRef = useRef<EditorView | undefined>(undefined);
|
|
59
|
-
|
|
60
|
-
// TODO(burdon): Factor out.
|
|
61
|
-
const toolRegistry = useMemo(() => {
|
|
62
|
-
const space = getSpace(blueprint);
|
|
63
|
-
if (!space) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// TODO(burdon): How should the queue be created?
|
|
68
|
-
const queue = space.queues.create();
|
|
69
|
-
|
|
70
|
-
return new ToolRegistry([
|
|
71
|
-
createExaTool({ apiKey: EXA_API_KEY }),
|
|
72
|
-
createLocalSearchTool(space.db, queue),
|
|
73
|
-
createGraphWriterTool({
|
|
74
|
-
db: space.db,
|
|
75
|
-
queue,
|
|
76
|
-
schema: [], // TODO(burdon): Get schema from client/blueprint?
|
|
77
|
-
onDone: async (objects) => {
|
|
78
|
-
await queue.append(objects);
|
|
79
|
-
},
|
|
80
|
-
}),
|
|
81
|
-
]);
|
|
82
|
-
}, [blueprint]);
|
|
83
|
-
|
|
84
|
-
const formatAndSave = useCallback((): BlueprintDefinition | undefined => {
|
|
85
|
-
if (!blueprint) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const text = editorRef.current?.state.doc.toString();
|
|
90
|
-
if (!text) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const definition = parseBlueprint(text);
|
|
95
|
-
if (!definition) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
setDefinition(definition);
|
|
100
|
-
const formatted = JSON.stringify(definition, null, 2);
|
|
101
|
-
editorRef.current?.dispatch({
|
|
102
|
-
changes: { from: 0, to: text.length, insert: formatted },
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
blueprint.steps.length = 0;
|
|
106
|
-
for (const step of definition.steps) {
|
|
107
|
-
blueprint.steps.push({
|
|
108
|
-
id: Key.ObjectId.random(),
|
|
109
|
-
instructions: step.instructions,
|
|
110
|
-
tools: step.tools,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return blueprint;
|
|
115
|
-
}, [blueprint]);
|
|
116
|
-
|
|
117
|
-
// TODO(burdon): Save raw blueprint separately from parsed blueprint? (like Script).
|
|
118
|
-
const handleSave = useCallback(() => formatAndSave(), [formatAndSave]);
|
|
119
|
-
|
|
120
|
-
const handleRun = useCallback(async () => {
|
|
121
|
-
if (!aiClient?.value || !toolRegistry) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
formatAndSave();
|
|
126
|
-
|
|
127
|
-
// Get input from selection.
|
|
128
|
-
const input = Array.from(getSelectionSet(selectionManager)).map((id) => DXN.fromLocalObjectId(id));
|
|
129
|
-
if (!input.length) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const machine = new BlueprintMachine(toolRegistry, blueprint).setLogger(new QueueLogger(blueprint));
|
|
134
|
-
await machine.runToCompletion({ aiClient: aiClient.value, input });
|
|
135
|
-
}, [aiClient.value, blueprint, formatAndSave, selectionManager, toolRegistry]);
|
|
136
|
-
|
|
16
|
+
export const BlueprintContainer = ({ blueprint }: BlueprintContainerProps) => {
|
|
137
17
|
return (
|
|
138
|
-
<StackItem.Content
|
|
139
|
-
<
|
|
140
|
-
<Toolbar.Button onClick={handleSave}>{t('button save')}</Toolbar.Button>
|
|
141
|
-
<Toolbar.Button onClick={handleRun}>{t('button run')}</Toolbar.Button>
|
|
142
|
-
</Toolbar.Root>
|
|
143
|
-
{definition && <BlueprintEditor ref={editorRef} blueprint={definition} />}
|
|
18
|
+
<StackItem.Content classNames='container-max-width'>
|
|
19
|
+
<TemplateEditor id={blueprint.id} template={blueprint.instructions} />
|
|
144
20
|
</StackItem.Content>
|
|
145
21
|
);
|
|
146
22
|
};
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Extension, Prec } from '@codemirror/state';
|
|
6
|
+
import { keymap } from '@codemirror/view';
|
|
7
|
+
import { useRxValue } from '@effect-rx/rx-react';
|
|
8
|
+
import { createContext } from '@radix-ui/react-context';
|
|
9
|
+
import { Array, Option } from 'effect';
|
|
10
|
+
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
11
|
+
|
|
12
|
+
import { Event } from '@dxos/async';
|
|
13
|
+
import { Obj } from '@dxos/echo';
|
|
14
|
+
import { useVoiceInput } from '@dxos/plugin-transcription';
|
|
15
|
+
import { type Space, getSpace, useQueue } from '@dxos/react-client/echo';
|
|
16
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
17
|
+
import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
|
|
18
|
+
import { ChatEditor, type ChatEditorController, type ChatEditorProps, references } from '@dxos/react-ui-chat';
|
|
19
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
20
|
+
import { DataType } from '@dxos/schema';
|
|
21
|
+
import { isNotFalsy } from '@dxos/util';
|
|
22
|
+
|
|
23
|
+
import { useReferencesProvider } from '../../hooks';
|
|
24
|
+
import { meta } from '../../meta';
|
|
25
|
+
import { type AiChatProcessor } from '../../processor';
|
|
26
|
+
import { type Assistant } from '../../types';
|
|
27
|
+
import {
|
|
28
|
+
ChatActions,
|
|
29
|
+
type ChatActionsProps,
|
|
30
|
+
ChatOptions,
|
|
31
|
+
type ChatPresetsProps,
|
|
32
|
+
ChatReferences,
|
|
33
|
+
ChatStatusIndicator,
|
|
34
|
+
} from '../ChatPrompt';
|
|
35
|
+
import {
|
|
36
|
+
type ChatThreadController,
|
|
37
|
+
ChatThread as NaturalChatThread,
|
|
38
|
+
type ChatThreadProps as NaturalChatThreadProps,
|
|
39
|
+
} from '../ChatThread';
|
|
40
|
+
|
|
41
|
+
import { type ChatEvent } from './events';
|
|
42
|
+
|
|
43
|
+
//
|
|
44
|
+
// Context
|
|
45
|
+
// NOTE: The context should not be exported. It is only used internally.
|
|
46
|
+
// Components outside of this Radix-style group shuld define their own APIs.
|
|
47
|
+
//
|
|
48
|
+
|
|
49
|
+
type ChatContextValue = {
|
|
50
|
+
debug?: boolean;
|
|
51
|
+
event: Event<ChatEvent>;
|
|
52
|
+
space: Space;
|
|
53
|
+
chat: Assistant.Chat;
|
|
54
|
+
messages: DataType.Message[];
|
|
55
|
+
processor: AiChatProcessor;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const [ChatContextProvider, useChatContext] = createContext<ChatContextValue>('Chat');
|
|
59
|
+
|
|
60
|
+
//
|
|
61
|
+
// Root
|
|
62
|
+
//
|
|
63
|
+
|
|
64
|
+
type ChatRootProps = ThemedClassName<
|
|
65
|
+
PropsWithChildren<
|
|
66
|
+
Pick<ChatContextValue, 'chat' | 'processor'> & {
|
|
67
|
+
onEvent?: (event: ChatEvent) => void;
|
|
68
|
+
}
|
|
69
|
+
>
|
|
70
|
+
>;
|
|
71
|
+
|
|
72
|
+
const ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }: ChatRootProps) => {
|
|
73
|
+
const [debug, setDebug] = useState(false);
|
|
74
|
+
const space = getSpace(chat);
|
|
75
|
+
|
|
76
|
+
// Messages.
|
|
77
|
+
const queue = useQueue<DataType.Message>(chat?.queue.dxn);
|
|
78
|
+
const pending = useRxValue(processor.messages);
|
|
79
|
+
const streaming = useRxValue(processor.streaming);
|
|
80
|
+
const lastPrompt = useRef<string | undefined>(undefined);
|
|
81
|
+
|
|
82
|
+
const messages = useMemo(() => {
|
|
83
|
+
const queueMessages = queue?.objects?.filter(Obj.instanceOf(DataType.Message)) ?? [];
|
|
84
|
+
return Array.dedupeWith([...queueMessages, ...pending], (a, b) => a.id === b.id);
|
|
85
|
+
}, [queue?.objects, pending]);
|
|
86
|
+
|
|
87
|
+
// Events.
|
|
88
|
+
const event = useMemo(() => new Event<ChatEvent>(), []);
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
return event.on((ev) => {
|
|
91
|
+
switch (ev.type) {
|
|
92
|
+
case 'toggle-debug': {
|
|
93
|
+
setDebug((current) => !current);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
case 'submit': {
|
|
98
|
+
const text = ev.text.trim();
|
|
99
|
+
if (!streaming && text.length) {
|
|
100
|
+
lastPrompt.current = ev.text;
|
|
101
|
+
void processor.request({ message: text });
|
|
102
|
+
}
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
case 'retry': {
|
|
107
|
+
if (!streaming) {
|
|
108
|
+
void processor.retry();
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
case 'cancel': {
|
|
114
|
+
if (streaming) {
|
|
115
|
+
void processor.cancel();
|
|
116
|
+
if (lastPrompt.current) {
|
|
117
|
+
event.emit({ type: 'update-prompt', text: lastPrompt.current });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
default: {
|
|
124
|
+
onEvent?.(ev);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}, [event, processor, streaming, onEvent]);
|
|
129
|
+
|
|
130
|
+
if (!space) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<ChatContextProvider
|
|
136
|
+
debug={debug}
|
|
137
|
+
event={event}
|
|
138
|
+
chat={chat}
|
|
139
|
+
space={space}
|
|
140
|
+
messages={messages}
|
|
141
|
+
processor={processor}
|
|
142
|
+
{...props}
|
|
143
|
+
>
|
|
144
|
+
<div role='none' className={mx('flex flex-col h-full overflow-hidden', classNames)}>
|
|
145
|
+
{children}
|
|
146
|
+
</div>
|
|
147
|
+
</ChatContextProvider>
|
|
148
|
+
);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
ChatRoot.displayName = 'Chat.Root';
|
|
152
|
+
|
|
153
|
+
//
|
|
154
|
+
// Prompt
|
|
155
|
+
//
|
|
156
|
+
|
|
157
|
+
type ChatPromptProps = ThemedClassName<
|
|
158
|
+
{
|
|
159
|
+
outline?: boolean;
|
|
160
|
+
} & Pick<ChatEditorProps, 'placeholder'> &
|
|
161
|
+
Omit<ChatPresetsProps, 'onChange'> & {
|
|
162
|
+
expandable?: boolean;
|
|
163
|
+
online?: boolean;
|
|
164
|
+
onOnlineChange?: (online: boolean) => void;
|
|
165
|
+
onPresetChange?: ChatPresetsProps['onChange'];
|
|
166
|
+
}
|
|
167
|
+
>;
|
|
168
|
+
|
|
169
|
+
const ChatPrompt = ({
|
|
170
|
+
classNames,
|
|
171
|
+
outline,
|
|
172
|
+
placeholder,
|
|
173
|
+
expandable,
|
|
174
|
+
online,
|
|
175
|
+
presets,
|
|
176
|
+
preset,
|
|
177
|
+
onPresetChange,
|
|
178
|
+
onOnlineChange,
|
|
179
|
+
}: ChatPromptProps) => {
|
|
180
|
+
const { t } = useTranslation(meta.id);
|
|
181
|
+
const { space, event, processor } = useChatContext(ChatPrompt.displayName);
|
|
182
|
+
|
|
183
|
+
const error = useRxValue(processor.error).pipe(Option.getOrUndefined);
|
|
184
|
+
const streaming = useRxValue(processor.streaming);
|
|
185
|
+
const active = useRxValue(processor.active);
|
|
186
|
+
const activeRef = useDynamicRef(active);
|
|
187
|
+
|
|
188
|
+
const editorRef = useRef<ChatEditorController>(null);
|
|
189
|
+
const [recordingState, setRecordingState] = useState(false);
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
return event.on((event) => {
|
|
192
|
+
switch (event.type) {
|
|
193
|
+
case 'update-prompt':
|
|
194
|
+
if (!editorRef.current?.getText()?.length) {
|
|
195
|
+
editorRef.current?.setText(event.text);
|
|
196
|
+
editorRef.current?.focus();
|
|
197
|
+
}
|
|
198
|
+
break;
|
|
199
|
+
case 'record-start':
|
|
200
|
+
setRecordingState(true);
|
|
201
|
+
break;
|
|
202
|
+
case 'record-stop':
|
|
203
|
+
setRecordingState(false);
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}, [event]);
|
|
208
|
+
|
|
209
|
+
// TODO(burdon): Configure capability in TranscriptionPlugin.
|
|
210
|
+
const { recording } = useVoiceInput({
|
|
211
|
+
active: recordingState,
|
|
212
|
+
onUpdate: (text) => {
|
|
213
|
+
editorRef.current?.setText(text);
|
|
214
|
+
editorRef.current?.focus();
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// TODO(burdon): Reconcile with object tags.
|
|
219
|
+
const referencesProvider = useReferencesProvider(space);
|
|
220
|
+
const extensions = useMemo<Extension[]>(() => {
|
|
221
|
+
return [
|
|
222
|
+
referencesProvider && references({ provider: referencesProvider }),
|
|
223
|
+
Prec.highest(
|
|
224
|
+
keymap.of(
|
|
225
|
+
[
|
|
226
|
+
{
|
|
227
|
+
key: 'cmd-d',
|
|
228
|
+
preventDefault: true,
|
|
229
|
+
run: () => {
|
|
230
|
+
event.emit({ type: 'toggle-debug' });
|
|
231
|
+
return true;
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
expandable && {
|
|
235
|
+
key: 'cmd-ArrowUp',
|
|
236
|
+
preventDefault: true,
|
|
237
|
+
run: () => {
|
|
238
|
+
event.emit({ type: 'thread-open' });
|
|
239
|
+
return true;
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
expandable && {
|
|
243
|
+
key: 'cmd-ArrowDown',
|
|
244
|
+
preventDefault: true,
|
|
245
|
+
run: () => {
|
|
246
|
+
event.emit({ type: 'thread-close' });
|
|
247
|
+
return true;
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
].filter(isNotFalsy),
|
|
251
|
+
),
|
|
252
|
+
),
|
|
253
|
+
].filter(isNotFalsy);
|
|
254
|
+
}, [event, expandable, referencesProvider]);
|
|
255
|
+
|
|
256
|
+
const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
|
|
257
|
+
(text) => {
|
|
258
|
+
if (!activeRef.current) {
|
|
259
|
+
event.emit({ type: 'submit', text });
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
[event],
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
const handleEvent = useCallback<NonNullable<ChatActionsProps['onEvent']>>(
|
|
267
|
+
(ev) => {
|
|
268
|
+
event.emit(ev);
|
|
269
|
+
},
|
|
270
|
+
[event],
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<div
|
|
275
|
+
className={mx(
|
|
276
|
+
'is-full flex flex-col density-fine',
|
|
277
|
+
outline && [
|
|
278
|
+
'p-2 bg-groupSurface border border-subduedSeparator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded',
|
|
279
|
+
],
|
|
280
|
+
classNames,
|
|
281
|
+
)}
|
|
282
|
+
>
|
|
283
|
+
<div className='flex gap-2'>
|
|
284
|
+
<ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
|
|
285
|
+
|
|
286
|
+
<ChatEditor
|
|
287
|
+
ref={editorRef}
|
|
288
|
+
autoFocus
|
|
289
|
+
lineWrapping
|
|
290
|
+
classNames='col-span-2 pbs-0.5'
|
|
291
|
+
placeholder={placeholder ?? t('prompt placeholder')}
|
|
292
|
+
extensions={extensions}
|
|
293
|
+
onSubmit={handleSubmit}
|
|
294
|
+
/>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
<div className='flex pbs-2 items-center'>
|
|
298
|
+
<ChatOptions
|
|
299
|
+
space={space}
|
|
300
|
+
blueprintRegistry={processor.blueprintRegistry}
|
|
301
|
+
context={processor.context}
|
|
302
|
+
preset={preset}
|
|
303
|
+
presets={presets}
|
|
304
|
+
onPresetChange={onPresetChange}
|
|
305
|
+
/>
|
|
306
|
+
|
|
307
|
+
<div role='none' className='pli-cardSpacingChrome grow'>
|
|
308
|
+
<ChatReferences space={space} context={processor.context} />
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
<ChatActions
|
|
312
|
+
classNames='col-span-2'
|
|
313
|
+
microphone={true}
|
|
314
|
+
recording={recording}
|
|
315
|
+
processing={streaming}
|
|
316
|
+
onEvent={handleEvent}
|
|
317
|
+
>
|
|
318
|
+
{online !== undefined && (
|
|
319
|
+
<Input.Root>
|
|
320
|
+
<Input.Switch classNames='mis-2 mie-2' checked={online} onCheckedChange={onOnlineChange} />
|
|
321
|
+
</Input.Root>
|
|
322
|
+
)}
|
|
323
|
+
</ChatActions>
|
|
324
|
+
</div>
|
|
325
|
+
</div>
|
|
326
|
+
);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
ChatPrompt.displayName = 'Chat.Prompt';
|
|
330
|
+
|
|
331
|
+
//
|
|
332
|
+
// Thread
|
|
333
|
+
//
|
|
334
|
+
|
|
335
|
+
type ChatThreadProps = Omit<NaturalChatThreadProps, 'identity' | 'messages' | 'tools'>;
|
|
336
|
+
|
|
337
|
+
const ChatThread = (props: ChatThreadProps) => {
|
|
338
|
+
const { event, messages, processor } = useChatContext(ChatThread.displayName);
|
|
339
|
+
const identity = useIdentity();
|
|
340
|
+
const error = useRxValue(processor.error).pipe(Option.getOrUndefined);
|
|
341
|
+
|
|
342
|
+
const scrollerRef = useRef<ChatThreadController | null>(null);
|
|
343
|
+
useEffect(() => {
|
|
344
|
+
return event.on((event) => {
|
|
345
|
+
switch (event.type) {
|
|
346
|
+
case 'submit':
|
|
347
|
+
case 'scroll-to-bottom':
|
|
348
|
+
scrollerRef.current?.scrollToBottom();
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}, [event]);
|
|
353
|
+
|
|
354
|
+
const handleEvent = useCallback<NonNullable<NaturalChatThreadProps['onEvent']>>(
|
|
355
|
+
(ev) => {
|
|
356
|
+
event.emit(ev);
|
|
357
|
+
},
|
|
358
|
+
[event],
|
|
359
|
+
);
|
|
360
|
+
|
|
361
|
+
if (!identity) {
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return (
|
|
366
|
+
<NaturalChatThread
|
|
367
|
+
{...props}
|
|
368
|
+
ref={scrollerRef}
|
|
369
|
+
identity={identity}
|
|
370
|
+
messages={messages}
|
|
371
|
+
error={error}
|
|
372
|
+
onEvent={handleEvent}
|
|
373
|
+
/>
|
|
374
|
+
);
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
ChatThread.displayName = 'Chat.Thread';
|
|
378
|
+
|
|
379
|
+
//
|
|
380
|
+
// Chat
|
|
381
|
+
//
|
|
382
|
+
|
|
383
|
+
export const Chat = {
|
|
384
|
+
Root: ChatRoot,
|
|
385
|
+
Prompt: ChatPrompt,
|
|
386
|
+
Thread: ChatThread,
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
export type { ChatRootProps, ChatThreadProps, ChatPromptProps, ChatEvent };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Obj } from '@dxos/echo';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The main `ChatRoot` manages the `ChatContextValue` which contains an `event` property that subcomponents
|
|
9
|
+
* can subscribe to and submit events. Unhandled events are passed to the external `onEvent` callback.
|
|
10
|
+
*/
|
|
11
|
+
export type ChatEvent =
|
|
12
|
+
| {
|
|
13
|
+
type: 'toggle-debug';
|
|
14
|
+
}
|
|
15
|
+
//
|
|
16
|
+
// Thread
|
|
17
|
+
//
|
|
18
|
+
| {
|
|
19
|
+
type: 'submit';
|
|
20
|
+
text: string;
|
|
21
|
+
}
|
|
22
|
+
| {
|
|
23
|
+
type: 'retry';
|
|
24
|
+
}
|
|
25
|
+
| {
|
|
26
|
+
type: 'cancel';
|
|
27
|
+
}
|
|
28
|
+
| {
|
|
29
|
+
type: 'delete';
|
|
30
|
+
id: string;
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
type: 'add';
|
|
34
|
+
object: Obj.Any;
|
|
35
|
+
}
|
|
36
|
+
//
|
|
37
|
+
// UX
|
|
38
|
+
//
|
|
39
|
+
| {
|
|
40
|
+
type: 'update-prompt';
|
|
41
|
+
text: string;
|
|
42
|
+
}
|
|
43
|
+
| {
|
|
44
|
+
type: 'scroll-to-bottom';
|
|
45
|
+
}
|
|
46
|
+
| {
|
|
47
|
+
type: 'thread-open';
|
|
48
|
+
}
|
|
49
|
+
| {
|
|
50
|
+
type: 'thread-close';
|
|
51
|
+
}
|
|
52
|
+
| {
|
|
53
|
+
type: 'record-start';
|
|
54
|
+
}
|
|
55
|
+
| {
|
|
56
|
+
type: 'record-stop';
|
|
57
|
+
};
|