@dxos/plugin-automation 0.7.5-labs.a279d8c → 0.7.5-labs.ea4b4c2
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/AutomationPanel-VW2XIUPU.mjs +8 -0
- package/dist/lib/browser/AutomationPanel-VW2XIUPU.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-5TAVTN3T.mjs +12 -0
- package/dist/lib/browser/ChatContainer-5TAVTN3T.mjs.map +7 -0
- package/dist/lib/browser/{ai-client-6CRYUC6D.mjs → ai-client-5CNY6JBF.mjs} +4 -4
- package/dist/lib/browser/{ai-client-6CRYUC6D.mjs.map → ai-client-5CNY6JBF.mjs.map} +3 -3
- package/dist/lib/browser/{app-graph-builder-IJTTULDP.mjs → app-graph-builder-FZGK55G7.mjs} +70 -4
- package/dist/lib/browser/app-graph-builder-FZGK55G7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HZ4TA7HY.mjs → chunk-2H2EUYXL.mjs} +2 -2
- package/dist/lib/browser/chunk-DVE33EZL.mjs +1602 -0
- package/dist/lib/browser/chunk-DVE33EZL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EKJVAFT2.mjs → chunk-MJK7GL5P.mjs} +108 -27
- package/dist/lib/browser/chunk-MJK7GL5P.mjs.map +7 -0
- package/dist/lib/browser/chunk-NQFZ6XRX.mjs +243 -0
- package/dist/lib/browser/chunk-NQFZ6XRX.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q4IMHYGH.mjs +150 -0
- package/dist/lib/browser/chunk-Q4IMHYGH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HKX3D3ZP.mjs → chunk-R4JH4TLE.mjs} +4 -2
- package/dist/lib/browser/chunk-R4JH4TLE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +56 -45
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-BWAXKT27.mjs +29 -0
- package/dist/lib/browser/intent-resolver-BWAXKT27.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-IGMBLSV7.mjs → react-surface-ILBDBZCN.mjs} +32 -23
- package/dist/lib/browser/react-surface-ILBDBZCN.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -4
- package/dist/lib/node/AutomationPanel-G6EDDYWW.cjs +26 -0
- package/dist/lib/node/AutomationPanel-G6EDDYWW.cjs.map +7 -0
- package/dist/lib/node/ChatContainer-EN24W3K4.cjs +33 -0
- package/dist/lib/node/ChatContainer-EN24W3K4.cjs.map +7 -0
- package/dist/lib/node/{ai-client-A3RRU55B.cjs → ai-client-FKLPDELV.cjs} +8 -8
- package/dist/lib/node/{ai-client-A3RRU55B.cjs.map → ai-client-FKLPDELV.cjs.map} +3 -3
- package/dist/lib/node/{app-graph-builder-MF5M4QRS.cjs → app-graph-builder-T76NYV42.cjs} +77 -12
- package/dist/lib/node/app-graph-builder-T76NYV42.cjs.map +7 -0
- package/dist/lib/node/chunk-CJGJXNY3.cjs +1586 -0
- package/dist/lib/node/chunk-CJGJXNY3.cjs.map +7 -0
- package/dist/lib/node/{chunk-5VF5JKUN.cjs → chunk-EQYHOTGG.cjs} +8 -5
- package/dist/lib/node/chunk-EQYHOTGG.cjs.map +7 -0
- package/dist/lib/node/{chunk-BUQOZA4N.cjs → chunk-GB7245FH.cjs} +87 -11
- package/dist/lib/node/chunk-GB7245FH.cjs.map +7 -0
- package/dist/lib/node/chunk-HMBKP6VG.cjs +324 -0
- package/dist/lib/node/chunk-HMBKP6VG.cjs.map +7 -0
- package/dist/lib/node/{AutomationPanel-RXJDVLCF.cjs → chunk-QXIHYOMF.cjs} +123 -9
- package/dist/lib/node/chunk-QXIHYOMF.cjs.map +7 -0
- package/dist/lib/node/{chunk-ZS5RZ7RM.cjs → chunk-U5Z7LFWB.cjs} +6 -6
- package/dist/lib/node/index.cjs +100 -88
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-TBHYXBDI.cjs → intent-resolver-C6OKFVEW.cjs} +20 -15
- package/dist/lib/node/intent-resolver-C6OKFVEW.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-BVUZMKYS.cjs → react-surface-LWDY7SQG.cjs} +31 -24
- package/dist/lib/node/react-surface-LWDY7SQG.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +15 -9
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/AutomationPanel-V3IWQAMO.mjs +9 -0
- package/dist/lib/node-esm/AutomationPanel-V3IWQAMO.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-CNTY3C2D.mjs +13 -0
- package/dist/lib/node-esm/ChatContainer-CNTY3C2D.mjs.map +7 -0
- package/dist/lib/node-esm/{ai-client-2GBZRHBA.mjs → ai-client-XGNA6SJ5.mjs} +4 -4
- package/dist/lib/node-esm/{ai-client-2GBZRHBA.mjs.map → ai-client-XGNA6SJ5.mjs.map} +3 -3
- package/dist/lib/node-esm/{app-graph-builder-5N7OK23B.mjs → app-graph-builder-IJQEN7WT.mjs} +70 -4
- package/dist/lib/node-esm/app-graph-builder-IJQEN7WT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6HLBYDUI.mjs +244 -0
- package/dist/lib/node-esm/chunk-6HLBYDUI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DNCXRGAF.mjs +151 -0
- package/dist/lib/node-esm/chunk-DNCXRGAF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-X3LPRWIL.mjs → chunk-EMVA6QUT.mjs} +4 -2
- package/dist/lib/node-esm/chunk-EMVA6QUT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ISYLEDVU.mjs → chunk-IJRTDSKN.mjs} +2 -2
- package/dist/lib/node-esm/chunk-QP47VJT6.mjs +1603 -0
- package/dist/lib/node-esm/chunk-QP47VJT6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5QUXIXNB.mjs → chunk-ZLIAMW45.mjs} +108 -27
- package/dist/lib/node-esm/chunk-ZLIAMW45.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +56 -45
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-DCP4ZDBA.mjs +30 -0
- package/dist/lib/node-esm/intent-resolver-DCP4ZDBA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-77S6XJOM.mjs → react-surface-SBDXFVIN.mjs} +32 -23
- package/dist/lib/node-esm/react-surface-SBDXFVIN.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +10 -4
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/artifacts.stories.d.ts +10 -24
- package/dist/types/src/artifacts.stories.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +45 -44
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +27 -27
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.d.ts +3 -0
- package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.d.ts.map +1 -0
- package/dist/types/src/components/AmbientChatDialog/index.d.ts +2 -0
- package/dist/types/src/components/AmbientChatDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/Box/StatusLine.d.ts +11 -0
- package/dist/types/src/components/Box/StatusLine.d.ts.map +1 -0
- package/dist/types/src/components/Box/StatusLine.stories.d.ts +9 -0
- package/dist/types/src/components/Box/StatusLine.stories.d.ts.map +1 -0
- package/dist/types/src/components/Box/Tabbed.d.ts +15 -0
- package/dist/types/src/components/Box/Tabbed.d.ts.map +1 -0
- package/dist/types/src/components/Box/Tabbed.stories.d.ts +8 -0
- package/dist/types/src/components/Box/Tabbed.stories.d.ts.map +1 -0
- package/dist/types/src/components/Box/ToggleContainer.d.ts +13 -0
- package/dist/types/src/components/Box/ToggleContainer.d.ts.map +1 -0
- package/dist/types/src/components/Box/ToggleContainer.stories.d.ts +9 -0
- package/dist/types/src/components/Box/ToggleContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/Box/index.d.ts +4 -0
- package/dist/types/src/components/Box/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer/ChatContainer.d.ts +7 -0
- package/dist/types/src/components/ChatContainer/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer/index.d.ts +4 -0
- package/dist/types/src/components/ChatContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts +14 -0
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts +8 -0
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownViewer/index.d.ts +2 -0
- package/dist/types/src/components/MarkdownViewer/index.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/Prompt.d.ts +7 -0
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +8 -0
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/index.d.ts +2 -0
- package/dist/types/src/components/Prompt/index.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts +20 -0
- package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts.map +1 -0
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +6 -0
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +1 -0
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +8 -0
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +1 -0
- package/dist/types/src/components/ServiceRegistry/index.d.ts +2 -0
- package/dist/types/src/components/ServiceRegistry/index.d.ts.map +1 -0
- package/dist/types/src/components/Thread/Thread.d.ts +6 -9
- package/dist/types/src/components/Thread/Thread.d.ts.map +1 -1
- package/dist/types/src/components/Thread/Thread.stories.d.ts +3 -4
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +12 -0
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +6 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/processor.d.ts +39 -15
- package/dist/types/src/hooks/processor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +7 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -0
- package/dist/types/src/hooks/useMessageQueue.d.ts +41 -0
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -0
- package/dist/types/src/hooks/useServices.d.ts +7 -0
- package/dist/types/src/hooks/useServices.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/{testing.d.ts → test-functions.d.ts} +1 -1
- package/dist/types/src/testing/test-functions.d.ts.map +1 -0
- package/dist/types/src/testing/test-services.d.ts +5 -0
- package/dist/types/src/testing/test-services.d.ts.map +1 -0
- package/dist/types/src/tools/function.d.ts +5 -0
- package/dist/types/src/tools/function.d.ts.map +1 -0
- package/dist/types/src/tools/index.d.ts +3 -0
- package/dist/types/src/tools/index.d.ts.map +1 -0
- package/dist/types/src/tools/openapi.d.ts +10 -0
- package/dist/types/src/tools/openapi.d.ts.map +1 -0
- package/dist/types/src/tools/openapi.test.d.ts +2 -0
- package/dist/types/src/tools/openapi.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +12 -6
- package/dist/types/src/translations.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/registry.d.ts +10 -0
- package/dist/types/src/types/registry.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +156 -7
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +2 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +56 -49
- package/src/AutomationPlugin.tsx +18 -26
- package/src/artifacts.stories.tsx +126 -65
- package/src/capabilities/ai-client.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +65 -5
- package/src/capabilities/intent-resolver.ts +14 -9
- package/src/capabilities/react-surface.tsx +21 -13
- package/src/components/AmbientChatDialog/AmbientChatDialog.tsx +26 -0
- package/src/components/AmbientChatDialog/index.ts +5 -0
- package/src/components/Box/StatusLine.stories.tsx +52 -0
- package/src/components/Box/StatusLine.tsx +76 -0
- package/src/components/Box/Tabbed.stories.tsx +51 -0
- package/src/components/Box/Tabbed.tsx +89 -0
- package/src/components/Box/ToggleContainer.stories.tsx +110 -0
- package/src/components/Box/ToggleContainer.tsx +108 -0
- package/src/components/Box/index.ts +7 -0
- package/src/components/ChatContainer/ChatContainer.tsx +52 -0
- package/src/components/ChatContainer/index.ts +8 -0
- package/src/components/MarkdownViewer/MarkdownViewer.stories.tsx +56 -0
- package/src/components/MarkdownViewer/MarkdownViewer.tsx +79 -0
- package/src/components/MarkdownViewer/index.ts +5 -0
- package/src/components/Prompt/Prompt.stories.tsx +50 -0
- package/src/components/Prompt/Prompt.tsx +36 -0
- package/src/components/Prompt/index.ts +5 -0
- package/src/components/Prompt/prompt-autocomplete.ts +200 -0
- package/src/components/PromptEditor/PromptEditor.stories.tsx +3 -3
- package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +49 -0
- package/src/components/ServiceRegistry/ServiceRegistry.tsx +75 -0
- package/src/components/ServiceRegistry/index.ts +5 -0
- package/src/components/Thread/Thread.stories.tsx +152 -97
- package/src/components/Thread/Thread.tsx +115 -108
- package/src/components/Thread/ThreadMessage.tsx +225 -0
- package/src/components/TriggerEditor/TriggerEditor.tsx +8 -5
- package/src/components/index.ts +5 -1
- package/src/hooks/index.ts +4 -0
- package/src/hooks/processor.ts +114 -65
- package/src/hooks/useChatProcessor.tsx +86 -0
- package/src/hooks/useMessageQueue.ts +23 -0
- package/src/hooks/useServices.ts +28 -0
- package/src/meta.ts +4 -1
- package/src/testing/index.ts +2 -1
- package/src/testing/test-services.ts +131 -0
- package/src/tools/function.ts +47 -0
- package/src/tools/index.ts +6 -0
- package/src/tools/openapi.test.ts +227 -0
- package/src/tools/openapi.ts +331 -0
- package/src/translations.ts +9 -6
- package/src/types/index.ts +1 -0
- package/src/types/registry.ts +26 -0
- package/src/types/schema.ts +90 -3
- package/src/types/types.ts +2 -2
- package/dist/lib/browser/AssistantPanel-KO6DZBTU.mjs +0 -340
- package/dist/lib/browser/AssistantPanel-KO6DZBTU.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-BMLM533Z.mjs +0 -131
- package/dist/lib/browser/AutomationPanel-BMLM533Z.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-SIAJFRFF.mjs +0 -300
- package/dist/lib/browser/ChatContainer-SIAJFRFF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-IJTTULDP.mjs.map +0 -7
- package/dist/lib/browser/chunk-C3VRGDR6.mjs +0 -75
- package/dist/lib/browser/chunk-C3VRGDR6.mjs.map +0 -7
- package/dist/lib/browser/chunk-EKJVAFT2.mjs.map +0 -7
- package/dist/lib/browser/chunk-HKX3D3ZP.mjs.map +0 -7
- package/dist/lib/browser/chunk-JSNPW6JF.mjs +0 -14
- package/dist/lib/browser/chunk-JSNPW6JF.mjs.map +0 -7
- package/dist/lib/browser/chunk-KPSDH6XZ.mjs +0 -118
- package/dist/lib/browser/chunk-KPSDH6XZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-YZF3SDZL.mjs +0 -139
- package/dist/lib/browser/chunk-YZF3SDZL.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-AHDQ3KQP.mjs +0 -24
- package/dist/lib/browser/intent-resolver-AHDQ3KQP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-IGMBLSV7.mjs.map +0 -7
- package/dist/lib/node/AssistantPanel-PPFS2HKK.cjs +0 -360
- package/dist/lib/node/AssistantPanel-PPFS2HKK.cjs.map +0 -7
- package/dist/lib/node/AutomationPanel-RXJDVLCF.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-GS2SC5OG.cjs +0 -318
- package/dist/lib/node/ChatContainer-GS2SC5OG.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-MF5M4QRS.cjs.map +0 -7
- package/dist/lib/node/chunk-5VF5JKUN.cjs.map +0 -7
- package/dist/lib/node/chunk-BUQOZA4N.cjs.map +0 -7
- package/dist/lib/node/chunk-DNLBVFR7.cjs +0 -147
- package/dist/lib/node/chunk-DNLBVFR7.cjs.map +0 -7
- package/dist/lib/node/chunk-TWDGP26W.cjs +0 -172
- package/dist/lib/node/chunk-TWDGP26W.cjs.map +0 -7
- package/dist/lib/node/chunk-VEGLN4YN.cjs +0 -250
- package/dist/lib/node/chunk-VEGLN4YN.cjs.map +0 -7
- package/dist/lib/node/chunk-Z2YFE5SJ.cjs +0 -49
- package/dist/lib/node/chunk-Z2YFE5SJ.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-TBHYXBDI.cjs.map +0 -7
- package/dist/lib/node/react-surface-BVUZMKYS.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantPanel-XSSKKCJY.mjs +0 -341
- package/dist/lib/node-esm/AssistantPanel-XSSKKCJY.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-GQZZ4UBI.mjs +0 -132
- package/dist/lib/node-esm/AutomationPanel-GQZZ4UBI.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-57ILGC3R.mjs +0 -301
- package/dist/lib/node-esm/ChatContainer-57ILGC3R.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-5N7OK23B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5QUXIXNB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ICHNUP5M.mjs +0 -119
- package/dist/lib/node-esm/chunk-ICHNUP5M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JCYVS5GG.mjs +0 -76
- package/dist/lib/node-esm/chunk-JCYVS5GG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-L2B6VGMG.mjs +0 -16
- package/dist/lib/node-esm/chunk-L2B6VGMG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U7HXYMPZ.mjs +0 -141
- package/dist/lib/node-esm/chunk-U7HXYMPZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-X3LPRWIL.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-DPJJHFGK.mjs +0 -25
- package/dist/lib/node-esm/intent-resolver-DPJJHFGK.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-77S6XJOM.mjs.map +0 -7
- package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts +0 -8
- package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts.map +0 -1
- package/dist/types/src/components/AssistantPanel/index.d.ts +0 -3
- package/dist/types/src/components/AssistantPanel/index.d.ts.map +0 -1
- package/dist/types/src/components/AssistantPanel/system-instructions.d.ts +0 -6
- package/dist/types/src/components/AssistantPanel/system-instructions.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -8
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/testing/testing.d.ts.map +0 -1
- package/src/components/AssistantPanel/AssistantPanel.tsx +0 -232
- package/src/components/AssistantPanel/index.ts +0 -7
- package/src/components/AssistantPanel/system-instructions.ts +0 -166
- package/src/components/ChatContainer.tsx +0 -80
- /package/dist/lib/browser/{chunk-HZ4TA7HY.mjs.map → chunk-2H2EUYXL.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-ZS5RZ7RM.cjs.map → chunk-U5Z7LFWB.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-ISYLEDVU.mjs.map → chunk-IJRTDSKN.mjs.map} +0 -0
- /package/src/testing/{testing.ts → test-functions.ts} +0 -0
|
@@ -4,97 +4,127 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type Meta } from '@storybook/react';
|
|
8
|
-
import React, { useMemo, useState } from 'react';
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { Capabilities, Surface, useCapabilities } from '@dxos/app-framework';
|
|
10
|
+
import { Capabilities, IntentPlugin, Surface, useCapabilities, useIntentDispatcher } from '@dxos/app-framework';
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { Message, type Tool } from '@dxos/artifact';
|
|
13
|
+
import { capabilities, genericTools, localServiceEndpoints, type IsObject } from '@dxos/artifact-testing';
|
|
14
14
|
import { AIServiceClientImpl } from '@dxos/assistant';
|
|
15
|
-
import { create } from '@dxos/client/echo';
|
|
16
15
|
import { createStatic, ObjectId } from '@dxos/echo-schema';
|
|
17
16
|
import { EdgeHttpClient } from '@dxos/edge-client';
|
|
17
|
+
import { invariant } from '@dxos/invariant';
|
|
18
18
|
import { DXN, QueueSubspaceTags, SpaceId } from '@dxos/keys';
|
|
19
19
|
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
20
20
|
import { ChessType } from '@dxos/plugin-chess/types';
|
|
21
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
21
22
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
23
|
+
import { SpacePlugin } from '@dxos/plugin-space';
|
|
24
|
+
import { TablePlugin } from '@dxos/plugin-table';
|
|
25
|
+
import { useSpace } from '@dxos/react-client/echo';
|
|
22
26
|
import { useQueue } from '@dxos/react-edge-client';
|
|
23
27
|
import { IconButton, Input, Toolbar } from '@dxos/react-ui';
|
|
24
28
|
import { mx } from '@dxos/react-ui-theme';
|
|
25
29
|
import { withLayout, withSignals, withTheme } from '@dxos/storybook-utils';
|
|
26
30
|
|
|
27
|
-
import { Thread } from './components';
|
|
31
|
+
import { Thread, type ThreadProps } from './components';
|
|
28
32
|
import { ChatProcessor } from './hooks';
|
|
29
33
|
import { createProcessorOptions } from './testing';
|
|
34
|
+
import translations from './translations';
|
|
30
35
|
|
|
31
36
|
const endpoints = localServiceEndpoints;
|
|
32
37
|
|
|
33
38
|
type RenderProps = {
|
|
34
|
-
items?:
|
|
35
|
-
|
|
39
|
+
items?: IsObject[];
|
|
40
|
+
prompts?: string[];
|
|
41
|
+
} & Pick<ThreadProps, 'debug'>;
|
|
36
42
|
|
|
37
|
-
|
|
43
|
+
// TODO(burdon): Use ChatContainer.
|
|
44
|
+
const Render = ({ items: _items, prompts = [], ...props }: RenderProps) => {
|
|
45
|
+
const space = useSpace();
|
|
38
46
|
const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
|
|
39
|
-
|
|
40
|
-
// Configuration.
|
|
41
47
|
const tools = useMemo<Tool[]>(
|
|
42
|
-
() => [
|
|
43
|
-
// prettier-ignore
|
|
44
|
-
...genericTools,
|
|
45
|
-
...artifactDefinitions.flatMap((definition) => definition.tools),
|
|
46
|
-
],
|
|
48
|
+
() => [...genericTools, ...artifactDefinitions.flatMap((definition) => definition.tools)],
|
|
47
49
|
[genericTools, artifactDefinitions],
|
|
48
50
|
);
|
|
49
51
|
|
|
50
|
-
// TODO(burdon): Common naming/packaging.
|
|
51
|
-
const [edgeClient] = useState(() => new EdgeHttpClient(endpoints.edge));
|
|
52
52
|
const [aiClient] = useState(() => new AIServiceClientImpl({ endpoint: endpoints.ai }));
|
|
53
|
+
const [edgeClient] = useState(() => new EdgeHttpClient(endpoints.edge));
|
|
54
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
55
|
+
const processor = useMemo<ChatProcessor | undefined>(() => {
|
|
56
|
+
if (!space) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
53
59
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const [artifactsContext] = useState(() =>
|
|
61
|
-
create<ArtifactsContext>({
|
|
62
|
-
items: _items ?? [],
|
|
63
|
-
getArtifacts() {
|
|
64
|
-
return this.items;
|
|
65
|
-
},
|
|
66
|
-
addArtifact(artifact) {
|
|
67
|
-
this.items.push(artifact);
|
|
60
|
+
return new ChatProcessor(
|
|
61
|
+
aiClient,
|
|
62
|
+
tools,
|
|
63
|
+
{
|
|
64
|
+
space,
|
|
65
|
+
dispatch,
|
|
68
66
|
},
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
createProcessorOptions(artifactDefinitions.map((definition) => definition.instructions)),
|
|
68
|
+
);
|
|
69
|
+
}, [aiClient, tools, space, dispatch, artifactDefinitions]);
|
|
71
70
|
|
|
72
|
-
//
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
// Queue.
|
|
72
|
+
const [queueDxn, setQueueDxn] = useState(() => randomQueueDxn());
|
|
73
|
+
const queue = useQueue<Message>(edgeClient, DXN.tryParse(queueDxn));
|
|
74
|
+
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (queue?.items.length === 0 && !queue.isLoading && prompts.length > 0) {
|
|
77
|
+
queue.append([
|
|
78
|
+
createStatic(Message, {
|
|
79
|
+
role: 'assistant',
|
|
80
|
+
content: prompts.map(
|
|
81
|
+
(prompt) =>
|
|
82
|
+
({
|
|
83
|
+
type: 'json',
|
|
84
|
+
disposition: 'suggest',
|
|
85
|
+
json: JSON.stringify({ text: prompt }),
|
|
86
|
+
}) as const,
|
|
87
|
+
),
|
|
88
|
+
}),
|
|
89
|
+
]);
|
|
90
|
+
}
|
|
91
|
+
}, [queueDxn, prompts, queue?.items.length, queue?.isLoading]);
|
|
83
92
|
|
|
84
93
|
// State.
|
|
85
|
-
const artifactItems =
|
|
86
|
-
const messages = [...queue
|
|
87
|
-
|
|
88
|
-
const handleSubmit =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
const artifactItems: any[] = []; // TODO(burdon): Query from space.
|
|
95
|
+
const messages = [...(queue?.items ?? []), ...(processor?.messages.value ?? [])];
|
|
96
|
+
|
|
97
|
+
const handleSubmit = processor
|
|
98
|
+
? async (message: string) => {
|
|
99
|
+
invariant(processor);
|
|
100
|
+
if (processor.streaming.value) {
|
|
101
|
+
await processor.cancel();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
invariant(queue);
|
|
105
|
+
await processor.request(message, {
|
|
106
|
+
history: queue.items,
|
|
107
|
+
onComplete: (messages) => {
|
|
108
|
+
queue.append(messages);
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
: undefined;
|
|
113
|
+
|
|
114
|
+
const handleSuggest = useCallback(
|
|
115
|
+
(text: string) => {
|
|
116
|
+
void handleSubmit?.(text);
|
|
117
|
+
},
|
|
118
|
+
[handleSubmit],
|
|
119
|
+
);
|
|
93
120
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
121
|
+
const handleDelete = useCallback(
|
|
122
|
+
(id: string) => {
|
|
123
|
+
invariant(ObjectId.isValid(id), 'Invalid message id');
|
|
124
|
+
void queue?.delete([id]);
|
|
125
|
+
},
|
|
126
|
+
[queue],
|
|
127
|
+
);
|
|
98
128
|
|
|
99
129
|
return (
|
|
100
130
|
<div className='grid grid-cols-2 w-full h-full divide-x divide-separator overflow-hidden'>
|
|
@@ -106,7 +136,7 @@ const Render = ({ items: _items }: RenderProps) => {
|
|
|
106
136
|
spellCheck={false}
|
|
107
137
|
placeholder='Queue DXN'
|
|
108
138
|
value={queueDxn}
|
|
109
|
-
onClick={() => setQueueDxn('')}
|
|
139
|
+
// onClick={() => setQueueDxn('')} Why?????
|
|
110
140
|
onChange={(ev) => setQueueDxn(ev.target.value)}
|
|
111
141
|
/>
|
|
112
142
|
<IconButton
|
|
@@ -121,11 +151,18 @@ const Render = ({ items: _items }: RenderProps) => {
|
|
|
121
151
|
icon='ph--trash--regular'
|
|
122
152
|
onClick={() => setQueueDxn(randomQueueDxn())}
|
|
123
153
|
/>
|
|
124
|
-
<IconButton iconOnly label='Stop' icon='ph--stop--regular' onClick={() => processor
|
|
154
|
+
<IconButton iconOnly label='Stop' icon='ph--stop--regular' onClick={() => processor?.cancel()} />
|
|
125
155
|
</Input.Root>
|
|
126
156
|
</Toolbar.Root>
|
|
127
157
|
|
|
128
|
-
<Thread
|
|
158
|
+
<Thread
|
|
159
|
+
messages={messages}
|
|
160
|
+
streaming={processor?.streaming.value}
|
|
161
|
+
onSubmit={processor ? handleSubmit : undefined}
|
|
162
|
+
onSuggest={processor ? handleSuggest : undefined}
|
|
163
|
+
onDelete={processor ? handleDelete : undefined}
|
|
164
|
+
{...props}
|
|
165
|
+
/>
|
|
129
166
|
</div>
|
|
130
167
|
|
|
131
168
|
{/* Artifacts Deck/Mosaic */}
|
|
@@ -157,20 +194,44 @@ const meta: Meta<typeof Render> = {
|
|
|
157
194
|
title: 'plugins/plugin-automation/artifacts',
|
|
158
195
|
render: Render,
|
|
159
196
|
decorators: [
|
|
160
|
-
//
|
|
161
197
|
withSignals,
|
|
198
|
+
withPluginManager({
|
|
199
|
+
plugins: [
|
|
200
|
+
ClientPlugin({
|
|
201
|
+
onClientInitialized: async (_, client) => {
|
|
202
|
+
await client.halo.createIdentity();
|
|
203
|
+
},
|
|
204
|
+
}),
|
|
205
|
+
SpacePlugin({ observability: false }),
|
|
206
|
+
IntentPlugin(),
|
|
207
|
+
ChessPlugin(),
|
|
208
|
+
MapPlugin(),
|
|
209
|
+
TablePlugin(),
|
|
210
|
+
],
|
|
211
|
+
capabilities,
|
|
212
|
+
}),
|
|
162
213
|
withTheme,
|
|
163
214
|
withLayout({ fullscreen: true, tooltips: true }),
|
|
164
|
-
withPluginManager({ plugins: [ChessPlugin(), MapPlugin()], capabilities }),
|
|
165
215
|
],
|
|
216
|
+
parameters: {
|
|
217
|
+
translations,
|
|
218
|
+
},
|
|
166
219
|
};
|
|
167
220
|
|
|
168
221
|
export default meta;
|
|
169
222
|
|
|
170
|
-
|
|
223
|
+
type Story = StoryObj<typeof Render>;
|
|
224
|
+
|
|
225
|
+
export const Default: Story = {
|
|
226
|
+
args: {
|
|
227
|
+
debug: true,
|
|
228
|
+
prompts: ['Ask me a question', 'Show me a chess puzzle'],
|
|
229
|
+
},
|
|
230
|
+
};
|
|
171
231
|
|
|
172
|
-
export const WithInitialItems = {
|
|
232
|
+
export const WithInitialItems: Story = {
|
|
173
233
|
args: {
|
|
234
|
+
debug: true,
|
|
174
235
|
items: [
|
|
175
236
|
createStatic(ChessType, {
|
|
176
237
|
fen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
|
|
@@ -13,7 +13,7 @@ const DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';
|
|
|
13
13
|
|
|
14
14
|
export default (context: PluginsContext) => {
|
|
15
15
|
const client = context.requestCapability(ClientCapabilities.Client);
|
|
16
|
-
const endpoint = client.config.values.runtime?.
|
|
16
|
+
const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;
|
|
17
17
|
const aiClient = new AIServiceClientImpl({ endpoint });
|
|
18
18
|
return contributes(AutomationCapabilities.AiClient, aiClient);
|
|
19
19
|
};
|
|
@@ -2,19 +2,81 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
5
|
+
import { Capabilities, contributes, createIntent, LayoutAction, type PluginsContext } from '@dxos/app-framework';
|
|
6
6
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
|
-
import { createExtension, toSignal } from '@dxos/plugin-graph';
|
|
7
|
+
import { createExtension, type Node, ROOT_ID, toSignal } from '@dxos/plugin-graph';
|
|
8
8
|
import { memoizeQuery } from '@dxos/plugin-space';
|
|
9
9
|
import { getTypename, parseId, SpaceState } from '@dxos/react-client/echo';
|
|
10
10
|
|
|
11
|
-
import { AUTOMATION_PLUGIN } from '../meta';
|
|
11
|
+
import { AMBIENT_CHAT_DIALOG, AUTOMATION_PLUGIN } from '../meta';
|
|
12
12
|
|
|
13
13
|
export default (context: PluginsContext) => {
|
|
14
14
|
const resolve = (typename: string) =>
|
|
15
15
|
context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
|
|
16
16
|
|
|
17
17
|
return contributes(Capabilities.AppGraphBuilder, [
|
|
18
|
+
createExtension({
|
|
19
|
+
id: `${AUTOMATION_PLUGIN}/service-registry`,
|
|
20
|
+
resolver: ({ id }) => {
|
|
21
|
+
if (!id.endsWith('~service-registry')) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const type = 'orphan-settings-for-subject';
|
|
26
|
+
const icon = 'ph--plugs--regular';
|
|
27
|
+
|
|
28
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
29
|
+
const [subjectId] = id.split('~');
|
|
30
|
+
const { spaceId } = parseId(subjectId);
|
|
31
|
+
const spaces = toSignal(
|
|
32
|
+
(onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,
|
|
33
|
+
() => client.spaces.get(),
|
|
34
|
+
);
|
|
35
|
+
const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);
|
|
36
|
+
return {
|
|
37
|
+
id,
|
|
38
|
+
type,
|
|
39
|
+
data: null,
|
|
40
|
+
properties: {
|
|
41
|
+
icon,
|
|
42
|
+
label: ['service registry label', { ns: AUTOMATION_PLUGIN }],
|
|
43
|
+
object: null,
|
|
44
|
+
space,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
createExtension({
|
|
50
|
+
id: `${AUTOMATION_PLUGIN}/ambient-chat`,
|
|
51
|
+
filter: (node): node is Node<null> => node.id === ROOT_ID,
|
|
52
|
+
actions: () => [
|
|
53
|
+
{
|
|
54
|
+
id: `${LayoutAction.UpdateDialog._tag}/ambient-chat/open`,
|
|
55
|
+
data: async () => {
|
|
56
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
57
|
+
await dispatch(
|
|
58
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
59
|
+
part: 'dialog',
|
|
60
|
+
subject: AMBIENT_CHAT_DIALOG,
|
|
61
|
+
options: {
|
|
62
|
+
state: true,
|
|
63
|
+
blockAlign: 'end',
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
properties: {
|
|
69
|
+
label: ['open ambient chat label', { ns: AUTOMATION_PLUGIN }],
|
|
70
|
+
icon: 'ph--chat-centered-text--regular',
|
|
71
|
+
disposition: 'pin-end',
|
|
72
|
+
keyBinding: {
|
|
73
|
+
macos: 'shift+meta+k',
|
|
74
|
+
windows: 'shift+ctrl+k',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
}),
|
|
18
80
|
createExtension({
|
|
19
81
|
id: `${AUTOMATION_PLUGIN}/automation-for-subject`,
|
|
20
82
|
resolver: ({ id }) => {
|
|
@@ -80,7 +142,6 @@ export default (context: PluginsContext) => {
|
|
|
80
142
|
createExtension({
|
|
81
143
|
id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,
|
|
82
144
|
resolver: ({ id }) => {
|
|
83
|
-
// TODO(Zan): Find util (or make one). Effect schema!!
|
|
84
145
|
if (!id.endsWith('~assistant')) {
|
|
85
146
|
return;
|
|
86
147
|
}
|
|
@@ -110,7 +171,6 @@ export default (context: PluginsContext) => {
|
|
|
110
171
|
}
|
|
111
172
|
|
|
112
173
|
const [object] = memoizeQuery(space, { id: objectId });
|
|
113
|
-
|
|
114
174
|
return {
|
|
115
175
|
id,
|
|
116
176
|
type: 'orphan-automation-for-subject',
|
|
@@ -6,17 +6,22 @@ import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
|
6
6
|
import { ObjectId } from '@dxos/echo-schema';
|
|
7
7
|
import { create, makeRef } from '@dxos/live-object';
|
|
8
8
|
|
|
9
|
-
import { AutomationAction,
|
|
9
|
+
import { AutomationAction, AIChatType } from '../types';
|
|
10
10
|
|
|
11
11
|
export default () =>
|
|
12
12
|
contributes(
|
|
13
13
|
Capabilities.IntentResolver,
|
|
14
|
-
createResolver(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
createResolver({
|
|
15
|
+
intent: AutomationAction.Create,
|
|
16
|
+
resolve: ({ name }) => ({
|
|
17
|
+
data: {
|
|
18
|
+
object: create(AIChatType, {
|
|
19
|
+
name,
|
|
20
|
+
// TODO(burdon): ???
|
|
21
|
+
// new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, SpaceId.random(), ObjectId.random()]).toString(),
|
|
22
|
+
queue: makeRef({ id: ObjectId.random() }),
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
}),
|
|
22
27
|
);
|
|
@@ -5,18 +5,32 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { getSpace, isEchoObject, type ReactiveEchoObject } from '@dxos/react-client/echo';
|
|
8
|
+
import { getSpace, isEchoObject, isSpace, type ReactiveEchoObject } from '@dxos/react-client/echo';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import { AUTOMATION_PLUGIN } from '../meta';
|
|
12
|
-
import {
|
|
10
|
+
import { AmbientChatDialog, AutomationPanel, ChatContainer, ServiceRegistry } from '../components';
|
|
11
|
+
import { AUTOMATION_PLUGIN, AMBIENT_CHAT_DIALOG } from '../meta';
|
|
12
|
+
import { AIChatType } from '../types';
|
|
13
13
|
|
|
14
14
|
export default () =>
|
|
15
15
|
contributes(Capabilities.ReactSurface, [
|
|
16
16
|
createSurface({
|
|
17
|
-
id: `${AUTOMATION_PLUGIN}/
|
|
18
|
-
role: '
|
|
19
|
-
|
|
17
|
+
id: `${AUTOMATION_PLUGIN}/ai-chat`,
|
|
18
|
+
role: 'article',
|
|
19
|
+
filter: (data): data is { subject: AIChatType } => data.subject instanceof AIChatType,
|
|
20
|
+
component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
|
|
21
|
+
}),
|
|
22
|
+
createSurface({
|
|
23
|
+
id: `${AUTOMATION_PLUGIN}/service-registry`,
|
|
24
|
+
role: 'complementary--service-registry',
|
|
25
|
+
component: ({ data }) => (
|
|
26
|
+
<ServiceRegistry space={isSpace(data.subject) ? data.subject : getSpace(data.subject)!} />
|
|
27
|
+
),
|
|
28
|
+
}),
|
|
29
|
+
createSurface({
|
|
30
|
+
id: AMBIENT_CHAT_DIALOG,
|
|
31
|
+
role: 'dialog',
|
|
32
|
+
filter: (data): data is any => data.component === AMBIENT_CHAT_DIALOG,
|
|
33
|
+
component: () => <AmbientChatDialog />,
|
|
20
34
|
}),
|
|
21
35
|
createSurface({
|
|
22
36
|
id: `${AUTOMATION_PLUGIN}/automation`,
|
|
@@ -25,10 +39,4 @@ export default () =>
|
|
|
25
39
|
isEchoObject(data.subject) && !!getSpace(data.subject),
|
|
26
40
|
component: ({ data }) => <AutomationPanel space={getSpace(data.subject)!} object={data.subject} />,
|
|
27
41
|
}),
|
|
28
|
-
createSurface({
|
|
29
|
-
id: `${AUTOMATION_PLUGIN}/gpt-chat`,
|
|
30
|
-
role: 'article',
|
|
31
|
-
filter: (data): data is { subject: GptChatType } => data.subject instanceof GptChatType,
|
|
32
|
-
component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
|
|
33
|
-
}),
|
|
34
42
|
]);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
import { AUTOMATION_PLUGIN } from '../../meta';
|
|
10
|
+
|
|
11
|
+
const preventDefault = (event: Event) => event.preventDefault();
|
|
12
|
+
|
|
13
|
+
export const AmbientChatDialog = () => {
|
|
14
|
+
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
15
|
+
return (
|
|
16
|
+
<div role='none' className='dx-dialog__overlay bg-transparent pointer-events-none' data-block-align='end'>
|
|
17
|
+
<Dialog.Content onInteractOutside={preventDefault} classNames='pointer-events-auto' inOverlayLayout>
|
|
18
|
+
<Dialog.Title classNames='sr-only'>{t('ambient chat dialog title')}</Dialog.Title>
|
|
19
|
+
<Dialog.Close>
|
|
20
|
+
<Icon icon='ph--x--regular' size={4} />
|
|
21
|
+
</Dialog.Close>
|
|
22
|
+
<h1>Hello</h1>
|
|
23
|
+
</Dialog.Content>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { faker } from '@dxos/random';
|
|
11
|
+
import { Button } from '@dxos/react-ui';
|
|
12
|
+
import { withLayout, withTheme, withSignals } from '@dxos/storybook-utils';
|
|
13
|
+
|
|
14
|
+
import { StatusLine } from './StatusLine';
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof StatusLine> = {
|
|
17
|
+
title: 'plugins/plugin-automation/StatusLine',
|
|
18
|
+
component: StatusLine,
|
|
19
|
+
decorators: [withSignals, withTheme, withLayout()],
|
|
20
|
+
parameters: {
|
|
21
|
+
layout: 'centered',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
type Story = StoryObj<typeof StatusLine>;
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
classNames: 'w-96 px-2',
|
|
32
|
+
lines: Array.from({ length: 5 }, (_, i) => `${i}. ${faker.lorem.paragraph()}`),
|
|
33
|
+
autoAdvance: true,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Demo: Story = {
|
|
38
|
+
render: () => {
|
|
39
|
+
const [lines, setLines] = useState<string[]>([]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className='flex flex-col w-96 gap-4'>
|
|
43
|
+
<StatusLine lines={lines} autoAdvance advance={500} />
|
|
44
|
+
<div>
|
|
45
|
+
<Button onClick={() => setLines((lines) => [...lines, `${lines.length + 1}. ${faker.lorem.paragraph()}`])}>
|
|
46
|
+
Add
|
|
47
|
+
</Button>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
9
|
+
|
|
10
|
+
const emptyLines: string[] = [];
|
|
11
|
+
|
|
12
|
+
export type StatusLineProps = ThemedClassName<{
|
|
13
|
+
line?: number;
|
|
14
|
+
lines?: string[];
|
|
15
|
+
transition?: number;
|
|
16
|
+
advance?: number;
|
|
17
|
+
autoAdvance?: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
export const StatusLine = ({
|
|
21
|
+
classNames,
|
|
22
|
+
line = -1,
|
|
23
|
+
lines = emptyLines,
|
|
24
|
+
transition = 300,
|
|
25
|
+
advance = 1_000,
|
|
26
|
+
autoAdvance,
|
|
27
|
+
}: StatusLineProps) => {
|
|
28
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
29
|
+
const [currentLine, setCurrentLine] = useState(line);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setCurrentLine(line);
|
|
32
|
+
}, [line]);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!autoAdvance) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const next = () => {
|
|
40
|
+
setCurrentLine((prev) => {
|
|
41
|
+
if (prev >= lines.length - 1) {
|
|
42
|
+
clearInterval(interval);
|
|
43
|
+
return prev;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return prev + 1;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
next();
|
|
51
|
+
const interval = setInterval(next, advance);
|
|
52
|
+
|
|
53
|
+
return () => clearInterval(interval);
|
|
54
|
+
}, [lines.length, autoAdvance, advance]);
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (containerRef.current) {
|
|
58
|
+
containerRef.current.style.transition = `transform ${transition}ms ease-in-out`;
|
|
59
|
+
containerRef.current.style.transform = `translateY(-${currentLine * 24}px)`;
|
|
60
|
+
}
|
|
61
|
+
}, [currentLine]);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div className={mx('relative h-[24px] overflow-hidden', classNames)}>
|
|
65
|
+
<div ref={containerRef} className='h-[24px]'>
|
|
66
|
+
<div className='flex flex-col'>
|
|
67
|
+
{lines.map((line, i) => (
|
|
68
|
+
<div key={i} className={mx('flex h-[24px] items-center')}>
|
|
69
|
+
<span className='truncate'>{line}</span>
|
|
70
|
+
</div>
|
|
71
|
+
))}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { faker } from '@dxos/random';
|
|
11
|
+
import { withLayout, withTheme, withSignals } from '@dxos/storybook-utils';
|
|
12
|
+
|
|
13
|
+
import { Tabs } from './Tabbed';
|
|
14
|
+
import { ToggleContainer } from './ToggleContainer';
|
|
15
|
+
|
|
16
|
+
const content = Array.from({ length: 4 }, (_, i) => ({
|
|
17
|
+
title: faker.lorem.paragraph(),
|
|
18
|
+
content: faker.lorem.paragraphs(3),
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
const meta: Meta<typeof Tabs> = {
|
|
22
|
+
title: 'plugins/plugin-automation/Tabbed',
|
|
23
|
+
component: Tabs,
|
|
24
|
+
decorators: [withSignals, withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
|
|
29
|
+
type Story = StoryObj<typeof Tabs>;
|
|
30
|
+
|
|
31
|
+
export const Default: Story = {
|
|
32
|
+
render: () => {
|
|
33
|
+
const [selected, setSelected] = useState(0);
|
|
34
|
+
return (
|
|
35
|
+
<div className='flex flex-col w-[500px] p-4 bg-attention'>
|
|
36
|
+
<ToggleContainer
|
|
37
|
+
open
|
|
38
|
+
title={content[selected].title}
|
|
39
|
+
classNames='p-1 rounded-lg bg-baseSurface border border-neutral-500'
|
|
40
|
+
>
|
|
41
|
+
<div className='flex w-full overflow-hidden'>
|
|
42
|
+
<Tabs length={content.length} selected={selected} onSelect={setSelected} />
|
|
43
|
+
<div className='flex-1 pis-2 pie-2 overflow-y-auto'>
|
|
44
|
+
<div>{content[selected].content}</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</ToggleContainer>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
};
|