@dxos/plugin-assistant 0.8.4-main.406dc2a → 0.8.4-main.52d7546f51
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/blueprints/index.mjs +12 -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-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 +251 -215
- 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 +8 -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-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-WD2IVMAI.mjs → blueprint-definition-H3LFAEK2.mjs} +6 -4
- 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-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-73ABYRYX.mjs → chunk-POWB2BPC.mjs} +7 -2
- 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 +251 -215
- 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 +8 -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 +10 -11
- 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 +25 -13
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +4 -4
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +14 -6
- 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 +2 -2
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +7 -10
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +246 -73
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +12 -6
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- 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 +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +230 -61
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +231 -62
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- 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 +10 -8
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +6 -7
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +230 -60
- 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 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +3 -3
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/{list.d.ts → object-list.d.ts} +3 -3
- package/dist/types/src/functions/object-list.d.ts.map +1 -0
- package/dist/types/src/functions/{load.d.ts → object-load.d.ts} +3 -3
- 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 +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +5 -2
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -5
- 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 +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- 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/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +1 -0
- package/dist/types/src/processor/index.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +23 -18
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- 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/test-generator.d.ts +5 -4
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +358 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +7 -38
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +90 -100
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- 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/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +10 -212
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +119 -90
- package/src/AssistantPlugin.tsx +114 -112
- 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 +10 -14
- 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 +28 -20
- package/src/components/BlueprintArticle.tsx +28 -0
- package/src/components/Chat/Chat.tsx +189 -127
- package/src/components/Chat/events.ts +7 -1
- package/src/components/ChatCompanion.tsx +191 -101
- package/src/components/ChatContainer.tsx +48 -31
- package/src/components/ChatDialog.tsx +15 -8
- package/src/components/ChatProgress/ChatProgress.tsx +6 -20
- package/src/components/ChatPrompt/ChatActions.tsx +11 -5
- package/src/components/ChatPrompt/ChatOptions.tsx +93 -80
- package/src/components/ChatPrompt/ChatReferences.tsx +7 -8
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +58 -37
- package/src/components/ChatThread/ChatThread.tsx +35 -36
- package/src/components/ChatThread/Link.tsx +4 -4
- package/src/components/ChatThread/registry.tsx +25 -35
- package/src/components/ChatThread/sync.test.ts +33 -17
- package/src/components/ChatThread/sync.ts +53 -12
- 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 +16 -6
- package/src/components/TemplateEditor/TemplateEditor.tsx +24 -12
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +17 -9
- package/src/components/TemplateEditor/TemplateForm.tsx +76 -29
- 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 +36 -45
- package/src/components/Toolbox/Toolbox.stories.tsx +10 -11
- package/src/components/Toolbox/Toolbox.tsx +54 -56
- package/src/components/TriggerStatus/TriggerStatus.tsx +142 -0
- package/src/components/{Toolbar → TriggerStatus}/index.ts +1 -1
- 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 +13 -7
- package/src/functions/index.ts +3 -3
- package/src/functions/{list.ts → object-list.ts} +8 -7
- package/src/functions/object-load.ts +44 -0
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useBlueprintRegistry.ts +31 -20
- package/src/hooks/useChatProcessor.ts +17 -13
- package/src/hooks/useChatServices.ts +16 -18
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +9 -7
- package/src/hooks/useContextObjects.ts +13 -25
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/useReferencesProvider.ts +7 -6
- package/src/index.ts +0 -1
- package/src/meta.ts +8 -3
- package/src/processor/index.ts +1 -0
- package/src/processor/presets.ts +1 -1
- package/src/processor/processor.test.ts +16 -25
- package/src/processor/processor.ts +72 -73
- package/src/processor/update-name.ts +58 -0
- package/src/queue-logger.ts +8 -9
- package/src/testing/test-generator.ts +14 -13
- package/src/testing/test-services.ts +8 -6
- package/src/translations.ts +51 -18
- package/src/types/Assistant.ts +4 -40
- package/src/types/AssistantAction.ts +67 -53
- package/src/types/capabilities.ts +27 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +6 -1
- package/src/types/service.ts +12 -9
- package/dist/lib/browser/BlueprintContainer-WX2SSDVI.mjs +0 -28
- package/dist/lib/browser/BlueprintContainer-WX2SSDVI.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs +0 -150
- package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-RYGNN73X.mjs +0 -73
- package/dist/lib/browser/ChatContainer-RYGNN73X.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-MVHH2U66.mjs +0 -86
- package/dist/lib/browser/ChatDialog-MVHH2U66.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs +0 -150
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-2U7SLCRX.mjs +0 -154
- package/dist/lib/browser/app-graph-builder-2U7SLCRX.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs +0 -12
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs +0 -175
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-43I2LR6O.mjs +0 -216
- package/dist/lib/browser/chunk-43I2LR6O.mjs.map +0 -7
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs +0 -16
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-5RICKAMN.mjs +0 -18
- package/dist/lib/browser/chunk-5RICKAMN.mjs.map +0 -7
- package/dist/lib/browser/chunk-CQ7UHYTT.mjs +0 -296
- package/dist/lib/browser/chunk-CQ7UHYTT.mjs.map +0 -7
- package/dist/lib/browser/chunk-FP56WB24.mjs +0 -212
- package/dist/lib/browser/chunk-FP56WB24.mjs.map +0 -7
- package/dist/lib/browser/chunk-JZRZVB2A.mjs +0 -170
- package/dist/lib/browser/chunk-JZRZVB2A.mjs.map +0 -7
- package/dist/lib/browser/chunk-WRJGOT5P.mjs +0 -1794
- package/dist/lib/browser/chunk-WRJGOT5P.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3GOJMBXJ.mjs +0 -114
- package/dist/lib/browser/intent-resolver-3GOJMBXJ.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FTKCE6GG.mjs +0 -107
- package/dist/lib/browser/react-surface-FTKCE6GG.mjs.map +0 -7
- package/dist/lib/browser/settings-HBF32KV6.mjs +0 -23
- package/dist/lib/browser/settings-HBF32KV6.mjs.map +0 -7
- package/dist/lib/browser/state-LXTS54DI.mjs +0 -21
- package/dist/lib/browser/state-LXTS54DI.mjs.map +0 -7
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs +0 -199
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintContainer-4MKN6ZRB.mjs +0 -29
- package/dist/lib/node-esm/BlueprintContainer-4MKN6ZRB.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs +0 -151
- package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-UTJGCQXF.mjs +0 -74
- package/dist/lib/node-esm/ChatContainer-UTJGCQXF.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QEYZ4IOV.mjs +0 -87
- package/dist/lib/node-esm/ChatDialog-QEYZ4IOV.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs +0 -151
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OKNLR7H2.mjs +0 -155
- package/dist/lib/node-esm/app-graph-builder-OKNLR7H2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs +0 -217
- package/dist/lib/node-esm/chunk-DSE2IILK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E2WXZND7.mjs +0 -297
- package/dist/lib/node-esm/chunk-E2WXZND7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HXIBCBH4.mjs +0 -171
- package/dist/lib/node-esm/chunk-HXIBCBH4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TNR46C3L.mjs +0 -213
- package/dist/lib/node-esm/chunk-TNR46C3L.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs +0 -177
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UFKLCEAE.mjs +0 -1795
- package/dist/lib/node-esm/chunk-UFKLCEAE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs +0 -17
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-6XLVTRDJ.mjs +0 -115
- package/dist/lib/node-esm/intent-resolver-6XLVTRDJ.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-K7ZXQLAP.mjs +0 -108
- package/dist/lib/node-esm/react-surface-K7ZXQLAP.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CWP6MTWP.mjs +0 -24
- package/dist/lib/node-esm/settings-CWP6MTWP.mjs.map +0 -7
- package/dist/lib/node-esm/state-BO6GUFLB.mjs +0 -22
- package/dist/lib/node-esm/state-BO6GUFLB.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs +0 -200
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-service.d.ts +0 -4
- package/dist/types/src/capabilities/ai-service.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/blueprint-definition.d.ts +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -11
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/edge-model-resolver.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/local-model-resolver.d.ts +0 -10
- package/dist/types/src/capabilities/local-model-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/capabilities/state.d.ts +0 -4
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -4
- package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +0 -8
- package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducers.d.ts +0 -40
- package/dist/types/src/components/ChatThread/reducers.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 -269
- 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/TemplateEditor/handlebars-extension.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -5
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/index.d.ts +0 -2
- package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +0 -11
- package/dist/types/src/components/Toolbar/useChatToolbarActions.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/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.d.ts.map +0 -1
- package/dist/types/src/functions/list.d.ts.map +0 -1
- package/dist/types/src/functions/load.d.ts.map +0 -1
- package/dist/types/src/hooks/useItemTypes.d.ts +0 -4
- package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
- package/src/capabilities/ai-service.ts +0 -27
- package/src/capabilities/app-graph-builder.ts +0 -163
- package/src/capabilities/blueprint-definition.ts +0 -64
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/edge-model-resolver.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -96
- package/src/capabilities/local-model-resolver.ts +0 -30
- package/src/capabilities/react-surface.tsx +0 -91
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -20
- package/src/capabilities/toolkit.ts +0 -168
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/PromptSettings.tsx +0 -90
- package/src/components/SequenceContainer.tsx +0 -131
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -35
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/components/SequenceEditor/index.ts +0 -5
- package/src/components/TemplateEditor/handlebars-extension.ts +0 -165
- package/src/components/Toolbar/Toolbar.tsx +0 -21
- package/src/components/Toolbar/useChatToolbarActions.ts +0 -126
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- package/src/functions/load.ts +0 -46
- package/src/hooks/useItemTypes.ts +0 -37
- /package/dist/lib/browser/{blueprint-definition-NSJARW5U.mjs.map → blueprint-definition-YAGWYVCL.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-WD2IVMAI.mjs.map → browser/blueprints/index.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
|
|
8
|
-
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { capabilities } from '@dxos/assistant-testing';
|
|
10
|
+
import { capabilities } from '@dxos/assistant-toolkit/testing';
|
|
11
11
|
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
12
12
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
13
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
14
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
15
14
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
15
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
16
16
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
17
17
|
|
|
18
18
|
import { translations } from '../../translations';
|
|
@@ -20,7 +20,7 @@ import { translations } from '../../translations';
|
|
|
20
20
|
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
21
21
|
|
|
22
22
|
const DefaultStory = (props: ToolboxProps) => {
|
|
23
|
-
return <Toolbox {...props} classNames='
|
|
23
|
+
return <Toolbox {...props} classNames='bs-[15rem] is-[30rem] plb-1 rounded-sm border border-separator' />;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const meta = {
|
|
@@ -28,17 +28,16 @@ const meta = {
|
|
|
28
28
|
component: Toolbox as any,
|
|
29
29
|
render: DefaultStory,
|
|
30
30
|
decorators: [
|
|
31
|
-
withTheme,
|
|
31
|
+
withTheme(),
|
|
32
32
|
withPluginManager({
|
|
33
33
|
plugins: [
|
|
34
|
+
...corePlugins(),
|
|
34
35
|
ClientPlugin({
|
|
35
|
-
onClientInitialized:
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
onClientInitialized: ({ client }) =>
|
|
37
|
+
Effect.gen(function* () {
|
|
38
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
39
|
+
}),
|
|
38
40
|
}),
|
|
39
|
-
SpacePlugin({}),
|
|
40
|
-
SettingsPlugin(),
|
|
41
|
-
IntentPlugin(),
|
|
42
41
|
ChessPlugin(),
|
|
43
42
|
MapPlugin(),
|
|
44
43
|
TablePlugin(),
|
|
@@ -5,68 +5,66 @@
|
|
|
5
5
|
import React, { type FC, Fragment, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Blueprint } from '@dxos/blueprints';
|
|
8
|
-
import { type Ref } from '@dxos/echo';
|
|
9
|
-
import {
|
|
8
|
+
import { type Database, type Ref } from '@dxos/echo';
|
|
9
|
+
import { Function } from '@dxos/functions';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
|
-
import { Filter,
|
|
12
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
14
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
11
|
+
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { ScrollArea, type ThemedClassName } from '@dxos/react-ui';
|
|
13
|
+
import { mx } from '@dxos/ui-theme';
|
|
15
14
|
|
|
16
|
-
import { meta } from '../../meta';
|
|
17
15
|
import { type AiChatProcessor } from '../../processor';
|
|
18
16
|
import { ServiceType } from '../../types';
|
|
19
17
|
|
|
20
18
|
export type ToolboxProps = ThemedClassName<{
|
|
21
19
|
services?: { service: ServiceType }[];
|
|
22
|
-
functions?:
|
|
20
|
+
functions?: Function.Function[];
|
|
23
21
|
// TODO(burdon): Combine into single array.
|
|
24
|
-
blueprints?: readonly
|
|
22
|
+
blueprints?: readonly Blueprint.Blueprint[];
|
|
25
23
|
activeBlueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
26
24
|
}>;
|
|
27
25
|
|
|
28
26
|
export const Toolbox = ({ classNames, functions, services, blueprints, activeBlueprints }: ToolboxProps) => {
|
|
29
|
-
const { t } = useTranslation(meta.id);
|
|
30
|
-
|
|
31
27
|
return (
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
28
|
+
<ScrollArea.Root thin orientation='vertical'>
|
|
29
|
+
<ScrollArea.Viewport classNames={classNames}>
|
|
30
|
+
{blueprints && blueprints.length > 0 && (
|
|
31
|
+
<Section
|
|
32
|
+
title='Blueprints'
|
|
33
|
+
items={blueprints.map(({ name, description, tools }) => ({
|
|
34
|
+
name,
|
|
35
|
+
description,
|
|
36
|
+
subitems: tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
37
|
+
}))}
|
|
38
|
+
/>
|
|
39
|
+
)}
|
|
40
|
+
|
|
41
|
+
{activeBlueprints && activeBlueprints.length > 0 && (
|
|
42
|
+
<Section
|
|
43
|
+
title='Blueprints'
|
|
44
|
+
items={activeBlueprints.map(({ target }) => ({
|
|
45
|
+
name: target?.name ?? '',
|
|
46
|
+
description: target?.description ?? '',
|
|
47
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
48
|
+
}))}
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
51
|
+
|
|
52
|
+
{services && services.length > 0 && (
|
|
53
|
+
<Section
|
|
54
|
+
title='Services'
|
|
55
|
+
items={services.map(({ service: { serviceId, name, description } }) => ({
|
|
56
|
+
name: name ?? serviceId,
|
|
57
|
+
description,
|
|
58
|
+
// subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
59
|
+
}))}
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
|
|
63
|
+
{functions && functions.length > 0 && (
|
|
64
|
+
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
65
|
+
)}
|
|
66
|
+
</ScrollArea.Viewport>
|
|
67
|
+
</ScrollArea.Root>
|
|
70
68
|
);
|
|
71
69
|
};
|
|
72
70
|
|
|
@@ -77,11 +75,11 @@ const Section: FC<{
|
|
|
77
75
|
}> = ({ title, items, striped }) => {
|
|
78
76
|
const stripeClassNames = 'odd:bg-neutral-50 dark:odd:bg-neutral-800';
|
|
79
77
|
const gridClassNames = 'grid grid-cols-[8rem_1fr]';
|
|
80
|
-
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs
|
|
78
|
+
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs pli-2', striped && stripeClassNames);
|
|
81
79
|
|
|
82
80
|
return (
|
|
83
81
|
<div>
|
|
84
|
-
<h1 className='
|
|
82
|
+
<h1 className='pli-2 text-sm'>{title}</h1>
|
|
85
83
|
<div className={gridClassNames}>
|
|
86
84
|
{items.map(({ name, description, subitems }, i) => (
|
|
87
85
|
<Fragment key={i}>
|
|
@@ -105,13 +103,13 @@ const Section: FC<{
|
|
|
105
103
|
};
|
|
106
104
|
|
|
107
105
|
export type ToolboxContainerProps = ThemedClassName<{
|
|
108
|
-
|
|
106
|
+
db?: Database.Database;
|
|
109
107
|
processor?: AiChatProcessor;
|
|
110
108
|
}>;
|
|
111
109
|
|
|
112
|
-
export const ToolboxContainer = ({ classNames,
|
|
110
|
+
export const ToolboxContainer = ({ classNames, db, processor }: ToolboxContainerProps) => {
|
|
113
111
|
// Registered services.
|
|
114
|
-
const services = useQuery(
|
|
112
|
+
const services = useQuery(db, Filter.type(ServiceType));
|
|
115
113
|
const [serviceTools, setServiceTools] = useState<{ service: ServiceType }[]>([]);
|
|
116
114
|
useEffect(() => {
|
|
117
115
|
log('creating service tools...', { services: services.length });
|
|
@@ -125,12 +123,12 @@ export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContai
|
|
|
125
123
|
}, [services]);
|
|
126
124
|
|
|
127
125
|
// Deployed functions.
|
|
128
|
-
const functions = useQuery(
|
|
126
|
+
const functions = useQuery(db, Filter.type(Function.Function));
|
|
129
127
|
|
|
130
128
|
return (
|
|
131
129
|
<Toolbox
|
|
132
130
|
classNames={classNames}
|
|
133
|
-
blueprints={processor?.context.
|
|
131
|
+
blueprints={processor?.context.getBlueprints()}
|
|
134
132
|
services={serviceTools}
|
|
135
133
|
functions={functions}
|
|
136
134
|
/>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
8
|
+
import { useLayout } from '@dxos/app-toolkit/ui';
|
|
9
|
+
import { type InvocationsState } from '@dxos/functions-runtime';
|
|
10
|
+
import { useTriggerRuntimeControls } from '@dxos/plugin-automation';
|
|
11
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
12
|
+
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
13
|
+
import { parseId } from '@dxos/react-client/echo';
|
|
14
|
+
import { Icon, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
15
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
16
|
+
import { mx } from '@dxos/ui-theme';
|
|
17
|
+
|
|
18
|
+
import { meta } from '../../meta';
|
|
19
|
+
|
|
20
|
+
type TriggerStatusState = 'disabled' | 'idle' | 'running' | 'error';
|
|
21
|
+
|
|
22
|
+
const getIcon = (state: TriggerStatusState): string => {
|
|
23
|
+
switch (state) {
|
|
24
|
+
case 'disabled':
|
|
25
|
+
return 'ph--lightning-slash--regular';
|
|
26
|
+
case 'idle':
|
|
27
|
+
return 'ph--lightning--regular';
|
|
28
|
+
case 'running':
|
|
29
|
+
return 'ph--lightning--fill';
|
|
30
|
+
case 'error':
|
|
31
|
+
return 'ph--warning--regular';
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const getIconClassNames = (state: TriggerStatusState): string | undefined => {
|
|
36
|
+
switch (state) {
|
|
37
|
+
case 'running':
|
|
38
|
+
return 'animate-pulse text-accentText';
|
|
39
|
+
case 'error':
|
|
40
|
+
return 'text-errorText';
|
|
41
|
+
default:
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const useCurrentSpace = () => {
|
|
47
|
+
const layout = useLayout();
|
|
48
|
+
const client = useCapability(ClientCapabilities.Client);
|
|
49
|
+
const { spaceId } = parseId(layout.workspace);
|
|
50
|
+
const space = spaceId ? client.spaces.get(spaceId) : undefined;
|
|
51
|
+
return space;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const TriggerStatus = () => {
|
|
55
|
+
const space = useCurrentSpace();
|
|
56
|
+
const db = space?.db;
|
|
57
|
+
const { state, start, stop } = useTriggerRuntimeControls(db);
|
|
58
|
+
const isRunning = state?.enabled ?? false;
|
|
59
|
+
|
|
60
|
+
// Determine the current trigger status state.
|
|
61
|
+
const triggerState: TriggerStatusState = useMemo(() => {
|
|
62
|
+
if (!isRunning) {
|
|
63
|
+
return 'disabled';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Check if there's any pending invocation.
|
|
67
|
+
const hasPending = state?.invocations.some((invocation) => invocation.result === null);
|
|
68
|
+
if (hasPending) {
|
|
69
|
+
return 'running';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Check if the last invocation failed.
|
|
73
|
+
const lastInvocation = state?.invocations.at(-1);
|
|
74
|
+
if (lastInvocation?.result?._tag === 'Failure') {
|
|
75
|
+
return 'error';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return 'idle';
|
|
79
|
+
}, [isRunning, state?.invocations]);
|
|
80
|
+
|
|
81
|
+
const { t } = useTranslation(meta.id);
|
|
82
|
+
const title = t(`trigger status ${triggerState} label`);
|
|
83
|
+
const icon = <Icon icon={getIcon(triggerState)} classNames={getIconClassNames(triggerState)} />;
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Popover.Root>
|
|
87
|
+
<Popover.Trigger asChild>
|
|
88
|
+
<StatusBar.Item title={title}>{icon}</StatusBar.Item>
|
|
89
|
+
</Popover.Trigger>
|
|
90
|
+
<Popover.Portal>
|
|
91
|
+
<Popover.Content>
|
|
92
|
+
<TriggerStatusPopover
|
|
93
|
+
isRunning={isRunning}
|
|
94
|
+
state={triggerState}
|
|
95
|
+
currentFunctionName={state?.invocations.at(-1)?.function?.name ?? state?.invocations.at(-1)?.function?.key}
|
|
96
|
+
lastInvocation={state?.invocations.at(-1)}
|
|
97
|
+
onToggle={isRunning ? stop : start}
|
|
98
|
+
/>
|
|
99
|
+
<Popover.Arrow />
|
|
100
|
+
</Popover.Content>
|
|
101
|
+
</Popover.Portal>
|
|
102
|
+
</Popover.Root>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
interface TriggerStatusPopoverProps {
|
|
107
|
+
isRunning: boolean;
|
|
108
|
+
state: TriggerStatusState;
|
|
109
|
+
currentFunctionName?: string;
|
|
110
|
+
lastInvocation?: InvocationsState;
|
|
111
|
+
onToggle: () => void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const TriggerStatusPopover = ({
|
|
115
|
+
isRunning,
|
|
116
|
+
state,
|
|
117
|
+
currentFunctionName,
|
|
118
|
+
lastInvocation,
|
|
119
|
+
onToggle,
|
|
120
|
+
}: TriggerStatusPopoverProps) => {
|
|
121
|
+
const { t } = useTranslation(meta.id);
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<div className='min-is-[240px] p-2 space-y-3'>
|
|
125
|
+
{/* Runtime Toggle */}
|
|
126
|
+
<Settings.ItemInput title={t('trigger runtime label')} description={t('trigger runtime description')}>
|
|
127
|
+
<Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={onToggle} />
|
|
128
|
+
</Settings.ItemInput>
|
|
129
|
+
|
|
130
|
+
{/* Status Indicator */}
|
|
131
|
+
<div className='flex items-center gap-2 pt-2 border-t border-separator'>
|
|
132
|
+
<Icon icon={getIcon(state)} classNames={mx(getIconClassNames(state), 'shrink-0')} />
|
|
133
|
+
<span className='text-sm'>{t(`trigger status ${state} label`)}</span>
|
|
134
|
+
{currentFunctionName && state === 'running' && (
|
|
135
|
+
<span className='text-xs text-description'>{currentFunctionName}</span>
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export default TriggerStatus;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type EditorView } from '@codemirror/view';
|
|
6
|
+
import * as LanguageModel from '@effect/ai/LanguageModel';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import type * as Runtime from 'effect/Runtime';
|
|
9
|
+
import React, { useState } from 'react';
|
|
10
|
+
|
|
11
|
+
import { runInRuntime } from '@dxos/effect';
|
|
12
|
+
import { log } from '@dxos/log';
|
|
13
|
+
import { Button, Icon, Input, ThemeProvider } from '@dxos/react-ui';
|
|
14
|
+
|
|
15
|
+
export interface AssistantToolbarProps {
|
|
16
|
+
view: EditorView;
|
|
17
|
+
from: number;
|
|
18
|
+
to: number;
|
|
19
|
+
runtime: Runtime.Runtime<LanguageModel.LanguageModel>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const AssistantToolbar = ({ view, from, to, runtime }: AssistantToolbarProps) => {
|
|
23
|
+
const [isProcessing, setIsProcessing] = useState(false);
|
|
24
|
+
const [showPromptInput, setShowPromptInput] = useState(false);
|
|
25
|
+
const [customPrompt, setCustomPrompt] = useState('');
|
|
26
|
+
|
|
27
|
+
const runEffect = async (text: string, prompt: string) => {
|
|
28
|
+
setIsProcessing(true);
|
|
29
|
+
try {
|
|
30
|
+
const newText = await runInRuntime(
|
|
31
|
+
runtime,
|
|
32
|
+
Effect.gen(function* () {
|
|
33
|
+
// Construct meaningful system prompt context
|
|
34
|
+
const response = yield* LanguageModel.generateText({
|
|
35
|
+
prompt: `${prompt}:\n"${text}"`,
|
|
36
|
+
});
|
|
37
|
+
return response.text;
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
// Apply change - check if selection is still valid/same?
|
|
42
|
+
// For simple demo, we just apply to the passed from/to, but ideally we check current selection.
|
|
43
|
+
// We can just rely on from/to passed as props, assuming the toolbar unmounts if selection changes.
|
|
44
|
+
view.dispatch({
|
|
45
|
+
changes: { from, to, insert: newText },
|
|
46
|
+
});
|
|
47
|
+
} catch (e) {
|
|
48
|
+
log.error('Assistant action failed', { error: e });
|
|
49
|
+
} finally {
|
|
50
|
+
setIsProcessing(false);
|
|
51
|
+
setShowPromptInput(false);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const currentText = view.state.sliceDoc(from, to);
|
|
56
|
+
|
|
57
|
+
const handleRegenerate = () => {
|
|
58
|
+
void runEffect(
|
|
59
|
+
currentText,
|
|
60
|
+
'You are a typewriting agent. Agent only outputs the result; one version; no explanation or formatting. Re-write the following text to be more clear and concise, keep the same meaning.',
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const handleCasual = () => handleChangeTone('casual');
|
|
65
|
+
const handleFormal = () => handleChangeTone('formal');
|
|
66
|
+
|
|
67
|
+
const handleChangeTone = (tone: 'formal' | 'casual') => {
|
|
68
|
+
void runEffect(
|
|
69
|
+
currentText,
|
|
70
|
+
`You are a typewriting agent. Agent only outputs the result; one version; no explanation or formatting. Rewrite the following text to be more ${tone}`,
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const handleEditWithPrompt = () => {
|
|
75
|
+
if (!customPrompt) return;
|
|
76
|
+
void runEffect(currentText, customPrompt);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<ThemeProvider>
|
|
81
|
+
{showPromptInput ? (
|
|
82
|
+
<div
|
|
83
|
+
className='flex items-center gap-2 p-1 bg-white/90 dark:bg-neutral-800/90 backdrop-blur-md rounded-full shadow-xl border border-neutral-200 dark:border-neutral-700 animate-in fade-in zoom-in-95 duration-150 mt-2'
|
|
84
|
+
onMouseDown={(e) => e.preventDefault()}
|
|
85
|
+
>
|
|
86
|
+
<Input.Root>
|
|
87
|
+
<Input.TextInput
|
|
88
|
+
placeholder='Instruction...'
|
|
89
|
+
value={customPrompt}
|
|
90
|
+
onChange={(e) => setCustomPrompt(e.target.value)}
|
|
91
|
+
onKeyDown={(e) => {
|
|
92
|
+
if (e.key === 'Enter') handleEditWithPrompt();
|
|
93
|
+
if (e.key === 'Escape') setShowPromptInput(false);
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
}}
|
|
96
|
+
autoFocus
|
|
97
|
+
classNames='border-none bg-transparent focus-visible:ring-0 p-1 text-sm min-w-[200px]'
|
|
98
|
+
/>
|
|
99
|
+
</Input.Root>
|
|
100
|
+
<Button
|
|
101
|
+
variant='ghost'
|
|
102
|
+
classNames='p-1 min-bs-0 bs-6 is-6 rounded-full'
|
|
103
|
+
onClick={handleEditWithPrompt}
|
|
104
|
+
disabled={!customPrompt || isProcessing}
|
|
105
|
+
>
|
|
106
|
+
<Icon icon='ph--arrows-clockwise--regular' classNames={isProcessing ? 'animate-spin' : ''} />
|
|
107
|
+
</Button>
|
|
108
|
+
</div>
|
|
109
|
+
) : (
|
|
110
|
+
<div
|
|
111
|
+
className='flex items-center gap-1 p-1 bg-white/50 dark:bg-neutral-800/50 backdrop-blur-md rounded-xl shadow-xl border border-neutral-200 dark:border-neutral-700 animate-in fade-in zoom-in-95 duration-150 mt-2'
|
|
112
|
+
onMouseDown={(e) => e.preventDefault()}
|
|
113
|
+
>
|
|
114
|
+
<div className='flex items-center gap-1'>
|
|
115
|
+
<Button
|
|
116
|
+
variant='ghost'
|
|
117
|
+
classNames='flex flex-col items-center gap-1 p-1 h-auto w-auto rounded-lg hover:bg-neutral-100 dark:hover:bg-neutral-700'
|
|
118
|
+
onClick={handleCasual}
|
|
119
|
+
disabled={isProcessing}
|
|
120
|
+
>
|
|
121
|
+
<Icon icon='ph--caret-left--regular' size={4} />
|
|
122
|
+
<span className='text-[10px] leading-none text-neutral-500 font-medium'>Casual</span>
|
|
123
|
+
</Button>
|
|
124
|
+
|
|
125
|
+
<Button
|
|
126
|
+
variant='ghost'
|
|
127
|
+
classNames='flex flex-col items-center gap-1 p-1 h-auto w-auto rounded-lg hover:bg-neutral-100 dark:hover:bg-neutral-700'
|
|
128
|
+
onClick={handleRegenerate}
|
|
129
|
+
disabled={isProcessing}
|
|
130
|
+
>
|
|
131
|
+
<Icon icon='ph--arrows-clockwise--regular' size={4} classNames={isProcessing ? 'animate-spin' : ''} />
|
|
132
|
+
<span className='text-[10px] leading-none text-neutral-500 font-medium'>Different</span>
|
|
133
|
+
</Button>
|
|
134
|
+
|
|
135
|
+
<Button
|
|
136
|
+
variant='ghost'
|
|
137
|
+
classNames='flex flex-col gap-1 p-1 h-auto w-auto rounded-lg hover:bg-neutral-100 dark:hover:bg-neutral-700'
|
|
138
|
+
onClick={handleFormal}
|
|
139
|
+
disabled={isProcessing}
|
|
140
|
+
>
|
|
141
|
+
<Icon icon='ph--caret-right--regular' size={4} />
|
|
142
|
+
<span className='text-[10px] leading-none text-neutral-500 font-medium'>Formal</span>
|
|
143
|
+
</Button>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div className='w-px h-8 bg-neutral-200 dark:bg-neutral-700 mx-1' />
|
|
147
|
+
|
|
148
|
+
<Button
|
|
149
|
+
variant='ghost'
|
|
150
|
+
classNames='flex flex-col gap-1 p-1 h-auto w-auto rounded-lg hover:bg-neutral-100 dark:hover:bg-neutral-700'
|
|
151
|
+
onClick={() => setShowPromptInput(true)}
|
|
152
|
+
disabled={isProcessing}
|
|
153
|
+
>
|
|
154
|
+
<Icon icon='ph--keyboard--regular' size={4} />
|
|
155
|
+
<span className='text-[10px] leading-none text-neutral-500 font-medium'>Instruct</span>
|
|
156
|
+
</Button>
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
</ThemeProvider>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type * as LanguageModel from '@effect/ai/LanguageModel';
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
|
+
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
9
|
+
import type * as Runtime from 'effect/Runtime';
|
|
10
|
+
import React, { useEffect, useState } from 'react';
|
|
11
|
+
|
|
12
|
+
import { AiService } from '@dxos/ai';
|
|
13
|
+
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
14
|
+
|
|
15
|
+
import { Typewriter } from './Typewriter';
|
|
16
|
+
|
|
17
|
+
const meta: Meta<typeof Typewriter> = {
|
|
18
|
+
title: 'plugins/plugin-assistant/Typewriter',
|
|
19
|
+
component: Typewriter,
|
|
20
|
+
parameters: {
|
|
21
|
+
layout: 'centered',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
type Story = StoryObj<typeof Typewriter>;
|
|
28
|
+
|
|
29
|
+
const sampleText = `# The Future of Artificial Intelligence
|
|
30
|
+
|
|
31
|
+
Artificial Intelligence (AI) has rapidly evolved from a theoretical concept to a transformative force reshaping industries, economies, and daily life. At its core, AI refers to the development of computer systems capable of performing tasks that typically require human intelligence, such as visual perception, speech recognition, decision-making, and language translation.
|
|
32
|
+
|
|
33
|
+
## Machine Learning and Neural Networks
|
|
34
|
+
|
|
35
|
+
The resurgence of AI in recent years is largely driven by advancements in machine learning (ML) and deep learning. Neural networks, inspired by the human brain's architecture, enable computers to learn from vast amounts of data. This has led to breakthroughs in areas like natural language processing (NLP), allowing models like GPT-4 to generate human-like text and code.
|
|
36
|
+
|
|
37
|
+
## Ethical Considerations
|
|
38
|
+
|
|
39
|
+
As AI becomes more autonomous, ethical concerns have moved to the forefront. Issues such as algorithmic bias, data privacy, and the potential displacement of jobs are critical topics of debate. Ensuring that AI systems are fair, transparent, and aligned with human values is essential for their sustainable development.
|
|
40
|
+
|
|
41
|
+
## Conclusion
|
|
42
|
+
|
|
43
|
+
The journey of AI is just beginning. With responsible innovation and global collaboration, AI has the potential to solve some of humanity's most pressing challenges, from climate change to personalized medicine.
|
|
44
|
+
|
|
45
|
+
(try selecting some text to see the AI assistant, or wait for the proofreader to find the typo below)
|
|
46
|
+
|
|
47
|
+
The quick brown fox jumps over teh lazy dog. i think this is cool.
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
export const Default: Story = {
|
|
51
|
+
render: () => {
|
|
52
|
+
const [rtEffect, setRtEffect] = useState<Runtime.Runtime<LanguageModel.LanguageModel>>();
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
let disposed = false;
|
|
55
|
+
const rt = ManagedRuntime.make(
|
|
56
|
+
AiService.model('@anthropic/claude-haiku-4-5').pipe(
|
|
57
|
+
Layer.provide(AiServiceTestingPreset('edge-remote')),
|
|
58
|
+
Layer.orDie,
|
|
59
|
+
),
|
|
60
|
+
);
|
|
61
|
+
queueMicrotask(async () => {
|
|
62
|
+
if (disposed) return;
|
|
63
|
+
const x = await rt.runtime();
|
|
64
|
+
if (disposed) return;
|
|
65
|
+
setRtEffect(x);
|
|
66
|
+
});
|
|
67
|
+
return () => {
|
|
68
|
+
disposed = true;
|
|
69
|
+
void rt.dispose();
|
|
70
|
+
};
|
|
71
|
+
}, []);
|
|
72
|
+
|
|
73
|
+
if (!rtEffect) {
|
|
74
|
+
return <div>...Loading</div>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div className='w-[800px] p-4'>
|
|
79
|
+
<Typewriter initialContent={sampleText} runtime={rtEffect} />
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Extension } from '@codemirror/state';
|
|
6
|
+
import type * as LanguageModel from '@effect/ai/LanguageModel';
|
|
7
|
+
import type * as Runtime from 'effect/Runtime';
|
|
8
|
+
import React, { useMemo, useRef } from 'react';
|
|
9
|
+
|
|
10
|
+
import { DensityProvider, ThemeProvider } from '@dxos/react-ui';
|
|
11
|
+
import { Editor, type EditorController } from '@dxos/react-ui-editor';
|
|
12
|
+
import {
|
|
13
|
+
createBasicExtensions,
|
|
14
|
+
createMarkdownExtensions,
|
|
15
|
+
createThemeExtensions,
|
|
16
|
+
decorateMarkdown,
|
|
17
|
+
} from '@dxos/ui-editor';
|
|
18
|
+
|
|
19
|
+
import { assistant } from './assistant-extension';
|
|
20
|
+
|
|
21
|
+
export type TypewriterProps = {
|
|
22
|
+
initialContent?: string;
|
|
23
|
+
extensions?: Extension[];
|
|
24
|
+
runtime: Runtime.Runtime<LanguageModel.LanguageModel>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Typewriter = ({ initialContent = '', extensions = [], runtime }: TypewriterProps) => {
|
|
28
|
+
const editorRef = useRef<EditorController>(null);
|
|
29
|
+
const extension = useMemo(
|
|
30
|
+
() => [
|
|
31
|
+
createBasicExtensions({ scrollPastEnd: true, search: true }),
|
|
32
|
+
createThemeExtensions({ syntaxHighlighting: true }),
|
|
33
|
+
createMarkdownExtensions(),
|
|
34
|
+
decorateMarkdown(),
|
|
35
|
+
assistant(runtime),
|
|
36
|
+
...extensions,
|
|
37
|
+
],
|
|
38
|
+
[runtime, extensions],
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<ThemeProvider>
|
|
43
|
+
<DensityProvider density='fine'>
|
|
44
|
+
<div className='is-full bs-full grid overflow-hidden'>
|
|
45
|
+
<Editor.Root ref={editorRef}>
|
|
46
|
+
<Editor.Viewport>
|
|
47
|
+
<Editor.Content initialValue={initialContent} extensions={extension} />
|
|
48
|
+
</Editor.Viewport>
|
|
49
|
+
</Editor.Root>
|
|
50
|
+
</div>
|
|
51
|
+
</DensityProvider>
|
|
52
|
+
</ThemeProvider>
|
|
53
|
+
);
|
|
54
|
+
};
|