@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.e098934
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-RPJ2LBOB.mjs → BlueprintContainer-BFNN6K46.mjs} +11 -9
- package/dist/lib/browser/BlueprintContainer-BFNN6K46.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-DOVN34C7.mjs +126 -0
- package/dist/lib/browser/ChatCompanion-DOVN34C7.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs → ChatContainer-XIVJTCC2.mjs} +34 -13
- package/dist/lib/browser/ChatContainer-XIVJTCC2.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs → ChatDialog-EJJMK3WL.mjs} +28 -12
- package/dist/lib/browser/ChatDialog-EJJMK3WL.mjs.map +7 -0
- package/dist/lib/browser/{SequenceContainer-3UDVKWPA.mjs → SequenceContainer-TF5QNXYM.mjs} +5 -17
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs.map +7 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs +22 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-JTXBKE7O.mjs → app-graph-builder-3C43MLCD.mjs} +26 -96
- package/dist/lib/browser/app-graph-builder-3C43MLCD.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-C4Q2RYQM.mjs +1974 -0
- package/dist/lib/browser/chunk-C4Q2RYQM.mjs.map +7 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs +19 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs.map +7 -0
- package/dist/lib/browser/chunk-GLWD66TA.mjs +161 -0
- package/dist/lib/browser/chunk-GLWD66TA.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-O4LUJEDV.mjs +20 -0
- package/dist/lib/browser/{chunk-FDCJSQYF.mjs.map → chunk-O4LUJEDV.mjs.map} +2 -2
- package/dist/lib/browser/chunk-PQI3MGDN.mjs +169 -0
- package/dist/lib/browser/chunk-PQI3MGDN.mjs.map +7 -0
- package/dist/lib/browser/chunk-QD4UUISH.mjs +299 -0
- package/dist/lib/browser/chunk-QD4UUISH.mjs.map +7 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs +216 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs.map +7 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs +202 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs +155 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs +22 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +167 -68
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs +112 -0
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs +21 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-E4NAGB6R.mjs +109 -0
- package/dist/lib/browser/react-surface-E4NAGB6R.mjs.map +7 -0
- package/dist/lib/browser/{settings-2DGP3UTS.mjs → settings-36V3VUMW.mjs} +6 -5
- package/dist/lib/{node-esm/settings-47RYZOU4.mjs.map → browser/settings-36V3VUMW.mjs.map} +1 -1
- package/dist/lib/browser/state-AINRYS5W.mjs +21 -0
- package/dist/lib/browser/state-AINRYS5W.mjs.map +7 -0
- package/dist/lib/browser/toolkit-MPUS3U64.mjs +191 -0
- package/dist/lib/browser/toolkit-MPUS3U64.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -4
- package/dist/lib/node-esm/{TemplateContainer-A3NAQCZE.mjs → BlueprintContainer-X4MRBKDR.mjs} +11 -9
- package/dist/lib/node-esm/BlueprintContainer-X4MRBKDR.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-ICWYVPRD.mjs +127 -0
- package/dist/lib/node-esm/ChatCompanion-ICWYVPRD.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs → ChatContainer-LMMMQD4K.mjs} +34 -13
- package/dist/lib/node-esm/ChatContainer-LMMMQD4K.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs → ChatDialog-UUE3F7BT.mjs} +28 -12
- package/dist/lib/node-esm/ChatDialog-UUE3F7BT.mjs.map +7 -0
- package/dist/lib/node-esm/{SequenceContainer-RQQH5XOC.mjs → SequenceContainer-UXOVZPZO.mjs} +5 -17
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs +23 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-OWSOXFTD.mjs → app-graph-builder-NM3JDLQ2.mjs} +26 -96
- package/dist/lib/node-esm/app-graph-builder-NM3JDLQ2.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs +170 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs +203 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs +217 -0
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs +163 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V44ZG7CU.mjs +1975 -0
- package/dist/lib/node-esm/chunk-V44ZG7CU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VFY2JG62.mjs +22 -0
- package/dist/lib/node-esm/{chunk-QN2H2EHV.mjs.map → chunk-VFY2JG62.mjs.map} +2 -2
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs +20 -0
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YU62ZWJN.mjs +300 -0
- package/dist/lib/node-esm/chunk-YU62ZWJN.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs +156 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs +23 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +167 -68
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs +113 -0
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs +22 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-5WQLRTCH.mjs +110 -0
- package/dist/lib/node-esm/react-surface-5WQLRTCH.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-47RYZOU4.mjs → settings-7ZCZ6AS5.mjs} +6 -5
- package/dist/lib/{browser/settings-2DGP3UTS.mjs.map → node-esm/settings-7ZCZ6AS5.mjs.map} +1 -1
- package/dist/lib/node-esm/state-EQS5KP6M.mjs +22 -0
- package/dist/lib/node-esm/state-EQS5KP6M.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-PKVYDZ4H.mjs +192 -0
- package/dist/lib/node-esm/toolkit-PKVYDZ4H.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -4
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +7 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +32 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +12 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +4 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +8 -0
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +20 -17
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +13 -0
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +4 -4
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +4 -5
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +10 -7
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +115 -74
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts +40 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +261 -2
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -6
- 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 +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +258 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +11 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -9
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +262 -4
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/execution-graph/execution-graph.d.ts +21 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +2 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/functions/analysis.d.ts +5 -0
- package/dist/types/src/functions/analysis.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/list.d.ts +10 -0
- package/dist/types/src/functions/list.d.ts.map +1 -0
- package/dist/types/src/functions/load.d.ts +8 -0
- package/dist/types/src/functions/load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +9 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +24 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -21
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -6
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts +6 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
- package/dist/types/src/hooks/useItemTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +3 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +2 -2
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +73 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/stories/Chat.stories.d.ts +26 -245
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +4 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/DebugCard.d.ts +8 -0
- package/dist/types/src/stories/components/DebugCard.d.ts.map +1 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts +6 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts +7 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts +4 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts +6 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +4 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts +14 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +16 -0
- package/dist/types/src/stories/components/index.d.ts.map +1 -0
- package/dist/types/src/stories/components/types.d.ts +7 -0
- package/dist/types/src/stories/components/types.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +9 -0
- package/dist/types/src/stories/testing/data.d.ts.map +1 -0
- package/dist/types/src/stories/testing/index.d.ts +3 -0
- package/dist/types/src/stories/testing/index.d.ts.map +1 -0
- package/dist/types/src/stories/testing/schema.d.ts +7 -0
- package/dist/types/src/stories/testing/schema.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +48 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +14 -0
- package/dist/types/src/testing/test-data.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +5 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +7 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +29 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +42 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +107 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +6 -3
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +106 -82
- package/src/AssistantPlugin.tsx +83 -12
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +43 -134
- package/src/capabilities/blueprint-definition.ts +58 -0
- package/src/capabilities/capabilities.ts +71 -0
- package/src/capabilities/compute-runtime.ts +124 -0
- package/src/capabilities/edge-model-resolver.ts +27 -0
- package/src/capabilities/index.ts +10 -0
- package/src/capabilities/intent-resolver.ts +50 -14
- package/src/capabilities/local-model-resolver.ts +32 -0
- package/src/capabilities/react-surface.tsx +17 -64
- package/src/capabilities/state.ts +20 -0
- package/src/capabilities/toolkit.ts +163 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +83 -76
- package/src/components/BlueprintContainer.tsx +24 -0
- package/src/components/Chat/Chat.tsx +175 -174
- package/src/components/Chat/events.ts +7 -0
- package/src/components/ChatCompanion.tsx +111 -0
- package/src/components/ChatContainer.tsx +19 -13
- package/src/components/ChatDialog.tsx +18 -14
- package/src/components/ChatProgress/ChatProgress.tsx +68 -0
- package/src/components/ChatProgress/index.ts +5 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -24
- package/src/components/ChatPrompt/ChatOptions.tsx +233 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +31 -36
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +97 -110
- package/src/components/ChatThread/ChatThread.tsx +65 -29
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/reducers.ts +151 -0
- package/src/components/ChatThread/registry.tsx +189 -0
- package/src/components/ChatThread/sync.test.ts +81 -0
- package/src/components/ChatThread/sync.ts +113 -0
- package/src/components/PromptSettings.tsx +1 -0
- package/src/components/SequenceContainer.tsx +27 -28
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +5 -4
- package/src/components/SequenceEditor/SequenceEditor.tsx +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +27 -14
- package/src/components/TemplateEditor/TemplateEditor.tsx +20 -51
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +15 -8
- package/src/components/TemplateEditor/TemplateForm.tsx +6 -3
- package/src/components/TemplateEditor/handlebars-extension.ts +165 -0
- package/src/components/ToolBlock/ToolBlock.tsx +152 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbar/Toolbar.tsx +21 -0
- package/src/components/Toolbar/index.ts +5 -0
- package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +10 -16
- package/src/components/Toolbox/Toolbox.tsx +21 -51
- package/src/components/index.ts +4 -5
- package/src/events.ts +2 -2
- package/src/execution-graph/execution-graph.ts +211 -0
- package/src/execution-graph/index.ts +5 -0
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +46 -0
- package/src/functions/load.ts +42 -0
- package/src/hooks/index.ts +9 -4
- package/src/hooks/useBlueprintRegistry.ts +80 -0
- package/src/hooks/useChatProcessor.ts +21 -98
- package/src/hooks/useChatServices.ts +28 -71
- package/src/hooks/useComputeRuntimeCallback.ts +25 -0
- package/src/hooks/useContextBinder.ts +18 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useExecutionGraph.ts +20 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +11 -9
- package/src/meta.ts +1 -1
- package/src/processor/index.ts +6 -0
- package/src/{hooks → processor}/presets.ts +14 -6
- package/src/processor/processor.test.ts +77 -0
- package/src/processor/processor.ts +302 -0
- package/src/queue-logger.ts +10 -10
- package/src/stories/Chat.stories.tsx +594 -315
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +74 -0
- package/src/stories/components/ChessContainer.tsx +17 -0
- package/src/stories/components/CommentsContainer.tsx +25 -0
- package/src/stories/components/DebugCard.tsx +61 -0
- package/src/stories/components/GraphContainer.tsx +119 -0
- package/src/stories/components/InvocationsContainer.tsx +17 -0
- package/src/stories/components/LoggingContainer.tsx +33 -0
- package/src/stories/components/MessageContainer.tsx +22 -0
- package/src/stories/components/PromptContainer.tsx +52 -0
- package/src/stories/components/ResearchInputStack.tsx +30 -0
- package/src/stories/components/ResearchOutputStack.tsx +29 -0
- package/src/stories/components/TasksContainer.tsx +49 -0
- package/src/stories/components/TokenManagerContainer.tsx +14 -0
- package/src/stories/components/TriggersContainer.tsx +75 -0
- package/src/stories/components/index.ts +20 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/testing/data.ts +142 -0
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/schema.ts +17 -0
- package/src/stories/testing/testing.tsx +279 -0
- package/src/testing/index.ts +3 -1
- package/src/testing/test-data.ts +245 -0
- package/src/testing/test-functions.ts +8 -3
- package/src/testing/test-generator.ts +257 -0
- package/src/testing/test-sequence.ts +2 -27
- package/src/translations.ts +32 -22
- package/src/types/Assistant.ts +61 -0
- package/src/types/AssistantAction.ts +62 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -1
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEAEKWOC.mjs +0 -98
- package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +0 -7
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs +0 -108
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-JQBVLTM5.mjs +0 -158
- package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
- package/dist/lib/browser/chunk-OWY4CUQY.mjs +0 -2245
- package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs +0 -60
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-66VY37YQ.mjs +0 -150
- package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs +0 -99
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs +0 -159
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs +0 -109
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs +0 -2246
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs +0 -61
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs +0 -151
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +0 -7
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -8
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -86
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -88
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatThread/ChatMessage.tsx +0 -268
- package/src/components/ChatThread/ToolBlock.tsx +0 -121
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/TemplateContainer.tsx +0 -24
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/chat-processor.ts +0 -314
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -95
- package/src/typings.d.ts +0 -9
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { Fragment, type FC, type PropsWithChildren } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Tool } from '@dxos/ai';
|
|
8
|
-
import { Surface } from '@dxos/app-framework';
|
|
9
|
-
import { invariant } from '@dxos/invariant';
|
|
10
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
11
|
-
import { Button, Icon, IconButton, useTranslation, type ThemedClassName } from '@dxos/react-ui';
|
|
12
|
-
import {
|
|
13
|
-
MarkdownViewer,
|
|
14
|
-
ToggleContainer as NativeToggleContainer,
|
|
15
|
-
type ToggleContainerProps,
|
|
16
|
-
} from '@dxos/react-ui-components';
|
|
17
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
-
import { type ContentBlock, type DataType } from '@dxos/schema';
|
|
19
|
-
import { safeParseJson } from '@dxos/util';
|
|
20
|
-
|
|
21
|
-
import { Json, ToolBlock, isToolMessage } from './ToolBlock';
|
|
22
|
-
import { type ChatProcessor } from '../../hooks';
|
|
23
|
-
import { meta } from '../../meta';
|
|
24
|
-
import { type ChatEvent } from '../Chat';
|
|
25
|
-
import { ToolboxContainer } from '../Toolbox';
|
|
26
|
-
|
|
27
|
-
export type ChatMessageProps = ThemedClassName<{
|
|
28
|
-
debug?: boolean;
|
|
29
|
-
space?: Space;
|
|
30
|
-
message: DataType.Message;
|
|
31
|
-
// TODO(burdon): Move to context.
|
|
32
|
-
processor?: ChatProcessor;
|
|
33
|
-
tools?: Tool[];
|
|
34
|
-
onEvent?: (event: ChatEvent) => void;
|
|
35
|
-
}>;
|
|
36
|
-
|
|
37
|
-
export const ChatMessage = ({ classNames, debug, space, message, processor, tools, onEvent }: ChatMessageProps) => {
|
|
38
|
-
const { t } = useTranslation(meta.id);
|
|
39
|
-
const {
|
|
40
|
-
sender: { role },
|
|
41
|
-
blocks,
|
|
42
|
-
} = message;
|
|
43
|
-
|
|
44
|
-
// TODO(burdon): Restructure types to make check unnecessary.
|
|
45
|
-
if (isToolMessage(message)) {
|
|
46
|
-
return (
|
|
47
|
-
<MessageContainer classNames={mx(classNames, 'animate-[fadeIn_0.5s]')}>
|
|
48
|
-
<ToolBlock classNames={panelClasses} message={message} tools={tools} />
|
|
49
|
-
</MessageContainer>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<>
|
|
55
|
-
{debug && (
|
|
56
|
-
<div className={mx('flex justify-end text-subdued', marginClasses)}>
|
|
57
|
-
<pre className='text-xs'>{JSON.stringify({ created: message.created })}</pre>
|
|
58
|
-
</div>
|
|
59
|
-
)}
|
|
60
|
-
|
|
61
|
-
{blocks.map((block, idx) => {
|
|
62
|
-
// TODO(burdon): Filter empty messages.
|
|
63
|
-
if (block._tag === 'text' && block.text.replaceAll(/\s+/g, '').length === 0) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const Component: BlockComponent = components[block._tag] ?? components.default!;
|
|
68
|
-
if (!Component) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<Fragment key={idx}>
|
|
74
|
-
<MessageContainer classNames={classNames} user={block._tag === 'text' && role === 'user'}>
|
|
75
|
-
<Component space={space} processor={processor} block={block} onEvent={onEvent} />
|
|
76
|
-
</MessageContainer>
|
|
77
|
-
{debug && (
|
|
78
|
-
<div className={mx('flex justify-end text-subdued', marginClasses)}>
|
|
79
|
-
<pre className='text-xs'>{JSON.stringify({ block: block._tag })}</pre>
|
|
80
|
-
</div>
|
|
81
|
-
)}
|
|
82
|
-
</Fragment>
|
|
83
|
-
);
|
|
84
|
-
})}
|
|
85
|
-
<div className={mx('flex justify-end pbs-2 pbe-2 opacity-50 hover:opacity-100', marginClasses)}>
|
|
86
|
-
<IconButton
|
|
87
|
-
classNames='animate-[fadeIn_0.5s]'
|
|
88
|
-
icon='ph--trash--regular'
|
|
89
|
-
iconOnly
|
|
90
|
-
label={t('button delete message')}
|
|
91
|
-
onClick={() => onEvent?.({ type: 'delete', id: message.id })}
|
|
92
|
-
/>
|
|
93
|
-
</div>
|
|
94
|
-
</>
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
type BlockComponentProps = {
|
|
99
|
-
space?: Space;
|
|
100
|
-
block: ContentBlock.Any;
|
|
101
|
-
/** @deprecated Replace with context */
|
|
102
|
-
processor?: ChatProcessor;
|
|
103
|
-
onEvent?: (event: ChatEvent) => void;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
type BlockComponent = FC<BlockComponentProps>;
|
|
107
|
-
|
|
108
|
-
const components: Partial<Record<ContentBlock.Any['_tag'] | 'default', BlockComponent>> = {
|
|
109
|
-
//
|
|
110
|
-
// Text
|
|
111
|
-
//
|
|
112
|
-
['text' as const]: ({ block }) => {
|
|
113
|
-
invariant(block._tag === 'text');
|
|
114
|
-
// const [open, setOpen] = useState(block.disposition === 'cot' && block.pending);
|
|
115
|
-
const title = block.disposition ? titles[block.disposition] : undefined;
|
|
116
|
-
if (!title) {
|
|
117
|
-
return <MarkdownViewer content={block.text} />;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// TOOD(burdon): Store last time user opened/closed COT.
|
|
121
|
-
// Autoclose when streaming ends.
|
|
122
|
-
// useEffect(() => {
|
|
123
|
-
// if (block.disposition === 'cot' && !block.pending) {
|
|
124
|
-
// setOpen(false);
|
|
125
|
-
// }
|
|
126
|
-
// }, [block.disposition, block.pending]);
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<ToggleContainer
|
|
130
|
-
// open={open}
|
|
131
|
-
defaultOpen={systemDispositions.includes(block.disposition ?? '') && block.pending}
|
|
132
|
-
title={title}
|
|
133
|
-
icon={
|
|
134
|
-
block.pending ? (
|
|
135
|
-
<Icon icon={'ph--circle-notch--regular'} classNames='text-subdued animate-spin' size={4} />
|
|
136
|
-
) : undefined
|
|
137
|
-
}
|
|
138
|
-
>
|
|
139
|
-
<MarkdownViewer
|
|
140
|
-
content={block.text}
|
|
141
|
-
classNames={['pbe-2', systemDispositions.includes(block.disposition ?? '') && 'text-sm text-subdued']}
|
|
142
|
-
/>
|
|
143
|
-
</ToggleContainer>
|
|
144
|
-
);
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
//
|
|
148
|
-
// JSON
|
|
149
|
-
//
|
|
150
|
-
['json' as const]: ({ space, processor, block, onEvent }) => {
|
|
151
|
-
invariant(block._tag === 'json');
|
|
152
|
-
|
|
153
|
-
switch (block.disposition) {
|
|
154
|
-
case 'tool_list': {
|
|
155
|
-
return (
|
|
156
|
-
<ToggleContainer title={titles[block.disposition]} defaultOpen={true}>
|
|
157
|
-
<ToolboxContainer space={space} processor={processor} classNames='pbe-2' />
|
|
158
|
-
</ToggleContainer>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
case 'suggest': {
|
|
163
|
-
const { text = '' }: { text: string } = safeParseJson(block.data ?? '{}') ?? ({} as any);
|
|
164
|
-
return (
|
|
165
|
-
<IconButton icon='ph--lightning--regular' label={text} onClick={() => onEvent?.({ type: 'submit', text })} />
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
case 'select': {
|
|
170
|
-
const { options = [] }: { options: string[] } = safeParseJson(block.data ?? '{}') ?? ({} as any);
|
|
171
|
-
return (
|
|
172
|
-
<div className='flex flex-wrap gap-1'>
|
|
173
|
-
{options.map((text, idx) => (
|
|
174
|
-
<Button
|
|
175
|
-
classNames={'animate-[fadeIn_0.5s] rounded-sm text-sm'}
|
|
176
|
-
key={idx}
|
|
177
|
-
onClick={() => onEvent?.({ type: 'submit', text })}
|
|
178
|
-
>
|
|
179
|
-
{text}
|
|
180
|
-
</Button>
|
|
181
|
-
))}
|
|
182
|
-
</div>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
case 'graph': {
|
|
187
|
-
return (
|
|
188
|
-
<div className='flex flex-wrap gap-1'>
|
|
189
|
-
<Surface
|
|
190
|
-
role='card'
|
|
191
|
-
data={{ subject: JSON.parse(block.data ?? '{}') }}
|
|
192
|
-
limit={1}
|
|
193
|
-
fallback={<div className='font-mono text-xs text-pre'>{block.data}</div>}
|
|
194
|
-
/>
|
|
195
|
-
{onEvent && (
|
|
196
|
-
<IconButton
|
|
197
|
-
icon='ph--plus--regular'
|
|
198
|
-
label='Add to graph'
|
|
199
|
-
onClick={() => onEvent?.({ type: 'add', object: JSON.parse(block.data ?? '{}') })}
|
|
200
|
-
/>
|
|
201
|
-
)}
|
|
202
|
-
</div>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
default: {
|
|
207
|
-
const title = block.disposition ? titles[block.disposition] : undefined;
|
|
208
|
-
return (
|
|
209
|
-
<ToggleContainer title={title ?? 'JSON'}>
|
|
210
|
-
<Json data={safeParseJson(block.data ?? block)} />
|
|
211
|
-
</ToggleContainer>
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
//
|
|
218
|
-
// Default
|
|
219
|
-
//
|
|
220
|
-
default: ({ block }) => {
|
|
221
|
-
let title = titles[block._tag];
|
|
222
|
-
if (block._tag === 'toolCall') {
|
|
223
|
-
title = `Tool [${block.name}]`; // TODO(burdon): Get label from tool.
|
|
224
|
-
} else {
|
|
225
|
-
title = block._tag;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return (
|
|
229
|
-
<ToggleContainer title={title ?? 'JSON'}>
|
|
230
|
-
<Json data={block} />
|
|
231
|
-
</ToggleContainer>
|
|
232
|
-
);
|
|
233
|
-
},
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
// TODO(burdon): Translations.
|
|
237
|
-
const titles: Record<string, string> = {
|
|
238
|
-
['cot' as const]: 'Chain of thought',
|
|
239
|
-
['artifact' as const]: 'Artifact',
|
|
240
|
-
['tool_use' as const]: 'Tool request',
|
|
241
|
-
['tool_result' as const]: 'Tool result',
|
|
242
|
-
['tool_list' as const]: 'Tools',
|
|
243
|
-
['artifact-update' as const]: 'Artifact(s) changed',
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
const systemDispositions: string[] = ['cot', 'artifact-update'];
|
|
247
|
-
|
|
248
|
-
const panelClasses = 'flex flex-col is-full bg-activeSurface rounded-sm';
|
|
249
|
-
const marginClasses = 'pie-4 pis-4';
|
|
250
|
-
const paddingClasses = 'pis-2 pie-2 pbs-0.5 pbe-0.5';
|
|
251
|
-
|
|
252
|
-
const MessageContainer = ({ classNames, children, user }: ThemedClassName<PropsWithChildren<{ user?: boolean }>>) => {
|
|
253
|
-
if (!children) {
|
|
254
|
-
return null;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
return (
|
|
258
|
-
<div role='list-item' className={mx('flex is-full', user && 'justify-end', marginClasses, classNames)}>
|
|
259
|
-
<div className={mx(user ? ['rounded-sm', 'bg-[--user-fill] text-accentSurfaceText', paddingClasses] : 'is-full')}>
|
|
260
|
-
{children}
|
|
261
|
-
</div>
|
|
262
|
-
</div>
|
|
263
|
-
);
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
const ToggleContainer = (props: ToggleContainerProps) => {
|
|
267
|
-
return <NativeToggleContainer {...props} classNames={mx(panelClasses, props.classNames)} />;
|
|
268
|
-
};
|
|
@@ -1,121 +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 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 { type JsonProps, Json as NativeJson } from '@dxos/react-ui-syntax-highlighter';
|
|
12
|
-
import { type DataType } from '@dxos/schema';
|
|
13
|
-
import { isNonNullable, isNotFalsy } from '@dxos/util';
|
|
14
|
-
|
|
15
|
-
export const isToolMessage = (message: DataType.Message) => {
|
|
16
|
-
return message.blocks.some((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const getToolName = (tool: Tool) => {
|
|
20
|
-
return tool.namespace && tool.function ? `${tool.namespace}:${tool.function}` : tool.name.split('_').pop();
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const getToolCaption = (tool: Tool | undefined, status: AgentStatus | undefined) => {
|
|
24
|
-
if (!tool) {
|
|
25
|
-
return 'Calling tool...';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return status?.message ?? tool.caption ?? `Calling ${getToolName(tool)}...`;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type ToolBlockProps = ThemedClassName<{
|
|
32
|
-
message: DataType.Message;
|
|
33
|
-
tools?: Tool[];
|
|
34
|
-
}>;
|
|
35
|
-
|
|
36
|
-
export const ToolBlock: FC<ToolBlockProps> = ({ classNames, message, tools }) => {
|
|
37
|
-
const { blocks = [] } = message;
|
|
38
|
-
|
|
39
|
-
let request: { tool: Tool | undefined; block: any } | undefined;
|
|
40
|
-
const toolBlocks = blocks.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
41
|
-
const items = toolBlocks
|
|
42
|
-
.map((block) => {
|
|
43
|
-
switch (block._tag) {
|
|
44
|
-
case 'toolCall': {
|
|
45
|
-
// TODO(burdon): Skip these updates?
|
|
46
|
-
if (block.pending && request?.block.toolCallId === block.toolCallId) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
request = { tool: tools?.find((tool) => tool.name === block.name), block };
|
|
51
|
-
return {
|
|
52
|
-
title: getToolCaption(request.tool, undefined), // block.status), // TODO(burdon): Get status?
|
|
53
|
-
block,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
case 'toolResult': {
|
|
58
|
-
if (!request) {
|
|
59
|
-
log.warn('unexpected message', { block });
|
|
60
|
-
return { title: 'Error', block };
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
title: `${getToolCaption(request.tool, undefined)} (Success)`,
|
|
65
|
-
block,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
default: {
|
|
70
|
-
request = undefined;
|
|
71
|
-
return {
|
|
72
|
-
title: 'Error',
|
|
73
|
-
block,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
.filter(isNonNullable);
|
|
79
|
-
|
|
80
|
-
return <ToolContainer classNames={classNames} items={items} />;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const ToolContainer: FC<ThemedClassName<{ items: { title: string; block: any }[] }>> = ({
|
|
84
|
-
classNames,
|
|
85
|
-
items,
|
|
86
|
-
}) => {
|
|
87
|
-
const tabsRef = useRef<HTMLDivElement>(null);
|
|
88
|
-
const [selected, setSelected] = useState(0);
|
|
89
|
-
const [open, setOpen] = useState(false);
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
if (open) {
|
|
92
|
-
tabsRef.current?.focus();
|
|
93
|
-
}
|
|
94
|
-
}, [open]);
|
|
95
|
-
|
|
96
|
-
const handleSelect = (index: number) => {
|
|
97
|
-
if (index === selected) {
|
|
98
|
-
setOpen(false);
|
|
99
|
-
} else {
|
|
100
|
-
setSelected(index);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const title = useMemo(() => {
|
|
105
|
-
const lines = items.map((item) => item.title).filter(isNotFalsy);
|
|
106
|
-
return <StatusRoll key='status-roll' lines={lines} duration={1_000} autoAdvance />;
|
|
107
|
-
}, [items]);
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<ToggleContainer classNames={['flex flex-col', classNames]} title={title} open={open} onChangeOpen={setOpen}>
|
|
111
|
-
<div className='w-full grid grid-cols-[32px_1fr]'>
|
|
112
|
-
<NumericTabs ref={tabsRef} length={items.length} selected={selected} onSelect={handleSelect} />
|
|
113
|
-
<Json data={items[selected].block} />
|
|
114
|
-
</div>
|
|
115
|
-
</ToggleContainer>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export const Json = ({ data }: Pick<JsonProps, 'data'>) => (
|
|
120
|
-
<NativeJson data={data} classNames='!p-1 text-xs bg-transparent' />
|
|
121
|
-
);
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type DataType } from '@dxos/schema';
|
|
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: DataType.Message[]; current?: DataType.Message }, DataType.Message> = (
|
|
15
|
-
{ current, messages },
|
|
16
|
-
message,
|
|
17
|
-
) => {
|
|
18
|
-
let i = 0;
|
|
19
|
-
for (const block of message.blocks) {
|
|
20
|
-
switch (block._tag) {
|
|
21
|
-
case 'toolCall':
|
|
22
|
-
case 'toolResult': {
|
|
23
|
-
if (current) {
|
|
24
|
-
current.blocks.push(block);
|
|
25
|
-
} else {
|
|
26
|
-
current = {
|
|
27
|
-
...message,
|
|
28
|
-
id: [message.id, i].join('_'),
|
|
29
|
-
blocks: [block],
|
|
30
|
-
};
|
|
31
|
-
messages.push(current);
|
|
32
|
-
}
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
case 'text':
|
|
37
|
-
default: {
|
|
38
|
-
current = undefined;
|
|
39
|
-
messages.push({
|
|
40
|
-
...message,
|
|
41
|
-
id: [message.id, i].join('_'),
|
|
42
|
-
blocks: [block],
|
|
43
|
-
});
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
i++;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return { current, messages };
|
|
52
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Template } from '@dxos/blueprints';
|
|
8
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
-
|
|
10
|
-
import { TemplateEditor } from './TemplateEditor';
|
|
11
|
-
|
|
12
|
-
export type TemplateContainerProps = {
|
|
13
|
-
template: Template.Template;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const TemplateContainer = ({ template }: TemplateContainerProps) => {
|
|
17
|
-
return (
|
|
18
|
-
<StackItem.Content classNames='container-max-width'>
|
|
19
|
-
<TemplateEditor template={template} />
|
|
20
|
-
</StackItem.Content>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default TemplateContainer;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, it } from 'vitest';
|
|
6
|
-
|
|
7
|
-
import { ChatProcessor } from './chat-processor';
|
|
8
|
-
|
|
9
|
-
describe('ChatProcessor', () => {
|
|
10
|
-
it('should be instantiable', ({ expect }) => {
|
|
11
|
-
const services = {} as any; // TODO(burdon): Create mock.
|
|
12
|
-
const client = {} as any; // TODO(burdon): Create mock.
|
|
13
|
-
const processor = new ChatProcessor(services, client);
|
|
14
|
-
expect(processor).toBeDefined();
|
|
15
|
-
});
|
|
16
|
-
});
|