@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
|
@@ -23,7 +23,6 @@ export type TemplateFormProps = {
|
|
|
23
23
|
id: string;
|
|
24
24
|
template: Template.Template;
|
|
25
25
|
schema?: Schema.Schema<any, any, any>;
|
|
26
|
-
commandEditable?: boolean;
|
|
27
26
|
/**
|
|
28
27
|
* Callback to mutate the template. Should wrap mutations in parent's Obj.update.
|
|
29
28
|
* If not provided, the component is read-only.
|
|
@@ -31,14 +30,14 @@ export type TemplateFormProps = {
|
|
|
31
30
|
onChange?: TemplateChangeCallback;
|
|
32
31
|
};
|
|
33
32
|
|
|
34
|
-
export const TemplateForm = ({ id, template,
|
|
33
|
+
export const TemplateForm = ({ id, template, onChange }: TemplateFormProps) => {
|
|
35
34
|
const { t } = useTranslation(meta.id);
|
|
36
35
|
usePromptInputs(template, onChange);
|
|
37
36
|
|
|
38
37
|
const handleInputKindChange = useCallback(
|
|
39
38
|
(inputName: string, kind: Template.InputKind) => {
|
|
40
|
-
onChange?.((
|
|
41
|
-
const input =
|
|
39
|
+
onChange?.((draft) => {
|
|
40
|
+
const input = draft.inputs?.find((i) => i?.name === inputName);
|
|
42
41
|
if (input) {
|
|
43
42
|
input.kind = kind;
|
|
44
43
|
}
|
|
@@ -49,8 +48,8 @@ export const TemplateForm = ({ id, template, commandEditable = true, onChange }:
|
|
|
49
48
|
|
|
50
49
|
const handleInputDefaultChange = useCallback(
|
|
51
50
|
(inputName: string, value: string) => {
|
|
52
|
-
onChange?.((
|
|
53
|
-
const input =
|
|
51
|
+
onChange?.((draft) => {
|
|
52
|
+
const input = draft.inputs?.find((i) => i?.name === inputName);
|
|
54
53
|
if (input) {
|
|
55
54
|
input.default = value;
|
|
56
55
|
}
|
|
@@ -61,24 +60,6 @@ export const TemplateForm = ({ id, template, commandEditable = true, onChange }:
|
|
|
61
60
|
|
|
62
61
|
return (
|
|
63
62
|
<div className='flex flex-col w-full overflow-hidden gap-4'>
|
|
64
|
-
{/* {commandEditable && (
|
|
65
|
-
<div className='flex items-center pl-4'>
|
|
66
|
-
<span className='text-neutral-500'>/</span>
|
|
67
|
-
<Input.Root>
|
|
68
|
-
<Input.TextInput
|
|
69
|
-
placeholder={t('command.placeholder')}
|
|
70
|
-
classNames='w-full bg-transparent m-2'
|
|
71
|
-
value={template.command ?? ''}
|
|
72
|
-
onChange={(event) => {
|
|
73
|
-
onChange?.((t) => {
|
|
74
|
-
t.command = event.target.value.replace(/\w/g, '');
|
|
75
|
-
});
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
</Input.Root>
|
|
79
|
-
</div>
|
|
80
|
-
)} */}
|
|
81
|
-
|
|
82
63
|
<TemplateEditor id={id} template={template} classNames='bg-base-surface min-h-[120px]' />
|
|
83
64
|
|
|
84
65
|
{(template.inputs?.length ?? 0) > 0 && (
|
|
@@ -109,17 +90,15 @@ export const TemplateForm = ({ id, template, commandEditable = true, onChange }:
|
|
|
109
90
|
</Input.Root>
|
|
110
91
|
|
|
111
92
|
<div>
|
|
112
|
-
{input.kind
|
|
113
|
-
<
|
|
114
|
-
<Input.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
</Input.Root>
|
|
122
|
-
</div>
|
|
93
|
+
{input.kind === 'value' && (
|
|
94
|
+
<Input.Root>
|
|
95
|
+
<Input.TextInput
|
|
96
|
+
placeholder={t('command.placeholder')}
|
|
97
|
+
classNames='w-full bg-transparent'
|
|
98
|
+
value={input.default ?? ''}
|
|
99
|
+
onChange={(event) => handleInputDefaultChange(input.name, event.target.value)}
|
|
100
|
+
/>
|
|
101
|
+
</Input.Root>
|
|
123
102
|
)}
|
|
124
103
|
</div>
|
|
125
104
|
</Fragment>
|
|
@@ -137,33 +116,33 @@ const inputs: { kind: Template.InputKind; label: string }[] = [
|
|
|
137
116
|
label: 'Value',
|
|
138
117
|
},
|
|
139
118
|
{
|
|
140
|
-
kind: '
|
|
141
|
-
label: '
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
kind: 'retriever',
|
|
145
|
-
label: 'Retriever',
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
kind: 'function',
|
|
149
|
-
label: 'Function',
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
kind: 'query',
|
|
153
|
-
label: 'Query',
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
kind: 'resolver',
|
|
157
|
-
label: 'Resolver',
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
kind: 'context',
|
|
161
|
-
label: 'Context',
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
kind: 'schema',
|
|
165
|
-
label: 'Schema',
|
|
119
|
+
kind: 'operation',
|
|
120
|
+
label: 'Operation',
|
|
166
121
|
},
|
|
122
|
+
// {
|
|
123
|
+
// kind: 'pass-through',
|
|
124
|
+
// label: 'Pass through',
|
|
125
|
+
// },
|
|
126
|
+
// {
|
|
127
|
+
// kind: 'retriever',
|
|
128
|
+
// label: 'Retriever',
|
|
129
|
+
// },
|
|
130
|
+
// {
|
|
131
|
+
// kind: 'query',
|
|
132
|
+
// label: 'Query',
|
|
133
|
+
// },
|
|
134
|
+
// {
|
|
135
|
+
// kind: 'resolver',
|
|
136
|
+
// label: 'Resolver',
|
|
137
|
+
// },
|
|
138
|
+
// {
|
|
139
|
+
// kind: 'context',
|
|
140
|
+
// label: 'Context',
|
|
141
|
+
// },
|
|
142
|
+
// {
|
|
143
|
+
// kind: 'schema',
|
|
144
|
+
// label: 'Schema',
|
|
145
|
+
// },
|
|
167
146
|
];
|
|
168
147
|
|
|
169
148
|
export const NAME_REGEXP = /\{\{([\w-]+)\}\}/;
|
|
@@ -194,30 +173,30 @@ const usePromptInputs = (template: Template.Template, onChange?: TemplateChangeC
|
|
|
194
173
|
|
|
195
174
|
// Match or create new inputs.
|
|
196
175
|
const values = unclaimed.values();
|
|
197
|
-
onChange((
|
|
198
|
-
if (!
|
|
199
|
-
|
|
176
|
+
onChange((draft) => {
|
|
177
|
+
if (!draft.inputs) {
|
|
178
|
+
draft.inputs = [];
|
|
200
179
|
}
|
|
201
180
|
|
|
202
181
|
missing.forEach((name) => {
|
|
203
182
|
const next = values.next().value;
|
|
204
183
|
if (next) {
|
|
205
184
|
// Find the input in the mutable draft and update it.
|
|
206
|
-
const inputIndex =
|
|
185
|
+
const inputIndex = draft.inputs!.findIndex((i) => i?.name === next.name);
|
|
207
186
|
if (inputIndex !== -1) {
|
|
208
|
-
|
|
187
|
+
draft.inputs![inputIndex].name = name;
|
|
209
188
|
}
|
|
210
189
|
} else {
|
|
211
|
-
|
|
190
|
+
draft.inputs!.push({ name, kind: 'value' });
|
|
212
191
|
}
|
|
213
192
|
});
|
|
214
193
|
|
|
215
194
|
// Remove unclaimed (deleted) inputs.
|
|
216
195
|
// TODO(burdon): If user types incorrect name value, it will be deleted. Garbage collect?
|
|
217
196
|
for (const input of values) {
|
|
218
|
-
const inputIndex =
|
|
197
|
+
const inputIndex = draft.inputs!.findIndex((i) => i?.name === input.name);
|
|
219
198
|
if (inputIndex !== -1) {
|
|
220
|
-
|
|
199
|
+
draft.inputs!.splice(inputIndex, 1);
|
|
221
200
|
}
|
|
222
201
|
}
|
|
223
202
|
});
|
|
@@ -8,11 +8,11 @@ import React from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { capabilities } from '@dxos/assistant-toolkit/testing';
|
|
11
|
-
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
12
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
11
|
+
import { ChessPlugin } from '@dxos/plugin-chess/testing';
|
|
12
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
13
13
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
14
|
-
import { MapPlugin } from '@dxos/plugin-map';
|
|
15
|
-
import { TablePlugin } from '@dxos/plugin-table';
|
|
14
|
+
import { MapPlugin } from '@dxos/plugin-map/testing';
|
|
15
|
+
import { TablePlugin } from '@dxos/plugin-table/testing';
|
|
16
16
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
17
17
|
|
|
18
18
|
import { translations } from '#translations';
|
|
@@ -6,9 +6,9 @@ import React, { Fragment, useEffect, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Blueprint } from '@dxos/compute';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
|
-
import { type Database, type Ref } from '@dxos/echo';
|
|
9
|
+
import { type Database, Filter, type Ref } from '@dxos/echo';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
|
-
import {
|
|
11
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
12
12
|
import { ScrollArea, type ThemedClassName } from '@dxos/react-ui';
|
|
13
13
|
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
14
14
|
|
package/src/components/index.ts
CHANGED
|
@@ -8,14 +8,14 @@ import React from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { Plan, Agent } from '@dxos/assistant-toolkit';
|
|
11
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
12
|
-
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
13
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
11
|
+
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
12
|
+
import { AutomationPlugin } from '@dxos/plugin-automation/testing';
|
|
13
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
14
14
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
15
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
16
|
-
import {
|
|
15
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
16
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
17
17
|
import { random } from '@dxos/random';
|
|
18
|
-
import {
|
|
18
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
19
19
|
import { Loading, withTheme } from '@dxos/react-ui/testing';
|
|
20
20
|
import { Text } from '@dxos/schema';
|
|
21
21
|
import { createObjectFactory, TypeSpec } from '@dxos/schema/testing';
|
|
@@ -84,7 +84,7 @@ const meta = {
|
|
|
84
84
|
name: Obj.getLabel(obj) ?? 'Artifact',
|
|
85
85
|
data: Ref.make(obj),
|
|
86
86
|
})),
|
|
87
|
-
|
|
87
|
+
feed: Ref.fromDXN(inputQueue.dxn),
|
|
88
88
|
subscriptions: [],
|
|
89
89
|
}),
|
|
90
90
|
);
|
|
@@ -14,7 +14,7 @@ import { Agent } from '@dxos/assistant-toolkit';
|
|
|
14
14
|
import { Annotation, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
15
15
|
import { AtomObj, AtomRef } from '@dxos/echo-atom';
|
|
16
16
|
import { QueueService } from '@dxos/functions';
|
|
17
|
-
import { AutomationCapabilities } from '@dxos/plugin-automation
|
|
17
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
18
18
|
import { useQuery } from '@dxos/react-client/echo';
|
|
19
19
|
import { Card, Message, Panel, ScrollArea, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
20
20
|
import { Masonry } from '@dxos/react-ui-masonry';
|
|
@@ -48,12 +48,12 @@ export const AgentArticle = ({ role, subject: agent }: AgentArticleProps) => {
|
|
|
48
48
|
|
|
49
49
|
const runtime = computeRuntime.getRuntime(space.spaceId);
|
|
50
50
|
await runtime.runPromise(Agent.resetChatHistory(agent));
|
|
51
|
-
if (!agent.
|
|
51
|
+
if (!agent.feed) {
|
|
52
52
|
await runtime.runPromise(
|
|
53
53
|
Effect.gen(function* () {
|
|
54
54
|
const queue = yield* QueueService.createQueue();
|
|
55
55
|
Obj.update(agent, (agent) => {
|
|
56
|
-
agent.
|
|
56
|
+
agent.feed = Ref.fromDXN(queue.dxn);
|
|
57
57
|
});
|
|
58
58
|
}),
|
|
59
59
|
);
|
|
@@ -74,15 +74,19 @@ export const AgentArticle = ({ role, subject: agent }: AgentArticleProps) => {
|
|
|
74
74
|
),
|
|
75
75
|
);
|
|
76
76
|
|
|
77
|
-
const
|
|
77
|
+
const inputFeed = useAtomValue(
|
|
78
78
|
AtomObj.make(agent).pipe((_) =>
|
|
79
79
|
Atom.make((get) =>
|
|
80
|
-
Option.fromNullable(get(_).
|
|
80
|
+
Option.fromNullable(get(_).feed).pipe(Option.map(AtomRef.make), Option.map(get), Option.getOrUndefined),
|
|
81
81
|
),
|
|
82
82
|
),
|
|
83
83
|
);
|
|
84
84
|
|
|
85
|
-
const
|
|
85
|
+
const db = Obj.getDatabase(agent);
|
|
86
|
+
const inputObjects = useQuery(
|
|
87
|
+
db,
|
|
88
|
+
inputFeed ? Query.select(Filter.everything()).from(inputFeed) : Query.select(Filter.nothing()),
|
|
89
|
+
);
|
|
86
90
|
|
|
87
91
|
return (
|
|
88
92
|
<Panel.Root role={role}>
|
|
@@ -90,7 +94,7 @@ export const AgentArticle = ({ role, subject: agent }: AgentArticleProps) => {
|
|
|
90
94
|
<Toolbar.Root>
|
|
91
95
|
<Toolbar.ToggleGroup type='single' value={tab} onValueChange={(value) => value && setTab(value as Tab)}>
|
|
92
96
|
<Toolbar.ToggleGroupIconItem value='artifacts' label={t('artifacts.label')} icon='ph--cube--regular' />
|
|
93
|
-
<Toolbar.ToggleGroupIconItem value='inputs' label={t('
|
|
97
|
+
<Toolbar.ToggleGroupIconItem value='inputs' label={t('inputs.label')} icon='ph--queue--regular' />
|
|
94
98
|
</Toolbar.ToggleGroup>
|
|
95
99
|
<Toolbar.Separator />
|
|
96
100
|
<Toolbar.IconButton
|
|
@@ -8,13 +8,13 @@ import React from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { Plan, Agent } from '@dxos/assistant-toolkit';
|
|
11
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
11
|
+
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
12
12
|
import { log } from '@dxos/log';
|
|
13
|
-
import { AutomationPlugin } from '@dxos/plugin-automation';
|
|
14
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
|
+
import { AutomationPlugin } from '@dxos/plugin-automation/testing';
|
|
14
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
15
15
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
16
|
import { corePlugins } from '@dxos/plugin-testing';
|
|
17
|
-
import {
|
|
17
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
18
18
|
import { Button } from '@dxos/react-ui';
|
|
19
19
|
import { ObjectProperties } from '@dxos/react-ui-form';
|
|
20
20
|
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
@@ -11,11 +11,11 @@ import { useCapability } from '@dxos/app-framework/ui';
|
|
|
11
11
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
12
12
|
import { Agent, SyncTriggers } from '@dxos/assistant-toolkit';
|
|
13
13
|
import { Operation } from '@dxos/compute';
|
|
14
|
-
import { DXN, Obj, Ref } from '@dxos/echo';
|
|
14
|
+
import { DXN, Filter, Obj, Ref } from '@dxos/echo';
|
|
15
15
|
import { AtomObj } from '@dxos/echo-atom';
|
|
16
16
|
import { log } from '@dxos/log';
|
|
17
|
-
import { AutomationCapabilities } from '@dxos/plugin-automation
|
|
18
|
-
import {
|
|
17
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
18
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
19
19
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
20
20
|
import { FeedAnnotation } from '@dxos/schema';
|
|
21
21
|
|
|
@@ -104,7 +104,7 @@ export const AgentProperties = ({ subject: agent }: AgentPropertiesProps) => {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
return (
|
|
107
|
-
<div
|
|
107
|
+
<div className='dx-expander flex flex-col'>
|
|
108
108
|
<Input.Root>
|
|
109
109
|
<Input.Label classNames='mt-form-gap'>{t('subscriptions.label')}</Input.Label>
|
|
110
110
|
</Input.Root>
|
|
@@ -8,7 +8,7 @@ import { Capabilities } from '@dxos/app-framework';
|
|
|
8
8
|
import { useAtomCapability, useCapability } from '@dxos/app-framework/ui';
|
|
9
9
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
10
|
import { type Space, getSpace } from '@dxos/client/echo';
|
|
11
|
-
import {
|
|
11
|
+
import { type Obj } from '@dxos/echo';
|
|
12
12
|
import { Panel } from '@dxos/react-ui';
|
|
13
13
|
import { getParentId } from '@dxos/react-ui-attention';
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ import { Chat as ChatComponent, type ChatRootProps } from '#components';
|
|
|
16
16
|
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '#hooks';
|
|
17
17
|
import { type Assistant, AssistantCapabilities, type ChatType } from '#types';
|
|
18
18
|
|
|
19
|
-
export type
|
|
19
|
+
export type ChatArticleProps = (
|
|
20
20
|
| AppSurface.ObjectArticleProps<ChatType.Chat | undefined>
|
|
21
21
|
| AppSurface.ObjectSectionProps<ChatType.Chat | undefined>
|
|
22
22
|
) & {
|
|
@@ -24,7 +24,7 @@ export type ChatContainerProps = (
|
|
|
24
24
|
companionTo?: Obj.Unknown;
|
|
25
25
|
} & Pick<ChatRootProps, 'onEvent'>;
|
|
26
26
|
|
|
27
|
-
export const
|
|
27
|
+
export const ChatArticle = forwardRef<HTMLDivElement, ChatArticleProps>((props, forwardedRef) => {
|
|
28
28
|
const { role, attendableId, subject: chat, space: spaceProp, companionTo, onEvent } = props;
|
|
29
29
|
const parentId = attendableId ? getParentId(attendableId) : undefined;
|
|
30
30
|
const space = spaceProp ?? getSpace(chat);
|
|
@@ -63,7 +63,6 @@ export const ChatContainer = forwardRef<HTMLDivElement, ChatContainerProps>((pro
|
|
|
63
63
|
}, [processor, attendableId, registry, stateAtom]);
|
|
64
64
|
|
|
65
65
|
const feedTarget = chat?.feed.target;
|
|
66
|
-
const queue = space && feedTarget ? space.queues.get(Feed.getQueueDxn(feedTarget)!) : undefined;
|
|
67
66
|
const view = (chat?.view as Assistant.ChatView | undefined) ?? settings.chatView;
|
|
68
67
|
|
|
69
68
|
if (!processor) {
|
|
@@ -71,24 +70,27 @@ export const ChatContainer = forwardRef<HTMLDivElement, ChatContainerProps>((pro
|
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
return (
|
|
74
|
-
<ChatComponent.Root db={space?.db} chat={chat} feed={
|
|
73
|
+
<ChatComponent.Root db={space?.db} chat={chat} feed={feedTarget} processor={processor} onEvent={onEvent}>
|
|
75
74
|
<Panel.Root role={role} ref={forwardedRef}>
|
|
76
75
|
<Panel.Toolbar className='bg-toolbar-surface'>
|
|
77
76
|
<ChatComponent.Toolbar classNames='dx-document' attendableId={attendableId} companionTo={companionTo} />
|
|
78
77
|
</Panel.Toolbar>
|
|
79
78
|
<Panel.Content>
|
|
80
79
|
<ChatComponent.Content>
|
|
81
|
-
<div
|
|
80
|
+
<div className='dx-container relative'>
|
|
82
81
|
<ChatComponent.Thread viewType={view} />
|
|
83
82
|
{view !== 'summary' && (
|
|
84
|
-
<div
|
|
85
|
-
<div
|
|
83
|
+
<div className='absolute bottom-2 left-0 right-0'>
|
|
84
|
+
<div className='dx-document px-4'>
|
|
86
85
|
<ChatComponent.Status classNames='px-3 rounded-sm bg-group-surface' />
|
|
87
86
|
</div>
|
|
88
87
|
</div>
|
|
89
88
|
)}
|
|
90
89
|
</div>
|
|
91
|
-
<div
|
|
90
|
+
<div className='dx-document px-4 pb-4'>
|
|
91
|
+
<div className='flex flex-col items-center py-2 overflow-hidden'>
|
|
92
|
+
<ChatComponent.TaskList classNames='max-h-[120px] border border-separator rounded-sm text-description' />
|
|
93
|
+
</div>
|
|
92
94
|
<ChatComponent.Prompt
|
|
93
95
|
{...chatProps}
|
|
94
96
|
outline
|
|
@@ -2,27 +2,25 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Array from 'effect/Array';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
5
|
import * as Option from 'effect/Option';
|
|
8
6
|
import React, { forwardRef, useCallback, useMemo } from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
|
+
import { BlueprintsAnnotation } from '@dxos/app-toolkit';
|
|
12
10
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
13
11
|
import { Chat } from '@dxos/assistant-toolkit';
|
|
14
12
|
import { getSpace } from '@dxos/client/echo';
|
|
15
13
|
import { Blueprint } from '@dxos/compute';
|
|
16
14
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
17
|
-
import { SpaceOperation } from '@dxos/plugin-space
|
|
15
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
18
16
|
import { useQuery } from '@dxos/react-client/echo';
|
|
19
17
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
20
18
|
|
|
21
19
|
import { type ChatEvent } from '#components';
|
|
22
20
|
import { useBlueprintRegistry, useContextBinder } from '#hooks';
|
|
23
|
-
import { AssistantOperation } from '#
|
|
21
|
+
import { AssistantOperation } from '#types';
|
|
24
22
|
|
|
25
|
-
import
|
|
23
|
+
import ChatArticle from '../ChatArticle';
|
|
26
24
|
|
|
27
25
|
export type ChatCompanionProps = AppSurface.ArticleProps<Chat.Chat, {}, Obj.Unknown>;
|
|
28
26
|
|
|
@@ -41,7 +39,7 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
41
39
|
return;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
if (event.type === 'submit' && !
|
|
42
|
+
if (event.type === 'submit' && !Obj.getDatabase(chat)) {
|
|
45
43
|
await invokePromise(SpaceOperation.AddObject, {
|
|
46
44
|
object: chat,
|
|
47
45
|
target: space.db,
|
|
@@ -62,27 +60,20 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
62
60
|
[chat, space, companionTo, invokePromise],
|
|
63
61
|
);
|
|
64
62
|
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
()
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
capability,
|
|
73
|
-
): capability is {
|
|
74
|
-
id: string;
|
|
75
|
-
metadata: { blueprints?: string[] };
|
|
76
|
-
} => capability.id === Obj.getTypename(companionTo),
|
|
77
|
-
),
|
|
78
|
-
Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)),
|
|
79
|
-
Option.getOrElse(() => [] as string[]),
|
|
80
|
-
),
|
|
81
|
-
[metadata, companionTo],
|
|
82
|
-
);
|
|
63
|
+
const blueprintKeys = useMemo(() => {
|
|
64
|
+
const schema = companionTo ? Obj.getSchema(companionTo) : undefined;
|
|
65
|
+
if (!schema) {
|
|
66
|
+
return [] as string[];
|
|
67
|
+
}
|
|
68
|
+
return Option.getOrElse(() => [] as string[])(BlueprintsAnnotation.get(schema));
|
|
69
|
+
}, [companionTo]);
|
|
83
70
|
const existingBlueprints = useQuery(space?.db, Filter.type(Blueprint.Blueprint));
|
|
84
71
|
const pluginBlueprints = useMemo(
|
|
85
|
-
() =>
|
|
72
|
+
() =>
|
|
73
|
+
existingBlueprints.filter((blueprint) => {
|
|
74
|
+
const key = Obj.getMeta(blueprint).key;
|
|
75
|
+
return key !== undefined && blueprintKeys.includes(key);
|
|
76
|
+
}),
|
|
86
77
|
[existingBlueprints, blueprintKeys],
|
|
87
78
|
);
|
|
88
79
|
|
|
@@ -95,7 +86,7 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
95
86
|
// NOTE: This must be run instead of using the useQuery result to avoid duplicates.
|
|
96
87
|
const existingBlueprints = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
|
|
97
88
|
for (const key of blueprintKeys) {
|
|
98
|
-
const existingBlueprint = existingBlueprints.find((blueprint) => blueprint.key === key);
|
|
89
|
+
const existingBlueprint = existingBlueprints.find((blueprint) => Obj.getMeta(blueprint).key === key);
|
|
99
90
|
if (existingBlueprint) {
|
|
100
91
|
continue;
|
|
101
92
|
}
|
|
@@ -128,7 +119,7 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
128
119
|
}, [binder, companionTo, blueprintKeys]);
|
|
129
120
|
|
|
130
121
|
return (
|
|
131
|
-
<
|
|
122
|
+
<ChatArticle
|
|
132
123
|
role={role ?? 'article'}
|
|
133
124
|
space={space}
|
|
134
125
|
subject={chat}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { type Plan } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
|
|
10
|
+
import { useAttention } from '@dxos/react-ui-attention';
|
|
11
|
+
|
|
12
|
+
import { TaskList } from '#components';
|
|
13
|
+
|
|
14
|
+
export type PlanArticleProps = AppSurface.ObjectArticleProps<Plan.Plan>;
|
|
15
|
+
|
|
16
|
+
export const PlanArticle = ({ role, attendableId, subject }: PlanArticleProps) => {
|
|
17
|
+
const { hasAttention } = useAttention(attendableId);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Panel.Root role={role} classNames='dx-document'>
|
|
21
|
+
<Panel.Toolbar asChild>
|
|
22
|
+
<Toolbar.Root disabled={!hasAttention} />
|
|
23
|
+
</Panel.Toolbar>
|
|
24
|
+
<Panel.Content asChild>
|
|
25
|
+
<ScrollArea.Root orientation='vertical'>
|
|
26
|
+
<ScrollArea.Viewport>
|
|
27
|
+
<TaskList plan={subject} />
|
|
28
|
+
</ScrollArea.Viewport>
|
|
29
|
+
</ScrollArea.Root>
|
|
30
|
+
</Panel.Content>
|
|
31
|
+
</Panel.Root>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { Routine } from '@dxos/compute';
|
|
11
|
+
import { Filter } from '@dxos/echo';
|
|
12
|
+
import { AutomationPlugin } from '@dxos/plugin-automation/testing';
|
|
13
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
14
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
15
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
16
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
17
|
+
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
18
|
+
|
|
19
|
+
import { translations } from '#translations';
|
|
20
|
+
|
|
21
|
+
import { AssistantPlugin } from '../../AssistantPlugin';
|
|
22
|
+
import { RoutineArticle } from './RoutineArticle';
|
|
23
|
+
|
|
24
|
+
const DefaultStory = () => {
|
|
25
|
+
const [space] = useSpaces();
|
|
26
|
+
const [routine] = useQuery(space?.db, Filter.type(Routine.Routine));
|
|
27
|
+
if (!routine) {
|
|
28
|
+
return <Loading />;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return <RoutineArticle role='article' subject={routine} attendableId='story' />;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const meta = {
|
|
35
|
+
title: 'plugins/plugin-assistant/containers/RoutineArticle',
|
|
36
|
+
render: DefaultStory,
|
|
37
|
+
decorators: [
|
|
38
|
+
withTheme(),
|
|
39
|
+
withLayout({ layout: 'column' }),
|
|
40
|
+
withPluginManager({
|
|
41
|
+
plugins: [
|
|
42
|
+
...corePlugins(),
|
|
43
|
+
ClientPlugin({
|
|
44
|
+
types: [Routine.Routine],
|
|
45
|
+
onClientInitialized: ({ client }) =>
|
|
46
|
+
Effect.gen(function* () {
|
|
47
|
+
yield* initializeIdentity(client);
|
|
48
|
+
const [space] = client.spaces.get();
|
|
49
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
50
|
+
|
|
51
|
+
space.db.add(
|
|
52
|
+
Routine.make({
|
|
53
|
+
name: 'Summarize',
|
|
54
|
+
description: 'Summarize the selected object.',
|
|
55
|
+
instructions: 'Create a new markdown document that is a summary of the selected object.',
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
}),
|
|
59
|
+
}),
|
|
60
|
+
AutomationPlugin(),
|
|
61
|
+
AssistantPlugin(),
|
|
62
|
+
],
|
|
63
|
+
}),
|
|
64
|
+
],
|
|
65
|
+
parameters: {
|
|
66
|
+
layout: 'fullscreen',
|
|
67
|
+
translations,
|
|
68
|
+
},
|
|
69
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
70
|
+
|
|
71
|
+
export default meta;
|
|
72
|
+
|
|
73
|
+
type Story = StoryObj<typeof meta>;
|
|
74
|
+
|
|
75
|
+
export const Default: Story = {};
|