@dxos/plugin-assistant 0.8.3-staging.0fa589b → 0.8.4-main.28f8d3d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{TemplateContainer-QQHVOTSI.mjs → BlueprintContainer-H7H4BQ2C.mjs} +11 -10
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-OUVSX5V5.mjs +76 -0
- package/dist/lib/browser/ChatContainer-OUVSX5V5.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-P4FLEOHG.mjs +86 -0
- package/dist/lib/browser/ChatDialog-P4FLEOHG.mjs.map +7 -0
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs +163 -0
- package/dist/lib/browser/SequenceContainer-627OQ557.mjs.map +7 -0
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs +22 -0
- package/dist/lib/browser/ai-service-7KJ5LXBT.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-E4H5DCOJ.mjs → app-graph-builder-AVHHQ3KV.mjs} +30 -89
- package/dist/lib/browser/app-graph-builder-AVHHQ3KV.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs +146 -0
- package/dist/lib/browser/blueprint-definition-CMGIZAOW.mjs.map +7 -0
- package/dist/lib/browser/chunk-BRLHDHOF.mjs +244 -0
- package/dist/lib/browser/chunk-BRLHDHOF.mjs.map +7 -0
- package/dist/lib/browser/chunk-HRLMD35M.mjs +191 -0
- package/dist/lib/browser/chunk-HRLMD35M.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XOZ7YMO3.mjs → chunk-LKP65RPA.mjs} +2 -2
- package/dist/lib/browser/{chunk-JQFUME3B.mjs → chunk-NZDCKQ6W.mjs} +36 -34
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs.map +7 -0
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs +16 -0
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs.map +7 -0
- package/dist/lib/browser/chunk-VEBVAHNM.mjs +2231 -0
- package/dist/lib/browser/chunk-VEBVAHNM.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs +24 -0
- package/dist/lib/browser/edge-model-resolver-2HB4PCWH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +141 -128
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-MVOIEJXZ.mjs +81 -0
- package/dist/lib/browser/intent-resolver-MVOIEJXZ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-LXCNUSZN.mjs → react-surface-4HXS3YLT.mjs} +66 -62
- package/dist/lib/browser/react-surface-4HXS3YLT.mjs.map +7 -0
- package/dist/lib/browser/{settings-XRHXVWGB.mjs → settings-G2EZXMWT.mjs} +7 -6
- package/dist/lib/browser/settings-G2EZXMWT.mjs.map +7 -0
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs +105 -0
- package/dist/lib/browser/toolkit-IW4FBLLB.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -20
- package/dist/lib/node-esm/{TemplateContainer-SOEWY2ZN.mjs → BlueprintContainer-VH4EE4CM.mjs} +11 -10
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-D5FABDNE.mjs +77 -0
- package/dist/lib/node-esm/ChatContainer-D5FABDNE.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-NKWVXHJP.mjs +87 -0
- package/dist/lib/node-esm/ChatDialog-NKWVXHJP.mjs.map +7 -0
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs +164 -0
- package/dist/lib/node-esm/SequenceContainer-EQ5NP2PG.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-LDD32477.mjs +23 -0
- package/dist/lib/node-esm/ai-service-LDD32477.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-3SY5MBIK.mjs → app-graph-builder-RMOUJMMG.mjs} +30 -89
- package/dist/lib/node-esm/app-graph-builder-RMOUJMMG.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs +147 -0
- package/dist/lib/node-esm/blueprint-definition-AEWYMW6I.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3SOC5GOP.mjs +2232 -0
- package/dist/lib/node-esm/chunk-3SOC5GOP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-F7RXCX5Y.mjs +192 -0
- package/dist/lib/node-esm/chunk-F7RXCX5Y.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OYN6HLXZ.mjs → chunk-GAWXJ7K5.mjs} +36 -34
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BB2TAT4P.mjs → chunk-KOC6ESG7.mjs} +2 -2
- package/dist/lib/node-esm/chunk-RD755HN3.mjs +245 -0
- package/dist/lib/node-esm/chunk-RD755HN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs +17 -0
- package/dist/lib/node-esm/chunk-X6AANUHZ.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs +25 -0
- package/dist/lib/node-esm/edge-model-resolver-UDDR2IA6.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +141 -128
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-DTDNCX3C.mjs +82 -0
- package/dist/lib/node-esm/intent-resolver-DTDNCX3C.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-7HA5EDWY.mjs → react-surface-V6JNEZVO.mjs} +66 -62
- package/dist/lib/node-esm/react-surface-V6JNEZVO.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-5IAY6BT4.mjs → settings-AIP5FOJG.mjs} +7 -6
- package/dist/lib/node-esm/settings-AIP5FOJG.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs +106 -0
- package/dist/lib/node-esm/toolkit-2VNUL77B.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -20
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +8 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -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/capabilities/toolkit.d.ts +5 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +2 -2
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +5 -6
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +45 -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 +8 -7
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts +8 -0
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +13 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +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 +18 -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 +226 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/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/TemplateEditor/TemplateEditor.d.ts +4 -3
- 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 +5 -4
- 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/Timeline/Timeline.d.ts +24 -0
- package/dist/types/src/components/Timeline/Timeline.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts +9 -0
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/index.d.ts +2 -0
- package/dist/types/src/components/Timeline/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +10 -6
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +2 -3
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +7 -12
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/functions/analysis.d.ts +5 -0
- package/dist/types/src/functions/analysis.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/list.d.ts +10 -0
- package/dist/types/src/functions/list.d.ts.map +1 -0
- package/dist/types/src/functions/load.d.ts +8 -0
- package/dist/types/src/functions/load.d.ts.map +1 -0
- package/dist/types/src/hooks/chat-processor.d.ts +72 -0
- package/dist/types/src/hooks/chat-processor.d.ts.map +1 -0
- package/dist/types/src/hooks/errors.d.ts +4 -0
- package/dist/types/src/hooks/errors.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +9 -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/useBlueprintRegistry.d.ts +21 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +16 -11
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +13 -0
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts +7 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -0
- package/dist/types/src/hooks/useResolveRef.d.ts +4 -0
- package/dist/types/src/hooks/useResolveRef.d.ts.map +1 -0
- package/dist/types/src/parser/filter-generator.d.ts.map +1 -1
- 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/parser/query-parser.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 +268 -0
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +5 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +5 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts +6 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts +5 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/SurfaceContainer.d.ts +8 -0
- package/dist/types/src/stories/components/SurfaceContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +5 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +8 -0
- package/dist/types/src/stories/components/index.d.ts.map +1 -0
- package/dist/types/src/stories/components/types.d.ts +7 -0
- package/dist/types/src/stories/components/types.d.ts.map +1 -0
- package/dist/types/src/stories/hooks/index.d.ts +3 -0
- package/dist/types/src/stories/hooks/index.d.ts.map +1 -0
- package/dist/types/src/stories/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/stories/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts +3 -0
- package/dist/types/src/stories/hooks/useMatcherExtension.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +142 -0
- package/dist/types/src/stories/testing/data.d.ts.map +1 -0
- package/dist/types/src/stories/testing/index.d.ts +3 -0
- package/dist/types/src/stories/testing/index.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +26 -0
- package/dist/types/src/stories/testing/testing.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-functions.d.ts +5 -2
- package/dist/types/src/testing/test-functions.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/tools/function.d.ts.map +1 -1
- package/dist/types/src/tools/openapi.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +73 -113
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/{chat.d.ts → Assistant.d.ts} +20 -3
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +90 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +12 -12
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +86 -74
- package/src/AssistantPlugin.tsx +63 -43
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +28 -107
- package/src/capabilities/blueprint-definition.ts +32 -0
- package/src/capabilities/capabilities.ts +12 -5
- package/src/capabilities/edge-model-resolver.ts +29 -0
- package/src/capabilities/index.ts +6 -3
- package/src/capabilities/intent-resolver.ts +40 -12
- package/src/capabilities/react-surface.tsx +54 -46
- package/src/capabilities/settings.ts +3 -3
- package/src/capabilities/toolkit.ts +106 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +4 -4
- package/src/components/BlueprintContainer.tsx +9 -133
- package/src/components/Chat/Chat.tsx +401 -0
- package/src/components/Chat/events.ts +50 -0
- package/src/components/Chat/index.ts +7 -0
- package/src/components/ChatContainer.tsx +51 -21
- package/src/components/ChatDialog.tsx +68 -0
- package/src/components/ChatPrompt/ChatActions.tsx +71 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +59 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +28 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +55 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +39 -0
- package/src/components/ChatPrompt/index.ts +9 -0
- package/src/components/ChatThread/ChatMessage.tsx +282 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +260 -0
- package/src/components/ChatThread/ChatThread.tsx +57 -0
- package/src/components/ChatThread/Link.tsx +39 -0
- package/src/components/ChatThread/ToolBlock.tsx +125 -0
- package/src/components/{AmbientDialog → ChatThread}/index.ts +1 -1
- package/src/components/{Thread → ChatThread}/reducer.ts +14 -14
- package/src/components/PromptSettings.tsx +43 -45
- package/src/components/SequenceContainer.tsx +133 -0
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +33 -0
- package/src/components/{BlueprintEditor/BlueprintEditor.tsx → SequenceEditor/SequenceEditor.tsx} +8 -8
- package/src/components/SequenceEditor/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +38 -36
- package/src/components/TemplateEditor/TemplateEditor.tsx +41 -25
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +24 -17
- package/src/components/TemplateEditor/TemplateForm.tsx +51 -57
- package/src/components/Timeline/Timeline.stories.tsx +53 -0
- package/src/components/Timeline/Timeline.tsx +159 -0
- package/src/{experimental/transcription → components/Timeline}/index.ts +2 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +9 -16
- package/src/components/Toolbox/Toolbox.tsx +49 -17
- package/src/components/index.ts +4 -8
- package/src/events.ts +3 -3
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +42 -0
- package/src/functions/load.ts +43 -0
- package/src/hooks/chat-processor.ts +260 -0
- package/src/hooks/errors.ts +8 -0
- package/src/hooks/index.ts +9 -5
- package/src/hooks/presets.ts +53 -0
- package/src/hooks/useBlueprintRegistry.ts +79 -0
- package/src/hooks/useChatProcessor.ts +81 -0
- package/src/hooks/useChatServices.ts +72 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +45 -0
- package/src/hooks/{useContextProvider.ts → useReferencesProvider.ts} +22 -20
- package/src/hooks/useResolveRef.ts +33 -0
- package/src/parser/filter-generator.ts +6 -13
- package/src/parser/index.ts +1 -1
- package/src/parser/query-parser.ts +1 -1
- package/src/queue-logger.ts +11 -11
- package/src/stories/Chat.stories.tsx +317 -0
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +80 -0
- package/src/stories/components/GraphContainer.tsx +118 -0
- package/src/stories/components/LoggingContainer.tsx +22 -0
- package/src/stories/components/SurfaceContainer.tsx +62 -0
- package/src/stories/components/TasksContainer.tsx +51 -0
- package/src/stories/components/index.ts +12 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/hooks/index.ts +6 -0
- package/src/stories/hooks/useFlush.ts +35 -0
- package/src/stories/hooks/useMatcherExtension.ts +45 -0
- package/src/stories/{test-data.ts → testing/data.ts} +10 -8
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/testing.tsx +162 -0
- package/src/testing/index.ts +1 -1
- package/src/testing/test-functions.ts +9 -4
- package/src/testing/test-sequence.ts +51 -0
- package/src/tools/function.ts +4 -1
- package/src/tools/openapi.test.ts +14 -12
- package/src/tools/openapi.ts +4 -1
- package/src/translations.ts +46 -28
- package/src/types/Assistant.ts +59 -0
- package/src/types/AssistantAction.ts +54 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -3
- 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 +0 -157
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-JO4W3MF7.mjs +0 -2101
- package/dist/lib/browser/chunk-JO4W3MF7.mjs.map +0 -7
- package/dist/lib/browser/chunk-JQFUME3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-MEGMOFJB.mjs +0 -16
- package/dist/lib/browser/chunk-MEGMOFJB.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs +0 -96
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs.map +0 -7
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs +0 -15
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs +0 -43
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LXCNUSZN.mjs.map +0 -7
- package/dist/lib/browser/settings-XRHXVWGB.mjs.map +0 -7
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs +0 -73
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs.map +0 -7
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs +0 -344
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs +0 -68
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs.map +0 -7
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs +0 -58
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs.map +0 -7
- package/dist/lib/node/ai-client-7HNSMUMT.cjs +0 -53
- package/dist/lib/node/ai-client-7HNSMUMT.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs +0 -235
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs.map +0 -7
- package/dist/lib/node/chunk-4EEWTDQK.cjs +0 -117
- package/dist/lib/node/chunk-4EEWTDQK.cjs.map +0 -7
- package/dist/lib/node/chunk-FUAGEO7Q.cjs +0 -52
- package/dist/lib/node/chunk-FUAGEO7Q.cjs.map +0 -7
- package/dist/lib/node/chunk-HRNIUYVQ.cjs +0 -128
- package/dist/lib/node/chunk-HRNIUYVQ.cjs.map +0 -7
- package/dist/lib/node/chunk-IKZBMHSW.cjs +0 -184
- package/dist/lib/node/chunk-IKZBMHSW.cjs.map +0 -7
- package/dist/lib/node/chunk-LMDJEGZ2.cjs +0 -233
- package/dist/lib/node/chunk-LMDJEGZ2.cjs.map +0 -7
- package/dist/lib/node/chunk-NIDICM57.cjs +0 -2080
- package/dist/lib/node/chunk-NIDICM57.cjs.map +0 -7
- package/dist/lib/node/chunk-P74TWGMG.cjs +0 -44
- package/dist/lib/node/chunk-P74TWGMG.cjs.map +0 -7
- package/dist/lib/node/chunk-QGPWY6GW.cjs +0 -34
- package/dist/lib/node/chunk-QGPWY6GW.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -289
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs +0 -58
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs +0 -172
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs.map +0 -7
- package/dist/lib/node/settings-2JXLKYGE.cjs +0 -36
- package/dist/lib/node/settings-2JXLKYGE.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -54
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs +0 -48
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs +0 -322
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs +0 -41
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-SOEWY2ZN.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs +0 -40
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-3SY5MBIK.mjs.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-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 +0 -158
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs +0 -44
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7HA5EDWY.mjs.map +0 -7
- package/dist/lib/node-esm/settings-5IAY6BT4.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-client.d.ts +0 -5
- package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +0 -10
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +0 -8
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/index.d.ts +0 -2
- package/dist/types/src/components/AmbientDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/AssistantDialog.d.ts +0 -7
- package/dist/types/src/components/AssistantDialog.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts +0 -13
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts +0 -8
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/index.d.ts +0 -2
- package/dist/types/src/components/BlueprintEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +0 -23
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +0 -13
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts +0 -16
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts +0 -9
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/autocomplete.d.ts +0 -25
- package/dist/types/src/components/Prompt/autocomplete.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/index.d.ts +0 -3
- package/dist/types/src/components/Prompt/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/references.d.ts +0 -30
- package/dist/types/src/components/Prompt/references.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -8
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.d.ts +0 -28
- package/dist/types/src/components/Thread/Thread.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.stories.d.ts +0 -11
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +0 -13
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +0 -13
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +0 -1
- package/dist/types/src/components/Thread/index.d.ts +0 -3
- package/dist/types/src/components/Thread/index.d.ts.map +0 -1
- package/dist/types/src/components/Thread/reducer.d.ts.map +0 -1
- package/dist/types/src/experimental/transcription/index.d.ts +0 -1
- package/dist/types/src/experimental/transcription/index.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.d.ts +0 -72
- package/dist/types/src/hooks/processor.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.test.d.ts +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.map +0 -1
- package/dist/types/src/types/template.d.ts +0 -56
- package/dist/types/src/types/template.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -50
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/ai-client.ts +0 -42
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +0 -84
- package/src/components/AmbientDialog/AmbientDialog.tsx +0 -117
- package/src/components/AssistantDialog.tsx +0 -37
- package/src/components/BlueprintEditor/BlueprintEditor.stories.tsx +0 -32
- package/src/components/BlueprintEditor/index.ts +0 -5
- package/src/components/Prompt/Prompt.stories.tsx +0 -121
- package/src/components/Prompt/Prompt.tsx +0 -124
- package/src/components/Prompt/PromptBar.stories.tsx +0 -69
- package/src/components/Prompt/PromptBar.tsx +0 -105
- package/src/components/Prompt/autocomplete.ts +0 -218
- package/src/components/Prompt/index.ts +0 -6
- package/src/components/Prompt/references.ts +0 -180
- package/src/components/TemplateContainer.tsx +0 -23
- package/src/components/Thread/Thread.stories.tsx +0 -201
- package/src/components/Thread/Thread.tsx +0 -118
- package/src/components/Thread/ThreadContainer.stories.tsx +0 -283
- package/src/components/Thread/ThreadContainer.tsx +0 -105
- package/src/components/Thread/ThreadMessage.tsx +0 -234
- package/src/components/Thread/ToolInvocations.tsx +0 -106
- package/src/components/Thread/index.ts +0 -6
- package/src/hooks/processor.test.ts +0 -15
- package/src/hooks/processor.ts +0 -238
- package/src/hooks/useChatProcessor.tsx +0 -97
- package/src/hooks/useMessageQueue.ts +0 -22
- package/src/hooks/useServices.ts +0 -28
- package/src/hooks/useTextInputEvents.ts +0 -49
- package/src/stories/Prompt.stories.tsx +0 -60
- package/src/stories/Query.stories.tsx +0 -514
- package/src/stories/Research.stories.tsx +0 -482
- package/src/stories/testing.ts +0 -60
- package/src/testing/test-blueprint.ts +0 -58
- package/src/types/chat.ts +0 -32
- package/src/types/template.ts +0 -66
- package/src/types/types.ts +0 -48
- /package/dist/lib/browser/{chunk-XOZ7YMO3.mjs.map → chunk-LKP65RPA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-BB2TAT4P.mjs.map → chunk-KOC6ESG7.mjs.map} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ChatPromptProps } from '../components';
|
|
8
|
+
|
|
9
|
+
import { type AiServicePreset, AiServicePresets } from './presets';
|
|
10
|
+
|
|
11
|
+
export type UsePresets = {
|
|
12
|
+
preset: AiServicePreset | undefined;
|
|
13
|
+
} & Pick<ChatPromptProps, 'presets' | 'onChangePreset'>;
|
|
14
|
+
|
|
15
|
+
export const usePresets = (online: boolean): UsePresets => {
|
|
16
|
+
// TODO(burdon): Memo preset for provider.
|
|
17
|
+
const [preset, setPreset] = useState<AiServicePreset>();
|
|
18
|
+
const presets = useMemo(
|
|
19
|
+
() => AiServicePresets.filter((preset) => online === (preset.provider === 'dxos-remote')),
|
|
20
|
+
[online],
|
|
21
|
+
);
|
|
22
|
+
const presetOptions = useMemo(
|
|
23
|
+
() => presets.map(({ id, model, label }) => ({ id, label: label ?? model })),
|
|
24
|
+
[presets],
|
|
25
|
+
);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
setPreset(presets[0]);
|
|
28
|
+
}, [presets]);
|
|
29
|
+
|
|
30
|
+
const handleChangePreset = useCallback<NonNullable<ChatPromptProps['onChangePreset']>>(
|
|
31
|
+
(id) => {
|
|
32
|
+
const preset = presets.find((preset) => preset.id === id);
|
|
33
|
+
if (preset) {
|
|
34
|
+
setPreset(preset);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
[presets],
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
preset: preset,
|
|
42
|
+
presets: presetOptions,
|
|
43
|
+
onChangePreset: handleChangePreset,
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -6,29 +6,29 @@ import { useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
8
8
|
import { type Space } from '@dxos/client/echo';
|
|
9
|
-
import { Filter, Obj
|
|
9
|
+
import { Filter, Obj } from '@dxos/echo';
|
|
10
|
+
import { type ReferencesProvider } from '@dxos/react-ui-chat';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const stringMatch = (query: string, label: string) => label.toLowerCase().startsWith(query.toLowerCase());
|
|
17
|
-
|
|
18
|
-
export const useContextProvider = (space?: Space): ContextProvider | undefined => {
|
|
19
|
-
const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
|
|
12
|
+
/**
|
|
13
|
+
* Resolve references to objects in the space.
|
|
14
|
+
*/
|
|
15
|
+
export const useReferencesProvider = (space?: Space): ReferencesProvider | undefined => {
|
|
16
|
+
const blueprints = useCapabilities(Capabilities.BlueprintDefinition);
|
|
20
17
|
|
|
21
|
-
return useMemo<
|
|
18
|
+
return useMemo<ReferencesProvider | undefined>((): ReferencesProvider | undefined => {
|
|
22
19
|
if (!space) {
|
|
23
20
|
return undefined;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
return {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
getReferences: async ({ query }) => {
|
|
25
|
+
// TODO(burdon): Previously we filtered by types declared by the artifact definitions.
|
|
26
|
+
// const schemas = blueprints.map((blueprint) => blueprint.schema).flat();
|
|
27
|
+
// const { objects } = await space.db
|
|
28
|
+
// .query(Filter.or(...schemas.map((schema) => Filter.type(schema as Type.Schema))))
|
|
29
|
+
// .run();
|
|
30
|
+
|
|
31
|
+
const { objects } = await space.db.query(Filter.everything()).run();
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
objects
|
|
@@ -41,15 +41,17 @@ export const useContextProvider = (space?: Space): ContextProvider | undefined =
|
|
|
41
41
|
// TODO(dmaretskyi): `Type.getDXN` (at the point of writing) didn't work here as it was schema-only.
|
|
42
42
|
.filter((object) => !!Obj.getDXN(object as Obj.Any))
|
|
43
43
|
.map((object) => ({
|
|
44
|
-
uri: Obj.getDXN(object as any)
|
|
44
|
+
uri: Obj.getDXN(object as any).toString(),
|
|
45
45
|
label: Obj.getLabel(object as any) ?? '',
|
|
46
46
|
}))
|
|
47
47
|
);
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
resolveReference: async ({ uri }) => {
|
|
50
50
|
const object = await space.db.query(Filter.ids(uri)).first();
|
|
51
51
|
return { uri, label: Obj.getLabel(object) ?? '' };
|
|
52
52
|
},
|
|
53
|
-
};
|
|
54
|
-
}, [space,
|
|
53
|
+
} satisfies ReferencesProvider;
|
|
54
|
+
}, [space, blueprints]);
|
|
55
55
|
};
|
|
56
|
+
|
|
57
|
+
const stringMatch = (query: string, label: string) => label.toLowerCase().startsWith(query.toLowerCase());
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useMemo, useSyncExternalStore } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Space } from '@dxos/client/echo';
|
|
8
|
+
import { type Ref } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
// TODO(burdon): Factor out.
|
|
11
|
+
export const useResolvedRef = <T>(space: Space, ref: Ref.Ref<T>): T | undefined => {
|
|
12
|
+
const { subscribe, getSnapshot } = useMemo(() => {
|
|
13
|
+
const resolver = space.db.graph.createRefResolver({});
|
|
14
|
+
let currentCallback: (() => void) | undefined = undefined;
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
subscribe: (cb: () => void) => {
|
|
18
|
+
currentCallback = cb;
|
|
19
|
+
return () => {
|
|
20
|
+
if (currentCallback === cb) {
|
|
21
|
+
currentCallback = undefined;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
getSnapshot: () =>
|
|
26
|
+
resolver?.resolveSync(ref.dxn, true, () => {
|
|
27
|
+
currentCallback?.();
|
|
28
|
+
}) as T | undefined,
|
|
29
|
+
};
|
|
30
|
+
}, [space, ref.dxn.toString()]);
|
|
31
|
+
|
|
32
|
+
return useSyncExternalStore<T | undefined>(subscribe, getSnapshot);
|
|
33
|
+
};
|
|
@@ -4,14 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Filter } from '@dxos/echo';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
type BinaryExpression,
|
|
9
|
-
type Expression,
|
|
10
|
-
type Identifier,
|
|
11
|
-
type Literal,
|
|
12
|
-
type RelationalOperator,
|
|
13
|
-
type UnaryExpression,
|
|
14
|
-
} from './types';
|
|
7
|
+
import { type Expression, type Identifier, type Literal, type RelationalOperator } from './types';
|
|
15
8
|
|
|
16
9
|
const relationalOperators: Record<RelationalOperator, (value: any) => Filter<any>> = {
|
|
17
10
|
EQ: Filter.eq,
|
|
@@ -26,7 +19,7 @@ const specialPredicates: Record<string, (value: string) => Filter<any>> = {
|
|
|
26
19
|
export const createFilter = (ast: Expression): Filter<any> => {
|
|
27
20
|
switch (ast.type) {
|
|
28
21
|
case 'binary': {
|
|
29
|
-
const { operator, left, right } = ast
|
|
22
|
+
const { operator, left, right } = ast;
|
|
30
23
|
|
|
31
24
|
// Handle logical operators.
|
|
32
25
|
if (operator === 'AND') {
|
|
@@ -44,7 +37,7 @@ export const createFilter = (ast: Expression): Filter<any> => {
|
|
|
44
37
|
}
|
|
45
38
|
|
|
46
39
|
// Handle relational operators
|
|
47
|
-
const filterFn = relationalOperators[operator
|
|
40
|
+
const filterFn = relationalOperators[operator];
|
|
48
41
|
if (filterFn) {
|
|
49
42
|
return filterFn((right as Literal).value);
|
|
50
43
|
}
|
|
@@ -53,7 +46,7 @@ export const createFilter = (ast: Expression): Filter<any> => {
|
|
|
53
46
|
}
|
|
54
47
|
|
|
55
48
|
case 'unary': {
|
|
56
|
-
const { operator, argument } = ast
|
|
49
|
+
const { operator, argument } = ast;
|
|
57
50
|
if (operator === 'NOT') {
|
|
58
51
|
return Filter.not(createFilter(argument));
|
|
59
52
|
}
|
|
@@ -61,12 +54,12 @@ export const createFilter = (ast: Expression): Filter<any> => {
|
|
|
61
54
|
}
|
|
62
55
|
|
|
63
56
|
case 'identifier': {
|
|
64
|
-
const { name } = ast
|
|
57
|
+
const { name } = ast;
|
|
65
58
|
return Filter._props({ [name]: true });
|
|
66
59
|
}
|
|
67
60
|
|
|
68
61
|
case 'literal': {
|
|
69
|
-
const { value } = ast
|
|
62
|
+
const { value } = ast;
|
|
70
63
|
// Handle special '*' value for empty input.
|
|
71
64
|
if (value === '*') {
|
|
72
65
|
return Filter.everything();
|
package/src/parser/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { invariant } from '@dxos/invariant';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type BinaryOperator, type Expression, type RelationalOperator } from './types';
|
|
8
8
|
|
|
9
9
|
// TODO(burdon): Move to echo-schema?
|
|
10
10
|
|
package/src/queue-logger.ts
CHANGED
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
6
|
-
import {
|
|
5
|
+
import { type Queue, Ref, type Space, getSpace } from '@dxos/client/echo';
|
|
6
|
+
import { type Sequence, type SequenceEvent, type SequenceLogger } from '@dxos/conductor';
|
|
7
7
|
import { DXN, Key, Obj } from '@dxos/echo';
|
|
8
8
|
import {
|
|
9
9
|
InvocationOutcome,
|
|
10
10
|
InvocationTraceEndEvent,
|
|
11
|
+
type InvocationTraceEvent,
|
|
11
12
|
InvocationTraceEventType,
|
|
12
13
|
InvocationTraceStartEvent,
|
|
13
14
|
TraceEvent,
|
|
14
|
-
type InvocationTraceEvent,
|
|
15
15
|
} from '@dxos/functions';
|
|
16
16
|
import { invariant } from '@dxos/invariant';
|
|
17
17
|
import { QueueSubspaceTags } from '@dxos/keys';
|
|
18
18
|
|
|
19
|
-
export class QueueLogger implements
|
|
19
|
+
export class QueueLogger implements SequenceLogger {
|
|
20
20
|
private _space: Space;
|
|
21
21
|
private _invocationTraceQueue: Queue<InvocationTraceEvent>;
|
|
22
22
|
|
|
23
|
-
constructor(private readonly
|
|
24
|
-
const space = getSpace(
|
|
23
|
+
constructor(private readonly sequence: Sequence) {
|
|
24
|
+
const space = getSpace(sequence);
|
|
25
25
|
invariant(space, 'Space not found');
|
|
26
26
|
this._space = space;
|
|
27
27
|
let dxn = this._space.properties.invocationTraceQueue?.dxn;
|
|
@@ -32,7 +32,7 @@ export class QueueLogger implements BlueprintLogger {
|
|
|
32
32
|
this._invocationTraceQueue = this._space.queues.get(dxn);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
log(event:
|
|
35
|
+
log(event: SequenceEvent) {
|
|
36
36
|
switch (event.type) {
|
|
37
37
|
case 'begin':
|
|
38
38
|
void this._invocationTraceQueue.append([
|
|
@@ -42,7 +42,7 @@ export class QueueLogger implements BlueprintLogger {
|
|
|
42
42
|
timestampMs: Date.now(),
|
|
43
43
|
input: {},
|
|
44
44
|
invocationTraceQueue: Ref.fromDXN(this._getTraceQueueDxn(event.invocationId)),
|
|
45
|
-
invocationTarget: Ref.make(this.
|
|
45
|
+
invocationTarget: Ref.make(this.sequence),
|
|
46
46
|
}),
|
|
47
47
|
]);
|
|
48
48
|
break;
|
|
@@ -62,7 +62,7 @@ export class QueueLogger implements BlueprintLogger {
|
|
|
62
62
|
Obj.make(TraceEvent, {
|
|
63
63
|
outcome: event.type,
|
|
64
64
|
truncated: false,
|
|
65
|
-
|
|
65
|
+
ingestionTimestamp: Date.now(),
|
|
66
66
|
logs: [
|
|
67
67
|
{
|
|
68
68
|
timestampMs: Date.now(),
|
|
@@ -80,7 +80,7 @@ export class QueueLogger implements BlueprintLogger {
|
|
|
80
80
|
Obj.make(TraceEvent, {
|
|
81
81
|
outcome: event.type,
|
|
82
82
|
truncated: false,
|
|
83
|
-
|
|
83
|
+
ingestionTimestamp: Date.now(),
|
|
84
84
|
logs: [
|
|
85
85
|
{
|
|
86
86
|
timestampMs: Date.now(),
|
|
@@ -98,7 +98,7 @@ export class QueueLogger implements BlueprintLogger {
|
|
|
98
98
|
Obj.make(TraceEvent, {
|
|
99
99
|
outcome: event.type,
|
|
100
100
|
truncated: false,
|
|
101
|
-
|
|
101
|
+
ingestionTimestamp: Date.now(),
|
|
102
102
|
logs: [
|
|
103
103
|
{
|
|
104
104
|
timestampMs: Date.now(),
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
import React, { type FC, useCallback } from 'react';
|
|
9
|
+
|
|
10
|
+
import { EXA_API_KEY } from '@dxos/ai/testing';
|
|
11
|
+
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
12
|
+
import { RESEARCH_BLUEPRINT, ResearchDataTypes, ResearchGraph } from '@dxos/assistant-testing';
|
|
13
|
+
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
14
|
+
import { log } from '@dxos/log';
|
|
15
|
+
import { Board, BoardPlugin } from '@dxos/plugin-board';
|
|
16
|
+
import { Chess, ChessPlugin } from '@dxos/plugin-chess';
|
|
17
|
+
import { InboxPlugin } from '@dxos/plugin-inbox';
|
|
18
|
+
import { Map, MapPlugin } from '@dxos/plugin-map';
|
|
19
|
+
import { MarkdownPlugin } from '@dxos/plugin-markdown';
|
|
20
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
21
|
+
import { TablePlugin } from '@dxos/plugin-table';
|
|
22
|
+
import { useClient } from '@dxos/react-client';
|
|
23
|
+
import { useSpace } from '@dxos/react-client/echo';
|
|
24
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
25
|
+
import { DataType } from '@dxos/schema';
|
|
26
|
+
import { render } from '@dxos/storybook-utils';
|
|
27
|
+
import { trim } from '@dxos/util';
|
|
28
|
+
|
|
29
|
+
import { translations } from '../translations';
|
|
30
|
+
import { Assistant } from '../types';
|
|
31
|
+
|
|
32
|
+
import {
|
|
33
|
+
BlueprintContainer,
|
|
34
|
+
ChatContainer,
|
|
35
|
+
type ComponentProps,
|
|
36
|
+
GraphContainer,
|
|
37
|
+
LoggingContainer,
|
|
38
|
+
SurfaceContainer,
|
|
39
|
+
TasksContainer,
|
|
40
|
+
} from './components';
|
|
41
|
+
import { addTestData, config, getDecorators, testTypes } from './testing';
|
|
42
|
+
|
|
43
|
+
const DefaultStory = ({
|
|
44
|
+
debug = true,
|
|
45
|
+
components,
|
|
46
|
+
blueprints = [],
|
|
47
|
+
}: {
|
|
48
|
+
debug?: boolean;
|
|
49
|
+
components: (FC<ComponentProps> | FC<ComponentProps>[])[];
|
|
50
|
+
blueprints?: string[];
|
|
51
|
+
}) => {
|
|
52
|
+
const client = useClient();
|
|
53
|
+
const space = useSpace();
|
|
54
|
+
|
|
55
|
+
const blueprintsDefinitions = useCapabilities(Capabilities.BlueprintDefinition);
|
|
56
|
+
useAsyncEffect(async () => {
|
|
57
|
+
if (!space) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const { objects: chats = [] } = await space.db.query(Filter.type(Assistant.Chat)).run();
|
|
61
|
+
const chat = chats[0];
|
|
62
|
+
if (!chat) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// TODO(burdon): Active should be ephemeral state of AiProcessor; write on edit/prompt.
|
|
67
|
+
|
|
68
|
+
// TODO(burdon): RACE CONDITION; must handle concurrently adding multiple blueprints instances with same key.
|
|
69
|
+
// Add blueprints to context.
|
|
70
|
+
// const binder = new AiContextBinder(await chat.queue.load());
|
|
71
|
+
// for (const key of blueprints) {
|
|
72
|
+
// const blueprint = blueprintsDefinitions.find((blueprint) => blueprint.key === key);
|
|
73
|
+
// if (blueprint) {
|
|
74
|
+
// const obj = space.db.add(Obj.clone(blueprint));
|
|
75
|
+
// await binder.bind({ blueprints: [Ref.make(obj)] });
|
|
76
|
+
// }
|
|
77
|
+
// }
|
|
78
|
+
}, [space, blueprints, blueprintsDefinitions]);
|
|
79
|
+
|
|
80
|
+
const handleEvent = useCallback<NonNullable<ComponentProps['onEvent']>>((event) => {
|
|
81
|
+
log.info('event', { event });
|
|
82
|
+
switch (event) {
|
|
83
|
+
case 'reset': {
|
|
84
|
+
void client?.reset().then(() => {
|
|
85
|
+
document.location.reload();
|
|
86
|
+
});
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, []);
|
|
91
|
+
|
|
92
|
+
if (!space) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<div
|
|
98
|
+
className='grid grid-cols gap-2 m-2'
|
|
99
|
+
style={{ gridTemplateColumns: `repeat(${components.length}, minmax(0, 40rem))` }}
|
|
100
|
+
>
|
|
101
|
+
{components.map((Component, index) =>
|
|
102
|
+
Array.isArray(Component) ? (
|
|
103
|
+
<div
|
|
104
|
+
key={index}
|
|
105
|
+
className='grid grid-rows gap-2 overflow-hidden'
|
|
106
|
+
style={{ gridTemplateRows: `repeat(${Component.length}, 1fr)` }}
|
|
107
|
+
>
|
|
108
|
+
{Component.map((Component, index) => (
|
|
109
|
+
<div key={index} className='flex flex-col overflow-hidden bg-baseSurface rounded border border-separator'>
|
|
110
|
+
<Component space={space} debug={debug} onEvent={handleEvent} />
|
|
111
|
+
</div>
|
|
112
|
+
))}
|
|
113
|
+
</div>
|
|
114
|
+
) : (
|
|
115
|
+
<div key={index} className='flex flex-col overflow-hidden bg-baseSurface rounded border border-separator'>
|
|
116
|
+
<Component space={space} debug={debug} onEvent={handleEvent} />
|
|
117
|
+
</div>
|
|
118
|
+
),
|
|
119
|
+
)}
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const storybook = {
|
|
125
|
+
title: 'plugins/plugin-assistant/Chat',
|
|
126
|
+
render: render(DefaultStory),
|
|
127
|
+
parameters: {
|
|
128
|
+
translations,
|
|
129
|
+
controls: { disable: true },
|
|
130
|
+
},
|
|
131
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
132
|
+
|
|
133
|
+
export default storybook;
|
|
134
|
+
|
|
135
|
+
type Story = StoryObj<typeof storybook>;
|
|
136
|
+
|
|
137
|
+
//
|
|
138
|
+
// Stories
|
|
139
|
+
//
|
|
140
|
+
|
|
141
|
+
export const Default = {
|
|
142
|
+
decorators: getDecorators({
|
|
143
|
+
config: config.remote,
|
|
144
|
+
}),
|
|
145
|
+
args: {
|
|
146
|
+
components: [ChatContainer],
|
|
147
|
+
},
|
|
148
|
+
} satisfies Story;
|
|
149
|
+
|
|
150
|
+
export const WithDocument = {
|
|
151
|
+
decorators: getDecorators({
|
|
152
|
+
plugins: [MarkdownPlugin()],
|
|
153
|
+
config: config.remote,
|
|
154
|
+
onInit: async ({ space, binder }) => {
|
|
155
|
+
const object = space.db.add(
|
|
156
|
+
Markdown.makeDocument({
|
|
157
|
+
name: 'Document',
|
|
158
|
+
content: trim`
|
|
159
|
+
# Hello, world!
|
|
160
|
+
This is a test.
|
|
161
|
+
`,
|
|
162
|
+
}),
|
|
163
|
+
);
|
|
164
|
+
await binder.bind({ objects: [Ref.make(object)] });
|
|
165
|
+
},
|
|
166
|
+
}),
|
|
167
|
+
args: {
|
|
168
|
+
components: [ChatContainer, SurfaceContainer],
|
|
169
|
+
},
|
|
170
|
+
} satisfies Story;
|
|
171
|
+
|
|
172
|
+
export const WithBlueprints = {
|
|
173
|
+
decorators: getDecorators({
|
|
174
|
+
plugins: [InboxPlugin(), MarkdownPlugin(), TablePlugin()],
|
|
175
|
+
config: config.remote,
|
|
176
|
+
onInit: async ({ space, binder }) => {
|
|
177
|
+
const object = space.db.add(Markdown.makeDocument({ name: 'Tasks' }));
|
|
178
|
+
await binder.bind({ objects: [Ref.make(object)] });
|
|
179
|
+
},
|
|
180
|
+
}),
|
|
181
|
+
args: {
|
|
182
|
+
components: [ChatContainer, [TasksContainer, BlueprintContainer]],
|
|
183
|
+
},
|
|
184
|
+
} satisfies Story;
|
|
185
|
+
|
|
186
|
+
export const WithChess = {
|
|
187
|
+
decorators: getDecorators({
|
|
188
|
+
plugins: [ChessPlugin()],
|
|
189
|
+
config: config.remote,
|
|
190
|
+
types: [Chess.Game],
|
|
191
|
+
onInit: async ({ space, binder }) => {
|
|
192
|
+
// TODO(burdon): Add player DID (for user and assistant).
|
|
193
|
+
const object = space.db.add(
|
|
194
|
+
Chess.makeGame({
|
|
195
|
+
name: 'Challenge',
|
|
196
|
+
pgn: '1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 d5 8. exd5 Nxd5 9. O-O Be6 10. Qb3 Na5 11. Qa4+ c6 12. Bxd5 Bxc3 13. Bxe6 fxe6 *',
|
|
197
|
+
}),
|
|
198
|
+
);
|
|
199
|
+
await binder.bind({ objects: [Ref.make(object)] });
|
|
200
|
+
},
|
|
201
|
+
}),
|
|
202
|
+
args: {
|
|
203
|
+
components: [ChatContainer, SurfaceContainer],
|
|
204
|
+
blueprints: ['dxos.org/blueprint/assistant', 'dxos.org/blueprint/chess'],
|
|
205
|
+
},
|
|
206
|
+
} satisfies Story;
|
|
207
|
+
|
|
208
|
+
export const WithMap = {
|
|
209
|
+
decorators: getDecorators({
|
|
210
|
+
plugins: [MapPlugin()],
|
|
211
|
+
config: config.remote,
|
|
212
|
+
types: [Map.Map],
|
|
213
|
+
onInit: async ({ space, binder }) => {
|
|
214
|
+
const object = space.db.add(Map.makeMap());
|
|
215
|
+
await binder.bind({ objects: [Ref.make(object)] });
|
|
216
|
+
},
|
|
217
|
+
}),
|
|
218
|
+
args: {
|
|
219
|
+
components: [ChatContainer, SurfaceContainer],
|
|
220
|
+
},
|
|
221
|
+
} satisfies Story;
|
|
222
|
+
|
|
223
|
+
export const WithTrip = {
|
|
224
|
+
decorators: getDecorators({
|
|
225
|
+
plugins: [MarkdownPlugin(), MapPlugin()],
|
|
226
|
+
config: config.remote,
|
|
227
|
+
types: [Map.Map],
|
|
228
|
+
onInit: async ({ space, binder }) => {
|
|
229
|
+
// TODO(burdon): Table.
|
|
230
|
+
{
|
|
231
|
+
const object = space.db.add(Map.makeMap({ name: 'Trip' }));
|
|
232
|
+
await binder.bind({ objects: [Ref.make(object)] });
|
|
233
|
+
}
|
|
234
|
+
{
|
|
235
|
+
const object = space.db.add(
|
|
236
|
+
Markdown.makeDocument({
|
|
237
|
+
name: 'Itinerary',
|
|
238
|
+
content: trim`
|
|
239
|
+
# Itinerary
|
|
240
|
+
|
|
241
|
+
## Day 1
|
|
242
|
+
- Visit the Sagrada Familia
|
|
243
|
+
- Visit the Park Güell
|
|
244
|
+
- Visit the Casa Batlló
|
|
245
|
+
|
|
246
|
+
## Day 2
|
|
247
|
+
- Visit the Eiffel Tower
|
|
248
|
+
- Visit the Louvre
|
|
249
|
+
- Visit the Musée d'Orsay
|
|
250
|
+
`,
|
|
251
|
+
}),
|
|
252
|
+
);
|
|
253
|
+
await binder.bind({ objects: [Ref.make(object)] });
|
|
254
|
+
}
|
|
255
|
+
{
|
|
256
|
+
const object = space.db.add(
|
|
257
|
+
Markdown.makeDocument({
|
|
258
|
+
name: 'Barcelona',
|
|
259
|
+
content: trim`
|
|
260
|
+
# Barcelona
|
|
261
|
+
|
|
262
|
+
Barcelona is the capital and most populous city of Catalonia, an autonomous community in northeastern Spain.
|
|
263
|
+
It is located on the Mediterranean coast, on the banks of the Llobregat River, in the comarca of the Baix Llobregat.
|
|
264
|
+
The city is known for its rich history, vibrant culture, and stunning architecture, including the Sagrada Familia, Park Güell, and Casa Batlló.
|
|
265
|
+
`,
|
|
266
|
+
}),
|
|
267
|
+
);
|
|
268
|
+
await binder.bind({ objects: [Ref.make(object)] });
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
}),
|
|
272
|
+
args: {
|
|
273
|
+
components: [ChatContainer, SurfaceContainer],
|
|
274
|
+
},
|
|
275
|
+
} satisfies Story;
|
|
276
|
+
|
|
277
|
+
export const WithBoard = {
|
|
278
|
+
decorators: getDecorators({
|
|
279
|
+
plugins: [BoardPlugin()],
|
|
280
|
+
config: config.remote,
|
|
281
|
+
types: [Board.Board],
|
|
282
|
+
onInit: async ({ space, binder }) => {
|
|
283
|
+
const object = space.db.add(Board.makeBoard());
|
|
284
|
+
await binder.bind({ objects: [Ref.make(object)] });
|
|
285
|
+
},
|
|
286
|
+
}),
|
|
287
|
+
args: {
|
|
288
|
+
debug: true,
|
|
289
|
+
components: [ChatContainer, SurfaceContainer],
|
|
290
|
+
},
|
|
291
|
+
} satisfies Story;
|
|
292
|
+
|
|
293
|
+
export const WithResearch = {
|
|
294
|
+
decorators: getDecorators({
|
|
295
|
+
plugins: [MarkdownPlugin(), TablePlugin()],
|
|
296
|
+
config: config.persistent,
|
|
297
|
+
types: [...ResearchDataTypes, ResearchGraph, DataType.AccessToken],
|
|
298
|
+
accessTokens: [Obj.make(DataType.AccessToken, { source: 'exa.ai', token: EXA_API_KEY })],
|
|
299
|
+
}),
|
|
300
|
+
args: {
|
|
301
|
+
components: [ChatContainer, [GraphContainer, BlueprintContainer, LoggingContainer]],
|
|
302
|
+
blueprints: [RESEARCH_BLUEPRINT.key],
|
|
303
|
+
},
|
|
304
|
+
} satisfies Story;
|
|
305
|
+
|
|
306
|
+
export const WithSearch = {
|
|
307
|
+
decorators: getDecorators({
|
|
308
|
+
config: config.remote,
|
|
309
|
+
types: testTypes,
|
|
310
|
+
onInit: async ({ space }) => {
|
|
311
|
+
await addTestData(space);
|
|
312
|
+
},
|
|
313
|
+
}),
|
|
314
|
+
args: {
|
|
315
|
+
components: [ChatContainer, [GraphContainer]],
|
|
316
|
+
},
|
|
317
|
+
} satisfies Story;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
10
|
+
import { Filter, Obj } from '@dxos/echo';
|
|
11
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { Toolbar } from '@dxos/react-ui';
|
|
13
|
+
|
|
14
|
+
import { TemplateEditor } from '../../components';
|
|
15
|
+
|
|
16
|
+
import { type ComponentProps } from './types';
|
|
17
|
+
|
|
18
|
+
export const BlueprintContainer = ({ space }: ComponentProps) => {
|
|
19
|
+
const [blueprint] = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
20
|
+
if (!blueprint?.instructions) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className='flex flex-col h-full'>
|
|
26
|
+
<Toolbar.Root classNames='density-coarse border-b border-subduedSeparator'>
|
|
27
|
+
<h2>{Obj.getLabel(blueprint)}</h2>
|
|
28
|
+
<div className='flex-1' />
|
|
29
|
+
<Toolbar.IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' />
|
|
30
|
+
</Toolbar.Root>
|
|
31
|
+
<TemplateEditor id={blueprint.id} template={blueprint.instructions} />
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|