@dxos/plugin-assistant 0.8.3 → 0.8.4-main.1068cf700f
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-JOTRKE7B.mjs +200 -0
- package/dist/lib/browser/ChatCompanion-JOTRKE7B.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-ESDLG5JY.mjs +73 -0
- package/dist/lib/browser/ChatContainer-ESDLG5JY.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-LKY3FTYO.mjs +85 -0
- package/dist/lib/browser/ChatDialog-LKY3FTYO.mjs.map +7 -0
- package/dist/lib/browser/InitiativeContainer-T2SQ4O6J.mjs +267 -0
- package/dist/lib/browser/InitiativeContainer-T2SQ4O6J.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-POPBT2AQ.mjs +198 -0
- package/dist/lib/browser/chunk-POPBT2AQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q4QUMX62.mjs +1974 -0
- package/dist/lib/browser/chunk-Q4QUMX62.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 +329 -207
- 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-I7YJVK4K.mjs +125 -0
- package/dist/lib/browser/react-surface-I7YJVK4K.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 -20
- 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-52OWAARX.mjs +201 -0
- package/dist/lib/node-esm/ChatCompanion-52OWAARX.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-VLWSQ3ZO.mjs +74 -0
- package/dist/lib/node-esm/ChatContainer-VLWSQ3ZO.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-5DUQIF2T.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-5DUQIF2T.mjs.map +7 -0
- package/dist/lib/node-esm/InitiativeContainer-ATD3D23L.mjs +268 -0
- package/dist/lib/node-esm/InitiativeContainer-ATD3D23L.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-75PHXBN3.mjs +327 -0
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ESDMBGF7.mjs +1975 -0
- package/dist/lib/node-esm/chunk-ESDMBGF7.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 +329 -207
- 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-2CWJ6GZW.mjs +126 -0
- package/dist/lib/node-esm/react-surface-2CWJ6GZW.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 -20
- 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 -6
- 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 +6 -4
- 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 +63 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/events.d.ts +39 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +3 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- 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 +17 -9
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts +8 -0
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -0
- 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 +11 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -0
- 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 +11 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +10 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +10 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts +6 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +21 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +455 -0
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -0
- 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/index.d.ts +2 -0
- package/dist/types/src/components/ChatThread/index.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 +5 -8
- 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 +16 -5
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +429 -3
- 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 +13 -12
- 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 +11 -14
- 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 +10 -5
- 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 +13 -11
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +13 -0
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -0
- package/dist/types/src/hooks/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 +7 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -0
- 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/processor/presets.d.ts +13 -0
- 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.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 +5 -5
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -2
- 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 +4 -0
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -0
- 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 +416 -113
- 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 -3
- 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 +127 -92
- package/src/AssistantPlugin.tsx +159 -115
- 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 -9
- 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 +94 -79
- package/src/components/BlueprintArticle.tsx +28 -0
- package/src/components/Chat/Chat.tsx +458 -0
- package/src/components/Chat/events.ts +63 -0
- package/src/components/Chat/index.ts +7 -0
- package/src/components/ChatCompanion.tsx +226 -0
- package/src/components/ChatContainer.tsx +55 -26
- package/src/components/ChatDialog.tsx +75 -0
- package/src/components/ChatProgress/ChatProgress.tsx +53 -0
- package/src/components/{AmbientDialog → ChatProgress}/index.ts +1 -1
- package/src/components/ChatPrompt/ChatActions.tsx +63 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +238 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +29 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +47 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +42 -0
- package/src/components/ChatPrompt/index.ts +9 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +150 -0
- package/src/components/ChatThread/ChatThread.tsx +96 -0
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/{experimental/transcription → components/ChatThread}/index.ts +2 -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 +57 -41
- package/src/components/TemplateEditor/TemplateEditor.tsx +40 -46
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +39 -26
- package/src/components/TemplateEditor/TemplateForm.tsx +121 -79
- 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 -29
- package/src/components/Toolbox/Toolbox.tsx +77 -53
- 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 +16 -12
- 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 +10 -6
- package/src/hooks/useBlueprintRegistry.ts +105 -0
- package/src/hooks/useChatProcessor.ts +78 -0
- package/src/hooks/useChatServices.ts +47 -0
- 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 +58 -0
- package/src/index.ts +2 -1
- package/src/meta.ts +11 -8
- package/src/processor/index.ts +7 -0
- package/src/processor/presets.ts +60 -0
- 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 +23 -24
- package/src/testing/index.ts +2 -2
- package/src/testing/test-generator.ts +262 -0
- package/src/testing/test-sequence.ts +26 -0
- package/src/testing/test-services.ts +10 -14
- package/src/translations.ts +90 -27
- 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 -3
- package/src/types/service.ts +25 -14
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs +0 -47
- package/dist/lib/browser/AssistantDialog-MQOOR364.mjs.map +0 -7
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs +0 -321
- package/dist/lib/browser/BlueprintContainer-AT5Y7EXG.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs +0 -40
- package/dist/lib/browser/ChatContainer-C2NEAS3A.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-QQHVOTSI.mjs +0 -28
- package/dist/lib/browser/TemplateContainer-QQHVOTSI.mjs.map +0 -7
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs +0 -39
- package/dist/lib/browser/ai-client-MK2ZZII2.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-E4H5DCOJ.mjs +0 -225
- package/dist/lib/browser/app-graph-builder-E4H5DCOJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-AAOKC2JN.mjs +0 -208
- package/dist/lib/browser/chunk-AAOKC2JN.mjs.map +0 -7
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs +0 -157
- package/dist/lib/browser/chunk-BI6AHRNJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-JO4W3MF7.mjs +0 -2101
- package/dist/lib/browser/chunk-JO4W3MF7.mjs.map +0 -7
- package/dist/lib/browser/chunk-JQFUME3B.mjs +0 -87
- package/dist/lib/browser/chunk-JQFUME3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-MEGMOFJB.mjs +0 -16
- package/dist/lib/browser/chunk-MEGMOFJB.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs +0 -96
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs.map +0 -7
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs +0 -15
- package/dist/lib/browser/chunk-UE3IZ4PN.mjs.map +0 -7
- package/dist/lib/browser/chunk-XOZ7YMO3.mjs +0 -20
- package/dist/lib/browser/chunk-XOZ7YMO3.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs +0 -43
- package/dist/lib/browser/intent-resolver-3UICTGPM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LXCNUSZN.mjs +0 -159
- package/dist/lib/browser/react-surface-LXCNUSZN.mjs.map +0 -7
- package/dist/lib/browser/settings-XRHXVWGB.mjs +0 -22
- package/dist/lib/browser/settings-XRHXVWGB.mjs.map +0 -7
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs +0 -73
- package/dist/lib/node/AssistantDialog-AN4Z6YUV.cjs.map +0 -7
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs +0 -344
- package/dist/lib/node/BlueprintContainer-NOWLDYCZ.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs +0 -68
- package/dist/lib/node/ChatContainer-VKYBQHUB.cjs.map +0 -7
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs +0 -58
- package/dist/lib/node/TemplateContainer-JZF2DCCG.cjs.map +0 -7
- package/dist/lib/node/ai-client-7HNSMUMT.cjs +0 -53
- package/dist/lib/node/ai-client-7HNSMUMT.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs +0 -235
- package/dist/lib/node/app-graph-builder-PPR5B5KU.cjs.map +0 -7
- package/dist/lib/node/chunk-4EEWTDQK.cjs +0 -117
- package/dist/lib/node/chunk-4EEWTDQK.cjs.map +0 -7
- package/dist/lib/node/chunk-FUAGEO7Q.cjs +0 -52
- package/dist/lib/node/chunk-FUAGEO7Q.cjs.map +0 -7
- package/dist/lib/node/chunk-HRNIUYVQ.cjs +0 -128
- package/dist/lib/node/chunk-HRNIUYVQ.cjs.map +0 -7
- package/dist/lib/node/chunk-IKZBMHSW.cjs +0 -184
- package/dist/lib/node/chunk-IKZBMHSW.cjs.map +0 -7
- package/dist/lib/node/chunk-LMDJEGZ2.cjs +0 -233
- package/dist/lib/node/chunk-LMDJEGZ2.cjs.map +0 -7
- package/dist/lib/node/chunk-NIDICM57.cjs +0 -2080
- package/dist/lib/node/chunk-NIDICM57.cjs.map +0 -7
- package/dist/lib/node/chunk-P74TWGMG.cjs +0 -44
- package/dist/lib/node/chunk-P74TWGMG.cjs.map +0 -7
- package/dist/lib/node/chunk-QGPWY6GW.cjs +0 -34
- package/dist/lib/node/chunk-QGPWY6GW.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -289
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs +0 -58
- package/dist/lib/node/intent-resolver-QSWGTKON.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs +0 -172
- package/dist/lib/node/react-surface-D3NBYRZ6.cjs.map +0 -7
- package/dist/lib/node/settings-2JXLKYGE.cjs +0 -36
- package/dist/lib/node/settings-2JXLKYGE.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -54
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs +0 -48
- package/dist/lib/node-esm/AssistantDialog-6WEMLUPU.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs +0 -322
- package/dist/lib/node-esm/BlueprintContainer-STOJAVML.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs +0 -41
- package/dist/lib/node-esm/ChatContainer-3MVBTUJN.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-SOEWY2ZN.mjs +0 -29
- package/dist/lib/node-esm/TemplateContainer-SOEWY2ZN.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs +0 -40
- package/dist/lib/node-esm/ai-client-XGZBJ6BE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-3SY5MBIK.mjs +0 -226
- package/dist/lib/node-esm/app-graph-builder-3SY5MBIK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs +0 -18
- package/dist/lib/node-esm/chunk-34EX6E5Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3UEZLJ2V.mjs +0 -16
- package/dist/lib/node-esm/chunk-3UEZLJ2V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BB2TAT4P.mjs +0 -22
- package/dist/lib/node-esm/chunk-BB2TAT4P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs +0 -98
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs +0 -209
- package/dist/lib/node-esm/chunk-J6UXXZGJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OD574YIU.mjs +0 -2102
- package/dist/lib/node-esm/chunk-OD574YIU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OYN6HLXZ.mjs +0 -88
- package/dist/lib/node-esm/chunk-OYN6HLXZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs +0 -158
- package/dist/lib/node-esm/chunk-UCOFKNKN.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs +0 -44
- package/dist/lib/node-esm/intent-resolver-E6MXTYAU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7HA5EDWY.mjs +0 -160
- package/dist/lib/node-esm/react-surface-7HA5EDWY.mjs.map +0 -7
- package/dist/lib/node-esm/settings-5IAY6BT4.mjs +0 -23
- package/dist/lib/node-esm/settings-5IAY6BT4.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-client.d.ts +0 -5
- package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
- package/dist/types/src/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/capabilities.d.ts +0 -6
- package/dist/types/src/capabilities/capabilities.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/AmbientDialog/AmbientDialog.d.ts +0 -10
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +0 -8
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/index.d.ts +0 -2
- package/dist/types/src/components/AmbientDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/AssistantDialog.d.ts +0 -7
- package/dist/types/src/components/AssistantDialog.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +0 -9
- package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts +0 -13
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts +0 -8
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintEditor/index.d.ts +0 -2
- package/dist/types/src/components/BlueprintEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +0 -23
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +0 -13
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts +0 -16
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts +0 -9
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/autocomplete.d.ts +0 -25
- package/dist/types/src/components/Prompt/autocomplete.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/index.d.ts +0 -3
- package/dist/types/src/components/Prompt/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/references.d.ts +0 -30
- package/dist/types/src/components/Prompt/references.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/TemplateContainer.d.ts +0 -8
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.d.ts +0 -28
- package/dist/types/src/components/Thread/Thread.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.stories.d.ts +0 -11
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +0 -13
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +0 -16
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +0 -13
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +0 -1
- package/dist/types/src/components/Thread/index.d.ts +0 -3
- package/dist/types/src/components/Thread/index.d.ts.map +0 -1
- package/dist/types/src/components/Thread/reducer.d.ts +0 -12
- package/dist/types/src/components/Thread/reducer.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/experimental/transcription/index.d.ts +0 -1
- package/dist/types/src/experimental/transcription/index.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.d.ts +0 -72
- package/dist/types/src/hooks/processor.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/useContextProvider.d.ts +0 -17
- package/dist/types/src/hooks/useContextProvider.d.ts.map +0 -1
- package/dist/types/src/hooks/useMessageQueue.d.ts +0 -42
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +0 -1
- package/dist/types/src/hooks/useServices.d.ts +0 -7
- package/dist/types/src/hooks/useServices.d.ts.map +0 -1
- package/dist/types/src/hooks/useTextInputEvents.d.ts +0 -13
- package/dist/types/src/hooks/useTextInputEvents.d.ts.map +0 -1
- package/dist/types/src/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/Prompt.stories.d.ts +0 -8
- package/dist/types/src/stories/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/stories/Query.stories.d.ts +0 -19
- package/dist/types/src/stories/Query.stories.d.ts.map +0 -1
- package/dist/types/src/stories/Research.stories.d.ts +0 -15
- package/dist/types/src/stories/Research.stories.d.ts.map +0 -1
- package/dist/types/src/stories/test-data.d.ts +0 -3
- package/dist/types/src/stories/test-data.d.ts.map +0 -1
- package/dist/types/src/stories/testing.d.ts +0 -12
- package/dist/types/src/stories/testing.d.ts.map +0 -1
- package/dist/types/src/testing/test-blueprint.d.ts +0 -8
- package/dist/types/src/testing/test-blueprint.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/chat.d.ts +0 -23
- package/dist/types/src/types/chat.d.ts.map +0 -1
- package/dist/types/src/types/template.d.ts +0 -56
- package/dist/types/src/types/template.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -50
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/ai-client.ts +0 -42
- package/src/capabilities/app-graph-builder.ts +0 -248
- package/src/capabilities/capabilities.ts +0 -15
- package/src/capabilities/intent-resolver.ts +0 -45
- package/src/capabilities/react-surface.tsx +0 -137
- package/src/capabilities/settings.ts +0 -19
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +0 -84
- package/src/components/AmbientDialog/AmbientDialog.tsx +0 -117
- package/src/components/AssistantDialog.tsx +0 -37
- package/src/components/BlueprintContainer.tsx +0 -148
- package/src/components/BlueprintEditor/BlueprintEditor.stories.tsx +0 -32
- package/src/components/BlueprintEditor/BlueprintEditor.tsx +0 -50
- package/src/components/BlueprintEditor/index.ts +0 -5
- package/src/components/Prompt/Prompt.stories.tsx +0 -121
- package/src/components/Prompt/Prompt.tsx +0 -124
- package/src/components/Prompt/PromptBar.stories.tsx +0 -69
- package/src/components/Prompt/PromptBar.tsx +0 -105
- package/src/components/Prompt/autocomplete.ts +0 -218
- package/src/components/Prompt/index.ts +0 -6
- package/src/components/Prompt/references.ts +0 -180
- package/src/components/PromptSettings.tsx +0 -91
- package/src/components/TemplateContainer.tsx +0 -23
- package/src/components/Thread/Thread.stories.tsx +0 -201
- package/src/components/Thread/Thread.tsx +0 -118
- package/src/components/Thread/ThreadContainer.stories.tsx +0 -283
- package/src/components/Thread/ThreadContainer.tsx +0 -105
- package/src/components/Thread/ThreadMessage.tsx +0 -234
- package/src/components/Thread/ToolInvocations.tsx +0 -106
- package/src/components/Thread/index.ts +0 -6
- package/src/components/Thread/reducer.ts +0 -52
- package/src/events.ts +0 -11
- package/src/hooks/processor.test.ts +0 -15
- package/src/hooks/processor.ts +0 -238
- package/src/hooks/useChatProcessor.tsx +0 -97
- package/src/hooks/useContextProvider.ts +0 -55
- package/src/hooks/useMessageQueue.ts +0 -22
- package/src/hooks/useServices.ts +0 -28
- package/src/hooks/useTextInputEvents.ts +0 -49
- 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/Prompt.stories.tsx +0 -60
- package/src/stories/Query.stories.tsx +0 -514
- package/src/stories/Research.stories.tsx +0 -482
- package/src/stories/test-data.ts +0 -128
- package/src/stories/testing.ts +0 -60
- package/src/testing/test-blueprint.ts +0 -58
- 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/chat.ts +0 -32
- package/src/types/template.ts +0 -66
- package/src/types/types.ts +0 -48
- package/src/typings.d.ts +0 -9
- /package/dist/types/src/{hooks → processor}/processor.test.d.ts +0 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type JSX, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AiContextBinder } from '@dxos/assistant';
|
|
8
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
9
|
+
import { type Database, Filter, Obj, Type } from '@dxos/echo';
|
|
10
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
import { IconButton, Popover, Select, useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { Listbox, SearchList, useSearchListResults } from '@dxos/react-ui-searchlist';
|
|
13
|
+
import { Tabs } from '@dxos/react-ui-tabs';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
useActiveBlueprints,
|
|
17
|
+
useBlueprintHandlers,
|
|
18
|
+
useBlueprints,
|
|
19
|
+
useContextObjects,
|
|
20
|
+
useFilteredTypes,
|
|
21
|
+
} from '../../hooks';
|
|
22
|
+
import { meta } from '../../meta';
|
|
23
|
+
|
|
24
|
+
const panelClassNames = 'is-[calc(100dvw-.5rem)] sm:is-max md:is-72 max-is-[--text-content]';
|
|
25
|
+
|
|
26
|
+
export type ChatOptionsProps = {
|
|
27
|
+
db: Database.Database;
|
|
28
|
+
context: AiContextBinder;
|
|
29
|
+
blueprintRegistry?: Blueprint.Registry;
|
|
30
|
+
presets?: { id: string; label: string }[];
|
|
31
|
+
preset?: string;
|
|
32
|
+
onPresetChange?: (id: string) => void;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Manages the runtime context for the chat.
|
|
37
|
+
*/
|
|
38
|
+
export const ChatOptions = ({ db, context, blueprintRegistry, presets, preset, onPresetChange }: ChatOptionsProps) => {
|
|
39
|
+
const { t } = useTranslation(meta.id);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div role='none' className='flex p-2'>
|
|
43
|
+
<Popover.Root>
|
|
44
|
+
<Popover.Trigger asChild>
|
|
45
|
+
<IconButton variant='ghost' icon='ph--plus--regular' iconOnly label={t('context objects button')} />
|
|
46
|
+
</Popover.Trigger>
|
|
47
|
+
<Popover.Portal>
|
|
48
|
+
<Popover.Content side='top' classNames={panelClassNames}>
|
|
49
|
+
<Popover.Viewport>
|
|
50
|
+
<ObjectsPanel db={db} context={context} />
|
|
51
|
+
</Popover.Viewport>
|
|
52
|
+
<Popover.Arrow />
|
|
53
|
+
</Popover.Content>
|
|
54
|
+
</Popover.Portal>
|
|
55
|
+
</Popover.Root>
|
|
56
|
+
|
|
57
|
+
<Popover.Root>
|
|
58
|
+
<Popover.Trigger asChild>
|
|
59
|
+
<IconButton
|
|
60
|
+
variant='ghost'
|
|
61
|
+
icon='ph--sliders-horizontal--regular'
|
|
62
|
+
iconOnly
|
|
63
|
+
label={t('context settings button')}
|
|
64
|
+
/>
|
|
65
|
+
</Popover.Trigger>
|
|
66
|
+
<Popover.Portal>
|
|
67
|
+
<Popover.Content side='top' classNames={panelClassNames}>
|
|
68
|
+
<Popover.Viewport>
|
|
69
|
+
<Tabs.Root orientation='horizontal' defaultValue='blueprints' defaultActivePart='list' tabIndex={-1}>
|
|
70
|
+
<Tabs.Viewport classNames='max-bs-[--radix-popover-content-available-height] grid grid-rows-[1fr_min-content] [&_[cmdk-root]]:contents [&_[role="tabpanel"]]:grid [&_[role="tabpanel"]]:grid-rows-[1fr_min-content] [&_[role="listbox"]]:min-bs-0 [&_[role="listbox"]]:overflow-y-auto [&_[role="tabpanel"]]:min-bs-0 [&_[role="tabpanel"]]:pli-cardSpacingChrome [&_[role="tabpanel"][data-state="active"]]:order-first [&_[role="tabpanel"][data-state="inactive"]]:hidden'>
|
|
71
|
+
<Tabs.Tabpanel value='blueprints' tabIndex={-1} classNames='dx-focus-ring-inset'>
|
|
72
|
+
<BlueprintsPanel blueprintRegistry={blueprintRegistry} db={db} context={context} />
|
|
73
|
+
</Tabs.Tabpanel>
|
|
74
|
+
<Tabs.Tabpanel value='model' tabIndex={-1} classNames='dx-focus-ring-inset !pli-0'>
|
|
75
|
+
<ModelsPanel presets={presets} preset={preset} onPresetChange={onPresetChange} />
|
|
76
|
+
</Tabs.Tabpanel>
|
|
77
|
+
<Tabs.Tablist classNames='sm:overflow-x-hidden justify-center p-[--dx-cardSpacingChrome] border-bs border-subduedSeparator order-last'>
|
|
78
|
+
<Tabs.IconTab
|
|
79
|
+
value='blueprints'
|
|
80
|
+
icon='ph--blueprint--regular'
|
|
81
|
+
label={t('blueprints in context title')}
|
|
82
|
+
/>
|
|
83
|
+
<Tabs.IconTab value='model' label={t('chat model title')} icon='ph--cpu--regular' />
|
|
84
|
+
</Tabs.Tablist>
|
|
85
|
+
</Tabs.Viewport>
|
|
86
|
+
</Tabs.Root>
|
|
87
|
+
</Popover.Viewport>
|
|
88
|
+
<Popover.Arrow />
|
|
89
|
+
</Popover.Content>
|
|
90
|
+
</Popover.Portal>
|
|
91
|
+
</Popover.Root>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const BlueprintsPanel = ({
|
|
97
|
+
blueprintRegistry,
|
|
98
|
+
db,
|
|
99
|
+
context,
|
|
100
|
+
}: Pick<ChatOptionsProps, 'blueprintRegistry' | 'db' | 'context'>) => {
|
|
101
|
+
const { t } = useTranslation(meta.id);
|
|
102
|
+
|
|
103
|
+
const blueprints = useBlueprints({ blueprintRegistry, db });
|
|
104
|
+
const activeBlueprints = useActiveBlueprints({ context });
|
|
105
|
+
const { onUpdateBlueprint } = useBlueprintHandlers({ db, context, blueprintRegistry });
|
|
106
|
+
|
|
107
|
+
const { results, handleSearch } = useSearchListResults({
|
|
108
|
+
items: blueprints,
|
|
109
|
+
extract: (blueprint) => blueprint.name,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<SearchList.Root onSearch={handleSearch}>
|
|
114
|
+
<SearchList.Content classNames='plb-cardSpacingChrome'>
|
|
115
|
+
<SearchList.Viewport>
|
|
116
|
+
{results.map((blueprint) => {
|
|
117
|
+
const isActive = activeBlueprints.has(blueprint.key);
|
|
118
|
+
return (
|
|
119
|
+
<SearchList.Item
|
|
120
|
+
classNames='flex items-center overflow-hidden'
|
|
121
|
+
key={blueprint.key}
|
|
122
|
+
value={blueprint.key}
|
|
123
|
+
label={blueprint.name}
|
|
124
|
+
checked={isActive}
|
|
125
|
+
onSelect={() => onUpdateBlueprint?.(blueprint.key, !isActive)}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
})}
|
|
129
|
+
</SearchList.Viewport>
|
|
130
|
+
</SearchList.Content>
|
|
131
|
+
<SearchList.Input placeholder={t('search placeholder')} classNames='mbe-cardSpacingChrome' autoFocus />
|
|
132
|
+
</SearchList.Root>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const ModelsPanel = ({
|
|
137
|
+
presets,
|
|
138
|
+
preset,
|
|
139
|
+
onPresetChange,
|
|
140
|
+
}: Pick<ChatOptionsProps, 'presets' | 'preset' | 'onPresetChange'>) => {
|
|
141
|
+
return (
|
|
142
|
+
<Listbox.Root value={preset} onValueChange={onPresetChange} autoFocus>
|
|
143
|
+
{presets?.map(({ id, label }) => {
|
|
144
|
+
return (
|
|
145
|
+
<Listbox.Option key={id} value={id}>
|
|
146
|
+
<Listbox.OptionLabel>{label}</Listbox.OptionLabel>
|
|
147
|
+
<Listbox.OptionIndicator />
|
|
148
|
+
</Listbox.Option>
|
|
149
|
+
);
|
|
150
|
+
})}
|
|
151
|
+
</Listbox.Root>
|
|
152
|
+
);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const ANY = '__any__';
|
|
156
|
+
|
|
157
|
+
const ObjectsPanel = ({ db, context }: Pick<ChatOptionsProps, 'db' | 'context'>): JSX.Element => {
|
|
158
|
+
const { t } = useTranslation(meta.id);
|
|
159
|
+
|
|
160
|
+
// Item types sorted by label.
|
|
161
|
+
const types = useFilteredTypes(db);
|
|
162
|
+
const typenames = useMemo(() => {
|
|
163
|
+
const typenames = types.map((type) => {
|
|
164
|
+
const typename = Type.getTypename(type);
|
|
165
|
+
return {
|
|
166
|
+
typename,
|
|
167
|
+
label: t('typename label', { ns: typename, defaultValue: typename }),
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
typenames.sort((a, b) => a.label.localeCompare(b.label));
|
|
172
|
+
return typenames;
|
|
173
|
+
}, [types]);
|
|
174
|
+
|
|
175
|
+
// Current type and filter.
|
|
176
|
+
const [typename, setTypename] = useState<string>(ANY);
|
|
177
|
+
const anyFilter = useMemo(
|
|
178
|
+
() => Filter.or(...typenames.map(({ typename }) => Filter.typename(typename))),
|
|
179
|
+
[typenames],
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
// Context objects.
|
|
183
|
+
const objects = useQuery(db, typename === ANY ? anyFilter : Filter.typename(typename));
|
|
184
|
+
const { objects: contextObjects, onUpdateObject } = useContextObjects({ db, context });
|
|
185
|
+
|
|
186
|
+
const { results, handleSearch } = useSearchListResults({
|
|
187
|
+
items: objects,
|
|
188
|
+
extract: (object) => Obj.getLabel(object) ?? Obj.getTypename(object) ?? object.id,
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<SearchList.Root onSearch={handleSearch}>
|
|
193
|
+
<SearchList.Content classNames='p-cardSpacingChrome [&:has([cmdk-list-sizer]:empty)]:plb-0'>
|
|
194
|
+
<SearchList.Viewport>
|
|
195
|
+
{results.length ? (
|
|
196
|
+
results.map((object) => {
|
|
197
|
+
const isActive = contextObjects.findIndex((obj) => obj.id === object.id) !== -1;
|
|
198
|
+
return (
|
|
199
|
+
<SearchList.Item
|
|
200
|
+
classNames='flex items-center overflow-hidden'
|
|
201
|
+
key={object.id}
|
|
202
|
+
value={object.id}
|
|
203
|
+
label={Obj.getLabel(object) ?? Obj.getTypename(object) ?? object.id}
|
|
204
|
+
checked={isActive}
|
|
205
|
+
onSelect={() => onUpdateObject?.(Obj.getDXN(object), !isActive)}
|
|
206
|
+
/>
|
|
207
|
+
);
|
|
208
|
+
})
|
|
209
|
+
) : (
|
|
210
|
+
<SearchList.Item value='__empty__' label={t('no results')} />
|
|
211
|
+
)}
|
|
212
|
+
</SearchList.Viewport>
|
|
213
|
+
</SearchList.Content>
|
|
214
|
+
|
|
215
|
+
<div role='none' className='grid grid-cols-[min-content_1fr] gap-2 pli-cardSpacingChrome mbe-cardSpacingChrome'>
|
|
216
|
+
<Select.Root value={typename === ANY ? undefined : typename} onValueChange={setTypename}>
|
|
217
|
+
<Select.TriggerButton density='fine' placeholder={t('type filter placeholder')} />
|
|
218
|
+
<Select.Portal>
|
|
219
|
+
<Select.Content>
|
|
220
|
+
<Select.ScrollUpButton />
|
|
221
|
+
<Select.Viewport>
|
|
222
|
+
<Select.Option value={ANY}>{t('any type filter label')}</Select.Option>
|
|
223
|
+
{typenames.map(({ typename, label }) => (
|
|
224
|
+
<Select.Option key={typename} value={typename}>
|
|
225
|
+
{label}
|
|
226
|
+
</Select.Option>
|
|
227
|
+
))}
|
|
228
|
+
</Select.Viewport>
|
|
229
|
+
<Select.ScrollDownButton />
|
|
230
|
+
<Select.Arrow />
|
|
231
|
+
</Select.Content>
|
|
232
|
+
</Select.Portal>
|
|
233
|
+
</Select.Root>
|
|
234
|
+
<SearchList.Input placeholder={t('search placeholder')} classNames='mbe-0' autoFocus />
|
|
235
|
+
</div>
|
|
236
|
+
</SearchList.Root>
|
|
237
|
+
);
|
|
238
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Select } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
export type ChatPresetsProps = {
|
|
10
|
+
presets?: { id: string; label: string }[];
|
|
11
|
+
preset?: string;
|
|
12
|
+
onChange?: (id: string) => void;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const ChatPresets = ({ presets, preset, onChange }: ChatPresetsProps) => {
|
|
16
|
+
return (
|
|
17
|
+
<Select.Root value={preset} onValueChange={onChange}>
|
|
18
|
+
<Select.TriggerButton classNames='text-sm' />
|
|
19
|
+
<Select.Content>
|
|
20
|
+
{presets?.map(({ id, label }) => (
|
|
21
|
+
<Select.Option key={id} value={id} classNames='text-sm'>
|
|
22
|
+
{label}
|
|
23
|
+
</Select.Option>
|
|
24
|
+
))}
|
|
25
|
+
<Select.Arrow />
|
|
26
|
+
</Select.Content>
|
|
27
|
+
</Select.Root>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AiContextBinder } from '@dxos/assistant';
|
|
8
|
+
import { type Database, Obj } from '@dxos/echo';
|
|
9
|
+
import { IconButton, type Label, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { mx } from '@dxos/ui-theme';
|
|
11
|
+
|
|
12
|
+
import { useContextObjects } from '../../hooks';
|
|
13
|
+
import { meta } from '../../meta';
|
|
14
|
+
|
|
15
|
+
export type ChatReferencesProps = ThemedClassName<{
|
|
16
|
+
context: AiContextBinder;
|
|
17
|
+
db: Database.Database;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps) => {
|
|
21
|
+
const { t } = useTranslation(meta.id);
|
|
22
|
+
const { objects, onUpdateObject } = useContextObjects({ db, context });
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<ul className={mx('flex', classNames)}>
|
|
26
|
+
{objects.map((obj) => {
|
|
27
|
+
const dxn = Obj.getDXN(obj);
|
|
28
|
+
const typename = Obj.getTypename(obj);
|
|
29
|
+
const label: Label = Obj.getLabel(obj) ?? (typename ? ['object name placeholder', { ns: typename }] : obj.id);
|
|
30
|
+
return (
|
|
31
|
+
<li key={dxn.toString()} className='dx-tag plb-0 pis-2 flex items-center' data-hue='neutral'>
|
|
32
|
+
{toLocalizedString(label, t)}
|
|
33
|
+
<IconButton
|
|
34
|
+
icon='ph--x--bold'
|
|
35
|
+
iconOnly
|
|
36
|
+
variant='ghost'
|
|
37
|
+
label={t('remove object in context label')}
|
|
38
|
+
classNames='p-0 hover:bg-transparent'
|
|
39
|
+
size={3}
|
|
40
|
+
onClick={() => onUpdateObject?.(dxn, false)}
|
|
41
|
+
/>
|
|
42
|
+
</li>
|
|
43
|
+
);
|
|
44
|
+
})}
|
|
45
|
+
</ul>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ThemedClassName, Tooltip, useTimeout } from '@dxos/react-ui';
|
|
8
|
+
import { Spinner, type SpinnerProps } from '@dxos/react-ui-sfx';
|
|
9
|
+
import { mx } from '@dxos/ui-theme';
|
|
10
|
+
|
|
11
|
+
const period = 3_000;
|
|
12
|
+
|
|
13
|
+
export type ChatStatusIndicatorProps = ThemedClassName<
|
|
14
|
+
{
|
|
15
|
+
preset?: string;
|
|
16
|
+
processing?: boolean;
|
|
17
|
+
error?: Error;
|
|
18
|
+
} & Pick<SpinnerProps, 'size' | 'onClick'>
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export const ChatStatusIndicator = ({ classNames, preset, processing, error, ...props }: ChatStatusIndicatorProps) => {
|
|
22
|
+
const [init, setInit] = useState(false);
|
|
23
|
+
useEffect(() => setInit(false), [preset]);
|
|
24
|
+
useTimeout(
|
|
25
|
+
async () => {
|
|
26
|
+
setInit(true);
|
|
27
|
+
},
|
|
28
|
+
period / 2,
|
|
29
|
+
[preset],
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div role='none' className={mx('relative flex', classNames)}>
|
|
34
|
+
<Spinner duration={period} state={!init ? 'flash' : error ? 'error' : processing ? 'spin' : 'pulse'} {...props} />
|
|
35
|
+
{error && (
|
|
36
|
+
<Tooltip.Trigger asChild content={error.message}>
|
|
37
|
+
<div className='absolute inset-0' />
|
|
38
|
+
</Tooltip.Trigger>
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Fiber from 'effect/Fiber';
|
|
8
|
+
import * as Layer from 'effect/Layer';
|
|
9
|
+
import React, { type CSSProperties, useEffect, useMemo, useState } from 'react';
|
|
10
|
+
|
|
11
|
+
import { Database } from '@dxos/echo';
|
|
12
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
13
|
+
import { ContextQueueService } from '@dxos/functions';
|
|
14
|
+
import { faker } from '@dxos/random';
|
|
15
|
+
import { useQueue, useSpace } from '@dxos/react-client/echo';
|
|
16
|
+
import { withClientProvider } from '@dxos/react-client/testing';
|
|
17
|
+
import { Popover } from '@dxos/react-ui';
|
|
18
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
19
|
+
import { MarkdownStream } from '@dxos/react-ui-components';
|
|
20
|
+
import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
|
|
21
|
+
import { Card } from '@dxos/react-ui-mosaic';
|
|
22
|
+
import { render } from '@dxos/storybook-utils';
|
|
23
|
+
import { type Message, Organization, Person } from '@dxos/types';
|
|
24
|
+
|
|
25
|
+
import { createMessageGenerator } from '../../testing';
|
|
26
|
+
import { translations } from '../../translations';
|
|
27
|
+
|
|
28
|
+
import { ChatThread, type ChatThreadProps } from './ChatThread';
|
|
29
|
+
import { componentRegistry } from './registry';
|
|
30
|
+
import TEXT from './testing/thread.md?raw';
|
|
31
|
+
|
|
32
|
+
faker.seed(1);
|
|
33
|
+
|
|
34
|
+
type MessageGenerator = Effect.Effect<void, never, Database.Service | ContextQueueService>;
|
|
35
|
+
|
|
36
|
+
type StoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
|
|
37
|
+
|
|
38
|
+
const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: StoryProps) => {
|
|
39
|
+
const space = useSpace();
|
|
40
|
+
const queueDxn = useMemo(() => space?.queues.create().dxn, [space]);
|
|
41
|
+
const queue = useQueue<Message.Message>(queueDxn);
|
|
42
|
+
const [done, setDone] = useState(false);
|
|
43
|
+
|
|
44
|
+
// Generate messages.
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!space || !queue) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const fiber = Effect.runFork(
|
|
51
|
+
Effect.gen(function* () {
|
|
52
|
+
for (const step of generator) {
|
|
53
|
+
yield* step;
|
|
54
|
+
if (delay) {
|
|
55
|
+
yield* Effect.sleep(delay);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
setDone(true);
|
|
59
|
+
}).pipe(Effect.provide(Layer.mergeAll(Database.layer(space.db), ContextQueueService.layer(queue)))),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return () => {
|
|
63
|
+
void runAndForwardErrors(Fiber.interrupt(fiber));
|
|
64
|
+
};
|
|
65
|
+
}, [space, queue, generator]);
|
|
66
|
+
|
|
67
|
+
if (wait && !done) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<EditorPreviewProvider onLookup={async ({ dxn, label }) => ({ label, text: dxn })}>
|
|
73
|
+
<ChatThread {...props} messages={queue?.objects} />
|
|
74
|
+
<PreviewCard />
|
|
75
|
+
</EditorPreviewProvider>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const PreviewCard = () => {
|
|
80
|
+
const { target } = useEditorPreview('PreviewCard');
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Popover.Portal>
|
|
84
|
+
<Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>
|
|
85
|
+
<Popover.Viewport>
|
|
86
|
+
<Card.Root>
|
|
87
|
+
<Card.Heading>{target?.label}</Card.Heading>
|
|
88
|
+
{target && <Card.Text classNames='truncate line-clamp-3'>{target.text}</Card.Text>}
|
|
89
|
+
</Card.Root>
|
|
90
|
+
</Popover.Viewport>
|
|
91
|
+
<Popover.Arrow />
|
|
92
|
+
</Popover.Content>
|
|
93
|
+
</Popover.Portal>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const meta = {
|
|
98
|
+
title: 'plugins/plugin-assistant/ChatThread',
|
|
99
|
+
component: ChatThread,
|
|
100
|
+
render: render(DefaultStory),
|
|
101
|
+
decorators: [
|
|
102
|
+
withTheme(),
|
|
103
|
+
withLayout({ layout: 'column' }),
|
|
104
|
+
withClientProvider({
|
|
105
|
+
createIdentity: true,
|
|
106
|
+
createSpace: true,
|
|
107
|
+
types: [Organization.Organization, Person.Person],
|
|
108
|
+
}),
|
|
109
|
+
],
|
|
110
|
+
parameters: {
|
|
111
|
+
layout: 'fullscreen',
|
|
112
|
+
translations,
|
|
113
|
+
},
|
|
114
|
+
} satisfies Meta<StoryProps>;
|
|
115
|
+
|
|
116
|
+
export default meta;
|
|
117
|
+
|
|
118
|
+
type Story = StoryObj<StoryProps>;
|
|
119
|
+
|
|
120
|
+
export const Default: Story = {
|
|
121
|
+
args: {
|
|
122
|
+
generator: createMessageGenerator(),
|
|
123
|
+
wait: true,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const Delayed: Story = {
|
|
128
|
+
args: {
|
|
129
|
+
generator: createMessageGenerator(),
|
|
130
|
+
delay: 1_000,
|
|
131
|
+
fadeIn: true,
|
|
132
|
+
cursor: false,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const Raw: Story = {
|
|
137
|
+
render: () => (
|
|
138
|
+
<div className='contents' style={{ '--user-fill': 'var(--dx-amberFill)' } as CSSProperties}>
|
|
139
|
+
<MarkdownStream content={TEXT} />
|
|
140
|
+
</div>
|
|
141
|
+
),
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const Static: Story = {
|
|
145
|
+
render: () => (
|
|
146
|
+
<div className='contents' style={{ '--user-fill': 'var(--dx-amberFill)' } as CSSProperties}>
|
|
147
|
+
<MarkdownStream content={TEXT} registry={componentRegistry} />
|
|
148
|
+
</div>
|
|
149
|
+
),
|
|
150
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type CSSProperties, forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { PublicKey } from '@dxos/keys';
|
|
8
|
+
import { type Identity } from '@dxos/react-client/halo';
|
|
9
|
+
import { type ThemedClassName, useForwardedRef } from '@dxos/react-ui';
|
|
10
|
+
import { MarkdownStream, type MarkdownStreamController, type MarkdownStreamProps } from '@dxos/react-ui-components';
|
|
11
|
+
import { type Message } from '@dxos/types';
|
|
12
|
+
import { mx } from '@dxos/ui-theme';
|
|
13
|
+
import { keyToFallback } from '@dxos/util';
|
|
14
|
+
|
|
15
|
+
import { type ChatEvent } from '../Chat';
|
|
16
|
+
|
|
17
|
+
import { blockToMarkdown, componentRegistry } from './registry';
|
|
18
|
+
import { MessageSyncer } from './sync';
|
|
19
|
+
|
|
20
|
+
export type ChatThreadProps = ThemedClassName<
|
|
21
|
+
{
|
|
22
|
+
identity?: Identity;
|
|
23
|
+
messages?: Message.Message[];
|
|
24
|
+
error?: Error;
|
|
25
|
+
onEvent?: (event: ChatEvent) => void;
|
|
26
|
+
} & Pick<MarkdownStreamProps, 'cursor' | 'fadeIn' | 'debug'>
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
// TODO(burdon): Memo thread position.
|
|
30
|
+
export const ChatThread = forwardRef<MarkdownStreamController | null, ChatThreadProps>(
|
|
31
|
+
(
|
|
32
|
+
{ classNames, identity, messages = [], error, cursor = false, fadeIn = true, debug = false, onEvent },
|
|
33
|
+
forwardedRef,
|
|
34
|
+
) => {
|
|
35
|
+
const controllerRef = useForwardedRef(forwardedRef);
|
|
36
|
+
const [controller, setController] = useState<MarkdownStreamController | null>(null);
|
|
37
|
+
|
|
38
|
+
// Callback ref to capture when MarkdownStream is mounted and trigger re-render.
|
|
39
|
+
const refCallback = useCallback(
|
|
40
|
+
(node: MarkdownStreamController | null) => {
|
|
41
|
+
controllerRef.current = node;
|
|
42
|
+
setController(node);
|
|
43
|
+
},
|
|
44
|
+
[controllerRef],
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const userHue = useMemo(
|
|
48
|
+
() => identity?.profile?.data?.hue || keyToFallback(identity?.identityKey ?? PublicKey.random()).hue,
|
|
49
|
+
[identity],
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
// Show error.
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
controller?.scrollToBottom();
|
|
55
|
+
}, [controller, error]);
|
|
56
|
+
|
|
57
|
+
// Update document.
|
|
58
|
+
const syncer = useMemo(() => controller && new MessageSyncer(controller, blockToMarkdown), [controller]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const reset = syncer?.append(messages, true);
|
|
61
|
+
if (reset) {
|
|
62
|
+
controller?.scrollToBottom('instant');
|
|
63
|
+
}
|
|
64
|
+
}, [syncer, messages]);
|
|
65
|
+
|
|
66
|
+
// Event adapter.
|
|
67
|
+
const handleEvent = useCallback<NonNullable<MarkdownStreamProps['onEvent']>>(
|
|
68
|
+
({ type, value }) => {
|
|
69
|
+
switch (type) {
|
|
70
|
+
case 'submit': {
|
|
71
|
+
value && onEvent?.({ type, text: value });
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
[onEvent],
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div
|
|
81
|
+
role='none'
|
|
82
|
+
className={mx('flex bs-full is-full justify-center overflow-hidden', classNames)}
|
|
83
|
+
style={{ '--user-fill': `var(--dx-${userHue}Fill)` } as CSSProperties}
|
|
84
|
+
>
|
|
85
|
+
<MarkdownStream
|
|
86
|
+
ref={refCallback}
|
|
87
|
+
registry={componentRegistry}
|
|
88
|
+
cursor={cursor}
|
|
89
|
+
fadeIn={fadeIn}
|
|
90
|
+
debug={debug}
|
|
91
|
+
onEvent={handleEvent}
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
},
|
|
96
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Space } from '@dxos/client/echo';
|
|
8
|
+
import { Entity } from '@dxos/echo';
|
|
9
|
+
import { type DXN } from '@dxos/keys';
|
|
10
|
+
import { DxAnchor } from '@dxos/lit-ui/react';
|
|
11
|
+
|
|
12
|
+
export type ObjectLinkProps = {
|
|
13
|
+
space: Space;
|
|
14
|
+
dxn: DXN;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const ObjectLink = ({ space, dxn }: ObjectLinkProps) => {
|
|
18
|
+
const ref = useMemo(() => space.db.makeRef(dxn), [space, dxn.toString()]);
|
|
19
|
+
|
|
20
|
+
const title = (ref.target && Entity.getLabel(ref.target)) ?? ref.target?.id ?? ref.dxn.toString();
|
|
21
|
+
return (
|
|
22
|
+
<DxAnchor rootclassname='dx-tag--anchor' dxn={dxn.toString()}>
|
|
23
|
+
{title}
|
|
24
|
+
</DxAnchor>
|
|
25
|
+
);
|
|
26
|
+
};
|