@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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
|
+
|
|
8
|
+
import { AgentRequestBegin, AgentRequestEnd, CompleteBlock } from '@dxos/assistant';
|
|
9
|
+
import { Process, Trace } from '@dxos/compute';
|
|
10
|
+
import { ObjectId } from '@dxos/keys';
|
|
11
|
+
|
|
12
|
+
export interface AgentScenario {
|
|
13
|
+
readonly prompt: string;
|
|
14
|
+
readonly tools: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Probability that any given run aborts with a simulated tool failure. */
|
|
18
|
+
const FAILURE_PROBABILITY = 0.1;
|
|
19
|
+
|
|
20
|
+
export const agentScenarios: readonly AgentScenario[] = [
|
|
21
|
+
{
|
|
22
|
+
prompt: 'Create an organization called "Cyberdyne Systems"',
|
|
23
|
+
tools: ['list-schemas', 'create-object'],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
prompt: 'Search for all organizations and persons',
|
|
27
|
+
tools: ['list-schemas', 'query', 'query'],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
prompt: 'Create a person named "John Connor"',
|
|
31
|
+
tools: ['create-object'],
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const delay = (ms: number) => Effect.promise(() => new Promise<void>((resolve) => setTimeout(resolve, ms)));
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Write a trace event and yield to the event loop so FeedTraceSink flushes it to ECHO before continuing.
|
|
39
|
+
*/
|
|
40
|
+
const writeAndFlush = <T>(eventType: Trace.EventType<T>, payload: T) =>
|
|
41
|
+
Effect.gen(function* () {
|
|
42
|
+
yield* Trace.write(eventType, payload);
|
|
43
|
+
yield* Effect.promise(() => new Promise((resolve) => setTimeout(resolve, 100)));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Storybook fixture: a {@link Process} that emits a deterministic stream of agent trace events
|
|
48
|
+
* (request begin/end, user message, sequential tool calls with simulated latency).
|
|
49
|
+
*
|
|
50
|
+
* Input is a scenario index into {@link agentScenarios} (modulo the array length).
|
|
51
|
+
*/
|
|
52
|
+
export const SimulatedAgent = Process.make(
|
|
53
|
+
{
|
|
54
|
+
key: 'org.dxos.testing.process.agent',
|
|
55
|
+
input: Schema.Number,
|
|
56
|
+
output: Schema.Void,
|
|
57
|
+
services: [Trace.TraceService],
|
|
58
|
+
},
|
|
59
|
+
(ctx) =>
|
|
60
|
+
Effect.succeed({
|
|
61
|
+
onInput: (index: number) =>
|
|
62
|
+
Effect.gen(function* () {
|
|
63
|
+
const messageId = ObjectId.random();
|
|
64
|
+
const scenario = agentScenarios[index % agentScenarios.length];
|
|
65
|
+
|
|
66
|
+
// Decide upfront whether this run will fail (and at which tool) so the trace shows a partial sequence.
|
|
67
|
+
const failAtToolIndex =
|
|
68
|
+
Math.random() < FAILURE_PROBABILITY ? Math.floor(Math.random() * scenario.tools.length) : -1;
|
|
69
|
+
|
|
70
|
+
// Agent begins processing.
|
|
71
|
+
yield* writeAndFlush(AgentRequestBegin, {});
|
|
72
|
+
|
|
73
|
+
// User message.
|
|
74
|
+
yield* writeAndFlush(CompleteBlock, {
|
|
75
|
+
messageId,
|
|
76
|
+
role: 'user',
|
|
77
|
+
block: { _tag: 'text', text: scenario.prompt },
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// Simulate tool calls sequentially with delays.
|
|
81
|
+
for (const [index, toolName] of scenario.tools.entries()) {
|
|
82
|
+
const toolCallId = ObjectId.random();
|
|
83
|
+
|
|
84
|
+
// Tool call event.
|
|
85
|
+
yield* writeAndFlush(CompleteBlock, {
|
|
86
|
+
messageId,
|
|
87
|
+
role: 'assistant',
|
|
88
|
+
block: { _tag: 'toolCall', toolCallId, name: toolName, input: '{}', providerExecuted: false },
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// Simulate tool execution time.
|
|
92
|
+
yield* delay(1_000 + Math.random() * 3_000);
|
|
93
|
+
|
|
94
|
+
if (index === failAtToolIndex) {
|
|
95
|
+
ctx.fail(new Error(`Simulated failure in tool '${toolName}'`));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Tool result event.
|
|
100
|
+
yield* writeAndFlush(CompleteBlock, {
|
|
101
|
+
messageId,
|
|
102
|
+
role: 'assistant',
|
|
103
|
+
block: { _tag: 'toolResult', toolCallId, name: toolName, providerExecuted: false },
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Agent completes.
|
|
108
|
+
yield* writeAndFlush(AgentRequestEnd, {});
|
|
109
|
+
ctx.succeed();
|
|
110
|
+
}).pipe(Effect.orDie),
|
|
111
|
+
onAlarm: () => Effect.void,
|
|
112
|
+
onChildEvent: () => Effect.void,
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Dispatch, type SetStateAction, useEffect, useRef, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Interval (ms) between auto-played trace messages in the snapshot playback story.
|
|
9
|
+
*/
|
|
10
|
+
export const PLAYBACK_INTERVAL_MS = 250;
|
|
11
|
+
|
|
12
|
+
export const STEP_STORAGE_KEY = 'plugin-assistant.trace-panel.snapshot.step';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* `useState<number>` that hydrates from and persists to `localStorage`.
|
|
16
|
+
* The third tuple member is `true` iff a valid value was loaded on first render.
|
|
17
|
+
*/
|
|
18
|
+
export const useLocalStorageNumber = (
|
|
19
|
+
key: string,
|
|
20
|
+
initial: number,
|
|
21
|
+
): [number, Dispatch<SetStateAction<number>>, boolean] => {
|
|
22
|
+
const initRef = useRef<{ value: number; hydrated: boolean } | null>(null);
|
|
23
|
+
if (initRef.current === null) {
|
|
24
|
+
let value = initial;
|
|
25
|
+
let hydrated = false;
|
|
26
|
+
if (typeof window !== 'undefined') {
|
|
27
|
+
const stored = window.localStorage.getItem(key);
|
|
28
|
+
const parsed = stored === null ? Number.NaN : Number(stored);
|
|
29
|
+
if (Number.isInteger(parsed) && parsed >= 0) {
|
|
30
|
+
value = parsed;
|
|
31
|
+
hydrated = true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
initRef.current = { value, hydrated };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const [value, setValue] = useState(initRef.current.value);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (typeof window !== 'undefined') {
|
|
40
|
+
window.localStorage.setItem(key, String(value));
|
|
41
|
+
}
|
|
42
|
+
}, [key, value]);
|
|
43
|
+
|
|
44
|
+
return [value, setValue, initRef.current.hydrated];
|
|
45
|
+
};
|
package/src/containers/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const ChatContainer: ComponentType<any> = lazy(() => import('./ChatContai
|
|
|
10
10
|
export const ChatDialog: ComponentType<any> = lazy(() => import('./ChatDialog'));
|
|
11
11
|
export const AgentArticle: ComponentType<any> = lazy(() => import('./AgentArticle'));
|
|
12
12
|
export const AgentProperties: ComponentType<any> = lazy(() => import('./AgentProperties'));
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
13
|
+
export const RoutineArticle: ComponentType<any> = lazy(() => import('./RoutineArticle'));
|
|
14
|
+
export const RoutineList: ComponentType<any> = lazy(() => import('./RoutineList'));
|
|
15
15
|
export const TracePanel: ComponentType<any> = lazy(() => import('./TracePanel'));
|
|
16
16
|
export const TriggerStatus: ComponentType<any> = lazy(() => import('./TriggerStatus'));
|
package/src/hooks/index.ts
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
export * from './useBlueprintRegistry';
|
|
6
|
+
export * from './useChatKeymap';
|
|
6
7
|
export * from './useChatProcessor';
|
|
7
8
|
export * from './useChatServices';
|
|
8
9
|
export * from './useChatToolbarActions';
|
|
9
10
|
export * from './useContextBinder';
|
|
10
11
|
export * from './useContextObjects';
|
|
12
|
+
export { useDebug } from './useDebug';
|
|
11
13
|
export * from './useFilteredTypes';
|
|
12
14
|
export * from './useFlush';
|
|
13
15
|
export * from './useOnline';
|
|
@@ -7,7 +7,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
7
7
|
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { type AiContextBinder } from '@dxos/assistant';
|
|
10
|
-
import { Blueprint } from '@dxos/
|
|
10
|
+
import { Blueprint } from '@dxos/compute';
|
|
11
11
|
import { type Database, Filter, Obj, Ref } from '@dxos/echo';
|
|
12
12
|
import { useQuery } from '@dxos/react-client/echo';
|
|
13
13
|
import { distinctBy } from '@dxos/util';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Extension, Prec } from '@codemirror/state';
|
|
6
|
+
import { keymap } from '@codemirror/view';
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
|
|
9
|
+
import { type Event } from '@dxos/async';
|
|
10
|
+
import { isTruthy } from '@dxos/util';
|
|
11
|
+
|
|
12
|
+
import { type ChatEvent } from '../components/Chat/events';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* CodeMirror keymap shared by the chat document (Thread) and the prompt editor — pressing
|
|
16
|
+
* Mod-Arrow keys when either editor is focused emits the corresponding `ChatEvent` on the
|
|
17
|
+
* shared event bus.
|
|
18
|
+
*/
|
|
19
|
+
export const useChatKeymapExtensions = ({ event }: { event: Event<ChatEvent> }): Extension[] => {
|
|
20
|
+
return useMemo<Extension[]>(() => {
|
|
21
|
+
return [
|
|
22
|
+
Prec.highest(
|
|
23
|
+
keymap.of([
|
|
24
|
+
{
|
|
25
|
+
key: 'Mod-ArrowUp',
|
|
26
|
+
preventDefault: true,
|
|
27
|
+
run: () => {
|
|
28
|
+
event.emit({ type: 'nav-previous' });
|
|
29
|
+
return true;
|
|
30
|
+
},
|
|
31
|
+
shift: () => {
|
|
32
|
+
event.emit({ type: 'thread-open' });
|
|
33
|
+
return true;
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'Mod-ArrowDown',
|
|
38
|
+
preventDefault: true,
|
|
39
|
+
run: () => {
|
|
40
|
+
event.emit({ type: 'nav-next' });
|
|
41
|
+
return true;
|
|
42
|
+
},
|
|
43
|
+
shift: () => {
|
|
44
|
+
event.emit({ type: 'thread-close' });
|
|
45
|
+
return true;
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
]),
|
|
49
|
+
),
|
|
50
|
+
].filter(isTruthy);
|
|
51
|
+
}, [event]);
|
|
52
|
+
};
|
|
@@ -8,7 +8,7 @@ import { useContext, useMemo, useState } from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { AiSession } from '@dxos/assistant';
|
|
10
10
|
import { type Chat } from '@dxos/assistant-toolkit';
|
|
11
|
-
import { type Blueprint } from '@dxos/
|
|
11
|
+
import { type Blueprint } from '@dxos/compute';
|
|
12
12
|
import { Feed, Ref } from '@dxos/echo';
|
|
13
13
|
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
14
14
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
import { trim } from '@dxos/util';
|
|
8
|
+
|
|
9
|
+
import { type AiChatProcessor } from '../processor';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Returns an async callback that logs the chat's current context, system prompt,
|
|
13
|
+
* and resolved tools to the browser console under a collapsible group.
|
|
14
|
+
* Used by the chat's debug-toggle event handler.
|
|
15
|
+
*/
|
|
16
|
+
export const useDebug = ({ processor }: { processor: AiChatProcessor }) => {
|
|
17
|
+
return useCallback(async () => {
|
|
18
|
+
const objects = processor.context.getObjects();
|
|
19
|
+
const blueprints = processor.context.getBlueprints();
|
|
20
|
+
const system = await processor.getSystemPrompt();
|
|
21
|
+
const tools = (await processor.getTools()) ?? {};
|
|
22
|
+
console.group('Chat', { objects, blueprints });
|
|
23
|
+
try {
|
|
24
|
+
console.log(trim`
|
|
25
|
+
System Prompt:
|
|
26
|
+
${system}
|
|
27
|
+
`);
|
|
28
|
+
console.log(trim`
|
|
29
|
+
Tools:
|
|
30
|
+
${Object.values(tools)
|
|
31
|
+
.map((tool) => JSON.stringify(tool, null, 2))
|
|
32
|
+
.join('\n')}
|
|
33
|
+
`);
|
|
34
|
+
} finally {
|
|
35
|
+
console.groupEnd();
|
|
36
|
+
}
|
|
37
|
+
}, [processor]);
|
|
38
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -7,11 +7,11 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
import { AiContextBinder } from '@dxos/assistant';
|
|
9
9
|
import { Chat, DatabaseBlueprint, AgentWizardBlueprint } from '@dxos/assistant-toolkit';
|
|
10
|
-
import { Blueprint } from '@dxos/
|
|
10
|
+
import { Blueprint } from '@dxos/compute';
|
|
11
|
+
import { Operation } from '@dxos/compute';
|
|
11
12
|
import { Feed, Filter, Obj, Ref } from '@dxos/echo';
|
|
12
13
|
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
13
14
|
import { invariant } from '@dxos/invariant';
|
|
14
|
-
import { Operation } from '@dxos/operation';
|
|
15
15
|
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
16
16
|
|
|
17
17
|
import { AssistantBlueprint } from '#blueprints';
|
|
@@ -7,10 +7,10 @@ import * as Schema from 'effect/Schema';
|
|
|
7
7
|
import { AiService } from '@dxos/ai';
|
|
8
8
|
import { Capability } from '@dxos/app-framework';
|
|
9
9
|
import { Chat } from '@dxos/assistant-toolkit';
|
|
10
|
-
import { Prompt } from '@dxos/blueprints';
|
|
11
10
|
import { SpaceSchema } from '@dxos/client/echo';
|
|
11
|
+
import { Routine } from '@dxos/compute';
|
|
12
|
+
import { Operation } from '@dxos/compute';
|
|
12
13
|
import { Collection, Database, DXN, Feed, Obj, Ref } from '@dxos/echo';
|
|
13
|
-
import { Operation } from '@dxos/operation';
|
|
14
14
|
|
|
15
15
|
import { meta } from '#meta';
|
|
16
16
|
|
|
@@ -68,8 +68,8 @@ export const RunPromptInNewChat = Operation.make({
|
|
|
68
68
|
objects: Schema.optional(Schema.Array(Obj.Unknown)),
|
|
69
69
|
/** Blueprint keys to look up and bind to the new chat. */
|
|
70
70
|
blueprints: Schema.optional(Schema.Array(Schema.String)),
|
|
71
|
-
/** Raw instructions or an existing
|
|
72
|
-
prompt: Schema.Union(Schema.String, Ref.Ref(
|
|
71
|
+
/** Raw instructions or an existing Routine object reference. */
|
|
72
|
+
prompt: Schema.Union(Schema.String, Ref.Ref(Routine.Routine)),
|
|
73
73
|
/**
|
|
74
74
|
* When true, skips opening the chat: runs the Agent prompt operation against the new chat via the compute runtime (traced).
|
|
75
75
|
*/
|
|
@@ -6,8 +6,8 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
import { Chat } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
9
10
|
import { Filter, Obj, Query } from '@dxos/echo';
|
|
10
|
-
import { Operation } from '@dxos/operation';
|
|
11
11
|
|
|
12
12
|
import { AssistantCapabilities } from '../types';
|
|
13
13
|
import { CreateChat, EnsureCompanionChat, SetCurrentChat } from './definitions';
|
package/src/operations/index.ts
CHANGED
|
@@ -7,12 +7,11 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { describe, test } from 'vitest';
|
|
8
8
|
|
|
9
9
|
import { AgentPrompt, Chat } from '@dxos/assistant-toolkit';
|
|
10
|
-
import {
|
|
10
|
+
import { Routine } from '@dxos/compute';
|
|
11
|
+
import { Operation } from '@dxos/compute';
|
|
11
12
|
import { Database, Feed, Filter, Ref } from '@dxos/echo';
|
|
12
13
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
13
|
-
import { TestHelpers } from '@dxos/effect/testing';
|
|
14
14
|
import { ObjectId } from '@dxos/keys';
|
|
15
|
-
import { Operation } from '@dxos/operation';
|
|
16
15
|
import { AutomationPlugin } from '@dxos/plugin-automation/cli';
|
|
17
16
|
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
18
17
|
import { ClientPlugin } from '@dxos/plugin-client/cli';
|
|
@@ -28,8 +27,9 @@ ObjectId.dangerouslyDisableRandomness();
|
|
|
28
27
|
describe('Agent prompt (composer plugin harness)', () => {
|
|
29
28
|
// Hits AutomationPlugin compute runtime (plugin handlers, AiServiceLayer, blueprints).
|
|
30
29
|
// Requires reachable edge AI (see repo DX_EDGE_AI_SERVICE_URL); not memoized like AssistantTestLayer tests.
|
|
31
|
-
test
|
|
30
|
+
test(
|
|
32
31
|
'chat mode appends assistant messages to the chat queue',
|
|
32
|
+
{ tags: ['llm'], timeout: 60_000 },
|
|
33
33
|
async ({ expect }) => {
|
|
34
34
|
await using harness = await createComposerTestApp({
|
|
35
35
|
plugins: [ClientPlugin({}), AssistantPlugin(), AutomationPlugin()],
|
|
@@ -50,7 +50,7 @@ describe('Agent prompt (composer plugin harness)', () => {
|
|
|
50
50
|
|
|
51
51
|
const chat = yield* Database.add(Chat.make({ feed: Ref.make(feed) }));
|
|
52
52
|
const prompt = yield* Database.add(
|
|
53
|
-
|
|
53
|
+
Routine.make({
|
|
54
54
|
name: 'chat-mode-test',
|
|
55
55
|
instructions: 'Reply with a single word: ack.',
|
|
56
56
|
blueprints: [],
|
|
@@ -74,6 +74,5 @@ describe('Agent prompt (composer plugin harness)', () => {
|
|
|
74
74
|
}),
|
|
75
75
|
);
|
|
76
76
|
},
|
|
77
|
-
60_000,
|
|
78
77
|
);
|
|
79
78
|
});
|
|
@@ -6,7 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
-
import { Operation } from '@dxos/
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
10
|
|
|
11
11
|
import { ResolveNavigationTargets } from './definitions';
|
|
12
12
|
|
|
@@ -8,12 +8,12 @@ import { Capabilities, Capability } from '@dxos/app-framework';
|
|
|
8
8
|
import { getObjectPathFromObject, LayoutOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { AiContextBinder } from '@dxos/assistant';
|
|
10
10
|
import { AgentPrompt } from '@dxos/assistant-toolkit';
|
|
11
|
-
import { Blueprint,
|
|
11
|
+
import { Blueprint, Routine, Template } from '@dxos/compute';
|
|
12
|
+
import { Operation } from '@dxos/compute';
|
|
12
13
|
import { Database, Feed, Filter, Obj, Ref } from '@dxos/echo';
|
|
13
14
|
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
14
15
|
import { invariant } from '@dxos/invariant';
|
|
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 { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
19
19
|
import { Text } from '@dxos/schema';
|
|
@@ -64,7 +64,7 @@ const handler: Operation.WithHandler<typeof RunPromptInNewChat> = RunPromptInNew
|
|
|
64
64
|
const promptRef =
|
|
65
65
|
typeof prompt === 'string'
|
|
66
66
|
? Ref.make(
|
|
67
|
-
|
|
67
|
+
Routine.make({
|
|
68
68
|
instructions: prompt,
|
|
69
69
|
blueprints: [],
|
|
70
70
|
context: [],
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
8
9
|
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
10
|
|
|
11
11
|
import { AssistantCapabilities } from '../types';
|
|
12
12
|
import { CreateChat, SetCurrentChat } from './definitions';
|
|
@@ -7,9 +7,9 @@ import * as Prompt from '@effect/ai/Prompt';
|
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
|
|
9
9
|
import { AiPreprocessor, AiService } from '@dxos/ai';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
10
11
|
import { Database, Feed, Filter, Obj } from '@dxos/echo';
|
|
11
12
|
import { log } from '@dxos/log';
|
|
12
|
-
import { Operation } from '@dxos/operation';
|
|
13
13
|
import { Message } from '@dxos/types';
|
|
14
14
|
import { trim } from '@dxos/util';
|
|
15
15
|
|
|
@@ -48,7 +48,7 @@ const handler: Operation.WithHandler<typeof UpdateChatName> = UpdateChatName.pip
|
|
|
48
48
|
|
|
49
49
|
const newName = response.text.replaceAll(/[^a-zA-Z0-9\s]/g, '').trim();
|
|
50
50
|
|
|
51
|
-
Obj.
|
|
51
|
+
Obj.update(chat, (chat) => {
|
|
52
52
|
chat.name = newName;
|
|
53
53
|
});
|
|
54
54
|
log.info('chat name updated', { chat, newName: chat.name });
|
|
@@ -8,10 +8,10 @@ import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
|
8
8
|
|
|
9
9
|
import { AiSession } from '@dxos/assistant';
|
|
10
10
|
import { Chat } from '@dxos/assistant-toolkit';
|
|
11
|
-
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
12
11
|
import { Database, Feed } from '@dxos/echo';
|
|
13
12
|
import { acquireReleaseResource } from '@dxos/effect';
|
|
14
13
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
14
|
+
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
15
15
|
|
|
16
16
|
import { AiChatProcessor } from './processor';
|
|
17
17
|
|
|
@@ -14,17 +14,17 @@ import {
|
|
|
14
14
|
type AiSession,
|
|
15
15
|
createSystemPrompt,
|
|
16
16
|
formatSystemPrompt,
|
|
17
|
-
AgentService,
|
|
18
17
|
PartialBlock,
|
|
19
18
|
ToolExecutionServices,
|
|
20
19
|
} from '@dxos/assistant';
|
|
21
20
|
import { type Chat } from '@dxos/assistant-toolkit';
|
|
22
|
-
import { type Blueprint } from '@dxos/
|
|
21
|
+
import { type Blueprint } from '@dxos/compute';
|
|
22
|
+
import { Trace, type CredentialsService, type QueueService } from '@dxos/compute';
|
|
23
|
+
import { Operation } from '@dxos/compute';
|
|
23
24
|
import { type Database, Feed, Obj, Ref } from '@dxos/echo';
|
|
24
25
|
import { runAndForwardErrors, unwrapExit } from '@dxos/effect';
|
|
25
|
-
import {
|
|
26
|
+
import { AgentService } from '@dxos/functions-runtime';
|
|
26
27
|
import { log } from '@dxos/log';
|
|
27
|
-
import { Operation } from '@dxos/operation';
|
|
28
28
|
import type { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
29
29
|
import { Message } from '@dxos/types';
|
|
30
30
|
|
package/src/queue-logger.ts
CHANGED
|
@@ -34,7 +34,7 @@ export class QueueLogger implements SequenceLogger {
|
|
|
34
34
|
const feed = space.db.add(Feed.make({ namespace: 'trace' }));
|
|
35
35
|
queueDxn = Feed.getQueueDxn(feed) ?? undefined;
|
|
36
36
|
invariant(queueDxn, 'New invocationTraceFeed has no queue DXN');
|
|
37
|
-
Obj.
|
|
37
|
+
Obj.update(this._space.properties, (obj) => {
|
|
38
38
|
obj.invocationTraceFeed = Ref.make(feed);
|
|
39
39
|
});
|
|
40
40
|
}
|