@dxos/plugin-assistant 0.8.4-main.422d1c7879 → 0.8.4-main.51f1e5ca51
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-GG52BLKS.mjs +40 -0
- package/dist/lib/browser/AssistantSettings-GG52BLKS.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +26 -3
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/{chunk-ATHYBVGN.mjs → chunk-RIJNPAYC.mjs} +5 -5
- package/dist/lib/browser/chunk-RIJNPAYC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LMVTXH54.mjs → chunk-SEMCG4ZK.mjs} +58 -17
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +3 -4
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/{create-chat-LBZHGVSN.mjs → create-chat-FZJASOQS.mjs} +5 -13
- package/dist/lib/browser/create-chat-FZJASOQS.mjs.map +7 -0
- package/dist/lib/browser/{ensure-companion-chat-ZEZA34MZ.mjs → ensure-companion-chat-PHUWWFVY.mjs} +4 -4
- package/dist/lib/browser/ensure-companion-chat-PHUWWFVY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +804 -880
- 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 → on-create-space-OQNCM7NC.mjs} +3 -3
- package/dist/lib/browser/{on-create-space-54RNX5JI.mjs.map → on-create-space-OQNCM7NC.mjs.map} +1 -1
- package/dist/lib/browser/operations/index.mjs +3 -3
- package/dist/lib/browser/operations/index.mjs.map +3 -3
- package/dist/lib/browser/{resolve-navigation-targets-NZOD66NY.mjs → resolve-navigation-targets-PMNR7D3P.mjs} +3 -3
- package/dist/lib/browser/{resolve-navigation-targets-NZOD66NY.mjs.map → resolve-navigation-targets-PMNR7D3P.mjs.map} +1 -1
- package/dist/lib/browser/{run-prompt-in-new-chat-THLK5YQC.mjs → run-prompt-in-new-chat-4XDYFKCV.mjs} +10 -39
- package/dist/lib/browser/run-prompt-in-new-chat-4XDYFKCV.mjs.map +7 -0
- package/dist/lib/browser/{set-current-chat-LRS3VFSH.mjs → set-current-chat-7V4DA66I.mjs} +4 -4
- package/dist/lib/browser/set-current-chat-7V4DA66I.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +171 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -3
- package/dist/lib/browser/{update-chat-name-3Y36KFAS.mjs → update-chat-name-ZGMU2UGN.mjs} +7 -22
- package/dist/lib/browser/update-chat-name-ZGMU2UGN.mjs.map +7 -0
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs +41 -0
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +26 -3
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-PXAJSTGZ.mjs → chunk-NCIZY5ZV.mjs} +5 -5
- package/dist/lib/node-esm/chunk-NCIZY5ZV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-W3JZ2F4T.mjs → chunk-XAFVSEUJ.mjs} +58 -17
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +3 -4
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/{create-chat-3BEG4R6J.mjs → create-chat-RY6A4WUV.mjs} +5 -13
- package/dist/lib/node-esm/create-chat-RY6A4WUV.mjs.map +7 -0
- package/dist/lib/node-esm/{ensure-companion-chat-6K2WEWFP.mjs → ensure-companion-chat-BTDU5TS2.mjs} +4 -4
- package/dist/lib/node-esm/ensure-companion-chat-BTDU5TS2.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +804 -880
- 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 → on-create-space-4LWCYT3H.mjs} +3 -3
- package/dist/lib/node-esm/{on-create-space-YRPZ6HZY.mjs.map → on-create-space-4LWCYT3H.mjs.map} +1 -1
- package/dist/lib/node-esm/operations/index.mjs +3 -3
- package/dist/lib/node-esm/operations/index.mjs.map +3 -3
- package/dist/lib/node-esm/{resolve-navigation-targets-3PPK7XLH.mjs → resolve-navigation-targets-GHS3XPVP.mjs} +3 -3
- package/dist/lib/node-esm/{resolve-navigation-targets-3PPK7XLH.mjs.map → resolve-navigation-targets-GHS3XPVP.mjs.map} +1 -1
- package/dist/lib/node-esm/{run-prompt-in-new-chat-OUYKCMQ7.mjs → run-prompt-in-new-chat-UF54E34O.mjs} +10 -39
- package/dist/lib/node-esm/run-prompt-in-new-chat-UF54E34O.mjs.map +7 -0
- package/dist/lib/node-esm/{set-current-chat-SMXZJD3F.mjs → set-current-chat-SWPAOLZL.mjs} +4 -4
- package/dist/lib/node-esm/set-current-chat-SWPAOLZL.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +172 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -3
- package/dist/lib/node-esm/{update-chat-name-HM2P4NSI.mjs → update-chat-name-CW6K5M37.mjs} +7 -22
- package/dist/lib/node-esm/update-chat-name-CW6K5M37.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +29 -39
- 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/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +5 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -1
- 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.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 +2 -0
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +6 -3
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +4 -3
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +1 -1
- package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +18 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +4 -4
- package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -1
- 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 +1 -2
- package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +2 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +0 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -2
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +3 -3
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- 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 -1
- package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -4
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +3 -3
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -1
- package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -1
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +1 -1
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +1 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
- 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/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/{PromptList/PromptList.stories.d.ts → RoutineList/RoutineList.stories.d.ts} +1 -1
- 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 +3 -2
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +1 -4
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +1 -1
- package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts +81 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/containers/index.d.ts +2 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +1 -1
- 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 +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useDebug.d.ts +10 -0
- package/dist/types/src/hooks/useDebug.d.ts.map +1 -0
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +1 -1
- package/dist/types/src/operations/create-chat.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +24 -19
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +1 -1
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -1
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +1 -1
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -1
- package/dist/types/src/operations/set-current-chat.d.ts +1 -1
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
- package/dist/types/src/operations/update-chat-name.d.ts +1 -1
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +2 -2
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +1 -1
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.d.ts.map +1 -1
- package/dist/types/src/testing/test-trace.d.ts +5 -0
- package/dist/types/src/testing/test-trace.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +22 -6
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +20 -5
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +95 -91
- package/src/AssistantPlugin.tsx +10 -12
- package/src/blueprints/assistant/blueprint.test.ts +3 -3
- package/src/blueprints/assistant/blueprint.ts +3 -3
- package/src/capabilities/app-graph-builder.ts +3 -3
- package/src/capabilities/blueprint-definition.ts +0 -4
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/markdown.ts +1 -1
- package/src/capabilities/migrations.ts +1 -8
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +16 -10
- package/src/cli/plugin.ts +3 -4
- package/src/components/AssistantSettings/AssistantSettings.stories.tsx +3 -2
- package/src/components/AssistantSettings/AssistantSettings.tsx +22 -111
- package/src/components/Chat/Chat.tsx +56 -260
- package/src/components/Chat/context.ts +39 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -10
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +24 -10
- package/src/components/ChatPrompt/ChatOptions.tsx +60 -31
- package/src/components/ChatPrompt/ChatPrompt.tsx +179 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +1 -1
- package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
- package/src/components/ChatPrompt/index.ts +2 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +3 -3
- package/src/components/ChatThread/ChatThread.tsx +31 -18
- package/src/components/ChatThread/DEBUG.md +41 -0
- package/src/components/ChatThread/MarkdownStream.stories.tsx +5 -4
- package/src/components/ChatThread/registry.tsx +53 -14
- package/src/components/ChatThread/sync.test.ts +80 -12
- package/src/components/ChatThread/sync.ts +1 -1
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +6 -6
- package/src/components/ChatThread/widgets/ReferenceWidget.ts +3 -1
- package/src/components/ChatThread/widgets/SelectWidget.ts +3 -1
- package/src/components/ChatThread/widgets/StatsWidget.ts +3 -1
- package/src/components/ChatThread/widgets/StatusWidget.ts +3 -1
- package/src/components/ChatThread/widgets/SuggestionWidget.ts +1 -1
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +3 -2
- package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +2 -1
- package/src/components/ChatThread/widgets/defaults.ts +8 -0
- package/src/components/ChatThread/widgets/index.ts +1 -2
- package/src/components/ProcessTree/ProcessTree.stories.tsx +12 -38
- package/src/components/ProcessTree/ProcessTree.tsx +67 -35
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +3 -2
- package/src/components/TemplateEditor/TemplateEditor.tsx +5 -5
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +4 -3
- package/src/components/TemplateEditor/TemplateForm.tsx +3 -3
- package/src/components/Toolbox/Toolbox.stories.tsx +2 -1
- package/src/components/Toolbox/Toolbox.tsx +2 -2
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +1 -1
- package/src/containers/AgentArticle/AgentArticle.tsx +2 -2
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +2 -1
- package/src/containers/AgentProperties/AgentProperties.tsx +2 -2
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +1 -1
- package/src/containers/ChatCompanion/ChatCompanion.tsx +1 -1
- package/src/containers/ChatContainer/ChatContainer.tsx +16 -6
- package/src/containers/ChatDialog/ChatDialog.tsx +3 -9
- package/src/containers/{PromptArticle/PromptArticle.tsx → RoutineArticle/RoutineArticle.tsx} +4 -4
- package/src/containers/RoutineArticle/index.ts +5 -0
- package/src/containers/{PromptList/PromptList.stories.tsx → RoutineList/RoutineList.stories.tsx} +10 -9
- package/src/containers/{PromptList/PromptList.tsx → RoutineList/RoutineList.tsx} +6 -5
- package/src/containers/RoutineList/index.ts +5 -0
- package/src/containers/TracePanel/TracePanel.stories.tsx +204 -198
- package/src/containers/TracePanel/TracePanel.tsx +69 -44
- package/src/containers/TracePanel/dxn-extractor.test.ts +7 -7
- package/src/containers/TracePanel/dxn-extractor.ts +4 -4
- package/src/containers/TracePanel/execution-graph.test.ts +382 -0
- package/src/containers/TracePanel/execution-graph.ts +340 -213
- 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/index.ts +2 -2
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useBlueprintRegistry.ts +1 -1
- package/src/hooks/useChatKeymap.ts +52 -0
- package/src/hooks/useChatProcessor.ts +1 -1
- package/src/hooks/useDebug.ts +38 -0
- package/src/index.ts +0 -3
- package/src/operations/create-chat.ts +2 -2
- package/src/operations/definitions.ts +4 -4
- package/src/operations/ensure-companion-chat.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/operations/on-create-space.ts +1 -1
- package/src/operations/prompt.test.ts +5 -6
- package/src/operations/resolve-navigation-targets.ts +1 -1
- package/src/operations/run-prompt-in-new-chat.ts +3 -3
- package/src/operations/set-current-chat.ts +1 -1
- package/src/operations/update-chat-name.ts +2 -2
- package/src/processor/processor.test.ts +1 -1
- package/src/processor/processor.ts +4 -4
- package/src/queue-logger.ts +1 -1
- package/src/testing/data/trace-timeline.dx.json +3737 -1200
- package/src/testing/index.ts +1 -0
- package/src/testing/test-generator.test.ts +1 -1
- package/src/testing/test-generator.ts +4 -4
- package/src/testing/test-trace.ts +20 -0
- package/src/testing/trace-timeline.conversations.json +1 -1
- package/src/testing/trace-timeline.test.ts +53 -49
- package/src/translations.ts +24 -31
- package/src/types/Assistant.ts +11 -0
- package/src/types/Settings.ts +62 -7
- package/src/types/index.ts +0 -1
- package/src/types/service.ts +1 -1
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs +0 -97
- package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATHYBVGN.mjs.map +0 -7
- package/dist/lib/browser/chunk-EZRS3J25.mjs +0 -30
- package/dist/lib/browser/chunk-EZRS3J25.mjs.map +0 -7
- package/dist/lib/browser/chunk-LMVTXH54.mjs.map +0 -7
- package/dist/lib/browser/create-chat-LBZHGVSN.mjs.map +0 -7
- package/dist/lib/browser/ensure-companion-chat-ZEZA34MZ.mjs.map +0 -7
- package/dist/lib/browser/run-prompt-in-new-chat-THLK5YQC.mjs.map +0 -7
- package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs.map +0 -7
- package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +0 -7
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +0 -98
- package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +0 -32
- package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs.map +0 -7
- package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs.map +0 -7
- package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs.map +0 -7
- package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs.map +0 -7
- package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs.map +0 -7
- package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +0 -7
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +0 -10
- 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/widgets/PromptWidget.d.ts +0 -15
- package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +0 -1
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +0 -6
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +0 -1
- package/dist/types/src/containers/PromptArticle/index.d.ts +0 -2
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/PromptList.d.ts +0 -6
- package/dist/types/src/containers/PromptList/PromptList.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +0 -1
- package/dist/types/src/containers/PromptList/index.d.ts +0 -2
- package/dist/types/src/containers/PromptList/index.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/components/ChatProgress/ChatProgress.tsx +0 -56
- package/src/components/ChatProgress/index.ts +0 -5
- package/src/components/ChatThread/widgets/PromptWidget.ts +0 -30
- package/src/containers/PromptArticle/index.ts +0 -5
- package/src/containers/PromptList/index.ts +0 -5
- package/src/types/defs.ts +0 -5
|
@@ -6,24 +6,14 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import * as Option from 'effect/Option';
|
|
7
7
|
|
|
8
8
|
import { Process } from '@dxos/functions-runtime';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
9
10
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
+
import { makeProcess } from '#testing';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
overrides: Partial<Process.Info> & Pick<Process.Info, 'pid' | 'state'> & { name: string },
|
|
15
|
-
): Process.Info => ({
|
|
16
|
-
parentPid: null,
|
|
17
|
-
key: `test.process.${overrides.name}`,
|
|
18
|
-
params: { name: overrides.name, target: null },
|
|
19
|
-
error: null,
|
|
20
|
-
startedAt: Date.now() - 10_000,
|
|
21
|
-
completedAt: Option.none(),
|
|
22
|
-
metrics: { wallTime: 0, inputCount: 0, outputCount: 0 },
|
|
23
|
-
...overrides,
|
|
24
|
-
});
|
|
14
|
+
import { ProcessTree } from './ProcessTree';
|
|
25
15
|
|
|
26
|
-
const
|
|
16
|
+
const processes: Process.Info[] = [
|
|
27
17
|
makeProcess({
|
|
28
18
|
pid: Process.ID.make('97793611-815e-4a67-bc04-60fa67b2c987'),
|
|
29
19
|
name: 'Trigger watcher',
|
|
@@ -73,7 +63,7 @@ const seedProcesses: Process.Info[] = [
|
|
|
73
63
|
const meta: Meta<typeof ProcessTree> = {
|
|
74
64
|
title: 'plugins/plugin-assistant/components/ProcessTree',
|
|
75
65
|
component: ProcessTree,
|
|
76
|
-
decorators: [withLayout({ layout: 'column', classNames: 'w-(--dx-complementary-sidebar-size)' })
|
|
66
|
+
decorators: [withTheme(), withLayout({ layout: 'column', classNames: 'w-(--dx-complementary-sidebar-size)' })],
|
|
77
67
|
} satisfies Meta<typeof ProcessTree>;
|
|
78
68
|
|
|
79
69
|
export default meta;
|
|
@@ -82,28 +72,12 @@ type Story = StoryObj<typeof meta>;
|
|
|
82
72
|
|
|
83
73
|
export const Default: Story = {
|
|
84
74
|
args: {
|
|
85
|
-
processes:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
makeProcess({
|
|
93
|
-
pid: Process.ID.make('1344bac8-745b-44a6-9af6-dc19509a7844'),
|
|
94
|
-
name: 'Agent alpha',
|
|
95
|
-
state: Process.State.RUNNING,
|
|
96
|
-
}),
|
|
97
|
-
makeProcess({
|
|
98
|
-
pid: Process.ID.make('b7c9787a-6705-47dc-a197-d37f1adfa338'),
|
|
99
|
-
name: 'Agent beta',
|
|
100
|
-
state: Process.State.RUNNING,
|
|
101
|
-
}),
|
|
102
|
-
makeProcess({
|
|
103
|
-
pid: Process.ID.make('43493533-a94c-4072-b18f-c0e0fd806bf5'),
|
|
104
|
-
name: 'Agent gamma',
|
|
105
|
-
state: Process.State.RUNNING,
|
|
106
|
-
}),
|
|
107
|
-
],
|
|
75
|
+
processes: processes,
|
|
76
|
+
onProcessSelect: (process) => {
|
|
77
|
+
log.info('select', process);
|
|
78
|
+
},
|
|
79
|
+
onProcessTerminate: (process) => {
|
|
80
|
+
log.info('terminate', process);
|
|
81
|
+
},
|
|
108
82
|
},
|
|
109
83
|
};
|
|
@@ -3,41 +3,47 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Match from 'effect/Match';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
|
|
8
9
|
import { Process } from '@dxos/functions-runtime';
|
|
9
|
-
import { Icon, ScrollArea, Treegrid } from '@dxos/react-ui';
|
|
10
|
+
import { Icon, IconButton, ScrollArea, Tooltip, Treegrid } from '@dxos/react-ui';
|
|
10
11
|
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
12
|
+
import { Unit } from '@dxos/util';
|
|
11
13
|
|
|
12
14
|
export type ProcessTreeProps = {
|
|
15
|
+
// TODO(burdon): Atom.
|
|
13
16
|
processes: readonly Process.Info[];
|
|
14
17
|
onProcessSelect?: (process: Process.Info) => void;
|
|
18
|
+
onProcessTerminate?: (process: Process.Info) => void;
|
|
15
19
|
};
|
|
16
20
|
|
|
17
21
|
export const ProcessTree = composable<HTMLDivElement, ProcessTreeProps>(
|
|
18
|
-
({ processes, onProcessSelect, ...props }, forwardedRef) => {
|
|
19
|
-
const
|
|
22
|
+
({ processes, onProcessSelect, onProcessTerminate, ...props }, forwardedRef) => {
|
|
23
|
+
const sortedProcesses = [
|
|
20
24
|
...processes.filter((process) => [Process.State.RUNNING, Process.State.HYBERNATING].includes(process.state)),
|
|
21
25
|
...processes.filter((process) => [Process.State.IDLE].includes(process.state)).slice(0, 3),
|
|
22
|
-
...processes
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
...processes.filter((process) =>
|
|
27
|
+
[Process.State.SUCCEEDED, Process.State.FAILED, Process.State.TERMINATED].includes(process.state),
|
|
28
|
+
),
|
|
29
|
+
].sort((a, b) => {
|
|
30
|
+
const aCompletedAt = Option.getOrElse(a.completedAt, () => Infinity);
|
|
31
|
+
const bCompletedAt = Option.getOrElse(b.completedAt, () => Infinity);
|
|
32
|
+
return bCompletedAt - aCompletedAt;
|
|
33
|
+
});
|
|
28
34
|
|
|
29
35
|
return (
|
|
30
36
|
<ScrollArea.Root {...composableProps(props, { classNames: 'dx-expander' })} thin ref={forwardedRef}>
|
|
31
37
|
<ScrollArea.Viewport>
|
|
32
38
|
<Treegrid.Root gridTemplateColumns='1fr'>
|
|
33
|
-
{
|
|
39
|
+
{sortedProcesses
|
|
34
40
|
.filter((process) => process.parentPid === null)
|
|
35
41
|
.map((process) => {
|
|
36
|
-
const activeChildren = filteredProcesses.filter(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
);
|
|
42
|
+
// const activeChildren = filteredProcesses.filter(
|
|
43
|
+
// (candidate) =>
|
|
44
|
+
// candidate.parentPid?.toString() === process.pid.toString() &&
|
|
45
|
+
// candidate.state === Process.State.RUNNING,
|
|
46
|
+
// );
|
|
41
47
|
return (
|
|
42
48
|
<Treegrid.Row
|
|
43
49
|
key={process.pid.toString()}
|
|
@@ -46,34 +52,60 @@ export const ProcessTree = composable<HTMLDivElement, ProcessTreeProps>(
|
|
|
46
52
|
>
|
|
47
53
|
<Treegrid.Cell
|
|
48
54
|
indent
|
|
49
|
-
classNames=
|
|
55
|
+
classNames={mx(
|
|
56
|
+
'grid grid-cols-[min-content_1fr_min-content_min-content] items-center gap-1 min-w-0',
|
|
57
|
+
onProcessSelect && 'dx-hover',
|
|
58
|
+
)}
|
|
50
59
|
onClick={() => onProcessSelect?.(process)}
|
|
51
60
|
>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Match.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
<Tooltip.Trigger className='p-1' content={process.state.toString()}>
|
|
62
|
+
<Icon
|
|
63
|
+
size={4}
|
|
64
|
+
classNames={mx(
|
|
65
|
+
process.state === Process.State.RUNNING && 'animate-spin',
|
|
66
|
+
process.state === Process.State.FAILED && 'text-error-text',
|
|
67
|
+
process.state === Process.State.SUCCEEDED && 'text-success-text',
|
|
68
|
+
)}
|
|
69
|
+
icon={Match.value(process.state).pipe(
|
|
70
|
+
Match.when(Process.State.RUNNING, () => 'ph--spinner-gap--regular'),
|
|
71
|
+
Match.when(Process.State.SUCCEEDED, () => 'ph--check-circle--regular'),
|
|
72
|
+
Match.when(Process.State.FAILED, () => 'ph--warning--regular'),
|
|
73
|
+
Match.when(Process.State.HYBERNATING, () => 'ph--spinner--regular'),
|
|
74
|
+
Match.when(Process.State.IDLE, () => 'ph--hourglass--regular'),
|
|
75
|
+
Match.when(Process.State.TERMINATING, () => 'ph--x-circle--regular'),
|
|
76
|
+
Match.when(Process.State.TERMINATED, () => 'ph--x-circle--regular'),
|
|
77
|
+
Match.orElse(() => 'ph--spinner-gap--regular'),
|
|
78
|
+
)}
|
|
79
|
+
/>
|
|
80
|
+
</Tooltip.Trigger>
|
|
70
81
|
<div role='none' className='flex items-center gap-2 text-xs overflow-hidden'>
|
|
71
82
|
{/* TODO(burdon): Name is too long (and not informative). */}
|
|
72
|
-
<span className='truncate text-description'>
|
|
83
|
+
<span className='truncate text-description select-none'>
|
|
84
|
+
{process.params.name ?? process.pid.toString()}
|
|
85
|
+
</span>
|
|
73
86
|
{/* {activeChildren.length > 0 && (
|
|
74
87
|
<span className='text-xs text-description ml-1'>{activeChildren[0].params.name}</span>
|
|
75
88
|
)} */}
|
|
76
89
|
</div>
|
|
90
|
+
{([Process.State.FAILED, Process.State.SUCCEEDED].includes(process.state) && (
|
|
91
|
+
<div className='text-xs text-description tabular-nums'>
|
|
92
|
+
{Unit.Millisecond(process.metrics.wallTime).toString()}
|
|
93
|
+
</div>
|
|
94
|
+
)) || <div />}
|
|
95
|
+
{onProcessTerminate && (
|
|
96
|
+
<IconButton
|
|
97
|
+
classNames='min-h-0 p-1'
|
|
98
|
+
icon='ph--x--regular'
|
|
99
|
+
iconOnly
|
|
100
|
+
variant='ghost'
|
|
101
|
+
size={4}
|
|
102
|
+
label='Actions'
|
|
103
|
+
onClick={(event) => {
|
|
104
|
+
event.stopPropagation();
|
|
105
|
+
onProcessTerminate?.(process);
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
108
|
+
)}
|
|
77
109
|
</Treegrid.Cell>
|
|
78
110
|
</Treegrid.Row>
|
|
79
111
|
);
|
|
@@ -6,13 +6,14 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { createSystemPrompt } from '@dxos/assistant';
|
|
9
|
-
import { Blueprint, Template } from '@dxos/
|
|
9
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
12
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
13
13
|
import { trim } from '@dxos/util';
|
|
14
14
|
|
|
15
|
-
import { translations } from '
|
|
15
|
+
import { translations } from '#translations';
|
|
16
|
+
|
|
16
17
|
import { TemplateEditor, type TemplateEditorProps } from './TemplateEditor';
|
|
17
18
|
|
|
18
19
|
const FENCE = '```';
|
|
@@ -6,7 +6,7 @@ import { defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language'
|
|
|
6
6
|
import { composeRefs } from '@radix-ui/react-compose-refs';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import { type Template } from '@dxos/
|
|
9
|
+
import { type Template } from '@dxos/compute';
|
|
10
10
|
import { createDocAccessor } from '@dxos/echo-db';
|
|
11
11
|
import { useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
@@ -35,17 +35,17 @@ export const TemplateEditor = composable<HTMLDivElement, TemplateEditorProps>(
|
|
|
35
35
|
const { t } = useTranslation(meta.id);
|
|
36
36
|
const { themeMode } = useThemeContext();
|
|
37
37
|
const { parentRef } = useTextEditor(() => {
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
38
|
+
const target = template.source?.target;
|
|
39
|
+
if (!target) {
|
|
40
40
|
return {};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return {
|
|
44
|
-
initialValue:
|
|
44
|
+
initialValue: target.content ?? '',
|
|
45
45
|
extensions: [
|
|
46
46
|
createDataExtensions({
|
|
47
47
|
id,
|
|
48
|
-
text: createDocAccessor(
|
|
48
|
+
text: createDocAccessor(target, ['content']),
|
|
49
49
|
}),
|
|
50
50
|
createBasicExtensions({
|
|
51
51
|
bracketMatching: false,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Meta } from '@storybook/react-vite';
|
|
6
6
|
import React, { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { Blueprint, Template } from '@dxos/
|
|
8
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
@@ -13,7 +13,8 @@ import { withClientProvider } from '@dxos/react-client/testing';
|
|
|
13
13
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
14
14
|
import { trim } from '@dxos/util';
|
|
15
15
|
|
|
16
|
-
import { translations } from '
|
|
16
|
+
import { translations } from '#translations';
|
|
17
|
+
|
|
17
18
|
import { type TemplateChangeCallback, TemplateForm } from './TemplateForm';
|
|
18
19
|
|
|
19
20
|
const TEMPLATE = trim`
|
|
@@ -42,7 +43,7 @@ const DefaultStory = () => {
|
|
|
42
43
|
|
|
43
44
|
const handleChange: TemplateChangeCallback = useCallback(
|
|
44
45
|
(mutate) => {
|
|
45
|
-
Obj.
|
|
46
|
+
Obj.update(blueprint, (blueprint) => mutate(blueprint.instructions));
|
|
46
47
|
},
|
|
47
48
|
[blueprint],
|
|
48
49
|
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type * as Schema from 'effect/Schema';
|
|
6
6
|
import React, { Fragment, useCallback, useEffect } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type Template } from '@dxos/
|
|
8
|
+
import { type Template } from '@dxos/compute';
|
|
9
9
|
import { type Obj } from '@dxos/echo';
|
|
10
10
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { isNonNullable } from '@dxos/util';
|
|
@@ -15,7 +15,7 @@ import { meta } from '#meta';
|
|
|
15
15
|
import { TemplateEditor } from './TemplateEditor';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Callback type for mutating template within a parent object's Obj.
|
|
18
|
+
* Callback type for mutating template within a parent object's Obj.update context.
|
|
19
19
|
*/
|
|
20
20
|
export type TemplateChangeCallback = (mutate: (template: Obj.Mutable<Template.Template>) => void) => void;
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ export type TemplateFormProps = {
|
|
|
25
25
|
schema?: Schema.Schema<any, any, any>;
|
|
26
26
|
commandEditable?: boolean;
|
|
27
27
|
/**
|
|
28
|
-
* Callback to mutate the template. Should wrap mutations in parent's Obj.
|
|
28
|
+
* Callback to mutate the template. Should wrap mutations in parent's Obj.update.
|
|
29
29
|
* If not provided, the component is read-only.
|
|
30
30
|
*/
|
|
31
31
|
onChange?: TemplateChangeCallback;
|
|
@@ -15,7 +15,8 @@ import { MapPlugin } from '@dxos/plugin-map';
|
|
|
15
15
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
16
16
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
17
17
|
|
|
18
|
-
import { translations } from '
|
|
18
|
+
import { translations } from '#translations';
|
|
19
|
+
|
|
19
20
|
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
20
21
|
|
|
21
22
|
const DefaultStory = (props: ToolboxProps) => {
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { Fragment, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type Blueprint } from '@dxos/
|
|
7
|
+
import { type Blueprint } from '@dxos/compute';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
8
9
|
import { type Database, type Ref } from '@dxos/echo';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
|
-
import { Operation } from '@dxos/operation';
|
|
11
11
|
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
12
12
|
import { ScrollArea, type ThemedClassName } from '@dxos/react-ui';
|
|
13
13
|
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
@@ -22,9 +22,9 @@ import { createObjectFactory, TypeSpec } from '@dxos/schema/testing';
|
|
|
22
22
|
import { Message, Organization, Person } from '@dxos/types';
|
|
23
23
|
|
|
24
24
|
import { createMessage } from '#testing';
|
|
25
|
+
import { translations } from '#translations';
|
|
25
26
|
|
|
26
27
|
import { AssistantPlugin } from '../../AssistantPlugin';
|
|
27
|
-
import { translations } from '../../translations';
|
|
28
28
|
import { AgentArticle } from './AgentArticle';
|
|
29
29
|
|
|
30
30
|
random.seed(1);
|
|
@@ -11,9 +11,9 @@ import React, { forwardRef, useCallback, useMemo, useState } from 'react';
|
|
|
11
11
|
import { Surface, useCapabilities } from '@dxos/app-framework/ui';
|
|
12
12
|
import { AppSurface, useObjectMenuItems } from '@dxos/app-toolkit/ui';
|
|
13
13
|
import { Agent } from '@dxos/assistant-toolkit';
|
|
14
|
+
import { QueueService } from '@dxos/compute';
|
|
14
15
|
import { Annotation, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
15
16
|
import { AtomObj, AtomRef } from '@dxos/echo-atom';
|
|
16
|
-
import { QueueService } from '@dxos/functions';
|
|
17
17
|
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
18
18
|
import { useQuery } from '@dxos/react-client/echo';
|
|
19
19
|
import { Card, Message, Panel, ScrollArea, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
@@ -52,7 +52,7 @@ export const AgentArticle = ({ role, subject: agent }: AgentArticleProps) => {
|
|
|
52
52
|
await runtime.runPromise(
|
|
53
53
|
Effect.gen(function* () {
|
|
54
54
|
const queue = yield* QueueService.createQueue();
|
|
55
|
-
Obj.
|
|
55
|
+
Obj.update(agent, (agent) => {
|
|
56
56
|
agent.queue = Ref.fromDXN(queue.dxn);
|
|
57
57
|
});
|
|
58
58
|
}),
|
|
@@ -21,8 +21,9 @@ import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
|
21
21
|
import { Text } from '@dxos/schema';
|
|
22
22
|
import { Organization } from '@dxos/types';
|
|
23
23
|
|
|
24
|
+
import { translations } from '#translations';
|
|
25
|
+
|
|
24
26
|
import { AssistantPlugin } from '../../AssistantPlugin';
|
|
25
|
-
import { translations } from '../../translations';
|
|
26
27
|
import { AgentProperties } from './AgentProperties';
|
|
27
28
|
|
|
28
29
|
type DefaultStoryProps = {};
|
|
@@ -10,10 +10,10 @@ import React, { useCallback, useEffect, useMemo } from 'react';
|
|
|
10
10
|
import { useCapability } from '@dxos/app-framework/ui';
|
|
11
11
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
12
12
|
import { Agent, SyncTriggers } from '@dxos/assistant-toolkit';
|
|
13
|
+
import { Operation } from '@dxos/compute';
|
|
13
14
|
import { DXN, Obj, Ref } from '@dxos/echo';
|
|
14
15
|
import { AtomObj } from '@dxos/echo-atom';
|
|
15
16
|
import { log } from '@dxos/log';
|
|
16
|
-
import { Operation } from '@dxos/operation';
|
|
17
17
|
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
18
18
|
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
19
19
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
@@ -86,7 +86,7 @@ export const AgentProperties = ({ subject: agent }: AgentPropertiesProps) => {
|
|
|
86
86
|
// Create/remove agent subscription.
|
|
87
87
|
const handleSubscriptionChange = useCallback(
|
|
88
88
|
(object: Obj.Unknown, checked: boolean) => {
|
|
89
|
-
Obj.
|
|
89
|
+
Obj.update(agent, (agent) => {
|
|
90
90
|
if (checked) {
|
|
91
91
|
agent.subscriptions.push(Ref.fromDXN(Obj.getDXN(object)));
|
|
92
92
|
} else {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
-
import { type Blueprint } from '@dxos/
|
|
8
|
+
import { type Blueprint } from '@dxos/compute';
|
|
9
9
|
import { Panel, Toolbar } from '@dxos/react-ui';
|
|
10
10
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
11
11
|
|
|
@@ -11,8 +11,8 @@ import { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
|
11
11
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
12
12
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
13
13
|
import { Chat } from '@dxos/assistant-toolkit';
|
|
14
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
15
14
|
import { getSpace } from '@dxos/client/echo';
|
|
15
|
+
import { Blueprint } from '@dxos/compute';
|
|
16
16
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
17
17
|
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
18
18
|
import { useQuery } from '@dxos/react-client/echo';
|
|
@@ -14,7 +14,7 @@ import { getParentId } from '@dxos/react-ui-attention';
|
|
|
14
14
|
|
|
15
15
|
import { Chat as ChatComponent, type ChatRootProps } from '#components';
|
|
16
16
|
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '#hooks';
|
|
17
|
-
import { AssistantCapabilities, type ChatType } from '#types';
|
|
17
|
+
import { type Assistant, AssistantCapabilities, type ChatType } from '#types';
|
|
18
18
|
|
|
19
19
|
export type ChatContainerProps = (
|
|
20
20
|
| AppSurface.ObjectArticleProps<ChatType.Chat | undefined>
|
|
@@ -64,21 +64,31 @@ export const ChatContainer = forwardRef<HTMLDivElement, ChatContainerProps>((pro
|
|
|
64
64
|
|
|
65
65
|
const feedTarget = chat?.feed.target;
|
|
66
66
|
const queue = space && feedTarget ? space.queues.get(Feed.getQueueDxn(feedTarget)!) : undefined;
|
|
67
|
+
const view = (chat?.view as Assistant.ChatView | undefined) ?? settings.chatView;
|
|
67
68
|
|
|
68
69
|
if (!processor) {
|
|
69
70
|
return null;
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
return (
|
|
73
|
-
<ChatComponent.Root db={space?.db} chat={chat}
|
|
74
|
+
<ChatComponent.Root db={space?.db} chat={chat} feed={queue} processor={processor} onEvent={onEvent}>
|
|
74
75
|
<Panel.Root role={role} ref={forwardedRef}>
|
|
75
76
|
<Panel.Toolbar className='bg-toolbar-surface'>
|
|
76
77
|
<ChatComponent.Toolbar classNames='dx-document' attendableId={attendableId} companionTo={companionTo} />
|
|
77
78
|
</Panel.Toolbar>
|
|
78
79
|
<Panel.Content>
|
|
79
|
-
<ChatComponent.
|
|
80
|
-
<
|
|
81
|
-
|
|
80
|
+
<ChatComponent.Content>
|
|
81
|
+
<div role='none' className='dx-container relative'>
|
|
82
|
+
<ChatComponent.Thread viewType={view} />
|
|
83
|
+
{view !== 'summary' && (
|
|
84
|
+
<div role='none' className='absolute bottom-2 left-0 right-0'>
|
|
85
|
+
<div role='none' className='dx-document px-4'>
|
|
86
|
+
<ChatComponent.Status classNames='px-3 rounded-sm bg-group-surface' />
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
)}
|
|
90
|
+
</div>
|
|
91
|
+
<div role='none' className='dx-document px-4 pb-4'>
|
|
82
92
|
<ChatComponent.Prompt
|
|
83
93
|
{...chatProps}
|
|
84
94
|
outline
|
|
@@ -87,7 +97,7 @@ export const ChatContainer = forwardRef<HTMLDivElement, ChatContainerProps>((pro
|
|
|
87
97
|
onOnlineChange={setOnline}
|
|
88
98
|
/>
|
|
89
99
|
</div>
|
|
90
|
-
</ChatComponent.
|
|
100
|
+
</ChatComponent.Content>
|
|
91
101
|
</Panel.Content>
|
|
92
102
|
</Panel.Root>
|
|
93
103
|
</ChatComponent.Root>
|
|
@@ -13,7 +13,7 @@ import { ChatDialog as NaturalChatDialog } from '@dxos/react-ui-chat';
|
|
|
13
13
|
import { Chat, type ChatRootProps } from '#components';
|
|
14
14
|
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '#hooks';
|
|
15
15
|
import { meta } from '#meta';
|
|
16
|
-
import { AssistantCapabilities } from '#types';
|
|
16
|
+
import { type Assistant, AssistantCapabilities } from '#types';
|
|
17
17
|
|
|
18
18
|
export type ChatDialogProps = {
|
|
19
19
|
chat?: ChatTypes.Chat;
|
|
@@ -28,13 +28,7 @@ export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
|
28
28
|
const [online, setOnline] = useOnline();
|
|
29
29
|
const { preset, ...chatProps } = usePresets(online);
|
|
30
30
|
const blueprintRegistry = useBlueprintRegistry();
|
|
31
|
-
const processor = useChatProcessor({
|
|
32
|
-
chat,
|
|
33
|
-
preset,
|
|
34
|
-
runtime,
|
|
35
|
-
blueprintRegistry,
|
|
36
|
-
settings,
|
|
37
|
-
});
|
|
31
|
+
const processor = useChatProcessor({ chat, preset, runtime, blueprintRegistry, settings });
|
|
38
32
|
|
|
39
33
|
// TODO(burdon): Refocus when open.
|
|
40
34
|
const [open, setOpen] = useState(true);
|
|
@@ -61,7 +55,7 @@ export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
|
61
55
|
<NaturalChatDialog.Root open={open} expanded={expanded} onOpenChange={setOpen}>
|
|
62
56
|
<NaturalChatDialog.Header title={t('assistant-dialog.title')} />
|
|
63
57
|
<NaturalChatDialog.Content>
|
|
64
|
-
<Chat.Thread />
|
|
58
|
+
<Chat.Thread viewType={(chat.view as Assistant.ChatView | undefined) ?? settings.chatView} />
|
|
65
59
|
</NaturalChatDialog.Content>
|
|
66
60
|
<NaturalChatDialog.Footer classNames='p-1.5'>
|
|
67
61
|
<Chat.Prompt {...chatProps} preset={preset?.id} online={online} onOnlineChange={setOnline} expandable />
|
package/src/containers/{PromptArticle/PromptArticle.tsx → RoutineArticle/RoutineArticle.tsx}
RENAMED
|
@@ -6,10 +6,10 @@ import React, { useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { AgentPrompt } from '@dxos/assistant-toolkit';
|
|
9
|
-
import { type
|
|
9
|
+
import { type Routine } from '@dxos/compute';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
10
11
|
import { Obj } from '@dxos/echo';
|
|
11
12
|
import { invariant } from '@dxos/invariant';
|
|
12
|
-
import { Operation } from '@dxos/operation';
|
|
13
13
|
import { useComputeRuntimeCallback } from '@dxos/plugin-automation/hooks';
|
|
14
14
|
import { Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
15
15
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
@@ -17,9 +17,9 @@ import { useAttention } from '@dxos/react-ui-attention';
|
|
|
17
17
|
import { TemplateEditor } from '#components';
|
|
18
18
|
import { meta } from '#meta';
|
|
19
19
|
|
|
20
|
-
export type
|
|
20
|
+
export type RoutineArticleProps = AppSurface.ObjectArticleProps<Routine.Routine>;
|
|
21
21
|
|
|
22
|
-
export const
|
|
22
|
+
export const RoutineArticle = ({ role, attendableId, subject }: RoutineArticleProps) => {
|
|
23
23
|
const { t } = useTranslation(meta.id);
|
|
24
24
|
const { hasAttention } = useAttention(attendableId);
|
|
25
25
|
const db = Obj.getDatabase(subject);
|
package/src/containers/{PromptList/PromptList.stories.tsx → RoutineList/RoutineList.stories.tsx}
RENAMED
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { SERVICES_CONFIG } from '@dxos/ai/testing';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
-
import {
|
|
11
|
+
import { Routine } from '@dxos/compute';
|
|
12
12
|
import { Filter } from '@dxos/echo';
|
|
13
13
|
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
14
14
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
@@ -20,10 +20,11 @@ import { Panel } from '@dxos/react-ui';
|
|
|
20
20
|
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
21
21
|
import { Organization } from '@dxos/types';
|
|
22
22
|
|
|
23
|
+
import { translations } from '#translations';
|
|
24
|
+
|
|
23
25
|
import { AssistantPlugin } from '../../AssistantPlugin';
|
|
24
|
-
import { translations } from '../../translations';
|
|
25
26
|
import { TracePanel } from '../TracePanel';
|
|
26
|
-
import {
|
|
27
|
+
import { RoutineList } from './RoutineList';
|
|
27
28
|
|
|
28
29
|
// TODO(burdon): Factor out (see assistant-stories)
|
|
29
30
|
export const config = {
|
|
@@ -60,7 +61,7 @@ const DefaultStory = () => {
|
|
|
60
61
|
return (
|
|
61
62
|
<Panel.Root>
|
|
62
63
|
<Panel.Toolbar className='flex p-1 items-center'>
|
|
63
|
-
<
|
|
64
|
+
<RoutineList subject={subject} role='toolbar-input' attendableId='story' />
|
|
64
65
|
</Panel.Toolbar>
|
|
65
66
|
<Panel.Content>
|
|
66
67
|
<TracePanel role='article' space={space} attendableId={space.id} />
|
|
@@ -70,7 +71,7 @@ const DefaultStory = () => {
|
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
const meta = {
|
|
73
|
-
title: 'plugins/plugin-assistant/containers/
|
|
74
|
+
title: 'plugins/plugin-assistant/containers/RoutineList',
|
|
74
75
|
render: DefaultStory,
|
|
75
76
|
decorators: [
|
|
76
77
|
withLayout({ layout: 'column' }),
|
|
@@ -78,7 +79,7 @@ const meta = {
|
|
|
78
79
|
plugins: [
|
|
79
80
|
...corePlugins(),
|
|
80
81
|
ClientPlugin({
|
|
81
|
-
types: [
|
|
82
|
+
types: [Routine.Routine, Organization.Organization, Markdown.Document],
|
|
82
83
|
config: config.remote,
|
|
83
84
|
onClientInitialized: ({ client }) =>
|
|
84
85
|
Effect.gen(function* () {
|
|
@@ -91,19 +92,19 @@ const meta = {
|
|
|
91
92
|
}),
|
|
92
93
|
);
|
|
93
94
|
space.db.add(
|
|
94
|
-
|
|
95
|
+
Routine.make({
|
|
95
96
|
name: 'Summarize',
|
|
96
97
|
instructions: 'Create a new markdown document that is a summary of the selected object.',
|
|
97
98
|
}),
|
|
98
99
|
);
|
|
99
100
|
space.db.add(
|
|
100
|
-
|
|
101
|
+
Routine.make({
|
|
101
102
|
name: 'Analyze',
|
|
102
103
|
instructions: 'Analyze the selected content.',
|
|
103
104
|
}),
|
|
104
105
|
);
|
|
105
106
|
space.db.add(
|
|
106
|
-
|
|
107
|
+
Routine.make({
|
|
107
108
|
name: 'Translate',
|
|
108
109
|
instructions: 'Translate the selected content to Spanish.',
|
|
109
110
|
}),
|