@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
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC, type PropsWithChildren } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type MessageContentBlock, type Message, type Tool } from '@dxos/ai';
|
|
8
|
-
import { Surface } from '@dxos/app-framework';
|
|
9
|
-
import { type Obj } from '@dxos/echo';
|
|
10
|
-
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
12
|
-
import { Button, Icon, IconButton, type ThemedClassName } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
14
|
-
MarkdownViewer,
|
|
15
|
-
ToggleContainer as NativeToggleContainer,
|
|
16
|
-
type ToggleContainerProps,
|
|
17
|
-
} from '@dxos/react-ui-components';
|
|
18
|
-
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
19
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
20
|
-
import { safeParseJson } from '@dxos/util';
|
|
21
|
-
|
|
22
|
-
import { ToolBlock, isToolMessage } from './ToolInvocations';
|
|
23
|
-
import { ToolboxContainer } from '../Toolbox';
|
|
24
|
-
|
|
25
|
-
const panelClassNames = 'flex flex-col w-full px-2 bg-activeSurface rounded-md';
|
|
26
|
-
const userClassNames = 'bg-[--user-fill] text-accentSurfaceText';
|
|
27
|
-
|
|
28
|
-
const ToggleContainer = (props: ToggleContainerProps) => {
|
|
29
|
-
return <NativeToggleContainer {...props} classNames={mx(panelClassNames, props.classNames)} />;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const MessageContainer = ({ children, classNames, user }: ThemedClassName<PropsWithChildren<{ user?: boolean }>>) => {
|
|
33
|
-
if (!children) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div role='list-item' className={mx('flex w-full', user && 'justify-end', classNames)}>
|
|
39
|
-
<div className={mx(user ? ['px-2 py-1 rounded-md', userClassNames] : 'w-full')}>{children}</div>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type ThreadMessageProps = ThemedClassName<{
|
|
45
|
-
space?: Space;
|
|
46
|
-
message: Message;
|
|
47
|
-
debug?: boolean;
|
|
48
|
-
tools?: Tool[];
|
|
49
|
-
onPrompt?: (text: string) => void;
|
|
50
|
-
onDelete?: (id: string) => void;
|
|
51
|
-
onAddToGraph?: (object: Obj.Any) => void;
|
|
52
|
-
}>;
|
|
53
|
-
|
|
54
|
-
export const ThreadMessage: FC<ThreadMessageProps> = ({
|
|
55
|
-
classNames,
|
|
56
|
-
space,
|
|
57
|
-
message,
|
|
58
|
-
tools,
|
|
59
|
-
onPrompt,
|
|
60
|
-
onAddToGraph,
|
|
61
|
-
}) => {
|
|
62
|
-
const { role, content = [] } = message;
|
|
63
|
-
|
|
64
|
-
// TODO(burdon): Restructure types to make check unnecessary.
|
|
65
|
-
if (isToolMessage(message)) {
|
|
66
|
-
return (
|
|
67
|
-
<MessageContainer classNames={mx(classNames, 'animate-[fadeIn_0.5s]')}>
|
|
68
|
-
<ToolBlock space={space} classNames={panelClassNames} message={message} tools={tools} />
|
|
69
|
-
</MessageContainer>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return content.map((block, idx) => {
|
|
74
|
-
// TODO(burdon): Filter empty messages.
|
|
75
|
-
if (block.type === 'text' && block.text.replaceAll(/\s+/g, '').length === 0) {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const Component = components[block.type] ?? components.default;
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<MessageContainer
|
|
83
|
-
key={idx}
|
|
84
|
-
classNames={mx(classNames, 'animate-[fadeIn_0.5s]')}
|
|
85
|
-
user={block.type === 'text' && role === 'user'}
|
|
86
|
-
>
|
|
87
|
-
<Component space={space} block={block} onPrompt={onPrompt} onAddToGraph={onAddToGraph} />
|
|
88
|
-
</MessageContainer>
|
|
89
|
-
);
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
type BlockComponent = FC<{
|
|
94
|
-
space?: Space;
|
|
95
|
-
block: MessageContentBlock;
|
|
96
|
-
onPrompt?: (text: string) => void;
|
|
97
|
-
onAddToGraph?: (object: Obj.Any) => void;
|
|
98
|
-
}>;
|
|
99
|
-
|
|
100
|
-
const components: Record<string, BlockComponent> = {
|
|
101
|
-
//
|
|
102
|
-
// Text
|
|
103
|
-
//
|
|
104
|
-
['text' as const]: ({ block }) => {
|
|
105
|
-
invariant(block.type === 'text');
|
|
106
|
-
// const [open, setOpen] = useState(block.disposition === 'cot' && block.pending);
|
|
107
|
-
const title = block.disposition ? titles[block.disposition] : undefined;
|
|
108
|
-
if (!title) {
|
|
109
|
-
return <MarkdownViewer classNames='[&>p]:animate-[fadeIn_0.5s]' content={block.text} />;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// TOOD(burdon): Store last time user opened/closed COT.
|
|
113
|
-
// Autoclose when streaming ends.
|
|
114
|
-
// useEffect(() => {
|
|
115
|
-
// if (block.disposition === 'cot' && !block.pending) {
|
|
116
|
-
// setOpen(false);
|
|
117
|
-
// }
|
|
118
|
-
// }, [block.disposition, block.pending]);
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<ToggleContainer
|
|
122
|
-
// open={open}
|
|
123
|
-
defaultOpen={systemDispositions.includes(block.disposition ?? '') && block.pending}
|
|
124
|
-
title={title}
|
|
125
|
-
icon={
|
|
126
|
-
block.pending ? (
|
|
127
|
-
<Icon icon={'ph--circle-notch--regular'} classNames='text-subdued ml-2 animate-spin' size={4} />
|
|
128
|
-
) : undefined
|
|
129
|
-
}
|
|
130
|
-
>
|
|
131
|
-
<MarkdownViewer
|
|
132
|
-
content={block.text}
|
|
133
|
-
classNames={['pbe-2', systemDispositions.includes(block.disposition ?? '') && 'text-sm text-subdued']}
|
|
134
|
-
/>
|
|
135
|
-
</ToggleContainer>
|
|
136
|
-
);
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
//
|
|
140
|
-
// JSON
|
|
141
|
-
//
|
|
142
|
-
['json' as const]: ({ space, block, onPrompt, onAddToGraph }) => {
|
|
143
|
-
invariant(block.type === 'json');
|
|
144
|
-
|
|
145
|
-
switch (block.disposition) {
|
|
146
|
-
case 'tool_list': {
|
|
147
|
-
return (
|
|
148
|
-
<ToggleContainer title={titles[block.disposition]} defaultOpen={true}>
|
|
149
|
-
<ToolboxContainer space={space} classNames='pbe-2' />
|
|
150
|
-
</ToggleContainer>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
case 'suggest': {
|
|
155
|
-
const { text = '' }: { text: string } = safeParseJson(block.json ?? '{}') ?? ({} as any);
|
|
156
|
-
return <IconButton icon='ph--lightning--regular' label={text} onClick={() => onPrompt?.(text)} />;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
case 'select': {
|
|
160
|
-
const { options = [] }: { options: string[] } = safeParseJson(block.json ?? '{}') ?? ({} as any);
|
|
161
|
-
return (
|
|
162
|
-
<div className='flex flex-wrap gap-1'>
|
|
163
|
-
{options.map((option, idx) => (
|
|
164
|
-
<Button
|
|
165
|
-
classNames={'animate-[fadeIn_0.5s] rounded-2xl text-sm'}
|
|
166
|
-
key={option}
|
|
167
|
-
onClick={() => onPrompt?.(option)}
|
|
168
|
-
>
|
|
169
|
-
{option}
|
|
170
|
-
</Button>
|
|
171
|
-
))}
|
|
172
|
-
</div>
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
case 'graph': {
|
|
177
|
-
return (
|
|
178
|
-
<div className='flex flex-wrap gap-1'>
|
|
179
|
-
<Surface
|
|
180
|
-
role='card'
|
|
181
|
-
data={{ subject: JSON.parse(block.json ?? '{}') }}
|
|
182
|
-
limit={1}
|
|
183
|
-
fallback={<div className='font-mono text-xs text-pre'>{block.json}</div>}
|
|
184
|
-
/>
|
|
185
|
-
{onAddToGraph && (
|
|
186
|
-
<IconButton
|
|
187
|
-
icon='ph--plus--regular'
|
|
188
|
-
label='Add to graph'
|
|
189
|
-
onClick={() => onAddToGraph?.(JSON.parse(block.json ?? '{}'))}
|
|
190
|
-
/>
|
|
191
|
-
)}
|
|
192
|
-
</div>
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
default: {
|
|
197
|
-
const title = block.disposition ? titles[block.disposition] : undefined;
|
|
198
|
-
return (
|
|
199
|
-
<ToggleContainer title={title ?? 'JSON'}>
|
|
200
|
-
<Json data={safeParseJson(block.json ?? block)} classNames='!p-1 text-xs' />
|
|
201
|
-
</ToggleContainer>
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
//
|
|
208
|
-
// Default
|
|
209
|
-
//
|
|
210
|
-
default: ({ block }) => {
|
|
211
|
-
let title = titles[block.type];
|
|
212
|
-
if (block.type === 'tool_use') {
|
|
213
|
-
title = `Tool [${block.name}]`; // TODO(burdon): Get label from tool.
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return (
|
|
217
|
-
<ToggleContainer title={title ?? 'JSON'}>
|
|
218
|
-
<Json data={block} classNames='!p-1 text-xs' />
|
|
219
|
-
</ToggleContainer>
|
|
220
|
-
);
|
|
221
|
-
},
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
// TODO(burdon): Translations.
|
|
225
|
-
const titles: Record<string, string> = {
|
|
226
|
-
['cot' as const]: 'Chain of thought',
|
|
227
|
-
['artifact' as const]: 'Artifact',
|
|
228
|
-
['tool_use' as const]: 'Tool request',
|
|
229
|
-
['tool_result' as const]: 'Tool result',
|
|
230
|
-
['tool_list' as const]: 'Tools',
|
|
231
|
-
['artifact-update' as const]: 'Artifact(s) changed',
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
const systemDispositions: string[] = ['cot', 'artifact-update'];
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type AgentStatus, type Message, type Tool } from '@dxos/ai';
|
|
8
|
-
import { log } from '@dxos/log';
|
|
9
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
10
|
-
import { NumericTabs, StatusRoll, ToggleContainer } from '@dxos/react-ui-components';
|
|
11
|
-
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
12
|
-
import { isNonNullable, isNotFalsy } from '@dxos/util';
|
|
13
|
-
|
|
14
|
-
import { type ThreadMessageProps } from './ThreadMessage';
|
|
15
|
-
|
|
16
|
-
export const isToolMessage = (message: Message) => {
|
|
17
|
-
return message.content.some((block) => block.type === 'tool_use' || block.type === 'tool_result');
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const getToolName = (tool: Tool) => {
|
|
21
|
-
return tool.namespace && tool.function ? `${tool.namespace}:${tool.function}` : tool.name.split('_').pop();
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const getToolCaption = (tool: Tool | undefined, status: AgentStatus | undefined) => {
|
|
25
|
-
if (!tool) {
|
|
26
|
-
return 'Calling tool...';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return status?.message ?? tool.caption ?? `Calling ${getToolName(tool)}...`;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const ToolBlock: FC<ThemedClassName<ThreadMessageProps>> = ({ classNames, message, tools }) => {
|
|
33
|
-
const { content = [] } = message;
|
|
34
|
-
|
|
35
|
-
let request: { tool: Tool | undefined; block: any } | undefined;
|
|
36
|
-
const blocks = content.filter((block) => block.type === 'tool_use' || block.type === 'tool_result');
|
|
37
|
-
const items = blocks
|
|
38
|
-
.map((block) => {
|
|
39
|
-
switch (block.type) {
|
|
40
|
-
case 'tool_use': {
|
|
41
|
-
// TODO(burdon): Skip these updates?
|
|
42
|
-
if (block.pending && request?.block.id === block.id) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
log.info('tool_use', { tool: request?.tool, status: block.currentStatus });
|
|
47
|
-
|
|
48
|
-
request = { tool: tools?.find((tool) => tool.name === block.name), block };
|
|
49
|
-
return { title: getToolCaption(request.tool, block.currentStatus), block };
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
case 'tool_result': {
|
|
53
|
-
if (!request) {
|
|
54
|
-
log.warn('unexpected message', { block });
|
|
55
|
-
return { title: 'Error', block };
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return { title: `${getToolCaption(request.tool, undefined)} (Success)`, block };
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
default: {
|
|
62
|
-
request = undefined;
|
|
63
|
-
return { title: 'Error', block };
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
.filter(isNonNullable);
|
|
68
|
-
|
|
69
|
-
return <ToolContainer classNames={classNames} items={items} />;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const ToolContainer: FC<ThemedClassName<{ items: { title: string; block: any }[] }>> = ({
|
|
73
|
-
classNames,
|
|
74
|
-
items,
|
|
75
|
-
}) => {
|
|
76
|
-
const tabsRef = useRef<HTMLDivElement>(null);
|
|
77
|
-
const [selected, setSelected] = useState(0);
|
|
78
|
-
const [open, setOpen] = useState(false);
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
if (open) {
|
|
81
|
-
tabsRef.current?.focus();
|
|
82
|
-
}
|
|
83
|
-
}, [open]);
|
|
84
|
-
|
|
85
|
-
const handleSelect = (index: number) => {
|
|
86
|
-
if (index === selected) {
|
|
87
|
-
setOpen(false);
|
|
88
|
-
} else {
|
|
89
|
-
setSelected(index);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const title = useMemo(() => {
|
|
94
|
-
const lines = items.map((item) => item.title).filter(isNotFalsy);
|
|
95
|
-
return <StatusRoll key='status-roll' lines={lines} duration={1_000} autoAdvance />;
|
|
96
|
-
}, [items]);
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<ToggleContainer classNames={['flex flex-col', classNames]} title={title} open={open} onChangeOpen={setOpen}>
|
|
100
|
-
<div className='grid grid-cols-[32px_1fr]'>
|
|
101
|
-
<NumericTabs ref={tabsRef} length={items.length} selected={selected} onSelect={handleSelect} />
|
|
102
|
-
<Json data={items[selected].block} classNames='!p-1 text-xs' />
|
|
103
|
-
</div>
|
|
104
|
-
</ToggleContainer>
|
|
105
|
-
);
|
|
106
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Message } from '@dxos/ai';
|
|
6
|
-
|
|
7
|
-
// TODO(burdon): Move to util?
|
|
8
|
-
type Reducer<R, I> = (acc: R, value: I) => R;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Reducer that collapses related message blocks into single messages.
|
|
12
|
-
* For example, combines tool request/response pairs into a single message.
|
|
13
|
-
*/
|
|
14
|
-
export const messageReducer: Reducer<{ messages: Message[]; current?: Message }, Message> = (
|
|
15
|
-
{ current, messages },
|
|
16
|
-
message,
|
|
17
|
-
) => {
|
|
18
|
-
let i = 0;
|
|
19
|
-
for (const block of message.content) {
|
|
20
|
-
switch (block.type) {
|
|
21
|
-
case 'tool_use':
|
|
22
|
-
case 'tool_result': {
|
|
23
|
-
if (current) {
|
|
24
|
-
current.content.push(block);
|
|
25
|
-
} else {
|
|
26
|
-
current = {
|
|
27
|
-
id: [message.id, i].join('_'),
|
|
28
|
-
role: message.role,
|
|
29
|
-
content: [block],
|
|
30
|
-
} as any;
|
|
31
|
-
messages.push(current as any);
|
|
32
|
-
}
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
case 'text':
|
|
37
|
-
default: {
|
|
38
|
-
current = undefined;
|
|
39
|
-
messages.push({
|
|
40
|
-
id: [message.id, i].join('_'),
|
|
41
|
-
role: message.role,
|
|
42
|
-
content: [block],
|
|
43
|
-
} as any);
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
i++;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return { current, messages };
|
|
52
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, it } from 'vitest';
|
|
6
|
-
|
|
7
|
-
import { ChatProcessor } from './processor';
|
|
8
|
-
|
|
9
|
-
describe('ChatProcessor', () => {
|
|
10
|
-
it('should be instantiable', ({ expect }) => {
|
|
11
|
-
const client = {} as any; // TODO(burdon): Create mock.
|
|
12
|
-
const processor = new ChatProcessor(client);
|
|
13
|
-
expect(processor).toBeDefined();
|
|
14
|
-
});
|
|
15
|
-
});
|
package/src/hooks/processor.ts
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Signal, batch, computed, signal } from '@preact/signals-core';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
DEFAULT_EDGE_MODEL,
|
|
9
|
-
type ExecutableTool,
|
|
10
|
-
type AiServiceClient,
|
|
11
|
-
type GenerateRequest,
|
|
12
|
-
type Message,
|
|
13
|
-
type MessageContentBlock,
|
|
14
|
-
type ToolUseContentBlock,
|
|
15
|
-
} from '@dxos/ai';
|
|
16
|
-
import { type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
17
|
-
import { type ArtifactDefinition } from '@dxos/artifact';
|
|
18
|
-
import { AISession, type ArtifactDiffResolver } from '@dxos/assistant';
|
|
19
|
-
import { invariant } from '@dxos/invariant';
|
|
20
|
-
import { log } from '@dxos/log';
|
|
21
|
-
import { Filter, getVersion, type Space } from '@dxos/react-client/echo';
|
|
22
|
-
|
|
23
|
-
// TODO(burdon): Factor out.
|
|
24
|
-
declare global {
|
|
25
|
-
interface ToolContextExtensions {
|
|
26
|
-
space?: Space;
|
|
27
|
-
dispatch?: PromiseIntentDispatcher;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
type RequestOptions = {
|
|
32
|
-
history?: Message[];
|
|
33
|
-
onComplete?: (messages: Message[]) => void;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type ChatProcessorOptions = Pick<GenerateRequest, 'model' | 'systemPrompt'>;
|
|
37
|
-
|
|
38
|
-
const defaultOptions: ChatProcessorOptions = {
|
|
39
|
-
model: DEFAULT_EDGE_MODEL,
|
|
40
|
-
systemPrompt: 'you are a helpful assistant',
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Handles interactions with the AI service.
|
|
45
|
-
* Maintains a queue of messages and handles streaming responses from the AI service.
|
|
46
|
-
* Executes tools based on AI responses.
|
|
47
|
-
* Supports cancellation of in-progress requests.
|
|
48
|
-
*/
|
|
49
|
-
export class ChatProcessor {
|
|
50
|
-
/** Pending messages (incl. the current user request). */
|
|
51
|
-
private readonly _pending: Signal<Message[]> = signal([]);
|
|
52
|
-
|
|
53
|
-
/** Current streaming block (from the AI service). */
|
|
54
|
-
private readonly _block: Signal<MessageContentBlock | undefined> = signal(undefined);
|
|
55
|
-
|
|
56
|
-
/** Current streaming response. */
|
|
57
|
-
private _session: AISession | undefined;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Streaming state.
|
|
61
|
-
* @reactive
|
|
62
|
-
*/
|
|
63
|
-
public readonly streaming: Signal<boolean> = computed(() => this._block.value !== undefined);
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Last error.
|
|
67
|
-
* @reactive
|
|
68
|
-
*/
|
|
69
|
-
public readonly error: Signal<Error | undefined> = signal(undefined);
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Array of Messages (incl. the current message being streamed).
|
|
73
|
-
* @reactive
|
|
74
|
-
*/
|
|
75
|
-
public readonly messages: Signal<Message[]> = computed(() => {
|
|
76
|
-
const messages = [...this._pending.value];
|
|
77
|
-
if (this._block.value) {
|
|
78
|
-
const current = messages.pop();
|
|
79
|
-
invariant(current);
|
|
80
|
-
const { content, ...rest } = current;
|
|
81
|
-
const message = { ...rest, content: [...content, this._block.value] };
|
|
82
|
-
messages.push(message);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return messages;
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
constructor(
|
|
89
|
-
private readonly _ai: AiServiceClient,
|
|
90
|
-
private _tools?: ExecutableTool[],
|
|
91
|
-
private _artifacts?: ArtifactDefinition[],
|
|
92
|
-
private readonly _extensions?: ToolContextExtensions,
|
|
93
|
-
private readonly _options: ChatProcessorOptions = defaultOptions,
|
|
94
|
-
) {}
|
|
95
|
-
|
|
96
|
-
get tools() {
|
|
97
|
-
return this._tools;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Update tools.
|
|
102
|
-
*/
|
|
103
|
-
setTools(tools: ExecutableTool[]): void {
|
|
104
|
-
this._tools = tools;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Make GPT request.
|
|
109
|
-
*/
|
|
110
|
-
async request(message: string, options: RequestOptions = {}): Promise<Message[]> {
|
|
111
|
-
this._session = new AISession({ operationModel: 'configured' });
|
|
112
|
-
|
|
113
|
-
// Message complete.
|
|
114
|
-
this._session.message.on((message) => {
|
|
115
|
-
batch(() => {
|
|
116
|
-
this._pending.value = [...this._pending.value, message];
|
|
117
|
-
this._block.value = undefined;
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
// Streaming update (happens before message complete).
|
|
122
|
-
this._session.update.on((block) => {
|
|
123
|
-
batch(() => {
|
|
124
|
-
this._block.value = block;
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
this._session.userMessage.on((message) => {
|
|
129
|
-
this._pending.value = [...this._pending.value, message];
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
this._session.toolStatusReport.on(({ message, status }) => {
|
|
133
|
-
const msg = this._pending.peek().find((m) => m.id === message.id);
|
|
134
|
-
const toolUse = msg?.content.find((block) => block.type === 'tool_use');
|
|
135
|
-
if (!toolUse) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const block = msg?.content.find(
|
|
140
|
-
(block): block is ToolUseContentBlock => block.type === 'tool_use' && block.id === toolUse.id,
|
|
141
|
-
);
|
|
142
|
-
if (block) {
|
|
143
|
-
this._pending.value = this._pending.value.map((m) => {
|
|
144
|
-
if (m.id === message.id) {
|
|
145
|
-
return {
|
|
146
|
-
...m,
|
|
147
|
-
content: m.content.map((b) =>
|
|
148
|
-
b.type === 'tool_use' && b.id === toolUse.id ? { ...b, currentStatus: status } : b,
|
|
149
|
-
),
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
return m;
|
|
153
|
-
});
|
|
154
|
-
} else {
|
|
155
|
-
log.warn('no block for status report');
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
try {
|
|
160
|
-
const messages = await this._session.run({
|
|
161
|
-
client: this._ai,
|
|
162
|
-
history: options.history ?? [],
|
|
163
|
-
artifacts: this._artifacts ?? [],
|
|
164
|
-
requiredArtifactIds: this._artifacts?.map((artifact) => artifact.id) ?? [],
|
|
165
|
-
tools: this._tools ?? [],
|
|
166
|
-
prompt: message,
|
|
167
|
-
systemPrompt: this._options.systemPrompt,
|
|
168
|
-
extensions: this._extensions,
|
|
169
|
-
artifactDiffResolver: this._artifactDiffResolver,
|
|
170
|
-
generationOptions: {
|
|
171
|
-
model: this._options.model,
|
|
172
|
-
},
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
log('completed', { messages });
|
|
176
|
-
options.onComplete?.(this._pending.value);
|
|
177
|
-
} catch (err) {
|
|
178
|
-
log.catch(err);
|
|
179
|
-
if (err instanceof Error && err.message.includes('Overloaded')) {
|
|
180
|
-
this.error.value = new AiServiceOverloadedError('AI service overloaded', { cause: err });
|
|
181
|
-
} else {
|
|
182
|
-
this.error.value = new Error('AI service error', { cause: err });
|
|
183
|
-
}
|
|
184
|
-
} finally {
|
|
185
|
-
this._session = undefined;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return this._reset();
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Cancel pending requests.
|
|
193
|
-
* @returns Pending requests (incl. the request message).
|
|
194
|
-
*/
|
|
195
|
-
async cancel(): Promise<Message[]> {
|
|
196
|
-
log.info('cancelling...');
|
|
197
|
-
this._session?.abort();
|
|
198
|
-
return this._reset();
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
private async _reset(): Promise<Message[]> {
|
|
202
|
-
const messages = this._pending.value;
|
|
203
|
-
batch(() => {
|
|
204
|
-
this._pending.value = [];
|
|
205
|
-
this._block.value = undefined;
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
return messages;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
private _artifactDiffResolver: ArtifactDiffResolver = async (artifacts) => {
|
|
212
|
-
const space = this._extensions?.space;
|
|
213
|
-
if (!space) {
|
|
214
|
-
return new Map();
|
|
215
|
-
}
|
|
216
|
-
const versions = new Map();
|
|
217
|
-
await Promise.all(
|
|
218
|
-
artifacts.map(async (artifact) => {
|
|
219
|
-
const {
|
|
220
|
-
objects: [object],
|
|
221
|
-
} = await space.db.query(Filter.ids(artifact.id)).run();
|
|
222
|
-
if (!object) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
versions.set(artifact.id, {
|
|
226
|
-
version: getVersion(object),
|
|
227
|
-
diff: `Current state: ${JSON.stringify(object)}`,
|
|
228
|
-
});
|
|
229
|
-
}),
|
|
230
|
-
);
|
|
231
|
-
return versions;
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// TODO(wittjosiah): Move to ai-service-client.
|
|
236
|
-
export class AiServiceOverloadedError extends Error {
|
|
237
|
-
code = 'AI_SERVICE_OVERLOADED';
|
|
238
|
-
}
|