@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.f5c0578
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{TemplateContainer-RPJ2LBOB.mjs → BlueprintContainer-H7H4BQ2C.mjs} +11 -9
- package/dist/lib/browser/BlueprintContainer-H7H4BQ2C.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs → ChatContainer-SB7YC2XP.mjs} +37 -14
- package/dist/lib/browser/ChatContainer-SB7YC2XP.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs → ChatDialog-X6PFOQSQ.mjs} +23 -8
- package/dist/lib/browser/ChatDialog-X6PFOQSQ.mjs.map +7 -0
- package/dist/lib/browser/{SequenceContainer-3UDVKWPA.mjs → SequenceContainer-627OQ557.mjs} +3 -2
- 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-JTXBKE7O.mjs → app-graph-builder-ERU5XY2S.mjs} +17 -74
- package/dist/lib/browser/app-graph-builder-ERU5XY2S.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-OWY4CUQY.mjs → chunk-BVH6VK6Q.mjs} +816 -807
- package/dist/lib/browser/chunk-BVH6VK6Q.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-JBFDQMUJ.mjs +193 -0
- package/dist/lib/browser/chunk-JBFDQMUJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-LKP65RPA.mjs +20 -0
- package/dist/lib/browser/{chunk-FDCJSQYF.mjs.map → chunk-LKP65RPA.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-AEAEKWOC.mjs → chunk-NZDCKQ6W.mjs} +12 -21
- 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-Y66UJUHV.mjs +280 -0
- package/dist/lib/browser/chunk-Y66UJUHV.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 +98 -51
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-5RMMCMXG.mjs → intent-resolver-DGRO2XSG.mjs} +33 -12
- package/dist/lib/browser/intent-resolver-DGRO2XSG.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-66VY37YQ.mjs → react-surface-LPSIBHEJ.mjs} +45 -32
- package/dist/lib/browser/react-surface-LPSIBHEJ.mjs.map +7 -0
- package/dist/lib/browser/{settings-2DGP3UTS.mjs → settings-ZFNQYSYP.mjs} +6 -5
- package/dist/lib/{node-esm/settings-47RYZOU4.mjs.map → browser/settings-ZFNQYSYP.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 +7 -4
- package/dist/lib/node-esm/{TemplateContainer-A3NAQCZE.mjs → BlueprintContainer-VH4EE4CM.mjs} +11 -9
- package/dist/lib/node-esm/BlueprintContainer-VH4EE4CM.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs → ChatContainer-7JLMWHMX.mjs} +37 -14
- package/dist/lib/node-esm/ChatContainer-7JLMWHMX.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs → ChatDialog-QDD722F2.mjs} +23 -8
- package/dist/lib/node-esm/ChatDialog-QDD722F2.mjs.map +7 -0
- package/dist/lib/node-esm/{SequenceContainer-RQQH5XOC.mjs → SequenceContainer-EQ5NP2PG.mjs} +3 -2
- 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-OWSOXFTD.mjs → app-graph-builder-RCT4ANP2.mjs} +17 -74
- package/dist/lib/node-esm/app-graph-builder-RCT4ANP2.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-SENTQAEO.mjs → chunk-ETS2CIDF.mjs} +816 -807
- package/dist/lib/node-esm/chunk-ETS2CIDF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2XL6MNPE.mjs → chunk-GAWXJ7K5.mjs} +12 -21
- package/dist/lib/node-esm/chunk-GAWXJ7K5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GENVBE3B.mjs +194 -0
- package/dist/lib/node-esm/chunk-GENVBE3B.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-KOC6ESG7.mjs +22 -0
- package/dist/lib/node-esm/{chunk-QN2H2EHV.mjs.map → chunk-KOC6ESG7.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-QS6GWTVA.mjs +281 -0
- package/dist/lib/node-esm/chunk-QS6GWTVA.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 +98 -51
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-YPPYELY3.mjs → intent-resolver-7CKWG7TZ.mjs} +33 -12
- package/dist/lib/node-esm/intent-resolver-7CKWG7TZ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-RJMRBR2M.mjs → react-surface-3EPAE4I4.mjs} +45 -32
- package/dist/lib/node-esm/react-surface-3EPAE4I4.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-47RYZOU4.mjs → settings-UI4VQCWW.mjs} +6 -5
- package/dist/lib/{browser/settings-2DGP3UTS.mjs.map → node-esm/settings-UI4VQCWW.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 +7 -4
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.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 +11 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- 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 +5 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- 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 +6 -8
- package/dist/types/src/components/Chat/Chat.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/ChatOptions.d.ts +13 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.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/index.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +4 -3
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +2 -2
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +33 -48
- 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.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/Timeline/Timeline.d.ts +42 -0
- package/dist/types/src/components/Timeline/Timeline.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts +11 -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 +4 -7
- 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 +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/execution-graph/execution-graph.d.ts +21 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +2 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/functions/analysis.d.ts +5 -0
- package/dist/types/src/functions/analysis.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/list.d.ts +10 -0
- package/dist/types/src/functions/list.d.ts.map +1 -0
- package/dist/types/src/functions/load.d.ts +8 -0
- package/dist/types/src/functions/load.d.ts.map +1 -0
- package/dist/types/src/hooks/chat-processor.d.ts +28 -42
- 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 +6 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/presets.d.ts +2 -2
- package/dist/types/src/hooks/presets.d.ts.map +1 -1
- 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 +7 -14
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -4
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useExecutionGraph.d.ts +7 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/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/query-parser.d.ts.map +1 -1
- package/dist/types/src/stories/Chat.stories.d.ts +68 -49
- 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 +6 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +42 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +91 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +6 -6
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +83 -75
- package/src/AssistantPlugin.tsx +59 -12
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +9 -93
- package/src/capabilities/blueprint-definition.ts +32 -0
- package/src/capabilities/capabilities.ts +22 -0
- package/src/capabilities/edge-model-resolver.ts +29 -0
- package/src/capabilities/index.ts +6 -0
- package/src/capabilities/intent-resolver.ts +24 -9
- package/src/capabilities/react-surface.tsx +29 -22
- 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 +77 -64
- package/src/components/ChatContainer.tsx +38 -14
- package/src/components/ChatDialog.tsx +10 -6
- package/src/components/ChatPrompt/ChatOptions.tsx +59 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +11 -9
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatMessage.tsx +141 -118
- package/src/components/ChatThread/ChatThread.stories.tsx +236 -104
- package/src/components/ChatThread/ChatThread.tsx +2 -2
- package/src/components/ChatThread/Link.tsx +23 -0
- package/src/components/ChatThread/ToolBlock.tsx +20 -16
- package/src/components/SequenceContainer.tsx +2 -1
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +3 -2
- package/src/components/SequenceEditor/SequenceEditor.tsx +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +12 -5
- package/src/components/TemplateEditor/TemplateEditor.tsx +15 -12
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +12 -5
- package/src/components/TemplateEditor/TemplateForm.tsx +5 -3
- package/src/components/Timeline/Timeline.stories.tsx +144 -0
- package/src/components/Timeline/Timeline.tsx +202 -0
- package/src/components/Timeline/index.ts +5 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +6 -12
- package/src/components/Toolbox/Toolbox.tsx +16 -40
- package/src/components/index.ts +2 -5
- package/src/events.ts +2 -2
- package/src/execution-graph/execution-graph.ts +184 -0
- package/src/execution-graph/index.ts +5 -0
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +42 -0
- package/src/functions/load.ts +43 -0
- package/src/hooks/chat-processor.ts +123 -177
- package/src/hooks/errors.ts +8 -0
- package/src/hooks/index.ts +6 -1
- package/src/hooks/presets.ts +6 -5
- package/src/hooks/useBlueprintRegistry.ts +79 -0
- package/src/hooks/useChatProcessor.ts +21 -83
- package/src/hooks/useChatServices.ts +37 -54
- package/src/hooks/useExecutionGraph.ts +16 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +45 -0
- package/src/hooks/useReferencesProvider.ts +11 -9
- package/src/hooks/useResolveRef.ts +33 -0
- package/src/parser/filter-generator.ts +6 -13
- package/src/parser/query-parser.ts +1 -1
- package/src/queue-logger.ts +5 -5
- package/src/stories/Chat.stories.tsx +238 -299
- 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 +29 -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 +163 -0
- package/src/testing/test-functions.ts +8 -3
- package/src/testing/test-sequence.ts +1 -1
- package/src/tools/function.ts +4 -1
- package/src/tools/openapi.test.ts +7 -5
- package/src/tools/openapi.ts +4 -1
- package/src/translations.ts +8 -10
- package/src/types/Assistant.ts +62 -0
- package/src/types/AssistantAction.ts +54 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -1
- package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +0 -7
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs +0 -108
- package/dist/lib/browser/chunk-EQDW6BYQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-JQBVLTM5.mjs +0 -158
- package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
- package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs +0 -159
- package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs +0 -109
- package/dist/lib/node-esm/chunk-E33DNNDW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +0 -7
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -8
- 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 -9
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -88
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/TemplateContainer.tsx +0 -24
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/types/schema.ts +0 -95
|
@@ -4,63 +4,98 @@
|
|
|
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
|
-
import {
|
|
14
|
-
DESIGN_BLUEPRINT,
|
|
15
|
-
TASK_BLUEPRINT,
|
|
16
|
-
readDocument,
|
|
17
|
-
remoteServiceEndpoints,
|
|
18
|
-
writeDocument,
|
|
19
|
-
} from '@dxos/assistant-testing';
|
|
20
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
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';
|
|
21
13
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
22
|
-
import { invariant } from '@dxos/invariant';
|
|
23
14
|
import { log } from '@dxos/log';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
15
|
+
import { Board, BoardPlugin } from '@dxos/plugin-board';
|
|
16
|
+
import { Chess, ChessPlugin } from '@dxos/plugin-chess';
|
|
26
17
|
import { InboxPlugin } from '@dxos/plugin-inbox';
|
|
27
|
-
import { MapPlugin } from '@dxos/plugin-map';
|
|
18
|
+
import { Map, MapPlugin } from '@dxos/plugin-map';
|
|
28
19
|
import { MarkdownPlugin } from '@dxos/plugin-markdown';
|
|
29
|
-
import {
|
|
30
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
20
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
31
21
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { Toolbar, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
36
|
-
import {
|
|
37
|
-
Editor,
|
|
38
|
-
createBasicExtensions,
|
|
39
|
-
createDataExtensions,
|
|
40
|
-
createMarkdownExtensions,
|
|
41
|
-
createThemeExtensions,
|
|
42
|
-
outliner,
|
|
43
|
-
} from '@dxos/react-ui-editor';
|
|
44
|
-
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';
|
|
45
25
|
import { DataType } from '@dxos/schema';
|
|
46
|
-
import { render
|
|
26
|
+
import { render } from '@dxos/storybook-utils';
|
|
27
|
+
import { trim } from '@dxos/util';
|
|
47
28
|
|
|
48
|
-
import { AssistantPlugin } from '../AssistantPlugin';
|
|
49
|
-
import { Chat, TemplateEditor, type ChatPromptProps } from '../components';
|
|
50
|
-
import { type AiServicePreset, AiServicePresets } from '../hooks';
|
|
51
|
-
import { useChatProcessor, useChatServices } from '../hooks';
|
|
52
|
-
import { meta as AssistantMeta } from '../meta';
|
|
53
29
|
import { translations } from '../translations';
|
|
54
30
|
import { Assistant } from '../types';
|
|
55
31
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
}
|
|
59
95
|
|
|
60
|
-
const DefaultStory = ({ components }: { components: (FC | FC[])[] }) => {
|
|
61
96
|
return (
|
|
62
97
|
<div
|
|
63
|
-
className=
|
|
98
|
+
className='grid grid-cols gap-2 m-2'
|
|
64
99
|
style={{ gridTemplateColumns: `repeat(${components.length}, minmax(0, 40rem))` }}
|
|
65
100
|
>
|
|
66
101
|
{components.map((Component, index) =>
|
|
@@ -71,14 +106,14 @@ const DefaultStory = ({ components }: { components: (FC | FC[])[] }) => {
|
|
|
71
106
|
style={{ gridTemplateRows: `repeat(${Component.length}, 1fr)` }}
|
|
72
107
|
>
|
|
73
108
|
{Component.map((Component, index) => (
|
|
74
|
-
<div key={index} className='flex flex-col overflow-hidden bg-baseSurface border border-separator'>
|
|
75
|
-
<Component />
|
|
109
|
+
<div key={index} className='flex flex-col overflow-hidden bg-baseSurface rounded border border-separator'>
|
|
110
|
+
<Component space={space} debug={debug} onEvent={handleEvent} />
|
|
76
111
|
</div>
|
|
77
112
|
))}
|
|
78
113
|
</div>
|
|
79
114
|
) : (
|
|
80
|
-
<div key={index} className='flex flex-col overflow-hidden bg-baseSurface border border-separator'>
|
|
81
|
-
<Component />
|
|
115
|
+
<div key={index} className='flex flex-col overflow-hidden bg-baseSurface rounded border border-separator'>
|
|
116
|
+
<Component space={space} debug={debug} onEvent={handleEvent} />
|
|
82
117
|
</div>
|
|
83
118
|
),
|
|
84
119
|
)}
|
|
@@ -86,293 +121,197 @@ const DefaultStory = ({ components }: { components: (FC | FC[])[] }) => {
|
|
|
86
121
|
);
|
|
87
122
|
};
|
|
88
123
|
|
|
89
|
-
|
|
90
|
-
// Components
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
const ChatContainer = () => {
|
|
94
|
-
const { t } = useTranslation(AssistantMeta.id);
|
|
95
|
-
const space = useSpace();
|
|
96
|
-
|
|
97
|
-
const [chat, setChat] = useState<Assistant.Chat>();
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
const results = space?.db.query(Filter.type(Assistant.Chat)).runSync();
|
|
100
|
-
if (results?.length) {
|
|
101
|
-
setChat(results[0].object);
|
|
102
|
-
}
|
|
103
|
-
}, [space]);
|
|
104
|
-
|
|
105
|
-
// TODO(burdon): Memo preset for provider.
|
|
106
|
-
const [online, setOnline] = useState(true);
|
|
107
|
-
const [preset, setPreset] = useState<AiServicePreset>();
|
|
108
|
-
const presets = useMemo(
|
|
109
|
-
() => AiServicePresets.filter((preset) => online === (preset.provider === 'dxos-remote')),
|
|
110
|
-
[online],
|
|
111
|
-
);
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
setPreset(presets[0]);
|
|
114
|
-
}, [presets]);
|
|
115
|
-
|
|
116
|
-
const services = useChatServices({ space });
|
|
117
|
-
const blueprintRegistry = useMemo(() => new Blueprint.Registry([DESIGN_BLUEPRINT, TASK_BLUEPRINT]), []);
|
|
118
|
-
const processor = useChatProcessor({
|
|
119
|
-
preset,
|
|
120
|
-
chat,
|
|
121
|
-
space,
|
|
122
|
-
services,
|
|
123
|
-
blueprintRegistry,
|
|
124
|
-
noPluginArtifacts: true,
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const handleChangePreset = useCallback<NonNullable<ChatPromptProps['onChangePreset']>>(
|
|
128
|
-
(id) => {
|
|
129
|
-
const preset = presets.find((preset) => preset.id === id);
|
|
130
|
-
if (preset) {
|
|
131
|
-
setPreset(preset);
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
[presets],
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
const handleNewChat = useCallback(() => {
|
|
138
|
-
invariant(space);
|
|
139
|
-
const chat = space.db.add(
|
|
140
|
-
Obj.make(Assistant.Chat, {
|
|
141
|
-
queue: Ref.fromDXN(space.queues.create().dxn),
|
|
142
|
-
}),
|
|
143
|
-
);
|
|
144
|
-
setChat(chat);
|
|
145
|
-
}, [space]);
|
|
146
|
-
|
|
147
|
-
const handleBranchChat = useCallback(() => {}, [space]);
|
|
148
|
-
|
|
149
|
-
if (!chat || !processor) {
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return (
|
|
154
|
-
<Chat.Root chat={chat} processor={processor} onEvent={(event) => log.info('event', { event })}>
|
|
155
|
-
<Toolbar.Root classNames='border-b border-subduedSeparator'>
|
|
156
|
-
<Toolbar.IconButton icon='ph--plus--regular' iconOnly label={t('button new thread')} onClick={handleNewChat} />
|
|
157
|
-
<Toolbar.IconButton
|
|
158
|
-
disabled
|
|
159
|
-
icon='ph--git-branch--regular'
|
|
160
|
-
iconOnly
|
|
161
|
-
label={t('button branch thread')}
|
|
162
|
-
onClick={handleBranchChat}
|
|
163
|
-
/>
|
|
164
|
-
</Toolbar.Root>
|
|
165
|
-
<Chat.Thread />
|
|
166
|
-
<div className='p-4'>
|
|
167
|
-
<Chat.Prompt
|
|
168
|
-
classNames='p-2 border border-subduedSeparator rounded focus-within:outline focus-within:border-transparent outline-primary-500'
|
|
169
|
-
expandable
|
|
170
|
-
online={online}
|
|
171
|
-
presets={presets.map(({ id, model, label }) => ({ id, label: label ?? model }))}
|
|
172
|
-
preset={preset?.id}
|
|
173
|
-
onChangeOnline={setOnline}
|
|
174
|
-
onChangePreset={handleChangePreset}
|
|
175
|
-
/>
|
|
176
|
-
</div>
|
|
177
|
-
</Chat.Root>
|
|
178
|
-
);
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const DocumentContainer = () => {
|
|
182
|
-
const { themeMode } = useThemeContext();
|
|
183
|
-
const space = useSpace();
|
|
184
|
-
const [document] = useQuery(space, Filter.type(DocumentType));
|
|
185
|
-
if (!document?.content.target) {
|
|
186
|
-
return null;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return (
|
|
190
|
-
<>
|
|
191
|
-
<Toolbar.Root classNames='border-b border-subduedSeparator'>
|
|
192
|
-
<h2>{Obj.getLabel(document)}</h2>
|
|
193
|
-
</Toolbar.Root>
|
|
194
|
-
<Editor
|
|
195
|
-
id={document.id}
|
|
196
|
-
text={document.content.target}
|
|
197
|
-
classNames='h-full p-2 overflow-hidden'
|
|
198
|
-
extensions={[
|
|
199
|
-
// TODO(burdon): Create util.
|
|
200
|
-
createDataExtensions({ id: document.id, text: createDocAccessor(document.content.target, ['content']) }),
|
|
201
|
-
createBasicExtensions({ readOnly: false }),
|
|
202
|
-
createMarkdownExtensions({ themeMode }),
|
|
203
|
-
createThemeExtensions({ themeMode }),
|
|
204
|
-
outliner(),
|
|
205
|
-
]}
|
|
206
|
-
/>
|
|
207
|
-
</>
|
|
208
|
-
);
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
// TODO(burdon): Show all active blueprints from context?
|
|
212
|
-
const BlueprintContainer = () => {
|
|
213
|
-
const space = useSpace();
|
|
214
|
-
const [blueprint] = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
215
|
-
if (!blueprint?.instructions.target) {
|
|
216
|
-
return null;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return (
|
|
220
|
-
<div className='flex flex-col h-full'>
|
|
221
|
-
<Toolbar.Root classNames='border-b border-subduedSeparator'>
|
|
222
|
-
<h2>{Obj.getLabel(blueprint)}</h2>
|
|
223
|
-
</Toolbar.Root>
|
|
224
|
-
<TemplateEditor template={blueprint.instructions.target} />
|
|
225
|
-
</div>
|
|
226
|
-
);
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
//
|
|
230
|
-
// Configuration
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
const meta = {
|
|
124
|
+
const storybook = {
|
|
234
125
|
title: 'plugins/plugin-assistant/Chat',
|
|
235
126
|
render: render(DefaultStory),
|
|
236
|
-
decorators: [],
|
|
237
127
|
parameters: {
|
|
238
128
|
translations,
|
|
239
129
|
controls: { disable: true },
|
|
240
130
|
},
|
|
241
131
|
} satisfies Meta<typeof DefaultStory>;
|
|
242
132
|
|
|
243
|
-
export default
|
|
133
|
+
export default storybook;
|
|
244
134
|
|
|
245
|
-
type Story = StoryObj<typeof
|
|
135
|
+
type Story = StoryObj<typeof storybook>;
|
|
246
136
|
|
|
247
137
|
//
|
|
248
|
-
//
|
|
138
|
+
// Stories
|
|
249
139
|
//
|
|
250
140
|
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
edge: {
|
|
259
|
-
url: remoteServiceEndpoints.edge,
|
|
260
|
-
},
|
|
261
|
-
},
|
|
141
|
+
export const Default = {
|
|
142
|
+
decorators: getDecorators({
|
|
143
|
+
config: config.remote,
|
|
144
|
+
}),
|
|
145
|
+
args: {
|
|
146
|
+
components: [ChatContainer],
|
|
262
147
|
},
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const getDecorators = ({
|
|
266
|
-
config,
|
|
267
|
-
plugins = [],
|
|
268
|
-
blueprints = [],
|
|
269
|
-
context = false,
|
|
270
|
-
}: {
|
|
271
|
-
config: Config;
|
|
272
|
-
plugins?: Plugin[];
|
|
273
|
-
blueprints?: Blueprint.Blueprint[];
|
|
274
|
-
context?: boolean;
|
|
275
|
-
}) => [
|
|
276
|
-
withPluginManager({
|
|
277
|
-
fireEvents: [Events.SetupArtifactDefinition],
|
|
278
|
-
plugins: [
|
|
279
|
-
ClientPlugin({
|
|
280
|
-
config,
|
|
281
|
-
types: [Assistant.Chat, DocumentType, Blueprint.Blueprint],
|
|
282
|
-
onClientInitialized: async (_, client) => {
|
|
283
|
-
await client.halo.createIdentity();
|
|
284
|
-
await client.spaces.waitUntilReady();
|
|
285
|
-
const space = client.spaces.default;
|
|
286
|
-
// ISSUE(burdon): Should not require this.
|
|
287
|
-
// ERROR: invariant violation: Database was not initialized with root object.
|
|
288
|
-
await space.waitUntilReady();
|
|
289
|
-
|
|
290
|
-
// TODO(burdon): Remove need for this boilerplate. Namespace for types?
|
|
291
|
-
const chat = space.db.add(
|
|
292
|
-
Obj.make(Assistant.Chat, {
|
|
293
|
-
queue: Ref.fromDXN(space.queues.create().dxn),
|
|
294
|
-
}),
|
|
295
|
-
);
|
|
296
|
-
const binder = new ContextBinder(await chat.queue.load());
|
|
297
|
-
|
|
298
|
-
const doc = space.db.add(
|
|
299
|
-
Obj.make(DocumentType, {
|
|
300
|
-
name: 'Tasks',
|
|
301
|
-
content: Ref.make(Obj.make(DataType.Text, { content: '' })),
|
|
302
|
-
}),
|
|
303
|
-
);
|
|
304
|
-
if (context) {
|
|
305
|
-
await binder.bind({ objects: [Ref.make(doc)] });
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
for (const blueprint of blueprints) {
|
|
309
|
-
// Clone blueprints and bind to conversation.
|
|
310
|
-
// TODO(dmaretskyi): This should be done by Obj.clone.
|
|
311
|
-
const { id: _id, ...data } = blueprint;
|
|
312
|
-
const obj = space.db.add(Obj.make(Blueprint.Blueprint, data));
|
|
313
|
-
await binder.bind({ blueprints: [Ref.make(obj)] });
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
}),
|
|
317
|
-
IntentPlugin(),
|
|
318
|
-
SettingsPlugin(),
|
|
319
|
-
SpacePlugin(),
|
|
148
|
+
} satisfies Story;
|
|
320
149
|
|
|
321
|
-
|
|
322
|
-
|
|
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;
|
|
323
171
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
+
},
|
|
327
180
|
}),
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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
|
+
},
|
|
332
201
|
}),
|
|
333
|
-
|
|
202
|
+
args: {
|
|
203
|
+
components: [ChatContainer, SurfaceContainer],
|
|
204
|
+
blueprints: ['dxos.org/blueprint/assistant', 'dxos.org/blueprint/chess'],
|
|
205
|
+
},
|
|
206
|
+
} satisfies Story;
|
|
334
207
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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;
|
|
338
222
|
|
|
339
|
-
export const
|
|
223
|
+
export const WithTrip = {
|
|
340
224
|
decorators: getDecorators({
|
|
341
|
-
|
|
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
|
+
},
|
|
342
271
|
}),
|
|
343
272
|
args: {
|
|
344
|
-
components: [ChatContainer],
|
|
273
|
+
components: [ChatContainer, SurfaceContainer],
|
|
345
274
|
},
|
|
346
275
|
} satisfies Story;
|
|
347
276
|
|
|
348
|
-
export const
|
|
277
|
+
export const WithBoard = {
|
|
349
278
|
decorators: getDecorators({
|
|
350
|
-
|
|
351
|
-
|
|
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
|
+
},
|
|
352
286
|
}),
|
|
353
287
|
args: {
|
|
354
|
-
|
|
288
|
+
debug: true,
|
|
289
|
+
components: [ChatContainer, SurfaceContainer],
|
|
355
290
|
},
|
|
356
291
|
} satisfies Story;
|
|
357
292
|
|
|
358
|
-
export const
|
|
293
|
+
export const WithResearch = {
|
|
359
294
|
decorators: getDecorators({
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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 })],
|
|
364
299
|
}),
|
|
365
300
|
args: {
|
|
366
|
-
components: [ChatContainer, [
|
|
301
|
+
components: [ChatContainer, [/*GraphContainer, BlueprintContainer,*/ LoggingContainer]],
|
|
302
|
+
blueprints: [RESEARCH_BLUEPRINT.key],
|
|
367
303
|
},
|
|
368
304
|
} satisfies Story;
|
|
369
305
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
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
|
+
};
|