@dxos/plugin-assistant 0.8.4-main.ead640a → 0.8.4-main.effb148878
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/AgentArticle-UPXYXYFJ.mjs +166 -0
- package/dist/lib/neutral/AgentArticle-UPXYXYFJ.mjs.map +7 -0
- package/dist/lib/neutral/AgentProperties-W6LD56IB.mjs +40 -0
- package/dist/lib/neutral/AgentProperties-W6LD56IB.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.mjs +10 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs +62 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.mjs +40 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs +40 -0
- package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs.map +7 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs +27 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs.map +7 -0
- package/dist/lib/neutral/ChatArticle-WVAFZPVI.mjs +8 -0
- package/dist/lib/neutral/ChatCompanion-PA5WC4ND.mjs +133 -0
- package/dist/lib/neutral/ChatCompanion-PA5WC4ND.mjs.map +7 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs +72 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs.map +7 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs +28 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs.map +7 -0
- package/dist/lib/neutral/RoutineArticle-HWB5ZQ6O.mjs +119 -0
- package/dist/lib/neutral/RoutineArticle-HWB5ZQ6O.mjs.map +7 -0
- package/dist/lib/neutral/RoutineList-SO5ETHNT.mjs +48 -0
- package/dist/lib/neutral/RoutineList-SO5ETHNT.mjs.map +7 -0
- package/dist/lib/neutral/RoutineProperties-FISLMW2R.mjs +17 -0
- package/dist/lib/neutral/RoutineProperties-FISLMW2R.mjs.map +7 -0
- package/dist/lib/neutral/TracePanel-75DMDJEB.mjs +136 -0
- package/dist/lib/neutral/TracePanel-75DMDJEB.mjs.map +7 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs +92 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs.map +7 -0
- package/dist/lib/neutral/ai-context-ERNAJDGG.mjs +42 -0
- package/dist/lib/neutral/ai-context-ERNAJDGG.mjs.map +7 -0
- package/dist/lib/neutral/ai-service-7SQH5S4F.mjs +34 -0
- package/dist/lib/neutral/ai-service-7SQH5S4F.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-VBWAKZE5.mjs +199 -0
- package/dist/lib/neutral/app-graph-builder-VBWAKZE5.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs +32 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +37 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5H6UJHLF.mjs +30 -0
- package/dist/lib/neutral/chunk-5H6UJHLF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-6UMJI6ON.mjs +110 -0
- package/dist/lib/neutral/chunk-6UMJI6ON.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CJXRQ2YX.mjs +386 -0
- package/dist/lib/neutral/chunk-CJXRQ2YX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JUCBGMF3.mjs +8 -0
- package/dist/lib/neutral/chunk-JUCBGMF3.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SLIPV6NN.mjs +106 -0
- package/dist/lib/neutral/chunk-SLIPV6NN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZWY6Y5IW.mjs +41 -0
- package/dist/lib/neutral/chunk-ZWY6Y5IW.mjs.map +7 -0
- package/dist/lib/neutral/companion-chat-provisioner-7RTSXL6M.mjs +116 -0
- package/dist/lib/neutral/companion-chat-provisioner-7RTSXL6M.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +2373 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +29 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-chat-QQZURUBW.mjs +71 -0
- package/dist/lib/neutral/create-chat-QQZURUBW.mjs.map +7 -0
- package/dist/lib/neutral/create-object-XPVVVEKF.mjs +89 -0
- package/dist/lib/neutral/create-object-XPVVVEKF.mjs.map +7 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs +21 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs.map +7 -0
- package/dist/lib/neutral/ensure-companion-chat-AMOF3C66.mjs +58 -0
- package/dist/lib/neutral/ensure-companion-chat-AMOF3C66.mjs.map +7 -0
- package/dist/lib/neutral/execution-graph/index.mjs +658 -0
- package/dist/lib/neutral/execution-graph/index.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +952 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +32 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs +24 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs.map +7 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs +110 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +12 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs +28 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs.map +7 -0
- package/dist/lib/neutral/on-create-space-Q2R7OSP6.mjs +19 -0
- package/dist/lib/neutral/on-create-space-Q2R7OSP6.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-CC6J7D4K.mjs +174 -0
- package/dist/lib/neutral/react-surface-CC6J7D4K.mjs.map +7 -0
- package/dist/lib/neutral/resolve-navigation-targets-ZHIMMH7L.mjs +22 -0
- package/dist/lib/neutral/resolve-navigation-targets-ZHIMMH7L.mjs.map +7 -0
- package/dist/lib/neutral/run-prompt-in-new-chat-KPXN5YJ2.mjs +102 -0
- package/dist/lib/neutral/run-prompt-in-new-chat-KPXN5YJ2.mjs.map +7 -0
- package/dist/lib/neutral/set-current-chat-VWBPSIMZ.mjs +48 -0
- package/dist/lib/neutral/set-current-chat-VWBPSIMZ.mjs.map +7 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs +28 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs.map +7 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs +28 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/testing.mjs.map +7 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs +21 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs.map +7 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs +14 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +175 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +20 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs +54 -0
- package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts +3 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.node.d.ts +4 -0
- package/dist/types/src/AssistantPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AssistantPlugin.test.d.ts +2 -0
- package/dist/types/src/AssistantPlugin.test.d.ts.map +1 -0
- package/dist/types/src/AssistantPlugin.workerd.d.ts +4 -0
- package/dist/types/src/AssistantPlugin.workerd.d.ts.map +1 -0
- 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.node.test.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/blueprint.node.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-context.d.ts +6 -0
- package/dist/types/src/capabilities/ai-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service.d.ts +5 -2
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- 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 +4 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- 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/create-object.d.ts +31 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +6 -3
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +56 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +9 -3
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- 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 +6 -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 +19 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +4 -2
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/AgentProperties/AgentProperties.d.ts +7 -0
- package/dist/types/src/components/AgentProperties/AgentProperties.d.ts.map +1 -0
- package/dist/types/src/components/AgentProperties/AgentProperties.stories.d.ts +15 -0
- package/dist/types/src/components/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
- package/dist/types/src/components/AgentProperties/index.d.ts +2 -0
- package/dist/types/src/components/AgentProperties/index.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 +42 -33
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/context.d.ts +29 -0
- package/dist/types/src/components/Chat/context.d.ts.map +1 -0
- package/dist/types/src/components/Chat/events.d.ts +5 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +2 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts +12 -0
- package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +10 -6
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +28 -0
- package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +5 -5
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +3 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts +14 -0
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +11 -11
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +15 -266
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +2 -2
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +42 -0
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +19 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +51 -18
- 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/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 +12 -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/defaults.d.ts +5 -0
- package/dist/types/src/components/ChatThread/widgets/defaults.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts +10 -0
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +11 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +7 -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/RoutineProperties/RoutineProperties.d.ts +7 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.d.ts.map +1 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.stories.d.ts +15 -0
- package/dist/types/src/components/RoutineProperties/RoutineProperties.stories.d.ts.map +1 -0
- package/dist/types/src/components/RoutineProperties/index.d.ts +2 -0
- package/dist/types/src/components/RoutineProperties/index.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/TaskList.d.ts +10 -0
- package/dist/types/src/components/TaskList/TaskList.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts +16 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/index.d.ts +2 -0
- package/dist/types/src/components/TaskList/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +7 -5
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -253
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +12 -3
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +2 -254
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
- package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +9 -16
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +14 -13
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -253
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +6 -11
- 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/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/ChatArticle/ChatArticle.d.ts +12 -0
- package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts +15 -0
- package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +26 -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/{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/PlanArticle/PlanArticle.d.ts +6 -0
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +6 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +15 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts +6 -0
- package/dist/types/src/containers/RoutineList/RoutineList.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts +21 -0
- package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineList/index.d.ts +2 -0
- package/dist/types/src/containers/RoutineList/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts +8 -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/index.d.ts +4 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/index.d.ts +3 -0
- package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +14 -0
- package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +12 -0
- package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +5 -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 +13 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts +108 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/execution-graph.test.d.ts +2 -0
- package/dist/types/src/execution-graph/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +3 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/execution-graph/remote-snapshot.test.d.ts +2 -0
- package/dist/types/src/execution-graph/remote-snapshot.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/span-tree.d.ts +76 -0
- package/dist/types/src/execution-graph/span-tree.d.ts.map +1 -0
- package/dist/types/src/execution-graph/span-tree.test.d.ts +2 -0
- package/dist/types/src/execution-graph/span-tree.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts +40 -0
- package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts.map +1 -0
- package/dist/types/src/execution-graph/testing/index.d.ts +2 -0
- package/dist/types/src/execution-graph/testing/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/feed-logger.d.ts +13 -0
- package/dist/types/src/feed-logger.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +4 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +57 -11
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatKeymap.d.ts +12 -0
- package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +10 -7
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +9 -8
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -3
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +10 -9
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useDebug.d.ts +10 -0
- package/dist/types/src/hooks/useDebug.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 +1 -1
- package/dist/types/src/hooks/useFlush.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 -6
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -2
- 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/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 +3 -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/prompt.node.test.d.ts +2 -0
- package/dist/types/src/operations/prompt.node.test.d.ts.map +1 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +17 -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/toggle-trace-panel-debug.d.ts +5 -0
- package/dist/types/src/operations/toggle-trace-panel-debug.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/plugin.d.ts +4 -0
- package/dist/types/src/plugin.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/presets.d.ts +1 -1
- package/dist/types/src/processor/presets.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +261 -40
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/processor.node.test.d.ts +2 -0
- package/dist/types/src/processor/processor.node.test.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/snapshot.d.ts +21 -0
- package/dist/types/src/testing/snapshot.d.ts.map +1 -0
- package/dist/types/src/testing/test-generator.d.ts +4 -4
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.test.d.ts +2 -0
- package/dist/types/src/testing/test-generator.test.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +10 -3
- package/dist/types/src/testing/test-sequence.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/testing/test-trace.d.ts +5 -0
- package/dist/types/src/testing/test-trace.d.ts.map +1 -0
- package/dist/types/src/testing/trace-timeline.node.test.d.ts +2 -0
- package/dist/types/src/testing/trace-timeline.node.test.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -88
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +34 -48
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantCapabilities.d.ts +30 -0
- package/dist/types/src/types/AssistantCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AssistantEvents.d.ts +3 -0
- package/dist/types/src/types/AssistantEvents.d.ts.map +1 -0
- package/dist/types/src/types/AssistantOperation.d.ts +145 -0
- package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +27 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +10 -213
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/src/util/suggestions.d.ts +9 -0
- package/dist/types/src/util/suggestions.d.ts.map +1 -0
- package/dist/types/src/util/suggestions.test.d.ts +2 -0
- package/dist/types/src/util/suggestions.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +206 -110
- package/src/AssistantPlugin.node.ts +71 -0
- package/src/AssistantPlugin.test.ts +49 -0
- package/src/AssistantPlugin.ts +140 -0
- package/src/AssistantPlugin.workerd.ts +41 -0
- package/src/blueprints/assistant/blueprint.node.test.ts +46 -0
- package/src/blueprints/assistant/blueprint.ts +31 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/{components/Toolbar → blueprints}/index.ts +1 -1
- package/src/capabilities/ai-context.ts +85 -0
- package/src/capabilities/ai-service.ts +34 -17
- package/src/capabilities/app-graph-builder.ts +174 -171
- package/src/capabilities/blueprint-definition.ts +47 -55
- package/src/capabilities/companion-chat-provisioner.ts +163 -0
- package/src/capabilities/create-object.ts +98 -0
- package/src/capabilities/edge-model-resolver.ts +22 -14
- package/src/capabilities/index.ts +24 -14
- package/src/capabilities/local-model-resolver.ts +31 -13
- package/src/capabilities/markdown.ts +40 -0
- package/src/capabilities/migrations.ts +28 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +161 -78
- package/src/capabilities/settings.ts +24 -12
- package/src/capabilities/state.ts +27 -12
- package/src/capabilities/toolkit.ts +6 -161
- package/src/components/AgentProperties/AgentProperties.stories.tsx +74 -0
- package/src/components/AgentProperties/AgentProperties.tsx +102 -0
- package/src/components/AgentProperties/index.ts +5 -0
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +35 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +30 -99
- package/src/components/AssistantSettings/index.ts +2 -2
- package/src/components/Chat/Chat.tsx +162 -258
- package/src/components/Chat/context.ts +39 -0
- package/src/components/Chat/events.ts +7 -1
- package/src/components/ChatPrompt/ChatActions.tsx +34 -16
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +50 -0
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +136 -0
- package/src/components/ChatPrompt/ChatOptions.tsx +311 -90
- package/src/components/ChatPrompt/ChatPrompt.tsx +182 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +28 -18
- package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +2 -2
- package/src/components/ChatPrompt/index.ts +3 -0
- package/src/components/ChatThread/Anchor.stories.tsx +95 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +81 -71
- package/src/components/ChatThread/ChatThread.tsx +62 -46
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/Link.tsx +6 -6
- package/src/components/ChatThread/MarkdownStream.stories.tsx +281 -0
- package/src/components/ChatThread/registry.tsx +184 -78
- package/src/components/ChatThread/sync.test.ts +201 -25
- package/src/components/ChatThread/sync.ts +105 -68
- package/src/components/ChatThread/testing/reasoning.md +25 -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/ReasoningWidget.stories.tsx +68 -0
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +133 -0
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +33 -0
- package/src/components/ChatThread/widgets/SelectWidget.ts +39 -0
- package/src/components/ChatThread/widgets/StatsWidget.ts +31 -0
- package/src/components/ChatThread/widgets/StatusWidget.ts +53 -0
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +27 -0
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +55 -0
- package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
- package/src/components/ChatThread/widgets/defaults.ts +8 -0
- package/src/components/ChatThread/widgets/index.ts +13 -0
- package/src/components/ProcessTree/ProcessTree.stories.tsx +83 -0
- package/src/components/ProcessTree/ProcessTree.tsx +122 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/RoutineProperties/RoutineProperties.stories.tsx +59 -0
- package/src/components/RoutineProperties/RoutineProperties.tsx +23 -0
- package/src/components/RoutineProperties/index.ts +5 -0
- package/src/components/TaskList/TaskList.stories.tsx +44 -0
- package/src/components/TaskList/TaskList.tsx +45 -0
- package/src/components/TaskList/index.ts +5 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +18 -14
- package/src/components/TemplateEditor/TemplateEditor.tsx +58 -42
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +21 -15
- package/src/components/TemplateEditor/TemplateForm.tsx +111 -86
- 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 +46 -54
- package/src/components/Toolbox/Toolbox.stories.tsx +16 -18
- package/src/components/Toolbox/Toolbox.tsx +72 -66
- package/src/components/index.ts +6 -10
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
- package/src/containers/AgentArticle/AgentArticle.tsx +197 -0
- package/src/containers/AgentArticle/index.ts +5 -0
- package/src/containers/AgentProperties/AgentProperties.tsx +43 -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/ChatArticle/ChatArticle.stories.tsx +76 -0
- package/src/containers/ChatArticle/ChatArticle.tsx +107 -0
- package/src/containers/ChatArticle/index.ts +5 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +133 -0
- package/src/containers/ChatCompanion/index.ts +5 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +14 -16
- package/src/containers/ChatDialog/index.ts +5 -0
- package/src/containers/PlanArticle/PlanArticle.tsx +33 -0
- package/src/containers/PlanArticle/index.ts +5 -0
- package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +75 -0
- package/src/containers/RoutineArticle/RoutineArticle.tsx +109 -0
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/RoutineList/RoutineList.stories.tsx +130 -0
- package/src/containers/RoutineList/RoutineList.tsx +50 -0
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +319 -0
- package/src/containers/TracePanel/TracePanel.tsx +213 -0
- package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/containers/TracePanel/dxn-extractor.ts +168 -0
- package/src/containers/TracePanel/index.ts +9 -0
- package/src/containers/TracePanel/testing/index.ts +6 -0
- package/src/containers/TracePanel/testing/simulated-agent.ts +114 -0
- package/src/containers/TracePanel/testing/snapshot-playback.ts +45 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +129 -0
- package/src/containers/TriggerStatus/index.ts +5 -0
- package/src/containers/index.ts +17 -0
- package/src/execution-graph/SPEC.md +678 -0
- package/src/execution-graph/execution-graph.test.ts +799 -0
- package/src/execution-graph/execution-graph.ts +714 -0
- package/src/execution-graph/index.ts +24 -0
- package/src/execution-graph/remote-snapshot.test.ts +116 -0
- package/src/execution-graph/span-tree.test.ts +249 -0
- package/src/execution-graph/span-tree.ts +259 -0
- package/src/execution-graph/testing/collect-trace-events.ts +74 -0
- package/src/execution-graph/testing/index.ts +5 -0
- package/src/extensions/index.ts +5 -0
- package/src/extensions/prompt-extension.ts +111 -0
- package/src/feed-logger.ts +149 -0
- package/src/hooks/index.ts +4 -1
- package/src/hooks/useBlueprintRegistry.ts +48 -27
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +60 -28
- package/src/hooks/useChatServices.ts +14 -35
- package/src/hooks/useChatToolbarActions.ts +120 -0
- package/src/hooks/useContextBinder.ts +23 -10
- package/src/hooks/useContextObjects.ts +20 -27
- package/src/hooks/useDebug.ts +38 -0
- package/src/hooks/useFilteredTypes.ts +37 -0
- package/src/hooks/usePresets.ts +2 -1
- package/src/hooks/useReferencesProvider.ts +11 -22
- package/src/index.ts +1 -7
- package/src/meta.ts +33 -7
- package/src/operations/create-chat.ts +84 -0
- package/src/operations/ensure-companion-chat.ts +63 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/on-create-space.ts +24 -0
- package/src/operations/prompt.node.test.ts +80 -0
- package/src/operations/resolve-navigation-targets.ts +31 -0
- package/src/operations/run-prompt-in-new-chat.ts +113 -0
- package/src/operations/set-current-chat.ts +49 -0
- package/src/operations/toggle-trace-panel-debug.ts +27 -0
- package/src/operations/update-chat-name.ts +61 -0
- package/src/plugin.ts +11 -0
- package/src/processor/index.ts +0 -1
- package/src/processor/presets.ts +12 -4
- package/src/processor/processor.node.test.ts +41 -0
- package/src/processor/processor.ts +287 -163
- package/src/testing/data/trace-timeline-multiple.dx.json +1 -0
- package/src/testing/data/trace-timeline-remote.dx.json +1 -0
- package/src/testing/data/trace-timeline.dx.json +4657 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/snapshot.ts +35 -0
- package/src/testing/test-generator.test.ts +71 -0
- package/src/testing/test-generator.ts +217 -194
- package/src/testing/test-sequence.ts +6 -6
- package/src/testing/test-services.ts +9 -7
- package/src/testing/test-trace.ts +20 -0
- package/src/testing/trace-timeline.node.conversations.json +1 -0
- package/src/testing/trace-timeline.node.test.ts +250 -0
- package/src/testing.ts +9 -0
- package/src/translations.ts +162 -82
- package/src/types/Assistant.ts +17 -55
- package/src/types/AssistantCapabilities.ts +35 -0
- package/src/types/AssistantEvents.ts +11 -0
- package/src/types/AssistantOperation.ts +152 -0
- package/src/types/Settings.ts +82 -0
- package/src/types/index.ts +8 -2
- package/src/types/service.ts +9 -11
- package/src/util/suggestions.test.ts +52 -0
- package/src/util/suggestions.ts +42 -0
- package/dist/lib/browser/BlueprintContainer-FOZTO447.mjs +0 -28
- package/dist/lib/browser/BlueprintContainer-FOZTO447.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-EC6LBEWF.mjs +0 -150
- package/dist/lib/browser/ChatCompanion-EC6LBEWF.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-A2SL6WO5.mjs +0 -73
- package/dist/lib/browser/ChatContainer-A2SL6WO5.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-XMOUFX2P.mjs +0 -86
- package/dist/lib/browser/ChatDialog-XMOUFX2P.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs +0 -150
- package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-7AE4R5KJ.mjs +0 -183
- package/dist/lib/browser/app-graph-builder-7AE4R5KJ.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs +0 -12
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs +0 -175
- package/dist/lib/browser/chunk-2CE2KPKZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-37VMDB4P.mjs +0 -220
- package/dist/lib/browser/chunk-37VMDB4P.mjs.map +0 -7
- package/dist/lib/browser/chunk-3EWE2UQD.mjs +0 -220
- package/dist/lib/browser/chunk-3EWE2UQD.mjs.map +0 -7
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs +0 -16
- package/dist/lib/browser/chunk-5EGXHCAZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-5RICKAMN.mjs +0 -18
- package/dist/lib/browser/chunk-5RICKAMN.mjs.map +0 -7
- package/dist/lib/browser/chunk-7THOIN6F.mjs +0 -1802
- package/dist/lib/browser/chunk-7THOIN6F.mjs.map +0 -7
- package/dist/lib/browser/chunk-HYYWP3KP.mjs +0 -170
- package/dist/lib/browser/chunk-HYYWP3KP.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z7DQT64Z.mjs +0 -301
- package/dist/lib/browser/chunk-Z7DQT64Z.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -370
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-BZUU4UNA.mjs +0 -130
- package/dist/lib/browser/intent-resolver-BZUU4UNA.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-KRRUOMYY.mjs +0 -107
- package/dist/lib/browser/react-surface-KRRUOMYY.mjs.map +0 -7
- package/dist/lib/browser/settings-PSR3WF3X.mjs +0 -23
- package/dist/lib/browser/settings-PSR3WF3X.mjs.map +0 -7
- package/dist/lib/browser/state-LXTS54DI.mjs +0 -21
- package/dist/lib/browser/state-LXTS54DI.mjs.map +0 -7
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs +0 -199
- package/dist/lib/browser/toolkit-NQ2GXCF5.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -19
- package/dist/lib/node-esm/BlueprintContainer-6HSEVQ7U.mjs +0 -29
- package/dist/lib/node-esm/BlueprintContainer-6HSEVQ7U.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-NDYEAUQN.mjs +0 -151
- package/dist/lib/node-esm/ChatCompanion-NDYEAUQN.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-NMDQM5HG.mjs +0 -74
- package/dist/lib/node-esm/ChatContainer-NMDQM5HG.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QPRWMRU4.mjs +0 -87
- package/dist/lib/node-esm/ChatDialog-QPRWMRU4.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs +0 -151
- package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-SJCOS64C.mjs +0 -184
- package/dist/lib/node-esm/app-graph-builder-SJCOS64C.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs +0 -13
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs +0 -20
- package/dist/lib/node-esm/chunk-73ABYRYX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HDZX6TSZ.mjs +0 -221
- package/dist/lib/node-esm/chunk-HDZX6TSZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-TMCGJPAN.mjs +0 -171
- package/dist/lib/node-esm/chunk-TMCGJPAN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TW2WKKSR.mjs +0 -302
- package/dist/lib/node-esm/chunk-TW2WKKSR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs +0 -177
- package/dist/lib/node-esm/chunk-U2NYUS2N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs +0 -17
- package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YZYGXFVG.mjs +0 -1803
- package/dist/lib/node-esm/chunk-YZYGXFVG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZQ3THJ2W.mjs +0 -221
- package/dist/lib/node-esm/chunk-ZQ3THJ2W.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -371
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-B7YAS3NT.mjs +0 -131
- package/dist/lib/node-esm/intent-resolver-B7YAS3NT.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-VRDDARFF.mjs +0 -108
- package/dist/lib/node-esm/react-surface-VRDDARFF.mjs.map +0 -7
- package/dist/lib/node-esm/settings-4EBIOJVK.mjs +0 -24
- package/dist/lib/node-esm/settings-4EBIOJVK.mjs.map +0 -7
- package/dist/lib/node-esm/state-BO6GUFLB.mjs +0 -22
- package/dist/lib/node-esm/state-BO6GUFLB.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs +0 -200
- package/dist/lib/node-esm/toolkit-V57PRJNG.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -20
- package/dist/types/src/capabilities/capabilities.d.ts +0 -11
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintContainer.d.ts +0 -8
- package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintSettings.d.ts +0 -6
- package/dist/types/src/components/BlueprintSettings.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 -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/ChatProgress/ChatProgress.d.ts +0 -7
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +0 -1
- package/dist/types/src/components/ChatProgress/index.d.ts +0 -2
- package/dist/types/src/components/ChatProgress/index.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/SequenceContainer.d.ts +0 -8
- package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -272
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
- package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -5
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/index.d.ts +0 -2
- package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +0 -9
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/list.d.ts +0 -10
- package/dist/types/src/functions/list.d.ts.map +0 -1
- package/dist/types/src/functions/load.d.ts +0 -8
- package/dist/types/src/functions/load.d.ts.map +0 -1
- package/dist/types/src/hooks/useItemTypes.d.ts +0 -4
- package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
- package/dist/types/src/processor/processor.test.d.ts +0 -2
- package/dist/types/src/processor/processor.test.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/queue-logger.d.ts +0 -11
- package/dist/types/src/queue-logger.d.ts.map +0 -1
- package/dist/types/src/types/AssistantAction.d.ts +0 -122
- package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
- package/dist/types/src/types/defs.d.ts +0 -2
- package/dist/types/src/types/defs.d.ts.map +0 -1
- package/src/AssistantPlugin.tsx +0 -170
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/intent-resolver.ts +0 -117
- package/src/components/BlueprintContainer.tsx +0 -24
- package/src/components/BlueprintSettings.tsx +0 -15
- package/src/components/ChatCompanion.tsx +0 -136
- package/src/components/ChatContainer.tsx +0 -51
- package/src/components/ChatProgress/ChatProgress.tsx +0 -67
- package/src/components/ChatProgress/index.ts +0 -5
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/components/SequenceContainer.tsx +0 -131
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -34
- package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
- package/src/components/SequenceEditor/index.ts +0 -5
- package/src/components/TemplateEditor/handlebars-extension.ts +0 -165
- package/src/components/Toolbar/Toolbar.tsx +0 -21
- package/src/components/Toolbar/useChatToolbarActions.ts +0 -126
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- package/src/functions/index.ts +0 -7
- package/src/functions/list.ts +0 -48
- package/src/functions/load.ts +0 -46
- package/src/hooks/useItemTypes.ts +0 -37
- package/src/processor/processor.test.ts +0 -81
- package/src/processor/update-name.ts +0 -57
- package/src/queue-logger.ts +0 -125
- package/src/types/AssistantAction.ts +0 -70
- package/src/types/defs.ts +0 -5
- /package/dist/lib/{browser/blueprint-definition-NSJARW5U.mjs.map → neutral/AssistantPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ChatArticle-WVAFZPVI.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-WD2IVMAI.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
package/src/AssistantPlugin.tsx
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
|
-
import { ResearchGraph, ResearchOn } from '@dxos/assistant-testing';
|
|
7
|
-
import { Blueprint, Prompt } from '@dxos/blueprints';
|
|
8
|
-
import { Sequence } from '@dxos/conductor';
|
|
9
|
-
import { Type } from '@dxos/echo';
|
|
10
|
-
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
11
|
-
import { SpaceCapabilities, SpaceEvents } from '@dxos/plugin-space';
|
|
12
|
-
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
AiService,
|
|
16
|
-
AppGraphBuilder,
|
|
17
|
-
AssistantState,
|
|
18
|
-
BlueprintDefinition,
|
|
19
|
-
EdgeModelResolver,
|
|
20
|
-
IntentResolver,
|
|
21
|
-
LocalModelResolver,
|
|
22
|
-
ReactSurface,
|
|
23
|
-
Settings,
|
|
24
|
-
Toolkit,
|
|
25
|
-
} from './capabilities';
|
|
26
|
-
import { AssistantEvents } from './events';
|
|
27
|
-
import { meta } from './meta';
|
|
28
|
-
import { translations } from './translations';
|
|
29
|
-
import { Assistant, AssistantAction, ServiceType } from './types';
|
|
30
|
-
|
|
31
|
-
export const AssistantPlugin = definePlugin(meta, () => [
|
|
32
|
-
defineModule({
|
|
33
|
-
id: `${meta.id}/module/translations`,
|
|
34
|
-
activatesOn: Events.SetupTranslations,
|
|
35
|
-
activate: () => contributes(Capabilities.Translations, translations),
|
|
36
|
-
}),
|
|
37
|
-
defineModule({
|
|
38
|
-
id: `${meta.id}/module/settings`,
|
|
39
|
-
activatesOn: Events.SetupSettings,
|
|
40
|
-
activate: Settings,
|
|
41
|
-
}),
|
|
42
|
-
defineModule({
|
|
43
|
-
id: `${meta.id}/module/state`,
|
|
44
|
-
// TODO(wittjosiah): Does not integrate with settings store.
|
|
45
|
-
// Should this be a different event?
|
|
46
|
-
// Should settings store be renamed to be more generic?
|
|
47
|
-
activatesOn: Events.SetupSettings,
|
|
48
|
-
activate: AssistantState,
|
|
49
|
-
}),
|
|
50
|
-
defineModule({
|
|
51
|
-
id: `${meta.id}/module/metadata`,
|
|
52
|
-
activatesOn: Events.SetupMetadata,
|
|
53
|
-
activate: () => [
|
|
54
|
-
contributes(Capabilities.Metadata, {
|
|
55
|
-
id: Type.getTypename(Assistant.Chat),
|
|
56
|
-
metadata: {
|
|
57
|
-
icon: 'ph--atom--regular',
|
|
58
|
-
iconClassName: 'text-skySurfaceText',
|
|
59
|
-
},
|
|
60
|
-
}),
|
|
61
|
-
contributes(Capabilities.Metadata, {
|
|
62
|
-
id: Type.getTypename(Blueprint.Blueprint),
|
|
63
|
-
metadata: {
|
|
64
|
-
icon: 'ph--blueprint--regular',
|
|
65
|
-
iconClassName: 'text-blueSurfaceText',
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
contributes(Capabilities.Metadata, {
|
|
69
|
-
id: Type.getTypename(Sequence),
|
|
70
|
-
metadata: {
|
|
71
|
-
icon: 'ph--circuitry--regular',
|
|
72
|
-
iconClassName: 'text-blueSurfaceText',
|
|
73
|
-
},
|
|
74
|
-
}),
|
|
75
|
-
],
|
|
76
|
-
}),
|
|
77
|
-
defineModule({
|
|
78
|
-
id: `${meta.id}/module/object-form`,
|
|
79
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
80
|
-
activate: () => [
|
|
81
|
-
contributes(
|
|
82
|
-
SpaceCapabilities.ObjectForm,
|
|
83
|
-
defineObjectForm({
|
|
84
|
-
objectSchema: Assistant.Chat,
|
|
85
|
-
getIntent: (_, options) => createIntent(AssistantAction.CreateChat, { space: options.space }),
|
|
86
|
-
}),
|
|
87
|
-
),
|
|
88
|
-
contributes(
|
|
89
|
-
SpaceCapabilities.ObjectForm,
|
|
90
|
-
defineObjectForm({
|
|
91
|
-
objectSchema: Blueprint.Blueprint,
|
|
92
|
-
formSchema: AssistantAction.BlueprintForm,
|
|
93
|
-
getIntent: (props) => createIntent(AssistantAction.CreateBlueprint, props),
|
|
94
|
-
}),
|
|
95
|
-
),
|
|
96
|
-
contributes(
|
|
97
|
-
SpaceCapabilities.ObjectForm,
|
|
98
|
-
defineObjectForm({
|
|
99
|
-
objectSchema: Sequence,
|
|
100
|
-
getIntent: () => createIntent(AssistantAction.CreateSequence),
|
|
101
|
-
}),
|
|
102
|
-
),
|
|
103
|
-
],
|
|
104
|
-
}),
|
|
105
|
-
defineModule({
|
|
106
|
-
id: `${meta.id}/module/schema`,
|
|
107
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
108
|
-
activate: () =>
|
|
109
|
-
contributes(ClientCapabilities.Schema, [
|
|
110
|
-
ServiceType,
|
|
111
|
-
Assistant.CompanionTo,
|
|
112
|
-
ResearchGraph,
|
|
113
|
-
ResearchOn,
|
|
114
|
-
Prompt.Prompt,
|
|
115
|
-
]),
|
|
116
|
-
}),
|
|
117
|
-
defineModule({
|
|
118
|
-
id: `${meta.id}/module/on-space-created`,
|
|
119
|
-
activatesOn: SpaceEvents.SpaceCreated,
|
|
120
|
-
activate: () =>
|
|
121
|
-
contributes(SpaceCapabilities.onCreateSpace, ({ rootCollection, space }) =>
|
|
122
|
-
createIntent(AssistantAction.onCreateSpace, { rootCollection, space }),
|
|
123
|
-
),
|
|
124
|
-
}),
|
|
125
|
-
defineModule({
|
|
126
|
-
id: `${meta.id}/module/app-graph-builder`,
|
|
127
|
-
activatesOn: Events.SetupAppGraph,
|
|
128
|
-
activate: AppGraphBuilder,
|
|
129
|
-
}),
|
|
130
|
-
defineModule({
|
|
131
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
132
|
-
activatesOn: Events.SetupIntentResolver,
|
|
133
|
-
activate: IntentResolver,
|
|
134
|
-
}),
|
|
135
|
-
defineModule({
|
|
136
|
-
id: `${meta.id}/module/react-surface`,
|
|
137
|
-
activatesOn: Events.SetupReactSurface,
|
|
138
|
-
// TODO(wittjosiah): Should occur before the chat is loaded when surfaces activation is more granular.
|
|
139
|
-
activatesBefore: [Events.SetupArtifactDefinition],
|
|
140
|
-
activate: ReactSurface,
|
|
141
|
-
}),
|
|
142
|
-
defineModule({
|
|
143
|
-
id: `${meta.id}/module/edge-model-resolver`,
|
|
144
|
-
activatesOn: AssistantEvents.SetupAiServiceProviders,
|
|
145
|
-
activate: EdgeModelResolver,
|
|
146
|
-
}),
|
|
147
|
-
defineModule({
|
|
148
|
-
id: `${meta.id}/module/local-model-resolver`,
|
|
149
|
-
activatesOn: AssistantEvents.SetupAiServiceProviders,
|
|
150
|
-
activate: LocalModelResolver,
|
|
151
|
-
}),
|
|
152
|
-
defineModule({
|
|
153
|
-
id: `${meta.id}/module/ai-service`,
|
|
154
|
-
activatesBefore: [AssistantEvents.SetupAiServiceProviders],
|
|
155
|
-
// TODO(dmaretskyi): This should activate lazily when the AI chat is used.
|
|
156
|
-
activatesOn: Events.Startup,
|
|
157
|
-
activate: AiService,
|
|
158
|
-
}),
|
|
159
|
-
defineModule({
|
|
160
|
-
id: `${meta.id}/module/blueprint`,
|
|
161
|
-
activatesOn: Events.SetupArtifactDefinition,
|
|
162
|
-
activate: BlueprintDefinition,
|
|
163
|
-
}),
|
|
164
|
-
defineModule({
|
|
165
|
-
id: `${meta.id}/module/toolkit`,
|
|
166
|
-
// TODO(wittjosiah): Use a different event.
|
|
167
|
-
activatesOn: Events.Startup,
|
|
168
|
-
activate: Toolkit,
|
|
169
|
-
}),
|
|
170
|
-
]);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type DeepReadonly } from '@dxos/util';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
import { type Assistant } from '../types';
|
|
10
|
-
|
|
11
|
-
export namespace AssistantCapabilities {
|
|
12
|
-
export type AssistantState = {
|
|
13
|
-
/** Map of primary object fq id to current chat. */
|
|
14
|
-
currentChat: Record<string, Assistant.Chat>;
|
|
15
|
-
};
|
|
16
|
-
export const State = defineCapability<DeepReadonly<AssistantState>>(`${meta.id}/capability/state`);
|
|
17
|
-
export const MutableState = defineCapability<AssistantState>(`${meta.id}/capability/state`);
|
|
18
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
|
|
8
|
-
import { AiContextBinder } from '@dxos/assistant';
|
|
9
|
-
import { AiConversation } from '@dxos/assistant';
|
|
10
|
-
import { Blueprint, Template } from '@dxos/blueprints';
|
|
11
|
-
import { fullyQualifiedId } from '@dxos/client/echo';
|
|
12
|
-
import { Sequence } from '@dxos/conductor';
|
|
13
|
-
import { Filter, Key, Obj, Ref } from '@dxos/echo';
|
|
14
|
-
import { CollectionAction } from '@dxos/plugin-space/types';
|
|
15
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
16
|
-
import { type DataType } from '@dxos/schema';
|
|
17
|
-
|
|
18
|
-
import { Assistant, AssistantAction } from '../types';
|
|
19
|
-
|
|
20
|
-
import { BLUEPRINT_KEY, createBlueprint } from './blueprint-definition';
|
|
21
|
-
import { AssistantCapabilities } from './capabilities';
|
|
22
|
-
|
|
23
|
-
export default (context: PluginContext) => [
|
|
24
|
-
contributes(Capabilities.IntentResolver, [
|
|
25
|
-
createResolver({
|
|
26
|
-
intent: AssistantAction.onCreateSpace,
|
|
27
|
-
resolve: ({ space, rootCollection }) =>
|
|
28
|
-
Effect.gen(function* () {
|
|
29
|
-
const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
30
|
-
const { object: chatCollection } = yield* dispatch(
|
|
31
|
-
createIntent(CollectionAction.CreateQueryCollection, { typename: Assistant.Chat.typename }),
|
|
32
|
-
);
|
|
33
|
-
const { object: blueprintCollection } = yield* dispatch(
|
|
34
|
-
createIntent(CollectionAction.CreateQueryCollection, { typename: Blueprint.Blueprint.typename }),
|
|
35
|
-
);
|
|
36
|
-
rootCollection.objects.push(Ref.make(chatCollection), Ref.make(blueprintCollection));
|
|
37
|
-
|
|
38
|
-
// Create default chat.
|
|
39
|
-
const { object: chat } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
40
|
-
space.db.add(chat);
|
|
41
|
-
}),
|
|
42
|
-
}),
|
|
43
|
-
createResolver({
|
|
44
|
-
intent: AssistantAction.CreateChat,
|
|
45
|
-
resolve: async ({ space, name }) => {
|
|
46
|
-
const queue = space.queues.create();
|
|
47
|
-
const chat = Assistant.makeChat({ name, queue });
|
|
48
|
-
const { objects: blueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
49
|
-
// TODO(wittjosiah): This should be a space-level setting.
|
|
50
|
-
// TODO(burdon): Clone when activated. Copy-on-write for template.
|
|
51
|
-
let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === BLUEPRINT_KEY);
|
|
52
|
-
if (!defaultBlueprint) {
|
|
53
|
-
defaultBlueprint = space.db.add(createBlueprint());
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const binder = new AiContextBinder(queue);
|
|
57
|
-
await binder.open();
|
|
58
|
-
await binder.bind({ blueprints: [Ref.make(defaultBlueprint)] });
|
|
59
|
-
await binder.close();
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
data: { object: chat },
|
|
63
|
-
};
|
|
64
|
-
},
|
|
65
|
-
}),
|
|
66
|
-
createResolver({
|
|
67
|
-
intent: AssistantAction.UpdateChatName,
|
|
68
|
-
resolve: async ({ chat }) => {
|
|
69
|
-
// TODO(burdon): Reuse system conversation/queue.
|
|
70
|
-
const space = getSpace(chat);
|
|
71
|
-
const queue = space?.queues.create<DataType.Message>();
|
|
72
|
-
if (!queue) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const conversation = new AiConversation(queue);
|
|
77
|
-
await conversation.open();
|
|
78
|
-
// TODO(burdon): How to get runtime?
|
|
79
|
-
// await updateName(runtime, conversation, chat);
|
|
80
|
-
await conversation.close();
|
|
81
|
-
console.log(chat);
|
|
82
|
-
},
|
|
83
|
-
}),
|
|
84
|
-
createResolver({
|
|
85
|
-
intent: AssistantAction.CreateBlueprint,
|
|
86
|
-
resolve: ({ key, name, description }) => ({
|
|
87
|
-
data: {
|
|
88
|
-
object: Blueprint.make({ key, name, description, instructions: Template.make({ source: '' }) }),
|
|
89
|
-
},
|
|
90
|
-
}),
|
|
91
|
-
}),
|
|
92
|
-
createResolver({
|
|
93
|
-
intent: AssistantAction.CreateSequence,
|
|
94
|
-
resolve: ({ name }) => ({
|
|
95
|
-
data: {
|
|
96
|
-
object: Obj.make(Sequence, {
|
|
97
|
-
name,
|
|
98
|
-
steps: [
|
|
99
|
-
{
|
|
100
|
-
id: Key.ObjectId.random(),
|
|
101
|
-
instructions: 'You are a helpful assistant.',
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
}),
|
|
105
|
-
},
|
|
106
|
-
}),
|
|
107
|
-
}),
|
|
108
|
-
createResolver({
|
|
109
|
-
intent: AssistantAction.SetCurrentChat,
|
|
110
|
-
resolve: ({ companionTo, chat }) =>
|
|
111
|
-
Effect.gen(function* () {
|
|
112
|
-
const state = context.getCapability(AssistantCapabilities.MutableState);
|
|
113
|
-
state.currentChat[fullyQualifiedId(companionTo)] = chat;
|
|
114
|
-
}),
|
|
115
|
-
}),
|
|
116
|
-
]),
|
|
117
|
-
];
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Blueprint } from '@dxos/blueprints';
|
|
8
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
-
|
|
10
|
-
import { TemplateEditor } from './TemplateEditor';
|
|
11
|
-
|
|
12
|
-
export type BlueprintContainerProps = {
|
|
13
|
-
blueprint: Blueprint.Blueprint;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const BlueprintContainer = ({ blueprint }: BlueprintContainerProps) => {
|
|
17
|
-
return (
|
|
18
|
-
<StackItem.Content>
|
|
19
|
-
<TemplateEditor id={blueprint.id} template={blueprint.instructions} classNames='container-max-width' />
|
|
20
|
-
</StackItem.Content>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default BlueprintContainer;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
9
|
-
import { Form } from '@dxos/react-ui-form';
|
|
10
|
-
|
|
11
|
-
const FormSchema = Blueprint.Blueprint.pipe(Schema.pick('tools'));
|
|
12
|
-
|
|
13
|
-
export const BlueprintSettings = ({ blueprint }: { blueprint: Blueprint.Blueprint }) => {
|
|
14
|
-
return <Form outerSpacing={false} readonly='disabled-input' values={blueprint} schema={FormSchema} />;
|
|
15
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Array from 'effect/Array';
|
|
6
|
-
import * as Effect from 'effect/Effect';
|
|
7
|
-
import * as Function from 'effect/Function';
|
|
8
|
-
import * as Option from 'effect/Option';
|
|
9
|
-
import React, { useMemo } from 'react';
|
|
10
|
-
|
|
11
|
-
import { Capabilities, createIntent, useCapabilities, useIntentDispatcher } from '@dxos/app-framework';
|
|
12
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
13
|
-
import { getSpace } from '@dxos/client/echo';
|
|
14
|
-
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
15
|
-
import { DatabaseService } from '@dxos/functions';
|
|
16
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
17
|
-
import { useQuery } from '@dxos/react-client/echo';
|
|
18
|
-
import { useAsyncEffect } from '@dxos/react-ui';
|
|
19
|
-
|
|
20
|
-
import { ChatContainer } from '../components';
|
|
21
|
-
import { useBlueprintRegistry, useContextBinder } from '../hooks';
|
|
22
|
-
import { Assistant, AssistantAction } from '../types';
|
|
23
|
-
|
|
24
|
-
export type ChatCompanionProps = {
|
|
25
|
-
role?: string;
|
|
26
|
-
data: { companionTo: Obj.Any; subject: Assistant.Chat | 'assistant-chat' };
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const ChatCompanion = ({ role, data }: ChatCompanionProps) => {
|
|
30
|
-
const companionTo = data.companionTo;
|
|
31
|
-
const space = getSpace(companionTo);
|
|
32
|
-
const chat = data.subject === 'assistant-chat' ? undefined : data.subject;
|
|
33
|
-
const blueprintRegistry = useBlueprintRegistry();
|
|
34
|
-
const binder = useContextBinder(chat);
|
|
35
|
-
const { dispatch } = useIntentDispatcher();
|
|
36
|
-
|
|
37
|
-
// Initialize companion chat if it doesn't exist.
|
|
38
|
-
useAsyncEffect(async () => {
|
|
39
|
-
if (chat || !space) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// TODO(burdon): Garbage collection of queues?
|
|
44
|
-
// TODO(wittjosiah): Figure out how to prevent companion chats from showing up in the navtree.
|
|
45
|
-
await Effect.gen(function* () {
|
|
46
|
-
const { objects } = yield* DatabaseService.runQuery(
|
|
47
|
-
Query.select(Filter.ids(companionTo.id)).targetOf(Assistant.CompanionTo).source(),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
// TODO(wittjosiah): This should be the default sort order.
|
|
51
|
-
let nextChat = objects.toSorted((a, b) => a.id.localeCompare(b.id)).at(-1);
|
|
52
|
-
if (!nextChat) {
|
|
53
|
-
const { object } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
|
|
54
|
-
nextChat = object;
|
|
55
|
-
yield* dispatch(createIntent(SpaceAction.AddObject, { object: nextChat, target: space, hidden: true }));
|
|
56
|
-
yield* dispatch(
|
|
57
|
-
createIntent(SpaceAction.AddRelation, {
|
|
58
|
-
space,
|
|
59
|
-
schema: Assistant.CompanionTo,
|
|
60
|
-
source: nextChat,
|
|
61
|
-
target: data.companionTo,
|
|
62
|
-
}),
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
yield* dispatch(createIntent(AssistantAction.SetCurrentChat, { companionTo, chat: nextChat }));
|
|
67
|
-
}).pipe(Effect.provide(DatabaseService.layer(space.db)), Effect.runPromise);
|
|
68
|
-
}, [space, chat, companionTo]);
|
|
69
|
-
|
|
70
|
-
const metadata = useCapabilities(Capabilities.Metadata);
|
|
71
|
-
const blueprintKeys = useMemo(
|
|
72
|
-
() =>
|
|
73
|
-
Function.pipe(
|
|
74
|
-
metadata,
|
|
75
|
-
Array.findFirst(
|
|
76
|
-
(capability): capability is { id: string; metadata: { blueprints?: string[] } } =>
|
|
77
|
-
capability.id === Obj.getTypename(companionTo),
|
|
78
|
-
),
|
|
79
|
-
Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)),
|
|
80
|
-
Option.getOrElse(() => [] as string[]),
|
|
81
|
-
),
|
|
82
|
-
[metadata, companionTo],
|
|
83
|
-
);
|
|
84
|
-
const existingBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
|
|
85
|
-
const pluginBlueprints = useMemo(
|
|
86
|
-
() => existingBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)),
|
|
87
|
-
[existingBlueprints, blueprintKeys],
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
// Initialize related blueprints that are not already in the space.
|
|
91
|
-
useAsyncEffect(async () => {
|
|
92
|
-
if (!space) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// NOTE: This must be run instead of using the useQuery result to avoid duplicates.
|
|
97
|
-
const { objects: existingBlueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
98
|
-
for (const key of blueprintKeys) {
|
|
99
|
-
const existingBlueprint = existingBlueprints.find((blueprint) => blueprint.key === key);
|
|
100
|
-
if (existingBlueprint) {
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const blueprint = blueprintRegistry.getByKey(key);
|
|
105
|
-
if (!blueprint) {
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
space.db.add(Obj.clone(blueprint));
|
|
110
|
-
}
|
|
111
|
-
}, [space, blueprintRegistry, blueprintKeys]);
|
|
112
|
-
|
|
113
|
-
useAsyncEffect(async () => {
|
|
114
|
-
if (!binder) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (pluginBlueprints.length > 0) {
|
|
119
|
-
await binder.bind({ blueprints: pluginBlueprints.map((blueprint) => Ref.make(blueprint)) });
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (Obj.instanceOf(Blueprint.Blueprint, companionTo)) {
|
|
123
|
-
await binder.bind({ blueprints: [Ref.make(companionTo)] });
|
|
124
|
-
} else {
|
|
125
|
-
await binder.bind({ objects: [Ref.make(companionTo)] });
|
|
126
|
-
}
|
|
127
|
-
}, [binder, companionTo, pluginBlueprints]);
|
|
128
|
-
|
|
129
|
-
if (!chat) {
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return <ChatContainer role={role} chat={chat} companionTo={companionTo} />;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export default ChatCompanion;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { getSpace } from '@dxos/client/echo';
|
|
9
|
-
import { type Obj } from '@dxos/echo';
|
|
10
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
|
-
|
|
12
|
-
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
|
|
13
|
-
import { meta } from '../meta';
|
|
14
|
-
import { type Assistant } from '../types';
|
|
15
|
-
|
|
16
|
-
import { Chat } from './Chat';
|
|
17
|
-
import { Toolbar } from './Toolbar';
|
|
18
|
-
|
|
19
|
-
export type ChatContainerProps = {
|
|
20
|
-
chat: Assistant.Chat;
|
|
21
|
-
companionTo?: Obj.Any;
|
|
22
|
-
role?: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const ChatContainer = ({ chat, companionTo }: ChatContainerProps) => {
|
|
26
|
-
const space = getSpace(chat);
|
|
27
|
-
const settings = useCapability(Capabilities.SettingsStore).getStore<Assistant.Settings>(meta.id)?.value;
|
|
28
|
-
const services = useChatServices({ space, chat });
|
|
29
|
-
const [online, setOnline] = useOnline();
|
|
30
|
-
const { preset, ...chatProps } = usePresets(online);
|
|
31
|
-
const blueprintRegistry = useBlueprintRegistry();
|
|
32
|
-
const processor = useChatProcessor({ chat, preset, services, blueprintRegistry, settings });
|
|
33
|
-
|
|
34
|
-
if (!processor) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<StackItem.Content toolbar={!!companionTo}>
|
|
40
|
-
{!!companionTo && <Toolbar chat={chat} companionTo={companionTo} />}
|
|
41
|
-
<Chat.Root classNames='container-max-width' chat={chat} processor={processor}>
|
|
42
|
-
<Chat.Thread />
|
|
43
|
-
<div className='p-2'>
|
|
44
|
-
<Chat.Prompt {...chatProps} outline preset={preset?.id} online={online} onOnlineChange={setOnline} />
|
|
45
|
-
</div>
|
|
46
|
-
</Chat.Root>
|
|
47
|
-
</StackItem.Content>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default ChatContainer;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { addEventListener } from '@dxos/async';
|
|
8
|
-
import { Flex, ProgressBar, type ProgressBarProps, TextCrawl, useExecutionGraph } from '@dxos/react-ui-components';
|
|
9
|
-
|
|
10
|
-
import { type Assistant } from '../../types';
|
|
11
|
-
|
|
12
|
-
// TODO(burdon): Reset after each session.
|
|
13
|
-
// TODO(burdon): Show after delay.
|
|
14
|
-
// TODO(burdon): Test with errors.
|
|
15
|
-
// TODO(burdon): Filter out empty trace messages.
|
|
16
|
-
|
|
17
|
-
// {
|
|
18
|
-
// "id": "01K3TE3C2VAXETP500QKDHK3C4_block_3",
|
|
19
|
-
// "branch": "main",
|
|
20
|
-
// "parents": [],
|
|
21
|
-
// "icon": "ph--robot--regular",
|
|
22
|
-
// "message": "\n"
|
|
23
|
-
// }
|
|
24
|
-
|
|
25
|
-
export type ChatProgressProps = {
|
|
26
|
-
chat: Assistant.Chat;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const ChatProgress = ({ chat }: ChatProgressProps) => {
|
|
30
|
-
const { commits } = useExecutionGraph(chat.traceQueue?.target, true);
|
|
31
|
-
const nodes = useMemo(() => commits.map((commit) => ({ id: commit.id, message: commit.message })), [commits]);
|
|
32
|
-
const lines = useMemo(() => commits.map((commit) => commit.message), [commits]);
|
|
33
|
-
|
|
34
|
-
const [index, setIndex] = useState<number | undefined>(undefined);
|
|
35
|
-
const handleSelect = useCallback<NonNullable<ProgressBarProps['onSelect']>>(({ index }) => {
|
|
36
|
-
setIndex((current) => {
|
|
37
|
-
return current === index ? undefined : index;
|
|
38
|
-
});
|
|
39
|
-
}, []);
|
|
40
|
-
|
|
41
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (!ref.current) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return addEventListener(ref.current, 'keydown', (event) => {
|
|
48
|
-
switch (event.key) {
|
|
49
|
-
case 'ArrowLeft': {
|
|
50
|
-
setIndex((current) => (current === undefined || current <= 0 ? 0 : current - 1));
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
case 'ArrowRight': {
|
|
54
|
-
setIndex((current) => (current === undefined || current >= nodes.length ? nodes.length - 1 : current + 1));
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}, [nodes.length]);
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<Flex column tabIndex={0} ref={ref} classNames='outline-none'>
|
|
63
|
-
<ProgressBar nodes={nodes} index={index} onSelect={handleSelect} />
|
|
64
|
-
<TextCrawl lines={lines} index={index} autoAdvance classNames='pis-4 text-sm text-subdued' />
|
|
65
|
-
</Flex>
|
|
66
|
-
);
|
|
67
|
-
};
|