@dxos/plugin-assistant 0.8.4-main.c1de068 → 0.8.4-main.c4373fc
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-TO35YXHT.mjs} +11 -9
- package/dist/lib/browser/BlueprintContainer-TO35YXHT.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-ZIKNUUSU.mjs +127 -0
- package/dist/lib/browser/ChatCompanion-ZIKNUUSU.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs → ChatContainer-MA5BVDGH.mjs} +33 -14
- package/dist/lib/browser/ChatContainer-MA5BVDGH.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs → ChatDialog-7OXLIWZI.mjs} +26 -12
- package/dist/lib/browser/ChatDialog-7OXLIWZI.mjs.map +7 -0
- package/dist/lib/browser/{SequenceContainer-3UDVKWPA.mjs → SequenceContainer-2FEWMQGW.mjs} +7 -19
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs.map +7 -0
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +19 -0
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-VKFRYY2N.mjs +154 -0
- package/dist/lib/browser/app-graph-builder-VKFRYY2N.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs.map +7 -0
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs +175 -0
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-43I2LR6O.mjs +216 -0
- package/dist/lib/browser/chunk-43I2LR6O.mjs.map +7 -0
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs +16 -0
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-5RICKAMN.mjs +18 -0
- package/dist/lib/browser/chunk-5RICKAMN.mjs.map +7 -0
- package/dist/lib/browser/chunk-B2RCJXEO.mjs +202 -0
- package/dist/lib/browser/chunk-B2RCJXEO.mjs.map +7 -0
- package/dist/lib/browser/chunk-BRJMNZOS.mjs +169 -0
- package/dist/lib/browser/chunk-BRJMNZOS.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-P5P7QXBS.mjs +296 -0
- package/dist/lib/browser/chunk-P5P7QXBS.mjs.map +7 -0
- package/dist/lib/browser/chunk-UDH4MR7H.mjs +1744 -0
- package/dist/lib/browser/chunk-UDH4MR7H.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +18 -0
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +161 -68
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-5LB25ZRN.mjs +112 -0
- package/dist/lib/browser/intent-resolver-5LB25ZRN.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +17 -0
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-WQZXU624.mjs +107 -0
- package/dist/lib/browser/react-surface-WQZXU624.mjs.map +7 -0
- package/dist/lib/browser/{settings-2DGP3UTS.mjs → settings-4B2NA4CE.mjs} +8 -7
- package/dist/lib/{node-esm/settings-47RYZOU4.mjs.map → browser/settings-4B2NA4CE.mjs.map} +1 -1
- package/dist/lib/browser/state-LXTS54DI.mjs +21 -0
- package/dist/lib/browser/state-LXTS54DI.mjs.map +7 -0
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs +199 -0
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -4
- package/dist/lib/node-esm/{TemplateContainer-A3NAQCZE.mjs → BlueprintContainer-J664LTU3.mjs} +11 -9
- package/dist/lib/node-esm/BlueprintContainer-J664LTU3.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-YDXJIVCF.mjs +128 -0
- package/dist/lib/node-esm/ChatCompanion-YDXJIVCF.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs → ChatContainer-WLTOQLHH.mjs} +33 -14
- package/dist/lib/node-esm/ChatContainer-WLTOQLHH.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs → ChatDialog-ADKF62SY.mjs} +26 -12
- package/dist/lib/node-esm/ChatDialog-ADKF62SY.mjs.map +7 -0
- package/dist/lib/node-esm/{SequenceContainer-RQQH5XOC.mjs → SequenceContainer-PGGJUQ46.mjs} +7 -19
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +20 -0
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-K6AYO4YM.mjs +155 -0
- package/dist/lib/node-esm/app-graph-builder-K6AYO4YM.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs +20 -0
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DBDKOC3I.mjs +203 -0
- package/dist/lib/node-esm/chunk-DBDKOC3I.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs +217 -0
- package/dist/lib/node-esm/chunk-DSE2IILK.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-I7BZMIAG.mjs +170 -0
- package/dist/lib/node-esm/chunk-I7BZMIAG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TBQOICXZ.mjs +297 -0
- package/dist/lib/node-esm/chunk-TBQOICXZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs +177 -0
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UPPSDTOJ.mjs +1745 -0
- package/dist/lib/node-esm/chunk-UPPSDTOJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs +17 -0
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +19 -0
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +161 -68
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-I64MNI4C.mjs +113 -0
- package/dist/lib/node-esm/intent-resolver-I64MNI4C.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +18 -0
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-TVVVRIR3.mjs +108 -0
- package/dist/lib/node-esm/react-surface-TVVVRIR3.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-47RYZOU4.mjs → settings-7Y3CRASE.mjs} +8 -7
- package/dist/lib/{browser/settings-2DGP3UTS.mjs.map → node-esm/settings-7Y3CRASE.mjs.map} +1 -1
- package/dist/lib/node-esm/state-BO6GUFLB.mjs +22 -0
- package/dist/lib/node-esm/state-BO6GUFLB.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs +200 -0
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -4
- package/dist/types/src/AssistantPlugin.d.ts +1 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +4 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +7 -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 +4 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +11 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +4 -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 +20 -17
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +13 -0
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +4 -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/ChatProgress/ChatProgress.d.ts +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +4 -5
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.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/ChatThread.d.ts +10 -7
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +115 -75
- 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/reducers.d.ts +40 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.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 +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +264 -3
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +262 -7
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +3 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +259 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +11 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -9
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +262 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -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/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/index.d.ts +7 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +25 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -21
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -6
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
- package/dist/types/src/hooks/useItemTypes.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/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +3 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +3 -3
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +74 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/stories/Chat.stories.d.ts +29 -246
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/stories/QueryEditor.stories.d.ts +7 -0
- package/dist/types/src/stories/QueryEditor.stories.d.ts.map +1 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +4 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/DebugCard.d.ts +8 -0
- package/dist/types/src/stories/components/DebugCard.d.ts.map +1 -0
- package/dist/types/src/stories/components/ExecutionGraphContainer.d.ts +7 -0
- package/dist/types/src/stories/components/ExecutionGraphContainer.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/InvocationsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts +4 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ProjectContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ProjectContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts +6 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ScriptContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ScriptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +4 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +18 -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/testing/data.d.ts +9 -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/schema.d.ts +7 -0
- package/dist/types/src/stories/testing/schema.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +51 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +14 -0
- package/dist/types/src/testing/test-data.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-generator.d.ts +7 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +29 -22
- 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 +107 -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 +15 -12
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +113 -92
- package/src/AssistantPlugin.tsx +151 -82
- package/src/capabilities/ai-service.ts +27 -0
- package/src/capabilities/app-graph-builder.ts +47 -137
- package/src/capabilities/blueprint-definition.ts +64 -0
- package/src/capabilities/capabilities.ts +18 -0
- package/src/capabilities/edge-model-resolver.ts +25 -0
- package/src/capabilities/index.ts +9 -0
- package/src/capabilities/intent-resolver.ts +51 -15
- package/src/capabilities/local-model-resolver.ts +30 -0
- package/src/capabilities/react-surface.tsx +17 -64
- package/src/capabilities/state.ts +20 -0
- package/src/capabilities/toolkit.ts +168 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +83 -76
- package/src/components/BlueprintContainer.tsx +24 -0
- package/src/components/Chat/Chat.tsx +180 -176
- package/src/components/Chat/events.ts +7 -0
- package/src/components/ChatCompanion.tsx +114 -0
- package/src/components/ChatContainer.tsx +19 -13
- package/src/components/ChatDialog.tsx +18 -14
- package/src/components/ChatProgress/ChatProgress.tsx +67 -0
- package/src/components/ChatProgress/index.ts +5 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -24
- package/src/components/ChatPrompt/ChatOptions.tsx +225 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +31 -36
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +98 -112
- package/src/components/ChatThread/ChatThread.tsx +65 -29
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/reducers.ts +151 -0
- package/src/components/ChatThread/registry.tsx +184 -0
- package/src/components/ChatThread/sync.test.ts +81 -0
- package/src/components/ChatThread/sync.ts +113 -0
- package/src/components/PromptSettings.tsx +1 -0
- package/src/components/SequenceContainer.tsx +29 -30
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +11 -8
- package/src/components/SequenceEditor/SequenceEditor.tsx +3 -3
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +28 -17
- package/src/components/TemplateEditor/TemplateEditor.tsx +21 -52
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +18 -13
- package/src/components/TemplateEditor/TemplateForm.tsx +7 -4
- package/src/components/TemplateEditor/handlebars-extension.ts +165 -0
- package/src/components/ToolBlock/ToolBlock.tsx +152 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbar/Toolbar.tsx +21 -0
- package/src/components/Toolbar/index.ts +5 -0
- package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +13 -22
- package/src/components/Toolbox/Toolbox.tsx +21 -51
- package/src/components/index.ts +4 -5
- package/src/events.ts +2 -2
- package/src/functions/analysis.ts +22 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +48 -0
- package/src/functions/load.ts +46 -0
- package/src/hooks/index.ts +7 -4
- package/src/hooks/useBlueprintRegistry.ts +94 -0
- package/src/hooks/useChatProcessor.ts +21 -98
- package/src/hooks/useChatServices.ts +29 -71
- package/src/hooks/useContextBinder.ts +18 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +11 -9
- package/src/meta.ts +4 -6
- package/src/processor/index.ts +6 -0
- package/src/{hooks → processor}/presets.ts +15 -7
- package/src/processor/processor.test.ts +81 -0
- package/src/processor/processor.ts +303 -0
- package/src/queue-logger.ts +10 -10
- package/src/stories/Chat.stories.tsx +818 -314
- package/src/stories/QueryEditor.stories.tsx +114 -0
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +74 -0
- package/src/stories/components/ChessContainer.tsx +17 -0
- package/src/stories/components/CommentsContainer.tsx +25 -0
- package/src/stories/components/DebugCard.tsx +61 -0
- package/src/stories/components/ExecutionGraphContainer.tsx +30 -0
- package/src/stories/components/GraphContainer.tsx +106 -0
- package/src/stories/components/InvocationsContainer.tsx +17 -0
- package/src/stories/components/MessageContainer.tsx +22 -0
- package/src/stories/components/ProjectContainer.tsx +17 -0
- package/src/stories/components/PromptContainer.tsx +52 -0
- package/src/stories/components/ResearchInputStack.tsx +30 -0
- package/src/stories/components/ResearchOutputStack.tsx +29 -0
- package/src/stories/components/ScriptContainer.tsx +28 -0
- package/src/stories/components/TasksContainer.tsx +47 -0
- package/src/stories/components/TokenManagerContainer.tsx +14 -0
- package/src/stories/components/TriggersContainer.tsx +12 -0
- package/src/stories/components/index.ts +22 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/testing/data.ts +135 -0
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/schema.ts +17 -0
- package/src/stories/testing/testing.tsx +291 -0
- package/src/testing/index.ts +3 -1
- package/src/testing/test-data.ts +248 -0
- package/src/testing/test-functions.ts +8 -3
- package/src/testing/test-generator.ts +261 -0
- package/src/testing/test-sequence.ts +2 -27
- package/src/translations.ts +32 -22
- package/src/types/Assistant.ts +61 -0
- package/src/types/AssistantAction.ts +62 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -1
- package/src/types/service.ts +2 -2
- package/src/vite-env.d.ts +30 -0
- 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 +0 -223
- package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEAEKWOC.mjs +0 -98
- 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-FDCJSQYF.mjs.map +0 -7
- 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 +0 -2245
- package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs +0 -60
- package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-66VY37YQ.mjs +0 -150
- 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 +0 -224
- package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2XL6MNPE.mjs +0 -99
- 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-QN2H2EHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs +0 -2246
- package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs +0 -61
- package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs +0 -151
- 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/ChatThread/ChatMessage.d.ts +0 -17
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.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.d.ts +0 -86
- package/dist/types/src/hooks/chat-processor.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/presets.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/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.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/ChatThread/ChatMessage.tsx +0 -268
- package/src/components/ChatThread/ToolBlock.tsx +0 -121
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/TemplateContainer.tsx +0 -24
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/chat-processor.ts +0 -314
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -95
- package/src/typings.d.ts +0 -9
|
@@ -3,37 +3,31 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
Capabilities,
|
|
10
|
-
contributes,
|
|
11
|
-
createIntent,
|
|
12
11
|
LayoutAction,
|
|
13
|
-
type PromiseIntentDispatcher,
|
|
14
12
|
type PluginContext,
|
|
13
|
+
type PromiseIntentDispatcher,
|
|
14
|
+
contributes,
|
|
15
|
+
createIntent,
|
|
15
16
|
} from '@dxos/app-framework';
|
|
16
|
-
import { Template } from '@dxos/blueprints';
|
|
17
17
|
import { Sequence } from '@dxos/conductor';
|
|
18
18
|
import { Obj } from '@dxos/echo';
|
|
19
19
|
import { invariant } from '@dxos/invariant';
|
|
20
20
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
21
|
-
import {
|
|
22
|
-
import { createExtension,
|
|
23
|
-
import { getActiveSpace
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
type Space,
|
|
27
|
-
Filter,
|
|
28
|
-
Query,
|
|
29
|
-
type QueryResult,
|
|
30
|
-
fullyQualifiedId,
|
|
31
|
-
getSpace,
|
|
32
|
-
isSpace,
|
|
33
|
-
} from '@dxos/react-client/echo';
|
|
21
|
+
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
22
|
+
import { ROOT_ID, createExtension, rxFromSignal } from '@dxos/plugin-graph';
|
|
23
|
+
import { getActiveSpace } from '@dxos/plugin-space';
|
|
24
|
+
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
25
|
+
import { Query, type Space, fullyQualifiedId } from '@dxos/react-client/echo';
|
|
34
26
|
|
|
35
27
|
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
36
|
-
import { Assistant } from '../types';
|
|
28
|
+
import { Assistant, AssistantAction } from '../types';
|
|
29
|
+
|
|
30
|
+
import { AssistantCapabilities } from './capabilities';
|
|
37
31
|
|
|
38
32
|
export default (context: PluginContext) =>
|
|
39
33
|
contributes(Capabilities.AppGraphBuilder, [
|
|
@@ -41,7 +35,7 @@ export default (context: PluginContext) =>
|
|
|
41
35
|
id: `${meta.id}/assistant`,
|
|
42
36
|
actions: (node) =>
|
|
43
37
|
Rx.make((get) =>
|
|
44
|
-
pipe(
|
|
38
|
+
Function.pipe(
|
|
45
39
|
get(node),
|
|
46
40
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
47
41
|
Option.map(() => [
|
|
@@ -88,44 +82,36 @@ export default (context: PluginContext) =>
|
|
|
88
82
|
}),
|
|
89
83
|
|
|
90
84
|
createExtension({
|
|
91
|
-
id: `${meta.id}/
|
|
85
|
+
id: `${meta.id}/companion-chat`,
|
|
92
86
|
connector: (node) => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
label: ['assistant chat label', { ns: meta.id }],
|
|
122
|
-
icon: 'ph--sparkle--regular',
|
|
123
|
-
position: 'hoist',
|
|
124
|
-
disposition: 'hidden',
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
];
|
|
128
|
-
});
|
|
87
|
+
return Rx.make((get) =>
|
|
88
|
+
Function.pipe(
|
|
89
|
+
get(node),
|
|
90
|
+
Option.flatMap((node) => (Obj.isObject(node.data) ? Option.some(node.data) : Option.none())),
|
|
91
|
+
Option.map((object) => {
|
|
92
|
+
const currentChat = get(
|
|
93
|
+
rxFromSignal(
|
|
94
|
+
() => context.getCapability(AssistantCapabilities.State).currentChat[fullyQualifiedId(object)],
|
|
95
|
+
),
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
return [
|
|
99
|
+
{
|
|
100
|
+
id: [fullyQualifiedId(object), 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
101
|
+
type: PLANK_COMPANION_TYPE,
|
|
102
|
+
data: currentChat ?? 'assistant-chat',
|
|
103
|
+
properties: {
|
|
104
|
+
label: ['assistant chat label', { ns: meta.id }],
|
|
105
|
+
icon: 'ph--sparkle--regular',
|
|
106
|
+
position: 'hoist',
|
|
107
|
+
disposition: 'hidden',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
}),
|
|
112
|
+
Option.getOrElse(() => []),
|
|
113
|
+
),
|
|
114
|
+
);
|
|
129
115
|
},
|
|
130
116
|
}),
|
|
131
117
|
|
|
@@ -133,7 +119,7 @@ export default (context: PluginContext) =>
|
|
|
133
119
|
id: `${meta.id}/sequence-logs`,
|
|
134
120
|
connector: (node) =>
|
|
135
121
|
Rx.make((get) =>
|
|
136
|
-
pipe(
|
|
122
|
+
Function.pipe(
|
|
137
123
|
get(node),
|
|
138
124
|
Option.flatMap((node) => (Obj.instanceOf(Sequence, node.data) ? Option.some(node) : Option.none())),
|
|
139
125
|
Option.map((node) => [
|
|
@@ -152,81 +138,6 @@ export default (context: PluginContext) =>
|
|
|
152
138
|
),
|
|
153
139
|
),
|
|
154
140
|
}),
|
|
155
|
-
|
|
156
|
-
createExtension({
|
|
157
|
-
id: `${meta.id}/root`,
|
|
158
|
-
connector: (node) => {
|
|
159
|
-
let query: QueryResult<Template.Template> | undefined;
|
|
160
|
-
return Rx.make((get) =>
|
|
161
|
-
pipe(
|
|
162
|
-
get(node),
|
|
163
|
-
Option.flatMap((node) =>
|
|
164
|
-
node.type === SPACE_TYPE && isSpace(node.data) ? Option.some(node.data) : Option.none(),
|
|
165
|
-
),
|
|
166
|
-
Option.map((space) => {
|
|
167
|
-
if (!query) {
|
|
168
|
-
query = space.db.query(Query.type(Template.Template));
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const templates = get(rxFromQuery(query));
|
|
172
|
-
return templates.length > 0
|
|
173
|
-
? [
|
|
174
|
-
{
|
|
175
|
-
id: `${meta.id}/templates`,
|
|
176
|
-
type: `${meta.id}/templates`,
|
|
177
|
-
data: null,
|
|
178
|
-
properties: {
|
|
179
|
-
label: ['templates label', { ns: meta.id }],
|
|
180
|
-
icon: 'ph--file-code--regular',
|
|
181
|
-
space,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
]
|
|
185
|
-
: [];
|
|
186
|
-
}),
|
|
187
|
-
Option.getOrElse(() => []),
|
|
188
|
-
),
|
|
189
|
-
);
|
|
190
|
-
},
|
|
191
|
-
}),
|
|
192
|
-
|
|
193
|
-
createExtension({
|
|
194
|
-
id: `${meta.id}/templates`,
|
|
195
|
-
connector: (node) => {
|
|
196
|
-
let query: QueryResult<Template.Template> | undefined;
|
|
197
|
-
return Rx.make((get) =>
|
|
198
|
-
pipe(
|
|
199
|
-
get(node),
|
|
200
|
-
Option.flatMap((node) =>
|
|
201
|
-
node.id === `${meta.id}/templates` && isSpace(node.properties.space)
|
|
202
|
-
? Option.some(node.properties.space)
|
|
203
|
-
: Option.none(),
|
|
204
|
-
),
|
|
205
|
-
Option.map((space) => {
|
|
206
|
-
if (!query) {
|
|
207
|
-
query = space.db.query(Query.type(Template.Template));
|
|
208
|
-
}
|
|
209
|
-
return get(rxFromQuery(query))
|
|
210
|
-
.toSorted((a, b) => {
|
|
211
|
-
const nameA = a.name ?? '';
|
|
212
|
-
const nameB = b.name ?? '';
|
|
213
|
-
return nameA.localeCompare(nameB);
|
|
214
|
-
})
|
|
215
|
-
.map((template) => ({
|
|
216
|
-
id: fullyQualifiedId(template),
|
|
217
|
-
type: `${meta.id}/template`,
|
|
218
|
-
data: template,
|
|
219
|
-
properties: {
|
|
220
|
-
label: template.name ?? ['object placeholder', { ns: meta.id }],
|
|
221
|
-
icon: 'ph--file-code--regular',
|
|
222
|
-
},
|
|
223
|
-
}));
|
|
224
|
-
}),
|
|
225
|
-
Option.getOrElse(() => []),
|
|
226
|
-
),
|
|
227
|
-
);
|
|
228
|
-
},
|
|
229
|
-
}),
|
|
230
141
|
]);
|
|
231
142
|
|
|
232
143
|
// TODO(burdon): Factor out.
|
|
@@ -239,14 +150,13 @@ const getOrCreateChat = async (
|
|
|
239
150
|
const { objects: relatedChats } = await space.db
|
|
240
151
|
.query(Query.type(Assistant.Chat).sourceOf(Assistant.CompanionTo).source())
|
|
241
152
|
.run();
|
|
153
|
+
|
|
242
154
|
const chats = allChats.filter((chat) => !relatedChats.includes(chat));
|
|
243
|
-
// console.log('objects', JSON.stringify(objects, null, 2));
|
|
244
155
|
if (chats.length > 0) {
|
|
245
|
-
|
|
246
|
-
return chats[chats.length - 1];
|
|
156
|
+
return chats.at(-1);
|
|
247
157
|
}
|
|
248
158
|
|
|
249
|
-
const { data } = await dispatch(createIntent(
|
|
159
|
+
const { data } = await dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
250
160
|
invariant(Obj.instanceOf(Assistant.Chat, data?.object));
|
|
251
161
|
await dispatch(createIntent(SpaceAction.AddObject, { target: space, object: data.object }));
|
|
252
162
|
return data.object;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
6
|
+
import { templates } from '@dxos/assistant';
|
|
7
|
+
import {
|
|
8
|
+
DISCORD_BLUEPRINT,
|
|
9
|
+
LINEAR_BLUEPRINT,
|
|
10
|
+
RESEARCH_BLUEPRINT,
|
|
11
|
+
WEB_SEARCH_BLUEPRINT,
|
|
12
|
+
agent,
|
|
13
|
+
createResearchNote,
|
|
14
|
+
entityExtraction,
|
|
15
|
+
fetchDiscordMessages,
|
|
16
|
+
research,
|
|
17
|
+
syncLinearIssues,
|
|
18
|
+
} from '@dxos/assistant-testing';
|
|
19
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
20
|
+
import { type FunctionDefinition } from '@dxos/functions';
|
|
21
|
+
|
|
22
|
+
import { analysis, list, load } from '../functions';
|
|
23
|
+
|
|
24
|
+
const functions: FunctionDefinition[] = [analysis, list, load];
|
|
25
|
+
const tools = [
|
|
26
|
+
'add-to-context',
|
|
27
|
+
// TODO(wittjosiah): Factor out to an ECHO blueprint.
|
|
28
|
+
'get-schemas',
|
|
29
|
+
'add-schema',
|
|
30
|
+
'create-record',
|
|
31
|
+
// TODO(wittjosiah): Factor out to a generic app-framework blueprint.
|
|
32
|
+
'open-item',
|
|
33
|
+
// TODO(burdon): Anthropic only.
|
|
34
|
+
// https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool#example-str-replace-command
|
|
35
|
+
// AI_TOOL_NOT_FOUND: str_replace_based_edit_tool
|
|
36
|
+
// 'str_replace_based_edit_tool',
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export const BLUEPRINT_KEY = 'dxos.org/blueprint/assistant';
|
|
40
|
+
|
|
41
|
+
export const createBlueprint = (): Blueprint.Blueprint =>
|
|
42
|
+
Blueprint.make({
|
|
43
|
+
key: BLUEPRINT_KEY,
|
|
44
|
+
name: 'Assistant',
|
|
45
|
+
tools: Blueprint.toolDefinitions({ functions, tools }),
|
|
46
|
+
instructions: templates.system,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const blueprint = createBlueprint();
|
|
50
|
+
|
|
51
|
+
// TODO(dmaretskyi): Consider splitting into multiple modules.
|
|
52
|
+
export default (): Capability<any>[] => [
|
|
53
|
+
contributes(Capabilities.Functions, functions),
|
|
54
|
+
contributes(Capabilities.Functions, [agent]),
|
|
55
|
+
contributes(Capabilities.Functions, [research, createResearchNote, entityExtraction]),
|
|
56
|
+
contributes(Capabilities.BlueprintDefinition, blueprint),
|
|
57
|
+
contributes(Capabilities.BlueprintDefinition, RESEARCH_BLUEPRINT),
|
|
58
|
+
// TODO(burdon): Move out of assistant.
|
|
59
|
+
contributes(Capabilities.Functions, [syncLinearIssues]),
|
|
60
|
+
contributes(Capabilities.Functions, [fetchDiscordMessages]),
|
|
61
|
+
contributes(Capabilities.BlueprintDefinition, LINEAR_BLUEPRINT),
|
|
62
|
+
contributes(Capabilities.BlueprintDefinition, DISCORD_BLUEPRINT),
|
|
63
|
+
contributes(Capabilities.BlueprintDefinition, WEB_SEARCH_BLUEPRINT),
|
|
64
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
+
import { type DeepReadonly } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
import { meta } from '../meta';
|
|
9
|
+
import { type Assistant } from '../types';
|
|
10
|
+
|
|
11
|
+
export namespace AssistantCapabilities {
|
|
12
|
+
export type AssistantState = {
|
|
13
|
+
/** Map of primary object fq id to current chat. */
|
|
14
|
+
currentChat: Record<string, Assistant.Chat>;
|
|
15
|
+
};
|
|
16
|
+
export const State = defineCapability<DeepReadonly<AssistantState>>(`${meta.id}/capability/state`);
|
|
17
|
+
export const MutableState = defineCapability<AssistantState>(`${meta.id}/capability/state`);
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
|
|
6
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
|
+
|
|
9
|
+
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
+
|
|
12
|
+
export default (): Capability<any>[] => [
|
|
13
|
+
contributes(
|
|
14
|
+
Capabilities.AiModelResolver,
|
|
15
|
+
AiServiceRouter.AnthropicResolver.pipe(
|
|
16
|
+
Layer.provide(
|
|
17
|
+
AnthropicClient.layer({
|
|
18
|
+
// TODO(dmaretskyi): Read endpoint from config/settings.
|
|
19
|
+
apiUrl: 'https://ai-service.dxos.workers.dev/provider/anthropic',
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
Layer.provide(FetchHttpClient.layer),
|
|
23
|
+
),
|
|
24
|
+
),
|
|
25
|
+
];
|
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
+
export const AiService = lazy(() => import('./ai-service'));
|
|
7
8
|
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
9
|
+
export const AssistantState = lazy(() => import('./state'));
|
|
10
|
+
export const BlueprintDefinition = lazy(() => import('./blueprint-definition'));
|
|
11
|
+
export const EdgeModelResolver = lazy(() => import('./edge-model-resolver'));
|
|
8
12
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
13
|
+
export const LocalModelResolver = lazy(() => import('./local-model-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'));
|
|
17
|
+
|
|
18
|
+
export * from './blueprint-definition';
|
|
19
|
+
export * from './capabilities';
|
|
@@ -2,44 +2,72 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createIntent, createResolver
|
|
7
|
+
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
+
import { AiContextBinder } from '@dxos/assistant';
|
|
9
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
10
|
+
import { fullyQualifiedId } from '@dxos/client/echo';
|
|
8
11
|
import { Sequence } from '@dxos/conductor';
|
|
9
|
-
import { Key, Obj, Ref } from '@dxos/echo';
|
|
12
|
+
import { Filter, Key, Obj, Ref } from '@dxos/echo';
|
|
10
13
|
import { CollectionAction } from '@dxos/plugin-space/types';
|
|
11
14
|
|
|
12
|
-
import { Assistant } from '../types';
|
|
15
|
+
import { Assistant, AssistantAction } from '../types';
|
|
16
|
+
|
|
17
|
+
import { BLUEPRINT_KEY, createBlueprint } from './blueprint-definition';
|
|
18
|
+
import { AssistantCapabilities } from './capabilities';
|
|
13
19
|
|
|
14
20
|
export default (context: PluginContext) => [
|
|
15
21
|
contributes(Capabilities.IntentResolver, [
|
|
16
22
|
createResolver({
|
|
17
|
-
intent:
|
|
23
|
+
intent: AssistantAction.onCreateSpace,
|
|
18
24
|
resolve: ({ space, rootCollection }) =>
|
|
19
25
|
Effect.gen(function* () {
|
|
20
26
|
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
21
|
-
const { object:
|
|
27
|
+
const { object: chatCollection } = yield* dispatch(
|
|
22
28
|
createIntent(CollectionAction.CreateQueryCollection, { typename: Assistant.Chat.typename }),
|
|
23
29
|
);
|
|
24
|
-
|
|
30
|
+
const { object: blueprintCollection } = yield* dispatch(
|
|
31
|
+
createIntent(CollectionAction.CreateQueryCollection, { typename: Blueprint.Blueprint.typename }),
|
|
32
|
+
);
|
|
33
|
+
rootCollection.objects.push(Ref.make(chatCollection), Ref.make(blueprintCollection));
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
// Create default chat.
|
|
36
|
+
const { object: chat } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
27
37
|
space.db.add(chat);
|
|
28
38
|
}),
|
|
29
39
|
}),
|
|
30
40
|
createResolver({
|
|
31
|
-
intent:
|
|
32
|
-
resolve: ({ space, name }) =>
|
|
41
|
+
intent: AssistantAction.CreateChat,
|
|
42
|
+
resolve: async ({ space, name }) => {
|
|
43
|
+
const queue = space.queues.create();
|
|
44
|
+
const chat = Obj.make(Assistant.Chat, { name, queue: Ref.fromDXN(queue.dxn) });
|
|
45
|
+
const { objects: blueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
46
|
+
// TODO(wittjosiah): This should be a space-level setting.
|
|
47
|
+
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
48
|
+
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === BLUEPRINT_KEY);
|
|
49
|
+
if (!defaultBlueprint) {
|
|
50
|
+
defaultBlueprint = space.db.add(createBlueprint());
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const binder = new AiContextBinder(queue);
|
|
54
|
+
await binder.bind({ blueprints: [Ref.make(defaultBlueprint)] });
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
data: { object: chat },
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
createResolver({
|
|
62
|
+
intent: AssistantAction.CreateBlueprint,
|
|
63
|
+
resolve: ({ key, name, description }) => ({
|
|
33
64
|
data: {
|
|
34
|
-
object:
|
|
35
|
-
name,
|
|
36
|
-
queue: Ref.fromDXN(space.queues.create().dxn),
|
|
37
|
-
}),
|
|
65
|
+
object: Blueprint.make({ key, name, description, instructions: Template.make({ source: '' }) }),
|
|
38
66
|
},
|
|
39
67
|
}),
|
|
40
68
|
}),
|
|
41
69
|
createResolver({
|
|
42
|
-
intent:
|
|
70
|
+
intent: AssistantAction.CreateSequence,
|
|
43
71
|
resolve: ({ name }) => ({
|
|
44
72
|
data: {
|
|
45
73
|
object: Obj.make(Sequence, {
|
|
@@ -54,5 +82,13 @@ export default (context: PluginContext) => [
|
|
|
54
82
|
},
|
|
55
83
|
}),
|
|
56
84
|
}),
|
|
85
|
+
createResolver({
|
|
86
|
+
intent: AssistantAction.SetCurrentChat,
|
|
87
|
+
resolve: ({ companionTo, chat }) =>
|
|
88
|
+
Effect.gen(function* () {
|
|
89
|
+
const state = context.getCapability(AssistantCapabilities.MutableState);
|
|
90
|
+
state.currentChat[fullyQualifiedId(companionTo)] = chat;
|
|
91
|
+
}),
|
|
92
|
+
}),
|
|
57
93
|
]),
|
|
58
94
|
];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as OpenAiClient from '@effect/ai-openai/OpenAiClient';
|
|
6
|
+
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
|
+
|
|
9
|
+
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
10
|
+
import { Capabilities, type Capability, contributes } from '@dxos/app-framework';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* To start LM Studio server:
|
|
14
|
+
* ```bash
|
|
15
|
+
* ~/.lmstudio/bin/lms server start --cors
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export default (): Capability<any>[] => [
|
|
19
|
+
contributes(
|
|
20
|
+
Capabilities.AiModelResolver,
|
|
21
|
+
AiServiceRouter.LMStudioResolver.pipe(
|
|
22
|
+
Layer.provide(
|
|
23
|
+
OpenAiClient.layer({
|
|
24
|
+
apiUrl: AiServiceRouter.LMSTUDIO_ENDPOINT,
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
Layer.provide(FetchHttpClient.layer),
|
|
28
|
+
),
|
|
29
|
+
),
|
|
30
|
+
];
|
|
@@ -2,28 +2,27 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import React, { useEffect, useMemo } from 'react';
|
|
5
|
+
import React from 'react';
|
|
7
6
|
|
|
8
|
-
import { Capabilities, contributes,
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
9
|
+
import { getSpace } from '@dxos/client/echo';
|
|
11
10
|
import { Sequence } from '@dxos/conductor';
|
|
12
11
|
import { InvocationTraceContainer } from '@dxos/devtools';
|
|
13
|
-
import {
|
|
12
|
+
import { Obj } from '@dxos/echo';
|
|
14
13
|
import { SettingsStore } from '@dxos/local-storage';
|
|
15
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
16
14
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
17
15
|
|
|
18
16
|
import {
|
|
19
17
|
AssistantSettings,
|
|
18
|
+
BlueprintContainer,
|
|
19
|
+
ChatCompanion,
|
|
20
20
|
ChatContainer,
|
|
21
21
|
ChatDialog,
|
|
22
22
|
PromptSettings,
|
|
23
23
|
SequenceContainer,
|
|
24
|
-
TemplateContainer,
|
|
25
24
|
} from '../components';
|
|
26
|
-
import {
|
|
25
|
+
import { ASSISTANT_DIALOG, meta } from '../meta';
|
|
27
26
|
import { Assistant } from '../types';
|
|
28
27
|
|
|
29
28
|
export default () =>
|
|
@@ -43,59 +42,12 @@ export default () =>
|
|
|
43
42
|
component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
|
|
44
43
|
}),
|
|
45
44
|
createSurface({
|
|
46
|
-
id: `${meta.id}/
|
|
45
|
+
id: `${meta.id}/companion-chat`,
|
|
47
46
|
role: 'article',
|
|
48
47
|
filter: (data): data is { companionTo: Obj.Any; subject: Assistant.Chat | 'assistant-chat' } =>
|
|
49
48
|
Obj.isObject(data.companionTo) &&
|
|
50
49
|
(Obj.instanceOf(Assistant.Chat, data.subject) || data.subject === 'assistant-chat'),
|
|
51
|
-
component: ({ data, role }) => {
|
|
52
|
-
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
|
-
|
|
62
|
-
// TODO(wittjosiah): Factor out to container.
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
const timeout = setTimeout(async () => {
|
|
65
|
-
const space = getSpace(data.companionTo);
|
|
66
|
-
if (space && data.subject === 'assistant-chat') {
|
|
67
|
-
const result = await space.db
|
|
68
|
-
.query(Query.select(Filter.ids(data.companionTo.id)).targetOf(Assistant.CompanionTo).source())
|
|
69
|
-
.run();
|
|
70
|
-
if (result.objects.length > 0) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const program = Effect.gen(function* () {
|
|
75
|
-
const { object } = yield* dispatch(createIntent(Assistant.CreateChat, { space }));
|
|
76
|
-
yield* dispatch(createIntent(SpaceAction.AddObject, { object, target: space, hidden: true }));
|
|
77
|
-
yield* dispatch(
|
|
78
|
-
createIntent(SpaceAction.AddRelation, {
|
|
79
|
-
space,
|
|
80
|
-
schema: Assistant.CompanionTo,
|
|
81
|
-
source: object,
|
|
82
|
-
target: data.companionTo,
|
|
83
|
-
}),
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
void Effect.runPromise(program);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
return () => clearTimeout(timeout);
|
|
91
|
-
}, [data.subject]);
|
|
92
|
-
|
|
93
|
-
if (data.subject === 'assistant-chat') {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return <ChatContainer role={role} chat={data.subject} artifact={associatedArtifact} />;
|
|
98
|
-
},
|
|
50
|
+
component: ({ data, role }) => <ChatCompanion role={role} data={data} />,
|
|
99
51
|
}),
|
|
100
52
|
createSurface({
|
|
101
53
|
id: `${meta.id}/sequence`,
|
|
@@ -104,10 +56,11 @@ export default () =>
|
|
|
104
56
|
component: ({ data }) => <SequenceContainer sequence={data.subject} />,
|
|
105
57
|
}),
|
|
106
58
|
createSurface({
|
|
107
|
-
id: `${meta.id}/companion
|
|
59
|
+
id: `${meta.id}/companion-logs`,
|
|
108
60
|
role: 'article',
|
|
109
61
|
filter: (data): data is { companionTo: Sequence } =>
|
|
110
62
|
Obj.instanceOf(Sequence, data.companionTo) && data.subject === 'logs',
|
|
63
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
111
64
|
component: ({ data, role }) => {
|
|
112
65
|
const space = getSpace(data.companionTo);
|
|
113
66
|
return (
|
|
@@ -118,16 +71,16 @@ export default () =>
|
|
|
118
71
|
},
|
|
119
72
|
}),
|
|
120
73
|
createSurface({
|
|
121
|
-
id: `${meta.id}/
|
|
74
|
+
id: `${meta.id}/blueprint`,
|
|
122
75
|
role: 'article',
|
|
123
|
-
filter: (data): data is { subject:
|
|
124
|
-
component: ({ data }) => <
|
|
76
|
+
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
77
|
+
component: ({ data }) => <BlueprintContainer blueprint={data.subject} />,
|
|
125
78
|
}),
|
|
126
79
|
createSurface({
|
|
127
80
|
id: `${meta.id}/prompt-settings`,
|
|
128
81
|
role: 'object-settings',
|
|
129
|
-
filter: (data): data is { subject:
|
|
130
|
-
component: ({ data }) => <PromptSettings template={data.subject} />,
|
|
82
|
+
filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
|
|
83
|
+
component: ({ data }) => <PromptSettings template={data.subject.instructions} />,
|
|
131
84
|
}),
|
|
132
85
|
createSurface({
|
|
133
86
|
id: ASSISTANT_DIALOG,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { contributes } from '@dxos/app-framework';
|
|
6
|
+
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
|
+
|
|
8
|
+
import { meta } from '../meta';
|
|
9
|
+
|
|
10
|
+
import { AssistantCapabilities } from './capabilities';
|
|
11
|
+
|
|
12
|
+
export default () => {
|
|
13
|
+
// NOTE: This needs to be a chat object rather than a string id to avoid a query race.
|
|
14
|
+
// TODO(wittjosiah): Handle serialization and hydration for this so it can be cached.
|
|
15
|
+
const state = new LocalStorageStore<AssistantCapabilities.AssistantState>(meta.id, {
|
|
16
|
+
currentChat: {},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return contributes(AssistantCapabilities.State, state.values, () => state.close());
|
|
20
|
+
};
|