@dxos/plugin-assistant 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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/AssistantSettings-7QMO3LGF.mjs +97 -0
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +3 -7
- package/dist/lib/browser/chunk-ATHYBVGN.mjs +176 -0
- package/dist/lib/browser/chunk-ATHYBVGN.mjs.map +7 -0
- package/dist/lib/browser/chunk-EZRS3J25.mjs +30 -0
- package/dist/lib/browser/chunk-EZRS3J25.mjs.map +7 -0
- package/dist/lib/browser/chunk-RUV2WOQH.mjs +154 -0
- package/dist/lib/browser/chunk-RUV2WOQH.mjs.map +7 -0
- package/dist/lib/browser/create-chat-LBZHGVSN.mjs +82 -0
- package/dist/lib/browser/create-chat-LBZHGVSN.mjs.map +7 -0
- package/dist/lib/browser/ensure-companion-chat-FR4AWZ2P.mjs +65 -0
- package/dist/lib/browser/ensure-companion-chat-FR4AWZ2P.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3163 -245
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/on-create-space-54RNX5JI.mjs +22 -0
- package/dist/lib/browser/on-create-space-54RNX5JI.mjs.map +7 -0
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs +22 -0
- package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs.map +7 -0
- package/dist/lib/browser/run-prompt-in-new-chat-4YQ37XIS.mjs +136 -0
- package/dist/lib/browser/run-prompt-in-new-chat-4YQ37XIS.mjs.map +7 -0
- package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs +54 -0
- package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -4
- package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs +71 -0
- package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +7 -0
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +98 -0
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +3 -7
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +32 -0
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs +177 -0
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PY4X6FJT.mjs +155 -0
- package/dist/lib/node-esm/chunk-PY4X6FJT.mjs.map +7 -0
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs +83 -0
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs.map +7 -0
- package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs +66 -0
- package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3163 -245
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs +23 -0
- package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs.map +7 -0
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs +23 -0
- package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs.map +7 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs +137 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs.map +7 -0
- package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs +55 -0
- package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -4
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs +72 -0
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +1 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +6 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts +9 -0
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +7 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +41 -11
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +13 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/migrations.d.ts +5 -0
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +4 -3
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +21 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +6 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -6
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +553 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/index.d.ts +1 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +15 -11
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +6 -3
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +2 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +3 -3
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +535 -303
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +573 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +6 -5
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts +18 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +8 -0
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts +14 -0
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts +25 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts +18 -0
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts +14 -0
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts +12 -0
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +25 -0
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts +11 -0
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts +9 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts +553 -0
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts +11 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +10 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +8 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
- package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +5 -4
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +529 -295
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +529 -295
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +0 -9
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +10 -8
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +529 -295
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +2 -2
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -12
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +6 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +554 -0
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/AgentArticle/index.d.ts +2 -0
- package/dist/types/src/containers/AgentArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +6 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts +554 -0
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
- package/dist/types/src/containers/AgentProperties/index.d.ts +2 -0
- package/dist/types/src/containers/AgentProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts +2 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +18 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts +2 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +12 -0
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +2 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts +2 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +6 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PromptList/PromptList.d.ts +6 -0
- package/dist/types/src/containers/PromptList/PromptList.d.ts.map +1 -0
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts +559 -0
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +1 -0
- package/dist/types/src/containers/PromptList/index.d.ts +2 -0
- package/dist/types/src/containers/PromptList/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts +6 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +19 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts +4 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +4 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +2 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +12 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +7 -6
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +3 -6
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +2 -2
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts +3 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- package/dist/types/src/hooks/usePresets.d.ts +1 -1
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +5 -0
- package/dist/types/src/operations/create-chat.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +135 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/on-create-space.d.ts +5 -0
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +15 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
- package/dist/types/src/operations/set-current-chat.d.ts +5 -0
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
- package/dist/types/src/operations/update-chat-name.d.ts +5 -0
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -0
- package/dist/types/src/processor/index.d.ts +0 -1
- package/dist/types/src/processor/index.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +33 -28
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +529 -295
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +17 -39
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +10 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +11 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +120 -92
- package/src/AssistantPlugin.tsx +148 -52
- package/src/blueprints/assistant/blueprint.conversations.json +1 -0
- package/src/blueprints/assistant/blueprint.test.ts +46 -0
- package/src/blueprints/assistant/blueprint.ts +31 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/blueprints/index.ts +1 -8
- package/src/capabilities/{ai-service/ai-service.ts → ai-service.ts} +4 -3
- package/src/capabilities/app-graph-builder.ts +217 -0
- package/src/capabilities/blueprint-definition.ts +58 -0
- package/src/capabilities/companion-chat-provisioner.ts +164 -0
- package/src/capabilities/{edge-model-resolver/edge-model-resolver.ts → edge-model-resolver.ts} +4 -3
- package/src/capabilities/index.ts +22 -11
- package/src/capabilities/{local-model-resolver/local-model-resolver.ts → local-model-resolver.ts} +4 -3
- package/src/capabilities/markdown.ts +40 -0
- package/src/capabilities/migrations.ts +34 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +157 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +5 -4
- package/src/capabilities/{state/state.ts → state.ts} +11 -3
- package/src/capabilities/toolkit.ts +13 -0
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +34 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +104 -92
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +88 -45
- package/src/components/ChatProgress/ChatProgress.tsx +9 -7
- package/src/components/ChatPrompt/ChatActions.tsx +25 -5
- package/src/components/ChatPrompt/ChatOptions.tsx +43 -29
- package/src/components/ChatPrompt/ChatReferences.tsx +18 -8
- package/src/components/ChatThread/ChatThread.stories.tsx +31 -48
- package/src/components/ChatThread/ChatThread.tsx +28 -17
- package/src/components/ChatThread/Link.tsx +1 -1
- package/src/components/ChatThread/MarkdownStream.stories.tsx +243 -0
- package/src/components/ChatThread/registry.tsx +107 -43
- package/src/components/ChatThread/sync.test.ts +13 -10
- package/src/components/ChatThread/sync.ts +43 -32
- package/src/components/ChatThread/testing/thinking.md +21 -0
- package/src/components/ChatThread/testing/thread-1.md +30 -0
- package/src/components/ChatThread/testing/{thread.md → thread-2.md} +19 -0
- package/src/components/ChatThread/testing/thread-widgets.md +79 -0
- package/src/components/ChatThread/tool-widget-state.test.ts +34 -0
- package/src/components/ChatThread/tool-widget-state.ts +48 -0
- package/src/components/ChatThread/widgets/FallbackWidget.tsx +26 -0
- package/src/components/ChatThread/widgets/PromptWidget.ts +28 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +68 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +133 -0
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +31 -0
- package/src/components/ChatThread/widgets/SelectWidget.ts +37 -0
- package/src/components/ChatThread/widgets/StatsWidget.ts +29 -0
- package/src/components/ChatThread/widgets/StatusWidget.ts +133 -0
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +28 -0
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +54 -0
- package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
- package/src/components/ChatThread/widgets/index.ts +14 -0
- package/src/components/ProcessTree/ProcessTree.stories.tsx +109 -0
- package/src/components/ProcessTree/ProcessTree.tsx +85 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -9
- package/src/components/TemplateEditor/TemplateEditor.tsx +50 -42
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +7 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +9 -10
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +4 -4
- package/src/components/ToolBlock/ToolBlock.tsx +21 -20
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -6
- package/src/components/Toolbox/Toolbox.tsx +66 -60
- package/src/components/Typewriter/AssistantToolbar.tsx +7 -7
- package/src/components/Typewriter/Typewriter.stories.tsx +18 -15
- package/src/components/Typewriter/Typewriter.tsx +6 -10
- package/src/components/Typewriter/assistant-extension.tsx +5 -8
- package/src/components/index.ts +3 -7
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +105 -0
- package/src/containers/AgentArticle/AgentArticle.tsx +157 -0
- package/src/containers/AgentArticle/index.ts +5 -0
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +91 -0
- package/src/containers/AgentProperties/AgentProperties.tsx +169 -0
- package/src/containers/AgentProperties/index.ts +5 -0
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +5 -0
- package/src/{components → containers/ChatCompanion}/ChatCompanion.tsx +23 -44
- package/src/containers/ChatCompanion/index.ts +5 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +95 -0
- package/src/containers/ChatContainer/index.ts +5 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +10 -12
- package/src/containers/ChatDialog/index.ts +5 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +5 -0
- package/src/containers/PromptList/PromptList.stories.tsx +129 -0
- package/src/containers/PromptList/PromptList.tsx +49 -0
- package/src/containers/PromptList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.tsx +361 -0
- package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/containers/TracePanel/dxn-extractor.ts +178 -0
- package/src/containers/TracePanel/index.ts +9 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +144 -0
- package/src/containers/TriggerStatus/index.ts +5 -0
- package/src/containers/index.ts +16 -0
- package/src/extensions/index.ts +5 -0
- package/src/extensions/prompt-extension.ts +111 -0
- package/src/hooks/useBlueprintRegistry.ts +8 -4
- package/src/hooks/useChatProcessor.ts +30 -17
- package/src/hooks/useChatServices.ts +7 -28
- package/src/hooks/useChatToolbarActions.ts +13 -12
- package/src/hooks/useContextBinder.ts +17 -6
- package/src/hooks/useContextObjects.ts +8 -4
- package/src/hooks/useFilteredTypes.ts +3 -3
- package/src/hooks/usePresets.ts +2 -1
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +1 -1
- package/src/meta.ts +6 -3
- package/src/operations/create-chat.ts +80 -0
- package/src/operations/definitions.ts +127 -0
- package/src/operations/ensure-companion-chat.ts +61 -0
- package/src/operations/index.ts +17 -0
- package/src/operations/on-create-space.ts +24 -0
- package/src/operations/resolve-navigation-targets.ts +26 -0
- package/src/operations/run-prompt-in-new-chat.ts +113 -0
- package/src/operations/set-current-chat.ts +50 -0
- package/src/operations/update-chat-name.ts +61 -0
- package/src/processor/index.ts +0 -1
- package/src/processor/presets.ts +2 -2
- package/src/processor/processor.test.ts +18 -50
- package/src/processor/processor.ts +190 -129
- package/src/queue-logger.ts +2 -2
- package/src/testing/test-generator.ts +45 -14
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +2 -2
- package/src/translations.ts +134 -83
- package/src/types/Assistant.ts +8 -56
- package/src/types/Settings.ts +21 -0
- package/src/types/capabilities.ts +11 -3
- package/src/types/events.ts +2 -2
- package/src/types/index.ts +3 -1
- package/src/types/service.ts +5 -5
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs +0 -31
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs +0 -153
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs +0 -72
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs +0 -85
- package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +0 -53
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +0 -7
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs +0 -21
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs +0 -212
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +0 -14
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs.map +0 -7
- package/dist/lib/browser/chunk-A75V4MOQ.mjs +0 -1832
- package/dist/lib/browser/chunk-A75V4MOQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-DKQMSMBN.mjs +0 -326
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +0 -7
- package/dist/lib/browser/chunk-EXVT7D4B.mjs +0 -23
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +0 -7
- package/dist/lib/browser/chunk-ML3QCFKA.mjs +0 -265
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRJVYGLU.mjs +0 -208
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V772AMZM.mjs +0 -250
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +0 -7
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +0 -41
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs +0 -20
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs +0 -19
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs +0 -132
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-S7SBFOSW.mjs +0 -109
- package/dist/lib/browser/react-surface-S7SBFOSW.mjs.map +0 -7
- package/dist/lib/browser/repair-6QGAKOVM.mjs +0 -54
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +0 -7
- package/dist/lib/browser/settings-4ZDLUMYE.mjs +0 -32
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +0 -7
- package/dist/lib/browser/state-AN6336ZX.mjs +0 -26
- package/dist/lib/browser/state-AN6336ZX.mjs.map +0 -7
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +0 -18
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +0 -32
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs +0 -154
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs +0 -73
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs +0 -86
- package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +0 -54
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs +0 -22
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs +0 -213
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs +0 -15
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-355W5B27.mjs +0 -251
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4BERCIES.mjs +0 -1833
- package/dist/lib/node-esm/chunk-4BERCIES.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs +0 -327
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +0 -209
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +0 -42
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs +0 -25
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs +0 -267
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs +0 -21
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs +0 -20
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs +0 -133
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ZR6FXGLF.mjs +0 -110
- package/dist/lib/node-esm/react-surface-ZR6FXGLF.mjs.map +0 -7
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs +0 -55
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs +0 -33
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +0 -7
- package/dist/lib/node-esm/state-HDON4REW.mjs +0 -27
- package/dist/lib/node-esm/state-HDON4REW.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +0 -19
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +0 -7
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +0 -209
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +0 -5
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +0 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts +0 -3
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -21
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -4
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +0 -6
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +0 -12
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/index.d.ts +0 -3
- package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
- package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -15
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -11
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts +0 -13
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +0 -3
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +0 -5
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +0 -7
- package/dist/types/src/components/BlueprintArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChatCompanion.d.ts +0 -13
- package/dist/types/src/components/ChatCompanion.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -19
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatDialog.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/PromptArticle.d.ts +0 -7
- package/dist/types/src/components/PromptArticle.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/object-list.d.ts +0 -10
- package/dist/types/src/functions/object-list.d.ts.map +0 -1
- package/dist/types/src/functions/object-load.d.ts +0 -8
- package/dist/types/src/functions/object-load.d.ts.map +0 -1
- package/dist/types/src/functions/object-search.d.ts +0 -10
- package/dist/types/src/functions/object-search.d.ts.map +0 -1
- package/dist/types/src/processor/update-name.d.ts +0 -10
- package/dist/types/src/processor/update-name.d.ts.map +0 -1
- package/dist/types/src/types/AssistantAction.d.ts +0 -95
- package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
- package/src/blueprints/assistant-blueprint.ts +0 -62
- package/src/capabilities/ai-service/index.ts +0 -7
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -180
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -60
- package/src/capabilities/blueprint-definition/index.ts +0 -8
- package/src/capabilities/edge-model-resolver/index.ts +0 -7
- package/src/capabilities/local-model-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -110
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -95
- package/src/capabilities/repair/index.ts +0 -7
- package/src/capabilities/repair/repair.ts +0 -63
- package/src/capabilities/settings/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/capabilities/toolkit/index.ts +0 -7
- package/src/capabilities/toolkit/toolkit.ts +0 -26
- package/src/components/BlueprintArticle.tsx +0 -29
- package/src/components/ChatContainer.tsx +0 -61
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/PromptArticle.tsx +0 -50
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -49
- package/src/functions/object-load.ts +0 -47
- package/src/functions/object-search.ts +0 -46
- package/src/processor/update-name.ts +0 -59
- package/src/types/AssistantAction.ts +0 -75
|
@@ -64,7 +64,7 @@ const regex = {
|
|
|
64
64
|
url: /[\w.-]+\.[\w.-]+\/[\w/]+/g,
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
const tagPadding = '
|
|
67
|
+
const tagPadding = 'mx-0.5 px-1 rounded-xs';
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* ViewPlugin that decorates Handlebars syntax.
|
|
@@ -158,14 +158,14 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
|
158
158
|
decorations.push({
|
|
159
159
|
from: idx,
|
|
160
160
|
to: end,
|
|
161
|
-
decoration: Decoration.mark({ class: 'text-
|
|
161
|
+
decoration: Decoration.mark({ class: 'text-green-text' }),
|
|
162
162
|
});
|
|
163
163
|
end = idx;
|
|
164
164
|
}
|
|
165
165
|
decorations.push({
|
|
166
166
|
from: start,
|
|
167
167
|
to: end,
|
|
168
|
-
decoration: Decoration.mark({ class: 'text-
|
|
168
|
+
decoration: Decoration.mark({ class: 'text-blue-text' }),
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
}
|
|
@@ -179,7 +179,7 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
|
179
179
|
decorations.push({
|
|
180
180
|
from: start,
|
|
181
181
|
to: end,
|
|
182
|
-
decoration: Decoration.mark({ class: 'text-
|
|
182
|
+
decoration: Decoration.mark({ class: 'text-green-text' }),
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
}
|
|
@@ -6,13 +6,13 @@ import type * as Tool from '@effect/ai/Tool';
|
|
|
6
6
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { NumericTabs, TextCrawl,
|
|
9
|
+
import { NumericTabs, TextCrawl, TogglePanel, type TogglePanelRootProps } from '@dxos/react-ui-components';
|
|
10
10
|
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
11
11
|
import { type ContentBlock, type Message } from '@dxos/types';
|
|
12
12
|
import { type XmlWidgetProps } from '@dxos/ui-editor';
|
|
13
13
|
import { isNonNullable, safeParseJson } from '@dxos/util';
|
|
14
14
|
|
|
15
|
-
import { meta } from '
|
|
15
|
+
import { meta } from '#meta';
|
|
16
16
|
|
|
17
17
|
export const isToolMessage = (message: Message.Message) => {
|
|
18
18
|
return message.blocks.some((block: ContentBlock.Any) => block._tag === 'toolCall' || block._tag === 'toolResult');
|
|
@@ -25,12 +25,12 @@ export type ToolBlockProps = XmlWidgetProps<{
|
|
|
25
25
|
export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
26
26
|
const { t } = useTranslation(meta.id);
|
|
27
27
|
|
|
28
|
-
const items = useMemo<
|
|
28
|
+
const items = useMemo<ToolPanelProps['items']>(() => {
|
|
29
29
|
let lastToolCall: { tool: Tool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
|
|
30
30
|
// TODO(burdon): Get from context?
|
|
31
31
|
const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
|
|
32
32
|
return blocks
|
|
33
|
-
.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === '
|
|
33
|
+
.filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === 'stats')
|
|
34
34
|
.map((block) => {
|
|
35
35
|
switch (block._tag) {
|
|
36
36
|
case 'toolCall': {
|
|
@@ -41,7 +41,7 @@ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
|
41
41
|
const tool = tools.find((tool) => tool.name === block.name);
|
|
42
42
|
lastToolCall = { tool, block };
|
|
43
43
|
return {
|
|
44
|
-
title: tool?.description ?? [t('tool
|
|
44
|
+
title: tool?.description ?? [t('tool-call.label'), block?.name].join(' '),
|
|
45
45
|
content: {
|
|
46
46
|
...block,
|
|
47
47
|
input: safeParseJson(block.input),
|
|
@@ -53,13 +53,13 @@ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
|
53
53
|
// TODO(burdon): Parse error type.
|
|
54
54
|
if (block.error) {
|
|
55
55
|
return {
|
|
56
|
-
title: t('tool
|
|
56
|
+
title: t('tool-error.label'),
|
|
57
57
|
content: block,
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const title =
|
|
62
|
-
lastToolCall?.tool?.description ?? [t('tool
|
|
62
|
+
lastToolCall?.tool?.description ?? [t('tool-result.label'), lastToolCall?.block?.name].join(' ');
|
|
63
63
|
lastToolCall = undefined;
|
|
64
64
|
return {
|
|
65
65
|
title,
|
|
@@ -70,13 +70,13 @@ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
case '
|
|
73
|
+
case 'stats': {
|
|
74
74
|
if (!lastToolCall) {
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
return {
|
|
79
|
-
title: t('
|
|
79
|
+
title: t('stats.label'),
|
|
80
80
|
content: block,
|
|
81
81
|
};
|
|
82
82
|
}
|
|
@@ -92,20 +92,21 @@ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
|
92
92
|
}, 1_000);
|
|
93
93
|
}, [view]);
|
|
94
94
|
|
|
95
|
+
// Ignore if empty.
|
|
95
96
|
if (!items.length) {
|
|
96
97
|
return null;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
return <
|
|
100
|
+
return <ToolPanel items={items} onChangeOpen={handleChangeOpen} />;
|
|
100
101
|
};
|
|
101
102
|
|
|
102
103
|
ToolBlock.displayName = 'ToolBlock';
|
|
103
104
|
|
|
104
|
-
type
|
|
105
|
+
type ToolPanelProps = {
|
|
105
106
|
items: { title: string; content: any }[];
|
|
106
|
-
} & Pick<
|
|
107
|
+
} & Pick<TogglePanelRootProps, 'onChangeOpen'>;
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
const ToolPanel = ({ items, onChangeOpen }: ToolPanelProps) => {
|
|
109
110
|
const tabsRef = useRef<HTMLDivElement>(null);
|
|
110
111
|
const [selected, setSelected] = useState(0);
|
|
111
112
|
const [open, setOpen] = useState(false);
|
|
@@ -122,13 +123,13 @@ export const ToolContainer = ({ items, onChangeOpen }: ToolContainerProps) => {
|
|
|
122
123
|
}, []);
|
|
123
124
|
|
|
124
125
|
return (
|
|
125
|
-
<
|
|
126
|
-
<
|
|
126
|
+
<TogglePanel.Root classNames='w-full rounded-xs border border-subdued-separator' open={open} onChangeOpen={setOpen}>
|
|
127
|
+
<TogglePanel.Header classNames='text-sm text-placeholder'>
|
|
127
128
|
<TextCrawl key='status-roll' lines={items.map((item) => item.title)} autoAdvance greedy />
|
|
128
|
-
</
|
|
129
|
-
<
|
|
129
|
+
</TogglePanel.Header>
|
|
130
|
+
<TogglePanel.Content classNames='grid grid-cols-[32px_1fr]'>
|
|
130
131
|
<NumericTabs ref={tabsRef} classNames='p-1' length={items.length} selected={selected} onSelect={handleSelect} />
|
|
131
|
-
<Json
|
|
132
|
+
<Json.Data
|
|
132
133
|
data={items[selected]?.content}
|
|
133
134
|
classNames='p-1 text-xs bg-transparent'
|
|
134
135
|
replacer={{
|
|
@@ -137,7 +138,7 @@ export const ToolContainer = ({ items, onChangeOpen }: ToolContainerProps) => {
|
|
|
137
138
|
maxStringLen: 128,
|
|
138
139
|
}}
|
|
139
140
|
/>
|
|
140
|
-
</
|
|
141
|
-
</
|
|
141
|
+
</TogglePanel.Content>
|
|
142
|
+
</TogglePanel.Root>
|
|
142
143
|
);
|
|
143
144
|
};
|
|
@@ -10,32 +10,30 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
10
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
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
13
14
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
14
15
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
15
16
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
16
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
17
17
|
|
|
18
18
|
import { translations } from '../../translations';
|
|
19
|
-
|
|
20
19
|
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
21
20
|
|
|
22
21
|
const DefaultStory = (props: ToolboxProps) => {
|
|
23
|
-
return <Toolbox {...props} classNames='
|
|
22
|
+
return <Toolbox {...props} classNames='h-[15rem] w-[30rem] py-1 rounded-xs border border-separator' />;
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
const meta = {
|
|
27
|
-
title: 'plugins/plugin-assistant/Toolbox',
|
|
26
|
+
title: 'plugins/plugin-assistant/components/Toolbox',
|
|
28
27
|
component: Toolbox as any,
|
|
29
28
|
render: DefaultStory,
|
|
30
29
|
decorators: [
|
|
31
|
-
withTheme,
|
|
32
30
|
withPluginManager({
|
|
33
31
|
plugins: [
|
|
34
32
|
...corePlugins(),
|
|
35
33
|
ClientPlugin({
|
|
36
34
|
onClientInitialized: ({ client }) =>
|
|
37
35
|
Effect.gen(function* () {
|
|
38
|
-
yield*
|
|
36
|
+
yield* initializeIdentity(client);
|
|
39
37
|
}),
|
|
40
38
|
}),
|
|
41
39
|
ChessPlugin(),
|
|
@@ -2,85 +2,91 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { Fragment, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Blueprint } from '@dxos/blueprints';
|
|
8
8
|
import { type Database, type Ref } from '@dxos/echo';
|
|
9
|
-
import { Function } from '@dxos/functions';
|
|
10
9
|
import { log } from '@dxos/log';
|
|
10
|
+
import { Operation } from '@dxos/operation';
|
|
11
11
|
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
12
|
-
import { type ThemedClassName
|
|
13
|
-
import { mx } from '@dxos/ui-theme';
|
|
12
|
+
import { ScrollArea, type ThemedClassName } from '@dxos/react-ui';
|
|
13
|
+
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
14
|
+
|
|
15
|
+
import { ServiceType } from '#types';
|
|
14
16
|
|
|
15
|
-
import { meta } from '../../meta';
|
|
16
17
|
import { type AiChatProcessor } from '../../processor';
|
|
17
|
-
import { ServiceType } from '../../types';
|
|
18
18
|
|
|
19
|
-
export type ToolboxProps =
|
|
19
|
+
export type ToolboxProps = {
|
|
20
20
|
services?: { service: ServiceType }[];
|
|
21
|
-
functions?:
|
|
21
|
+
functions?: Operation.PersistentOperation[];
|
|
22
22
|
// TODO(burdon): Combine into single array.
|
|
23
23
|
blueprints?: readonly Blueprint.Blueprint[];
|
|
24
24
|
activeBlueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
25
|
-
}>;
|
|
26
|
-
|
|
27
|
-
export const Toolbox = ({ classNames, functions, services, blueprints, activeBlueprints }: ToolboxProps) => {
|
|
28
|
-
const { t } = useTranslation(meta.id);
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div className={mx('flex flex-col overflow-y-auto box-content', classNames)}>
|
|
32
|
-
{blueprints && blueprints.length > 0 && (
|
|
33
|
-
<Section
|
|
34
|
-
title='Blueprints'
|
|
35
|
-
items={blueprints.map(({ name, description, tools }) => ({
|
|
36
|
-
name,
|
|
37
|
-
description,
|
|
38
|
-
subitems: tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
39
|
-
}))}
|
|
40
|
-
/>
|
|
41
|
-
)}
|
|
42
|
-
|
|
43
|
-
{activeBlueprints && activeBlueprints.length > 0 && (
|
|
44
|
-
<Section
|
|
45
|
-
title='Blueprints'
|
|
46
|
-
items={activeBlueprints.map(({ target }) => ({
|
|
47
|
-
name: target?.name ?? '',
|
|
48
|
-
description: target?.description ?? '',
|
|
49
|
-
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
50
|
-
}))}
|
|
51
|
-
/>
|
|
52
|
-
)}
|
|
53
|
-
|
|
54
|
-
{services && services.length > 0 && (
|
|
55
|
-
<Section
|
|
56
|
-
title='Services'
|
|
57
|
-
items={services.map(({ service: { serviceId, name, description } }) => ({
|
|
58
|
-
name: name ?? serviceId,
|
|
59
|
-
description,
|
|
60
|
-
// subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
61
|
-
}))}
|
|
62
|
-
/>
|
|
63
|
-
)}
|
|
64
|
-
|
|
65
|
-
{functions && functions.length > 0 && (
|
|
66
|
-
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
67
|
-
)}
|
|
68
|
-
</div>
|
|
69
|
-
);
|
|
70
25
|
};
|
|
71
26
|
|
|
72
|
-
const
|
|
27
|
+
export const Toolbox = composable<HTMLDivElement, ToolboxProps>(
|
|
28
|
+
({ functions, services, blueprints, activeBlueprints, ...props }, forwardedRef) => {
|
|
29
|
+
return (
|
|
30
|
+
<ScrollArea.Root {...composableProps(props)} thin orientation='vertical' ref={forwardedRef}>
|
|
31
|
+
<ScrollArea.Viewport>
|
|
32
|
+
{blueprints && blueprints.length > 0 && (
|
|
33
|
+
<Section
|
|
34
|
+
title='Blueprints'
|
|
35
|
+
items={blueprints.map(({ name, description, tools }) => ({
|
|
36
|
+
name,
|
|
37
|
+
description,
|
|
38
|
+
subitems: tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
39
|
+
}))}
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
|
|
43
|
+
{activeBlueprints && activeBlueprints.length > 0 && (
|
|
44
|
+
<Section
|
|
45
|
+
title='Blueprints'
|
|
46
|
+
items={activeBlueprints.map(({ target }) => ({
|
|
47
|
+
name: target?.name ?? '',
|
|
48
|
+
description: target?.description ?? '',
|
|
49
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
50
|
+
}))}
|
|
51
|
+
/>
|
|
52
|
+
)}
|
|
53
|
+
|
|
54
|
+
{services && services.length > 0 && (
|
|
55
|
+
<Section
|
|
56
|
+
title='Services'
|
|
57
|
+
items={services.map(({ service: { serviceId, name, description } }) => ({
|
|
58
|
+
name: name ?? serviceId,
|
|
59
|
+
description,
|
|
60
|
+
// subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
61
|
+
}))}
|
|
62
|
+
/>
|
|
63
|
+
)}
|
|
64
|
+
|
|
65
|
+
{functions && functions.length > 0 && (
|
|
66
|
+
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
67
|
+
)}
|
|
68
|
+
</ScrollArea.Viewport>
|
|
69
|
+
</ScrollArea.Root>
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
Toolbox.displayName = 'Toolbox';
|
|
75
|
+
|
|
76
|
+
type SectionProps = {
|
|
73
77
|
title: string;
|
|
74
78
|
items: { name: string; description?: string; subitems?: { name: string; description?: string }[] }[];
|
|
75
79
|
striped?: boolean;
|
|
76
|
-
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const Section = ({ title, items, striped }: SectionProps) => {
|
|
77
83
|
const stripeClassNames = 'odd:bg-neutral-50 dark:odd:bg-neutral-800';
|
|
78
84
|
const gridClassNames = 'grid grid-cols-[8rem_1fr]';
|
|
79
|
-
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs
|
|
85
|
+
const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs px-2', striped && stripeClassNames);
|
|
80
86
|
|
|
81
87
|
return (
|
|
82
88
|
<div>
|
|
83
|
-
<h1 className='
|
|
89
|
+
<h1 className='px-2 text-sm'>{title}</h1>
|
|
84
90
|
<div className={gridClassNames}>
|
|
85
91
|
{items.map(({ name, description, subitems }, i) => (
|
|
86
92
|
<Fragment key={i}>
|
|
@@ -103,12 +109,12 @@ const Section: FC<{
|
|
|
103
109
|
);
|
|
104
110
|
};
|
|
105
111
|
|
|
106
|
-
export type
|
|
112
|
+
export type ToolboxPanelProps = ThemedClassName<{
|
|
107
113
|
db?: Database.Database;
|
|
108
114
|
processor?: AiChatProcessor;
|
|
109
115
|
}>;
|
|
110
116
|
|
|
111
|
-
export const
|
|
117
|
+
export const ToolboxPanel = ({ classNames, db, processor }: ToolboxPanelProps) => {
|
|
112
118
|
// Registered services.
|
|
113
119
|
const services = useQuery(db, Filter.type(ServiceType));
|
|
114
120
|
const [serviceTools, setServiceTools] = useState<{ service: ServiceType }[]>([]);
|
|
@@ -124,7 +130,7 @@ export const ToolboxContainer = ({ classNames, db, processor }: ToolboxContainer
|
|
|
124
130
|
}, [services]);
|
|
125
131
|
|
|
126
132
|
// Deployed functions.
|
|
127
|
-
const functions = useQuery(db, Filter.type(
|
|
133
|
+
const functions = useQuery(db, Filter.type(Operation.PersistentOperation));
|
|
128
134
|
|
|
129
135
|
return (
|
|
130
136
|
<Toolbox
|
|
@@ -12,12 +12,12 @@ import { runInRuntime } from '@dxos/effect';
|
|
|
12
12
|
import { log } from '@dxos/log';
|
|
13
13
|
import { Button, Icon, Input, ThemeProvider } from '@dxos/react-ui';
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export type AssistantToolbarProps = {
|
|
16
16
|
view: EditorView;
|
|
17
17
|
from: number;
|
|
18
18
|
to: number;
|
|
19
19
|
runtime: Runtime.Runtime<LanguageModel.LanguageModel>;
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
21
|
|
|
22
22
|
export const AssistantToolbar = ({ view, from, to, runtime }: AssistantToolbarProps) => {
|
|
23
23
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
@@ -99,7 +99,7 @@ export const AssistantToolbar = ({ view, from, to, runtime }: AssistantToolbarPr
|
|
|
99
99
|
</Input.Root>
|
|
100
100
|
<Button
|
|
101
101
|
variant='ghost'
|
|
102
|
-
classNames='p-1 min-
|
|
102
|
+
classNames='p-1 min-h-0 h-6 w-6 rounded-full'
|
|
103
103
|
onClick={handleEditWithPrompt}
|
|
104
104
|
disabled={!customPrompt || isProcessing}
|
|
105
105
|
>
|
|
@@ -118,7 +118,7 @@ export const AssistantToolbar = ({ view, from, to, runtime }: AssistantToolbarPr
|
|
|
118
118
|
onClick={handleCasual}
|
|
119
119
|
disabled={isProcessing}
|
|
120
120
|
>
|
|
121
|
-
<Icon icon='ph--caret-left--regular'
|
|
121
|
+
<Icon icon='ph--caret-left--regular' />
|
|
122
122
|
<span className='text-[10px] leading-none text-neutral-500 font-medium'>Casual</span>
|
|
123
123
|
</Button>
|
|
124
124
|
|
|
@@ -128,7 +128,7 @@ export const AssistantToolbar = ({ view, from, to, runtime }: AssistantToolbarPr
|
|
|
128
128
|
onClick={handleRegenerate}
|
|
129
129
|
disabled={isProcessing}
|
|
130
130
|
>
|
|
131
|
-
<Icon icon='ph--arrows-clockwise--regular'
|
|
131
|
+
<Icon icon='ph--arrows-clockwise--regular' classNames={isProcessing ? 'animate-spin' : ''} />
|
|
132
132
|
<span className='text-[10px] leading-none text-neutral-500 font-medium'>Different</span>
|
|
133
133
|
</Button>
|
|
134
134
|
|
|
@@ -138,7 +138,7 @@ export const AssistantToolbar = ({ view, from, to, runtime }: AssistantToolbarPr
|
|
|
138
138
|
onClick={handleFormal}
|
|
139
139
|
disabled={isProcessing}
|
|
140
140
|
>
|
|
141
|
-
<Icon icon='ph--caret-right--regular'
|
|
141
|
+
<Icon icon='ph--caret-right--regular' />
|
|
142
142
|
<span className='text-[10px] leading-none text-neutral-500 font-medium'>Formal</span>
|
|
143
143
|
</Button>
|
|
144
144
|
</div>
|
|
@@ -151,7 +151,7 @@ export const AssistantToolbar = ({ view, from, to, runtime }: AssistantToolbarPr
|
|
|
151
151
|
onClick={() => setShowPromptInput(true)}
|
|
152
152
|
disabled={isProcessing}
|
|
153
153
|
>
|
|
154
|
-
<Icon icon='ph--keyboard--regular'
|
|
154
|
+
<Icon icon='ph--keyboard--regular' />
|
|
155
155
|
<span className='text-[10px] leading-none text-neutral-500 font-medium'>Instruct</span>
|
|
156
156
|
</Button>
|
|
157
157
|
</div>
|
|
@@ -11,15 +11,14 @@ import React, { useEffect, useState } from 'react';
|
|
|
11
11
|
|
|
12
12
|
import { AiService } from '@dxos/ai';
|
|
13
13
|
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
14
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
15
|
|
|
15
16
|
import { Typewriter } from './Typewriter';
|
|
16
17
|
|
|
17
18
|
const meta: Meta<typeof Typewriter> = {
|
|
18
|
-
title: 'plugins/plugin-assistant/Typewriter',
|
|
19
|
+
title: 'plugins/plugin-assistant/components/Typewriter',
|
|
19
20
|
component: Typewriter,
|
|
20
|
-
|
|
21
|
-
layout: 'centered',
|
|
22
|
-
},
|
|
21
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
export default meta;
|
|
@@ -49,7 +48,7 @@ The quick brown fox jumps over teh lazy dog. i think this is cool.
|
|
|
49
48
|
|
|
50
49
|
export const Default: Story = {
|
|
51
50
|
render: () => {
|
|
52
|
-
const [
|
|
51
|
+
const [runtime, setRuntime] = useState<Runtime.Runtime<LanguageModel.LanguageModel>>();
|
|
53
52
|
useEffect(() => {
|
|
54
53
|
let disposed = false;
|
|
55
54
|
const rt = ManagedRuntime.make(
|
|
@@ -59,10 +58,18 @@ export const Default: Story = {
|
|
|
59
58
|
),
|
|
60
59
|
);
|
|
61
60
|
queueMicrotask(async () => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
try {
|
|
62
|
+
if (disposed) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const runtime = await rt.runtime();
|
|
66
|
+
if (disposed) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
setRuntime(runtime);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
console.error('Failed to initialize runtime:', error);
|
|
72
|
+
}
|
|
66
73
|
});
|
|
67
74
|
return () => {
|
|
68
75
|
disposed = true;
|
|
@@ -70,14 +77,10 @@ export const Default: Story = {
|
|
|
70
77
|
};
|
|
71
78
|
}, []);
|
|
72
79
|
|
|
73
|
-
if (!
|
|
80
|
+
if (!runtime) {
|
|
74
81
|
return <div>...Loading</div>;
|
|
75
82
|
}
|
|
76
83
|
|
|
77
|
-
return
|
|
78
|
-
<div className='w-[800px] p-4'>
|
|
79
|
-
<Typewriter initialContent={sampleText} runtime={rtEffect} />
|
|
80
|
-
</div>
|
|
81
|
-
);
|
|
84
|
+
return <Typewriter initialContent={sampleText} runtime={runtime} />;
|
|
82
85
|
},
|
|
83
86
|
};
|
|
@@ -7,7 +7,7 @@ import type * as LanguageModel from '@effect/ai/LanguageModel';
|
|
|
7
7
|
import type * as Runtime from 'effect/Runtime';
|
|
8
8
|
import React, { useMemo, useRef } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { ThemeProvider } from '@dxos/react-ui';
|
|
11
11
|
import { Editor, type EditorController } from '@dxos/react-ui-editor';
|
|
12
12
|
import {
|
|
13
13
|
createBasicExtensions,
|
|
@@ -40,15 +40,11 @@ export const Typewriter = ({ initialContent = '', extensions = [], runtime }: Ty
|
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<ThemeProvider>
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
<Editor.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</Editor.Viewport>
|
|
49
|
-
</Editor.Root>
|
|
50
|
-
</div>
|
|
51
|
-
</DensityProvider>
|
|
43
|
+
<Editor.Root ref={editorRef}>
|
|
44
|
+
<Editor.Viewport>
|
|
45
|
+
<Editor.Content initialValue={initialContent} extensions={extension} />
|
|
46
|
+
</Editor.Viewport>
|
|
47
|
+
</Editor.Root>
|
|
52
48
|
</ThemeProvider>
|
|
53
49
|
);
|
|
54
50
|
};
|
|
@@ -8,7 +8,7 @@ import { EditorView, type Tooltip, showTooltip } from '@codemirror/view';
|
|
|
8
8
|
import * as LanguageModel from '@effect/ai/LanguageModel';
|
|
9
9
|
import * as Effect from 'effect/Effect';
|
|
10
10
|
import * as Runtime from 'effect/Runtime';
|
|
11
|
-
import
|
|
11
|
+
import { createElement } from 'react';
|
|
12
12
|
import { createRoot } from 'react-dom/client';
|
|
13
13
|
|
|
14
14
|
import { unwrapExit } from '@dxos/effect';
|
|
@@ -54,8 +54,7 @@ const assistantState = (runtime: Runtime.Runtime<LanguageModel.LanguageModel>) =
|
|
|
54
54
|
const dom = document.createElement('div');
|
|
55
55
|
dom.classList.add('cm-tooltip-assistant');
|
|
56
56
|
const root = createRoot(dom);
|
|
57
|
-
|
|
58
|
-
root.render(React.createElement(AssistantToolbar, { view, runtime, from, to }));
|
|
57
|
+
root.render(createElement(AssistantToolbar, { view, runtime, from, to }));
|
|
59
58
|
|
|
60
59
|
return {
|
|
61
60
|
dom,
|
|
@@ -111,9 +110,7 @@ const assistantLinter = (runtime: Runtime.Runtime<LanguageModel.LanguageModel>)
|
|
|
111
110
|
if (match) {
|
|
112
111
|
suggestions = JSON.parse(match[0]);
|
|
113
112
|
}
|
|
114
|
-
} catch
|
|
115
|
-
// failed to parse
|
|
116
|
-
}
|
|
113
|
+
} catch {}
|
|
117
114
|
|
|
118
115
|
const diagnostics: Diagnostic[] = [];
|
|
119
116
|
for (const s of suggestions) {
|
|
@@ -137,8 +134,8 @@ const assistantLinter = (runtime: Runtime.Runtime<LanguageModel.LanguageModel>)
|
|
|
137
134
|
}
|
|
138
135
|
}
|
|
139
136
|
return diagnostics;
|
|
140
|
-
} catch (
|
|
141
|
-
log.
|
|
137
|
+
} catch (error) {
|
|
138
|
+
log.catch(error);
|
|
142
139
|
return [];
|
|
143
140
|
}
|
|
144
141
|
});
|
package/src/components/index.ts
CHANGED
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { lazy } from 'react';
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export * from './AssistantSettings';
|
|
8
7
|
export * from './Chat';
|
|
8
|
+
export * from './ProcessTree';
|
|
9
9
|
export * from './TemplateEditor';
|
|
10
10
|
export * from './Toolbox';
|
|
11
11
|
|
|
12
|
-
export const
|
|
13
|
-
export const ChatCompanion = lazy(() => import('./ChatCompanion'));
|
|
14
|
-
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
|
15
|
-
export const ChatDialog = lazy(() => import('./ChatDialog'));
|
|
16
|
-
export const PromptArticle = lazy(() => import('./PromptArticle'));
|
|
12
|
+
export const AssistantSettings: ComponentType<any> = lazy(() => import('./AssistantSettings'));
|