@dxos/plugin-assistant 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/AssistantSettings-RBJHZPUJ.mjs +93 -0
- package/dist/lib/browser/AssistantSettings-RBJHZPUJ.mjs.map +7 -0
- package/dist/lib/browser/BlueprintArticle-FTGO6Y2F.mjs +35 -0
- package/dist/lib/browser/BlueprintArticle-FTGO6Y2F.mjs.map +7 -0
- package/dist/lib/browser/{ChatCompanion-ECQYUQ2B.mjs → ChatCompanion-J7UAC5TX.mjs} +76 -26
- package/dist/lib/browser/ChatCompanion-J7UAC5TX.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-QPPZHQRQ.mjs +12 -0
- package/dist/lib/browser/{ChatDialog-SMK4RSZU.mjs → ChatDialog-NYU67AQS.mjs} +9 -9
- package/dist/lib/browser/ChatDialog-NYU67AQS.mjs.map +7 -0
- package/dist/lib/browser/ProjectArticle-ZB27ZROW.mjs +92 -0
- package/dist/lib/browser/ProjectArticle-ZB27ZROW.mjs.map +7 -0
- package/dist/lib/browser/ProjectSettings-DDYTUL25.mjs +117 -0
- package/dist/lib/browser/ProjectSettings-DDYTUL25.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-RHTAHF23.mjs +71 -0
- package/dist/lib/browser/PromptArticle-RHTAHF23.mjs.map +7 -0
- package/dist/lib/browser/TracePanel-UPRPODLO.mjs +228 -0
- package/dist/lib/browser/TracePanel-UPRPODLO.mjs.map +7 -0
- package/dist/lib/browser/TriggerStatus-X35WDCK5.mjs +112 -0
- package/dist/lib/browser/TriggerStatus-X35WDCK5.mjs.map +7 -0
- package/dist/lib/browser/{ai-service-5GUDOEWF.mjs → ai-service-CY2BYPH6.mjs} +5 -4
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-DSNH2OMY.mjs → app-graph-builder-RXT6BPSZ.mjs} +74 -42
- package/dist/lib/browser/app-graph-builder-RXT6BPSZ.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-O4XHPNJB.mjs +37 -0
- package/dist/lib/browser/blueprint-definition-O4XHPNJB.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +3 -7
- package/dist/lib/browser/{chunk-EXVT7D4B.mjs → chunk-2VIEX4RA.mjs} +3 -3
- package/dist/lib/browser/{chunk-EXVT7D4B.mjs.map → chunk-2VIEX4RA.mjs.map} +1 -1
- package/dist/lib/browser/chunk-IWAEH25L.mjs +101 -0
- package/dist/lib/browser/chunk-IWAEH25L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ML3QCFKA.mjs → chunk-JYY5AD65.mjs} +50 -29
- package/dist/lib/browser/chunk-JYY5AD65.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3JYPE2MM.mjs → chunk-KR3KDUVF.mjs} +637 -346
- package/dist/lib/browser/chunk-KR3KDUVF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-V772AMZM.mjs → chunk-MZWRGUND.mjs} +51 -48
- package/dist/lib/browser/chunk-MZWRGUND.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZZRRSIQQ.mjs +26 -0
- package/dist/lib/browser/chunk-ZZRRSIQQ.mjs.map +7 -0
- package/dist/lib/browser/{edge-model-resolver-26BOY6HY.mjs → edge-model-resolver-YTMFQEN5.mjs} +4 -3
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +128 -91
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{local-model-resolver-ZFIM6GGV.mjs → local-model-resolver-CGRQH37T.mjs} +4 -3
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +7 -0
- package/dist/lib/browser/markdown-QGCIPTMQ.mjs +155 -0
- package/dist/lib/browser/markdown-QGCIPTMQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-7XJLBRQY.mjs → operation-resolver-BNMDF2JV.mjs} +64 -43
- package/dist/lib/browser/operation-resolver-BNMDF2JV.mjs.map +7 -0
- package/dist/lib/browser/react-surface-XPQLYF6H.mjs +150 -0
- package/dist/lib/browser/react-surface-XPQLYF6H.mjs.map +7 -0
- package/dist/lib/browser/{settings-4ZDLUMYE.mjs → settings-BVW4UWJL.mjs} +6 -5
- package/dist/lib/browser/settings-BVW4UWJL.mjs.map +7 -0
- package/dist/lib/browser/{state-AN6336ZX.mjs → state-TKE6OVOG.mjs} +5 -4
- package/dist/lib/browser/{state-AN6336ZX.mjs.map → state-TKE6OVOG.mjs.map} +3 -3
- package/dist/lib/browser/toolkit-XRSBBB3L.mjs +16 -0
- package/dist/lib/browser/toolkit-XRSBBB3L.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/AssistantSettings-KYN2CIJJ.mjs +94 -0
- package/dist/lib/node-esm/AssistantSettings-KYN2CIJJ.mjs.map +7 -0
- package/dist/lib/node-esm/BlueprintArticle-DFTPXAYU.mjs +36 -0
- package/dist/lib/node-esm/BlueprintArticle-DFTPXAYU.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatCompanion-Q4FUZ2MW.mjs → ChatCompanion-OJJVO44R.mjs} +76 -26
- package/dist/lib/node-esm/ChatCompanion-OJJVO44R.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-RIVOAWFM.mjs +13 -0
- package/dist/lib/node-esm/{ChatDialog-AP45PVZR.mjs → ChatDialog-IEZLH7T5.mjs} +9 -9
- package/dist/lib/node-esm/ChatDialog-IEZLH7T5.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectArticle-WVJI6IYZ.mjs +93 -0
- package/dist/lib/node-esm/ProjectArticle-WVJI6IYZ.mjs.map +7 -0
- package/dist/lib/node-esm/ProjectSettings-JQLRY6AS.mjs +118 -0
- package/dist/lib/node-esm/ProjectSettings-JQLRY6AS.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-HPCQDVFD.mjs +72 -0
- package/dist/lib/node-esm/PromptArticle-HPCQDVFD.mjs.map +7 -0
- package/dist/lib/node-esm/TracePanel-KAUU6OVE.mjs +229 -0
- package/dist/lib/node-esm/TracePanel-KAUU6OVE.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerStatus-V3QMIE7T.mjs +113 -0
- package/dist/lib/node-esm/TriggerStatus-V3QMIE7T.mjs.map +7 -0
- package/dist/lib/node-esm/{ai-service-PXKKCFIF.mjs → ai-service-ZI3A6RVG.mjs} +5 -4
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-TJCUEXW5.mjs → app-graph-builder-H24ZSWEY.mjs} +74 -42
- package/dist/lib/node-esm/app-graph-builder-H24ZSWEY.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-LWPM3FBG.mjs +38 -0
- package/dist/lib/node-esm/blueprint-definition-LWPM3FBG.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +3 -7
- package/dist/lib/node-esm/chunk-5BLOZBHM.mjs +102 -0
- package/dist/lib/node-esm/chunk-5BLOZBHM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AK3JJ76X.mjs +28 -0
- package/dist/lib/node-esm/chunk-AK3JJ76X.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZRIPP7YF.mjs → chunk-JMBYVUD6.mjs} +50 -29
- package/dist/lib/node-esm/chunk-JMBYVUD6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-XI5T3MJC.mjs → chunk-QYHBAOBD.mjs} +637 -346
- package/dist/lib/node-esm/chunk-QYHBAOBD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-POWB2BPC.mjs → chunk-TEYTGR67.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-POWB2BPC.mjs.map → chunk-TEYTGR67.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-355W5B27.mjs → chunk-VSA3KDAW.mjs} +51 -48
- package/dist/lib/node-esm/chunk-VSA3KDAW.mjs.map +7 -0
- package/dist/lib/node-esm/{edge-model-resolver-G5KMODPO.mjs → edge-model-resolver-CMJ3KNLQ.mjs} +4 -3
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +128 -91
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{local-model-resolver-KDZLYI7Y.mjs → local-model-resolver-FFDAKOXN.mjs} +4 -3
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +7 -0
- package/dist/lib/node-esm/markdown-5FJCWKIE.mjs +156 -0
- package/dist/lib/node-esm/markdown-5FJCWKIE.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-SX4WMNA7.mjs → operation-resolver-TWGZ3ODO.mjs} +64 -43
- package/dist/lib/node-esm/operation-resolver-TWGZ3ODO.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-6I6JOQBD.mjs +151 -0
- package/dist/lib/node-esm/react-surface-6I6JOQBD.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-CQEOHR3R.mjs → settings-5CL6CQFK.mjs} +6 -5
- package/dist/lib/node-esm/settings-5CL6CQFK.mjs.map +7 -0
- package/dist/lib/node-esm/{state-HDON4REW.mjs → state-XBRFX5FL.mjs} +5 -4
- package/dist/lib/node-esm/{state-HDON4REW.mjs.map → state-XBRFX5FL.mjs.map} +3 -3
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs +17 -0
- package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +1 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +3 -2
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts +1 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +4 -19
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +1 -2
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +4 -3
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +4 -3
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
- package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +4 -3
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state/index.d.ts +6 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/state/state.d.ts +7 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +3 -2
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +12 -8
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +2 -2
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +133 -7
- 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/sync.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +131 -5
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +131 -5
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -4
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +2 -2
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +131 -5
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +2 -2
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -1
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -12
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/containers/AssistantSettings/index.d.ts +3 -0
- package/dist/types/src/containers/AssistantSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
- package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts +3 -0
- package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatCompanion}/ChatCompanion.d.ts +3 -3
- package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts +3 -0
- package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatContainer}/ChatContainer.d.ts +6 -6
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts +3 -0
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
- package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts +3 -0
- package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts +7 -0
- package/dist/types/src/containers/Project/ProjectArticle.d.ts.map +1 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts +6 -0
- package/dist/types/src/containers/Project/ProjectSettings.d.ts.map +1 -0
- package/dist/types/src/containers/Project/index.d.ts +7 -0
- package/dist/types/src/containers/Project/index.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +6 -0
- package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts +3 -0
- package/dist/types/src/containers/PromptArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts +3 -0
- package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/containers/TracePanel/index.d.ts +3 -0
- package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +4 -0
- package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +11 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
- package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +2 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +2 -2
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +2 -2
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +7 -3
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts +2 -2
- package/dist/types/src/processor/update-name.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +131 -5
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +5 -27
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +35 -15
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +8 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +95 -92
- package/src/AssistantPlugin.tsx +82 -45
- package/src/blueprints/assistant/blueprint.conversations.json +1 -0
- package/src/blueprints/assistant/blueprint.test.ts +48 -0
- package/src/blueprints/assistant/blueprint.ts +27 -0
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/blueprints/index.ts +1 -8
- package/src/capabilities/ai-service/ai-service.ts +4 -3
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +67 -31
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +36 -42
- package/src/capabilities/blueprint-definition/index.ts +0 -1
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +4 -3
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +4 -3
- package/src/capabilities/markdown/index.ts +7 -0
- package/src/capabilities/markdown/markdown.ts +39 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +53 -26
- package/src/capabilities/react-surface/react-surface.tsx +68 -30
- package/src/capabilities/settings/settings.ts +3 -2
- package/src/capabilities/state/state.ts +1 -0
- package/src/capabilities/toolkit/toolkit.ts +5 -16
- package/src/components/Chat/Chat.tsx +66 -33
- package/src/components/ChatProgress/ChatProgress.tsx +4 -5
- package/src/components/ChatPrompt/ChatActions.tsx +9 -1
- package/src/components/ChatPrompt/ChatOptions.tsx +29 -9
- package/src/components/ChatPrompt/ChatReferences.tsx +14 -4
- package/src/components/ChatThread/ChatThread.stories.tsx +11 -11
- package/src/components/ChatThread/ChatThread.tsx +15 -6
- package/src/components/ChatThread/Link.tsx +1 -1
- package/src/components/ChatThread/registry.tsx +51 -18
- package/src/components/ChatThread/sync.test.ts +2 -0
- package/src/components/ChatThread/sync.ts +14 -8
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +3 -7
- package/src/components/TemplateEditor/TemplateEditor.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +3 -3
- package/src/components/TemplateEditor/TemplateForm.tsx +6 -7
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +4 -4
- package/src/components/ToolBlock/ToolBlock.tsx +15 -15
- package/src/components/Toolbox/Toolbox.stories.tsx +3 -3
- package/src/components/Toolbox/Toolbox.tsx +49 -48
- package/src/components/Typewriter/AssistantToolbar.tsx +3 -3
- package/src/components/Typewriter/Typewriter.stories.tsx +18 -15
- package/src/components/Typewriter/Typewriter.tsx +1 -1
- package/src/components/Typewriter/assistant-extension.tsx +3 -5
- package/src/components/index.ts +0 -9
- package/src/{components → containers}/AssistantSettings/AssistantSettings.tsx +15 -15
- package/src/containers/AssistantSettings/index.ts +7 -0
- package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
- package/src/containers/BlueprintArticle/index.ts +7 -0
- package/src/{components → containers/ChatCompanion}/ChatCompanion.tsx +86 -22
- package/src/containers/ChatCompanion/index.ts +7 -0
- package/src/containers/ChatContainer/ChatContainer.tsx +92 -0
- package/src/containers/ChatContainer/index.ts +7 -0
- package/src/{components → containers/ChatDialog}/ChatDialog.tsx +7 -9
- package/src/containers/ChatDialog/index.ts +7 -0
- package/src/containers/Project/ProjectArticle.tsx +124 -0
- package/src/containers/Project/ProjectSettings.tsx +135 -0
- package/src/containers/Project/index.ts +16 -0
- package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
- package/src/containers/PromptArticle/index.ts +7 -0
- package/src/containers/TracePanel/TracePanel.tsx +260 -0
- package/src/containers/TracePanel/index.ts +7 -0
- package/src/containers/TriggerStatus/TriggerStatus.tsx +140 -0
- package/src/containers/TriggerStatus/index.ts +7 -0
- package/src/containers/index.ts +16 -0
- package/src/extensions/index.ts +5 -0
- package/src/extensions/prompt-extension.ts +142 -0
- package/src/hooks/useBlueprintRegistry.ts +8 -4
- package/src/hooks/useChatProcessor.ts +2 -1
- package/src/hooks/useChatServices.ts +3 -3
- package/src/hooks/useChatToolbarActions.ts +6 -5
- package/src/hooks/useContextObjects.ts +7 -3
- package/src/hooks/useFilteredTypes.ts +3 -3
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +1 -0
- package/src/meta.ts +2 -2
- package/src/processor/processor.test.ts +8 -7
- package/src/processor/processor.ts +47 -26
- package/src/processor/update-name.ts +2 -3
- package/src/testing/test-sequence.ts +3 -3
- package/src/testing/test-services.ts +1 -1
- package/src/translations.ts +30 -3
- package/src/types/Assistant.ts +4 -38
- package/src/types/AssistantAction.ts +28 -13
- package/src/types/capabilities.ts +4 -2
- package/src/types/events.ts +1 -1
- package/src/types/index.ts +3 -0
- package/src/types/service.ts +4 -4
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs +0 -31
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-ECQYUQ2B.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs +0 -73
- package/dist/lib/browser/ChatContainer-QCCOFBUX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-SMK4RSZU.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +0 -53
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +0 -7
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +0 -14
- package/dist/lib/browser/chunk-3JYPE2MM.mjs.map +0 -7
- package/dist/lib/browser/chunk-DKQMSMBN.mjs +0 -326
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +0 -7
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRJVYGLU.mjs +0 -208
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +0 -7
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +0 -41
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs +0 -109
- package/dist/lib/browser/react-surface-NCITRSJJ.mjs.map +0 -7
- package/dist/lib/browser/repair-6QGAKOVM.mjs +0 -54
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +0 -7
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +0 -7
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +0 -18
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +0 -32
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-Q4FUZ2MW.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs +0 -74
- package/dist/lib/node-esm/ChatContainer-AKI33HIB.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-AP45PVZR.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +0 -54
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs +0 -15
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs +0 -327
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +0 -209
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +0 -42
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XI5T3MJC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs +0 -110
- package/dist/lib/node-esm/react-surface-ST6V7LPE.mjs.map +0 -7
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs +0 -55
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +0 -19
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +0 -7
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +0 -209
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/index.d.ts +0 -3
- package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
- package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
- package/dist/types/src/components/AssistantSettings/index.d.ts +0 -2
- package/dist/types/src/components/AssistantSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +0 -7
- package/dist/types/src/components/BlueprintArticle.d.ts.map +0 -1
- package/dist/types/src/components/ChatCompanion.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatDialog.d.ts.map +0 -1
- package/dist/types/src/components/PromptArticle.d.ts +0 -7
- package/dist/types/src/components/PromptArticle.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/object-list.d.ts +0 -10
- package/dist/types/src/functions/object-list.d.ts.map +0 -1
- package/dist/types/src/functions/object-load.d.ts +0 -8
- package/dist/types/src/functions/object-load.d.ts.map +0 -1
- package/dist/types/src/functions/object-search.d.ts +0 -10
- package/dist/types/src/functions/object-search.d.ts.map +0 -1
- package/src/blueprints/assistant-blueprint.ts +0 -62
- package/src/capabilities/repair/index.ts +0 -7
- package/src/capabilities/repair/repair.ts +0 -63
- package/src/components/AssistantSettings/index.ts +0 -5
- package/src/components/BlueprintArticle.tsx +0 -29
- package/src/components/ChatContainer.tsx +0 -61
- package/src/components/PromptArticle.tsx +0 -50
- package/src/functions/index.ts +0 -7
- package/src/functions/object-list.ts +0 -49
- package/src/functions/object-load.ts +0 -47
- package/src/functions/object-search.ts +0 -46
- /package/dist/lib/browser/{blueprint-definition-DGHH7MUU.mjs.map → ChatContainer-QPPZHQRQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-SEMDEIYG.mjs.map → ChatContainer-RIVOAWFM.mjs.map} +0 -0
- /package/dist/types/src/{components → containers}/AssistantSettings/AssistantSettings.d.ts +0 -0
|
@@ -5,25 +5,28 @@
|
|
|
5
5
|
import * as Array from 'effect/Array';
|
|
6
6
|
import * as Function from 'effect/Function';
|
|
7
7
|
import * as Option from 'effect/Option';
|
|
8
|
-
import React, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { useAtomCapability, useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
11
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
12
|
+
import { Chat } from '@dxos/assistant-toolkit';
|
|
12
13
|
import { Blueprint } from '@dxos/blueprints';
|
|
13
14
|
import { getSpace } from '@dxos/client/echo';
|
|
14
|
-
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
15
|
+
import { DXN, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
15
16
|
import { SpaceOperation } from '@dxos/plugin-space/types';
|
|
16
17
|
import { useQuery } from '@dxos/react-client/echo';
|
|
17
18
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
18
19
|
|
|
19
|
-
import {
|
|
20
|
-
import { useBlueprintRegistry, useContextBinder } from '
|
|
21
|
-
import { Assistant, AssistantOperation } from '
|
|
20
|
+
import { type ChatEvent } from '../../components';
|
|
21
|
+
import { useBlueprintRegistry, useContextBinder } from '../../hooks';
|
|
22
|
+
import { Assistant, AssistantCapabilities, AssistantOperation } from '../../types';
|
|
23
|
+
import ChatContainer from '../ChatContainer';
|
|
22
24
|
|
|
23
25
|
export type ChatCompanionProps = {
|
|
24
26
|
role?: string;
|
|
25
27
|
data: {
|
|
26
|
-
|
|
28
|
+
attendableId: string;
|
|
29
|
+
subject: Chat.Chat | 'assistant-chat';
|
|
27
30
|
companionTo: Obj.Unknown;
|
|
28
31
|
};
|
|
29
32
|
};
|
|
@@ -36,9 +39,49 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
36
39
|
|
|
37
40
|
const space = getSpace(companionTo);
|
|
38
41
|
const [chat, setChat] = useState(data.subject === 'assistant-chat' ? undefined : data.subject);
|
|
42
|
+
|
|
43
|
+
// Watch the state atom directly to detect when plus button clears the chat selection.
|
|
44
|
+
const state = useAtomCapability(AssistantCapabilities.State);
|
|
45
|
+
const companionToId = Obj.getDXN(companionTo).toString();
|
|
46
|
+
const currentChatState = state?.currentChat[companionToId];
|
|
47
|
+
|
|
48
|
+
// Track if initial setup has been done (to distinguish initial mount from plus button click).
|
|
49
|
+
// Reset when companionTo changes.
|
|
50
|
+
const initialSetupDoneRef = useRef(false);
|
|
51
|
+
const prevCompanionToIdRef = useRef(companionToId);
|
|
52
|
+
if (prevCompanionToIdRef.current !== companionToId) {
|
|
53
|
+
initialSetupDoneRef.current = false;
|
|
54
|
+
prevCompanionToIdRef.current = companionToId;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Sync local chat state with the state atom.
|
|
58
|
+
// When currentChatState is undefined (plus button clicked), reset local chat.
|
|
59
|
+
// When data.subject is a Chat object, use it directly.
|
|
60
|
+
// When currentChatState is a different chat, fetch and set it.
|
|
39
61
|
useEffect(() => {
|
|
40
|
-
|
|
41
|
-
|
|
62
|
+
// If state says no chat selected AND current chat is persisted, reset local state (handles plus button click).
|
|
63
|
+
// Don't reset in-memory chats - they're expected to have currentChatState === undefined.
|
|
64
|
+
if (!currentChatState && chat && getSpace(chat)) {
|
|
65
|
+
setChat(undefined);
|
|
66
|
+
} else if (data.subject !== 'assistant-chat') {
|
|
67
|
+
// If data.subject is a Chat object (resolved from graph), use it.
|
|
68
|
+
setChat(data.subject);
|
|
69
|
+
} else if (currentChatState && space) {
|
|
70
|
+
// currentChatState is set but graph couldn't resolve it - fetch manually.
|
|
71
|
+
const currentChatDxnStr = chat ? Obj.getDXN(chat).toString() : undefined;
|
|
72
|
+
if (currentChatState !== currentChatDxnStr) {
|
|
73
|
+
// Parse DXN and fetch the chat object from the database.
|
|
74
|
+
const parsedDxn = DXN.tryParse(currentChatState);
|
|
75
|
+
if (parsedDxn) {
|
|
76
|
+
const chatRef = space.db.makeRef(parsedDxn);
|
|
77
|
+
const resolvedChat = chatRef?.target;
|
|
78
|
+
if (Obj.instanceOf(Assistant.Chat, resolvedChat)) {
|
|
79
|
+
setChat(resolvedChat);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, [currentChatState, data.subject, space, chat]);
|
|
42
85
|
|
|
43
86
|
const chatQueue = space && chat ? space.queues.get(chat.queue.dxn) : undefined;
|
|
44
87
|
const binder = useContextBinder(chatQueue);
|
|
@@ -49,19 +92,41 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
49
92
|
return;
|
|
50
93
|
}
|
|
51
94
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
95
|
+
// Only query for existing chats on initial mount, not when plus button is clicked.
|
|
96
|
+
if (!initialSetupDoneRef.current) {
|
|
97
|
+
// Query for existing companion chats linked to this object.
|
|
98
|
+
const existingChats = await space.db
|
|
99
|
+
.query(Query.select(Filter.id(companionTo.id)).targetOf(Chat.CompanionTo).source())
|
|
100
|
+
.run();
|
|
101
|
+
|
|
102
|
+
initialSetupDoneRef.current = true;
|
|
103
|
+
|
|
104
|
+
// Use existing chat if found on initial mount.
|
|
105
|
+
if (existingChats.length > 0) {
|
|
106
|
+
const existingChat = existingChats.at(-1) as Assistant.Chat;
|
|
107
|
+
setChat(existingChat);
|
|
108
|
+
await invokePromise(AssistantOperation.SetCurrentChat, { companionTo, chat: existingChat });
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Create chat in-memory only - it will be added to space on first message.
|
|
114
|
+
const { data: createResult } = await invokePromise(AssistantOperation.CreateChat, {
|
|
115
|
+
db: space.db,
|
|
116
|
+
addToSpace: false,
|
|
117
|
+
});
|
|
118
|
+
setChat(createResult?.object);
|
|
119
|
+
}, [chat, space, companionTo, invokePromise]);
|
|
55
120
|
|
|
56
|
-
// Add chat to space when user submits the first message.
|
|
121
|
+
// Add chat to space and create relation when user submits the first message.
|
|
57
122
|
const handleEvent = useCallback(
|
|
58
123
|
async (event: ChatEvent) => {
|
|
59
|
-
|
|
60
|
-
if (chatInSpace || !chat || !space) {
|
|
124
|
+
if (!chat || !space) {
|
|
61
125
|
return;
|
|
62
126
|
}
|
|
63
127
|
|
|
64
|
-
|
|
128
|
+
// If chat is not in space yet, persist it on first submit.
|
|
129
|
+
if (event.type === 'submit' && !getSpace(chat)) {
|
|
65
130
|
await invokePromise(SpaceOperation.AddObject, {
|
|
66
131
|
object: chat,
|
|
67
132
|
target: space.db,
|
|
@@ -69,7 +134,7 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
69
134
|
});
|
|
70
135
|
await invokePromise(SpaceOperation.AddRelation, {
|
|
71
136
|
db: space.db,
|
|
72
|
-
schema:
|
|
137
|
+
schema: Chat.CompanionTo,
|
|
73
138
|
source: chat,
|
|
74
139
|
target: companionTo,
|
|
75
140
|
});
|
|
@@ -82,7 +147,7 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
82
147
|
[chat, space, companionTo, invokePromise],
|
|
83
148
|
);
|
|
84
149
|
|
|
85
|
-
const metadata = useCapabilities(
|
|
150
|
+
const metadata = useCapabilities(AppCapabilities.Metadata);
|
|
86
151
|
const blueprintKeys = useMemo(
|
|
87
152
|
() =>
|
|
88
153
|
Function.pipe(
|
|
@@ -125,7 +190,7 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
125
190
|
continue;
|
|
126
191
|
}
|
|
127
192
|
|
|
128
|
-
space.db.add(Obj.clone(blueprint));
|
|
193
|
+
space.db.add(Obj.clone(blueprint, { deep: true }));
|
|
129
194
|
}
|
|
130
195
|
}, [space, blueprintRegistry, blueprintKeys]);
|
|
131
196
|
|
|
@@ -150,6 +215,7 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
150
215
|
return (
|
|
151
216
|
<ChatContainer
|
|
152
217
|
role={role}
|
|
218
|
+
attendableId={data.attendableId}
|
|
153
219
|
space={space}
|
|
154
220
|
subject={chat}
|
|
155
221
|
companionTo={companionTo}
|
|
@@ -159,5 +225,3 @@ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
|
|
|
159
225
|
);
|
|
160
226
|
},
|
|
161
227
|
);
|
|
162
|
-
|
|
163
|
-
export default ChatCompanion;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { forwardRef, useEffect, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { useAtomCapability, useCapability } from '@dxos/app-framework/ui';
|
|
9
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
10
|
+
import { type Space, getSpace } from '@dxos/client/echo';
|
|
11
|
+
import { type Obj } from '@dxos/echo';
|
|
12
|
+
import { Panel } from '@dxos/react-ui';
|
|
13
|
+
import { getParentId } from '@dxos/react-ui-attention';
|
|
14
|
+
|
|
15
|
+
import { Chat as ChatComponent, type ChatRootProps } from '../../components';
|
|
16
|
+
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../../hooks';
|
|
17
|
+
import { AssistantCapabilities, type ChatType } from '../../types';
|
|
18
|
+
|
|
19
|
+
export type ChatContainerProps = SurfaceComponentProps<
|
|
20
|
+
ChatType.Chat | undefined,
|
|
21
|
+
{
|
|
22
|
+
space?: Space;
|
|
23
|
+
companionTo?: Obj.Unknown;
|
|
24
|
+
} & Pick<ChatRootProps, 'onEvent'>
|
|
25
|
+
>;
|
|
26
|
+
|
|
27
|
+
export const ChatContainer = forwardRef<HTMLDivElement, ChatContainerProps>((props, forwardedRef) => {
|
|
28
|
+
const { role, attendableId, subject: chat, space: spaceProp, companionTo, onEvent } = props;
|
|
29
|
+
const parentId = attendableId ? getParentId(attendableId) : undefined;
|
|
30
|
+
const space = spaceProp ?? getSpace(chat);
|
|
31
|
+
const settings = useAtomCapability(AssistantCapabilities.Settings);
|
|
32
|
+
const services = useChatServices({ id: space?.id, chat });
|
|
33
|
+
const [online, setOnline] = useOnline();
|
|
34
|
+
const { preset, ...chatProps } = usePresets(online);
|
|
35
|
+
const blueprintRegistry = useBlueprintRegistry();
|
|
36
|
+
const processor = useChatProcessor({
|
|
37
|
+
space,
|
|
38
|
+
chat,
|
|
39
|
+
preset,
|
|
40
|
+
services,
|
|
41
|
+
blueprintRegistry,
|
|
42
|
+
settings,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const registry = useCapability(Capabilities.AtomRegistry);
|
|
46
|
+
const stateAtom = useCapability(AssistantCapabilities.State);
|
|
47
|
+
const pendingSubmitted = useRef(false);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!processor || !attendableId || pendingSubmitted.current) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const state = registry.get(stateAtom);
|
|
54
|
+
const pendingPrompt = state.pendingPrompts[attendableId];
|
|
55
|
+
if (pendingPrompt) {
|
|
56
|
+
pendingSubmitted.current = true;
|
|
57
|
+
registry.update(stateAtom, (current) => {
|
|
58
|
+
const { [attendableId]: _, ...rest } = current.pendingPrompts;
|
|
59
|
+
return { ...current, pendingPrompts: rest };
|
|
60
|
+
});
|
|
61
|
+
void processor.request({ message: pendingPrompt });
|
|
62
|
+
}
|
|
63
|
+
}, [processor, attendableId, registry, stateAtom]);
|
|
64
|
+
|
|
65
|
+
if (!processor) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<ChatComponent.Root db={space?.db} chat={chat} processor={processor} onEvent={onEvent}>
|
|
71
|
+
<Panel.Root role={role} classNames='dx-document' ref={forwardedRef}>
|
|
72
|
+
<Panel.Toolbar>
|
|
73
|
+
<ChatComponent.Toolbar attendableId={parentId} companionTo={companionTo} />
|
|
74
|
+
</Panel.Toolbar>
|
|
75
|
+
<Panel.Content>
|
|
76
|
+
<ChatComponent.Viewport>
|
|
77
|
+
<ChatComponent.Thread />
|
|
78
|
+
<div role='none' className='p-4'>
|
|
79
|
+
<ChatComponent.Prompt
|
|
80
|
+
{...chatProps}
|
|
81
|
+
outline
|
|
82
|
+
preset={preset?.id}
|
|
83
|
+
online={online}
|
|
84
|
+
onOnlineChange={setOnline}
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</ChatComponent.Viewport>
|
|
88
|
+
</Panel.Content>
|
|
89
|
+
</Panel.Root>
|
|
90
|
+
</ChatComponent.Root>
|
|
91
|
+
);
|
|
92
|
+
});
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useAtomCapability } from '@dxos/app-framework/
|
|
7
|
+
import { useAtomCapability } from '@dxos/app-framework/ui';
|
|
8
|
+
import { type Chat as ChatTypes } from '@dxos/assistant-toolkit';
|
|
8
9
|
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { useTranslation } from '@dxos/react-ui';
|
|
10
11
|
import { ChatDialog as NaturalChatDialog } from '@dxos/react-ui-chat';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import { Chat, type ChatRootProps } from './Chat';
|
|
13
|
+
import { Chat, type ChatRootProps } from '../../components';
|
|
14
|
+
import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../../hooks';
|
|
15
|
+
import { meta } from '../../meta';
|
|
16
|
+
import { AssistantCapabilities } from '../../types';
|
|
17
17
|
|
|
18
18
|
export type ChatDialogProps = {
|
|
19
|
-
chat?:
|
|
19
|
+
chat?: ChatTypes.Chat;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
@@ -70,5 +70,3 @@ export const ChatDialog = ({ chat }: ChatDialogProps) => {
|
|
|
70
70
|
</Chat.Root>
|
|
71
71
|
);
|
|
72
72
|
};
|
|
73
|
-
|
|
74
|
-
export default ChatDialog;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
import React, { forwardRef, useMemo, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
11
|
+
import { type SurfaceComponentProps, useObjectMenuItems } from '@dxos/app-toolkit/ui';
|
|
12
|
+
import { type Project } from '@dxos/assistant-toolkit';
|
|
13
|
+
import { Annotation, Filter, Obj, Query } from '@dxos/echo';
|
|
14
|
+
import { AtomObj, AtomRef } from '@dxos/echo-atom';
|
|
15
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
16
|
+
import { Card, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
|
|
17
|
+
import { Menu } from '@dxos/react-ui-menu';
|
|
18
|
+
import { Focus, Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';
|
|
19
|
+
import { isNonNullable } from '@dxos/util';
|
|
20
|
+
|
|
21
|
+
export type ProjectArticleProps = SurfaceComponentProps<Project.Project>;
|
|
22
|
+
|
|
23
|
+
export const ProjectArticle = ({ subject: project }: ProjectArticleProps) => {
|
|
24
|
+
const inputQueue = useAtomValue(
|
|
25
|
+
AtomObj.make(project).pipe((_) =>
|
|
26
|
+
Atom.make((get) =>
|
|
27
|
+
Option.fromNullable(get(_).queue).pipe(Option.map(AtomRef.make), Option.map(get), Option.getOrUndefined),
|
|
28
|
+
),
|
|
29
|
+
),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const inputQueueItems: Obj.Unknown[] = useQuery(inputQueue, Query.select(Filter.everything()));
|
|
33
|
+
|
|
34
|
+
const artifacts = useAtomValue(
|
|
35
|
+
useMemo(
|
|
36
|
+
() =>
|
|
37
|
+
AtomObj.make(project).pipe((project) =>
|
|
38
|
+
Atom.make((get) => {
|
|
39
|
+
return get(project).artifacts.map((artifact) => get(AtomRef.make(artifact.data)) as Obj.Unknown);
|
|
40
|
+
}),
|
|
41
|
+
),
|
|
42
|
+
[project],
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const [viewport, setViewport] = useState<HTMLElement | null>(null);
|
|
47
|
+
|
|
48
|
+
const stackObjects = [...artifacts, ...inputQueueItems].filter(isNonNullable);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Panel.Root className='dx-document'>
|
|
52
|
+
<Panel.Content>
|
|
53
|
+
{/* TODO(burdon): Factor out. */}
|
|
54
|
+
{stackObjects.length === 0 && (
|
|
55
|
+
<div className='text-subdued'>
|
|
56
|
+
Project has no objects associated with it.
|
|
57
|
+
<br />
|
|
58
|
+
<br />
|
|
59
|
+
To get started:
|
|
60
|
+
<br />- Write the initative spec: what is the goal of the project?
|
|
61
|
+
<br />- subscribe project to your email.
|
|
62
|
+
<br />- Chat with the agent.
|
|
63
|
+
</div>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
{stackObjects.length > 0 && (
|
|
67
|
+
<Focus.Group asChild>
|
|
68
|
+
<Mosaic.Container asChild withFocus autoScroll={viewport}>
|
|
69
|
+
<ScrollArea.Root orientation='vertical'>
|
|
70
|
+
<ScrollArea.Viewport classNames='p-2' ref={setViewport}>
|
|
71
|
+
<Mosaic.Stack items={stackObjects} getId={(item) => item.id} draggable={false} Tile={StackTile} />
|
|
72
|
+
</ScrollArea.Viewport>
|
|
73
|
+
</ScrollArea.Root>
|
|
74
|
+
</Mosaic.Container>
|
|
75
|
+
</Focus.Group>
|
|
76
|
+
)}
|
|
77
|
+
</Panel.Content>
|
|
78
|
+
</Panel.Root>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const StackTile = forwardRef<HTMLDivElement, MosaicTileProps<Obj.Unknown>>(
|
|
83
|
+
({ data, location, debug }, forwardedRef) => {
|
|
84
|
+
const objectMenuItems = useObjectMenuItems(data);
|
|
85
|
+
const icon = Function.pipe(
|
|
86
|
+
Obj.getSchema(data),
|
|
87
|
+
Option.fromNullable,
|
|
88
|
+
Option.flatMap(Annotation.IconAnnotation.get),
|
|
89
|
+
Option.map(({ icon }) => icon),
|
|
90
|
+
Option.getOrElse(() => 'ph--placeholder--regular'),
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>
|
|
95
|
+
<Focus.Group asChild>
|
|
96
|
+
<Menu.Root>
|
|
97
|
+
<Card.Root ref={forwardedRef} data-testid='board-item'>
|
|
98
|
+
<Card.Toolbar>
|
|
99
|
+
<Card.Icon icon={icon} />
|
|
100
|
+
<Card.Title>{Obj.getLabel(data)}</Card.Title>
|
|
101
|
+
{/* TODO(wittjosiah): Reconcile with Card.Menu. */}
|
|
102
|
+
<Menu.Trigger asChild disabled={!objectMenuItems?.length}>
|
|
103
|
+
<Toolbar.IconButton
|
|
104
|
+
iconOnly
|
|
105
|
+
variant='ghost'
|
|
106
|
+
icon='ph--dots-three-vertical--regular'
|
|
107
|
+
label='Actions'
|
|
108
|
+
/>
|
|
109
|
+
</Menu.Trigger>
|
|
110
|
+
<Menu.Content items={objectMenuItems} />
|
|
111
|
+
</Card.Toolbar>
|
|
112
|
+
<Card.Content>
|
|
113
|
+
<Surface.Surface role='card--content' limit={1} data={{ subject: data }} />
|
|
114
|
+
</Card.Content>
|
|
115
|
+
</Card.Root>
|
|
116
|
+
</Menu.Root>
|
|
117
|
+
</Focus.Group>
|
|
118
|
+
</Mosaic.Tile>
|
|
119
|
+
);
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
StackTile.displayName = 'StackTile';
|
|
123
|
+
|
|
124
|
+
export default ProjectArticle;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom } from '@effect-atom/atom';
|
|
6
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Option from 'effect/Option';
|
|
9
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
10
|
+
|
|
11
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
12
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
13
|
+
import { Project, syncProjectTriggers } from '@dxos/assistant-toolkit';
|
|
14
|
+
import { DXN, Obj, Ref } from '@dxos/echo';
|
|
15
|
+
import { AtomObj, AtomRef } from '@dxos/echo-atom';
|
|
16
|
+
import { QueueService } from '@dxos/functions';
|
|
17
|
+
import { AutomationCapabilities } from '@dxos/plugin-automation/types';
|
|
18
|
+
import { MarkdownEditor } from '@dxos/plugin-markdown';
|
|
19
|
+
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
20
|
+
import { useObject } from '@dxos/react-client/echo';
|
|
21
|
+
import { Button } from '@dxos/react-ui';
|
|
22
|
+
import { ButtonGroup, Input } from '@dxos/react-ui';
|
|
23
|
+
import { FeedAnnotation } from '@dxos/schema';
|
|
24
|
+
|
|
25
|
+
export const ProjectSettings = ({ subject: project }: SurfaceComponentProps<Project.Project>) => {
|
|
26
|
+
const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
27
|
+
|
|
28
|
+
const handleResetHistory = useCallback(async () => {
|
|
29
|
+
const runtime = computeRuntime.getRuntime(Obj.getDatabase(project)!.spaceId);
|
|
30
|
+
|
|
31
|
+
await runtime.runPromise(Project.resetChatHistory(project));
|
|
32
|
+
|
|
33
|
+
if (!project.queue) {
|
|
34
|
+
await runtime.runPromise(
|
|
35
|
+
Effect.gen(function* () {
|
|
36
|
+
const queue = yield* QueueService.createQueue();
|
|
37
|
+
Obj.change(project, (project) => {
|
|
38
|
+
project.queue = Ref.fromDXN(queue.dxn);
|
|
39
|
+
});
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}, [project, computeRuntime]);
|
|
44
|
+
|
|
45
|
+
const spec = useAtomValue(AtomRef.make(project.spec));
|
|
46
|
+
const [specInitialValue] = useObject(spec, 'content');
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const db = Obj.getDatabase(project);
|
|
50
|
+
if (!db) return;
|
|
51
|
+
const runtime = computeRuntime.getRuntime(db.spaceId);
|
|
52
|
+
return Obj.subscribe(project, () => {
|
|
53
|
+
queueMicrotask(() => runtime.runPromise(syncProjectTriggers(project)));
|
|
54
|
+
});
|
|
55
|
+
}, [project, computeRuntime]);
|
|
56
|
+
|
|
57
|
+
const db = Obj.getDatabase(project);
|
|
58
|
+
const feedFilter = useMemo(() => {
|
|
59
|
+
if (!db) {
|
|
60
|
+
return Filter.nothing();
|
|
61
|
+
}
|
|
62
|
+
const schemas = db.schemaRegistry.query({ location: ['database', 'runtime'] }).runSync();
|
|
63
|
+
const feedSchemas = schemas.filter((schema) => {
|
|
64
|
+
const annotation = FeedAnnotation.get(schema);
|
|
65
|
+
return Option.isSome(annotation) && annotation.value === true;
|
|
66
|
+
});
|
|
67
|
+
if (feedSchemas.length === 0) {
|
|
68
|
+
return Filter.nothing();
|
|
69
|
+
}
|
|
70
|
+
return Filter.or(...feedSchemas.map((schema) => Filter.type(schema)));
|
|
71
|
+
}, [db]);
|
|
72
|
+
const subscribableObjects = useQuery(db, feedFilter);
|
|
73
|
+
|
|
74
|
+
const existingSubscripts = useAtomValue(
|
|
75
|
+
useMemo(
|
|
76
|
+
() =>
|
|
77
|
+
AtomObj.make(project).pipe((_) =>
|
|
78
|
+
Atom.make((get) => {
|
|
79
|
+
const project = get(_);
|
|
80
|
+
const selectedSubscriptions: Obj.Unknown[] = subscribableObjects.filter((object) =>
|
|
81
|
+
project.subscriptions.some((subscription) => DXN.equals(subscription.dxn, Obj.getDXN(object))),
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
return selectedSubscriptions;
|
|
85
|
+
}),
|
|
86
|
+
),
|
|
87
|
+
[project, subscribableObjects],
|
|
88
|
+
),
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div className='flex flex-col gap-4'>
|
|
93
|
+
<Input.Root>
|
|
94
|
+
<Input.Label>Spec (what is the goal of the project?)</Input.Label>
|
|
95
|
+
<MarkdownEditor.Root id={spec?.id ?? ''} object={spec}>
|
|
96
|
+
<MarkdownEditor.Content initialValue={specInitialValue} />
|
|
97
|
+
</MarkdownEditor.Root>
|
|
98
|
+
</Input.Root>
|
|
99
|
+
<ButtonGroup classNames='h-10'>
|
|
100
|
+
<Button onClick={handleResetHistory}>Reset Chat History</Button>
|
|
101
|
+
</ButtonGroup>
|
|
102
|
+
<div>
|
|
103
|
+
<h2 className='text-lg font-bold'>Subscriptions</h2>
|
|
104
|
+
{subscribableObjects.length > 0 && (
|
|
105
|
+
<div>
|
|
106
|
+
{subscribableObjects.map((object) => (
|
|
107
|
+
<Input.Root key={object.id}>
|
|
108
|
+
<Input.Checkbox
|
|
109
|
+
checked={existingSubscripts.includes(object)}
|
|
110
|
+
onCheckedChange={(checked) => {
|
|
111
|
+
Obj.change(project, (project) => {
|
|
112
|
+
if (checked) {
|
|
113
|
+
project.subscriptions.push(Ref.fromDXN(Obj.getDXN(object)));
|
|
114
|
+
} else {
|
|
115
|
+
project.subscriptions = project.subscriptions.filter(
|
|
116
|
+
(subscription) => !DXN.equals(subscription.dxn, Obj.getDXN(object)),
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
<Input.Label>{Obj.getLabel(object)}</Input.Label>
|
|
123
|
+
</Input.Root>
|
|
124
|
+
))}
|
|
125
|
+
</div>
|
|
126
|
+
)}
|
|
127
|
+
{subscribableObjects.length === 0 && (
|
|
128
|
+
<div className='text-sm text-description'>Space has no feeds to subscribe to.</div>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export default ProjectSettings;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, type FunctionComponent, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import type { Project } from '@dxos/assistant-toolkit';
|
|
9
|
+
|
|
10
|
+
import type { ProjectArticleProps } from './ProjectArticle';
|
|
11
|
+
|
|
12
|
+
export const ProjectArticle: ComponentType<ProjectArticleProps> = lazy(() => import('./ProjectArticle'));
|
|
13
|
+
|
|
14
|
+
export const ProjectSettings: FunctionComponent<SurfaceComponentProps<Project.Project>> = lazy(
|
|
15
|
+
() => import('./ProjectSettings'),
|
|
16
|
+
);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { AgentFunctions } from '@dxos/assistant-toolkit';
|
|
9
|
+
import { type Prompt } from '@dxos/blueprints';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { type FunctionDefinition } from '@dxos/functions';
|
|
12
|
+
import { invariant } from '@dxos/invariant';
|
|
13
|
+
import { invokeFunctionWithTracing, useComputeRuntimeCallback } from '@dxos/plugin-automation';
|
|
14
|
+
import { Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
15
|
+
import { useAttention } from '@dxos/react-ui-attention';
|
|
16
|
+
|
|
17
|
+
import { TemplateEditor } from '../../components';
|
|
18
|
+
import { meta } from '../../meta';
|
|
19
|
+
|
|
20
|
+
export type PromptArticleProps = SurfaceComponentProps<Prompt.Prompt>;
|
|
21
|
+
|
|
22
|
+
export const PromptArticle = ({ role, attendableId, subject }: PromptArticleProps) => {
|
|
23
|
+
const { t } = useTranslation(meta.id);
|
|
24
|
+
const { hasAttention } = useAttention(attendableId);
|
|
25
|
+
const db = Obj.getDatabase(subject);
|
|
26
|
+
|
|
27
|
+
const inputData = useMemo<FunctionDefinition.Input<typeof AgentFunctions.Prompt> | undefined>(
|
|
28
|
+
() =>
|
|
29
|
+
subject && db
|
|
30
|
+
? {
|
|
31
|
+
prompt: db.makeRef(Obj.getDXN(subject)),
|
|
32
|
+
input: {},
|
|
33
|
+
}
|
|
34
|
+
: undefined,
|
|
35
|
+
[subject, db],
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const handleRun = useComputeRuntimeCallback(
|
|
39
|
+
db?.spaceId,
|
|
40
|
+
() => {
|
|
41
|
+
invariant(inputData);
|
|
42
|
+
return invokeFunctionWithTracing(AgentFunctions.Prompt, inputData);
|
|
43
|
+
},
|
|
44
|
+
[inputData],
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Panel.Root role={role} className='dx-document'>
|
|
49
|
+
<Panel.Toolbar asChild>
|
|
50
|
+
<Toolbar.Root disabled={!hasAttention} onClick={handleRun}>
|
|
51
|
+
<Toolbar.IconButton iconOnly icon='ph--play--regular' label={t('run prompt label')} onClick={handleRun} />
|
|
52
|
+
</Toolbar.Root>
|
|
53
|
+
</Panel.Toolbar>
|
|
54
|
+
<Panel.Content asChild>
|
|
55
|
+
<TemplateEditor id={subject.id} template={subject.instructions} />
|
|
56
|
+
</Panel.Content>
|
|
57
|
+
</Panel.Root>
|
|
58
|
+
);
|
|
59
|
+
};
|