@dxos/plugin-assistant 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/AgentArticle-5XDDEXMP.mjs +169 -0
- package/dist/lib/neutral/AgentArticle-5XDDEXMP.mjs.map +7 -0
- package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs +100 -0
- package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.mjs +10 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs +46 -0
- package/dist/lib/neutral/AssistantPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.mjs +40 -0
- package/dist/lib/neutral/AssistantPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs +27 -0
- package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs.map +7 -0
- package/dist/lib/neutral/ChatArticle-WVAFZPVI.mjs +8 -0
- package/dist/lib/neutral/ChatCompanion-DFRMRUK3.mjs +133 -0
- package/dist/lib/neutral/ChatCompanion-DFRMRUK3.mjs.map +7 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs +72 -0
- package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs.map +7 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs +28 -0
- package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs.map +7 -0
- package/dist/lib/neutral/RoutineArticle-H7ECM7AH.mjs +116 -0
- package/dist/lib/neutral/RoutineArticle-H7ECM7AH.mjs.map +7 -0
- package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs +48 -0
- package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs.map +7 -0
- package/dist/lib/neutral/TracePanel-C77SPEIS.mjs +672 -0
- package/dist/lib/neutral/TracePanel-C77SPEIS.mjs.map +7 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs +92 -0
- package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs.map +7 -0
- package/dist/lib/neutral/ai-service-GJXMI5OI.mjs +22 -0
- package/dist/lib/neutral/ai-service-GJXMI5OI.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-5QBICPYP.mjs +200 -0
- package/dist/lib/neutral/app-graph-builder-5QBICPYP.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs +32 -0
- package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +35 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-3FIV362Z.mjs +8 -0
- package/dist/lib/neutral/chunk-3FIV362Z.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4CQZCMRP.mjs +25 -0
- package/dist/lib/neutral/chunk-4CQZCMRP.mjs.map +7 -0
- package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-5H6UJHLF.mjs} +4 -5
- package/dist/lib/neutral/chunk-5H6UJHLF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ITJX2YZZ.mjs +98 -0
- package/dist/lib/neutral/chunk-ITJX2YZZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IZQWGJNG.mjs +380 -0
- package/dist/lib/neutral/chunk-IZQWGJNG.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SLIPV6NN.mjs +106 -0
- package/dist/lib/neutral/chunk-SLIPV6NN.mjs.map +7 -0
- package/dist/lib/neutral/companion-chat-provisioner-2Y6PRSDK.mjs +116 -0
- package/dist/lib/neutral/companion-chat-provisioner-2Y6PRSDK.mjs.map +7 -0
- package/dist/lib/{browser/chunk-VK53MITK.mjs → neutral/components/index.mjs} +139 -141
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +29 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/{browser/create-chat-E2ZLVTLP.mjs → neutral/create-chat-QQZURUBW.mjs} +10 -12
- package/dist/lib/neutral/create-chat-QQZURUBW.mjs.map +7 -0
- package/dist/lib/neutral/create-object-UZCJCPWM.mjs +93 -0
- package/dist/lib/neutral/create-object-UZCJCPWM.mjs.map +7 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs +21 -0
- package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs.map +7 -0
- package/dist/lib/{browser/ensure-companion-chat-7GDMXSQW.mjs → neutral/ensure-companion-chat-5S4LZM2H.mjs} +9 -16
- package/dist/lib/neutral/ensure-companion-chat-5S4LZM2H.mjs.map +7 -0
- package/dist/lib/{browser/chunk-M55MBYG7.mjs → neutral/hooks/index.mjs} +106 -111
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +32 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs +24 -0
- package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs.map +7 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs +110 -0
- package/dist/lib/neutral/markdown-KTBFOMFM.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +12 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs +28 -0
- package/dist/lib/neutral/migrations-7DEMVBOG.mjs.map +7 -0
- package/dist/lib/{browser/on-create-space-4J3KTNAJ.mjs → neutral/on-create-space-Q2R7OSP6.mjs} +4 -7
- package/dist/lib/neutral/on-create-space-Q2R7OSP6.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-SF36MOB5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-T4R65UJU.mjs +174 -0
- package/dist/lib/neutral/react-surface-T4R65UJU.mjs.map +7 -0
- package/dist/lib/{browser/resolve-navigation-targets-3ZPQE6SZ.mjs → neutral/resolve-navigation-targets-VXBSWV5L.mjs} +3 -5
- package/dist/lib/neutral/resolve-navigation-targets-VXBSWV5L.mjs.map +7 -0
- package/dist/lib/{browser/run-prompt-in-new-chat-AA3KPBDN.mjs → neutral/run-prompt-in-new-chat-VJXXZ6SI.mjs} +16 -19
- package/dist/lib/neutral/run-prompt-in-new-chat-VJXXZ6SI.mjs.map +7 -0
- package/dist/lib/{browser/set-current-chat-P4VHI3YF.mjs → neutral/set-current-chat-ZFDCYK5I.mjs} +4 -10
- package/dist/lib/neutral/set-current-chat-ZFDCYK5I.mjs.map +7 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs +28 -0
- package/dist/lib/neutral/settings-W4BLWQ53.mjs.map +7 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs +28 -0
- package/dist/lib/neutral/state-H3G7QCU6.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs +21 -0
- package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs.map +7 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs +14 -0
- package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/translations.mjs +5 -2
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +20 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/{browser/update-chat-name-VWKNUON7.mjs → neutral/update-chat-name-ENXRUMDJ.mjs} +3 -5
- package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs.map +7 -0
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.node.d.ts.map +1 -1
- package/dist/types/src/AssistantPlugin.workerd.d.ts +4 -0
- package/dist/types/src/AssistantPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +31 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +27 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +2 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +11 -5
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +2 -2
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +2 -2
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +2 -3
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +2 -15
- package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -1
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -1
- package/dist/types/src/components/TaskList/TaskList.d.ts +10 -0
- package/dist/types/src/components/TaskList/TaskList.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts +16 -0
- package/dist/types/src/components/TaskList/TaskList.stories.d.ts.map +1 -0
- package/dist/types/src/components/TaskList/index.d.ts +2 -0
- package/dist/types/src/components/TaskList/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +1 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -1
- package/dist/types/src/containers/{ChatContainer/ChatContainer.d.ts → ChatArticle/ChatArticle.d.ts} +3 -3
- package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts +2 -0
- package/dist/types/src/containers/ChatArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts +6 -0
- package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PlanArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -1
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +15 -0
- package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts +11 -2
- package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -1
- package/dist/types/src/containers/TracePanel/span-tree.d.ts +73 -0
- package/dist/types/src/containers/TracePanel/span-tree.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/span-tree.test.d.ts +2 -0
- package/dist/types/src/containers/TracePanel/span-tree.test.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -3
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/feed-logger.d.ts +13 -0
- package/dist/types/src/feed-logger.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +3 -3
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- 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 +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 +2 -2
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +2 -2
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-chat.d.ts +2 -2
- package/dist/types/src/operations/create-chat.d.ts.map +1 -1
- package/dist/types/src/operations/ensure-companion-chat.d.ts +2 -2
- package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +0 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +2 -2
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +2 -2
- 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 +2 -2
- package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
- package/dist/types/src/operations/toggle-trace-panel-debug.d.ts +5 -0
- package/dist/types/src/operations/toggle-trace-panel-debug.d.ts.map +1 -0
- package/dist/types/src/operations/update-chat-name.d.ts +2 -2
- package/dist/types/src/operations/update-chat-name.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +11 -11
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +2 -3
- package/dist/types/src/testing/test-generator.d.ts.map +1 -1
- package/dist/types/src/testing/test-sequence.d.ts +3 -3
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +1 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantCapabilities.d.ts +30 -0
- package/dist/types/src/types/AssistantCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AssistantEvents.d.ts +3 -0
- package/dist/types/src/types/AssistantEvents.d.ts.map +1 -0
- package/dist/types/src/{operations/definitions.d.ts → types/AssistantOperation.d.ts} +10 -6
- package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +1 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/suggestions.d.ts +9 -0
- package/dist/types/src/util/suggestions.d.ts.map +1 -0
- package/dist/types/src/util/suggestions.test.d.ts +2 -0
- package/dist/types/src/util/suggestions.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +152 -128
- package/src/AssistantPlugin.node.ts +7 -88
- package/src/AssistantPlugin.test.ts +3 -3
- package/src/AssistantPlugin.ts +126 -0
- package/src/AssistantPlugin.workerd.ts +41 -0
- package/src/blueprints/assistant/blueprint.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +48 -9
- package/src/capabilities/companion-chat-provisioner.ts +4 -5
- package/src/capabilities/create-object.ts +107 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/markdown.ts +2 -2
- package/src/capabilities/migrations.ts +3 -3
- package/src/capabilities/react-surface.tsx +15 -7
- package/src/components/Chat/Chat.tsx +35 -5
- package/src/components/ChatPrompt/ChatMcpErrors.tsx +1 -1
- package/src/components/ChatPrompt/ChatOptions.stories.tsx +4 -4
- package/src/components/ChatPrompt/ChatOptions.tsx +12 -11
- package/src/components/ChatPrompt/ChatPrompt.tsx +3 -3
- package/src/components/ChatPrompt/ChatReferences.tsx +3 -3
- package/src/components/ChatPrompt/ChatStatus.tsx +1 -1
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/Anchor.stories.tsx +3 -3
- package/src/components/ChatThread/ChatThread.stories.tsx +25 -29
- package/src/components/ChatThread/ChatThread.tsx +1 -1
- package/src/components/ChatThread/registry.tsx +8 -4
- package/src/components/ChatThread/sync.test.ts +4 -6
- package/src/components/ChatThread/widgets/ReasoningWidget.ts +2 -2
- package/src/components/ChatThread/widgets/StatusWidget.ts +3 -83
- package/src/components/ChatThread/widgets/SummaryWidget.tsx +1 -3
- package/src/components/ProcessTree/ProcessTree.tsx +2 -1
- package/src/components/TaskList/TaskList.stories.tsx +44 -0
- package/src/components/TaskList/TaskList.tsx +45 -0
- package/src/{cli → components/TaskList}/index.ts +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +1 -1
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +2 -6
- package/src/components/TemplateEditor/TemplateForm.tsx +48 -69
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -4
- package/src/components/Toolbox/Toolbox.tsx +2 -2
- package/src/components/index.ts +1 -0
- package/src/containers/AgentArticle/AgentArticle.stories.tsx +7 -7
- package/src/containers/AgentArticle/AgentArticle.tsx +11 -7
- package/src/containers/AgentProperties/AgentProperties.stories.tsx +4 -4
- package/src/containers/AgentProperties/AgentProperties.tsx +4 -4
- package/src/containers/{ChatContainer/ChatContainer.tsx → ChatArticle/ChatArticle.tsx} +11 -9
- package/src/containers/ChatArticle/index.ts +5 -0
- package/src/containers/ChatCompanion/ChatCompanion.tsx +20 -29
- package/src/containers/PlanArticle/PlanArticle.tsx +33 -0
- package/src/containers/PlanArticle/index.ts +5 -0
- package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +75 -0
- package/src/containers/RoutineArticle/RoutineArticle.tsx +74 -24
- package/src/containers/RoutineList/RoutineList.stories.tsx +3 -3
- package/src/containers/RoutineList/RoutineList.tsx +3 -3
- package/src/containers/TracePanel/TracePanel.stories.tsx +33 -26
- package/src/containers/TracePanel/TracePanel.tsx +72 -33
- package/src/containers/TracePanel/dxn-extractor.ts +7 -7
- package/src/containers/TracePanel/execution-graph.test.ts +218 -213
- package/src/containers/TracePanel/execution-graph.ts +316 -271
- package/src/containers/TracePanel/span-tree.test.ts +166 -0
- package/src/containers/TracePanel/span-tree.ts +214 -0
- package/src/containers/index.ts +4 -3
- package/src/{queue-logger.ts → feed-logger.ts} +37 -27
- package/src/hooks/useBlueprintRegistry.ts +12 -6
- package/src/hooks/useChatProcessor.ts +3 -3
- package/src/hooks/useChatServices.ts +1 -1
- package/src/hooks/useChatToolbarActions.ts +86 -88
- package/src/hooks/useContextBinder.ts +4 -4
- package/src/hooks/useContextObjects.ts +2 -2
- package/src/index.ts +2 -9
- package/src/operations/create-chat.ts +16 -11
- package/src/operations/ensure-companion-chat.ts +47 -45
- package/src/operations/index.ts +1 -2
- package/src/operations/on-create-space.ts +3 -3
- package/src/operations/prompt.test.ts +5 -5
- package/src/operations/resolve-navigation-targets.ts +2 -2
- package/src/operations/run-prompt-in-new-chat.ts +85 -84
- package/src/operations/set-current-chat.ts +3 -4
- package/src/operations/toggle-trace-panel-debug.ts +27 -0
- package/src/operations/update-chat-name.ts +2 -2
- package/src/plugin.ts +11 -0
- package/src/processor/processor.test.ts +1 -1
- package/src/processor/processor.ts +15 -15
- package/src/testing/test-generator.test.ts +41 -52
- package/src/testing/test-generator.ts +174 -189
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/trace-timeline.conversations.json +1 -1
- package/src/testing/trace-timeline.test.ts +3 -5
- package/src/testing.ts +7 -0
- package/src/translations.ts +5 -2
- package/src/types/Assistant.ts +2 -1
- package/src/types/AssistantCapabilities.ts +35 -0
- package/src/types/AssistantEvents.ts +11 -0
- package/src/{operations/definitions.ts → types/AssistantOperation.ts} +15 -0
- package/src/types/Settings.ts +6 -0
- package/src/types/index.ts +5 -2
- package/src/util/suggestions.test.ts +52 -0
- package/src/util/suggestions.ts +42 -0
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-DVOOFAWU.mjs +0 -175
- package/dist/lib/browser/chunk-DVOOFAWU.mjs.map +0 -7
- package/dist/lib/browser/chunk-M55MBYG7.mjs.map +0 -7
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs +0 -195
- package/dist/lib/browser/chunk-SEMCG4ZK.mjs.map +0 -7
- package/dist/lib/browser/chunk-VK53MITK.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -73
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/components/index.mjs +0 -20
- package/dist/lib/browser/create-chat-E2ZLVTLP.mjs.map +0 -7
- package/dist/lib/browser/ensure-companion-chat-7GDMXSQW.mjs.map +0 -7
- package/dist/lib/browser/hooks/index.mjs +0 -39
- package/dist/lib/browser/index.mjs +0 -84
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/on-create-space-4J3KTNAJ.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -13
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/resolve-navigation-targets-3ZPQE6SZ.mjs.map +0 -7
- package/dist/lib/browser/run-prompt-in-new-chat-AA3KPBDN.mjs.map +0 -7
- package/dist/lib/browser/set-current-chat-P4VHI3YF.mjs.map +0 -7
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -18
- package/dist/lib/browser/update-chat-name-VWKNUON7.mjs.map +0 -7
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs +0 -41
- package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -32
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FWC3ZGPH.mjs +0 -933
- package/dist/lib/node-esm/chunk-FWC3ZGPH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-JKEB3NFZ.mjs +0 -2302
- package/dist/lib/node-esm/chunk-JKEB3NFZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MBDVPB4V.mjs +0 -176
- package/dist/lib/node-esm/chunk-MBDVPB4V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs +0 -196
- package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -74
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/components/index.mjs +0 -21
- package/dist/lib/node-esm/create-chat-UQQ3542N.mjs +0 -74
- package/dist/lib/node-esm/create-chat-UQQ3542N.mjs.map +0 -7
- package/dist/lib/node-esm/ensure-companion-chat-LVCPD4DJ.mjs +0 -66
- package/dist/lib/node-esm/ensure-companion-chat-LVCPD4DJ.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -40
- package/dist/lib/node-esm/index.mjs +0 -85
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/on-create-space-M63UBTTT.mjs +0 -23
- package/dist/lib/node-esm/on-create-space-M63UBTTT.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -14
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/resolve-navigation-targets-HO77CAFT.mjs +0 -23
- package/dist/lib/node-esm/resolve-navigation-targets-HO77CAFT.mjs.map +0 -7
- package/dist/lib/node-esm/run-prompt-in-new-chat-RIRYYYPK.mjs +0 -107
- package/dist/lib/node-esm/run-prompt-in-new-chat-RIRYYYPK.mjs.map +0 -7
- package/dist/lib/node-esm/set-current-chat-Z7GJ52VX.mjs +0 -55
- package/dist/lib/node-esm/set-current-chat-Z7GJ52VX.mjs.map +0 -7
- package/dist/lib/node-esm/translations.mjs +0 -173
- package/dist/lib/node-esm/translations.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -19
- package/dist/lib/node-esm/update-chat-name-GV4HX32Z.mjs +0 -57
- package/dist/lib/node-esm/update-chat-name-GV4HX32Z.mjs.map +0 -7
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts +0 -10
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -2
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/queue-logger.d.ts +0 -11
- package/dist/types/src/queue-logger.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -32
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/AssistantPlugin.tsx +0 -238
- package/src/cli/plugin.ts +0 -83
- package/src/containers/ChatContainer/index.ts +0 -5
- package/src/types/capabilities.ts +0 -35
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/AssistantPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser → neutral}/AssistantSettings-GG52BLKS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/AssistantSettings-GG52BLKS.mjs.map +0 -0
- /package/dist/lib/{browser/components/index.mjs.map → neutral/ChatArticle-WVAFZPVI.mjs.map} +0 -0
- /package/dist/lib/{browser/hooks → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/components → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/hooks → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types/index.mjs.map → neutral/testing.mjs.map} +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
import { AiContext } from '@dxos/assistant';
|
|
8
|
+
import { Agent, Chat, McpServer, Memory, Plan } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { Blueprint, Routine } from '@dxos/compute';
|
|
10
|
+
import { Sequence } from '@dxos/conductor';
|
|
11
|
+
import { Feed } from '@dxos/echo';
|
|
12
|
+
import { Text } from '@dxos/schema';
|
|
13
|
+
import { HasSubject, Message } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { OperationHandler } from '#capabilities';
|
|
16
|
+
import { meta } from '#meta';
|
|
17
|
+
|
|
18
|
+
export const AssistantPlugin = Plugin.define(meta).pipe(
|
|
19
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
20
|
+
AppPlugin.addSchemaModule({
|
|
21
|
+
schema: [
|
|
22
|
+
Chat.Chat,
|
|
23
|
+
Chat.CompanionTo,
|
|
24
|
+
Blueprint.Blueprint,
|
|
25
|
+
AiContext.Binding,
|
|
26
|
+
Feed.Feed,
|
|
27
|
+
HasSubject.HasSubject,
|
|
28
|
+
Message.Message,
|
|
29
|
+
Routine.Routine,
|
|
30
|
+
Agent.Agent,
|
|
31
|
+
McpServer.McpServer,
|
|
32
|
+
Plan.Plan,
|
|
33
|
+
Sequence.Sequence,
|
|
34
|
+
Memory.Memory,
|
|
35
|
+
Text.Text,
|
|
36
|
+
],
|
|
37
|
+
}),
|
|
38
|
+
Plugin.make,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export default AssistantPlugin;
|
|
@@ -6,7 +6,7 @@ import { LayoutOperation } from '@dxos/app-toolkit';
|
|
|
6
6
|
import { templates } from '@dxos/assistant';
|
|
7
7
|
import { Blueprint } from '@dxos/compute';
|
|
8
8
|
|
|
9
|
-
import { AssistantOperation } from '#
|
|
9
|
+
import { AssistantOperation } from '#types';
|
|
10
10
|
|
|
11
11
|
const BLUEPRINT_KEY = 'org.dxos.blueprint.assistant';
|
|
12
12
|
|
|
@@ -8,20 +8,22 @@ import * as Option from 'effect/Option';
|
|
|
8
8
|
|
|
9
9
|
import { Capability } from '@dxos/app-framework';
|
|
10
10
|
import { AppCapabilities, AppNode, getActiveSpace, getPersonalSpace } from '@dxos/app-toolkit';
|
|
11
|
-
import { Chat } from '@dxos/assistant-toolkit';
|
|
11
|
+
import { AgentPrompt, Chat } from '@dxos/assistant-toolkit';
|
|
12
12
|
import { Blueprint, Routine, Operation } from '@dxos/compute';
|
|
13
13
|
import { Sequence } from '@dxos/conductor';
|
|
14
14
|
import { DXN, Database, Filter, Obj, type Ref } from '@dxos/echo';
|
|
15
15
|
import { AtomObj } from '@dxos/echo-atom';
|
|
16
16
|
import { invariant } from '@dxos/invariant';
|
|
17
|
-
import { AutomationCapabilities } from '@dxos/plugin-automation
|
|
18
|
-
import { ClientCapabilities } from '@dxos/plugin-client
|
|
17
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
18
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
19
19
|
import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
20
20
|
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
21
21
|
|
|
22
22
|
import { ASSISTANT_COMPANION_VARIANT, meta } from '#meta';
|
|
23
|
-
import { AssistantOperation } from '#
|
|
24
|
-
|
|
23
|
+
import { AssistantCapabilities, AssistantOperation } from '#types';
|
|
24
|
+
|
|
25
|
+
/** Operation definitions to seed as `PersistentOperation` records for automation / triggers. */
|
|
26
|
+
const computeOperationsToImport = [AgentPrompt] as const;
|
|
25
27
|
|
|
26
28
|
/** Match ECHO objects that are NOT chats. */
|
|
27
29
|
const whenNonChatObject = NodeMatcher.whenAll(
|
|
@@ -65,6 +67,43 @@ export default Capability.makeModule(
|
|
|
65
67
|
match: NodeMatcher.whenRoot,
|
|
66
68
|
actions: () =>
|
|
67
69
|
Effect.succeed([
|
|
70
|
+
Node.makeAction({
|
|
71
|
+
id: 'import-compute-operations',
|
|
72
|
+
data: Effect.fnUntraced(function* () {
|
|
73
|
+
const capabilities = yield* Capability.Service;
|
|
74
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
75
|
+
const space = getActiveSpace(client, capabilities) ?? getPersonalSpace(client);
|
|
76
|
+
if (!space) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
for (const definition of computeOperationsToImport) {
|
|
80
|
+
const key = definition.meta.key;
|
|
81
|
+
if (!key) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const existing = yield* Effect.promise(
|
|
85
|
+
(): Promise<Operation.PersistentOperation[]> =>
|
|
86
|
+
space.db.query(Filter.and(Filter.type(Operation.PersistentOperation), Filter.key(key))).run(),
|
|
87
|
+
);
|
|
88
|
+
if (existing.length === 0) {
|
|
89
|
+
space.db.add(Operation.serialize(definition));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
yield* Database.flush();
|
|
93
|
+
}),
|
|
94
|
+
properties: {
|
|
95
|
+
label: ['import-compute-operations.label', { ns: meta.id }],
|
|
96
|
+
icon: 'ph--download-simple--regular',
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
Node.makeAction({
|
|
100
|
+
id: AssistantOperation.ToggleTracePanelDebug.meta.key,
|
|
101
|
+
data: () => Operation.invoke(AssistantOperation.ToggleTracePanelDebug, {}),
|
|
102
|
+
properties: {
|
|
103
|
+
label: ['toggle-trace-panel-debug.label', { ns: meta.id }],
|
|
104
|
+
icon: 'ph--brackets-curly--regular',
|
|
105
|
+
},
|
|
106
|
+
}),
|
|
68
107
|
Node.makeAction({
|
|
69
108
|
id: 'reset-blueprints',
|
|
70
109
|
data: Effect.fnUntraced(function* () {
|
|
@@ -98,16 +137,16 @@ export default Capability.makeModule(
|
|
|
98
137
|
Effect.gen(function* () {
|
|
99
138
|
const state = get(yield* Capability.get(AssistantCapabilities.State));
|
|
100
139
|
const cache = get(yield* Capability.get(AssistantCapabilities.CompanionChatCache));
|
|
101
|
-
const
|
|
140
|
+
const objectDXN = Obj.getDXN(object).toString();
|
|
102
141
|
|
|
103
142
|
// Resolve chat from persisted state or transient cache.
|
|
104
143
|
const chat = pipe(
|
|
105
|
-
Option.fromNullable(state.currentChat[
|
|
144
|
+
Option.fromNullable(state.currentChat[objectDXN]),
|
|
106
145
|
Option.flatMap((dxnStr) => Option.fromNullable(DXN.tryParse(dxnStr))),
|
|
107
146
|
Option.flatMap((dxn) => Option.fromNullable(Obj.getDatabase(object)?.makeRef(dxn))),
|
|
108
147
|
Option.map((ref) => get(AtomObj.make(ref as Ref.Ref<Obj.Unknown>))),
|
|
109
148
|
Option.filter(Obj.isObject),
|
|
110
|
-
Option.orElse(() => pipe(Option.fromNullable(cache[
|
|
149
|
+
Option.orElse(() => pipe(Option.fromNullable(cache[objectDXN]), Option.filter(Obj.isObject))),
|
|
111
150
|
Option.getOrNull,
|
|
112
151
|
);
|
|
113
152
|
|
|
@@ -126,7 +165,7 @@ export default Capability.makeModule(
|
|
|
126
165
|
GraphBuilder.createExtension({
|
|
127
166
|
id: 'invocations',
|
|
128
167
|
match: NodeMatcher.whenAny(
|
|
129
|
-
NodeMatcher.whenEchoTypeMatches(Sequence),
|
|
168
|
+
NodeMatcher.whenEchoTypeMatches(Sequence.Sequence),
|
|
130
169
|
NodeMatcher.whenEchoTypeMatches(Routine.Routine),
|
|
131
170
|
),
|
|
132
171
|
connector: () =>
|
|
@@ -12,13 +12,12 @@ import { AppCapabilities } from '@dxos/app-toolkit';
|
|
|
12
12
|
import { Chat } from '@dxos/assistant-toolkit';
|
|
13
13
|
import { Obj } from '@dxos/echo';
|
|
14
14
|
import { log } from '@dxos/log';
|
|
15
|
-
import { DeckCapabilities, PLANK_COMPANION_TYPE, type StoredDeckState } from '@dxos/plugin-deck
|
|
15
|
+
import { DeckCapabilities, PLANK_COMPANION_TYPE, type StoredDeckState } from '@dxos/plugin-deck';
|
|
16
16
|
import { getLinkedVariant } from '@dxos/react-ui-attention';
|
|
17
17
|
import { byPosition } from '@dxos/util';
|
|
18
18
|
|
|
19
19
|
import { ASSISTANT_COMPANION_VARIANT } from '#meta';
|
|
20
|
-
import { AssistantOperation } from '#
|
|
21
|
-
import { AssistantCapabilities } from '#types';
|
|
20
|
+
import { AssistantCapabilities, AssistantOperation } from '#types';
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* Non-React capability that watches deck companion state and provisions transient chats
|
|
@@ -65,9 +64,9 @@ export default Capability.makeModule(
|
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
const object = node.data;
|
|
68
|
-
const
|
|
67
|
+
const companionDXN = Obj.getDXN(object).toString();
|
|
69
68
|
const cache = registry.get(cacheAtom);
|
|
70
|
-
if (cache[
|
|
69
|
+
if (cache[companionDXN]) {
|
|
71
70
|
return true;
|
|
72
71
|
}
|
|
73
72
|
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Agent, AgentBlueprint, Chat } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { Blueprint, Operation, Routine } from '@dxos/compute';
|
|
10
|
+
import { Sequence } from '@dxos/conductor';
|
|
11
|
+
import { Obj } from '@dxos/echo';
|
|
12
|
+
import { type SpaceId } from '@dxos/keys';
|
|
13
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
14
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
15
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
16
|
+
|
|
17
|
+
import { AssistantOperation } from '#types';
|
|
18
|
+
|
|
19
|
+
export default Capability.makeModule(
|
|
20
|
+
Effect.fnUntraced(function* () {
|
|
21
|
+
return [
|
|
22
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
23
|
+
id: Chat.Chat.typename,
|
|
24
|
+
createObject: (props, options) =>
|
|
25
|
+
Effect.gen(function* () {
|
|
26
|
+
const { object } = yield* Operation.invoke(AssistantOperation.CreateChat, {
|
|
27
|
+
db: options.db,
|
|
28
|
+
name: props?.name,
|
|
29
|
+
});
|
|
30
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
31
|
+
object,
|
|
32
|
+
target: options.target,
|
|
33
|
+
hidden: true,
|
|
34
|
+
targetNodeId: options.targetNodeId,
|
|
35
|
+
});
|
|
36
|
+
}),
|
|
37
|
+
}),
|
|
38
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
39
|
+
id: Blueprint.Blueprint.typename,
|
|
40
|
+
inputSchema: AssistantOperation.BlueprintForm,
|
|
41
|
+
createObject: (props, options) =>
|
|
42
|
+
Effect.gen(function* () {
|
|
43
|
+
const object = Blueprint.make(props);
|
|
44
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
45
|
+
object,
|
|
46
|
+
target: options.target,
|
|
47
|
+
hidden: true,
|
|
48
|
+
targetNodeId: options.targetNodeId,
|
|
49
|
+
});
|
|
50
|
+
}),
|
|
51
|
+
}),
|
|
52
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
53
|
+
id: Routine.Routine.typename,
|
|
54
|
+
createObject: (props, options) =>
|
|
55
|
+
Effect.gen(function* () {
|
|
56
|
+
const object = Routine.make(props);
|
|
57
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
58
|
+
object,
|
|
59
|
+
target: options.target,
|
|
60
|
+
hidden: true,
|
|
61
|
+
targetNodeId: options.targetNodeId,
|
|
62
|
+
});
|
|
63
|
+
}),
|
|
64
|
+
}),
|
|
65
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
66
|
+
id: Sequence.Sequence.typename,
|
|
67
|
+
createObject: (props, options) =>
|
|
68
|
+
Effect.gen(function* () {
|
|
69
|
+
const object = Obj.make(Sequence.Sequence, props);
|
|
70
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
71
|
+
object,
|
|
72
|
+
target: options.target,
|
|
73
|
+
hidden: true,
|
|
74
|
+
targetNodeId: options.targetNodeId,
|
|
75
|
+
});
|
|
76
|
+
}),
|
|
77
|
+
}),
|
|
78
|
+
Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
79
|
+
id: Agent.Agent.typename,
|
|
80
|
+
createObject: (props, options) =>
|
|
81
|
+
Effect.gen(function* () {
|
|
82
|
+
const object = yield* Agent.makeInitialized({ name: '', instructions: '' }, AgentBlueprint.make()).pipe(
|
|
83
|
+
withComputeRuntime(options.db.spaceId),
|
|
84
|
+
);
|
|
85
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
86
|
+
object,
|
|
87
|
+
target: options.target,
|
|
88
|
+
hidden: true,
|
|
89
|
+
targetNodeId: options.targetNodeId,
|
|
90
|
+
});
|
|
91
|
+
}),
|
|
92
|
+
}),
|
|
93
|
+
];
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
// TODO(dmaretskyi): Extract to a helper module.
|
|
98
|
+
const withComputeRuntime =
|
|
99
|
+
(spaceId: SpaceId) =>
|
|
100
|
+
<A, E, R>(
|
|
101
|
+
effect: Effect.Effect<A, E, R>,
|
|
102
|
+
): Effect.Effect<A, E, Exclude<R, AutomationCapabilities.ComputeServices> | Capability.Service> =>
|
|
103
|
+
Effect.gen(function* () {
|
|
104
|
+
const provider = yield* Capability.get(AutomationCapabilities.ComputeRuntime).pipe(Effect.orDie);
|
|
105
|
+
const runtime = yield* provider.getRuntime(spaceId).runtimeEffect;
|
|
106
|
+
return yield* effect.pipe(Effect.provide(runtime));
|
|
107
|
+
});
|
|
@@ -13,6 +13,7 @@ export const CompanionChatProvisioner = Capability.lazy(
|
|
|
13
13
|
'CompanionChatProvisioner',
|
|
14
14
|
() => import('./companion-chat-provisioner'),
|
|
15
15
|
);
|
|
16
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
16
17
|
export const EdgeModelResolver = Capability.lazy('EdgeModelResolver', () => import('./edge-model-resolver'));
|
|
17
18
|
export const LocalModelResolver = Capability.lazy('LocalModelResolver', () => import('./local-model-resolver'));
|
|
18
19
|
export const MarkdownExtension = Capability.lazy('MarkdownExtension', () => import('./markdown'));
|
|
@@ -6,9 +6,9 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { MarkdownCapabilities } from '@dxos/plugin-markdown
|
|
9
|
+
import { MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
10
10
|
|
|
11
|
-
import { AssistantOperation } from '#
|
|
11
|
+
import { AssistantOperation } from '#types';
|
|
12
12
|
|
|
13
13
|
import { promptRunExtension } from '../extensions';
|
|
14
14
|
|
|
@@ -6,14 +6,14 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { Chat } from '@dxos/assistant-toolkit';
|
|
9
|
-
import {
|
|
10
|
-
import { ClientCapabilities } from '@dxos/plugin-client
|
|
9
|
+
import { Migration } from '@dxos/echo';
|
|
10
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
11
11
|
|
|
12
12
|
const identityTransform = async (from: any) => ({ ...from });
|
|
13
13
|
const noopCallback = async () => {};
|
|
14
14
|
|
|
15
15
|
const migrations = [
|
|
16
|
-
|
|
16
|
+
Migration.define({
|
|
17
17
|
from: Chat.LegacyCompanionTo,
|
|
18
18
|
to: Chat.CompanionTo,
|
|
19
19
|
transform: identityTransform,
|
|
@@ -8,7 +8,7 @@ import React, { type ComponentProps, useEffect } from 'react';
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { Surface, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
10
|
import { AppSurface, useActiveSpace } from '@dxos/app-toolkit/ui';
|
|
11
|
-
import { Chat, Agent } from '@dxos/assistant-toolkit';
|
|
11
|
+
import { Chat, Agent, Plan } from '@dxos/assistant-toolkit';
|
|
12
12
|
import { getSpace } from '@dxos/client/echo';
|
|
13
13
|
import { Blueprint, Routine } from '@dxos/compute';
|
|
14
14
|
import { Sequence } from '@dxos/conductor';
|
|
@@ -21,10 +21,11 @@ import { AssistantSettings } from '#components';
|
|
|
21
21
|
import {
|
|
22
22
|
BlueprintArticle,
|
|
23
23
|
ChatCompanion,
|
|
24
|
-
|
|
24
|
+
ChatArticle,
|
|
25
25
|
ChatDialog,
|
|
26
26
|
AgentArticle,
|
|
27
27
|
AgentProperties,
|
|
28
|
+
PlanArticle,
|
|
28
29
|
RoutineArticle,
|
|
29
30
|
RoutineList,
|
|
30
31
|
TracePanel,
|
|
@@ -52,7 +53,7 @@ export default Capability.makeModule(() =>
|
|
|
52
53
|
Obj.instanceOf(Chat.Chat, data.subject) &&
|
|
53
54
|
data.variant !== ASSISTANT_COMPANION_VARIANT,
|
|
54
55
|
component: ({ data, role, ref }) => {
|
|
55
|
-
return <
|
|
56
|
+
return <ChatArticle role={role} subject={data.subject} attendableId={data.attendableId} ref={ref} />;
|
|
56
57
|
},
|
|
57
58
|
}),
|
|
58
59
|
Surface.create({
|
|
@@ -87,20 +88,20 @@ export default Capability.makeModule(() =>
|
|
|
87
88
|
Surface.create({
|
|
88
89
|
id: 'companion-invocations',
|
|
89
90
|
role: 'article',
|
|
90
|
-
filter: (data): data is { companionTo: Sequence } =>
|
|
91
|
-
(Obj.instanceOf(Sequence, data.companionTo) || Obj.instanceOf(Routine.Routine, data.companionTo)) &&
|
|
91
|
+
filter: (data): data is { companionTo: Sequence.Sequence } =>
|
|
92
|
+
(Obj.instanceOf(Sequence.Sequence, data.companionTo) || Obj.instanceOf(Routine.Routine, data.companionTo)) &&
|
|
92
93
|
data.subject === 'invocations',
|
|
93
94
|
component: ({ data, role }) => {
|
|
94
95
|
const space = getSpace(data.companionTo);
|
|
95
96
|
const feed = space?.properties.invocationTraceFeed?.target;
|
|
96
|
-
const
|
|
97
|
+
const feedDXN = feed ? Feed.getQueueDxn(feed) : undefined;
|
|
97
98
|
// TODO(wittjosiah): Support invocation filtering for prompts.
|
|
98
99
|
const target = Obj.instanceOf(Routine.Routine, data.companionTo) ? undefined : data.companionTo;
|
|
99
100
|
|
|
100
101
|
return (
|
|
101
102
|
<Panel.Root role={role} className='dx-document'>
|
|
102
103
|
<Panel.Content asChild>
|
|
103
|
-
<InvocationTraceContainer db={space?.db}
|
|
104
|
+
<InvocationTraceContainer db={space?.db} feedDXN={feedDXN} target={target} detailAxis='block' />
|
|
104
105
|
</Panel.Content>
|
|
105
106
|
</Panel.Root>
|
|
106
107
|
);
|
|
@@ -120,6 +121,13 @@ export default Capability.makeModule(() =>
|
|
|
120
121
|
<RoutineArticle role={role} subject={data.subject} attendableId={data.attendableId} />
|
|
121
122
|
),
|
|
122
123
|
}),
|
|
124
|
+
Surface.create({
|
|
125
|
+
id: 'plan',
|
|
126
|
+
filter: AppSurface.object(AppSurface.Article, Plan.Plan),
|
|
127
|
+
component: ({ data, role }) => (
|
|
128
|
+
<PlanArticle role={role} subject={data.subject} attendableId={data.attendableId} />
|
|
129
|
+
),
|
|
130
|
+
}),
|
|
123
131
|
Surface.create({
|
|
124
132
|
id: ASSISTANT_DIALOG,
|
|
125
133
|
filter: AppSurface.component<ComponentProps<typeof ChatDialog>>(AppSurface.Dialog, ASSISTANT_DIALOG),
|
|
@@ -7,9 +7,10 @@ import * as Array from 'effect/Array';
|
|
|
7
7
|
import * as Option from 'effect/Option';
|
|
8
8
|
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
|
+
import { Agent, Plan } from '@dxos/assistant-toolkit';
|
|
10
11
|
import { Event } from '@dxos/async';
|
|
11
|
-
import { Filter, Obj } from '@dxos/echo';
|
|
12
|
-
import {
|
|
12
|
+
import { type Feed, Filter, Obj, Query } from '@dxos/echo';
|
|
13
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
13
14
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
14
15
|
import { type MarkdownStreamController } from '@dxos/react-ui-markdown';
|
|
15
16
|
import { Menu, MenuRootProps } from '@dxos/react-ui-menu';
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
type ChatPromptProps as NaturalChatPromptProps,
|
|
25
26
|
} from '../ChatPrompt';
|
|
26
27
|
import { ChatThread as NaturalChatThread, type ChatThreadProps as NaturalChatThreadProps } from '../ChatThread';
|
|
28
|
+
import { TaskList } from '../TaskList';
|
|
27
29
|
import { ChatContextProvider, type ChatContextValue, type ChatRequestTiming, useChatContext } from './context';
|
|
28
30
|
import { type ChatEvent } from './events';
|
|
29
31
|
|
|
@@ -35,7 +37,7 @@ export { useChatContext };
|
|
|
35
37
|
|
|
36
38
|
type ChatRootProps = PropsWithChildren<
|
|
37
39
|
Pick<ChatContextValue, 'db' | 'chat' | 'processor'> & {
|
|
38
|
-
feed?:
|
|
40
|
+
feed?: Feed.Feed;
|
|
39
41
|
onEvent?: (event: ChatEvent) => void;
|
|
40
42
|
}
|
|
41
43
|
>;
|
|
@@ -48,7 +50,10 @@ const ChatRoot = ({ children, chat, feed, processor, onEvent, ...props }: ChatRo
|
|
|
48
50
|
const lastPrompt = useRef<string | undefined>(undefined);
|
|
49
51
|
const db = props.db ?? (chat && Obj.getDatabase(chat));
|
|
50
52
|
|
|
51
|
-
const feedMessages = useQuery(
|
|
53
|
+
const feedMessages = useQuery(
|
|
54
|
+
db,
|
|
55
|
+
feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
|
|
56
|
+
);
|
|
52
57
|
const pendingMessages = useAtomValue(processor.messages);
|
|
53
58
|
const messages = useMemo(
|
|
54
59
|
() => Array.dedupeWith([...feedMessages, ...pendingMessages], ({ id: a }, { id: b }) => a === b),
|
|
@@ -219,7 +224,7 @@ const ChatThread = ({ viewType, debug: debugProp, ...props }: ChatThreadProps) =
|
|
|
219
224
|
);
|
|
220
225
|
|
|
221
226
|
if (!identity) {
|
|
222
|
-
return
|
|
227
|
+
return <div className='dx-expander' />;
|
|
223
228
|
}
|
|
224
229
|
|
|
225
230
|
return (
|
|
@@ -254,6 +259,30 @@ const ChatPrompt = (props: ChatPromptProps) => {
|
|
|
254
259
|
|
|
255
260
|
ChatPrompt.displayName = CHAT_PROMPT_NAME;
|
|
256
261
|
|
|
262
|
+
//
|
|
263
|
+
// TaskList
|
|
264
|
+
//
|
|
265
|
+
|
|
266
|
+
const CHAT_TASK_LIST_NAME = 'Chat.TaskList';
|
|
267
|
+
|
|
268
|
+
type ChatTaskListProps = {
|
|
269
|
+
plan?: Plan.Plan;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
const ChatTaskList = composable<HTMLDivElement, ChatTaskListProps>(({ plan: planProp, ...props }, forwardedRef) => {
|
|
273
|
+
const { chat } = useChatContext(CHAT_TASK_LIST_NAME);
|
|
274
|
+
const parent = chat ? Obj.getParent(chat) : undefined;
|
|
275
|
+
const agent = parent && Obj.instanceOf(Agent.Agent, parent) ? parent : undefined;
|
|
276
|
+
const plan = planProp ?? agent?.plan.target;
|
|
277
|
+
if (!plan) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return <TaskList {...props} plan={plan} ref={forwardedRef} />;
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
ChatTaskList.displayName = CHAT_TASK_LIST_NAME;
|
|
285
|
+
|
|
257
286
|
//
|
|
258
287
|
// Chat
|
|
259
288
|
//
|
|
@@ -265,6 +294,7 @@ export const Chat = {
|
|
|
265
294
|
Prompt: ChatPrompt,
|
|
266
295
|
Status: ChatStatus,
|
|
267
296
|
Thread: ChatThread,
|
|
297
|
+
TaskList: ChatTaskList,
|
|
268
298
|
};
|
|
269
299
|
|
|
270
300
|
export type { ChatRootProps, ChatToolbarProps, ChatContentProps, ChatPromptProps, ChatThreadProps, ChatEvent };
|
|
@@ -37,7 +37,7 @@ export const ChatMcpErrors = ({ classNames, processor }: ChatMcpErrorsProps) =>
|
|
|
37
37
|
<Message.Content asChild>
|
|
38
38
|
<ul className='flex flex-col gap-0.5 text-sm'>
|
|
39
39
|
{errors.map((error) => (
|
|
40
|
-
<li key={`${error.url}::${error.
|
|
40
|
+
<li key={`${error.url}::${error.protocol}`} className='truncate'>
|
|
41
41
|
<span className='font-mono'>{error.url}</span>
|
|
42
42
|
{' — '}
|
|
43
43
|
<span>{error.message}</span>
|
|
@@ -10,11 +10,11 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
10
10
|
import { Chat } from '@dxos/assistant-toolkit';
|
|
11
11
|
import { capabilities } from '@dxos/assistant-toolkit/testing';
|
|
12
12
|
import { Feed, Filter, Ref } from '@dxos/echo';
|
|
13
|
-
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
14
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
|
+
import { ChessPlugin } from '@dxos/plugin-chess/testing';
|
|
14
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
15
15
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
|
-
import { MapPlugin } from '@dxos/plugin-map';
|
|
17
|
-
import { TablePlugin } from '@dxos/plugin-table';
|
|
16
|
+
import { MapPlugin } from '@dxos/plugin-map/testing';
|
|
17
|
+
import { TablePlugin } from '@dxos/plugin-table/testing';
|
|
18
18
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
19
19
|
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
20
20
|
import { Loading, withTheme } from '@dxos/react-ui/testing';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Option from 'effect/Option';
|
|
6
6
|
import React, { type JSX, useCallback, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type
|
|
8
|
+
import { type AiContext } from '@dxos/assistant';
|
|
9
9
|
import { type Chat as ChatModule, McpServer } from '@dxos/assistant-toolkit';
|
|
10
10
|
import { type Blueprint } from '@dxos/compute';
|
|
11
11
|
import { Annotation, type Database, Filter, Obj, Type } from '@dxos/echo';
|
|
@@ -28,7 +28,7 @@ const styles = {
|
|
|
28
28
|
export type ChatOptionsProps = {
|
|
29
29
|
chat?: ChatModule.Chat;
|
|
30
30
|
db: Database.Database;
|
|
31
|
-
context:
|
|
31
|
+
context: AiContext.Binder;
|
|
32
32
|
blueprintRegistry?: Blueprint.Registry;
|
|
33
33
|
presets?: { id: string; label: string }[];
|
|
34
34
|
preset?: string;
|
|
@@ -50,7 +50,7 @@ export const ChatOptions = ({
|
|
|
50
50
|
const { t } = useTranslation(meta.id);
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
|
-
<div
|
|
53
|
+
<div className='flex'>
|
|
54
54
|
<Popover.Root>
|
|
55
55
|
<Popover.Trigger asChild>
|
|
56
56
|
<IconButton variant='ghost' icon='ph--plus--regular' iconOnly label={t('context-objects.button')} />
|
|
@@ -142,15 +142,16 @@ const BlueprintsPanel = ({
|
|
|
142
142
|
<SearchList.Content classNames='flex flex-col'>
|
|
143
143
|
<SearchList.Viewport>
|
|
144
144
|
{results.map((blueprint) => {
|
|
145
|
-
const
|
|
145
|
+
const blueprintKey = Obj.getMeta(blueprint).key ?? blueprint.id;
|
|
146
|
+
const isActive = activeBlueprints.has(blueprintKey);
|
|
146
147
|
return (
|
|
147
148
|
<SearchList.Item
|
|
148
149
|
classNames='flex items-center overflow-hidden'
|
|
149
|
-
key={
|
|
150
|
-
value={
|
|
150
|
+
key={blueprintKey}
|
|
151
|
+
value={blueprintKey}
|
|
151
152
|
label={blueprint.name}
|
|
152
153
|
checked={isActive}
|
|
153
|
-
onSelect={() => onUpdateBlueprint?.(
|
|
154
|
+
onSelect={() => onUpdateBlueprint?.(blueprintKey, !isActive)}
|
|
154
155
|
/>
|
|
155
156
|
);
|
|
156
157
|
})}
|
|
@@ -229,7 +230,7 @@ const McpServersPanel = ({ db }: McpServersPanelProps) => {
|
|
|
229
230
|
{adding ? (
|
|
230
231
|
<McpServerForm onSubmit={handleAdd} onCancel={() => setAdding(false)} />
|
|
231
232
|
) : (
|
|
232
|
-
<div
|
|
233
|
+
<div>
|
|
233
234
|
<IconButton
|
|
234
235
|
variant='ghost'
|
|
235
236
|
icon='ph--plus--regular'
|
|
@@ -333,7 +334,7 @@ const McpServerForm = ({ onSubmit, onCancel }: McpServerFormProps) => {
|
|
|
333
334
|
onChange={(event) => setApiKey(event.target.value)}
|
|
334
335
|
/>
|
|
335
336
|
</Input.Root>
|
|
336
|
-
<div
|
|
337
|
+
<div className='flex gap-2'>
|
|
337
338
|
<IconButton
|
|
338
339
|
variant='ghost'
|
|
339
340
|
icon='ph--check--regular'
|
|
@@ -405,7 +406,7 @@ export const ObjectsPanel = ({ db, context }: Pick<ChatOptionsProps, 'db' | 'con
|
|
|
405
406
|
key={object.id}
|
|
406
407
|
value={object.id}
|
|
407
408
|
icon={icon}
|
|
408
|
-
iconClassNames={styles?.
|
|
409
|
+
iconClassNames={styles?.foreground}
|
|
409
410
|
label={Obj.getLabel(object) ?? Obj.getTypename(object) ?? object.id}
|
|
410
411
|
checked={isActive}
|
|
411
412
|
onSelect={() => onUpdateObject?.(Obj.getDXN(object), !isActive)}
|
|
@@ -418,7 +419,7 @@ export const ObjectsPanel = ({ db, context }: Pick<ChatOptionsProps, 'db' | 'con
|
|
|
418
419
|
</SearchList.Viewport>
|
|
419
420
|
</SearchList.Content>
|
|
420
421
|
|
|
421
|
-
<div
|
|
422
|
+
<div className={mx('flex flex-col', styles.toolbar)}>
|
|
422
423
|
<Select.Root value={typename === ANY ? undefined : typename} onValueChange={setTypename}>
|
|
423
424
|
<Select.TriggerButton placeholder={t('type-filter.placeholder')} />
|
|
424
425
|
<Select.Portal>
|
|
@@ -129,7 +129,7 @@ export const ChatPrompt = ({
|
|
|
129
129
|
>
|
|
130
130
|
<ChatMcpErrors processor={processor} />
|
|
131
131
|
|
|
132
|
-
<div
|
|
132
|
+
<div className='flex p-2 gap-2'>
|
|
133
133
|
<ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
|
|
134
134
|
<ChatEditor
|
|
135
135
|
ref={editorRef}
|
|
@@ -143,7 +143,7 @@ export const ChatPrompt = ({
|
|
|
143
143
|
</div>
|
|
144
144
|
|
|
145
145
|
{db && settings && (
|
|
146
|
-
<div
|
|
146
|
+
<div className='flex items-center overflow-hidden p-1.5'>
|
|
147
147
|
<ChatOptions
|
|
148
148
|
chat={chat}
|
|
149
149
|
db={db}
|
|
@@ -154,7 +154,7 @@ export const ChatPrompt = ({
|
|
|
154
154
|
onPresetChange={onPresetChange}
|
|
155
155
|
/>
|
|
156
156
|
|
|
157
|
-
<div
|
|
157
|
+
<div className='flex h-8 grow overflow-x-auto scrollbar-none'>
|
|
158
158
|
<ChatReferences db={db} context={processor.context} />
|
|
159
159
|
</div>
|
|
160
160
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Option from 'effect/Option';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { type
|
|
8
|
+
import { type AiContext } from '@dxos/assistant';
|
|
9
9
|
import { Annotation, type Database, Obj } from '@dxos/echo';
|
|
10
10
|
import { Icon, IconButton, type Label, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
import { getStyles, mx } from '@dxos/ui-theme';
|
|
@@ -14,7 +14,7 @@ import { useContextObjects } from '#hooks';
|
|
|
14
14
|
import { meta } from '#meta';
|
|
15
15
|
|
|
16
16
|
export type ChatReferencesProps = ThemedClassName<{
|
|
17
|
-
context:
|
|
17
|
+
context: AiContext.Binder;
|
|
18
18
|
db: Database.Database;
|
|
19
19
|
}>;
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps)
|
|
|
35
35
|
const styles = hue ? getStyles(hue) : undefined;
|
|
36
36
|
return (
|
|
37
37
|
<li key={dxn.toString()} className='dx-tag py-0 ps-2 flex items-center gap-1' data-hue='neutral'>
|
|
38
|
-
<Icon icon={icon} size={4} classNames={styles?.
|
|
38
|
+
<Icon icon={icon} size={4} classNames={styles?.foreground} />
|
|
39
39
|
{toLocalizedString(label, t)}
|
|
40
40
|
<IconButton
|
|
41
41
|
icon='ph--x--bold'
|
|
@@ -76,7 +76,7 @@ export const ChatStatus = ({ classNames, icon }: ChatStreamStatusProps) => {
|
|
|
76
76
|
</NaturalChatStatus.Icon>
|
|
77
77
|
)}
|
|
78
78
|
{show && (
|
|
79
|
-
<div
|
|
79
|
+
<div className='flex items-center'>
|
|
80
80
|
{requestTiming && (
|
|
81
81
|
<NaturalChatStatus.Text>
|
|
82
82
|
<Elapsed timing={requestTiming} />
|