@dxos/plugin-assistant 0.8.4-main.2e9d522 → 0.8.4-main.3eb6e50203
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/BlueprintArticle-6SP2ZWJ2.mjs +30 -0
- package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs +200 -0
- package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-QB37VONJ.mjs +73 -0
- package/dist/lib/browser/ChatContainer-QB37VONJ.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs +85 -0
- package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs.map +7 -0
- package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs +266 -0
- package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs +52 -0
- package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs.map +7 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs +22 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs +234 -0
- package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-YAGWYVCL.mjs +14 -0
- package/dist/lib/browser/blueprint-definition-YAGWYVCL.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +12 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- package/dist/lib/browser/chunk-3ETBCBMH.mjs +47 -0
- package/dist/lib/browser/chunk-3ETBCBMH.mjs.map +7 -0
- package/dist/lib/browser/chunk-6BVCG5SJ.mjs +230 -0
- package/dist/lib/browser/chunk-6BVCG5SJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-DKQMSMBN.mjs +326 -0
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
- package/dist/lib/browser/chunk-EXVT7D4B.mjs +23 -0
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
- package/dist/lib/browser/chunk-IJYAKPEU.mjs +286 -0
- package/dist/lib/browser/chunk-IJYAKPEU.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-JA7PUZC7.mjs +1974 -0
- package/dist/lib/browser/chunk-JA7PUZC7.mjs.map +7 -0
- package/dist/lib/browser/chunk-POPBT2AQ.mjs +198 -0
- package/dist/lib/browser/chunk-POPBT2AQ.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs +21 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +310 -156
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs +20 -0
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-2673CFJS.mjs +133 -0
- package/dist/lib/browser/operation-resolver-2673CFJS.mjs.map +7 -0
- package/dist/lib/browser/react-surface-T3FN4GVP.mjs +125 -0
- package/dist/lib/browser/react-surface-T3FN4GVP.mjs.map +7 -0
- package/dist/lib/browser/repair-IRXDYF4R.mjs +51 -0
- package/dist/lib/browser/repair-IRXDYF4R.mjs.map +7 -0
- package/dist/lib/browser/settings-XF6GKHCG.mjs +33 -0
- package/dist/lib/browser/settings-XF6GKHCG.mjs.map +7 -0
- package/dist/lib/browser/state-OYDPWLKA.mjs +26 -0
- package/dist/lib/browser/state-OYDPWLKA.mjs.map +7 -0
- package/dist/lib/browser/toolkit-IDXQCSTX.mjs +19 -0
- package/dist/lib/browser/toolkit-IDXQCSTX.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +11 -4
- package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs +31 -0
- package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs +201 -0
- package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs +74 -0
- package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs.map +7 -0
- package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs +267 -0
- package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs +53 -0
- package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs +23 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs +235 -0
- package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs +15 -0
- package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +13 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs +48 -0
- package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3XC7LQSO.mjs +1975 -0
- package/dist/lib/node-esm/chunk-3XC7LQSO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs +327 -0
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-F6LA7XNS.mjs +199 -0
- package/dist/lib/node-esm/chunk-F6LA7XNS.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-LB72WG6R.mjs +231 -0
- package/dist/lib/node-esm/chunk-LB72WG6R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MJD5XWQV.mjs +288 -0
- package/dist/lib/node-esm/chunk-MJD5XWQV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs +25 -0
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs +22 -0
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +310 -156
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs +21 -0
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs +134 -0
- package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs +126 -0
- package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs.map +7 -0
- package/dist/lib/node-esm/repair-DMI55PON.mjs +52 -0
- package/dist/lib/node-esm/repair-DMI55PON.mjs.map +7 -0
- package/dist/lib/node-esm/settings-NGGZA7S7.mjs +34 -0
- package/dist/lib/node-esm/settings-NGGZA7S7.mjs.map +7 -0
- package/dist/lib/node-esm/state-VSCPGN7R.mjs +27 -0
- package/dist/lib/node-esm/state-VSCPGN7R.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs +20 -0
- package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +11 -4
- package/dist/types/src/AssistantPlugin.d.ts +2 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +11 -0
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +7 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +6 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +26 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +4 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +7 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +11 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +13 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +15 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +18 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +11 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +13 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +6 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +7 -0
- package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/components/Chat/Chat.d.ts +37 -21
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +10 -1
- 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 +16 -8
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts +2 -2
- 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 +5 -6
- 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 +13 -11
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +285 -71
- 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/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 +42 -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/InitiativeContainer.d.ts +9 -0
- package/dist/types/src/components/InitiativeContainer.d.ts.map +1 -0
- package/dist/types/src/components/PromptArticle.d.ts +7 -0
- package/dist/types/src/components/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +3 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +431 -7
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +13 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +428 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +21 -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/Toolbox/Toolbox.d.ts +9 -15
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +432 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts +4 -0
- package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/components/TriggerStatus/index.d.ts +2 -0
- package/dist/types/src/components/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/index.d.ts +2 -0
- package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +10 -7
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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/object-list.d.ts +10 -0
- package/dist/types/src/functions/object-list.d.ts.map +1 -0
- package/dist/types/src/functions/object-load.d.ts +8 -0
- package/dist/types/src/functions/object-load.d.ts.map +1 -0
- package/dist/types/src/functions/object-search.d.ts +10 -0
- package/dist/types/src/functions/object-search.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +8 -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 +10 -20
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +7 -8
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- 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/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.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/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/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +4 -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 +79 -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/processor/update-name.d.ts +10 -0
- package/dist/types/src/processor/update-name.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +8 -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/testing/test-services.d.ts +2 -2
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +376 -37
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +20 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +97 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +33 -0
- package/dist/types/src/types/capabilities.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/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +6 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +14 -213
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +125 -96
- package/src/AssistantPlugin.tsx +159 -88
- package/src/blueprints/assistant-blueprint.ts +57 -0
- package/src/blueprints/index.ts +12 -0
- package/src/capabilities/ai-service/ai-service.ts +30 -0
- package/src/capabilities/ai-service/index.ts +7 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +200 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +74 -0
- package/src/capabilities/blueprint-definition/index.ts +8 -0
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +33 -0
- package/src/capabilities/edge-model-resolver/index.ts +7 -0
- package/src/capabilities/index.ts +11 -6
- package/src/capabilities/local-model-resolver/index.ts +7 -0
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +38 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +112 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +111 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/repair/repair.ts +62 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +27 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/toolkit/toolkit.ts +27 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +92 -77
- package/src/components/BlueprintArticle.tsx +28 -0
- package/src/components/Chat/Chat.tsx +267 -197
- package/src/components/Chat/events.ts +14 -1
- package/src/components/ChatCompanion.tsx +226 -0
- package/src/components/ChatContainer.tsx +56 -33
- package/src/components/ChatDialog.tsx +30 -19
- package/src/components/ChatProgress/ChatProgress.tsx +53 -0
- package/src/components/{SequenceEditor → ChatProgress}/index.ts +1 -1
- package/src/components/ChatPrompt/ChatActions.tsx +19 -27
- package/src/components/ChatPrompt/ChatOptions.tsx +238 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +32 -38
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +123 -116
- package/src/components/ChatThread/ChatThread.tsx +75 -36
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/registry.tsx +174 -0
- package/src/components/ChatThread/sync.test.ts +97 -0
- package/src/components/ChatThread/sync.ts +154 -0
- package/src/components/ChatThread/testing/thread.md +37 -0
- package/src/components/InitiativeContainer.tsx +340 -0
- package/src/components/PromptArticle.tsx +49 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +40 -19
- package/src/components/TemplateEditor/TemplateEditor.tsx +33 -52
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +30 -17
- package/src/components/TemplateEditor/TemplateForm.tsx +82 -32
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
- package/src/components/TemplateEditor/extensions/index.ts +6 -0
- package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
- package/src/components/ToolBlock/ToolBlock.tsx +143 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +18 -28
- package/src/components/Toolbox/Toolbox.tsx +70 -102
- package/src/components/TriggerStatus/TriggerStatus.tsx +142 -0
- package/src/components/TriggerStatus/index.ts +5 -0
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
- package/src/components/Typewriter/Typewriter.tsx +54 -0
- package/src/components/Typewriter/assistant-extension.tsx +144 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/components/index.ts +14 -9
- package/src/functions/index.ts +7 -0
- package/src/functions/object-list.ts +49 -0
- package/src/functions/object-load.ts +44 -0
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/index.ts +8 -4
- package/src/hooks/useBlueprintRegistry.ts +105 -0
- package/src/hooks/useChatProcessor.ts +40 -105
- package/src/hooks/useChatServices.ts +31 -75
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +32 -0
- package/src/hooks/useContextObjects.ts +46 -0
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +15 -12
- package/src/index.ts +2 -1
- package/src/meta.ts +11 -8
- package/src/processor/index.ts +7 -0
- package/src/{hooks → processor}/presets.ts +16 -8
- package/src/processor/processor.test.ts +72 -0
- package/src/processor/processor.ts +301 -0
- package/src/processor/update-name.ts +58 -0
- package/src/queue-logger.ts +17 -18
- package/src/testing/index.ts +1 -1
- package/src/testing/test-generator.ts +262 -0
- package/src/testing/test-sequence.ts +2 -27
- package/src/testing/test-services.ts +10 -14
- package/src/translations.ts +71 -28
- package/src/types/Assistant.ts +28 -0
- package/src/types/AssistantAction.ts +76 -0
- package/src/types/capabilities.ts +27 -0
- package/src/types/defs.ts +5 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +9 -1
- package/src/types/service.ts +25 -14
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs +0 -54
- package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs +0 -72
- package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs +0 -162
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs +0 -27
- 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/browser/settings-2DGP3UTS.mjs +0 -22
- package/dist/lib/browser/settings-2DGP3UTS.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs +0 -55
- package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs +0 -73
- package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs +0 -163
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs +0 -28
- 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/lib/node-esm/settings-47RYZOU4.mjs +0 -23
- package/dist/lib/node-esm/settings-47RYZOU4.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/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/PromptSettings.d.ts +0 -6
- package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
- package/dist/types/src/components/SequenceContainer.d.ts +0 -8
- package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -8
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
- package/dist/types/src/components/SequenceEditor/index.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/events.d.ts +0 -4
- package/dist/types/src/events.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/stories/Chat.stories.d.ts +0 -249
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -3
- package/dist/types/src/testing/test-functions.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/capabilities/app-graph-builder.ts +0 -253
- package/src/capabilities/intent-resolver.ts +0 -58
- package/src/capabilities/react-surface.tsx +0 -138
- package/src/capabilities/settings.ts +0 -19
- 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/PromptSettings.tsx +0 -89
- package/src/components/SequenceContainer.tsx +0 -132
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -32
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/components/TemplateContainer.tsx +0 -24
- package/src/events.ts +0 -11
- 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/stories/Chat.stories.tsx +0 -378
- package/src/testing/test-functions.ts +0 -11
- 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
|
@@ -19,6 +19,9 @@ export type ChatEvent =
|
|
|
19
19
|
type: 'submit';
|
|
20
20
|
text: string;
|
|
21
21
|
}
|
|
22
|
+
| {
|
|
23
|
+
type: 'retry';
|
|
24
|
+
}
|
|
22
25
|
| {
|
|
23
26
|
type: 'cancel';
|
|
24
27
|
}
|
|
@@ -28,14 +31,24 @@ export type ChatEvent =
|
|
|
28
31
|
}
|
|
29
32
|
| {
|
|
30
33
|
type: 'add';
|
|
31
|
-
object: Obj.
|
|
34
|
+
object: Obj.Unknown;
|
|
32
35
|
}
|
|
33
36
|
//
|
|
34
37
|
// UX
|
|
35
38
|
//
|
|
39
|
+
| {
|
|
40
|
+
type: 'update-prompt';
|
|
41
|
+
text: string;
|
|
42
|
+
}
|
|
36
43
|
| {
|
|
37
44
|
type: 'scroll-to-bottom';
|
|
38
45
|
}
|
|
46
|
+
| {
|
|
47
|
+
type: 'nav-previous';
|
|
48
|
+
}
|
|
49
|
+
| {
|
|
50
|
+
type: 'nav-next';
|
|
51
|
+
}
|
|
39
52
|
| {
|
|
40
53
|
type: 'thread-open';
|
|
41
54
|
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Array from 'effect/Array';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { useAtomCapability, useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
11
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
12
|
+
import { Chat } from '@dxos/assistant-toolkit';
|
|
13
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
14
|
+
import { getSpace } from '@dxos/client/echo';
|
|
15
|
+
import { DXN, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
16
|
+
import { SpaceOperation } from '@dxos/plugin-space/types';
|
|
17
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
18
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
19
|
+
|
|
20
|
+
import { ChatContainer, type ChatEvent } from '../components';
|
|
21
|
+
import { useBlueprintRegistry, useContextBinder } from '../hooks';
|
|
22
|
+
import { Assistant, AssistantCapabilities, AssistantOperation } from '../types';
|
|
23
|
+
|
|
24
|
+
export type ChatCompanionProps = {
|
|
25
|
+
role?: string;
|
|
26
|
+
data: {
|
|
27
|
+
subject: Chat.Chat | 'assistant-chat';
|
|
28
|
+
companionTo: Obj.Unknown;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
33
|
+
({ role, data }: ChatCompanionProps, forwardedRef) => {
|
|
34
|
+
const { invokePromise } = useOperationInvoker();
|
|
35
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
36
|
+
const companionTo = data.companionTo;
|
|
37
|
+
|
|
38
|
+
const space = getSpace(companionTo);
|
|
39
|
+
const [chat, setChat] = useState(data.subject === 'assistant-chat' ? undefined : data.subject);
|
|
40
|
+
|
|
41
|
+
// Watch the state atom directly to detect when plus button clears the chat selection.
|
|
42
|
+
const state = useAtomCapability(AssistantCapabilities.State);
|
|
43
|
+
const companionToId = Obj.getDXN(companionTo).toString();
|
|
44
|
+
const currentChatState = state?.currentChat[companionToId];
|
|
45
|
+
|
|
46
|
+
// Track if initial setup has been done (to distinguish initial mount from plus button click).
|
|
47
|
+
// Reset when companionTo changes.
|
|
48
|
+
const initialSetupDoneRef = useRef(false);
|
|
49
|
+
const prevCompanionToIdRef = useRef(companionToId);
|
|
50
|
+
if (prevCompanionToIdRef.current !== companionToId) {
|
|
51
|
+
initialSetupDoneRef.current = false;
|
|
52
|
+
prevCompanionToIdRef.current = companionToId;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Sync local chat state with the state atom.
|
|
56
|
+
// When currentChatState is undefined (plus button clicked), reset local chat.
|
|
57
|
+
// When data.subject is a Chat object, use it directly.
|
|
58
|
+
// When currentChatState is a different chat, fetch and set it.
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
// If state says no chat selected AND current chat is persisted, reset local state (handles plus button click).
|
|
61
|
+
// Don't reset in-memory chats - they're expected to have currentChatState === undefined.
|
|
62
|
+
if (!currentChatState && chat && getSpace(chat)) {
|
|
63
|
+
setChat(undefined);
|
|
64
|
+
} else if (data.subject !== 'assistant-chat') {
|
|
65
|
+
// If data.subject is a Chat object (resolved from graph), use it.
|
|
66
|
+
setChat(data.subject);
|
|
67
|
+
} else if (currentChatState && space) {
|
|
68
|
+
// currentChatState is set but graph couldn't resolve it - fetch manually.
|
|
69
|
+
const currentChatDxnStr = chat ? Obj.getDXN(chat).toString() : undefined;
|
|
70
|
+
if (currentChatState !== currentChatDxnStr) {
|
|
71
|
+
// Parse DXN and fetch the chat object from the database.
|
|
72
|
+
const parsedDxn = DXN.tryParse(currentChatState);
|
|
73
|
+
if (parsedDxn) {
|
|
74
|
+
const chatRef = space.db.makeRef(parsedDxn);
|
|
75
|
+
const resolvedChat = chatRef?.target;
|
|
76
|
+
if (Obj.instanceOf(Assistant.Chat, resolvedChat)) {
|
|
77
|
+
setChat(resolvedChat);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}, [currentChatState, data.subject, space, chat]);
|
|
83
|
+
|
|
84
|
+
const chatQueue = space && chat ? space.queues.get(chat.queue.dxn) : undefined;
|
|
85
|
+
const binder = useContextBinder(chatQueue);
|
|
86
|
+
|
|
87
|
+
// Initialize companion chat if it doesn't exist, but don't add it to the space immediately.
|
|
88
|
+
useAsyncEffect(async () => {
|
|
89
|
+
if (!space || chat) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Only query for existing chats on initial mount, not when plus button is clicked.
|
|
94
|
+
if (!initialSetupDoneRef.current) {
|
|
95
|
+
// Query for existing companion chats linked to this object.
|
|
96
|
+
const existingChats = await space.db
|
|
97
|
+
.query(Query.select(Filter.id(companionTo.id)).targetOf(Chat.CompanionTo).source())
|
|
98
|
+
.run();
|
|
99
|
+
|
|
100
|
+
initialSetupDoneRef.current = true;
|
|
101
|
+
|
|
102
|
+
// Use existing chat if found on initial mount.
|
|
103
|
+
if (existingChats.length > 0) {
|
|
104
|
+
const existingChat = existingChats.at(-1) as Assistant.Chat;
|
|
105
|
+
setChat(existingChat);
|
|
106
|
+
await invokePromise(AssistantOperation.SetCurrentChat, { companionTo, chat: existingChat });
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Create chat in-memory only - it will be added to space on first message.
|
|
112
|
+
const { data: createResult } = await invokePromise(AssistantOperation.CreateChat, {
|
|
113
|
+
db: space.db,
|
|
114
|
+
addToSpace: false,
|
|
115
|
+
});
|
|
116
|
+
setChat(createResult?.object);
|
|
117
|
+
}, [chat, space, companionTo, invokePromise]);
|
|
118
|
+
|
|
119
|
+
// Add chat to space and create relation when user submits the first message.
|
|
120
|
+
const handleEvent = useCallback(
|
|
121
|
+
async (event: ChatEvent) => {
|
|
122
|
+
if (!chat || !space) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// If chat is not in space yet, persist it on first submit.
|
|
127
|
+
if (event.type === 'submit' && !getSpace(chat)) {
|
|
128
|
+
await invokePromise(SpaceOperation.AddObject, {
|
|
129
|
+
object: chat,
|
|
130
|
+
target: space.db,
|
|
131
|
+
hidden: true,
|
|
132
|
+
});
|
|
133
|
+
await invokePromise(SpaceOperation.AddRelation, {
|
|
134
|
+
db: space.db,
|
|
135
|
+
schema: Chat.CompanionTo,
|
|
136
|
+
source: chat,
|
|
137
|
+
target: companionTo,
|
|
138
|
+
});
|
|
139
|
+
await invokePromise(AssistantOperation.SetCurrentChat, {
|
|
140
|
+
companionTo,
|
|
141
|
+
chat,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
[chat, space, companionTo, invokePromise],
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
const metadata = useCapabilities(AppCapabilities.Metadata);
|
|
149
|
+
const blueprintKeys = useMemo(
|
|
150
|
+
() =>
|
|
151
|
+
Function.pipe(
|
|
152
|
+
metadata,
|
|
153
|
+
Array.findFirst(
|
|
154
|
+
(
|
|
155
|
+
capability,
|
|
156
|
+
): capability is {
|
|
157
|
+
id: string;
|
|
158
|
+
metadata: { blueprints?: string[] };
|
|
159
|
+
} => capability.id === Obj.getTypename(companionTo),
|
|
160
|
+
),
|
|
161
|
+
Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)),
|
|
162
|
+
Option.getOrElse(() => [] as string[]),
|
|
163
|
+
),
|
|
164
|
+
[metadata, companionTo],
|
|
165
|
+
);
|
|
166
|
+
const existingBlueprints = useQuery(space?.db, Filter.type(Blueprint.Blueprint));
|
|
167
|
+
const pluginBlueprints = useMemo(
|
|
168
|
+
() => existingBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)),
|
|
169
|
+
[existingBlueprints, blueprintKeys],
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
// Initialize related blueprints that are not already in the space.
|
|
173
|
+
useAsyncEffect(async () => {
|
|
174
|
+
if (!space) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// NOTE: This must be run instead of using the useQuery result to avoid duplicates.
|
|
179
|
+
const existingBlueprints = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
180
|
+
for (const key of blueprintKeys) {
|
|
181
|
+
const existingBlueprint = existingBlueprints.find((blueprint) => blueprint.key === key);
|
|
182
|
+
if (existingBlueprint) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const blueprint = blueprintRegistry.getByKey(key);
|
|
187
|
+
if (!blueprint) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
space.db.add(Obj.clone(blueprint, { deep: true }));
|
|
192
|
+
}
|
|
193
|
+
}, [space, blueprintRegistry, blueprintKeys]);
|
|
194
|
+
|
|
195
|
+
useAsyncEffect(async () => {
|
|
196
|
+
if (!binder?.isOpen) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (pluginBlueprints.length > 0) {
|
|
201
|
+
await binder.bind({
|
|
202
|
+
blueprints: pluginBlueprints.map((blueprint) => Ref.make(blueprint)),
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (Obj.instanceOf(Blueprint.Blueprint, companionTo)) {
|
|
207
|
+
await binder.bind({ blueprints: [Ref.make(companionTo)] });
|
|
208
|
+
} else {
|
|
209
|
+
await binder.bind({ objects: [Ref.make(companionTo)] });
|
|
210
|
+
}
|
|
211
|
+
}, [binder, companionTo, blueprintKeys]);
|
|
212
|
+
|
|
213
|
+
return (
|
|
214
|
+
<ChatContainer
|
|
215
|
+
role={role}
|
|
216
|
+
space={space}
|
|
217
|
+
subject={chat}
|
|
218
|
+
companionTo={companionTo}
|
|
219
|
+
onEvent={handleEvent}
|
|
220
|
+
ref={forwardedRef}
|
|
221
|
+
/>
|
|
222
|
+
);
|
|
223
|
+
},
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
export default ChatCompanion;
|
|
@@ -2,44 +2,67 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import { type
|
|
9
|
-
import { getSpace } from '@dxos/client/echo';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { useChatProcessor, useChatServices } from '../hooks';
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
5
|
+
import React, { forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useAtomCapability } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
9
|
+
import { type Space, getSpace } from '@dxos/client/echo';
|
|
10
|
+
import { type Obj } from '@dxos/echo';
|
|
11
|
+
import { Layout } from '@dxos/react-ui';
|
|
12
|
+
|
|
13
|
+
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
|
|
14
|
+
import { AssistantCapabilities, type ChatType } from '../types';
|
|
15
|
+
|
|
16
|
+
import { Chat as ChatComponent, type ChatRootProps } from './Chat';
|
|
17
|
+
|
|
18
|
+
export type ChatContainerProps = SurfaceComponentProps<
|
|
19
|
+
ChatType.Chat | undefined,
|
|
20
|
+
{
|
|
21
|
+
space?: Space;
|
|
22
|
+
companionTo?: Obj.Unknown;
|
|
23
|
+
} & Pick<ChatRootProps, 'onEvent'>
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export const ChatContainer = forwardRef<HTMLDivElement, ChatContainerProps>((props, forwardedRef) => {
|
|
27
|
+
const { role, subject: chat, space: spaceProp, companionTo, onEvent } = props;
|
|
28
|
+
const space = spaceProp ?? getSpace(chat);
|
|
29
|
+
const settings = useAtomCapability(AssistantCapabilities.Settings);
|
|
30
|
+
const services = useChatServices({ id: space?.id, chat });
|
|
31
|
+
const [online, setOnline] = useOnline();
|
|
32
|
+
const { preset, ...chatProps } = usePresets(online);
|
|
33
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
34
|
+
const processor = useChatProcessor({
|
|
35
|
+
space,
|
|
36
|
+
chat,
|
|
37
|
+
preset,
|
|
38
|
+
services,
|
|
39
|
+
blueprintRegistry,
|
|
40
|
+
settings,
|
|
41
|
+
});
|
|
42
|
+
|
|
28
43
|
if (!processor) {
|
|
29
44
|
return null;
|
|
30
45
|
}
|
|
31
46
|
|
|
32
|
-
// TODO(burdon): Add attention attributes.
|
|
33
47
|
return (
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
<Layout.Main toolbar role={role} ref={forwardedRef}>
|
|
49
|
+
<ChatComponent.Root db={space?.db} chat={chat} processor={processor} onEvent={onEvent}>
|
|
50
|
+
<ChatComponent.Toolbar companionTo={companionTo} />
|
|
51
|
+
<ChatComponent.Viewport classNames='container-max-width'>
|
|
52
|
+
<ChatComponent.Thread />
|
|
53
|
+
<div role='none' className='p-4'>
|
|
54
|
+
<ChatComponent.Prompt
|
|
55
|
+
{...chatProps}
|
|
56
|
+
outline
|
|
57
|
+
preset={preset?.id}
|
|
58
|
+
online={online}
|
|
59
|
+
onOnlineChange={setOnline}
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</ChatComponent.Viewport>
|
|
63
|
+
</ChatComponent.Root>
|
|
64
|
+
</Layout.Main>
|
|
42
65
|
);
|
|
43
|
-
};
|
|
66
|
+
});
|
|
44
67
|
|
|
45
68
|
export default ChatContainer;
|
|
@@ -4,27 +4,38 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useAtomCapability } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type Chat as ChatTypes } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { ChatDialog as
|
|
11
|
+
import { ChatDialog as NaturalChatDialog } from '@dxos/react-ui-chat';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
-
import { useChatProcessor, useChatServices } from '../hooks';
|
|
13
|
+
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
|
|
14
14
|
import { meta } from '../meta';
|
|
15
|
-
import {
|
|
15
|
+
import { AssistantCapabilities } from '../types';
|
|
16
|
+
|
|
17
|
+
import { Chat, type ChatRootProps } from './Chat';
|
|
16
18
|
|
|
17
19
|
export type ChatDialogProps = {
|
|
18
|
-
chat?:
|
|
20
|
+
chat?: ChatTypes.Chat;
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
22
24
|
const { t } = useTranslation(meta.id);
|
|
23
25
|
|
|
24
|
-
const
|
|
25
|
-
const settings =
|
|
26
|
-
const services = useChatServices({
|
|
27
|
-
const
|
|
26
|
+
const db = chat && Obj.getDatabase(chat);
|
|
27
|
+
const settings = useAtomCapability(AssistantCapabilities.Settings);
|
|
28
|
+
const services = useChatServices({ id: db?.spaceId, chat });
|
|
29
|
+
const [online, setOnline] = useOnline();
|
|
30
|
+
const { preset, ...chatProps } = usePresets(online);
|
|
31
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
32
|
+
const processor = useChatProcessor({
|
|
33
|
+
chat,
|
|
34
|
+
preset,
|
|
35
|
+
services,
|
|
36
|
+
blueprintRegistry,
|
|
37
|
+
settings,
|
|
38
|
+
});
|
|
28
39
|
|
|
29
40
|
// TODO(burdon): Refocus when open.
|
|
30
41
|
const [open, setOpen] = useState(true);
|
|
@@ -48,15 +59,15 @@ export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
|
48
59
|
|
|
49
60
|
return (
|
|
50
61
|
<Chat.Root chat={chat} processor={processor} onEvent={handleEvent}>
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
<
|
|
62
|
+
<NaturalChatDialog.Root open={open} expanded={expanded} onOpenChange={setOpen}>
|
|
63
|
+
<NaturalChatDialog.Header title={t('assistant dialog title')} />
|
|
64
|
+
<NaturalChatDialog.Content>
|
|
54
65
|
<Chat.Thread />
|
|
55
|
-
</
|
|
56
|
-
<
|
|
57
|
-
<Chat.Prompt expandable />
|
|
58
|
-
</
|
|
59
|
-
</
|
|
66
|
+
</NaturalChatDialog.Content>
|
|
67
|
+
<NaturalChatDialog.Footer classNames='p-1.5'>
|
|
68
|
+
<Chat.Prompt {...chatProps} preset={preset?.id} online={online} onOnlineChange={setOnline} expandable />
|
|
69
|
+
</NaturalChatDialog.Footer>
|
|
70
|
+
</NaturalChatDialog.Root>
|
|
60
71
|
</Chat.Root>
|
|
61
72
|
);
|
|
62
73
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Chat } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { addEventListener } from '@dxos/async';
|
|
9
|
+
import { ProgressBar, type ProgressBarProps, TextCrawl, useExecutionGraph } from '@dxos/react-ui-components';
|
|
10
|
+
|
|
11
|
+
export type ChatProgressProps = {
|
|
12
|
+
chat: Chat.Chat;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const ChatProgress = ({ chat }: ChatProgressProps) => {
|
|
16
|
+
const { commits } = useExecutionGraph(chat.traceQueue?.target, true);
|
|
17
|
+
const nodes = useMemo(() => commits.map((commit) => ({ id: commit.id, message: commit.message })), [commits]);
|
|
18
|
+
const lines = useMemo(() => commits.map((commit) => commit.message), [commits]);
|
|
19
|
+
|
|
20
|
+
const [index, setIndex] = useState<number | undefined>(undefined);
|
|
21
|
+
const handleSelect = useCallback<NonNullable<ProgressBarProps['onSelect']>>(({ index }) => {
|
|
22
|
+
setIndex((current) => {
|
|
23
|
+
return current === index ? undefined : index;
|
|
24
|
+
});
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!ref.current) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return addEventListener(ref.current, 'keydown', (event) => {
|
|
34
|
+
switch (event.key) {
|
|
35
|
+
case 'ArrowLeft': {
|
|
36
|
+
setIndex((current) => (current === undefined || current <= 0 ? 0 : current - 1));
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
case 'ArrowRight': {
|
|
40
|
+
setIndex((current) => (current === undefined || current >= nodes.length ? nodes.length - 1 : current + 1));
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}, [nodes.length]);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div role='none' tabIndex={0} ref={ref} className='flex flex-col outline-none'>
|
|
49
|
+
<ProgressBar nodes={nodes} index={index} onSelect={handleSelect} />
|
|
50
|
+
<TextCrawl classNames='pis-4 text-sm text-description' lines={lines} autoAdvance />
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { type PropsWithChildren } from 'react';
|
|
6
6
|
|
|
7
7
|
import { IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { mx } from '@dxos/
|
|
8
|
+
import { mx } from '@dxos/ui-theme';
|
|
9
9
|
|
|
10
10
|
import { meta } from '../../meta';
|
|
11
11
|
import { type ChatEvent } from '../Chat';
|
|
@@ -26,46 +26,38 @@ export const ChatActions = ({ classNames, children, microphone, recording, proce
|
|
|
26
26
|
<div className={mx('flex items-center mie-1', classNames)}>
|
|
27
27
|
{children}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
label={t('button cancel processing')}
|
|
38
|
-
onClick={() => onEvent?.({ type: 'cancel' })}
|
|
39
|
-
/>
|
|
40
|
-
)) || (
|
|
41
|
-
<IconButton
|
|
42
|
-
disabled
|
|
43
|
-
classNames='px-1.5'
|
|
44
|
-
variant='ghost'
|
|
45
|
-
size={5}
|
|
46
|
-
icon='ph--arrow-down--regular'
|
|
47
|
-
iconOnly
|
|
48
|
-
label={t('button scroll down')}
|
|
49
|
-
onClick={() => onEvent?.({ type: 'scroll-to-bottom' })}
|
|
50
|
-
/>
|
|
51
|
-
)}
|
|
29
|
+
<IconButton
|
|
30
|
+
disabled={!processing}
|
|
31
|
+
variant='ghost'
|
|
32
|
+
icon='ph--x--regular'
|
|
33
|
+
iconOnly
|
|
34
|
+
label={t('cancel processing button')}
|
|
35
|
+
onClick={() => onEvent?.({ type: 'cancel' })}
|
|
36
|
+
/>
|
|
52
37
|
|
|
53
38
|
{microphone && (
|
|
54
39
|
<IconButton
|
|
55
40
|
disabled={!processing}
|
|
56
|
-
classNames={mx(
|
|
41
|
+
classNames={mx(recording && 'bg-primary-500')}
|
|
57
42
|
variant='ghost'
|
|
58
|
-
size={5}
|
|
59
43
|
icon='ph--microphone--regular'
|
|
60
44
|
iconOnly
|
|
61
45
|
noTooltip
|
|
62
|
-
label={t('button
|
|
46
|
+
label={t('microphone button')}
|
|
63
47
|
onMouseDown={() => onEvent?.({ type: 'record-start' })}
|
|
64
48
|
onMouseUp={() => onEvent?.({ type: 'record-stop' })}
|
|
65
49
|
onTouchStart={() => onEvent?.({ type: 'record-start' })}
|
|
66
50
|
onTouchEnd={() => onEvent?.({ type: 'record-stop' })}
|
|
67
51
|
/>
|
|
68
52
|
)}
|
|
53
|
+
|
|
54
|
+
<IconButton
|
|
55
|
+
variant='ghost'
|
|
56
|
+
icon='ph--wrench--regular'
|
|
57
|
+
iconOnly
|
|
58
|
+
label={t('debug button')}
|
|
59
|
+
onClick={() => onEvent?.({ type: 'toggle-debug' })}
|
|
60
|
+
/>
|
|
69
61
|
</div>
|
|
70
62
|
);
|
|
71
63
|
};
|