@dxos/plugin-assistant 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5
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 +8 -0
- package/dist/lib/browser/blueprints/index.mjs.map +7 -0
- 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-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-LMVTXH54.mjs +154 -0
- package/dist/lib/browser/chunk-LMVTXH54.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-ZEZA34MZ.mjs +65 -0
- package/dist/lib/browser/ensure-companion-chat-ZEZA34MZ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3410 -223
- 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-THLK5YQC.mjs +136 -0
- package/dist/lib/browser/run-prompt-in-new-chat-THLK5YQC.mjs.map +7 -0
- package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs +54 -0
- package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -14
- 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 +9 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-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-W3JZ2F4T.mjs +155 -0
- package/dist/lib/node-esm/chunk-W3JZ2F4T.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-6K2WEWFP.mjs +66 -0
- package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3410 -223
- 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-OUYKCMQ7.mjs +137 -0
- package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs.map +7 -0
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs +55 -0
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -14
- 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 +2 -1
- 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 +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- 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 +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- 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 +29 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +16 -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 +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +4 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- 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 -4
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +15 -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 +41 -19
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +39 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +1 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +10 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +7 -5
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +22 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +19 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts +11 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +5 -6
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +7 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +2 -2
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +13 -17
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +24 -221
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +35 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +43 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/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 +15 -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 +9 -11
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +13 -7
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +16 -5
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +10 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +12 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +17 -21
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +14 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -8
- 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 +21 -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 +16 -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 +21 -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 +9 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +15 -0
- package/dist/types/src/containers/TracePanel/TracePanel.stories.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/execution-graph.d.ts +17 -0
- package/dist/types/src/containers/TracePanel/execution-graph.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/index.d.ts +10 -5
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +25 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +12 -24
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +10 -0
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +5 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts +7 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +5 -4
- 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 +3 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/processor/presets.d.ts +13 -0
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +80 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +8 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts +2 -2
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/testing/trace-timeline.test.d.ts +2 -0
- package/dist/types/src/testing/trace-timeline.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -64
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +20 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +11 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +32 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +5 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +14 -213
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +151 -93
- package/src/AssistantPlugin.tsx +222 -114
- 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/{components/SequenceEditor → blueprints}/index.ts +1 -1
- package/src/capabilities/ai-service.ts +30 -0
- package/src/capabilities/app-graph-builder.ts +192 -227
- package/src/capabilities/blueprint-definition.ts +58 -0
- package/src/capabilities/companion-chat-provisioner.ts +164 -0
- package/src/capabilities/edge-model-resolver.ts +33 -0
- package/src/capabilities/index.ts +21 -8
- package/src/capabilities/local-model-resolver.ts +48 -0
- package/src/capabilities/markdown.ts +40 -0
- package/src/capabilities/migrations.ts +35 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +140 -123
- package/src/capabilities/settings.ts +24 -12
- package/src/capabilities/state.ts +35 -0
- package/src/capabilities/toolkit.ts +13 -0
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +34 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +102 -75
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +310 -184
- package/src/components/Chat/events.ts +63 -0
- package/src/components/Chat/index.ts +2 -0
- package/src/components/ChatProgress/ChatProgress.tsx +56 -0
- package/src/components/ChatProgress/index.ts +5 -0
- package/src/components/ChatPrompt/ChatActions.tsx +46 -47
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +122 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +404 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +29 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +42 -37
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +33 -17
- package/src/components/ChatPrompt/index.ts +2 -3
- package/src/components/ChatThread/ChatThread.stories.tsx +120 -125
- package/src/components/ChatThread/ChatThread.tsx +80 -50
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/MarkdownStream.stories.tsx +243 -0
- package/src/components/ChatThread/registry.tsx +238 -0
- package/src/components/ChatThread/sync.test.ts +99 -0
- package/src/components/ChatThread/sync.ts +165 -0
- 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-2.md +56 -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 +86 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +54 -43
- package/src/components/TemplateEditor/TemplateEditor.tsx +62 -60
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +39 -25
- package/src/components/TemplateEditor/TemplateForm.tsx +123 -81
- 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 +144 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +17 -29
- package/src/components/Toolbox/Toolbox.tsx +88 -110
- package/src/components/index.ts +3 -11
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
- package/src/containers/AgentArticle/AgentArticle.tsx +198 -0
- package/src/containers/AgentArticle/index.ts +5 -0
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +100 -0
- package/src/containers/AgentProperties/AgentProperties.tsx +158 -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/containers/ChatCompanion/ChatCompanion.tsx +142 -0
- 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/containers/ChatDialog/ChatDialog.tsx +72 -0
- 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.stories.tsx +230 -0
- package/src/containers/TracePanel/TracePanel.tsx +114 -0
- package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/containers/TracePanel/dxn-extractor.ts +178 -0
- package/src/containers/TracePanel/execution-graph.ts +425 -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/index.ts +10 -6
- package/src/hooks/useBlueprintRegistry.ts +109 -0
- package/src/hooks/useChatProcessor.ts +90 -0
- package/src/hooks/useChatServices.ts +26 -0
- package/src/hooks/useChatToolbarActions.ts +122 -0
- package/src/hooks/useContextBinder.ts +43 -0
- package/src/hooks/useContextObjects.ts +50 -0
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +45 -0
- package/src/hooks/useReferencesProvider.ts +54 -0
- package/src/index.ts +3 -2
- package/src/meta.ts +15 -9
- 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 +6 -0
- package/src/processor/presets.ts +68 -0
- package/src/processor/processor.test.ts +40 -0
- package/src/processor/processor.ts +321 -0
- package/src/queue-logger.ts +33 -23
- package/src/testing/index.ts +1 -1
- package/src/testing/test-generator.ts +293 -0
- package/src/testing/test-sequence.ts +5 -32
- package/src/testing/test-services.ts +10 -14
- package/src/testing/trace-timeline.conversations.json +1 -0
- package/src/testing/trace-timeline.test.ts +246 -0
- package/src/translations.ts +166 -55
- package/src/types/Assistant.ts +14 -0
- package/src/types/Settings.ts +21 -0
- package/src/types/capabilities.ts +35 -0
- package/src/types/defs.ts +5 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +8 -2
- package/src/types/service.ts +27 -16
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/ChatContainer-6XNB5NEI.mjs +0 -57
- package/dist/lib/browser/ChatContainer-6XNB5NEI.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-IMWPRXTO.mjs +0 -74
- package/dist/lib/browser/ChatDialog-IMWPRXTO.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-6XOYB2RN.mjs +0 -322
- package/dist/lib/browser/SequenceContainer-6XOYB2RN.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-6ZGGH5T4.mjs +0 -28
- package/dist/lib/browser/TemplateContainer-6ZGGH5T4.mjs.map +0 -7
- package/dist/lib/browser/ai-client-ML7OQWAO.mjs +0 -39
- package/dist/lib/browser/ai-client-ML7OQWAO.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-UJ5NHRGK.mjs +0 -223
- package/dist/lib/browser/app-graph-builder-UJ5NHRGK.mjs.map +0 -7
- package/dist/lib/browser/chunk-44HZKIAW.mjs +0 -87
- package/dist/lib/browser/chunk-44HZKIAW.mjs.map +0 -7
- package/dist/lib/browser/chunk-LKP65RPA.mjs +0 -20
- package/dist/lib/browser/chunk-LKP65RPA.mjs.map +0 -7
- package/dist/lib/browser/chunk-NTBGTFTV.mjs +0 -15
- package/dist/lib/browser/chunk-NTBGTFTV.mjs.map +0 -7
- package/dist/lib/browser/chunk-OZL4OHTU.mjs +0 -157
- package/dist/lib/browser/chunk-OZL4OHTU.mjs.map +0 -7
- package/dist/lib/browser/chunk-TQ3QW3HJ.mjs +0 -2072
- package/dist/lib/browser/chunk-TQ3QW3HJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-TU7UUGWQ.mjs +0 -203
- package/dist/lib/browser/chunk-TU7UUGWQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-WPZ4UANI.mjs +0 -16
- package/dist/lib/browser/chunk-WPZ4UANI.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-LEAPB55Q.mjs +0 -42
- package/dist/lib/browser/intent-resolver-LEAPB55Q.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TMF7JJA4.mjs +0 -156
- package/dist/lib/browser/react-surface-TMF7JJA4.mjs.map +0 -7
- package/dist/lib/browser/settings-N4HEXADL.mjs +0 -22
- package/dist/lib/browser/settings-N4HEXADL.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-VOLG7J6N.mjs +0 -58
- package/dist/lib/node-esm/ChatContainer-VOLG7J6N.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-B2XNUNRM.mjs +0 -75
- package/dist/lib/node-esm/ChatDialog-B2XNUNRM.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-WWG6IMN3.mjs +0 -323
- package/dist/lib/node-esm/SequenceContainer-WWG6IMN3.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-6KRNEMVE.mjs +0 -29
- package/dist/lib/node-esm/TemplateContainer-6KRNEMVE.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-2FQ434CT.mjs +0 -40
- package/dist/lib/node-esm/ai-client-2FQ434CT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-MEQ5CYNI.mjs +0 -224
- package/dist/lib/node-esm/app-graph-builder-MEQ5CYNI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D3HTVK5D.mjs +0 -2073
- package/dist/lib/node-esm/chunk-D3HTVK5D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E6V2RUQ2.mjs +0 -16
- package/dist/lib/node-esm/chunk-E6V2RUQ2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HVMVHP4R.mjs +0 -158
- package/dist/lib/node-esm/chunk-HVMVHP4R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HXKRKIN2.mjs +0 -18
- package/dist/lib/node-esm/chunk-HXKRKIN2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs +0 -22
- package/dist/lib/node-esm/chunk-KOC6ESG7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VESVUAOS.mjs +0 -88
- package/dist/lib/node-esm/chunk-VESVUAOS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YYUVTTVK.mjs +0 -204
- package/dist/lib/node-esm/chunk-YYUVTTVK.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-4ULF3F7U.mjs +0 -43
- package/dist/lib/node-esm/intent-resolver-4ULF3F7U.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-6XL6SWL2.mjs +0 -157
- package/dist/lib/node-esm/react-surface-6XL6SWL2.mjs.map +0 -7
- package/dist/lib/node-esm/settings-WQ76EG6O.mjs +0 -23
- package/dist/lib/node-esm/settings-WQ76EG6O.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-client.d.ts +0 -5
- package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -6
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -11
- 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/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatPrompt/events.d.ts +0 -17
- package/dist/types/src/components/ChatPrompt/events.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -18
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -18
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/PromptSettings.d.ts +0 -6
- package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
- package/dist/types/src/components/SequenceContainer.d.ts +0 -9
- package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -8
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/TemplateContainer.d.ts +0 -9
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -82
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -4
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/hooks/useContextProvider.d.ts +0 -23
- package/dist/types/src/hooks/useContextProvider.d.ts.map +0 -1
- package/dist/types/src/hooks/useServiceContainer.d.ts +0 -8
- package/dist/types/src/hooks/useServiceContainer.d.ts.map +0 -1
- package/dist/types/src/hooks/useTextInputEvents.d.ts +0 -13
- package/dist/types/src/hooks/useTextInputEvents.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/stories/Chat.stories.d.ts +0 -199
- package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -3
- package/dist/types/src/testing/test-functions.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -71
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/template.d.ts +0 -56
- package/dist/types/src/types/template.d.ts.map +0 -1
- package/src/capabilities/ai-client.ts +0 -39
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/intent-resolver.ts +0 -45
- package/src/components/ChatContainer.tsx +0 -45
- package/src/components/ChatDialog.tsx +0 -65
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatPrompt/events.ts +0 -12
- package/src/components/ChatThread/ChatMessage.tsx +0 -238
- package/src/components/ChatThread/ToolBlock.tsx +0 -111
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/components/PromptSettings.tsx +0 -91
- package/src/components/SequenceContainer.tsx +0 -139
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -32
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/components/TemplateContainer.tsx +0 -25
- package/src/events.ts +0 -11
- package/src/hooks/chat-processor.test.ts +0 -15
- package/src/hooks/chat-processor.ts +0 -281
- package/src/hooks/useBlueprints.ts +0 -31
- package/src/hooks/useChatProcessor.tsx +0 -142
- package/src/hooks/useContextProvider.ts +0 -61
- package/src/hooks/useServiceContainer.ts +0 -42
- package/src/hooks/useTextInputEvents.ts +0 -49
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/stories/Chat.stories.tsx +0 -269
- package/src/testing/test-functions.ts +0 -11
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -86
- package/src/types/template.ts +0 -66
- package/src/typings.d.ts +0 -9
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Blueprint, type BlueprintRegistry } from '@dxos/assistant';
|
|
8
|
-
import { DropdownMenu, IconButton, Input, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
|
|
10
|
-
import { meta } from '../../meta';
|
|
11
|
-
|
|
12
|
-
export type ChatOptionsMenuProps = {
|
|
13
|
-
blueprintRegistry?: BlueprintRegistry;
|
|
14
|
-
blueprints?: Blueprint[];
|
|
15
|
-
onChange?: (key: string, active: boolean) => void;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const ChatOptionsMenu = ({ blueprintRegistry, blueprints, onChange }: ChatOptionsMenuProps) => {
|
|
19
|
-
const { t } = useTranslation(meta.id);
|
|
20
|
-
const blueprintOptions = useMemo(
|
|
21
|
-
() => blueprintRegistry?.query().map((blueprint) => ({ key: blueprint.key, label: blueprint.name })),
|
|
22
|
-
[blueprintRegistry],
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<DropdownMenu.Root>
|
|
27
|
-
<DropdownMenu.Trigger asChild disabled={!blueprintOptions?.length}>
|
|
28
|
-
<IconButton icon='ph--plus--regular' variant='ghost' size={5} iconOnly label={t('button add blueprint')} />
|
|
29
|
-
</DropdownMenu.Trigger>
|
|
30
|
-
<DropdownMenu.Portal>
|
|
31
|
-
<DropdownMenu.Content side='left'>
|
|
32
|
-
<DropdownMenu.Viewport>
|
|
33
|
-
{blueprintOptions?.map((option) => (
|
|
34
|
-
<DropdownMenu.Item key={option.key}>
|
|
35
|
-
<Input.Root>
|
|
36
|
-
<Input.Checkbox
|
|
37
|
-
checked={!!blueprints?.find((blueprint) => blueprint.key === option.key)}
|
|
38
|
-
onCheckedChange={(checked) => onChange?.(option.key, !!checked)}
|
|
39
|
-
/>
|
|
40
|
-
{/* TODO(burdon): Remove need for custom margin. */}
|
|
41
|
-
{/* TODO(burdon): Clicking on label doesn't toggle checkbox. */}
|
|
42
|
-
<Input.Label classNames='m-0'>{option.label}</Input.Label>
|
|
43
|
-
</Input.Root>
|
|
44
|
-
</DropdownMenu.Item>
|
|
45
|
-
))}
|
|
46
|
-
</DropdownMenu.Viewport>
|
|
47
|
-
<DropdownMenu.Arrow />
|
|
48
|
-
</DropdownMenu.Content>
|
|
49
|
-
</DropdownMenu.Portal>
|
|
50
|
-
</DropdownMenu.Root>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
export type ChatEvent =
|
|
6
|
-
| { type: 'submit'; text: string }
|
|
7
|
-
| { type: 'cancel' }
|
|
8
|
-
| { type: 'thread-open' }
|
|
9
|
-
| { type: 'thread-close' }
|
|
10
|
-
| { type: 'scroll-to-bottom' }
|
|
11
|
-
| { type: 'record-start' }
|
|
12
|
-
| { type: 'record-stop' };
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC, type PropsWithChildren } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type MessageContentBlock, type Message, type Tool } from '@dxos/ai';
|
|
8
|
-
import { Surface } from '@dxos/app-framework';
|
|
9
|
-
import { type Obj } from '@dxos/echo';
|
|
10
|
-
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
12
|
-
import { Button, Icon, IconButton, type ThemedClassName } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
14
|
-
MarkdownViewer,
|
|
15
|
-
ToggleContainer as NativeToggleContainer,
|
|
16
|
-
type ToggleContainerProps,
|
|
17
|
-
} from '@dxos/react-ui-components';
|
|
18
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
19
|
-
import { safeParseJson } from '@dxos/util';
|
|
20
|
-
|
|
21
|
-
import { Json, ToolBlock, isToolMessage } from './ToolBlock';
|
|
22
|
-
import { type ChatProcessor } from '../../hooks';
|
|
23
|
-
import { ToolboxContainer } from '../Toolbox';
|
|
24
|
-
|
|
25
|
-
export type ChatMessageProps = ThemedClassName<{
|
|
26
|
-
space?: Space;
|
|
27
|
-
processor?: ChatProcessor;
|
|
28
|
-
message: Message;
|
|
29
|
-
debug?: boolean;
|
|
30
|
-
tools?: Tool[];
|
|
31
|
-
onPrompt?: (text: string) => void;
|
|
32
|
-
onDelete?: (id: string) => void;
|
|
33
|
-
onAddToGraph?: (object: Obj.Any) => void;
|
|
34
|
-
}>;
|
|
35
|
-
|
|
36
|
-
export const ChatMessage = ({
|
|
37
|
-
classNames,
|
|
38
|
-
space,
|
|
39
|
-
processor,
|
|
40
|
-
message,
|
|
41
|
-
tools,
|
|
42
|
-
onPrompt,
|
|
43
|
-
onAddToGraph,
|
|
44
|
-
}: ChatMessageProps) => {
|
|
45
|
-
const { role, content = [] } = message;
|
|
46
|
-
|
|
47
|
-
// TODO(burdon): Restructure types to make check unnecessary.
|
|
48
|
-
if (isToolMessage(message)) {
|
|
49
|
-
return (
|
|
50
|
-
<MessageContainer classNames={mx(classNames, 'animate-[fadeIn_0.5s]')}>
|
|
51
|
-
<ToolBlock classNames={panelClassNames} message={message} tools={tools} />
|
|
52
|
-
</MessageContainer>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return content.map((block, idx) => {
|
|
57
|
-
// TODO(burdon): Filter empty messages.
|
|
58
|
-
if (block.type === 'text' && block.text.replaceAll(/\s+/g, '').length === 0) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const Component = components[block.type] ?? components.default;
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<MessageContainer
|
|
66
|
-
key={idx}
|
|
67
|
-
classNames={mx(classNames, 'animate-[fadeIn_0.5s]')}
|
|
68
|
-
user={block.type === 'text' && role === 'user'}
|
|
69
|
-
>
|
|
70
|
-
<Component space={space} processor={processor} block={block} onPrompt={onPrompt} onAddToGraph={onAddToGraph} />
|
|
71
|
-
</MessageContainer>
|
|
72
|
-
);
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
type BlockComponent = FC<{
|
|
77
|
-
space?: Space;
|
|
78
|
-
/** @deprecated Replace with context */
|
|
79
|
-
processor?: ChatProcessor;
|
|
80
|
-
block: MessageContentBlock;
|
|
81
|
-
onPrompt?: (text: string) => void;
|
|
82
|
-
onAddToGraph?: (object: Obj.Any) => void;
|
|
83
|
-
}>;
|
|
84
|
-
|
|
85
|
-
const components: Record<string, BlockComponent> = {
|
|
86
|
-
//
|
|
87
|
-
// Text
|
|
88
|
-
//
|
|
89
|
-
['text' as const]: ({ block }) => {
|
|
90
|
-
invariant(block.type === 'text');
|
|
91
|
-
// const [open, setOpen] = useState(block.disposition === 'cot' && block.pending);
|
|
92
|
-
const title = block.disposition ? titles[block.disposition] : undefined;
|
|
93
|
-
if (!title) {
|
|
94
|
-
return <MarkdownViewer classNames='[&>p]:animate-[fadeIn_0.5s]' content={block.text} />;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// TOOD(burdon): Store last time user opened/closed COT.
|
|
98
|
-
// Autoclose when streaming ends.
|
|
99
|
-
// useEffect(() => {
|
|
100
|
-
// if (block.disposition === 'cot' && !block.pending) {
|
|
101
|
-
// setOpen(false);
|
|
102
|
-
// }
|
|
103
|
-
// }, [block.disposition, block.pending]);
|
|
104
|
-
|
|
105
|
-
return (
|
|
106
|
-
<ToggleContainer
|
|
107
|
-
// open={open}
|
|
108
|
-
defaultOpen={systemDispositions.includes(block.disposition ?? '') && block.pending}
|
|
109
|
-
title={title}
|
|
110
|
-
icon={
|
|
111
|
-
block.pending ? (
|
|
112
|
-
<Icon icon={'ph--circle-notch--regular'} classNames='text-subdued ml-2 animate-spin' size={4} />
|
|
113
|
-
) : undefined
|
|
114
|
-
}
|
|
115
|
-
>
|
|
116
|
-
<MarkdownViewer
|
|
117
|
-
content={block.text}
|
|
118
|
-
classNames={['pbe-2', systemDispositions.includes(block.disposition ?? '') && 'text-sm text-subdued']}
|
|
119
|
-
/>
|
|
120
|
-
</ToggleContainer>
|
|
121
|
-
);
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
//
|
|
125
|
-
// JSON
|
|
126
|
-
//
|
|
127
|
-
['json' as const]: ({ space, processor, block, onPrompt, onAddToGraph }) => {
|
|
128
|
-
invariant(block.type === 'json');
|
|
129
|
-
|
|
130
|
-
switch (block.disposition) {
|
|
131
|
-
case 'tool_list': {
|
|
132
|
-
return (
|
|
133
|
-
<ToggleContainer title={titles[block.disposition]} defaultOpen={true}>
|
|
134
|
-
<ToolboxContainer space={space} processor={processor} classNames='pbe-2' />
|
|
135
|
-
</ToggleContainer>
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
case 'suggest': {
|
|
140
|
-
const { text = '' }: { text: string } = safeParseJson(block.json ?? '{}') ?? ({} as any);
|
|
141
|
-
return <IconButton icon='ph--lightning--regular' label={text} onClick={() => onPrompt?.(text)} />;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
case 'select': {
|
|
145
|
-
const { options = [] }: { options: string[] } = safeParseJson(block.json ?? '{}') ?? ({} as any);
|
|
146
|
-
return (
|
|
147
|
-
<div className='flex flex-wrap gap-1'>
|
|
148
|
-
{options.map((option, idx) => (
|
|
149
|
-
<Button
|
|
150
|
-
classNames={'animate-[fadeIn_0.5s] rounded-sm text-sm'}
|
|
151
|
-
key={option}
|
|
152
|
-
onClick={() => onPrompt?.(option)}
|
|
153
|
-
>
|
|
154
|
-
{option}
|
|
155
|
-
</Button>
|
|
156
|
-
))}
|
|
157
|
-
</div>
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
case 'graph': {
|
|
162
|
-
return (
|
|
163
|
-
<div className='flex flex-wrap gap-1'>
|
|
164
|
-
<Surface
|
|
165
|
-
role='card'
|
|
166
|
-
data={{ subject: JSON.parse(block.json ?? '{}') }}
|
|
167
|
-
limit={1}
|
|
168
|
-
fallback={<div className='font-mono text-xs text-pre'>{block.json}</div>}
|
|
169
|
-
/>
|
|
170
|
-
{onAddToGraph && (
|
|
171
|
-
<IconButton
|
|
172
|
-
icon='ph--plus--regular'
|
|
173
|
-
label='Add to graph'
|
|
174
|
-
onClick={() => onAddToGraph?.(JSON.parse(block.json ?? '{}'))}
|
|
175
|
-
/>
|
|
176
|
-
)}
|
|
177
|
-
</div>
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
default: {
|
|
182
|
-
const title = block.disposition ? titles[block.disposition] : undefined;
|
|
183
|
-
return (
|
|
184
|
-
<ToggleContainer title={title ?? 'JSON'}>
|
|
185
|
-
<Json data={safeParseJson(block.json ?? block)} />
|
|
186
|
-
</ToggleContainer>
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
//
|
|
193
|
-
// Default
|
|
194
|
-
//
|
|
195
|
-
default: ({ block }) => {
|
|
196
|
-
let title = titles[block.type];
|
|
197
|
-
if (block.type === 'tool_use') {
|
|
198
|
-
title = `Tool [${block.name}]`; // TODO(burdon): Get label from tool.
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<ToggleContainer title={title ?? 'JSON'}>
|
|
203
|
-
<Json data={block} />
|
|
204
|
-
</ToggleContainer>
|
|
205
|
-
);
|
|
206
|
-
},
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
// TODO(burdon): Translations.
|
|
210
|
-
const titles: Record<string, string> = {
|
|
211
|
-
['cot' as const]: 'Chain of thought',
|
|
212
|
-
['artifact' as const]: 'Artifact',
|
|
213
|
-
['tool_use' as const]: 'Tool request',
|
|
214
|
-
['tool_result' as const]: 'Tool result',
|
|
215
|
-
['tool_list' as const]: 'Tools',
|
|
216
|
-
['artifact-update' as const]: 'Artifact(s) changed',
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
const systemDispositions: string[] = ['cot', 'artifact-update'];
|
|
220
|
-
|
|
221
|
-
const panelClassNames = 'flex flex-col w-full px-2 bg-activeSurface rounded-sm';
|
|
222
|
-
const userClassNames = 'bg-[--user-fill] text-accentSurfaceText';
|
|
223
|
-
|
|
224
|
-
const ToggleContainer = (props: ToggleContainerProps) => {
|
|
225
|
-
return <NativeToggleContainer {...props} classNames={mx(panelClassNames, props.classNames)} />;
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const MessageContainer = ({ children, classNames, user }: ThemedClassName<PropsWithChildren<{ user?: boolean }>>) => {
|
|
229
|
-
if (!children) {
|
|
230
|
-
return null;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
return (
|
|
234
|
-
<div role='list-item' className={mx('flex w-full', user && 'justify-end', classNames)}>
|
|
235
|
-
<div className={mx(user ? ['px-2 py-1 rounded-sm', userClassNames] : 'w-full')}>{children}</div>
|
|
236
|
-
</div>
|
|
237
|
-
);
|
|
238
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type AgentStatus, type Message, type Tool } from '@dxos/ai';
|
|
8
|
-
import { log } from '@dxos/log';
|
|
9
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
10
|
-
import { NumericTabs, StatusRoll, ToggleContainer } from '@dxos/react-ui-components';
|
|
11
|
-
import { type JsonProps, Json as NativeJson } from '@dxos/react-ui-syntax-highlighter';
|
|
12
|
-
import { isNonNullable, isNotFalsy } from '@dxos/util';
|
|
13
|
-
|
|
14
|
-
export const isToolMessage = (message: Message) => {
|
|
15
|
-
return message.content.some((block) => block.type === 'tool_use' || block.type === 'tool_result');
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const getToolName = (tool: Tool) => {
|
|
19
|
-
return tool.namespace && tool.function ? `${tool.namespace}:${tool.function}` : tool.name.split('_').pop();
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const getToolCaption = (tool: Tool | undefined, status: AgentStatus | undefined) => {
|
|
23
|
-
if (!tool) {
|
|
24
|
-
return 'Calling tool...';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return status?.message ?? tool.caption ?? `Calling ${getToolName(tool)}...`;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type ToolBlockProps = ThemedClassName<{
|
|
31
|
-
message: Message;
|
|
32
|
-
tools?: Tool[];
|
|
33
|
-
}>;
|
|
34
|
-
|
|
35
|
-
export const ToolBlock: FC<ToolBlockProps> = ({ classNames, message, tools }) => {
|
|
36
|
-
const { content = [] } = message;
|
|
37
|
-
|
|
38
|
-
let request: { tool: Tool | undefined; block: any } | undefined;
|
|
39
|
-
const blocks = content.filter((block) => block.type === 'tool_use' || block.type === 'tool_result');
|
|
40
|
-
const items = blocks
|
|
41
|
-
.map((block) => {
|
|
42
|
-
switch (block.type) {
|
|
43
|
-
case 'tool_use': {
|
|
44
|
-
// TODO(burdon): Skip these updates?
|
|
45
|
-
if (block.pending && request?.block.id === block.id) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
request = { tool: tools?.find((tool) => tool.name === block.name), block };
|
|
50
|
-
return { title: getToolCaption(request.tool, block.currentStatus), block };
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
case 'tool_result': {
|
|
54
|
-
if (!request) {
|
|
55
|
-
log.warn('unexpected message', { block });
|
|
56
|
-
return { title: 'Error', block };
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return { title: `${getToolCaption(request.tool, undefined)} (Success)`, block };
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
default: {
|
|
63
|
-
request = undefined;
|
|
64
|
-
return { title: 'Error', block };
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
})
|
|
68
|
-
.filter(isNonNullable);
|
|
69
|
-
|
|
70
|
-
return <ToolContainer classNames={classNames} items={items} />;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const ToolContainer: FC<ThemedClassName<{ items: { title: string; block: any }[] }>> = ({
|
|
74
|
-
classNames,
|
|
75
|
-
items,
|
|
76
|
-
}) => {
|
|
77
|
-
const tabsRef = useRef<HTMLDivElement>(null);
|
|
78
|
-
const [selected, setSelected] = useState(0);
|
|
79
|
-
const [open, setOpen] = useState(false);
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
if (open) {
|
|
82
|
-
tabsRef.current?.focus();
|
|
83
|
-
}
|
|
84
|
-
}, [open]);
|
|
85
|
-
|
|
86
|
-
const handleSelect = (index: number) => {
|
|
87
|
-
if (index === selected) {
|
|
88
|
-
setOpen(false);
|
|
89
|
-
} else {
|
|
90
|
-
setSelected(index);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const title = useMemo(() => {
|
|
95
|
-
const lines = items.map((item) => item.title).filter(isNotFalsy);
|
|
96
|
-
return <StatusRoll key='status-roll' lines={lines} duration={1_000} autoAdvance />;
|
|
97
|
-
}, [items]);
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<ToggleContainer classNames={['flex flex-col', classNames]} title={title} open={open} onChangeOpen={setOpen}>
|
|
101
|
-
<div className='w-full grid grid-cols-[32px_1fr]'>
|
|
102
|
-
<NumericTabs ref={tabsRef} length={items.length} selected={selected} onSelect={handleSelect} />
|
|
103
|
-
<Json data={items[selected].block} />
|
|
104
|
-
</div>
|
|
105
|
-
</ToggleContainer>
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const Json = ({ data }: Pick<JsonProps, 'data'>) => (
|
|
110
|
-
<NativeJson data={data} classNames='!p-1 text-xs bg-transparent' />
|
|
111
|
-
);
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Message } from '@dxos/ai';
|
|
6
|
-
|
|
7
|
-
// TODO(burdon): Move to util?
|
|
8
|
-
type Reducer<R, I> = (acc: R, value: I) => R;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Reducer that collapses related message blocks into single messages.
|
|
12
|
-
* For example, combines tool request/response pairs into a single message.
|
|
13
|
-
*/
|
|
14
|
-
export const messageReducer: Reducer<{ messages: Message[]; current?: Message }, Message> = (
|
|
15
|
-
{ current, messages },
|
|
16
|
-
message,
|
|
17
|
-
) => {
|
|
18
|
-
let i = 0;
|
|
19
|
-
for (const block of message.content) {
|
|
20
|
-
switch (block.type) {
|
|
21
|
-
case 'tool_use':
|
|
22
|
-
case 'tool_result': {
|
|
23
|
-
if (current) {
|
|
24
|
-
current.content.push(block);
|
|
25
|
-
} else {
|
|
26
|
-
current = {
|
|
27
|
-
id: [message.id, i].join('_'),
|
|
28
|
-
role: message.role,
|
|
29
|
-
content: [block],
|
|
30
|
-
} as any;
|
|
31
|
-
messages.push(current as any);
|
|
32
|
-
}
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
case 'text':
|
|
37
|
-
default: {
|
|
38
|
-
current = undefined;
|
|
39
|
-
messages.push({
|
|
40
|
-
id: [message.id, i].join('_'),
|
|
41
|
-
role: message.role,
|
|
42
|
-
content: [block],
|
|
43
|
-
} as any);
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
i++;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return { current, messages };
|
|
52
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Match, type Schema } from 'effect';
|
|
6
|
-
import React, { type ChangeEvent, useCallback } from 'react';
|
|
7
|
-
|
|
8
|
-
import { debounce } from '@dxos/async';
|
|
9
|
-
import { Input, Select, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
|
|
11
|
-
import { meta } from '../meta';
|
|
12
|
-
import { TemplateKinds, type TemplateType, type TemplateKindSchema } from '../types';
|
|
13
|
-
|
|
14
|
-
export const PromptSettings = ({ template }: { template: TemplateType }) => {
|
|
15
|
-
const { t } = useTranslation(meta.id);
|
|
16
|
-
|
|
17
|
-
const handleKindChange = useCallback(
|
|
18
|
-
(value: string) => {
|
|
19
|
-
const kind = Match.type<string>().pipe(
|
|
20
|
-
Match.withReturnType<Schema.Schema.Type<typeof TemplateKindSchema>>(),
|
|
21
|
-
Match.when('always', () => ({ include: 'always' })),
|
|
22
|
-
Match.when('schema-matching', () => ({ include: 'schema-matching', typename: '' })),
|
|
23
|
-
Match.when('automatically', () => ({ include: 'automatically', description: '' })),
|
|
24
|
-
Match.orElse(() => ({ include: 'manual' })),
|
|
25
|
-
)(value);
|
|
26
|
-
|
|
27
|
-
template.kind = kind;
|
|
28
|
-
},
|
|
29
|
-
[template],
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const handleTypenameChange = useCallback(
|
|
33
|
-
debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
34
|
-
if (template.kind.include === 'schema-matching') {
|
|
35
|
-
template.kind.typename = event.target.value;
|
|
36
|
-
}
|
|
37
|
-
}, 300),
|
|
38
|
-
[template.kind.include],
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
const handleDescriptionChange = useCallback(
|
|
42
|
-
debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
43
|
-
if (template.kind.include === 'automatically') {
|
|
44
|
-
template.kind.description = event.target.value;
|
|
45
|
-
}
|
|
46
|
-
}, 300),
|
|
47
|
-
[template.kind.include],
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<div className='flex flex-col gap-4'>
|
|
52
|
-
<h2>{t('prompt rules label')}</h2>
|
|
53
|
-
<Toolbar.Root>
|
|
54
|
-
<Select.Root value={template.kind.include} onValueChange={handleKindChange}>
|
|
55
|
-
<Toolbar.Button asChild>
|
|
56
|
-
<Select.TriggerButton />
|
|
57
|
-
</Toolbar.Button>
|
|
58
|
-
<Select.Portal>
|
|
59
|
-
<Select.Content>
|
|
60
|
-
<Select.Viewport>
|
|
61
|
-
{TemplateKinds.map((kind) => (
|
|
62
|
-
<Select.Option key={kind} value={kind}>
|
|
63
|
-
{kind}
|
|
64
|
-
</Select.Option>
|
|
65
|
-
))}
|
|
66
|
-
</Select.Viewport>
|
|
67
|
-
</Select.Content>
|
|
68
|
-
</Select.Portal>
|
|
69
|
-
</Select.Root>
|
|
70
|
-
{template.kind.include === 'schema-matching' && (
|
|
71
|
-
<Input.Root>
|
|
72
|
-
<Input.TextInput
|
|
73
|
-
placeholder={t('typename placeholder')}
|
|
74
|
-
defaultValue={template.kind.typename}
|
|
75
|
-
onChange={handleTypenameChange}
|
|
76
|
-
/>
|
|
77
|
-
</Input.Root>
|
|
78
|
-
)}
|
|
79
|
-
{template.kind.include === 'automatically' && (
|
|
80
|
-
<Input.Root>
|
|
81
|
-
<Input.TextInput
|
|
82
|
-
placeholder={t('description placeholder')}
|
|
83
|
-
defaultValue={template.kind.description}
|
|
84
|
-
onChange={handleDescriptionChange}
|
|
85
|
-
/>
|
|
86
|
-
</Input.Root>
|
|
87
|
-
)}
|
|
88
|
-
</Toolbar.Root>
|
|
89
|
-
</div>
|
|
90
|
-
);
|
|
91
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type EditorView } from '@codemirror/view';
|
|
6
|
-
import JSON5 from 'json5';
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
import { ToolRegistry } from '@dxos/ai';
|
|
10
|
-
import { useCapability } from '@dxos/app-framework';
|
|
11
|
-
import { createLocalSearchTool, createExaTool, createGraphWriterTool } from '@dxos/assistant';
|
|
12
|
-
import { getSpace } from '@dxos/client/echo';
|
|
13
|
-
import { type Sequence, type SequenceDefinition, SequenceMachine } from '@dxos/conductor';
|
|
14
|
-
import { DXN, Key } from '@dxos/echo';
|
|
15
|
-
import { Toolbar, useTranslation } from '@dxos/react-ui';
|
|
16
|
-
import { getSelectionSet, useSelectionManager } from '@dxos/react-ui-attention';
|
|
17
|
-
import { StackItem, type StackItemContentProps } from '@dxos/react-ui-stack';
|
|
18
|
-
|
|
19
|
-
import { SequenceEditor } from './SequenceEditor';
|
|
20
|
-
import { AssistantCapabilities } from '../capabilities';
|
|
21
|
-
import { meta } from '../meta';
|
|
22
|
-
import { QueueLogger } from '../queue-logger';
|
|
23
|
-
|
|
24
|
-
// TODO(burdon): Move to config.
|
|
25
|
-
export const EXA_API_KEY = '9c7e17ff-0c85-4cd5-827a-8b489f139e03';
|
|
26
|
-
|
|
27
|
-
// TODO(burdon): Validate.
|
|
28
|
-
const parseSequence = (text: string): SequenceDefinition | undefined => {
|
|
29
|
-
try {
|
|
30
|
-
const json = JSON5.parse(text);
|
|
31
|
-
const { steps } = json;
|
|
32
|
-
return { steps };
|
|
33
|
-
} catch (error) {
|
|
34
|
-
// Ignore.
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const SequenceContainer = ({ role, sequence }: Pick<StackItemContentProps, 'role'> & { sequence: Sequence }) => {
|
|
39
|
-
const { t } = useTranslation(meta.id);
|
|
40
|
-
const aiClient = useCapability(AssistantCapabilities.AiClient);
|
|
41
|
-
const selectionManager = useSelectionManager();
|
|
42
|
-
const [definition, setDefinition] = useState<SequenceDefinition>();
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
setDefinition({
|
|
45
|
-
steps: sequence.steps.map(({ instructions, tools }) => ({ instructions, tools })),
|
|
46
|
-
});
|
|
47
|
-
}, [sequence]);
|
|
48
|
-
|
|
49
|
-
const editorRef = useRef<EditorView | undefined>(undefined);
|
|
50
|
-
|
|
51
|
-
// TODO(burdon): Factor out.
|
|
52
|
-
const toolRegistry = useMemo(() => {
|
|
53
|
-
const space = getSpace(sequence);
|
|
54
|
-
if (!space) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// TODO(burdon): How should the queue be created?
|
|
59
|
-
const queue = space.queues.create();
|
|
60
|
-
|
|
61
|
-
return new ToolRegistry([
|
|
62
|
-
createExaTool({ apiKey: EXA_API_KEY }),
|
|
63
|
-
createLocalSearchTool(space.db, queue),
|
|
64
|
-
createGraphWriterTool({
|
|
65
|
-
db: space.db,
|
|
66
|
-
queue,
|
|
67
|
-
schema: [], // TODO(burdon): Get schema from client/sequence?
|
|
68
|
-
onDone: async (objects) => {
|
|
69
|
-
await queue.append(objects);
|
|
70
|
-
},
|
|
71
|
-
}),
|
|
72
|
-
]);
|
|
73
|
-
}, [sequence]);
|
|
74
|
-
|
|
75
|
-
const formatAndSave = useCallback((): SequenceDefinition | undefined => {
|
|
76
|
-
if (!sequence) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const text = editorRef.current?.state.doc.toString();
|
|
81
|
-
if (!text) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const definition = parseSequence(text);
|
|
86
|
-
if (!definition) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
setDefinition(definition);
|
|
91
|
-
const formatted = JSON.stringify(definition, null, 2);
|
|
92
|
-
editorRef.current?.dispatch({
|
|
93
|
-
changes: { from: 0, to: text.length, insert: formatted },
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
sequence.steps.length = 0;
|
|
97
|
-
for (const step of definition.steps) {
|
|
98
|
-
sequence.steps.push({
|
|
99
|
-
id: Key.ObjectId.random(),
|
|
100
|
-
instructions: step.instructions,
|
|
101
|
-
tools: step.tools,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return sequence;
|
|
106
|
-
}, [sequence]);
|
|
107
|
-
|
|
108
|
-
// TODO(burdon): Save raw sequence separately from parsed sequence? (like Script).
|
|
109
|
-
const handleSave = useCallback(() => formatAndSave(), [formatAndSave]);
|
|
110
|
-
|
|
111
|
-
const handleRun = useCallback(async () => {
|
|
112
|
-
if (!aiClient?.value || !toolRegistry) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
formatAndSave();
|
|
117
|
-
|
|
118
|
-
// Get input from selection.
|
|
119
|
-
const input = Array.from(getSelectionSet(selectionManager)).map((id) => DXN.fromLocalObjectId(id));
|
|
120
|
-
if (!input.length) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const machine = new SequenceMachine(toolRegistry, sequence).setLogger(new QueueLogger(sequence));
|
|
125
|
-
await machine.runToCompletion({ aiClient: aiClient.value, input });
|
|
126
|
-
}, [aiClient.value, sequence, formatAndSave, selectionManager, toolRegistry]);
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<StackItem.Content role={role} toolbar>
|
|
130
|
-
<Toolbar.Root>
|
|
131
|
-
<Toolbar.Button onClick={handleSave}>{t('button save')}</Toolbar.Button>
|
|
132
|
-
<Toolbar.Button onClick={handleRun}>{t('button run')}</Toolbar.Button>
|
|
133
|
-
</Toolbar.Root>
|
|
134
|
-
{definition && <SequenceEditor ref={editorRef} sequence={definition} />}
|
|
135
|
-
</StackItem.Content>
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export default SequenceContainer;
|