@dxos/plugin-assistant 0.8.4-main.67995b8 → 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/{BlueprintContainer-IZ4AK5EO.mjs → BlueprintContainer-H7H4BQ2C.mjs} +4 -3
- package/dist/lib/browser/{ChatContainer-RP3QEXYX.mjs → ChatContainer-SB7YC2XP.mjs} +37 -14
- package/dist/lib/browser/ChatContainer-SB7YC2XP.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-ZVLXFHEY.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-XSEOKJLG.mjs → app-graph-builder-ERU5XY2S.mjs} +14 -12
- 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-63GG6U6D.mjs → chunk-BVH6VK6Q.mjs} +817 -789
- 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-KFXSBNZR.mjs → chunk-NZDCKQ6W.mjs} +3 -3
- package/dist/lib/{node-esm/chunk-VIIMA3XQ.mjs.map → browser/chunk-NZDCKQ6W.mjs.map} +2 -2
- 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 +83 -48
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-MV3VSZLS.mjs → intent-resolver-DGRO2XSG.mjs} +20 -14
- 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-3GYEHQRP.mjs → react-surface-LPSIBHEJ.mjs} +36 -23
- package/dist/lib/browser/react-surface-LPSIBHEJ.mjs.map +7 -0
- package/dist/lib/browser/{settings-5GTTCVGD.mjs → settings-ZFNQYSYP.mjs} +6 -5
- package/dist/lib/{node-esm/settings-J2EXEM5H.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/{BlueprintContainer-RGTMNLNX.mjs → BlueprintContainer-VH4EE4CM.mjs} +4 -3
- package/dist/lib/{browser/BlueprintContainer-IZ4AK5EO.mjs.map → node-esm/BlueprintContainer-VH4EE4CM.mjs.map} +1 -1
- package/dist/lib/node-esm/{ChatContainer-W3W6FWV3.mjs → ChatContainer-7JLMWHMX.mjs} +37 -14
- package/dist/lib/node-esm/ChatContainer-7JLMWHMX.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-QW4JRKVO.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-PANCJUHV.mjs → app-graph-builder-RCT4ANP2.mjs} +14 -12
- 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-BFO3KHYL.mjs → chunk-ETS2CIDF.mjs} +817 -789
- package/dist/lib/node-esm/chunk-ETS2CIDF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-VIIMA3XQ.mjs → chunk-GAWXJ7K5.mjs} +3 -3
- package/dist/lib/{browser/chunk-KFXSBNZR.mjs.map → node-esm/chunk-GAWXJ7K5.mjs.map} +2 -2
- 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 +83 -48
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-3FMC3GHC.mjs → intent-resolver-7CKWG7TZ.mjs} +20 -14
- 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-QDQWJ7FZ.mjs → react-surface-3EPAE4I4.mjs} +36 -23
- package/dist/lib/node-esm/react-surface-3EPAE4I4.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-J2EXEM5H.mjs → settings-UI4VQCWW.mjs} +6 -5
- package/dist/lib/{browser/settings-5GTTCVGD.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/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 -6
- 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.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.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 +2 -1
- 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 +4 -3
- 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 +66 -5
- 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 +5 -0
- 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 +85 -79
- package/src/AssistantPlugin.tsx +37 -16
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +8 -8
- 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 +13 -12
- package/src/capabilities/react-surface.tsx +22 -15
- package/src/capabilities/toolkit.ts +106 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +1 -1
- 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 +9 -2
- package/src/components/TemplateEditor/TemplateEditor.tsx +3 -2
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +9 -2
- package/src/components/TemplateEditor/TemplateForm.tsx +2 -1
- 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 +1 -4
- 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 +29 -22
- 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 +236 -290
- 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 +7 -0
- 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-RP3QEXYX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ZVLXFHEY.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs.map +0 -7
- package/dist/lib/browser/chunk-63GG6U6D.mjs.map +0 -7
- package/dist/lib/browser/chunk-7W7LHTRH.mjs +0 -171
- package/dist/lib/browser/chunk-7W7LHTRH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-LERGF5YG.mjs +0 -108
- package/dist/lib/browser/chunk-LERGF5YG.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3GYEHQRP.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-W3W6FWV3.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QW4JRKVO.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs +0 -109
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs +0 -172
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs.map +0 -7
- package/dist/types/src/capability-definitions.d.ts +0 -7
- package/dist/types/src/capability-definitions.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/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 -120
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capability-definitions.ts +0 -15
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/types/schema.ts +0 -108
- /package/dist/lib/{node-esm/BlueprintContainer-RGTMNLNX.mjs.map → browser/BlueprintContainer-H7H4BQ2C.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-assistant",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.f5c0578",
|
|
4
4
|
"description": "Assistant plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
|
-
"source": "./src/index.ts"
|
|
16
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
17
17
|
},
|
|
18
18
|
"./types": {
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
19
20
|
"types": "./dist/types/src/types/index.d.ts",
|
|
20
21
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
21
|
-
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
22
|
-
"source": "./src/types/index.ts"
|
|
22
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -41,100 +41,106 @@
|
|
|
41
41
|
"@codemirror/search": "^6.5.6",
|
|
42
42
|
"@codemirror/state": "^6.4.1",
|
|
43
43
|
"@codemirror/view": "^6.34.1",
|
|
44
|
-
"@effect/ai": "0.
|
|
44
|
+
"@effect/ai": "0.25.2",
|
|
45
|
+
"@effect/ai-anthropic": "^0.15.1",
|
|
45
46
|
"@lezer/highlight": "^1.2.1",
|
|
46
47
|
"@preact-signals/safe-react": "^0.9.0",
|
|
47
48
|
"@preact/signals-core": "^1.9.0",
|
|
48
49
|
"@preact/signals-react": "^3.2.0",
|
|
49
50
|
"@radix-ui/react-context": "1.1.1",
|
|
50
51
|
"@xiechao/codemirror-lang-handlebars": "1.0.4",
|
|
51
|
-
"effect": "3.17.
|
|
52
|
+
"effect": "3.17.7",
|
|
52
53
|
"exa-js": "^1.5.12",
|
|
53
54
|
"json5": "^2.2.3",
|
|
54
55
|
"jsonpointer": "^5.0.1",
|
|
55
56
|
"lodash.defaultsdeep": "^4.6.1",
|
|
56
57
|
"unified": "^11.0.0",
|
|
57
58
|
"use-deep-compare-effect": "^1.8.1",
|
|
58
|
-
"@dxos/ai": "0.8.4-main.
|
|
59
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/compute": "0.8.4-main.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/echo": "0.8.4-main.
|
|
71
|
-
"@dxos/echo-
|
|
72
|
-
"@dxos/echo-
|
|
73
|
-
"@dxos/echo-schema": "0.8.4-main.
|
|
74
|
-
"@dxos/edge-client": "0.8.4-main.
|
|
75
|
-
"@dxos/effect": "0.8.4-main.
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/live-object": "0.8.4-main.
|
|
81
|
-
"@dxos/local-storage": "0.8.4-main.
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/plugin-
|
|
85
|
-
"@dxos/plugin-
|
|
86
|
-
"@dxos/plugin-
|
|
87
|
-
"@dxos/plugin-
|
|
88
|
-
"@dxos/plugin-
|
|
89
|
-
"@dxos/plugin-
|
|
90
|
-
"@dxos/plugin-
|
|
91
|
-
"@dxos/plugin-
|
|
92
|
-
"@dxos/plugin-
|
|
93
|
-
"@dxos/plugin-
|
|
94
|
-
"@dxos/plugin-
|
|
95
|
-
"@dxos/plugin-
|
|
96
|
-
"@dxos/
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/
|
|
100
|
-
"@dxos/
|
|
101
|
-
"@dxos/react-
|
|
102
|
-
"@dxos/react-
|
|
103
|
-
"@dxos/react-ui-
|
|
104
|
-
"@dxos/react-ui-editor": "0.8.4-main.
|
|
105
|
-
"@dxos/react-ui-
|
|
106
|
-
"@dxos/react-ui-
|
|
107
|
-
"@dxos/react-ui-
|
|
108
|
-
"@dxos/react-ui-
|
|
109
|
-
"@dxos/react-ui-
|
|
110
|
-
"@dxos/react-ui-
|
|
111
|
-
"@dxos/react-ui-
|
|
112
|
-
"@dxos/
|
|
113
|
-
"@dxos/
|
|
59
|
+
"@dxos/ai": "0.8.4-main.f5c0578",
|
|
60
|
+
"@dxos/app-framework": "0.8.4-main.f5c0578",
|
|
61
|
+
"@dxos/async": "0.8.4-main.f5c0578",
|
|
62
|
+
"@dxos/assistant": "0.8.4-main.f5c0578",
|
|
63
|
+
"@dxos/blueprints": "0.8.4-main.f5c0578",
|
|
64
|
+
"@dxos/client": "0.8.4-main.f5c0578",
|
|
65
|
+
"@dxos/compute": "0.8.4-main.f5c0578",
|
|
66
|
+
"@dxos/config": "0.8.4-main.f5c0578",
|
|
67
|
+
"@dxos/context": "0.8.4-main.f5c0578",
|
|
68
|
+
"@dxos/debug": "0.8.4-main.f5c0578",
|
|
69
|
+
"@dxos/conductor": "0.8.4-main.f5c0578",
|
|
70
|
+
"@dxos/devtools": "0.8.4-main.f5c0578",
|
|
71
|
+
"@dxos/echo": "0.8.4-main.f5c0578",
|
|
72
|
+
"@dxos/echo-protocol": "0.8.4-main.f5c0578",
|
|
73
|
+
"@dxos/echo-db": "0.8.4-main.f5c0578",
|
|
74
|
+
"@dxos/echo-schema": "0.8.4-main.f5c0578",
|
|
75
|
+
"@dxos/edge-client": "0.8.4-main.f5c0578",
|
|
76
|
+
"@dxos/effect": "0.8.4-main.f5c0578",
|
|
77
|
+
"@dxos/graph": "0.8.4-main.f5c0578",
|
|
78
|
+
"@dxos/invariant": "0.8.4-main.f5c0578",
|
|
79
|
+
"@dxos/keys": "0.8.4-main.f5c0578",
|
|
80
|
+
"@dxos/functions": "0.8.4-main.f5c0578",
|
|
81
|
+
"@dxos/live-object": "0.8.4-main.f5c0578",
|
|
82
|
+
"@dxos/local-storage": "0.8.4-main.f5c0578",
|
|
83
|
+
"@dxos/lit-ui": "0.8.4-main.f5c0578",
|
|
84
|
+
"@dxos/log": "0.8.4-main.f5c0578",
|
|
85
|
+
"@dxos/plugin-attention": "0.8.4-main.f5c0578",
|
|
86
|
+
"@dxos/plugin-board": "0.8.4-main.f5c0578",
|
|
87
|
+
"@dxos/plugin-client": "0.8.4-main.f5c0578",
|
|
88
|
+
"@dxos/plugin-deck": "0.8.4-main.f5c0578",
|
|
89
|
+
"@dxos/plugin-explorer": "0.8.4-main.f5c0578",
|
|
90
|
+
"@dxos/plugin-graph": "0.8.4-main.f5c0578",
|
|
91
|
+
"@dxos/plugin-markdown": "0.8.4-main.f5c0578",
|
|
92
|
+
"@dxos/plugin-map": "0.8.4-main.f5c0578",
|
|
93
|
+
"@dxos/plugin-preview": "0.8.4-main.f5c0578",
|
|
94
|
+
"@dxos/plugin-script": "0.8.4-main.f5c0578",
|
|
95
|
+
"@dxos/plugin-sketch": "0.8.4-main.f5c0578",
|
|
96
|
+
"@dxos/plugin-space": "0.8.4-main.f5c0578",
|
|
97
|
+
"@dxos/plugin-transcription": "0.8.4-main.f5c0578",
|
|
98
|
+
"@dxos/plugin-stack": "0.8.4-main.f5c0578",
|
|
99
|
+
"@dxos/plugin-wnfs": "0.8.4-main.f5c0578",
|
|
100
|
+
"@dxos/plugin-inbox": "0.8.4-main.f5c0578",
|
|
101
|
+
"@dxos/protocols": "0.8.4-main.f5c0578",
|
|
102
|
+
"@dxos/react-client": "0.8.4-main.f5c0578",
|
|
103
|
+
"@dxos/react-edge-client": "0.8.4-main.f5c0578",
|
|
104
|
+
"@dxos/react-ui-attention": "0.8.4-main.f5c0578",
|
|
105
|
+
"@dxos/react-ui-canvas-editor": "0.8.4-main.f5c0578",
|
|
106
|
+
"@dxos/react-ui-components": "0.8.4-main.f5c0578",
|
|
107
|
+
"@dxos/react-ui-chat": "0.8.4-main.f5c0578",
|
|
108
|
+
"@dxos/react-ui-editor": "0.8.4-main.f5c0578",
|
|
109
|
+
"@dxos/react-ui-canvas-compute": "0.8.4-main.f5c0578",
|
|
110
|
+
"@dxos/react-ui-form": "0.8.4-main.f5c0578",
|
|
111
|
+
"@dxos/react-ui-list": "0.8.4-main.f5c0578",
|
|
112
|
+
"@dxos/react-ui-sfx": "0.8.4-main.f5c0578",
|
|
113
|
+
"@dxos/react-ui-stack": "0.8.4-main.f5c0578",
|
|
114
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.f5c0578",
|
|
115
|
+
"@dxos/react-ui-graph": "0.8.4-main.f5c0578",
|
|
116
|
+
"@dxos/react-ui-tag-picker": "0.8.4-main.f5c0578",
|
|
117
|
+
"@dxos/schema": "0.8.4-main.f5c0578",
|
|
118
|
+
"@dxos/util": "0.8.4-main.f5c0578"
|
|
114
119
|
},
|
|
115
120
|
"devDependencies": {
|
|
116
121
|
"@effect-rx/rx-react": "^0.38.0",
|
|
117
|
-
"@effect/platform": "0.
|
|
122
|
+
"@effect/platform": "0.90.2",
|
|
118
123
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
119
124
|
"@types/react": "~18.2.0",
|
|
120
125
|
"@types/react-dom": "~18.2.0",
|
|
121
|
-
"effect": "3.17.
|
|
126
|
+
"effect": "3.17.7",
|
|
122
127
|
"openapi-types": "^12.1.3",
|
|
123
128
|
"react": "~18.2.0",
|
|
124
129
|
"react-dom": "~18.2.0",
|
|
125
130
|
"vite": "5.4.7",
|
|
126
|
-
"@dxos/
|
|
127
|
-
"@dxos/
|
|
128
|
-
"@dxos/
|
|
129
|
-
"@dxos/plugin-inbox": "0.8.4-main.
|
|
130
|
-
"@dxos/plugin-map": "0.8.4-main.
|
|
131
|
-
"@dxos/plugin-markdown": "0.8.4-main.
|
|
132
|
-
"@dxos/plugin-table": "0.8.4-main.
|
|
133
|
-
"@dxos/
|
|
134
|
-
"@dxos/
|
|
135
|
-
"@dxos/react-ui-menu": "0.8.4-main.
|
|
136
|
-
"@dxos/
|
|
137
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
131
|
+
"@dxos/echo-db": "0.8.4-main.f5c0578",
|
|
132
|
+
"@dxos/assistant-testing": "0.8.4-main.f5c0578",
|
|
133
|
+
"@dxos/plugin-chess": "0.8.4-main.f5c0578",
|
|
134
|
+
"@dxos/plugin-inbox": "0.8.4-main.f5c0578",
|
|
135
|
+
"@dxos/plugin-map": "0.8.4-main.f5c0578",
|
|
136
|
+
"@dxos/plugin-markdown": "0.8.4-main.f5c0578",
|
|
137
|
+
"@dxos/plugin-table": "0.8.4-main.f5c0578",
|
|
138
|
+
"@dxos/random": "0.8.4-main.f5c0578",
|
|
139
|
+
"@dxos/plugin-theme": "0.8.4-main.f5c0578",
|
|
140
|
+
"@dxos/react-ui-menu": "0.8.4-main.f5c0578",
|
|
141
|
+
"@dxos/react-ui": "0.8.4-main.f5c0578",
|
|
142
|
+
"@dxos/react-ui-theme": "0.8.4-main.f5c0578",
|
|
143
|
+
"@dxos/storybook-utils": "0.8.4-main.f5c0578"
|
|
138
144
|
},
|
|
139
145
|
"peerDependencies": {
|
|
140
146
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -142,8 +148,8 @@
|
|
|
142
148
|
"effect": "^3.13.3",
|
|
143
149
|
"react": "~18.2.0",
|
|
144
150
|
"react-dom": "~18.2.0",
|
|
145
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
146
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
151
|
+
"@dxos/react-ui": "0.8.4-main.f5c0578",
|
|
152
|
+
"@dxos/react-ui-theme": "0.8.4-main.f5c0578"
|
|
147
153
|
},
|
|
148
154
|
"publishConfig": {
|
|
149
155
|
"access": "public"
|
package/src/AssistantPlugin.tsx
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Layer } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
8
5
|
import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
|
|
9
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
10
7
|
import { Sequence } from '@dxos/conductor';
|
|
@@ -13,11 +10,20 @@ import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
|
13
10
|
import { SpaceCapabilities, SpaceEvents } from '@dxos/plugin-space';
|
|
14
11
|
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
15
12
|
|
|
16
|
-
import {
|
|
17
|
-
|
|
13
|
+
import {
|
|
14
|
+
AiService,
|
|
15
|
+
AppGraphBuilder,
|
|
16
|
+
BlueprintDefinition,
|
|
17
|
+
EdgeModelResolver,
|
|
18
|
+
IntentResolver,
|
|
19
|
+
ReactSurface,
|
|
20
|
+
Settings,
|
|
21
|
+
Toolkit,
|
|
22
|
+
} from './capabilities';
|
|
23
|
+
import { AssistantEvents } from './events';
|
|
18
24
|
import { meta } from './meta';
|
|
19
25
|
import { translations } from './translations';
|
|
20
|
-
import { Assistant, ServiceType } from './types';
|
|
26
|
+
import { Assistant, AssistantAction, ServiceType } from './types';
|
|
21
27
|
|
|
22
28
|
export const AssistantPlugin = () =>
|
|
23
29
|
definePlugin(meta, [
|
|
@@ -63,22 +69,22 @@ export const AssistantPlugin = () =>
|
|
|
63
69
|
SpaceCapabilities.ObjectForm,
|
|
64
70
|
defineObjectForm({
|
|
65
71
|
objectSchema: Assistant.Chat,
|
|
66
|
-
getIntent: (_, options) => createIntent(
|
|
72
|
+
getIntent: (_, options) => createIntent(AssistantAction.CreateChat, { space: options.space }),
|
|
67
73
|
}),
|
|
68
74
|
),
|
|
69
75
|
contributes(
|
|
70
76
|
SpaceCapabilities.ObjectForm,
|
|
71
77
|
defineObjectForm({
|
|
72
78
|
objectSchema: Blueprint.Blueprint,
|
|
73
|
-
formSchema:
|
|
74
|
-
getIntent: (props) => createIntent(
|
|
79
|
+
formSchema: AssistantAction.BlueprintForm,
|
|
80
|
+
getIntent: (props) => createIntent(AssistantAction.CreateBlueprint, props),
|
|
75
81
|
}),
|
|
76
82
|
),
|
|
77
83
|
contributes(
|
|
78
84
|
SpaceCapabilities.ObjectForm,
|
|
79
85
|
defineObjectForm({
|
|
80
86
|
objectSchema: Sequence,
|
|
81
|
-
getIntent: () => createIntent(
|
|
87
|
+
getIntent: () => createIntent(AssistantAction.CreateSequence),
|
|
82
88
|
}),
|
|
83
89
|
),
|
|
84
90
|
],
|
|
@@ -92,8 +98,8 @@ export const AssistantPlugin = () =>
|
|
|
92
98
|
id: `${meta.id}/module/on-space-created`,
|
|
93
99
|
activatesOn: SpaceEvents.SpaceCreated,
|
|
94
100
|
activate: () =>
|
|
95
|
-
contributes(SpaceCapabilities.OnSpaceCreated, ({
|
|
96
|
-
createIntent(
|
|
101
|
+
contributes(SpaceCapabilities.OnSpaceCreated, ({ rootCollection, space }) =>
|
|
102
|
+
createIntent(AssistantAction.OnSpaceCreated, { rootCollection, space }),
|
|
97
103
|
),
|
|
98
104
|
}),
|
|
99
105
|
defineModule({
|
|
@@ -113,12 +119,27 @@ export const AssistantPlugin = () =>
|
|
|
113
119
|
activatesBefore: [Events.SetupArtifactDefinition],
|
|
114
120
|
activate: ReactSurface,
|
|
115
121
|
}),
|
|
122
|
+
defineModule({
|
|
123
|
+
id: `${meta.id}/module/ai-model-resolver`,
|
|
124
|
+
activatesOn: AssistantEvents.SetupAiServiceProviders,
|
|
125
|
+
activate: EdgeModelResolver,
|
|
126
|
+
}),
|
|
116
127
|
defineModule({
|
|
117
128
|
id: `${meta.id}/module/ai-service`,
|
|
129
|
+
activatesBefore: [AssistantEvents.SetupAiServiceProviders],
|
|
130
|
+
// TODO(dmaretskyi): This should activate lazily when the AI chat is used.
|
|
118
131
|
activatesOn: Events.Startup,
|
|
119
|
-
activate:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
activate: AiService,
|
|
133
|
+
}),
|
|
134
|
+
defineModule({
|
|
135
|
+
id: `${meta.id}/module/blueprint`,
|
|
136
|
+
activatesOn: Events.SetupArtifactDefinition,
|
|
137
|
+
activate: BlueprintDefinition,
|
|
138
|
+
}),
|
|
139
|
+
defineModule({
|
|
140
|
+
id: `${meta.id}/module/toolkit`,
|
|
141
|
+
// TODO(wittjosiah): Use a different event.
|
|
142
|
+
activatesOn: Events.Startup,
|
|
143
|
+
activate: Toolkit,
|
|
123
144
|
}),
|
|
124
145
|
]);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Effect, Layer } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { AiServiceRouter } from '@dxos/ai';
|
|
8
|
+
import { type PluginContext, contributes } from '@dxos/app-framework';
|
|
9
|
+
|
|
10
|
+
import { AssistantCapabilities } from './capabilities';
|
|
11
|
+
|
|
12
|
+
export default (context: PluginContext) => {
|
|
13
|
+
const resolvers = context.getCapabilities(AssistantCapabilities.AiModelResolver);
|
|
14
|
+
|
|
15
|
+
// TODO(dmaretskyi): Extract function to reduce them.
|
|
16
|
+
const combinedLayer = resolvers.reduce(
|
|
17
|
+
(acc, resolver) => resolver.pipe(Layer.provide(acc)),
|
|
18
|
+
AiServiceRouter.AiModelResolver.fromModelMap(Effect.succeed({})), // Empty resolver as fallback.
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return [
|
|
22
|
+
// TODO(dmaretskyi): Read config from settings.
|
|
23
|
+
contributes(
|
|
24
|
+
AssistantCapabilities.AiServiceLayer,
|
|
25
|
+
AiServiceRouter.AiModelResolver.buildAiService.pipe(Layer.provide(combinedLayer)),
|
|
26
|
+
),
|
|
27
|
+
];
|
|
28
|
+
};
|
|
@@ -7,24 +7,24 @@ import { Option, pipe } from 'effect';
|
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
Capabilities,
|
|
10
|
-
contributes,
|
|
11
|
-
createIntent,
|
|
12
10
|
LayoutAction,
|
|
13
|
-
type PromiseIntentDispatcher,
|
|
14
11
|
type PluginContext,
|
|
12
|
+
type PromiseIntentDispatcher,
|
|
13
|
+
contributes,
|
|
14
|
+
createIntent,
|
|
15
15
|
} from '@dxos/app-framework';
|
|
16
16
|
import { Sequence } from '@dxos/conductor';
|
|
17
17
|
import { Obj } from '@dxos/echo';
|
|
18
18
|
import { invariant } from '@dxos/invariant';
|
|
19
19
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
21
|
+
import { ROOT_ID, createExtension } from '@dxos/plugin-graph';
|
|
22
22
|
import { getActiveSpace, rxFromQuery } from '@dxos/plugin-space';
|
|
23
23
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
24
|
-
import {
|
|
24
|
+
import { Filter, Query, type QueryResult, type Space, fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
|
|
25
25
|
|
|
26
26
|
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
27
|
-
import { Assistant } from '../types';
|
|
27
|
+
import { Assistant, AssistantAction } from '../types';
|
|
28
28
|
|
|
29
29
|
export default (context: PluginContext) =>
|
|
30
30
|
contributes(Capabilities.AppGraphBuilder, [
|
|
@@ -162,7 +162,7 @@ const getOrCreateChat = async (
|
|
|
162
162
|
return chats[chats.length - 1];
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
const { data } = await dispatch(createIntent(
|
|
165
|
+
const { data } = await dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
166
166
|
invariant(Obj.instanceOf(Assistant.Chat, data?.object));
|
|
167
167
|
await dispatch(createIntent(SpaceAction.AddObject, { target: space, object: data.object }));
|
|
168
168
|
return data.object;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { ToolId } from '@dxos/ai';
|
|
6
|
+
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
7
|
+
import { templates } from '@dxos/assistant';
|
|
8
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
9
|
+
|
|
10
|
+
import { analysis, list, load } from '../functions';
|
|
11
|
+
|
|
12
|
+
const functions = [analysis, list, load];
|
|
13
|
+
const tools: string[] = [
|
|
14
|
+
'get-schemas',
|
|
15
|
+
'create-record',
|
|
16
|
+
// 'open-item'
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default () => {
|
|
20
|
+
return [
|
|
21
|
+
contributes(
|
|
22
|
+
Capabilities.BlueprintDefinition,
|
|
23
|
+
Blueprint.make({
|
|
24
|
+
key: 'dxos.org/blueprint/assistant',
|
|
25
|
+
name: 'Assistant',
|
|
26
|
+
instructions: templates.system,
|
|
27
|
+
tools: [...functions.map((tool) => ToolId.make(tool.name)), ...tools.map((tool) => ToolId.make(tool))],
|
|
28
|
+
}),
|
|
29
|
+
),
|
|
30
|
+
contributes(Capabilities.Functions, functions),
|
|
31
|
+
];
|
|
32
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Layer } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { type AiService, type AiServiceRouter } from '@dxos/ai';
|
|
8
|
+
import { defineCapability } from '@dxos/app-framework';
|
|
9
|
+
|
|
10
|
+
import { meta } from '../meta';
|
|
11
|
+
|
|
12
|
+
export namespace AssistantCapabilities {
|
|
13
|
+
export type AiServiceLayer = Layer.Layer<AiService.AiService>;
|
|
14
|
+
export const AiServiceLayer = defineCapability<AiServiceLayer>(`${meta.id}/capability/ai-service-factory`);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Plugins can contribute them to provide model resolvers.
|
|
18
|
+
*/
|
|
19
|
+
export const AiModelResolver = defineCapability<Layer.Layer<AiServiceRouter.AiModelResolver>>(
|
|
20
|
+
`${meta.id}/capability/ai-model-resolver`,
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { AnthropicClient } from '@effect/ai-anthropic';
|
|
6
|
+
import { FetchHttpClient } from '@effect/platform';
|
|
7
|
+
import { Layer } from 'effect';
|
|
8
|
+
|
|
9
|
+
import { AiServiceRouter } from '@dxos/ai';
|
|
10
|
+
import { contributes } from '@dxos/app-framework';
|
|
11
|
+
|
|
12
|
+
import { AssistantCapabilities } from './capabilities';
|
|
13
|
+
|
|
14
|
+
export default () => {
|
|
15
|
+
return [
|
|
16
|
+
contributes(
|
|
17
|
+
AssistantCapabilities.AiModelResolver,
|
|
18
|
+
AiServiceRouter.AnthropicResolver.pipe(
|
|
19
|
+
Layer.provide(
|
|
20
|
+
AnthropicClient.layer({
|
|
21
|
+
// TODO(dmaretskyi): Read endpoint from config/settings.
|
|
22
|
+
apiUrl: 'https://ai-service.dxos.workers.dev/provider/anthropic',
|
|
23
|
+
}),
|
|
24
|
+
),
|
|
25
|
+
Layer.provide(FetchHttpClient.layer),
|
|
26
|
+
),
|
|
27
|
+
),
|
|
28
|
+
];
|
|
29
|
+
};
|
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
+
export * from './capabilities';
|
|
8
|
+
|
|
9
|
+
export const AiService = lazy(() => import('./ai-service'));
|
|
7
10
|
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
11
|
+
export const BlueprintDefinition = lazy(() => import('./blueprint-definition'));
|
|
12
|
+
export const EdgeModelResolver = lazy(() => import('./edge-model-resolver'));
|
|
8
13
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
9
14
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
10
15
|
export const Settings = lazy(() => import('./settings'));
|
|
16
|
+
export const Toolkit = lazy(() => import('./toolkit'));
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import { Effect } from 'effect';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createIntent, createResolver
|
|
8
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
+
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
9
9
|
import { Sequence } from '@dxos/conductor';
|
|
10
10
|
import { Key, Obj, Ref } from '@dxos/echo';
|
|
11
11
|
import { CollectionAction } from '@dxos/plugin-space/types';
|
|
12
12
|
|
|
13
|
-
import { Assistant } from '../types';
|
|
13
|
+
import { Assistant, AssistantAction } from '../types';
|
|
14
14
|
|
|
15
15
|
export default (context: PluginContext) => [
|
|
16
16
|
contributes(Capabilities.IntentResolver, [
|
|
17
17
|
createResolver({
|
|
18
|
-
intent:
|
|
18
|
+
intent: AssistantAction.OnSpaceCreated,
|
|
19
19
|
resolve: ({ space, rootCollection }) =>
|
|
20
20
|
Effect.gen(function* () {
|
|
21
21
|
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
@@ -26,17 +26,16 @@ export default (context: PluginContext) => [
|
|
|
26
26
|
createIntent(CollectionAction.CreateQueryCollection, { typename: Blueprint.Blueprint.typename }),
|
|
27
27
|
);
|
|
28
28
|
rootCollection.objects.push(Ref.make(chatCollection), Ref.make(blueprintCollection));
|
|
29
|
-
|
|
30
|
-
const { object: chat } = yield* dispatch(createIntent(Assistant.CreateChat, { space }));
|
|
29
|
+
const { object: chat } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
31
30
|
space.db.add(chat);
|
|
32
31
|
|
|
33
32
|
// TODO(wittjosiah): Create default blueprint.
|
|
34
|
-
// const { object: blueprint } = yield* dispatch(createIntent(
|
|
33
|
+
// const { object: blueprint } = yield* dispatch(createIntent(AssistantAction.CreateBlueprint, { ... }));
|
|
35
34
|
// space.db.add(blueprint);
|
|
36
35
|
}),
|
|
37
36
|
}),
|
|
38
37
|
createResolver({
|
|
39
|
-
intent:
|
|
38
|
+
intent: AssistantAction.CreateChat,
|
|
40
39
|
resolve: ({ space, name }) => ({
|
|
41
40
|
data: {
|
|
42
41
|
object: Obj.make(Assistant.Chat, {
|
|
@@ -47,13 +46,15 @@ export default (context: PluginContext) => [
|
|
|
47
46
|
}),
|
|
48
47
|
}),
|
|
49
48
|
createResolver({
|
|
50
|
-
intent:
|
|
51
|
-
resolve: ({ name, description }) => ({
|
|
52
|
-
data: {
|
|
49
|
+
intent: AssistantAction.CreateBlueprint,
|
|
50
|
+
resolve: ({ key, name, description }) => ({
|
|
51
|
+
data: {
|
|
52
|
+
object: Blueprint.make({ key, name, description, instructions: Template.make({ source: '' }) }),
|
|
53
|
+
},
|
|
53
54
|
}),
|
|
54
55
|
}),
|
|
55
56
|
createResolver({
|
|
56
|
-
intent:
|
|
57
|
+
intent: AssistantAction.CreateSequence,
|
|
57
58
|
resolve: ({ name }) => ({
|
|
58
59
|
data: {
|
|
59
60
|
object: Obj.make(Sequence, {
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Effect } from 'effect';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { useCallback, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Capabilities, contributes, createIntent, createSurface, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { Blueprint } from '@dxos/blueprints';
|
|
10
|
-
import {
|
|
10
|
+
import { getSpace } from '@dxos/client/echo';
|
|
11
11
|
import { Sequence } from '@dxos/conductor';
|
|
12
12
|
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
13
|
-
import { Filter,
|
|
13
|
+
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
14
14
|
import { SettingsStore } from '@dxos/local-storage';
|
|
15
15
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
16
16
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
@@ -23,8 +23,9 @@ import {
|
|
|
23
23
|
PromptSettings,
|
|
24
24
|
SequenceContainer,
|
|
25
25
|
} from '../components';
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
26
|
+
import { type AiChatProcessor } from '../hooks';
|
|
27
|
+
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
28
|
+
import { Assistant, AssistantAction } from '../types';
|
|
28
29
|
|
|
29
30
|
export default () =>
|
|
30
31
|
contributes(Capabilities.ReactSurface, [
|
|
@@ -50,15 +51,8 @@ export default () =>
|
|
|
50
51
|
(Obj.instanceOf(Assistant.Chat, data.subject) || data.subject === 'assistant-chat'),
|
|
51
52
|
component: ({ data, role }) => {
|
|
52
53
|
const { dispatch } = useIntentDispatcher();
|
|
53
|
-
const associatedArtifact = useMemo(
|
|
54
|
-
() => ({
|
|
55
|
-
id: fullyQualifiedId(data.companionTo),
|
|
56
|
-
typename: getTypename(data.companionTo) ?? 'unknown',
|
|
57
|
-
spaceId: (getSpace(data.companionTo)?.id ?? 'unknown') as Key.SpaceId,
|
|
58
|
-
}),
|
|
59
|
-
[data.companionTo],
|
|
60
|
-
);
|
|
61
54
|
|
|
55
|
+
// Initialize companion chat if it doesn't exist.
|
|
62
56
|
// TODO(wittjosiah): Factor out to container.
|
|
63
57
|
useEffect(() => {
|
|
64
58
|
const timeout = setTimeout(async () => {
|
|
@@ -72,7 +66,7 @@ export default () =>
|
|
|
72
66
|
}
|
|
73
67
|
|
|
74
68
|
const program = Effect.gen(function* () {
|
|
75
|
-
const { object } = yield* dispatch(createIntent(
|
|
69
|
+
const { object } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
76
70
|
yield* dispatch(createIntent(SpaceAction.AddObject, { object, target: space, hidden: true }));
|
|
77
71
|
yield* dispatch(
|
|
78
72
|
createIntent(SpaceAction.AddRelation, {
|
|
@@ -83,6 +77,7 @@ export default () =>
|
|
|
83
77
|
}),
|
|
84
78
|
);
|
|
85
79
|
});
|
|
80
|
+
|
|
86
81
|
void Effect.runPromise(program);
|
|
87
82
|
}
|
|
88
83
|
});
|
|
@@ -90,11 +85,23 @@ export default () =>
|
|
|
90
85
|
return () => clearTimeout(timeout);
|
|
91
86
|
}, [data.subject]);
|
|
92
87
|
|
|
88
|
+
// TODO(wittjosiah): Factor out to container.
|
|
89
|
+
const handleProcessorReady = useCallback(
|
|
90
|
+
(processor: AiChatProcessor) => {
|
|
91
|
+
if (Obj.instanceOf(Blueprint.Blueprint, data.companionTo)) {
|
|
92
|
+
void processor.context.bind({ blueprints: [Ref.make(data.companionTo)] });
|
|
93
|
+
} else {
|
|
94
|
+
void processor.context.bind({ objects: [Ref.make(data.companionTo)] });
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
[data.companionTo],
|
|
98
|
+
);
|
|
99
|
+
|
|
93
100
|
if (data.subject === 'assistant-chat') {
|
|
94
101
|
return null;
|
|
95
102
|
}
|
|
96
103
|
|
|
97
|
-
return <ChatContainer role={role} chat={data.subject}
|
|
104
|
+
return <ChatContainer role={role} chat={data.subject} onProcessorReady={handleProcessorReady} />;
|
|
98
105
|
},
|
|
99
106
|
}),
|
|
100
107
|
createSurface({
|