@dxos/plugin-automation 0.7.5-labs.5f04cf6 → 0.7.5-labs.8a82073
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-CL2TWZT5.mjs +8 -0
- package/dist/lib/browser/AutomationPanel-CL2TWZT5.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-EJ3IWL7Y.mjs +12 -0
- package/dist/lib/browser/ChatContainer-EJ3IWL7Y.mjs.map +7 -0
- package/dist/lib/browser/{ai-client-6CRYUC6D.mjs → ai-client-UJLNYP7B.mjs} +4 -4
- package/dist/lib/browser/{ai-client-6CRYUC6D.mjs.map → ai-client-UJLNYP7B.mjs.map} +3 -3
- package/dist/lib/browser/{app-graph-builder-IJTTULDP.mjs → app-graph-builder-3H5TCRG4.mjs} +33 -2
- package/dist/lib/browser/{app-graph-builder-IJTTULDP.mjs.map → app-graph-builder-3H5TCRG4.mjs.map} +3 -3
- package/dist/lib/browser/chunk-43WRHV2L.mjs +150 -0
- package/dist/lib/browser/chunk-43WRHV2L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EKJVAFT2.mjs → chunk-4M74P6YW.mjs} +66 -8
- package/dist/lib/browser/{chunk-EKJVAFT2.mjs.map → chunk-4M74P6YW.mjs.map} +4 -4
- package/dist/lib/browser/chunk-6KJRL5KV.mjs +243 -0
- package/dist/lib/browser/chunk-6KJRL5KV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HZ4TA7HY.mjs → chunk-BQHXJZ4K.mjs} +2 -2
- package/dist/lib/browser/{chunk-HKX3D3ZP.mjs → chunk-DQ7ZSYJJ.mjs} +2 -2
- package/dist/lib/browser/{chunk-HKX3D3ZP.mjs.map → chunk-DQ7ZSYJJ.mjs.map} +2 -2
- package/dist/lib/browser/chunk-N4SSCQ7P.mjs +1602 -0
- package/dist/lib/browser/chunk-N4SSCQ7P.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +52 -45
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/intent-resolver-5YVZJFS3.mjs +29 -0
- package/dist/lib/browser/intent-resolver-5YVZJFS3.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-IGMBLSV7.mjs → react-surface-RRTZFTKR.mjs} +24 -23
- package/dist/lib/browser/react-surface-RRTZFTKR.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -4
- package/dist/lib/node/AutomationPanel-BCEY3YXO.cjs +26 -0
- package/dist/lib/node/AutomationPanel-BCEY3YXO.cjs.map +7 -0
- package/dist/lib/node/ChatContainer-QUWFEBTI.cjs +33 -0
- package/dist/lib/node/ChatContainer-QUWFEBTI.cjs.map +7 -0
- package/dist/lib/node/{ai-client-A3RRU55B.cjs → ai-client-AOB6TLNW.cjs} +8 -8
- package/dist/lib/node/{ai-client-A3RRU55B.cjs.map → ai-client-AOB6TLNW.cjs.map} +3 -3
- package/dist/lib/node/{app-graph-builder-MF5M4QRS.cjs → app-graph-builder-CDEQJEHY.cjs} +43 -12
- package/dist/lib/node/{app-graph-builder-MF5M4QRS.cjs.map → app-graph-builder-CDEQJEHY.cjs.map} +3 -3
- package/dist/lib/node/{chunk-ZS5RZ7RM.cjs → chunk-AWZVJZ2I.cjs} +6 -6
- package/dist/lib/node/chunk-DKGNORZK.cjs +1586 -0
- package/dist/lib/node/chunk-DKGNORZK.cjs.map +7 -0
- package/dist/lib/node/{chunk-BUQOZA4N.cjs → chunk-H3RSMGJG.cjs} +87 -11
- package/dist/lib/node/chunk-H3RSMGJG.cjs.map +7 -0
- package/dist/lib/node/{AutomationPanel-RXJDVLCF.cjs → chunk-IPCNJYQL.cjs} +123 -9
- package/dist/lib/node/chunk-IPCNJYQL.cjs.map +7 -0
- package/dist/lib/node/{chunk-VEGLN4YN.cjs → chunk-LC6KNDPQ.cjs} +78 -26
- package/dist/lib/node/chunk-LC6KNDPQ.cjs.map +7 -0
- package/dist/lib/node/{chunk-5VF5JKUN.cjs → chunk-TQEDPRY5.cjs} +5 -5
- package/dist/lib/node/{chunk-5VF5JKUN.cjs.map → chunk-TQEDPRY5.cjs.map} +2 -2
- package/dist/lib/node/index.cjs +96 -88
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-TBHYXBDI.cjs → intent-resolver-MJFZT5IU.cjs} +20 -15
- package/dist/lib/node/intent-resolver-MJFZT5IU.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-BVUZMKYS.cjs → react-surface-BVZ63QP4.cjs} +25 -24
- package/dist/lib/node/react-surface-BVZ63QP4.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-YTIZ74RI.mjs +9 -0
- package/dist/lib/node-esm/AutomationPanel-YTIZ74RI.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-QSMDZRDU.mjs +13 -0
- package/dist/lib/node-esm/ChatContainer-QSMDZRDU.mjs.map +7 -0
- package/dist/lib/node-esm/{ai-client-2GBZRHBA.mjs → ai-client-RUCCJ7JZ.mjs} +4 -4
- package/dist/lib/node-esm/{ai-client-2GBZRHBA.mjs.map → ai-client-RUCCJ7JZ.mjs.map} +3 -3
- package/dist/lib/node-esm/{app-graph-builder-5N7OK23B.mjs → app-graph-builder-GR3URVNX.mjs} +33 -2
- package/dist/lib/node-esm/{app-graph-builder-5N7OK23B.mjs.map → app-graph-builder-GR3URVNX.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-7JO77AAS.mjs +151 -0
- package/dist/lib/node-esm/chunk-7JO77AAS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5QUXIXNB.mjs → chunk-CQPQXIJP.mjs} +66 -8
- package/dist/lib/node-esm/{chunk-5QUXIXNB.mjs.map → chunk-CQPQXIJP.mjs.map} +4 -4
- package/dist/lib/node-esm/chunk-CZXU4CFK.mjs +244 -0
- package/dist/lib/node-esm/chunk-CZXU4CFK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-D7RARVTS.mjs +1603 -0
- package/dist/lib/node-esm/chunk-D7RARVTS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-X3LPRWIL.mjs → chunk-JFHI22MF.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-X3LPRWIL.mjs.map → chunk-JFHI22MF.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-ISYLEDVU.mjs → chunk-LSSWQIQD.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +52 -45
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/intent-resolver-FCKNRTKQ.mjs +30 -0
- package/dist/lib/node-esm/intent-resolver-FCKNRTKQ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-77S6XJOM.mjs → react-surface-Y5LQHUQN.mjs} +24 -23
- package/dist/lib/node-esm/react-surface-Y5LQHUQN.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 +22 -22
- 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/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 +5 -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.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 +31 -2
- package/src/capabilities/intent-resolver.ts +14 -9
- package/src/capabilities/react-surface.tsx +14 -12
- 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 +4 -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 +2 -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/chunk-C3VRGDR6.mjs +0 -75
- package/dist/lib/browser/chunk-C3VRGDR6.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/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.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/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/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-BQHXJZ4K.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-ZS5RZ7RM.cjs.map → chunk-AWZVJZ2I.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-ISYLEDVU.mjs.map → chunk-LSSWQIQD.mjs.map} +0 -0
- /package/src/testing/{testing.ts → test-functions.ts} +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { computed, type ReadonlySignal, signal } from '@preact/signals-core';
|
|
8
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
9
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
10
|
+
|
|
11
|
+
import { faker } from '@dxos/random';
|
|
12
|
+
import { Icon, Input, Toolbar } from '@dxos/react-ui';
|
|
13
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
14
|
+
import { withLayout, withTheme, withSignals } from '@dxos/storybook-utils';
|
|
15
|
+
|
|
16
|
+
import { ToggleContainer, type ToggleContainerProps } from './ToggleContainer';
|
|
17
|
+
import { MarkdownViewer } from '../MarkdownViewer';
|
|
18
|
+
|
|
19
|
+
class Generator {
|
|
20
|
+
private readonly _current = signal<string>(faker.lorem.sentence(5));
|
|
21
|
+
private readonly _lines = signal<string[]>([]);
|
|
22
|
+
private _running: NodeJS.Timeout | undefined;
|
|
23
|
+
|
|
24
|
+
readonly count = computed(() => this._lines.value.length);
|
|
25
|
+
readonly text: ReadonlySignal<string[]> = computed(() => [...this._lines.value, this._current.value]);
|
|
26
|
+
|
|
27
|
+
start() {
|
|
28
|
+
this.stop();
|
|
29
|
+
this._running = setInterval(() => {
|
|
30
|
+
if (this._current.value.length > 0) {
|
|
31
|
+
this._current.value += ' ';
|
|
32
|
+
}
|
|
33
|
+
this._current.value += faker.lorem.words(Math.ceil(Math.random() * 2));
|
|
34
|
+
if (Math.random() > 0.95) {
|
|
35
|
+
this._lines.value = [...this._lines.value, this._current.value + '.'];
|
|
36
|
+
this._current.value = '';
|
|
37
|
+
}
|
|
38
|
+
}, 100);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
stop() {
|
|
42
|
+
if (this._running) {
|
|
43
|
+
clearInterval(this._running);
|
|
44
|
+
this._running = undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const Render = ({ shrinkX, ...props }: ToggleContainerProps) => {
|
|
50
|
+
const generator = useMemo(() => new Generator(), []);
|
|
51
|
+
const [running, setRunning] = useState(false);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (running) {
|
|
54
|
+
generator.start();
|
|
55
|
+
} else {
|
|
56
|
+
generator.stop();
|
|
57
|
+
}
|
|
58
|
+
}, [running]);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className='flex flex-col w-[500px]'>
|
|
62
|
+
<Toolbar.Root classNames='p-4'>
|
|
63
|
+
<Input.Root>
|
|
64
|
+
<Input.Switch checked={running} onCheckedChange={(checked) => setRunning(checked)} />
|
|
65
|
+
</Input.Root>
|
|
66
|
+
<div className='grow' />
|
|
67
|
+
<div>{generator.count.value}</div>
|
|
68
|
+
</Toolbar.Root>
|
|
69
|
+
<div className='flex p-4'>
|
|
70
|
+
<div className={mx('border border-border rounded-md p-2', !shrinkX && 'w-full')}>
|
|
71
|
+
<ToggleContainer
|
|
72
|
+
{...props}
|
|
73
|
+
shrinkX={shrinkX}
|
|
74
|
+
icon={
|
|
75
|
+
running ? (
|
|
76
|
+
<Icon icon={'ph--circle-notch--regular'} classNames='text-subdued ml-2 animate-spin' size={4} />
|
|
77
|
+
) : undefined
|
|
78
|
+
}
|
|
79
|
+
>
|
|
80
|
+
<MarkdownViewer classNames='text-sm' content={generator.text.value.join('\n\n')} />
|
|
81
|
+
</ToggleContainer>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const meta: Meta<typeof ToggleContainer> = {
|
|
89
|
+
title: 'plugins/plugin-automation/ToggleContainer',
|
|
90
|
+
component: ToggleContainer,
|
|
91
|
+
render: Render,
|
|
92
|
+
decorators: [withSignals, withTheme, withLayout({ fullscreen: true, classNames: 'justify-center bg-baseSurface' })],
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default meta;
|
|
96
|
+
|
|
97
|
+
type Story = StoryObj<typeof ToggleContainer>;
|
|
98
|
+
|
|
99
|
+
export const Default: Story = {
|
|
100
|
+
args: {
|
|
101
|
+
title: 'Markdown',
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const Shrink: Story = {
|
|
106
|
+
args: {
|
|
107
|
+
title: 'Markdown',
|
|
108
|
+
shrinkX: true,
|
|
109
|
+
},
|
|
110
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type JSX, type PropsWithChildren, useEffect, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Icon, useControlledState, type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
9
|
+
|
|
10
|
+
export type ToggleContainerProps = ThemedClassName<
|
|
11
|
+
PropsWithChildren<{
|
|
12
|
+
title?: string | JSX.Element;
|
|
13
|
+
icon?: JSX.Element;
|
|
14
|
+
open?: boolean;
|
|
15
|
+
duration?: number;
|
|
16
|
+
/** Should shrink the width when closed. */
|
|
17
|
+
shrinkX?: boolean;
|
|
18
|
+
onChangeOpen?: (open: boolean) => void;
|
|
19
|
+
}>
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export const ToggleContainer = ({
|
|
23
|
+
classNames,
|
|
24
|
+
title,
|
|
25
|
+
icon,
|
|
26
|
+
open: _open,
|
|
27
|
+
duration = 400,
|
|
28
|
+
shrinkX = false,
|
|
29
|
+
children,
|
|
30
|
+
onChangeOpen,
|
|
31
|
+
}: ToggleContainerProps) => {
|
|
32
|
+
const [open, setOpen] = useControlledState(_open);
|
|
33
|
+
const [expandX, setExpandX] = useState(shrinkX ? open : true);
|
|
34
|
+
const [expandY, setExpandY] = useState(open);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
let t: NodeJS.Timeout;
|
|
38
|
+
if (open) {
|
|
39
|
+
if (shrinkX) {
|
|
40
|
+
setExpandX(true);
|
|
41
|
+
}
|
|
42
|
+
t = setTimeout(
|
|
43
|
+
() => {
|
|
44
|
+
setExpandY(true);
|
|
45
|
+
},
|
|
46
|
+
shrinkX ? duration : 0,
|
|
47
|
+
);
|
|
48
|
+
} else {
|
|
49
|
+
setExpandY(false);
|
|
50
|
+
if (shrinkX) {
|
|
51
|
+
t = setTimeout(() => {
|
|
52
|
+
setExpandX(false);
|
|
53
|
+
}, duration);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return () => clearTimeout(t);
|
|
58
|
+
}, [open]);
|
|
59
|
+
|
|
60
|
+
const handleToggle = () => {
|
|
61
|
+
if (onChangeOpen) {
|
|
62
|
+
onChangeOpen(!open);
|
|
63
|
+
} else {
|
|
64
|
+
setOpen((open) => !open);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div className={mx('overflow-hidden', classNames)}>
|
|
70
|
+
{title && (
|
|
71
|
+
<div
|
|
72
|
+
className='flex gap-1 py-1 items-center text-sm text-subdued cursor-pointer select-none'
|
|
73
|
+
onClick={handleToggle}
|
|
74
|
+
>
|
|
75
|
+
<div className='flex w-[24px] h-[24px] items-center justify-center'>
|
|
76
|
+
<Icon
|
|
77
|
+
size={4}
|
|
78
|
+
icon={'ph--caret-right--regular'}
|
|
79
|
+
style={{ transitionDuration: `${shrinkX ? duration * 2 : duration}ms` }}
|
|
80
|
+
classNames={['transition transition-transform ease-in-out', open ? 'rotate-90' : 'transform-none']}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<div className='flex-1 pis-1 pie-1 truncate'>{title}</div>
|
|
84
|
+
{icon}
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
<div
|
|
88
|
+
style={{ transitionDuration: `${duration}ms` }}
|
|
89
|
+
className={mx(
|
|
90
|
+
'grid transition-[grid-template-columns] ease-in-out',
|
|
91
|
+
expandX ? 'grid-cols-[1fr]' : 'grid-cols-[0fr]',
|
|
92
|
+
)}
|
|
93
|
+
>
|
|
94
|
+
<div className='overflow-hidden'>
|
|
95
|
+
<div
|
|
96
|
+
style={{ transitionDuration: `${duration}ms` }}
|
|
97
|
+
className={mx(
|
|
98
|
+
'grid transition-[grid-template-rows] ease-in-out',
|
|
99
|
+
expandY ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]',
|
|
100
|
+
)}
|
|
101
|
+
>
|
|
102
|
+
<div className={mx('flex overflow-hidden transition-opacity')}>{children}</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
import { invariant } from '@dxos/invariant';
|
|
8
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
+
|
|
10
|
+
import { useChatProcessor, useMessageQueue } from '../../hooks';
|
|
11
|
+
import { type AIChatType } from '../../types';
|
|
12
|
+
import { Thread } from '../Thread';
|
|
13
|
+
|
|
14
|
+
export const ChatContainer = ({ chat, role }: { chat: AIChatType; role: string }) => {
|
|
15
|
+
const processor = useChatProcessor(chat);
|
|
16
|
+
const messageQueue = useMessageQueue(chat);
|
|
17
|
+
const messages = [...(messageQueue?.items ?? []), ...processor.messages.value];
|
|
18
|
+
|
|
19
|
+
const handleSubmit = useCallback(
|
|
20
|
+
async (text: string) => {
|
|
21
|
+
if (processor.streaming.value) {
|
|
22
|
+
await processor.cancel();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
invariant(messageQueue);
|
|
26
|
+
await processor.request(text, {
|
|
27
|
+
history: messageQueue.items,
|
|
28
|
+
onComplete: (messages) => messageQueue.append(messages),
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
[processor, messageQueue],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const handleStop = useCallback(() => {
|
|
35
|
+
if (processor.streaming.value) {
|
|
36
|
+
void processor.cancel();
|
|
37
|
+
}
|
|
38
|
+
}, [processor]);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<StackItem.Content toolbar={false} role={role}>
|
|
42
|
+
<Thread
|
|
43
|
+
messages={messages}
|
|
44
|
+
streaming={processor.streaming.value}
|
|
45
|
+
collapse={true}
|
|
46
|
+
onSubmit={handleSubmit}
|
|
47
|
+
onSuggest={handleSubmit}
|
|
48
|
+
onStop={handleStop}
|
|
49
|
+
/>
|
|
50
|
+
</StackItem.Content>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
|
|
9
|
+
import { faker } from '@dxos/random';
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
11
|
+
|
|
12
|
+
import { MarkdownViewer } from './MarkdownViewer';
|
|
13
|
+
|
|
14
|
+
faker.seed(0);
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof MarkdownViewer> = {
|
|
17
|
+
title: 'plugins/plugin-automation/MarkdownViewer',
|
|
18
|
+
component: MarkdownViewer,
|
|
19
|
+
decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
type Story = StoryObj<typeof MarkdownViewer>;
|
|
25
|
+
|
|
26
|
+
const content = `
|
|
27
|
+
# Hello, world!
|
|
28
|
+
|
|
29
|
+
${faker.lorem.paragraphs(1)}
|
|
30
|
+
|
|
31
|
+
Here's a JSON block:
|
|
32
|
+
|
|
33
|
+
~~~json
|
|
34
|
+
{
|
|
35
|
+
"hello": "world"
|
|
36
|
+
}
|
|
37
|
+
~~~
|
|
38
|
+
|
|
39
|
+
And some code:
|
|
40
|
+
|
|
41
|
+
~~~ts
|
|
42
|
+
const App = () => {
|
|
43
|
+
const title = 'Hello, world!';
|
|
44
|
+
return <div>{title}</div>;
|
|
45
|
+
};
|
|
46
|
+
~~~
|
|
47
|
+
|
|
48
|
+
${faker.lorem.paragraphs(1)}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export const Default: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
classNames: 'w-[500px] border border-border rounded-md p-4',
|
|
54
|
+
content,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type FC } from 'react';
|
|
6
|
+
import ReactMarkdown from 'react-markdown';
|
|
7
|
+
|
|
8
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
9
|
+
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
10
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
11
|
+
import { omit } from '@dxos/util';
|
|
12
|
+
|
|
13
|
+
type MarkdownViewerProps = ThemedClassName<{
|
|
14
|
+
content?: string;
|
|
15
|
+
}>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Transform text into react elements.
|
|
19
|
+
*
|
|
20
|
+
* https://github.com/remarkjs/react-markdown
|
|
21
|
+
* markdown -> remark -> [mdast -> remark plugins] -> [hast -> rehype plugins] -> components -> react elements.
|
|
22
|
+
*/
|
|
23
|
+
// TODO(burdon): Styles.
|
|
24
|
+
// TODO(burdon): Factor out (react-ui-syntax-highlighter).
|
|
25
|
+
export const MarkdownViewer: FC<MarkdownViewerProps> = ({ classNames, content = '' }) => {
|
|
26
|
+
return (
|
|
27
|
+
<div className={mx('space-y-2', classNames)}>
|
|
28
|
+
<ReactMarkdown
|
|
29
|
+
components={{
|
|
30
|
+
a: ({ node, children, href, ...props }) => (
|
|
31
|
+
<a
|
|
32
|
+
href={href}
|
|
33
|
+
className='text-primary-500 hover:text-primary-500'
|
|
34
|
+
target='_blank'
|
|
35
|
+
rel='noopener noreferrer'
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</a>
|
|
40
|
+
),
|
|
41
|
+
ol: ({ node, children, ...props }) => (
|
|
42
|
+
<ol className='leading-tight list-decimal pl-6' {...omit(props, ['ordered'])}>
|
|
43
|
+
{children}
|
|
44
|
+
</ol>
|
|
45
|
+
),
|
|
46
|
+
ul: ({ node, children, ...props }) => (
|
|
47
|
+
<ul className='leading-tight list-disc pl-6' {...omit(props, ['ordered'])}>
|
|
48
|
+
{children}
|
|
49
|
+
</ul>
|
|
50
|
+
),
|
|
51
|
+
li: ({ node, children, ...props }) => (
|
|
52
|
+
<li className='' {...omit(props, ['ordered'])}>
|
|
53
|
+
{children}
|
|
54
|
+
</li>
|
|
55
|
+
),
|
|
56
|
+
blockquote: ({ node, children, ...props }) => (
|
|
57
|
+
<blockquote className='border-l-4 border-primary-500 pl-4 my-4 text-primary-500' {...props}>
|
|
58
|
+
{children}
|
|
59
|
+
</blockquote>
|
|
60
|
+
),
|
|
61
|
+
code: ({ children, className }) => {
|
|
62
|
+
const [_, language] = /language-(\w+)/.exec(className || '') || [];
|
|
63
|
+
return (
|
|
64
|
+
<SyntaxHighlighter PreTag='div' language={language} className='p-0'>
|
|
65
|
+
{children}
|
|
66
|
+
</SyntaxHighlighter>
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
{content}
|
|
72
|
+
</ReactMarkdown>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// const Cursor = () => {
|
|
78
|
+
// return <span className='animate-[pulse_1s_steps(1)_infinite] text-primary-500'>▊</span>;
|
|
79
|
+
// };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
|
|
9
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
10
|
+
|
|
11
|
+
import { Prompt } from './Prompt';
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Prompt> = {
|
|
14
|
+
title: 'plugins/plugin-automation/Prompt',
|
|
15
|
+
component: Prompt,
|
|
16
|
+
decorators: [withTheme],
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: 'centered',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
type Story = StoryObj<typeof Prompt>;
|
|
25
|
+
|
|
26
|
+
export const Default: Story = {
|
|
27
|
+
args: {
|
|
28
|
+
classNames: 'w-96 p-4 rounded outline outline-gray-200',
|
|
29
|
+
autoFocus: true,
|
|
30
|
+
onEnter: (text) => {
|
|
31
|
+
console.log('onEnter', text);
|
|
32
|
+
},
|
|
33
|
+
onSuggest: (text) => {
|
|
34
|
+
const trimmed = text.trim().toLowerCase();
|
|
35
|
+
if (trimmed.length < 2) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const suggestions = [
|
|
40
|
+
'Create a CRM',
|
|
41
|
+
'Create a new project',
|
|
42
|
+
'Find flights to Tokyo',
|
|
43
|
+
"Let's play chess",
|
|
44
|
+
'Show me Paris on a map',
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
return suggestions.filter((s) => s.toLowerCase().startsWith(text));
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
8
|
+
import {
|
|
9
|
+
createBasicExtensions,
|
|
10
|
+
createThemeExtensions,
|
|
11
|
+
useTextEditor,
|
|
12
|
+
type UseTextEditorProps,
|
|
13
|
+
} from '@dxos/react-ui-editor';
|
|
14
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
15
|
+
|
|
16
|
+
import { createAutocompleteExtension, type AutocompleteOptions } from './prompt-autocomplete';
|
|
17
|
+
|
|
18
|
+
export type PromptProps = ThemedClassName<AutocompleteOptions & Pick<UseTextEditorProps, 'autoFocus'>>;
|
|
19
|
+
|
|
20
|
+
export const Prompt = ({ classNames, autoFocus, onEnter, onSuggest }: PromptProps) => {
|
|
21
|
+
const { themeMode } = useThemeContext();
|
|
22
|
+
const { parentRef } = useTextEditor({
|
|
23
|
+
autoFocus,
|
|
24
|
+
extensions: [
|
|
25
|
+
createBasicExtensions({
|
|
26
|
+
bracketMatching: false,
|
|
27
|
+
lineWrapping: false,
|
|
28
|
+
placeholder: 'Ask a question...',
|
|
29
|
+
}),
|
|
30
|
+
createThemeExtensions({ themeMode }),
|
|
31
|
+
createAutocompleteExtension({ onEnter, onSuggest }),
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return <div ref={parentRef} className={mx(classNames)} />;
|
|
36
|
+
};
|