@dxos/plugin-assistant 0.8.4-main.f9ba587 → 0.8.4-main.fd6878d
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-6ZGGH5T4.mjs → BlueprintContainer-H7H4BQ2C.mjs} +10 -9
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-6XNB5NEI.mjs → ChatContainer-OUVSX5V5.mjs} +36 -17
- package/dist/lib/browser/ChatContainer-OUVSX5V5.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-IMWPRXTO.mjs → ChatDialog-P4FLEOHG.mjs} +22 -10
- 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-UJ5NHRGK.mjs → app-graph-builder-AVHHQ3KV.mjs} +16 -73
- 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-44HZKIAW.mjs → chunk-NZDCKQ6W.mjs} +32 -30
- package/dist/lib/browser/chunk-NZDCKQ6W.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NTBGTFTV.mjs → chunk-QB7OVS6Z.mjs} +3 -2
- package/dist/lib/browser/chunk-QB7OVS6Z.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TQ3QW3HJ.mjs → chunk-VEBVAHNM.mjs} +1041 -882
- 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 +116 -88
- 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-TMF7JJA4.mjs → react-surface-4HXS3YLT.mjs} +52 -45
- package/dist/lib/browser/react-surface-4HXS3YLT.mjs.map +7 -0
- package/dist/lib/browser/{settings-N4HEXADL.mjs → settings-G2EZXMWT.mjs} +5 -4
- package/dist/lib/{node-esm/settings-WQ76EG6O.mjs.map → browser/settings-G2EZXMWT.mjs.map} +1 -1
- 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 +6 -13
- package/dist/lib/node-esm/{TemplateContainer-6KRNEMVE.mjs → BlueprintContainer-VH4EE4CM.mjs} +10 -9
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-VOLG7J6N.mjs → ChatContainer-D5FABDNE.mjs} +36 -17
- package/dist/lib/node-esm/ChatContainer-D5FABDNE.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-B2XNUNRM.mjs → ChatDialog-NKWVXHJP.mjs} +22 -10
- 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-MEQ5CYNI.mjs → app-graph-builder-RMOUJMMG.mjs} +16 -73
- 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-D3HTVK5D.mjs → chunk-3SOC5GOP.mjs} +1041 -882
- 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-VESVUAOS.mjs → chunk-GAWXJ7K5.mjs} +32 -30
- 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-RD755HN3.mjs +245 -0
- package/dist/lib/node-esm/chunk-RD755HN3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-E6V2RUQ2.mjs → chunk-X6AANUHZ.mjs} +3 -2
- 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 +116 -88
- 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-6XL6SWL2.mjs → react-surface-V6JNEZVO.mjs} +52 -45
- package/dist/lib/node-esm/react-surface-V6JNEZVO.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-WQ76EG6O.mjs → settings-AIP5FOJG.mjs} +5 -4
- package/dist/lib/{browser/settings-N4HEXADL.mjs.map → node-esm/settings-AIP5FOJG.mjs.map} +1 -1
- 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 +6 -13
- 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.map +1 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +8 -0
- package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +16 -13
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- 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 +1 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +5 -4
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +6 -5
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- 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 +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +2 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +2 -2
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +10 -10
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +6 -12
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +54 -60
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +4 -3
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +4 -4
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +1 -1
- 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 +1 -2
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
- 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 +2 -2
- 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.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 +6 -9
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -2
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -3
- 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 +34 -44
- package/dist/types/src/hooks/chat-processor.d.ts.map +1 -1
- 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 +8 -4
- 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 +9 -18
- 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/stories/Chat.stories.d.ts +87 -18
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -1
- 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/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.map +1 -1
- 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 +25 -13
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +40 -0
- 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 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +6 -6
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +83 -73
- package/src/AssistantPlugin.tsx +61 -41
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +9 -92
- package/src/capabilities/blueprint-definition.ts +32 -0
- package/src/capabilities/capabilities.ts +11 -3
- package/src/capabilities/edge-model-resolver.ts +29 -0
- package/src/capabilities/index.ts +6 -3
- package/src/capabilities/intent-resolver.ts +39 -11
- package/src/capabilities/react-surface.tsx +35 -27
- package/src/capabilities/toolkit.ts +106 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +1 -1
- package/src/components/BlueprintContainer.tsx +24 -0
- package/src/components/Chat/Chat.tsx +148 -95
- package/src/components/Chat/events.ts +50 -0
- package/src/components/Chat/index.ts +2 -0
- package/src/components/ChatContainer.tsx +39 -15
- package/src/components/ChatDialog.tsx +10 -7
- package/src/components/ChatPrompt/ChatActions.tsx +15 -20
- package/src/components/ChatPrompt/ChatOptions.tsx +59 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +28 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +11 -8
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +17 -4
- package/src/components/ChatPrompt/index.ts +2 -3
- package/src/components/ChatThread/ChatMessage.tsx +192 -148
- package/src/components/ChatThread/ChatThread.stories.tsx +221 -109
- package/src/components/ChatThread/ChatThread.tsx +12 -23
- package/src/components/ChatThread/Link.tsx +39 -0
- package/src/components/ChatThread/ToolBlock.tsx +41 -27
- package/src/components/ChatThread/reducer.ts +14 -14
- package/src/components/PromptSettings.tsx +41 -43
- package/src/components/SequenceContainer.tsx +32 -38
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +3 -2
- package/src/components/SequenceEditor/SequenceEditor.tsx +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +37 -35
- package/src/components/TemplateEditor/TemplateEditor.tsx +39 -23
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +23 -16
- package/src/components/TemplateEditor/TemplateForm.tsx +50 -55
- package/src/components/Timeline/Timeline.stories.tsx +53 -0
- package/src/components/Timeline/Timeline.tsx +159 -0
- package/src/components/Timeline/index.ts +5 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +7 -13
- package/src/components/Toolbox/Toolbox.tsx +21 -42
- package/src/components/index.ts +2 -5
- package/src/events.ts +2 -2
- 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 +167 -188
- package/src/hooks/errors.ts +8 -0
- package/src/hooks/index.ts +8 -4
- 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} +18 -22
- 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 +5 -5
- package/src/stories/Chat.stories.tsx +246 -198
- 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/testing/data.ts +130 -0
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/testing.tsx +162 -0
- package/src/testing/test-functions.ts +9 -4
- package/src/testing/test-sequence.ts +18 -20
- package/src/tools/function.ts +4 -1
- package/src/tools/openapi.test.ts +10 -8
- package/src/tools/openapi.ts +4 -1
- package/src/translations.ts +29 -13
- 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 -2
- package/dist/lib/browser/ChatContainer-6XNB5NEI.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-IMWPRXTO.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-6XOYB2RN.mjs +0 -322
- package/dist/lib/browser/SequenceContainer-6XOYB2RN.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-6ZGGH5T4.mjs.map +0 -7
- package/dist/lib/browser/ai-client-ML7OQWAO.mjs +0 -39
- package/dist/lib/browser/ai-client-ML7OQWAO.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-UJ5NHRGK.mjs.map +0 -7
- package/dist/lib/browser/chunk-44HZKIAW.mjs.map +0 -7
- package/dist/lib/browser/chunk-NTBGTFTV.mjs.map +0 -7
- package/dist/lib/browser/chunk-OZL4OHTU.mjs +0 -157
- package/dist/lib/browser/chunk-OZL4OHTU.mjs.map +0 -7
- package/dist/lib/browser/chunk-TQ3QW3HJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-TU7UUGWQ.mjs +0 -203
- package/dist/lib/browser/chunk-TU7UUGWQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-WPZ4UANI.mjs +0 -16
- package/dist/lib/browser/chunk-WPZ4UANI.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-LEAPB55Q.mjs +0 -42
- package/dist/lib/browser/intent-resolver-LEAPB55Q.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TMF7JJA4.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-VOLG7J6N.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-B2XNUNRM.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-WWG6IMN3.mjs +0 -323
- package/dist/lib/node-esm/SequenceContainer-WWG6IMN3.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-6KRNEMVE.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-2FQ434CT.mjs +0 -40
- package/dist/lib/node-esm/ai-client-2FQ434CT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-MEQ5CYNI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D3HTVK5D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E6V2RUQ2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HVMVHP4R.mjs +0 -158
- package/dist/lib/node-esm/chunk-HVMVHP4R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HXKRKIN2.mjs +0 -18
- package/dist/lib/node-esm/chunk-HXKRKIN2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VESVUAOS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YYUVTTVK.mjs +0 -204
- package/dist/lib/node-esm/chunk-YYUVTTVK.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-4ULF3F7U.mjs +0 -43
- package/dist/lib/node-esm/intent-resolver-4ULF3F7U.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-6XL6SWL2.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/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatPrompt/events.d.ts +0 -17
- package/dist/types/src/components/ChatPrompt/events.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -9
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -4
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/hooks/useContextProvider.d.ts +0 -23
- package/dist/types/src/hooks/useContextProvider.d.ts.map +0 -1
- package/dist/types/src/hooks/useServiceContainer.d.ts +0 -8
- package/dist/types/src/hooks/useServiceContainer.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/types/schema.d.ts +0 -71
- package/dist/types/src/types/schema.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/src/capabilities/ai-client.ts +0 -39
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatPrompt/events.ts +0 -12
- package/src/components/TemplateContainer.tsx +0 -25
- package/src/hooks/chat-processor.test.ts +0 -15
- package/src/hooks/useBlueprints.ts +0 -31
- package/src/hooks/useChatProcessor.tsx +0 -142
- package/src/hooks/useServiceContainer.ts +0 -42
- package/src/hooks/useTextInputEvents.ts +0 -49
- package/src/types/schema.ts +0 -86
- package/src/types/template.ts +0 -66
|
@@ -4,266 +4,314 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
8
|
-
import React, {
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
import React, { type FC, useCallback } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
DESIGN_SPEC_BLUEPRINT,
|
|
14
|
-
TASK_LIST_BLUEPRINT,
|
|
15
|
-
remoteServiceEndpoints,
|
|
16
|
-
readDocument,
|
|
17
|
-
writeDocument,
|
|
18
|
-
} from '@dxos/artifact-testing';
|
|
19
|
-
import { Blueprint, BlueprintRegistry, ContextBinder } from '@dxos/assistant';
|
|
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';
|
|
20
13
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
21
14
|
import { log } from '@dxos/log';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
15
|
+
import { Board, BoardPlugin } from '@dxos/plugin-board';
|
|
16
|
+
import { Chess, ChessPlugin } from '@dxos/plugin-chess';
|
|
24
17
|
import { InboxPlugin } from '@dxos/plugin-inbox';
|
|
25
|
-
import { MapPlugin } from '@dxos/plugin-map';
|
|
18
|
+
import { Map, MapPlugin } from '@dxos/plugin-map';
|
|
26
19
|
import { MarkdownPlugin } from '@dxos/plugin-markdown';
|
|
27
|
-
import {
|
|
28
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
20
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
29
21
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import { useThemeContext } from '@dxos/react-ui';
|
|
34
|
-
import {
|
|
35
|
-
Editor,
|
|
36
|
-
createBasicExtensions,
|
|
37
|
-
createDataExtensions,
|
|
38
|
-
createMarkdownExtensions,
|
|
39
|
-
createThemeExtensions,
|
|
40
|
-
outliner,
|
|
41
|
-
} from '@dxos/react-ui-editor';
|
|
42
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
22
|
+
import { useClient } from '@dxos/react-client';
|
|
23
|
+
import { useSpace } from '@dxos/react-client/echo';
|
|
24
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
43
25
|
import { DataType } from '@dxos/schema';
|
|
44
|
-
import { render
|
|
26
|
+
import { render } from '@dxos/storybook-utils';
|
|
27
|
+
import { trim } from '@dxos/util';
|
|
45
28
|
|
|
46
|
-
import { AssistantPlugin } from '../AssistantPlugin';
|
|
47
|
-
import { Chat } from '../components';
|
|
48
|
-
import { useChatProcessor, useServiceContainer } from '../hooks';
|
|
49
29
|
import { translations } from '../translations';
|
|
50
30
|
import { Assistant } from '../types';
|
|
51
31
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{components.map((Component, index) => (
|
|
63
|
-
<Component key={index} />
|
|
64
|
-
))}
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
//
|
|
70
|
-
// Components
|
|
71
|
-
//
|
|
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';
|
|
72
42
|
|
|
73
|
-
const
|
|
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();
|
|
74
53
|
const space = useSpace();
|
|
75
|
-
const [chat] = useQuery(space, Filter.type(Assistant.Chat));
|
|
76
54
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
+
}
|
|
81
65
|
|
|
82
|
-
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
66
|
+
// TODO(burdon): Active should be ephemeral state of AiProcessor; write on edit/prompt.
|
|
85
67
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
);
|
|
97
|
-
};
|
|
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]);
|
|
98
79
|
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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) {
|
|
104
93
|
return null;
|
|
105
94
|
}
|
|
106
95
|
|
|
107
96
|
return (
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
121
|
);
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
// Configuration
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
const meta = {
|
|
124
|
+
const storybook = {
|
|
129
125
|
title: 'plugins/plugin-assistant/Chat',
|
|
130
126
|
render: render(DefaultStory),
|
|
131
|
-
decorators: [],
|
|
132
127
|
parameters: {
|
|
133
128
|
translations,
|
|
134
129
|
controls: { disable: true },
|
|
135
130
|
},
|
|
136
131
|
} satisfies Meta<typeof DefaultStory>;
|
|
137
132
|
|
|
138
|
-
export default
|
|
133
|
+
export default storybook;
|
|
139
134
|
|
|
140
|
-
type Story = StoryObj<typeof
|
|
135
|
+
type Story = StoryObj<typeof storybook>;
|
|
141
136
|
|
|
142
137
|
//
|
|
143
|
-
//
|
|
138
|
+
// Stories
|
|
144
139
|
//
|
|
145
140
|
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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)] });
|
|
156
165
|
},
|
|
166
|
+
}),
|
|
167
|
+
args: {
|
|
168
|
+
components: [ChatContainer, SurfaceContainer],
|
|
157
169
|
},
|
|
158
|
-
}
|
|
170
|
+
} satisfies Story;
|
|
159
171
|
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
config,
|
|
174
|
-
types: [Assistant.Chat, DocumentType, Blueprint],
|
|
175
|
-
onClientInitialized: async (_, client) => {
|
|
176
|
-
await client.halo.createIdentity();
|
|
177
|
-
await client.spaces.waitUntilReady();
|
|
178
|
-
const space = client.spaces.default;
|
|
179
|
-
// ISSUE(burdon): Should not require this.
|
|
180
|
-
// ERROR: invariant violation: Database was not initialized with root object.
|
|
181
|
-
await space.waitUntilReady();
|
|
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;
|
|
182
185
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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;
|
|
189
207
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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;
|
|
197
222
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
|
209
240
|
|
|
210
|
-
|
|
241
|
+
## Day 1
|
|
242
|
+
- Visit the Sagrada Familia
|
|
243
|
+
- Visit the Park Güell
|
|
244
|
+
- Visit the Casa Batlló
|
|
211
245
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
|
215
261
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
+
},
|
|
224
271
|
}),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
//
|
|
272
|
+
args: {
|
|
273
|
+
components: [ChatContainer, SurfaceContainer],
|
|
274
|
+
},
|
|
275
|
+
} satisfies Story;
|
|
230
276
|
|
|
231
|
-
export const
|
|
277
|
+
export const WithBoard = {
|
|
232
278
|
decorators: getDecorators({
|
|
233
|
-
|
|
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
|
+
},
|
|
234
286
|
}),
|
|
235
287
|
args: {
|
|
236
|
-
|
|
288
|
+
debug: true,
|
|
289
|
+
components: [ChatContainer, SurfaceContainer],
|
|
237
290
|
},
|
|
238
291
|
} satisfies Story;
|
|
239
292
|
|
|
240
|
-
export const
|
|
293
|
+
export const WithResearch = {
|
|
241
294
|
decorators: getDecorators({
|
|
242
|
-
|
|
243
|
-
|
|
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 })],
|
|
244
299
|
}),
|
|
245
300
|
args: {
|
|
246
|
-
components: [ChatContainer,
|
|
301
|
+
components: [ChatContainer, [GraphContainer, BlueprintContainer, LoggingContainer]],
|
|
302
|
+
blueprints: [RESEARCH_BLUEPRINT.key],
|
|
247
303
|
},
|
|
248
304
|
} satisfies Story;
|
|
249
305
|
|
|
250
|
-
export const
|
|
306
|
+
export const WithSearch = {
|
|
251
307
|
decorators: getDecorators({
|
|
252
|
-
config:
|
|
253
|
-
|
|
254
|
-
|
|
308
|
+
config: config.remote,
|
|
309
|
+
types: testTypes,
|
|
310
|
+
onInit: async ({ space }) => {
|
|
311
|
+
await addTestData(space);
|
|
312
|
+
},
|
|
255
313
|
}),
|
|
256
314
|
args: {
|
|
257
|
-
components: [ChatContainer,
|
|
315
|
+
components: [ChatContainer, [GraphContainer]],
|
|
258
316
|
},
|
|
259
317
|
} satisfies Story;
|
|
260
|
-
|
|
261
|
-
// export const WithArtifacts = {
|
|
262
|
-
// decorators: getDecorators({
|
|
263
|
-
// config: remoteConfig,
|
|
264
|
-
// plugins: [ChessPlugin(), InboxPlugin(), MapPlugin(), MarkdownPlugin(), TablePlugin()],
|
|
265
|
-
// }),
|
|
266
|
-
// args: {
|
|
267
|
-
// components: [ChatContainer],
|
|
268
|
-
// },
|
|
269
|
-
// } 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
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
10
|
+
import { invariant } from '@dxos/invariant';
|
|
11
|
+
import { log } from '@dxos/log';
|
|
12
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
13
|
+
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
14
|
+
|
|
15
|
+
import { Chat } from '../../components';
|
|
16
|
+
import { useBlueprintRegistry, useChatProcessor, useChatServices } from '../../hooks';
|
|
17
|
+
import { useOnline, usePresets } from '../../hooks';
|
|
18
|
+
import { meta } from '../../meta';
|
|
19
|
+
import { Assistant } from '../../types';
|
|
20
|
+
|
|
21
|
+
import { type ComponentProps } from './types';
|
|
22
|
+
|
|
23
|
+
export const ChatContainer = ({ space, onEvent }: ComponentProps) => {
|
|
24
|
+
const { t } = useTranslation(meta.id);
|
|
25
|
+
const [online, setOnline] = useOnline();
|
|
26
|
+
const { preset, ...chatProps } = usePresets(online);
|
|
27
|
+
|
|
28
|
+
const chats = useQuery(space, Filter.type(Assistant.Chat));
|
|
29
|
+
const [chat, setChat] = useState<Assistant.Chat>();
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setChat((currentChat) => currentChat ?? chats[0]);
|
|
32
|
+
}, [chat, chats]);
|
|
33
|
+
|
|
34
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
35
|
+
const services = useChatServices({ space });
|
|
36
|
+
const processor = useChatProcessor({ space, chat, preset, services, blueprintRegistry });
|
|
37
|
+
|
|
38
|
+
const handleNewChat = useCallback(() => {
|
|
39
|
+
invariant(space);
|
|
40
|
+
const chat = space.db.add(
|
|
41
|
+
Obj.make(Assistant.Chat, {
|
|
42
|
+
queue: Ref.fromDXN(space.queues.create().dxn),
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
setChat(chat);
|
|
46
|
+
}, [space]);
|
|
47
|
+
|
|
48
|
+
const handleBranchChat = useCallback(() => {}, [space]);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<Toolbar.Root classNames='density-coarse border-b border-subduedSeparator'>
|
|
53
|
+
<Toolbar.IconButton icon='ph--plus--regular' iconOnly label={t('button new thread')} onClick={handleNewChat} />
|
|
54
|
+
<Toolbar.IconButton
|
|
55
|
+
disabled
|
|
56
|
+
icon='ph--git-branch--regular'
|
|
57
|
+
iconOnly
|
|
58
|
+
label={t('button branch thread')}
|
|
59
|
+
onClick={handleBranchChat}
|
|
60
|
+
/>
|
|
61
|
+
<div className='flex-1' />
|
|
62
|
+
<Toolbar.IconButton icon='ph--trash--regular' iconOnly label='Reset' onClick={() => onEvent?.('reset')} />
|
|
63
|
+
</Toolbar.Root>
|
|
64
|
+
{!chat || !processor ? null : (
|
|
65
|
+
<Chat.Root chat={chat} processor={processor} onEvent={(event) => log.info('event', { event })}>
|
|
66
|
+
<Chat.Thread />
|
|
67
|
+
<div className='p-4'>
|
|
68
|
+
<Chat.Prompt
|
|
69
|
+
{...chatProps}
|
|
70
|
+
classNames='p-2 border border-transparent rounded focus-within:outline focus-within:border-transparent outline-primary-500'
|
|
71
|
+
preset={preset?.id}
|
|
72
|
+
online={online}
|
|
73
|
+
onChangeOnline={setOnline}
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
</Chat.Root>
|
|
77
|
+
)}
|
|
78
|
+
</>
|
|
79
|
+
);
|
|
80
|
+
};
|