@dxos/plugin-assistant 0.8.3 → 0.8.4-main.c1de068
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-M3IHQLRS.mjs +54 -0
- package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs +72 -0
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs.map +7 -0
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs +162 -0
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +7 -0
- package/dist/lib/browser/{TemplateContainer-QQHVOTSI.mjs → TemplateContainer-RPJ2LBOB.mjs} +5 -6
- package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-E4H5DCOJ.mjs → app-graph-builder-JTXBKE7O.mjs} +34 -36
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +7 -0
- package/dist/lib/browser/chunk-AEAEKWOC.mjs +98 -0
- package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BI6AHRNJ.mjs → chunk-EQDW6BYQ.mjs} +19 -68
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs.map +7 -0
- package/dist/lib/{node/chunk-P74TWGMG.cjs → browser/chunk-FDCJSQYF.mjs} +10 -14
- package/dist/lib/{node-esm/chunk-BB2TAT4P.mjs.map → browser/chunk-FDCJSQYF.mjs.map} +1 -1
- package/dist/lib/browser/chunk-JQBVLTM5.mjs +158 -0
- package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +7 -0
- package/dist/lib/browser/chunk-OWY4CUQY.mjs +2245 -0
- package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +87 -119
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs +60 -0
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-LXCNUSZN.mjs → react-surface-66VY37YQ.mjs} +42 -51
- package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +7 -0
- package/dist/lib/browser/{settings-XRHXVWGB.mjs → settings-2DGP3UTS.mjs} +6 -6
- package/dist/lib/browser/settings-2DGP3UTS.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -20
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs +55 -0
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs +73 -0
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs.map +7 -0
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs +163 -0
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +7 -0
- package/dist/lib/node-esm/{TemplateContainer-SOEWY2ZN.mjs → TemplateContainer-A3NAQCZE.mjs} +5 -6
- package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-3SY5MBIK.mjs → app-graph-builder-OWSOXFTD.mjs} +34 -36
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OYN6HLXZ.mjs → chunk-2XL6MNPE.mjs} +44 -33
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs +159 -0
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UCOFKNKN.mjs → chunk-E33DNNDW.mjs} +19 -68
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +41 -0
- package/dist/lib/{browser/chunk-XOZ7YMO3.mjs.map → node-esm/chunk-QN2H2EHV.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs +2246 -0
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +87 -119
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs +61 -0
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-7HA5EDWY.mjs → react-surface-RJMRBR2M.mjs} +42 -51
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-5IAY6BT4.mjs → settings-47RYZOU4.mjs} +6 -6
- package/dist/lib/node-esm/settings-47RYZOU4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -20
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.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 +47 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/events.d.ts +30 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +3 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +6 -6
- 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 +11 -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/ChatPresets.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +8 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts +6 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +17 -0
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +19 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +241 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +19 -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/{Thread → ChatThread}/reducer.d.ts +4 -4
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.d.ts +2 -2
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts +8 -0
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +13 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -0
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +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 +5 -5
- package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -2
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +3 -3
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +3 -3
- 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 +11 -4
- 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} +36 -22
- 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 +5 -5
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/presets.d.ts +13 -0
- package/dist/types/src/hooks/presets.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprints.d.ts +9 -0
- package/dist/types/src/hooks/useBlueprints.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +20 -8
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +14 -0
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts +7 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -0
- package/dist/types/src/parser/index.d.ts +1 -1
- package/dist/types/src/parser/index.d.ts.map +1 -1
- 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 +249 -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 +77 -113
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +88 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/types/service.d.ts +9 -9
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +80 -74
- package/src/AssistantPlugin.tsx +20 -47
- package/src/capabilities/app-graph-builder.ts +35 -30
- package/src/capabilities/index.ts +0 -3
- package/src/capabilities/intent-resolver.ts +27 -14
- package/src/capabilities/react-surface.tsx +38 -37
- package/src/capabilities/settings.ts +3 -3
- package/src/components/AssistantSettings/AssistantSettings.tsx +4 -4
- package/src/components/Chat/Chat.tsx +388 -0
- package/src/components/Chat/events.ts +50 -0
- package/src/components/Chat/index.ts +7 -0
- package/src/components/ChatContainer.tsx +26 -20
- package/src/components/ChatDialog.tsx +64 -0
- package/src/components/ChatPrompt/ChatActions.tsx +71 -0
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +52 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +28 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +53 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +39 -0
- package/src/components/ChatPrompt/index.ts +9 -0
- package/src/components/ChatThread/ChatMessage.tsx +268 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +143 -0
- package/src/components/ChatThread/ChatThread.tsx +57 -0
- package/src/components/{Thread/ToolInvocations.tsx → ChatThread/ToolBlock.tsx} +36 -21
- package/src/{experimental/transcription → components/ChatThread}/index.ts +2 -0
- package/src/components/{Thread → ChatThread}/reducer.ts +14 -14
- package/src/components/PromptSettings.tsx +43 -45
- package/src/components/SequenceContainer.tsx +132 -0
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +32 -0
- package/src/components/{BlueprintEditor/BlueprintEditor.tsx → SequenceEditor/SequenceEditor.tsx} +7 -7
- package/src/components/{AmbientDialog → SequenceEditor}/index.ts +1 -1
- package/src/components/TemplateContainer.tsx +8 -7
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +28 -33
- package/src/components/TemplateEditor/TemplateEditor.tsx +32 -19
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +15 -15
- package/src/components/TemplateEditor/TemplateForm.tsx +47 -55
- package/src/components/Toolbox/Toolbox.stories.tsx +5 -6
- package/src/components/Toolbox/Toolbox.tsx +60 -4
- package/src/components/index.ts +4 -5
- package/src/events.ts +2 -2
- package/src/hooks/{processor.test.ts → chat-processor.test.ts} +3 -2
- package/src/hooks/chat-processor.ts +314 -0
- package/src/hooks/index.ts +5 -5
- package/src/hooks/presets.ts +52 -0
- package/src/hooks/useBlueprints.ts +57 -0
- package/src/hooks/useChatProcessor.ts +143 -0
- package/src/hooks/useChatServices.ts +91 -0
- package/src/hooks/{useContextProvider.ts → useReferencesProvider.ts} +14 -14
- package/src/parser/index.ts +1 -1
- package/src/queue-logger.ts +6 -6
- package/src/stories/Chat.stories.tsx +378 -0
- package/src/testing/index.ts +1 -1
- package/src/testing/test-functions.ts +1 -1
- package/src/testing/test-sequence.ts +51 -0
- package/src/tools/openapi.test.ts +11 -11
- package/src/translations.ts +43 -23
- package/src/types/index.ts +1 -3
- package/src/types/schema.ts +95 -0
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs +0 -47
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs.map +0 -7
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs +0 -321
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs +0 -40
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-QQHVOTSI.mjs.map +0 -7
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs +0 -39
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-E4H5DCOJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-AAOKC2JN.mjs +0 -208
- package/dist/lib/browser/chunk-AAOKC2JN.mjs.map +0 -7
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-JO4W3MF7.mjs +0 -2101
- package/dist/lib/browser/chunk-JO4W3MF7.mjs.map +0 -7
- package/dist/lib/browser/chunk-JQFUME3B.mjs +0 -87
- package/dist/lib/browser/chunk-JQFUME3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-MEGMOFJB.mjs +0 -16
- package/dist/lib/browser/chunk-MEGMOFJB.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs +0 -96
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs.map +0 -7
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs +0 -15
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs.map +0 -7
- package/dist/lib/browser/chunk-XOZ7YMO3.mjs +0 -20
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs +0 -43
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LXCNUSZN.mjs.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.map +0 -7
- package/dist/lib/node/chunk-QGPWY6GW.cjs +0 -34
- package/dist/lib/node/chunk-QGPWY6GW.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -289
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs +0 -58
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs +0 -172
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs.map +0 -7
- package/dist/lib/node/settings-2JXLKYGE.cjs +0 -36
- package/dist/lib/node/settings-2JXLKYGE.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -54
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs +0 -48
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs +0 -322
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs +0 -41
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-SOEWY2ZN.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs +0 -40
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-3SY5MBIK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs +0 -18
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3UEZLJ2V.mjs +0 -16
- package/dist/lib/node-esm/chunk-3UEZLJ2V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BB2TAT4P.mjs +0 -22
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs +0 -98
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs +0 -209
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OD574YIU.mjs +0 -2102
- package/dist/lib/node-esm/chunk-OD574YIU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OYN6HLXZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs +0 -44
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7HA5EDWY.mjs.map +0 -7
- package/dist/lib/node-esm/settings-5IAY6BT4.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-client.d.ts +0 -5
- package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -6
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +0 -10
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +0 -8
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/index.d.ts +0 -2
- package/dist/types/src/components/AmbientDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/AssistantDialog.d.ts +0 -7
- package/dist/types/src/components/AssistantDialog.d.ts.map +0 -1
- package/dist/types/src/components/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 +0 -16
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +0 -13
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +0 -1
- package/dist/types/src/components/Thread/index.d.ts +0 -3
- package/dist/types/src/components/Thread/index.d.ts.map +0 -1
- package/dist/types/src/components/Thread/reducer.d.ts.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/useContextProvider.d.ts +0 -17
- package/dist/types/src/hooks/useContextProvider.d.ts.map +0 -1
- package/dist/types/src/hooks/useMessageQueue.d.ts +0 -42
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +0 -1
- package/dist/types/src/hooks/useServices.d.ts +0 -7
- package/dist/types/src/hooks/useServices.d.ts.map +0 -1
- package/dist/types/src/hooks/useTextInputEvents.d.ts +0 -13
- package/dist/types/src/hooks/useTextInputEvents.d.ts.map +0 -1
- package/dist/types/src/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/template.d.ts +0 -56
- package/dist/types/src/types/template.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -50
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/ai-client.ts +0 -42
- package/src/capabilities/capabilities.ts +0 -15
- 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/BlueprintContainer.tsx +0 -148
- 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/ThreadMessage.tsx +0 -234
- package/src/components/Thread/index.ts +0 -6
- package/src/hooks/processor.ts +0 -238
- package/src/hooks/useChatProcessor.tsx +0 -97
- package/src/hooks/useMessageQueue.ts +0 -22
- package/src/hooks/useServices.ts +0 -28
- package/src/hooks/useTextInputEvents.ts +0 -49
- package/src/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/testing/test-blueprint.ts +0 -58
- package/src/types/chat.ts +0 -32
- package/src/types/template.ts +0 -66
- package/src/types/types.ts +0 -48
|
@@ -4,19 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, expect, test } from 'vitest';
|
|
6
6
|
|
|
7
|
-
import { EdgeAiServiceClient } from '@dxos/ai';
|
|
8
|
-
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
9
7
|
import { log } from '@dxos/log';
|
|
10
8
|
|
|
11
9
|
import { createToolsFromApi, resolveAuthorization } from './openapi';
|
|
12
10
|
import { ChatProcessor } from '../hooks';
|
|
13
|
-
import type
|
|
11
|
+
import { type ApiAuthorization } from '../types';
|
|
14
12
|
|
|
15
13
|
describe.skip('openapi', () => {
|
|
16
14
|
describe.skip('mapping', () => {
|
|
17
15
|
test('amadeus flight availabilities', async () => {
|
|
18
16
|
const tools = await createToolsFromApi(FLIGHT_SEARCH_API);
|
|
19
|
-
|
|
20
17
|
log.info('tools', { tools });
|
|
21
18
|
// for (const tool of tools) {
|
|
22
19
|
// const schema = tool.parameters;
|
|
@@ -57,7 +54,7 @@ describe.skip('openapi', () => {
|
|
|
57
54
|
|
|
58
55
|
test('weather API', async () => {
|
|
59
56
|
const tools = await createToolsFromApi(WEATHER_API, { authorization: VISUAL_CROSSING_CREDENTIALS });
|
|
60
|
-
const forecastTool = tools.find((
|
|
57
|
+
const forecastTool = tools.find((tool) => tool.name.includes('forecast'));
|
|
61
58
|
const result = await forecastTool?.execute(
|
|
62
59
|
{
|
|
63
60
|
locations: 'Brooklyn, NY',
|
|
@@ -73,8 +70,9 @@ describe.skip('openapi', () => {
|
|
|
73
70
|
describe.skip('AI uses tools', () => {
|
|
74
71
|
test('amadeus flight availabilities', { timeout: 60_000 }, async () => {
|
|
75
72
|
const tools = await createToolsFromApi(FLIGHT_SEARCH_API, { authorization: AMADEUS_AUTH });
|
|
76
|
-
const aiClient = new
|
|
77
|
-
|
|
73
|
+
// const aiClient = new Edge AiServiceClient({ endpoint: AI_SERVICE_ENDPOINT.LOCAL });
|
|
74
|
+
// TODO(dmaretskyi): FIX ME.
|
|
75
|
+
const processor = new ChatProcessor(null as any, null as any, { tools });
|
|
78
76
|
const reply = await processor.request(
|
|
79
77
|
`What is the cheapest flight from New York to Paris? going on ${new Date().toISOString()} and returning after a week. 1 adult traveler`,
|
|
80
78
|
);
|
|
@@ -85,8 +83,9 @@ describe.skip('openapi', () => {
|
|
|
85
83
|
// TODO(dmaretskyi): Doesn't work.
|
|
86
84
|
test('amadeus hotel name autocomplete', { timeout: 60_000 }, async () => {
|
|
87
85
|
const tools = await createToolsFromApi(HOTEL_NAME_AUTOCOMPLETE_API, { authorization: AMADEUS_AUTH });
|
|
88
|
-
const aiClient = new
|
|
89
|
-
|
|
86
|
+
// const aiClient = new Edge AiServiceClient({ endpoint: AI_SERVICE_ENDPOINT.LOCAL });
|
|
87
|
+
// TODO(dmaretskyi): FIX ME.
|
|
88
|
+
const processor = new ChatProcessor(null as any, null as any, { tools });
|
|
90
89
|
const reply = await processor.request('Find me the William Wale in Brooklyn New York');
|
|
91
90
|
|
|
92
91
|
log.info('reply', { reply });
|
|
@@ -97,8 +96,9 @@ describe.skip('openapi', () => {
|
|
|
97
96
|
authorization: VISUAL_CROSSING_CREDENTIALS,
|
|
98
97
|
instructions: WEATHER_INSTRUCTIONS,
|
|
99
98
|
});
|
|
100
|
-
const aiClient = new
|
|
101
|
-
|
|
99
|
+
// const aiClient = new Edge AiServiceClient({ endpoint: AI_SERVICE_ENDPOINT.LOCAL });
|
|
100
|
+
// TODO(dmaretskyi): FIX ME.
|
|
101
|
+
const processor = new ChatProcessor(null as any, null as any, { tools });
|
|
102
102
|
const reply = await processor.request(
|
|
103
103
|
`Today's date is ${new Date().toISOString().split('T')[0]}. Give me weather forecast for Warsaw for next 5 days.`,
|
|
104
104
|
);
|
package/src/translations.ts
CHANGED
|
@@ -2,37 +2,55 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Blueprint } from '@dxos/
|
|
6
|
-
import {
|
|
5
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
6
|
+
import { Sequence } from '@dxos/conductor';
|
|
7
|
+
import { type Resource } from '@dxos/react-ui';
|
|
7
8
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
9
|
+
import { meta } from './meta';
|
|
10
|
+
import { Assistant } from './types';
|
|
10
11
|
|
|
11
|
-
export
|
|
12
|
+
export const translations = [
|
|
12
13
|
{
|
|
13
14
|
'en-US': {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'typename label_zero': 'Assistants',
|
|
17
|
-
'typename label_one': 'Assistant',
|
|
18
|
-
'typename label_other': 'Assistants',
|
|
19
|
-
'object name placeholder': 'New assistant',
|
|
20
|
-
},
|
|
21
|
-
[Type.getTypename(Blueprint)]: {
|
|
15
|
+
// TODO(burdon): From assistant.
|
|
16
|
+
[Blueprint.Blueprint.typename]: {
|
|
22
17
|
'typename label': 'Blueprint',
|
|
23
18
|
'typename label_zero': 'Blueprints',
|
|
24
19
|
'typename label_one': 'Blueprint',
|
|
25
20
|
'typename label_other': 'Blueprints',
|
|
26
21
|
'object name placeholder': 'New blueprint',
|
|
22
|
+
'rename object label': 'Rename blueprint',
|
|
23
|
+
'delete object label': 'Delete blueprint',
|
|
27
24
|
},
|
|
28
|
-
[
|
|
25
|
+
[Template.Template.typename]: {
|
|
29
26
|
'typename label': 'Template',
|
|
30
27
|
'typename label_zero': 'Templates',
|
|
31
28
|
'typename label_one': 'Template',
|
|
32
29
|
'typename label_other': 'Templates',
|
|
33
30
|
'object name placeholder': 'New template',
|
|
31
|
+
'rename object label': 'Rename template',
|
|
32
|
+
'delete object label': 'Delete template',
|
|
33
|
+
},
|
|
34
|
+
// TODO(burdon): From conductor.
|
|
35
|
+
[Sequence.typename]: {
|
|
36
|
+
'typename label': 'Sequence',
|
|
37
|
+
'typename label_zero': 'Sequences',
|
|
38
|
+
'typename label_one': 'Sequence',
|
|
39
|
+
'typename label_other': 'Sequences',
|
|
40
|
+
'object name placeholder': 'New sequence',
|
|
41
|
+
'rename object label': 'Rename sequence',
|
|
42
|
+
'delete object label': 'Delete sequence',
|
|
43
|
+
},
|
|
44
|
+
[Assistant.Chat.typename]: {
|
|
45
|
+
'typename label': 'Assistant',
|
|
46
|
+
'typename label_zero': 'Assistants',
|
|
47
|
+
'typename label_one': 'Assistant',
|
|
48
|
+
'typename label_other': 'Assistants',
|
|
49
|
+
'object name placeholder': 'New assistant',
|
|
50
|
+
'rename object label': 'Rename assistant',
|
|
51
|
+
'delete object label': 'Delete assistant',
|
|
34
52
|
},
|
|
35
|
-
[
|
|
53
|
+
[meta.id]: {
|
|
36
54
|
'templates label': 'Templates',
|
|
37
55
|
'open ambient chat label': 'Open Assistant',
|
|
38
56
|
'assistant chat label': 'Assistant',
|
|
@@ -50,21 +68,23 @@ export default [
|
|
|
50
68
|
'select preset template placeholder': 'Select preset',
|
|
51
69
|
'service registry label': 'Service Registry',
|
|
52
70
|
|
|
53
|
-
'
|
|
71
|
+
'sequence logs label': 'Logs',
|
|
54
72
|
|
|
55
73
|
'assistant dialog title': 'Assistant',
|
|
56
74
|
'open assistant label': 'Open assistant',
|
|
57
75
|
|
|
58
|
-
'
|
|
59
|
-
'chat input placeholder': 'Ask a question...',
|
|
60
|
-
'chat stop': 'Cancel request.',
|
|
76
|
+
'no tools': 'No tools are configured.',
|
|
61
77
|
|
|
62
78
|
'button save': 'Save',
|
|
63
79
|
'button run': 'Run',
|
|
64
80
|
|
|
65
|
-
'
|
|
66
|
-
'
|
|
67
|
-
'
|
|
81
|
+
'search placeholder': 'Search...',
|
|
82
|
+
'prompt placeholder': 'Ask or search for anything...',
|
|
83
|
+
'context objects placeholder': 'Add to context...',
|
|
84
|
+
'button add blueprint': 'Configure blueprints',
|
|
85
|
+
'button microphone': 'Click to speak',
|
|
86
|
+
'button cancel processing': 'Stop processing',
|
|
87
|
+
'button scroll down': 'Scroll down',
|
|
68
88
|
|
|
69
89
|
'settings default label': 'Default',
|
|
70
90
|
'settings custom prompts label': 'Use custom prompts',
|
|
@@ -74,4 +94,4 @@ export default [
|
|
|
74
94
|
},
|
|
75
95
|
},
|
|
76
96
|
},
|
|
77
|
-
];
|
|
97
|
+
] as const satisfies Resource[];
|
package/src/types/index.ts
CHANGED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { SpaceSchema, Queue } from '@dxos/client/echo';
|
|
8
|
+
import { Sequence } from '@dxos/conductor';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
10
|
+
import { LabelAnnotation } from '@dxos/echo-schema';
|
|
11
|
+
import { DataType } from '@dxos/schema';
|
|
12
|
+
|
|
13
|
+
import { meta } from '../meta';
|
|
14
|
+
|
|
15
|
+
export const LLM_PROVIDERS = ['edge', 'ollama', 'lmstudio'] as const;
|
|
16
|
+
|
|
17
|
+
export namespace Assistant {
|
|
18
|
+
//
|
|
19
|
+
// Types
|
|
20
|
+
//
|
|
21
|
+
|
|
22
|
+
export const Chat = Schema.Struct({
|
|
23
|
+
id: Type.ObjectId,
|
|
24
|
+
name: Schema.optional(Schema.String),
|
|
25
|
+
queue: Type.Ref(Queue),
|
|
26
|
+
}).pipe(
|
|
27
|
+
Type.Obj({
|
|
28
|
+
typename: 'dxos.org/type/assistant/Chat',
|
|
29
|
+
version: '0.2.0',
|
|
30
|
+
}),
|
|
31
|
+
LabelAnnotation.set(['name']),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export interface Chat extends Schema.Schema.Type<typeof Chat> {}
|
|
35
|
+
|
|
36
|
+
export const CompanionTo = Schema.Struct({
|
|
37
|
+
id: Type.ObjectId,
|
|
38
|
+
}).pipe(
|
|
39
|
+
Type.Relation({
|
|
40
|
+
typename: 'dxos.org/relation/assistant/CompanionTo',
|
|
41
|
+
version: '0.1.0',
|
|
42
|
+
source: Chat,
|
|
43
|
+
target: Type.Expando,
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export interface CompanionTo extends Schema.Schema.Type<typeof CompanionTo> {}
|
|
48
|
+
|
|
49
|
+
//
|
|
50
|
+
// Settings
|
|
51
|
+
//
|
|
52
|
+
|
|
53
|
+
export const Settings = Schema.mutable(
|
|
54
|
+
Schema.Struct({
|
|
55
|
+
llmProvider: Schema.optional(Schema.Literal(...LLM_PROVIDERS)),
|
|
56
|
+
edgeModel: Schema.optional(Schema.String),
|
|
57
|
+
ollamaModel: Schema.optional(Schema.String),
|
|
58
|
+
lmstudioModel: Schema.optional(Schema.String),
|
|
59
|
+
customPrompts: Schema.optional(Schema.Boolean),
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export type Settings = Schema.Schema.Type<typeof Settings>;
|
|
64
|
+
|
|
65
|
+
//
|
|
66
|
+
// Actions
|
|
67
|
+
//
|
|
68
|
+
|
|
69
|
+
export class OnSpaceCreated extends Schema.TaggedClass<OnSpaceCreated>()(`${meta.id}/on-space-created`, {
|
|
70
|
+
input: Schema.Struct({
|
|
71
|
+
space: SpaceSchema,
|
|
72
|
+
rootCollection: DataType.Collection,
|
|
73
|
+
}),
|
|
74
|
+
output: Schema.Void,
|
|
75
|
+
}) {}
|
|
76
|
+
|
|
77
|
+
export class CreateChat extends Schema.TaggedClass<CreateChat>()(`${meta.id}/action/create-chat`, {
|
|
78
|
+
input: Schema.Struct({
|
|
79
|
+
space: SpaceSchema,
|
|
80
|
+
name: Schema.optional(Schema.String),
|
|
81
|
+
}),
|
|
82
|
+
output: Schema.Struct({
|
|
83
|
+
object: Assistant.Chat,
|
|
84
|
+
}),
|
|
85
|
+
}) {}
|
|
86
|
+
|
|
87
|
+
export class CreateSequence extends Schema.TaggedClass<CreateSequence>()(`${meta.id}/action/create-sequence`, {
|
|
88
|
+
input: Schema.Struct({
|
|
89
|
+
name: Schema.optional(Schema.String),
|
|
90
|
+
}),
|
|
91
|
+
output: Schema.Struct({
|
|
92
|
+
object: Sequence,
|
|
93
|
+
}),
|
|
94
|
+
}) {}
|
|
95
|
+
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AmbientDialog
|
|
3
|
-
} from "./chunk-Q6UZ4F3H.mjs";
|
|
4
|
-
import {
|
|
5
|
-
ThreadContainer
|
|
6
|
-
} from "./chunk-JO4W3MF7.mjs";
|
|
7
|
-
import "./chunk-AAOKC2JN.mjs";
|
|
8
|
-
import "./chunk-MEGMOFJB.mjs";
|
|
9
|
-
import "./chunk-UE3IZ4PN.mjs";
|
|
10
|
-
import {
|
|
11
|
-
ASSISTANT_PLUGIN
|
|
12
|
-
} from "./chunk-XOZ7YMO3.mjs";
|
|
13
|
-
|
|
14
|
-
// packages/plugins/plugin-assistant/src/components/AssistantDialog.tsx
|
|
15
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
16
|
-
import React, { useState } from "react";
|
|
17
|
-
import { useCapability, Capabilities, useCapabilities } from "@dxos/app-framework";
|
|
18
|
-
import { TranscriptionCapabilities } from "@dxos/plugin-transcription";
|
|
19
|
-
import { useTranslation } from "@dxos/react-ui";
|
|
20
|
-
var AssistantDialog = ({ chat }) => {
|
|
21
|
-
var _effect = _useSignals();
|
|
22
|
-
try {
|
|
23
|
-
const { t } = useTranslation(ASSISTANT_PLUGIN);
|
|
24
|
-
const transcription = useCapabilities(TranscriptionCapabilities.Transcriber).length > 0;
|
|
25
|
-
const settings = useCapability(Capabilities.SettingsStore).getStore(ASSISTANT_PLUGIN)?.value;
|
|
26
|
-
const [open, setOpen] = useState(false);
|
|
27
|
-
return /* @__PURE__ */ React.createElement(AmbientDialog, {
|
|
28
|
-
open,
|
|
29
|
-
onOpenChange: setOpen,
|
|
30
|
-
title: t("assistant dialog title")
|
|
31
|
-
}, /* @__PURE__ */ React.createElement(ThreadContainer, {
|
|
32
|
-
part: "dialog",
|
|
33
|
-
chat,
|
|
34
|
-
onOpenChange: setOpen,
|
|
35
|
-
settings,
|
|
36
|
-
transcription
|
|
37
|
-
}));
|
|
38
|
-
} finally {
|
|
39
|
-
_effect.f();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var AssistantDialog_default = AssistantDialog;
|
|
43
|
-
export {
|
|
44
|
-
AssistantDialog,
|
|
45
|
-
AssistantDialog_default as default
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=AssistantDialog-MQOOR364.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/AssistantDialog.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type FC, useState } from 'react';\n\nimport { useCapability, Capabilities, useCapabilities } from '@dxos/app-framework';\nimport { TranscriptionCapabilities } from '@dxos/plugin-transcription';\nimport { useTranslation } from '@dxos/react-ui';\n\nimport { AmbientDialog } from './AmbientDialog';\nimport { ThreadContainer } from './Thread';\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps, type AIChatType } from '../types';\n\nexport const AssistantDialog: FC<{ chat?: AIChatType }> = ({ chat }) => {\n const { t } = useTranslation(ASSISTANT_PLUGIN);\n const transcription = useCapabilities(TranscriptionCapabilities.Transcriber).length > 0;\n const settings = useCapability(Capabilities.SettingsStore).getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;\n\n // TODO(burdon): Refocus when open.\n const [open, setOpen] = useState(false);\n\n return (\n <AmbientDialog open={open} onOpenChange={setOpen} title={t('assistant dialog title')}>\n <ThreadContainer\n part={'dialog'}\n chat={chat}\n onOpenChange={setOpen}\n settings={settings}\n transcription={transcription}\n />\n </AmbientDialog>\n );\n};\n\nexport default AssistantDialog;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAIA,OAAOA,SAAkBC,gBAAgB;AAEzC,SAASC,eAAeC,cAAcC,uBAAuB;AAC7D,SAASC,iCAAiC;AAC1C,SAASC,sBAAsB;AAOxB,IAAMC,kBAA6C,CAAC,EAAEC,KAAI,MAAE;;;AACjE,UAAM,EAAEC,EAAC,IAAKC,eAAeC,gBAAAA;AAC7B,UAAMC,gBAAgBC,gBAAgBC,0BAA0BC,WAAW,EAAEC,SAAS;AACtF,UAAMC,WAAWC,cAAcC,aAAaC,aAAa,EAAEC,SAAiCV,gBAAAA,GAAmBW;AAG/G,UAAM,CAACC,MAAMC,OAAAA,IAAWC,SAAS,KAAA;AAEjC,WACE,sBAAA,cAACC,eAAAA;MAAcH;MAAYI,cAAcH;MAASI,OAAOnB,EAAE,wBAAA;OACzD,sBAAA,cAACoB,iBAAAA;MACCC,MAAM;MACNtB;MACAmB,cAAcH;MACdP;MACAL;;;;;AAIR;AAEA,IAAA,0BAAeL;",
|
|
6
|
-
"names": ["React", "useState", "useCapability", "Capabilities", "useCapabilities", "TranscriptionCapabilities", "useTranslation", "AssistantDialog", "chat", "t", "useTranslation", "ASSISTANT_PLUGIN", "transcription", "useCapabilities", "TranscriptionCapabilities", "Transcriber", "length", "settings", "useCapability", "Capabilities", "SettingsStore", "getStore", "value", "open", "setOpen", "useState", "AmbientDialog", "onOpenChange", "title", "ThreadContainer", "part"]
|
|
7
|
-
}
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import "./chunk-MEGMOFJB.mjs";
|
|
2
|
-
import {
|
|
3
|
-
AssistantCapabilities
|
|
4
|
-
} from "./chunk-UE3IZ4PN.mjs";
|
|
5
|
-
import {
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-XOZ7YMO3.mjs";
|
|
8
|
-
|
|
9
|
-
// packages/plugins/plugin-assistant/src/components/BlueprintContainer.tsx
|
|
10
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
11
|
-
import JSON5 from "json5";
|
|
12
|
-
import React2, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
13
|
-
import { ToolRegistry } from "@dxos/ai";
|
|
14
|
-
import { useCapability } from "@dxos/app-framework";
|
|
15
|
-
import { BlueprintMachine, createLocalSearchTool, createExaTool, createGraphWriterTool } from "@dxos/assistant";
|
|
16
|
-
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
17
|
-
import { DXN as DXN2, Key as Key2 } from "@dxos/echo";
|
|
18
|
-
import { Toolbar, useTranslation } from "@dxos/react-ui";
|
|
19
|
-
import { getSelectionSet, useSelectionManager } from "@dxos/react-ui-attention";
|
|
20
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
21
|
-
|
|
22
|
-
// packages/plugins/plugin-assistant/src/components/BlueprintEditor/BlueprintEditor.tsx
|
|
23
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
24
|
-
import React, { forwardRef, useImperativeHandle } from "react";
|
|
25
|
-
import { BlueprintDefinition } from "@dxos/assistant";
|
|
26
|
-
import { Type } from "@dxos/echo";
|
|
27
|
-
import { useThemeContext } from "@dxos/react-ui";
|
|
28
|
-
import { createBasicExtensions, createJsonExtensions, createThemeExtensions, useTextEditor } from "@dxos/react-ui-editor";
|
|
29
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
30
|
-
var BlueprintEditor = /* @__PURE__ */ forwardRef(({ classNames, blueprint }, forwardedRef) => {
|
|
31
|
-
var _effect = _useSignals();
|
|
32
|
-
try {
|
|
33
|
-
const { themeMode } = useThemeContext();
|
|
34
|
-
const { parentRef, view } = useTextEditor({
|
|
35
|
-
initialValue: JSON.stringify(blueprint, null, 2),
|
|
36
|
-
extensions: [
|
|
37
|
-
createBasicExtensions({
|
|
38
|
-
lineNumbers: true,
|
|
39
|
-
lineWrapping: false,
|
|
40
|
-
monospace: true,
|
|
41
|
-
scrollPastEnd: true
|
|
42
|
-
}),
|
|
43
|
-
createThemeExtensions({
|
|
44
|
-
themeMode,
|
|
45
|
-
syntaxHighlighting: true
|
|
46
|
-
}),
|
|
47
|
-
createJsonExtensions({
|
|
48
|
-
schema: Type.toJsonSchema(BlueprintDefinition, {
|
|
49
|
-
strict: true
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
]
|
|
53
|
-
});
|
|
54
|
-
useImperativeHandle(forwardedRef, () => view, [
|
|
55
|
-
view
|
|
56
|
-
]);
|
|
57
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
58
|
-
ref: parentRef,
|
|
59
|
-
className: mx("overflow-hidden", classNames)
|
|
60
|
-
});
|
|
61
|
-
} finally {
|
|
62
|
-
_effect.f();
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// packages/plugins/plugin-assistant/src/queue-logger.ts
|
|
67
|
-
import { getSpace, Ref } from "@dxos/client/echo";
|
|
68
|
-
import { DXN, Key, Obj } from "@dxos/echo";
|
|
69
|
-
import { InvocationOutcome, InvocationTraceEndEvent, InvocationTraceEventType, InvocationTraceStartEvent, TraceEvent } from "@dxos/functions";
|
|
70
|
-
import { invariant } from "@dxos/invariant";
|
|
71
|
-
import { QueueSubspaceTags } from "@dxos/keys";
|
|
72
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/queue-logger.ts";
|
|
73
|
-
var QueueLogger = class {
|
|
74
|
-
constructor(blueprint) {
|
|
75
|
-
this.blueprint = blueprint;
|
|
76
|
-
const space = getSpace(blueprint);
|
|
77
|
-
invariant(space, "Space not found", {
|
|
78
|
-
F: __dxlog_file,
|
|
79
|
-
L: 25,
|
|
80
|
-
S: this,
|
|
81
|
-
A: [
|
|
82
|
-
"space",
|
|
83
|
-
"'Space not found'"
|
|
84
|
-
]
|
|
85
|
-
});
|
|
86
|
-
this._space = space;
|
|
87
|
-
let dxn = this._space.properties.invocationTraceQueue?.dxn;
|
|
88
|
-
if (!dxn) {
|
|
89
|
-
dxn = DXN.fromQueue(QueueSubspaceTags.TRACE, this._space.id, Key.ObjectId.random());
|
|
90
|
-
this._space.properties.invocationTraceQueue = Ref.fromDXN(dxn);
|
|
91
|
-
}
|
|
92
|
-
this._invocationTraceQueue = this._space.queues.get(dxn);
|
|
93
|
-
}
|
|
94
|
-
log(event) {
|
|
95
|
-
switch (event.type) {
|
|
96
|
-
case "begin":
|
|
97
|
-
void this._invocationTraceQueue.append([
|
|
98
|
-
Obj.make(InvocationTraceStartEvent, {
|
|
99
|
-
type: InvocationTraceEventType.START,
|
|
100
|
-
invocationId: event.invocationId,
|
|
101
|
-
timestampMs: Date.now(),
|
|
102
|
-
input: {},
|
|
103
|
-
invocationTraceQueue: Ref.fromDXN(this._getTraceQueueDxn(event.invocationId)),
|
|
104
|
-
invocationTarget: Ref.make(this.blueprint)
|
|
105
|
-
})
|
|
106
|
-
]);
|
|
107
|
-
break;
|
|
108
|
-
case "end":
|
|
109
|
-
void this._invocationTraceQueue.append([
|
|
110
|
-
Obj.make(InvocationTraceEndEvent, {
|
|
111
|
-
type: InvocationTraceEventType.END,
|
|
112
|
-
invocationId: event.invocationId,
|
|
113
|
-
timestampMs: Date.now(),
|
|
114
|
-
outcome: InvocationOutcome.SUCCESS
|
|
115
|
-
})
|
|
116
|
-
]);
|
|
117
|
-
break;
|
|
118
|
-
case "step-start":
|
|
119
|
-
case "step-complete":
|
|
120
|
-
void this._getTraceEventQueue(event.invocationId).append([
|
|
121
|
-
Obj.make(TraceEvent, {
|
|
122
|
-
outcome: event.type,
|
|
123
|
-
truncated: false,
|
|
124
|
-
ingestionTimestampMs: Date.now(),
|
|
125
|
-
logs: [
|
|
126
|
-
{
|
|
127
|
-
timestampMs: Date.now(),
|
|
128
|
-
level: "info",
|
|
129
|
-
message: event.type,
|
|
130
|
-
context: {
|
|
131
|
-
step: event.step
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
exceptions: []
|
|
136
|
-
})
|
|
137
|
-
]);
|
|
138
|
-
break;
|
|
139
|
-
case "message":
|
|
140
|
-
void this._getTraceEventQueue(event.invocationId).append([
|
|
141
|
-
Obj.make(TraceEvent, {
|
|
142
|
-
outcome: event.type,
|
|
143
|
-
truncated: false,
|
|
144
|
-
ingestionTimestampMs: Date.now(),
|
|
145
|
-
logs: [
|
|
146
|
-
{
|
|
147
|
-
timestampMs: Date.now(),
|
|
148
|
-
level: "info",
|
|
149
|
-
message: event.type,
|
|
150
|
-
context: {
|
|
151
|
-
message: event.message
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
],
|
|
155
|
-
exceptions: []
|
|
156
|
-
})
|
|
157
|
-
]);
|
|
158
|
-
break;
|
|
159
|
-
case "block":
|
|
160
|
-
void this._getTraceEventQueue(event.invocationId).append([
|
|
161
|
-
Obj.make(TraceEvent, {
|
|
162
|
-
outcome: event.type,
|
|
163
|
-
truncated: false,
|
|
164
|
-
ingestionTimestampMs: Date.now(),
|
|
165
|
-
logs: [
|
|
166
|
-
{
|
|
167
|
-
timestampMs: Date.now(),
|
|
168
|
-
level: "info",
|
|
169
|
-
message: event.type,
|
|
170
|
-
context: {
|
|
171
|
-
block: event.block
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
],
|
|
175
|
-
exceptions: []
|
|
176
|
-
})
|
|
177
|
-
]);
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
_getTraceQueueDxn(invocationId) {
|
|
182
|
-
return DXN.fromQueue(QueueSubspaceTags.TRACE, this._space.id, invocationId);
|
|
183
|
-
}
|
|
184
|
-
_getTraceEventQueue(invocationId) {
|
|
185
|
-
const dxn = this._getTraceQueueDxn(invocationId);
|
|
186
|
-
return this._space.queues.get(dxn);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
// packages/plugins/plugin-assistant/src/components/BlueprintContainer.tsx
|
|
191
|
-
var EXA_API_KEY = "9c7e17ff-0c85-4cd5-827a-8b489f139e03";
|
|
192
|
-
var parseBlueprint = (text) => {
|
|
193
|
-
try {
|
|
194
|
-
const json = JSON5.parse(text);
|
|
195
|
-
const { steps } = json;
|
|
196
|
-
return {
|
|
197
|
-
steps
|
|
198
|
-
};
|
|
199
|
-
} catch (error) {
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
var BlueprintContainer = ({ role, blueprint }) => {
|
|
203
|
-
var _effect = _useSignals2();
|
|
204
|
-
try {
|
|
205
|
-
const { t } = useTranslation(meta.id);
|
|
206
|
-
const aiClient = useCapability(AssistantCapabilities.AiClient);
|
|
207
|
-
const selectionManager = useSelectionManager();
|
|
208
|
-
const [definition, setDefinition] = useState();
|
|
209
|
-
useEffect(() => {
|
|
210
|
-
setDefinition({
|
|
211
|
-
steps: blueprint.steps.map(({ instructions, tools }) => ({
|
|
212
|
-
instructions,
|
|
213
|
-
tools
|
|
214
|
-
}))
|
|
215
|
-
});
|
|
216
|
-
}, [
|
|
217
|
-
blueprint
|
|
218
|
-
]);
|
|
219
|
-
const editorRef = useRef(void 0);
|
|
220
|
-
const toolRegistry = useMemo(() => {
|
|
221
|
-
const space = getSpace2(blueprint);
|
|
222
|
-
if (!space) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
const queue = space.queues.create();
|
|
226
|
-
return new ToolRegistry([
|
|
227
|
-
createExaTool({
|
|
228
|
-
apiKey: EXA_API_KEY
|
|
229
|
-
}),
|
|
230
|
-
createLocalSearchTool(space.db, queue),
|
|
231
|
-
createGraphWriterTool({
|
|
232
|
-
db: space.db,
|
|
233
|
-
queue,
|
|
234
|
-
schema: [],
|
|
235
|
-
onDone: async (objects) => {
|
|
236
|
-
await queue.append(objects);
|
|
237
|
-
}
|
|
238
|
-
})
|
|
239
|
-
]);
|
|
240
|
-
}, [
|
|
241
|
-
blueprint
|
|
242
|
-
]);
|
|
243
|
-
const formatAndSave = useCallback(() => {
|
|
244
|
-
if (!blueprint) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
const text = editorRef.current?.state.doc.toString();
|
|
248
|
-
if (!text) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
const definition2 = parseBlueprint(text);
|
|
252
|
-
if (!definition2) {
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
setDefinition(definition2);
|
|
256
|
-
const formatted = JSON.stringify(definition2, null, 2);
|
|
257
|
-
editorRef.current?.dispatch({
|
|
258
|
-
changes: {
|
|
259
|
-
from: 0,
|
|
260
|
-
to: text.length,
|
|
261
|
-
insert: formatted
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
blueprint.steps.length = 0;
|
|
265
|
-
for (const step of definition2.steps) {
|
|
266
|
-
blueprint.steps.push({
|
|
267
|
-
id: Key2.ObjectId.random(),
|
|
268
|
-
instructions: step.instructions,
|
|
269
|
-
tools: step.tools
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
return blueprint;
|
|
273
|
-
}, [
|
|
274
|
-
blueprint
|
|
275
|
-
]);
|
|
276
|
-
const handleSave = useCallback(() => formatAndSave(), [
|
|
277
|
-
formatAndSave
|
|
278
|
-
]);
|
|
279
|
-
const handleRun = useCallback(async () => {
|
|
280
|
-
if (!aiClient?.value || !toolRegistry) {
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
formatAndSave();
|
|
284
|
-
const input = Array.from(getSelectionSet(selectionManager)).map((id) => DXN2.fromLocalObjectId(id));
|
|
285
|
-
if (!input.length) {
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
const machine = new BlueprintMachine(toolRegistry, blueprint).setLogger(new QueueLogger(blueprint));
|
|
289
|
-
await machine.runToCompletion({
|
|
290
|
-
aiClient: aiClient.value,
|
|
291
|
-
input
|
|
292
|
-
});
|
|
293
|
-
}, [
|
|
294
|
-
aiClient.value,
|
|
295
|
-
blueprint,
|
|
296
|
-
formatAndSave,
|
|
297
|
-
selectionManager,
|
|
298
|
-
toolRegistry
|
|
299
|
-
]);
|
|
300
|
-
return /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
301
|
-
role,
|
|
302
|
-
toolbar: true
|
|
303
|
-
}, /* @__PURE__ */ React2.createElement(Toolbar.Root, null, /* @__PURE__ */ React2.createElement(Toolbar.Button, {
|
|
304
|
-
onClick: handleSave
|
|
305
|
-
}, t("button save")), /* @__PURE__ */ React2.createElement(Toolbar.Button, {
|
|
306
|
-
onClick: handleRun
|
|
307
|
-
}, t("button run"))), definition && /* @__PURE__ */ React2.createElement(BlueprintEditor, {
|
|
308
|
-
ref: editorRef,
|
|
309
|
-
blueprint: definition
|
|
310
|
-
}));
|
|
311
|
-
} finally {
|
|
312
|
-
_effect.f();
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
var BlueprintContainer_default = BlueprintContainer;
|
|
316
|
-
export {
|
|
317
|
-
BlueprintContainer,
|
|
318
|
-
EXA_API_KEY,
|
|
319
|
-
BlueprintContainer_default as default
|
|
320
|
-
};
|
|
321
|
-
//# sourceMappingURL=BlueprintContainer-AT5Y7EXG.mjs.map
|