@dxos/plugin-assistant 0.8.3 → 0.8.4-main.f9ba587
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/ChatContainer-6XNB5NEI.mjs +57 -0
- package/dist/lib/browser/ChatContainer-6XNB5NEI.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-IMWPRXTO.mjs +74 -0
- package/dist/lib/browser/ChatDialog-IMWPRXTO.mjs.map +7 -0
- package/dist/lib/browser/{BlueprintContainer-AT5Y7EXG.mjs → SequenceContainer-6XOYB2RN.mjs} +38 -37
- package/dist/lib/browser/SequenceContainer-6XOYB2RN.mjs.map +7 -0
- package/dist/lib/browser/{TemplateContainer-QQHVOTSI.mjs → TemplateContainer-6ZGGH5T4.mjs} +4 -4
- package/dist/lib/browser/TemplateContainer-6ZGGH5T4.mjs.map +7 -0
- package/dist/lib/browser/{ai-client-MK2ZZII2.mjs → ai-client-ML7OQWAO.mjs} +6 -6
- package/dist/lib/browser/ai-client-ML7OQWAO.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-E4H5DCOJ.mjs → app-graph-builder-UJ5NHRGK.mjs} +31 -33
- package/dist/lib/browser/app-graph-builder-UJ5NHRGK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JQFUME3B.mjs → chunk-44HZKIAW.mjs} +5 -5
- package/dist/lib/browser/chunk-44HZKIAW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XOZ7YMO3.mjs → chunk-LKP65RPA.mjs} +2 -2
- package/dist/lib/browser/chunk-NTBGTFTV.mjs +15 -0
- package/dist/lib/browser/chunk-NTBGTFTV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BI6AHRNJ.mjs → chunk-OZL4OHTU.mjs} +15 -15
- package/dist/lib/browser/chunk-OZL4OHTU.mjs.map +7 -0
- package/dist/lib/browser/chunk-TQ3QW3HJ.mjs +2072 -0
- package/dist/lib/browser/chunk-TQ3QW3HJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AAOKC2JN.mjs → chunk-TU7UUGWQ.mjs} +68 -73
- package/dist/lib/browser/chunk-TU7UUGWQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-WPZ4UANI.mjs +16 -0
- package/dist/lib/browser/index.mjs +53 -68
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-3UICTGPM.mjs → intent-resolver-LEAPB55Q.mjs} +10 -11
- package/dist/lib/browser/intent-resolver-LEAPB55Q.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-LXCNUSZN.mjs → react-surface-TMF7JJA4.mjs} +34 -37
- package/dist/lib/browser/react-surface-TMF7JJA4.mjs.map +7 -0
- package/dist/lib/browser/{settings-XRHXVWGB.mjs → settings-N4HEXADL.mjs} +6 -6
- package/dist/lib/browser/settings-N4HEXADL.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -10
- package/dist/lib/node-esm/ChatContainer-VOLG7J6N.mjs +58 -0
- package/dist/lib/node-esm/ChatContainer-VOLG7J6N.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-B2XNUNRM.mjs +75 -0
- package/dist/lib/node-esm/ChatDialog-B2XNUNRM.mjs.map +7 -0
- package/dist/lib/node-esm/{BlueprintContainer-STOJAVML.mjs → SequenceContainer-WWG6IMN3.mjs} +38 -37
- package/dist/lib/node-esm/SequenceContainer-WWG6IMN3.mjs.map +7 -0
- package/dist/lib/node-esm/{TemplateContainer-SOEWY2ZN.mjs → TemplateContainer-6KRNEMVE.mjs} +4 -4
- package/dist/lib/node-esm/TemplateContainer-6KRNEMVE.mjs.map +7 -0
- package/dist/lib/node-esm/{ai-client-XGZBJ6BE.mjs → ai-client-2FQ434CT.mjs} +6 -6
- package/dist/lib/node-esm/ai-client-2FQ434CT.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-3SY5MBIK.mjs → app-graph-builder-MEQ5CYNI.mjs} +31 -33
- package/dist/lib/node-esm/app-graph-builder-MEQ5CYNI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-D3HTVK5D.mjs +2073 -0
- package/dist/lib/node-esm/chunk-D3HTVK5D.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3UEZLJ2V.mjs → chunk-E6V2RUQ2.mjs} +5 -5
- package/dist/lib/node-esm/chunk-E6V2RUQ2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UCOFKNKN.mjs → chunk-HVMVHP4R.mjs} +15 -15
- package/dist/lib/node-esm/chunk-HVMVHP4R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HXKRKIN2.mjs +18 -0
- package/dist/lib/node-esm/{chunk-BB2TAT4P.mjs → chunk-KOC6ESG7.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-OYN6HLXZ.mjs → chunk-VESVUAOS.mjs} +5 -5
- package/dist/lib/node-esm/chunk-VESVUAOS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-J6UXXZGJ.mjs → chunk-YYUVTTVK.mjs} +68 -73
- package/dist/lib/node-esm/chunk-YYUVTTVK.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +53 -68
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-E6MXTYAU.mjs → intent-resolver-4ULF3F7U.mjs} +10 -11
- package/dist/lib/node-esm/intent-resolver-4ULF3F7U.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-7HA5EDWY.mjs → react-surface-6XL6SWL2.mjs} +34 -37
- package/dist/lib/node-esm/react-surface-6XL6SWL2.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-5IAY6BT4.mjs → settings-WQ76EG6O.mjs} +6 -6
- package/dist/lib/node-esm/settings-WQ76EG6O.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -10
- package/dist/types/src/capabilities/ai-client.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- 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/Chat/Chat.d.ts +42 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +2 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +5 -5
- 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/ChatPrompt/ChatActions.d.ts +10 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +9 -0
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +7 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/events.d.ts +17 -0
- package/dist/types/src/components/ChatPrompt/events.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/{Thread/ThreadMessage.d.ts → ChatThread/ChatMessage.d.ts} +6 -4
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +25 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +232 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +18 -0
- package/dist/types/src/components/ChatThread/ToolBlock.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/reducer.d.ts.map +1 -0
- package/dist/types/src/components/SequenceContainer.d.ts +9 -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 +8 -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/TemplateContainer.d.ts +4 -3
- package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +10 -3
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +6 -12
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/{processor.d.ts → chat-processor.d.ts} +27 -17
- package/dist/types/src/hooks/chat-processor.d.ts.map +1 -0
- package/dist/types/src/hooks/chat-processor.test.d.ts +2 -0
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +4 -4
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +4 -0
- package/dist/types/src/hooks/useBlueprints.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +20 -6
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextProvider.d.ts +6 -0
- package/dist/types/src/hooks/useContextProvider.d.ts.map +1 -1
- package/dist/types/src/hooks/useServiceContainer.d.ts +8 -0
- package/dist/types/src/hooks/useServiceContainer.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 +199 -0
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-sequence.d.ts +8 -0
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +61 -113
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +71 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/types/service.d.ts +6 -6
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +76 -74
- package/src/AssistantPlugin.tsx +13 -13
- package/src/capabilities/ai-client.ts +3 -6
- package/src/capabilities/app-graph-builder.ts +30 -26
- package/src/capabilities/capabilities.ts +2 -3
- package/src/capabilities/intent-resolver.ts +6 -6
- package/src/capabilities/react-surface.tsx +29 -29
- package/src/capabilities/settings.ts +3 -3
- package/src/components/AssistantSettings/AssistantSettings.tsx +4 -4
- package/src/components/Chat/Chat.tsx +348 -0
- package/src/{experimental/transcription → components/Chat}/index.ts +2 -0
- package/src/components/ChatContainer.tsx +24 -18
- package/src/components/ChatDialog.tsx +65 -0
- package/src/components/ChatPrompt/ChatActions.tsx +76 -0
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +52 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +52 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +26 -0
- package/src/components/ChatPrompt/events.ts +12 -0
- package/src/components/ChatPrompt/index.ts +10 -0
- package/src/components/{Thread/ThreadMessage.tsx → ChatThread/ChatMessage.tsx} +35 -31
- package/src/components/ChatThread/ChatThread.stories.tsx +148 -0
- package/src/components/ChatThread/ChatThread.tsx +68 -0
- package/src/components/{Thread/ToolInvocations.tsx → ChatThread/ToolBlock.tsx} +13 -8
- package/src/components/{AmbientDialog → ChatThread}/index.ts +1 -1
- package/src/components/PromptSettings.tsx +2 -2
- package/src/components/{BlueprintContainer.tsx → SequenceContainer.tsx} +23 -32
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +32 -0
- package/src/components/{BlueprintEditor/BlueprintEditor.tsx → SequenceEditor/SequenceEditor.tsx} +7 -7
- package/src/components/SequenceEditor/index.ts +5 -0
- package/src/components/TemplateContainer.tsx +7 -5
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +2 -2
- package/src/components/TemplateEditor/TemplateEditor.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.tsx +2 -3
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -5
- package/src/components/Toolbox/Toolbox.tsx +56 -3
- package/src/components/index.ts +4 -5
- package/src/events.ts +2 -2
- package/src/hooks/{processor.test.ts → chat-processor.test.ts} +1 -1
- package/src/hooks/{processor.ts → chat-processor.ts} +115 -72
- package/src/hooks/index.ts +4 -4
- package/src/hooks/useBlueprints.ts +31 -0
- package/src/hooks/useChatProcessor.tsx +69 -24
- package/src/hooks/useContextProvider.ts +8 -2
- package/src/hooks/useServiceContainer.ts +42 -0
- package/src/queue-logger.ts +6 -6
- package/src/stories/Chat.stories.tsx +269 -0
- package/src/testing/index.ts +1 -1
- package/src/testing/{test-blueprint.ts → test-sequence.ts} +4 -9
- package/src/tools/openapi.test.ts +11 -11
- package/src/translations.ts +24 -22
- package/src/types/index.ts +1 -2
- package/src/types/schema.ts +86 -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.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.map +0 -7
- package/dist/lib/browser/app-graph-builder-E4H5DCOJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-AAOKC2JN.mjs.map +0 -7
- 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.map +0 -7
- package/dist/lib/browser/chunk-MEGMOFJB.mjs +0 -16
- 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.map +0 -7
- 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.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.map +0 -7
- 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-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.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.map +0 -7
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs.map +0 -7
- 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/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/BlueprintContainer.d.ts +0 -9
- package/dist/types/src/components/BlueprintContainer.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/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.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.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.map +0 -1
- package/dist/types/src/hooks/processor.test.d.ts +0 -2
- package/dist/types/src/hooks/processor.test.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/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/types/chat.d.ts +0 -23
- package/dist/types/src/types/chat.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/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/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/index.ts +0 -6
- package/src/hooks/useMessageQueue.ts +0 -22
- package/src/hooks/useServices.ts +0 -28
- 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/test-data.ts +0 -128
- package/src/stories/testing.ts +0 -60
- package/src/types/chat.ts +0 -32
- package/src/types/types.ts +0 -48
- /package/dist/lib/browser/{chunk-XOZ7YMO3.mjs.map → chunk-LKP65RPA.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-MEGMOFJB.mjs.map → chunk-WPZ4UANI.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-34EX6E5Q.mjs.map → chunk-HXKRKIN2.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-BB2TAT4P.mjs.map → chunk-KOC6ESG7.mjs.map} +0 -0
- /package/dist/types/src/components/{Thread → ChatThread}/reducer.d.ts +0 -0
- /package/src/components/{Thread → ChatThread}/reducer.ts +0 -0
|
@@ -8,21 +8,15 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
|
8
8
|
|
|
9
9
|
import { ToolRegistry } from '@dxos/ai';
|
|
10
10
|
import { useCapability } from '@dxos/app-framework';
|
|
11
|
-
import {
|
|
12
|
-
type Blueprint,
|
|
13
|
-
type BlueprintDefinition,
|
|
14
|
-
BlueprintMachine,
|
|
15
|
-
createLocalSearchTool,
|
|
16
|
-
createExaTool,
|
|
17
|
-
createGraphWriterTool,
|
|
18
|
-
} from '@dxos/assistant';
|
|
11
|
+
import { createLocalSearchTool, createExaTool, createGraphWriterTool } from '@dxos/assistant';
|
|
19
12
|
import { getSpace } from '@dxos/client/echo';
|
|
13
|
+
import { type Sequence, type SequenceDefinition, SequenceMachine } from '@dxos/conductor';
|
|
20
14
|
import { DXN, Key } from '@dxos/echo';
|
|
21
15
|
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
22
16
|
import { getSelectionSet, useSelectionManager } from '@dxos/react-ui-attention';
|
|
23
17
|
import { StackItem, type StackItemContentProps } from '@dxos/react-ui-stack';
|
|
24
18
|
|
|
25
|
-
import {
|
|
19
|
+
import { SequenceEditor } from './SequenceEditor';
|
|
26
20
|
import { AssistantCapabilities } from '../capabilities';
|
|
27
21
|
import { meta } from '../meta';
|
|
28
22
|
import { QueueLogger } from '../queue-logger';
|
|
@@ -31,7 +25,7 @@ import { QueueLogger } from '../queue-logger';
|
|
|
31
25
|
export const EXA_API_KEY = '9c7e17ff-0c85-4cd5-827a-8b489f139e03';
|
|
32
26
|
|
|
33
27
|
// TODO(burdon): Validate.
|
|
34
|
-
const
|
|
28
|
+
const parseSequence = (text: string): SequenceDefinition | undefined => {
|
|
35
29
|
try {
|
|
36
30
|
const json = JSON5.parse(text);
|
|
37
31
|
const { steps } = json;
|
|
@@ -41,25 +35,22 @@ const parseBlueprint = (text: string): BlueprintDefinition | undefined => {
|
|
|
41
35
|
}
|
|
42
36
|
};
|
|
43
37
|
|
|
44
|
-
export const
|
|
45
|
-
role,
|
|
46
|
-
blueprint,
|
|
47
|
-
}: Pick<StackItemContentProps, 'role'> & { blueprint: Blueprint }) => {
|
|
38
|
+
export const SequenceContainer = ({ role, sequence }: Pick<StackItemContentProps, 'role'> & { sequence: Sequence }) => {
|
|
48
39
|
const { t } = useTranslation(meta.id);
|
|
49
40
|
const aiClient = useCapability(AssistantCapabilities.AiClient);
|
|
50
41
|
const selectionManager = useSelectionManager();
|
|
51
|
-
const [definition, setDefinition] = useState<
|
|
42
|
+
const [definition, setDefinition] = useState<SequenceDefinition>();
|
|
52
43
|
useEffect(() => {
|
|
53
44
|
setDefinition({
|
|
54
|
-
steps:
|
|
45
|
+
steps: sequence.steps.map(({ instructions, tools }) => ({ instructions, tools })),
|
|
55
46
|
});
|
|
56
|
-
}, [
|
|
47
|
+
}, [sequence]);
|
|
57
48
|
|
|
58
49
|
const editorRef = useRef<EditorView | undefined>(undefined);
|
|
59
50
|
|
|
60
51
|
// TODO(burdon): Factor out.
|
|
61
52
|
const toolRegistry = useMemo(() => {
|
|
62
|
-
const space = getSpace(
|
|
53
|
+
const space = getSpace(sequence);
|
|
63
54
|
if (!space) {
|
|
64
55
|
return;
|
|
65
56
|
}
|
|
@@ -73,16 +64,16 @@ export const BlueprintContainer = ({
|
|
|
73
64
|
createGraphWriterTool({
|
|
74
65
|
db: space.db,
|
|
75
66
|
queue,
|
|
76
|
-
schema: [], // TODO(burdon): Get schema from client/
|
|
67
|
+
schema: [], // TODO(burdon): Get schema from client/sequence?
|
|
77
68
|
onDone: async (objects) => {
|
|
78
69
|
await queue.append(objects);
|
|
79
70
|
},
|
|
80
71
|
}),
|
|
81
72
|
]);
|
|
82
|
-
}, [
|
|
73
|
+
}, [sequence]);
|
|
83
74
|
|
|
84
|
-
const formatAndSave = useCallback(():
|
|
85
|
-
if (!
|
|
75
|
+
const formatAndSave = useCallback((): SequenceDefinition | undefined => {
|
|
76
|
+
if (!sequence) {
|
|
86
77
|
return;
|
|
87
78
|
}
|
|
88
79
|
|
|
@@ -91,7 +82,7 @@ export const BlueprintContainer = ({
|
|
|
91
82
|
return;
|
|
92
83
|
}
|
|
93
84
|
|
|
94
|
-
const definition =
|
|
85
|
+
const definition = parseSequence(text);
|
|
95
86
|
if (!definition) {
|
|
96
87
|
return;
|
|
97
88
|
}
|
|
@@ -102,19 +93,19 @@ export const BlueprintContainer = ({
|
|
|
102
93
|
changes: { from: 0, to: text.length, insert: formatted },
|
|
103
94
|
});
|
|
104
95
|
|
|
105
|
-
|
|
96
|
+
sequence.steps.length = 0;
|
|
106
97
|
for (const step of definition.steps) {
|
|
107
|
-
|
|
98
|
+
sequence.steps.push({
|
|
108
99
|
id: Key.ObjectId.random(),
|
|
109
100
|
instructions: step.instructions,
|
|
110
101
|
tools: step.tools,
|
|
111
102
|
});
|
|
112
103
|
}
|
|
113
104
|
|
|
114
|
-
return
|
|
115
|
-
}, [
|
|
105
|
+
return sequence;
|
|
106
|
+
}, [sequence]);
|
|
116
107
|
|
|
117
|
-
// TODO(burdon): Save raw
|
|
108
|
+
// TODO(burdon): Save raw sequence separately from parsed sequence? (like Script).
|
|
118
109
|
const handleSave = useCallback(() => formatAndSave(), [formatAndSave]);
|
|
119
110
|
|
|
120
111
|
const handleRun = useCallback(async () => {
|
|
@@ -130,9 +121,9 @@ export const BlueprintContainer = ({
|
|
|
130
121
|
return;
|
|
131
122
|
}
|
|
132
123
|
|
|
133
|
-
const machine = new
|
|
124
|
+
const machine = new SequenceMachine(toolRegistry, sequence).setLogger(new QueueLogger(sequence));
|
|
134
125
|
await machine.runToCompletion({ aiClient: aiClient.value, input });
|
|
135
|
-
}, [aiClient.value,
|
|
126
|
+
}, [aiClient.value, sequence, formatAndSave, selectionManager, toolRegistry]);
|
|
136
127
|
|
|
137
128
|
return (
|
|
138
129
|
<StackItem.Content role={role} toolbar>
|
|
@@ -140,9 +131,9 @@ export const BlueprintContainer = ({
|
|
|
140
131
|
<Toolbar.Button onClick={handleSave}>{t('button save')}</Toolbar.Button>
|
|
141
132
|
<Toolbar.Button onClick={handleRun}>{t('button run')}</Toolbar.Button>
|
|
142
133
|
</Toolbar.Root>
|
|
143
|
-
{definition && <
|
|
134
|
+
{definition && <SequenceEditor ref={editorRef} sequence={definition} />}
|
|
144
135
|
</StackItem.Content>
|
|
145
136
|
);
|
|
146
137
|
};
|
|
147
138
|
|
|
148
|
-
export default
|
|
139
|
+
export default SequenceContainer;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
8
|
+
|
|
9
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
10
|
+
|
|
11
|
+
import { SequenceEditor } from './SequenceEditor';
|
|
12
|
+
import { RESEARCH_SEQUENCE_DEFINITION } from '../../testing';
|
|
13
|
+
import { translations } from '../../translations';
|
|
14
|
+
|
|
15
|
+
const meta: Meta<typeof SequenceEditor> = {
|
|
16
|
+
title: 'plugins/plugin-assistant/SequenceEditor',
|
|
17
|
+
component: SequenceEditor,
|
|
18
|
+
decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'mli-auto max-is-[50rem] justify-center' })],
|
|
19
|
+
parameters: {
|
|
20
|
+
translations,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof SequenceEditor>;
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
sequence: RESEARCH_SEQUENCE_DEFINITION,
|
|
31
|
+
},
|
|
32
|
+
};
|
package/src/components/{BlueprintEditor/BlueprintEditor.tsx → SequenceEditor/SequenceEditor.tsx}
RENAMED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { SequenceDefinition } from '@dxos/conductor';
|
|
8
8
|
import { Type } from '@dxos/echo';
|
|
9
9
|
import { useThemeContext, type ThemedClassName } from '@dxos/react-ui';
|
|
10
10
|
import {
|
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
} from '@dxos/react-ui-editor';
|
|
17
17
|
import { mx } from '@dxos/react-ui-theme';
|
|
18
18
|
|
|
19
|
-
export type
|
|
20
|
-
|
|
19
|
+
export type SequenceEditorProps = ThemedClassName<{
|
|
20
|
+
sequence: SequenceDefinition;
|
|
21
21
|
}>;
|
|
22
22
|
|
|
23
23
|
// TODO(burdon): Factor out JsonEditor.
|
|
24
|
-
export const
|
|
25
|
-
({ classNames,
|
|
24
|
+
export const SequenceEditor = forwardRef<EditorView | undefined, SequenceEditorProps>(
|
|
25
|
+
({ classNames, sequence }, forwardedRef) => {
|
|
26
26
|
const { themeMode } = useThemeContext();
|
|
27
27
|
const { parentRef, view } = useTextEditor({
|
|
28
|
-
initialValue: JSON.stringify(
|
|
28
|
+
initialValue: JSON.stringify(sequence, null, 2),
|
|
29
29
|
extensions: [
|
|
30
30
|
createBasicExtensions({
|
|
31
31
|
lineNumbers: true,
|
|
@@ -38,7 +38,7 @@ export const BlueprintEditor = forwardRef<EditorView | undefined, BlueprintEdito
|
|
|
38
38
|
syntaxHighlighting: true,
|
|
39
39
|
}),
|
|
40
40
|
createJsonExtensions({
|
|
41
|
-
schema: Type.toJsonSchema(
|
|
41
|
+
schema: Type.toJsonSchema(SequenceDefinition, { strict: true }),
|
|
42
42
|
}),
|
|
43
43
|
],
|
|
44
44
|
});
|
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { StackItem
|
|
7
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
8
8
|
|
|
9
9
|
import { TemplateEditor } from './TemplateEditor';
|
|
10
10
|
import { type TemplateType } from '../types';
|
|
11
11
|
|
|
12
|
-
export
|
|
13
|
-
role
|
|
14
|
-
template
|
|
15
|
-
}
|
|
12
|
+
export type TemplateContainerProps = {
|
|
13
|
+
role: string;
|
|
14
|
+
template: TemplateType;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const TemplateContainer = ({ role, template }: TemplateContainerProps) => {
|
|
16
18
|
return (
|
|
17
19
|
<StackItem.Content role={role} classNames='container-max-width'>
|
|
18
20
|
<TemplateEditor template={template} />
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { createSystemPrompt } from '@dxos/artifact';
|
|
@@ -14,7 +14,7 @@ import { withClientProvider } from '@dxos/react-client/testing';
|
|
|
14
14
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
15
15
|
|
|
16
16
|
import { TemplateEditor, type TemplateEditorProps } from './TemplateEditor';
|
|
17
|
-
import translations from '../../translations';
|
|
17
|
+
import { translations } from '../../translations';
|
|
18
18
|
import { TemplateType } from '../../types';
|
|
19
19
|
|
|
20
20
|
const TEMPLATE = [
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@dxos/react-ui-editor';
|
|
18
18
|
import { mx } from '@dxos/react-ui-theme';
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import { meta } from '../../meta';
|
|
21
21
|
import { type TemplateType } from '../../types';
|
|
22
22
|
|
|
23
23
|
handlebarsLanguage.configure({
|
|
@@ -33,7 +33,7 @@ export type TemplateEditorProps = ThemedClassName<{
|
|
|
33
33
|
}>;
|
|
34
34
|
|
|
35
35
|
export const TemplateEditor = ({ classNames, template }: TemplateEditorProps) => {
|
|
36
|
-
const { t } = useTranslation(
|
|
36
|
+
const { t } = useTranslation(meta.id);
|
|
37
37
|
const { themeMode } = useThemeContext();
|
|
38
38
|
const { parentRef } = useTextEditor(
|
|
39
39
|
() => ({
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
@@ -13,7 +13,7 @@ import { withClientProvider } from '@dxos/react-client/testing';
|
|
|
13
13
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
14
|
|
|
15
15
|
import { TemplateForm } from './TemplateForm';
|
|
16
|
-
import translations from '../../translations';
|
|
16
|
+
import { translations } from '../../translations';
|
|
17
17
|
import { TemplateType } from '../../types';
|
|
18
18
|
|
|
19
19
|
const TEMPLATE = [
|
|
@@ -10,7 +10,7 @@ import { attentionSurface, groupBorder, mx } from '@dxos/react-ui-theme';
|
|
|
10
10
|
import { isNonNullable } from '@dxos/util';
|
|
11
11
|
|
|
12
12
|
import { TemplateEditor } from './TemplateEditor';
|
|
13
|
-
import {
|
|
13
|
+
import { meta } from '../../meta';
|
|
14
14
|
import { type TemplateInput, TemplateInputType, type TemplateType } from '../../types';
|
|
15
15
|
|
|
16
16
|
export type TemplateFormProps = {
|
|
@@ -20,8 +20,7 @@ export type TemplateFormProps = {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const TemplateForm = ({ template, commandEditable = true }: TemplateFormProps) => {
|
|
23
|
-
const { t } = useTranslation(
|
|
24
|
-
|
|
23
|
+
const { t } = useTranslation(meta.id);
|
|
25
24
|
usePromptInputs(template);
|
|
26
25
|
|
|
27
26
|
return (
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
7
|
+
import { type Meta } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { IntentPlugin, Capabilities, useCapabilities, SettingsPlugin } from '@dxos/app-framework';
|
|
@@ -15,10 +15,10 @@ import { ClientPlugin } from '@dxos/plugin-client';
|
|
|
15
15
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
16
16
|
import { SpacePlugin } from '@dxos/plugin-space';
|
|
17
17
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
18
|
-
import { withLayout,
|
|
18
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
19
19
|
|
|
20
20
|
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
21
|
-
import translations from '../../translations';
|
|
21
|
+
import { translations } from '../../translations';
|
|
22
22
|
|
|
23
23
|
const DefaultStory = (props: ToolboxProps) => {
|
|
24
24
|
const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
|
|
@@ -26,7 +26,7 @@ const DefaultStory = (props: ToolboxProps) => {
|
|
|
26
26
|
<Toolbox
|
|
27
27
|
{...props}
|
|
28
28
|
artifacts={artifactDefinitions}
|
|
29
|
-
classNames='w-[30rem] h-[15rem] rounded-
|
|
29
|
+
classNames='w-[30rem] h-[15rem] rounded-sm border border-separator py-1'
|
|
30
30
|
/>
|
|
31
31
|
);
|
|
32
32
|
};
|
|
@@ -36,7 +36,6 @@ const meta: Meta<typeof Toolbox> = {
|
|
|
36
36
|
component: Toolbox,
|
|
37
37
|
render: DefaultStory,
|
|
38
38
|
decorators: [
|
|
39
|
-
withSignals,
|
|
40
39
|
withPluginManager({
|
|
41
40
|
plugins: [
|
|
42
41
|
ClientPlugin({
|
|
@@ -7,25 +7,64 @@ import React, { useState, useEffect, Fragment, type FC } from 'react';
|
|
|
7
7
|
import { parseToolName, type Tool } from '@dxos/ai';
|
|
8
8
|
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
9
9
|
import { type ArtifactDefinition } from '@dxos/artifact';
|
|
10
|
+
import { type Blueprint } from '@dxos/assistant';
|
|
11
|
+
import { type Ref } from '@dxos/echo';
|
|
10
12
|
import { FunctionType } from '@dxos/functions';
|
|
11
13
|
import { log } from '@dxos/log';
|
|
12
14
|
import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
|
|
13
15
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
16
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
14
17
|
import { mx } from '@dxos/react-ui-theme';
|
|
15
18
|
|
|
19
|
+
import { type ChatProcessor } from '../../hooks';
|
|
20
|
+
import { meta } from '../../meta';
|
|
16
21
|
import { createToolsFromService } from '../../tools';
|
|
17
22
|
import { ServiceType } from '../../types';
|
|
18
23
|
|
|
19
24
|
export type ToolboxProps = ThemedClassName<{
|
|
25
|
+
blueprints?: readonly Ref.Ref<Blueprint>[];
|
|
20
26
|
artifacts?: ArtifactDefinition[];
|
|
21
27
|
services?: { service: ServiceType; tools: Tool[] }[];
|
|
22
28
|
functions?: FunctionType[];
|
|
29
|
+
activeBlueprints?: readonly Ref.Ref<Blueprint>[];
|
|
23
30
|
striped?: boolean;
|
|
24
31
|
}>;
|
|
25
32
|
|
|
26
|
-
export const Toolbox = ({
|
|
33
|
+
export const Toolbox = ({
|
|
34
|
+
classNames,
|
|
35
|
+
artifacts,
|
|
36
|
+
functions,
|
|
37
|
+
services,
|
|
38
|
+
blueprints,
|
|
39
|
+
activeBlueprints,
|
|
40
|
+
striped,
|
|
41
|
+
}: ToolboxProps) => {
|
|
42
|
+
const { t } = useTranslation(meta.id);
|
|
43
|
+
|
|
27
44
|
return (
|
|
28
45
|
<div className={mx('flex flex-col overflow-y-auto box-content', classNames)}>
|
|
46
|
+
{blueprints && blueprints.length > 0 && (
|
|
47
|
+
<Section
|
|
48
|
+
title='Blueprints'
|
|
49
|
+
items={blueprints.map(({ target }) => ({
|
|
50
|
+
name: target?.name ?? '',
|
|
51
|
+
description: target?.description ?? '',
|
|
52
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${parseToolName(toolId)}` })),
|
|
53
|
+
}))}
|
|
54
|
+
/>
|
|
55
|
+
)}
|
|
56
|
+
|
|
57
|
+
{activeBlueprints && activeBlueprints.length > 0 && (
|
|
58
|
+
<Section
|
|
59
|
+
title='Blueprints'
|
|
60
|
+
items={activeBlueprints.map(({ target }) => ({
|
|
61
|
+
name: target?.name ?? '',
|
|
62
|
+
description: target?.description ?? '',
|
|
63
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${parseToolName(toolId)}` })),
|
|
64
|
+
}))}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
67
|
+
|
|
29
68
|
{artifacts && artifacts.length > 0 && (
|
|
30
69
|
<Section
|
|
31
70
|
title='Artifacts'
|
|
@@ -51,6 +90,12 @@ export const Toolbox = ({ classNames, artifacts, functions, services, striped }:
|
|
|
51
90
|
{functions && functions.length > 0 && (
|
|
52
91
|
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
53
92
|
)}
|
|
93
|
+
|
|
94
|
+
{!blueprints?.length &&
|
|
95
|
+
!activeBlueprints?.length &&
|
|
96
|
+
!artifacts?.length &&
|
|
97
|
+
!services?.length &&
|
|
98
|
+
!functions?.length && <div>{t('no tools')}</div>}
|
|
54
99
|
</div>
|
|
55
100
|
);
|
|
56
101
|
};
|
|
@@ -89,7 +134,9 @@ const Section: FC<{
|
|
|
89
134
|
);
|
|
90
135
|
};
|
|
91
136
|
|
|
92
|
-
export
|
|
137
|
+
export type ToolboxContainerProps = ThemedClassName<{ space?: Space; processor?: ChatProcessor }>;
|
|
138
|
+
|
|
139
|
+
export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContainerProps) => {
|
|
93
140
|
// Plugin artifacts.
|
|
94
141
|
const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
|
|
95
142
|
|
|
@@ -111,6 +158,12 @@ export const ToolboxContainer = ({ classNames, space }: ThemedClassName<{ space?
|
|
|
111
158
|
const functions = useQuery(space, Filter.type(FunctionType));
|
|
112
159
|
|
|
113
160
|
return (
|
|
114
|
-
<Toolbox
|
|
161
|
+
<Toolbox
|
|
162
|
+
classNames={classNames}
|
|
163
|
+
blueprints={processor?.context.blueprints.value}
|
|
164
|
+
artifacts={artifactDefinitions}
|
|
165
|
+
services={serviceTools}
|
|
166
|
+
functions={functions}
|
|
167
|
+
/>
|
|
115
168
|
);
|
|
116
169
|
};
|
package/src/components/index.ts
CHANGED
|
@@ -4,18 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export * from './AmbientDialog';
|
|
8
7
|
export * from './AssistantSettings';
|
|
9
|
-
export * from './
|
|
8
|
+
export * from './Chat';
|
|
10
9
|
export * from './PromptSettings';
|
|
11
10
|
export * from './TemplateEditor';
|
|
12
|
-
export * from './Thread';
|
|
13
11
|
export * from './Toolbox';
|
|
14
12
|
|
|
15
13
|
// TODO(burdon): Lazy loading causes issues with Tabster.
|
|
16
14
|
// Repro: open assistant dialog then close.
|
|
17
15
|
// https://github.com/microsoft/fluentui/issues/34020
|
|
18
|
-
|
|
19
|
-
export const BlueprintContainer = lazy(() => import('./BlueprintContainer'));
|
|
16
|
+
|
|
20
17
|
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
|
18
|
+
export const ChatDialog = lazy(() => import('./ChatDialog'));
|
|
19
|
+
export const SequenceContainer = lazy(() => import('./SequenceContainer'));
|
|
21
20
|
export const TemplateContainer = lazy(() => import('./TemplateContainer'));
|
package/src/events.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { Events } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { meta } from './meta';
|
|
8
8
|
|
|
9
9
|
export namespace AssistantEvents {
|
|
10
|
-
export const AiClientReady = Events.createStateEvent(`${
|
|
10
|
+
export const AiClientReady = Events.createStateEvent(`${meta.id}/ai-client-ready`);
|
|
11
11
|
}
|