@dxos/plugin-automation 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8
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/AssistantDialog-V67OWLRP.mjs +116 -0
- package/dist/lib/browser/AssistantDialog-V67OWLRP.mjs.map +7 -0
- package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs +8 -0
- package/dist/lib/browser/ChatContainer-5BS6THNV.mjs +33 -0
- package/dist/lib/browser/ChatContainer-5BS6THNV.mjs.map +7 -0
- package/dist/lib/browser/TemplateContainer-HJJV44CE.mjs +23 -0
- package/dist/lib/browser/TemplateContainer-HJJV44CE.mjs.map +7 -0
- package/dist/lib/browser/ai-client-T2PBJISL.mjs +22 -0
- package/dist/lib/browser/ai-client-T2PBJISL.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-IR3CGVM6.mjs +110 -0
- package/dist/lib/browser/app-graph-builder-IR3CGVM6.mjs.map +7 -0
- package/dist/lib/browser/chunk-62E2AEXF.mjs +162 -0
- package/dist/lib/browser/chunk-62E2AEXF.mjs.map +7 -0
- package/dist/lib/browser/chunk-67KDIIM6.mjs +15 -0
- package/dist/lib/browser/chunk-67KDIIM6.mjs.map +7 -0
- package/dist/lib/browser/chunk-BQ4WHY4D.mjs +1818 -0
- package/dist/lib/browser/chunk-BQ4WHY4D.mjs.map +7 -0
- package/dist/lib/browser/{chunk-X5KMOH3I.mjs → chunk-HZSTXZWK.mjs} +6 -4
- package/dist/lib/browser/chunk-HZSTXZWK.mjs.map +7 -0
- package/dist/lib/browser/chunk-LJ7F4KDM.mjs +243 -0
- package/dist/lib/browser/chunk-LJ7F4KDM.mjs.map +7 -0
- package/dist/lib/browser/chunk-QH5E22EL.mjs +108 -0
- package/dist/lib/browser/chunk-QH5E22EL.mjs.map +7 -0
- package/dist/lib/browser/chunk-XAIWETH6.mjs +81 -0
- package/dist/lib/browser/chunk-XAIWETH6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +210 -467
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-ICLE6FSI.mjs +44 -0
- package/dist/lib/browser/intent-resolver-ICLE6FSI.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-KEKVLCPQ.mjs +80 -0
- package/dist/lib/browser/react-surface-KEKVLCPQ.mjs.map +7 -0
- package/dist/lib/browser/settings-FE5DDWOE.mjs +22 -0
- package/dist/lib/browser/settings-FE5DDWOE.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +18 -9
- package/dist/lib/node/AssistantDialog-E62O72KI.cjs +140 -0
- package/dist/lib/node/AssistantDialog-E62O72KI.cjs.map +7 -0
- package/dist/lib/node/{meta.cjs → AutomationPanel-6COLKRIB.cjs} +7 -11
- package/dist/lib/node/AutomationPanel-6COLKRIB.cjs.map +7 -0
- package/dist/lib/node/ChatContainer-4QTLL7TH.cjs +61 -0
- package/dist/lib/node/ChatContainer-4QTLL7TH.cjs.map +7 -0
- package/dist/lib/node/TemplateContainer-3YCM6XPU.cjs +53 -0
- package/dist/lib/node/TemplateContainer-3YCM6XPU.cjs.map +7 -0
- package/dist/lib/node/ai-client-L5GUSAER.cjs +38 -0
- package/dist/lib/node/ai-client-L5GUSAER.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-ECNVGTRT.cjs +122 -0
- package/dist/lib/node/app-graph-builder-ECNVGTRT.cjs.map +7 -0
- package/dist/lib/node/chunk-3QSK6IPK.cjs +133 -0
- package/dist/lib/node/chunk-3QSK6IPK.cjs.map +7 -0
- package/dist/lib/node/chunk-76F5BCJE.cjs +111 -0
- package/dist/lib/node/chunk-76F5BCJE.cjs.map +7 -0
- package/dist/lib/node/chunk-B37JIAOP.cjs +1795 -0
- package/dist/lib/node/chunk-B37JIAOP.cjs.map +7 -0
- package/dist/lib/node/{chunk-DTJ7XVO2.cjs → chunk-BAQRBGOJ.cjs} +11 -8
- package/dist/lib/node/chunk-BAQRBGOJ.cjs.map +7 -0
- package/dist/lib/node/chunk-UVWK2XJE.cjs +183 -0
- package/dist/lib/node/chunk-UVWK2XJE.cjs.map +7 -0
- package/dist/lib/node/chunk-V4L7LTWM.cjs +267 -0
- package/dist/lib/node/chunk-V4L7LTWM.cjs.map +7 -0
- package/dist/lib/node/chunk-VNBYGJ4K.cjs +34 -0
- package/dist/lib/node/chunk-VNBYGJ4K.cjs.map +7 -0
- package/dist/lib/node/index.cjs +201 -473
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/intent-resolver-4MQZULXW.cjs +58 -0
- package/dist/lib/node/intent-resolver-4MQZULXW.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-4RVHY6WI.cjs +95 -0
- package/dist/lib/node/react-surface-4RVHY6WI.cjs.map +7 -0
- package/dist/lib/node/settings-GOIB2WJQ.cjs +36 -0
- package/dist/lib/node/settings-GOIB2WJQ.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +19 -10
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/AssistantDialog-IPRBJKWA.mjs +117 -0
- package/dist/lib/node-esm/AssistantDialog-IPRBJKWA.mjs.map +7 -0
- package/dist/lib/node-esm/AutomationPanel-3MPIAO7R.mjs +9 -0
- package/dist/lib/node-esm/ChatContainer-4IWUGMGM.mjs +34 -0
- package/dist/lib/node-esm/ChatContainer-4IWUGMGM.mjs.map +7 -0
- package/dist/lib/node-esm/TemplateContainer-YJIXR24Z.mjs +24 -0
- package/dist/lib/node-esm/TemplateContainer-YJIXR24Z.mjs.map +7 -0
- package/dist/lib/node-esm/ai-client-45LZLW7V.mjs +23 -0
- package/dist/lib/node-esm/ai-client-45LZLW7V.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-HMRKSZ2X.mjs +111 -0
- package/dist/lib/node-esm/app-graph-builder-HMRKSZ2X.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5BKKHYO5.mjs +163 -0
- package/dist/lib/node-esm/chunk-5BKKHYO5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AWAU4BHR.mjs +244 -0
- package/dist/lib/node-esm/chunk-AWAU4BHR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CAWPHOY4.mjs +82 -0
- package/dist/lib/node-esm/chunk-CAWPHOY4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-I32H7MCF.mjs +109 -0
- package/dist/lib/node-esm/chunk-I32H7MCF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HNOBZHWK.mjs → chunk-IG4GSWZN.mjs} +6 -4
- package/dist/lib/node-esm/chunk-IG4GSWZN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QHKP5HT2.mjs +1819 -0
- package/dist/lib/node-esm/chunk-QHKP5HT2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SS7U6GCX.mjs +16 -0
- package/dist/lib/node-esm/chunk-SS7U6GCX.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +210 -467
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-ZS7XTYLG.mjs +45 -0
- package/dist/lib/node-esm/intent-resolver-ZS7XTYLG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-5ILD642V.mjs +81 -0
- package/dist/lib/node-esm/react-surface-5ILD642V.mjs.map +7 -0
- package/dist/lib/node-esm/settings-ANNQPPRY.mjs +23 -0
- package/dist/lib/node-esm/settings-ANNQPPRY.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +18 -9
- package/dist/types/src/AutomationPlugin.d.ts +1 -3
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-client.d.ts +5 -0
- package/dist/types/src/capabilities/ai-client.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +5 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +183 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +4 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +7 -0
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +1 -0
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +8 -0
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/AmbientDialog/index.d.ts +2 -0
- package/dist/types/src/components/AmbientDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/AssistantDialog.d.ts +7 -0
- package/dist/types/src/components/AssistantDialog.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -2
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationSettings/AutomationSettings.d.ts +5 -0
- package/dist/types/src/components/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/components/AutomationSettings/index.d.ts +2 -0
- package/dist/types/src/components/AutomationSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +7 -0
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/Prompt.d.ts +17 -0
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +9 -0
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/PromptBar.d.ts +10 -0
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/autocomplete.d.ts +21 -0
- package/dist/types/src/components/Prompt/autocomplete.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/index.d.ts +3 -0
- package/dist/types/src/components/Prompt/index.d.ts.map +1 -0
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +5 -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/TemplateContainer.d.ts +7 -0
- package/dist/types/src/components/TemplateContainer.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +10 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +8 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/index.d.ts +2 -0
- package/dist/types/src/components/TemplateEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/TemplateEditor/types.d.ts.map +1 -0
- package/dist/types/src/components/Thread/Thread.d.ts +17 -0
- package/dist/types/src/components/Thread/Thread.d.ts.map +1 -0
- package/dist/types/src/components/Thread/Thread.stories.d.ts +11 -0
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +10 -0
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +15 -0
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +13 -0
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -0
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +13 -0
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +1 -0
- package/dist/types/src/components/Thread/index.d.ts +3 -0
- package/dist/types/src/components/Thread/index.d.ts.map +1 -0
- package/dist/types/src/components/Thread/reducer.d.ts +12 -0
- package/dist/types/src/components/Thread/reducer.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +19 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +8 -0
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/index.d.ts +2 -0
- package/dist/types/src/components/Toolbox/index.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -3
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +19 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +5 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/processor.d.ts +75 -0
- package/dist/types/src/hooks/processor.d.ts.map +1 -0
- package/dist/types/src/hooks/processor.test.d.ts +2 -0
- package/dist/types/src/hooks/processor.test.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -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/hooks/useTextInputEvents.d.ts +13 -0
- package/dist/types/src/hooks/useTextInputEvents.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- 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} +3 -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 +117 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/chat.d.ts +12 -0
- package/dist/types/src/types/chat.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +160 -0
- package/dist/types/src/types/service.d.ts.map +1 -0
- package/dist/types/src/types/template.d.ts +40 -0
- package/dist/types/src/types/template.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +35 -5
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +62 -48
- package/src/AutomationPlugin.tsx +102 -193
- package/src/capabilities/ai-client.ts +19 -0
- package/src/capabilities/app-graph-builder.ts +99 -0
- package/src/capabilities/capabilities.ts +12 -0
- package/src/capabilities/index.ts +13 -0
- package/src/capabilities/intent-resolver.ts +38 -0
- package/src/capabilities/react-surface.tsx +63 -0
- package/src/capabilities/settings.ts +19 -0
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +81 -0
- package/src/components/AmbientDialog/AmbientDialog.tsx +103 -0
- package/src/components/AmbientDialog/index.ts +5 -0
- package/src/components/AssistantDialog.tsx +33 -0
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +2 -2
- package/src/components/AutomationPanel/AutomationPanel.tsx +54 -37
- package/src/components/AutomationSettings/AutomationSettings.tsx +49 -0
- package/src/components/AutomationSettings/index.ts +5 -0
- package/src/components/ChatContainer.tsx +29 -0
- package/src/components/Prompt/Prompt.stories.tsx +79 -0
- package/src/components/Prompt/Prompt.tsx +100 -0
- package/src/components/Prompt/PromptBar.tsx +100 -0
- package/src/components/Prompt/autocomplete.ts +212 -0
- package/src/components/Prompt/index.ts +6 -0
- package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +49 -0
- package/src/components/ServiceRegistry/ServiceRegistry.tsx +76 -0
- package/src/components/ServiceRegistry/index.ts +5 -0
- package/src/components/TemplateContainer.tsx +21 -0
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +72 -0
- package/src/components/TemplateEditor/TemplateEditor.tsx +76 -0
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +65 -0
- package/src/components/TemplateEditor/TemplateForm.tsx +184 -0
- package/src/components/{PromptEditor → TemplateEditor}/index.ts +1 -1
- package/src/components/Thread/Thread.stories.tsx +212 -0
- package/src/components/Thread/Thread.tsx +97 -0
- package/src/components/Thread/ThreadContainer.stories.tsx +258 -0
- package/src/components/Thread/ThreadContainer.tsx +78 -0
- package/src/components/Thread/ThreadMessage.tsx +187 -0
- package/src/components/Thread/ToolInvocations.tsx +93 -0
- package/src/components/Thread/index.ts +6 -0
- package/src/components/Thread/reducer.ts +52 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +65 -0
- package/src/components/Toolbox/Toolbox.tsx +117 -0
- package/src/components/Toolbox/index.ts +5 -0
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +2 -2
- package/src/components/TriggerEditor/TriggerEditor.tsx +78 -14
- package/src/components/index.ts +11 -1
- package/src/hooks/index.ts +6 -0
- package/src/hooks/processor.test.ts +15 -0
- package/src/hooks/processor.ts +219 -0
- package/src/hooks/useChatProcessor.tsx +77 -0
- package/src/hooks/useMessageQueue.ts +23 -0
- package/src/hooks/useServices.ts +28 -0
- package/src/hooks/useTextInputEvents.ts +49 -0
- package/src/index.ts +3 -6
- package/src/meta.ts +5 -2
- package/src/testing/index.ts +2 -1
- package/src/testing/{testing.ts → test-functions.ts} +9 -2
- 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 +224 -0
- package/src/tools/openapi.ts +331 -0
- package/src/translations.ts +36 -2
- package/src/types/chat.ts +11 -0
- package/src/types/index.ts +3 -1
- package/src/types/service.ts +102 -0
- package/src/types/template.ts +34 -0
- package/src/types/types.ts +34 -20
- package/src/typings.d.ts +9 -0
- package/dist/lib/browser/AssistantPanel-32FH2RA6.mjs +0 -339
- package/dist/lib/browser/AssistantPanel-32FH2RA6.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs +0 -151
- package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs.map +0 -7
- package/dist/lib/browser/chunk-DN5M2QL5.mjs +0 -49
- package/dist/lib/browser/chunk-DN5M2QL5.mjs.map +0 -7
- package/dist/lib/browser/chunk-X5KMOH3I.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/node/AssistantPanel-XANI7YNV.cjs +0 -359
- package/dist/lib/node/AssistantPanel-XANI7YNV.cjs.map +0 -7
- package/dist/lib/node/AutomationPanel-VADY3HMP.cjs +0 -171
- package/dist/lib/node/AutomationPanel-VADY3HMP.cjs.map +0 -7
- package/dist/lib/node/chunk-DTJ7XVO2.cjs.map +0 -7
- package/dist/lib/node/chunk-NIL4TP6U.cjs +0 -73
- package/dist/lib/node/chunk-NIL4TP6U.cjs.map +0 -7
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantPanel-5M6O6JV7.mjs +0 -340
- package/dist/lib/node-esm/AssistantPanel-5M6O6JV7.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs +0 -152
- package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GCHXTXVT.mjs +0 -51
- package/dist/lib/node-esm/chunk-GCHXTXVT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HNOBZHWK.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- 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/PromptEditor/PromptEditor.d.ts +0 -10
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts +0 -6
- package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/index.d.ts +0 -2
- package/dist/types/src/components/PromptEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/prompt-extension.d.ts +0 -4
- package/dist/types/src/components/PromptEditor/prompt-extension.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/types.d.ts.map +0 -1
- package/dist/types/src/presets.d.ts +0 -9
- package/dist/types/src/presets.d.ts.map +0 -1
- package/dist/types/src/testing/testing.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -63
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/components/AssistantPanel/AssistantPanel.tsx +0 -230
- package/src/components/AssistantPanel/index.ts +0 -7
- package/src/components/AssistantPanel/system-instructions.ts +0 -166
- package/src/components/PromptEditor/PromptEditor.stories.tsx +0 -64
- package/src/components/PromptEditor/PromptEditor.tsx +0 -222
- package/src/components/PromptEditor/prompt-extension.ts +0 -43
- package/src/presets.ts +0 -248
- package/src/types/schema.ts +0 -38
- /package/dist/lib/browser/{meta.mjs.map → AutomationPanel-NCKK3CFN.mjs.map} +0 -0
- /package/dist/lib/node-esm/{meta.mjs.map → AutomationPanel-3MPIAO7R.mjs.map} +0 -0
- /package/dist/types/src/components/{PromptEditor → TemplateEditor}/types.d.ts +0 -0
- /package/src/components/{PromptEditor → TemplateEditor}/types.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-automation",
|
|
3
|
-
"version": "0.7.5-main.
|
|
3
|
+
"version": "0.7.5-main.b19bfc8",
|
|
4
4
|
"description": "Prompt chain plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
13
14
|
"browser": "./dist/lib/browser/index.mjs",
|
|
14
15
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
15
16
|
},
|
|
16
|
-
"./meta": {
|
|
17
|
-
"types": "./dist/types/src/meta.d.ts",
|
|
18
|
-
"browser": "./dist/lib/browser/meta.mjs",
|
|
19
|
-
"node": "./dist/lib/node-esm/meta.mjs"
|
|
20
|
-
},
|
|
21
17
|
"./types": {
|
|
22
18
|
"types": "./dist/types/src/types/index.d.ts",
|
|
23
19
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
@@ -27,77 +23,95 @@
|
|
|
27
23
|
"types": "dist/types/src/index.d.ts",
|
|
28
24
|
"typesVersions": {
|
|
29
25
|
"*": {
|
|
30
|
-
"meta": [
|
|
31
|
-
"dist/types/src/meta.d.ts"
|
|
32
|
-
],
|
|
33
26
|
"types": [
|
|
34
27
|
"dist/types/src/types/index.d.ts"
|
|
35
28
|
]
|
|
36
29
|
}
|
|
37
30
|
},
|
|
38
31
|
"files": [
|
|
32
|
+
"assets",
|
|
39
33
|
"dist",
|
|
40
34
|
"src"
|
|
41
35
|
],
|
|
42
36
|
"dependencies": {
|
|
37
|
+
"@codemirror/autocomplete": "^6.18.1",
|
|
43
38
|
"@codemirror/language": "^6.10.3",
|
|
44
39
|
"@codemirror/search": "^6.5.6",
|
|
45
40
|
"@codemirror/state": "^6.4.1",
|
|
46
41
|
"@codemirror/view": "^6.34.1",
|
|
47
42
|
"@effect/schema": "^0.75.5",
|
|
43
|
+
"@lezer/highlight": "^1.2.1",
|
|
48
44
|
"@preact/signals-core": "^1.6.0",
|
|
45
|
+
"@xiechao/codemirror-lang-handlebars": "1.0.4",
|
|
46
|
+
"jsonpointer": "^5.0.1",
|
|
49
47
|
"lodash.get": "^4.4.2",
|
|
50
|
-
"
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/plugin-
|
|
70
|
-
"@dxos/plugin-
|
|
71
|
-
"@dxos/plugin-
|
|
72
|
-
"@dxos/plugin-
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
48
|
+
"unified": "^11.0.0",
|
|
49
|
+
"@dxos/app-framework": "0.7.5-main.b19bfc8",
|
|
50
|
+
"@dxos/assistant": "0.7.5-main.b19bfc8",
|
|
51
|
+
"@dxos/artifact": "0.7.5-main.b19bfc8",
|
|
52
|
+
"@dxos/async": "0.7.5-main.b19bfc8",
|
|
53
|
+
"@dxos/client": "0.7.5-main.b19bfc8",
|
|
54
|
+
"@dxos/conductor": "0.7.5-main.b19bfc8",
|
|
55
|
+
"@dxos/compute": "0.7.5-main.b19bfc8",
|
|
56
|
+
"@dxos/context": "0.7.5-main.b19bfc8",
|
|
57
|
+
"@dxos/echo-db": "0.7.5-main.b19bfc8",
|
|
58
|
+
"@dxos/echo-schema": "0.7.5-main.b19bfc8",
|
|
59
|
+
"@dxos/edge-client": "0.7.5-main.b19bfc8",
|
|
60
|
+
"@dxos/functions": "0.7.5-main.b19bfc8",
|
|
61
|
+
"@dxos/invariant": "0.7.5-main.b19bfc8",
|
|
62
|
+
"@dxos/keys": "0.7.5-main.b19bfc8",
|
|
63
|
+
"@dxos/live-object": "0.7.5-main.b19bfc8",
|
|
64
|
+
"@dxos/log": "0.7.5-main.b19bfc8",
|
|
65
|
+
"@dxos/local-storage": "0.7.5-main.b19bfc8",
|
|
66
|
+
"@dxos/plugin-deck": "0.7.5-main.b19bfc8",
|
|
67
|
+
"@dxos/plugin-client": "0.7.5-main.b19bfc8",
|
|
68
|
+
"@dxos/plugin-inbox": "0.7.5-main.b19bfc8",
|
|
69
|
+
"@dxos/plugin-graph": "0.7.5-main.b19bfc8",
|
|
70
|
+
"@dxos/plugin-script": "0.7.5-main.b19bfc8",
|
|
71
|
+
"@dxos/plugin-markdown": "0.7.5-main.b19bfc8",
|
|
72
|
+
"@dxos/plugin-sketch": "0.7.5-main.b19bfc8",
|
|
73
|
+
"@dxos/plugin-space": "0.7.5-main.b19bfc8",
|
|
74
|
+
"@dxos/plugin-stack": "0.7.5-main.b19bfc8",
|
|
75
|
+
"@dxos/plugin-transcription": "0.7.5-main.b19bfc8",
|
|
76
|
+
"@dxos/plugin-wnfs": "0.7.5-main.b19bfc8",
|
|
77
|
+
"@dxos/react-ui-canvas-editor": "0.7.5-main.b19bfc8",
|
|
78
|
+
"@dxos/react-ui-canvas-compute": "0.7.5-main.b19bfc8",
|
|
79
|
+
"@dxos/react-client": "0.7.5-main.b19bfc8",
|
|
80
|
+
"@dxos/react-ui-components": "0.7.5-main.b19bfc8",
|
|
81
|
+
"@dxos/react-ui-dnd": "0.7.5-main.b19bfc8",
|
|
82
|
+
"@dxos/react-ui-editor": "0.7.5-main.b19bfc8",
|
|
83
|
+
"@dxos/react-ui-form": "0.7.5-main.b19bfc8",
|
|
84
|
+
"@dxos/react-ui-list": "0.7.5-main.b19bfc8",
|
|
85
|
+
"@dxos/react-ui-sfx": "0.7.5-main.b19bfc8",
|
|
86
|
+
"@dxos/react-edge-client": "0.7.5-main.b19bfc8",
|
|
87
|
+
"@dxos/react-ui-stack": "0.7.5-main.b19bfc8",
|
|
88
|
+
"@dxos/react-ui-syntax-highlighter": "0.7.5-main.b19bfc8",
|
|
89
|
+
"@dxos/schema": "0.7.5-main.b19bfc8",
|
|
90
|
+
"@dxos/util": "0.7.5-main.b19bfc8"
|
|
80
91
|
},
|
|
81
92
|
"devDependencies": {
|
|
82
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
83
93
|
"@types/lodash.get": "^4.4.7",
|
|
84
94
|
"@types/react": "~18.2.0",
|
|
85
95
|
"@types/react-dom": "~18.2.0",
|
|
96
|
+
"openapi-types": "^12.1.3",
|
|
86
97
|
"react": "~18.2.0",
|
|
87
98
|
"react-dom": "~18.2.0",
|
|
88
99
|
"vite": "5.4.7",
|
|
89
|
-
"@dxos/echo-db": "0.7.5-main.
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
100
|
+
"@dxos/echo-db": "0.7.5-main.b19bfc8",
|
|
101
|
+
"@dxos/artifact-testing": "0.7.5-main.b19bfc8",
|
|
102
|
+
"@dxos/plugin-map": "0.7.5-main.b19bfc8",
|
|
103
|
+
"@dxos/plugin-table": "0.7.5-main.b19bfc8",
|
|
104
|
+
"@dxos/random": "0.7.5-main.b19bfc8",
|
|
105
|
+
"@dxos/plugin-chess": "0.7.5-main.b19bfc8",
|
|
106
|
+
"@dxos/react-ui": "0.7.5-main.b19bfc8",
|
|
107
|
+
"@dxos/react-ui-theme": "0.7.5-main.b19bfc8",
|
|
108
|
+
"@dxos/storybook-utils": "0.7.5-main.b19bfc8"
|
|
94
109
|
},
|
|
95
110
|
"peerDependencies": {
|
|
96
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
97
111
|
"react": "~18.2.0",
|
|
98
112
|
"react-dom": "~18.2.0",
|
|
99
|
-
"@dxos/react-ui
|
|
100
|
-
"@dxos/react-ui": "0.7.5-main.
|
|
113
|
+
"@dxos/react-ui": "0.7.5-main.b19bfc8",
|
|
114
|
+
"@dxos/react-ui-theme": "0.7.5-main.b19bfc8"
|
|
101
115
|
},
|
|
102
116
|
"publishConfig": {
|
|
103
117
|
"access": "public"
|
package/src/AutomationPlugin.tsx
CHANGED
|
@@ -2,205 +2,114 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import { createSurface, parseMetadataResolverPlugin, type PluginDefinition, resolvePlugin } from '@dxos/app-framework';
|
|
5
|
+
import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
|
|
8
6
|
import { FunctionTrigger } from '@dxos/functions';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
getSpace,
|
|
15
|
-
getTypename,
|
|
16
|
-
isEchoObject,
|
|
17
|
-
parseId,
|
|
18
|
-
type ReactiveEchoObject,
|
|
19
|
-
RefArray,
|
|
20
|
-
SpaceState,
|
|
21
|
-
} from '@dxos/react-client/echo';
|
|
22
|
-
import { translations as formTranslations } from '@dxos/react-ui-form';
|
|
7
|
+
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
8
|
+
import { DeckCapabilities, DeckEvents } from '@dxos/plugin-deck';
|
|
9
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
10
|
+
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
11
|
+
import { isEchoObject, getSpace } from '@dxos/react-client/echo';
|
|
23
12
|
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
13
|
+
import { AiClient, AppGraphBuilder, IntentResolver, ReactSurface, AutomationSettings } from './capabilities';
|
|
14
|
+
import { AUTOMATION_PLUGIN, meta } from './meta';
|
|
26
15
|
import translations from './translations';
|
|
27
|
-
import {
|
|
16
|
+
import { AutomationAction, AIChatType, ServiceType, TemplateType } from './types';
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
label: ['open automation panel label', { ns: AUTOMATION_PLUGIN }],
|
|
52
|
-
icon: 'ph--magic-wand--regular',
|
|
18
|
+
// TODO(wittjosiah): Rename to AssistantPlugin?
|
|
19
|
+
export const AutomationPlugin = () =>
|
|
20
|
+
definePlugin(meta, [
|
|
21
|
+
defineModule({
|
|
22
|
+
id: `${meta.id}/module/translations`,
|
|
23
|
+
activatesOn: Events.SetupTranslations,
|
|
24
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
25
|
+
}),
|
|
26
|
+
defineModule({
|
|
27
|
+
id: `${meta.id}/module/settings`,
|
|
28
|
+
activatesOn: Events.SetupSettings,
|
|
29
|
+
activate: AutomationSettings,
|
|
30
|
+
}),
|
|
31
|
+
defineModule({
|
|
32
|
+
id: `${meta.id}/module/metadata`,
|
|
33
|
+
activatesOn: Events.SetupMetadata,
|
|
34
|
+
activate: () => [
|
|
35
|
+
contributes(Capabilities.Metadata, {
|
|
36
|
+
id: TemplateType.typename,
|
|
37
|
+
metadata: {
|
|
38
|
+
placeholder: ['template title placeholder', { ns: AUTOMATION_PLUGIN }],
|
|
39
|
+
icon: 'ph--code-block--regular',
|
|
53
40
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
}),
|
|
42
|
+
contributes(Capabilities.Metadata, {
|
|
43
|
+
id: AIChatType.typename,
|
|
44
|
+
metadata: {
|
|
45
|
+
placeholder: ['chat title placeholder', { ns: AUTOMATION_PLUGIN }],
|
|
57
46
|
icon: 'ph--atom--regular',
|
|
58
47
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// Create nodes for object settings.
|
|
72
|
-
createExtension({
|
|
73
|
-
id: `${AUTOMATION_PLUGIN}/automation-for-subject`,
|
|
74
|
-
resolver: ({ id }) => {
|
|
75
|
-
if (!id.endsWith('~automation')) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const type = 'orphan-settings-for-subject';
|
|
80
|
-
const icon = 'ph--magic-wand--regular';
|
|
81
|
-
|
|
82
|
-
const [subjectId] = id.split('~');
|
|
83
|
-
const { spaceId, objectId } = parseId(subjectId);
|
|
84
|
-
const spaces = toSignal(
|
|
85
|
-
(onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,
|
|
86
|
-
() => client.spaces.get(),
|
|
87
|
-
);
|
|
88
|
-
const space = spaces?.find(
|
|
89
|
-
(space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY,
|
|
90
|
-
);
|
|
91
|
-
if (!objectId) {
|
|
92
|
-
// TODO(burdon): Ref SPACE_PLUGIN ns.
|
|
93
|
-
const label = space
|
|
94
|
-
? space.properties.name || ['unnamed space label', { ns: AUTOMATION_PLUGIN }]
|
|
95
|
-
: ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];
|
|
96
|
-
|
|
97
|
-
// TODO(wittjosiah): Support comments for arbitrary subjects.
|
|
98
|
-
// This is to ensure that the comments panel is not stuck on an old object.
|
|
99
|
-
return {
|
|
100
|
-
id,
|
|
101
|
-
type,
|
|
102
|
-
data: null,
|
|
103
|
-
properties: {
|
|
104
|
-
icon,
|
|
105
|
-
label,
|
|
106
|
-
showResolvedThreads: false,
|
|
107
|
-
object: null,
|
|
108
|
-
space,
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const [object] = memoizeQuery(space, { id: objectId });
|
|
114
|
-
if (!object || !subjectId) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const meta = resolve(getTypename(object) ?? '');
|
|
119
|
-
const label = meta.label?.(object) ||
|
|
120
|
-
object.name ||
|
|
121
|
-
meta.placeholder || ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
id,
|
|
125
|
-
type,
|
|
126
|
-
data: null,
|
|
127
|
-
properties: {
|
|
128
|
-
icon,
|
|
129
|
-
label,
|
|
130
|
-
object,
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
},
|
|
134
|
-
}),
|
|
135
|
-
createExtension({
|
|
136
|
-
id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,
|
|
137
|
-
resolver: ({ id }) => {
|
|
138
|
-
// TODO(Zan): Find util (or make one). Effect schema!!
|
|
139
|
-
if (!id.endsWith('~assistant')) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const [subjectId] = id.split('~');
|
|
144
|
-
const { spaceId, objectId } = parseId(subjectId);
|
|
145
|
-
const spaces = toSignal(
|
|
146
|
-
(onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,
|
|
147
|
-
() => client.spaces.get(),
|
|
148
|
-
);
|
|
149
|
-
const space = spaces?.find(
|
|
150
|
-
(space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY,
|
|
151
|
-
);
|
|
152
|
-
if (!objectId) {
|
|
153
|
-
// TODO(wittjosiah): Support assistant for arbitrary subjects.
|
|
154
|
-
// This is to ensure that the assistant panel is not stuck on an old object.
|
|
155
|
-
return {
|
|
156
|
-
id,
|
|
157
|
-
type: 'orphan-automation-for-subject',
|
|
158
|
-
data: null,
|
|
159
|
-
properties: {
|
|
160
|
-
icon: 'ph--atom--regular',
|
|
161
|
-
label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],
|
|
162
|
-
object: null,
|
|
163
|
-
space,
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const [object] = memoizeQuery(space, { id: objectId });
|
|
169
|
-
|
|
170
|
-
return {
|
|
171
|
-
id,
|
|
172
|
-
type: 'orphan-automation-for-subject',
|
|
173
|
-
data: null,
|
|
174
|
-
properties: {
|
|
175
|
-
icon: 'ph--atom--regular',
|
|
176
|
-
label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],
|
|
177
|
-
object,
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
},
|
|
181
|
-
}),
|
|
182
|
-
];
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
surface: {
|
|
186
|
-
definitions: () => [
|
|
187
|
-
createSurface({
|
|
188
|
-
id: `${AUTOMATION_PLUGIN}/assistant`,
|
|
189
|
-
role: 'complementary--assistant',
|
|
190
|
-
component: ({ data }) => <AssistantPanel subject={data.subject} />,
|
|
48
|
+
}),
|
|
49
|
+
],
|
|
50
|
+
}),
|
|
51
|
+
defineModule({
|
|
52
|
+
id: `${meta.id}/module/object-form`,
|
|
53
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
54
|
+
activate: () => [
|
|
55
|
+
contributes(
|
|
56
|
+
SpaceCapabilities.ObjectForm,
|
|
57
|
+
defineObjectForm({
|
|
58
|
+
objectSchema: AIChatType,
|
|
59
|
+
getIntent: (_, options) => createIntent(AutomationAction.CreateChat, { spaceId: options.space.id }),
|
|
191
60
|
}),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
61
|
+
),
|
|
62
|
+
contributes(
|
|
63
|
+
SpaceCapabilities.ObjectForm,
|
|
64
|
+
defineObjectForm({
|
|
65
|
+
objectSchema: TemplateType,
|
|
66
|
+
getIntent: () => createIntent(AutomationAction.CreateTemplate),
|
|
198
67
|
}),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
68
|
+
),
|
|
69
|
+
],
|
|
70
|
+
}),
|
|
71
|
+
defineModule({
|
|
72
|
+
id: `${meta.id}/module/schema`,
|
|
73
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
74
|
+
activate: () => contributes(ClientCapabilities.Schema, [FunctionTrigger, ServiceType, TemplateType]),
|
|
75
|
+
}),
|
|
76
|
+
defineModule({
|
|
77
|
+
id: `${meta.id}/module/complementary-panels`,
|
|
78
|
+
activatesOn: DeckEvents.SetupComplementaryPanels,
|
|
79
|
+
activate: () => [
|
|
80
|
+
contributes(DeckCapabilities.ComplementaryPanel, {
|
|
81
|
+
id: 'service-registry',
|
|
82
|
+
label: ['service registry label', { ns: AUTOMATION_PLUGIN }],
|
|
83
|
+
icon: 'ph--plugs--regular',
|
|
84
|
+
}),
|
|
85
|
+
contributes(DeckCapabilities.ComplementaryPanel, {
|
|
86
|
+
id: 'automation',
|
|
87
|
+
label: ['automation panel label', { ns: AUTOMATION_PLUGIN }],
|
|
88
|
+
icon: 'ph--magic-wand--regular',
|
|
89
|
+
filter: (node) => isEchoObject(node.data) && !!getSpace(node.data),
|
|
90
|
+
}),
|
|
91
|
+
],
|
|
92
|
+
}),
|
|
93
|
+
defineModule({
|
|
94
|
+
id: `${meta.id}/module/react-surface`,
|
|
95
|
+
activatesOn: Events.SetupReactSurface,
|
|
96
|
+
// TODO(wittjosiah): Should occur before the chat is loaded when surfaces activation is more granular.
|
|
97
|
+
activatesBefore: [Events.SetupArtifactDefinition],
|
|
98
|
+
activate: ReactSurface,
|
|
99
|
+
}),
|
|
100
|
+
defineModule({
|
|
101
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
102
|
+
activatesOn: Events.SetupAppGraph,
|
|
103
|
+
activate: AppGraphBuilder,
|
|
104
|
+
}),
|
|
105
|
+
defineModule({
|
|
106
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
107
|
+
activatesOn: Events.SetupIntentResolver,
|
|
108
|
+
activate: IntentResolver,
|
|
109
|
+
}),
|
|
110
|
+
defineModule({
|
|
111
|
+
id: `${meta.id}/module/ai-client`,
|
|
112
|
+
activatesOn: ClientEvents.ClientReady,
|
|
113
|
+
activate: AiClient,
|
|
114
|
+
}),
|
|
115
|
+
]);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { contributes, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
+
import { AIServiceClientImpl } from '@dxos/assistant';
|
|
7
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
8
|
+
|
|
9
|
+
import { AutomationCapabilities } from './capabilities';
|
|
10
|
+
|
|
11
|
+
// TODO(wittjosiah): Factor out.
|
|
12
|
+
const DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';
|
|
13
|
+
|
|
14
|
+
export default (context: PluginsContext) => {
|
|
15
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
16
|
+
const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;
|
|
17
|
+
const aiClient = new AIServiceClientImpl({ endpoint });
|
|
18
|
+
return contributes(AutomationCapabilities.AiClient, aiClient);
|
|
19
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Capabilities,
|
|
7
|
+
contributes,
|
|
8
|
+
createIntent,
|
|
9
|
+
LayoutAction,
|
|
10
|
+
type PromiseIntentDispatcher,
|
|
11
|
+
type PluginsContext,
|
|
12
|
+
} from '@dxos/app-framework';
|
|
13
|
+
import { invariant } from '@dxos/invariant';
|
|
14
|
+
import { log } from '@dxos/log';
|
|
15
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
16
|
+
import { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';
|
|
17
|
+
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
18
|
+
import { type Space, Filter, getSpace } from '@dxos/react-client/echo';
|
|
19
|
+
|
|
20
|
+
import { ASSISTANT_DIALOG, AUTOMATION_PLUGIN } from '../meta';
|
|
21
|
+
import { AIChatType, AutomationAction } from '../types';
|
|
22
|
+
|
|
23
|
+
export default (context: PluginsContext) =>
|
|
24
|
+
contributes(Capabilities.AppGraphBuilder, [
|
|
25
|
+
createExtension({
|
|
26
|
+
id: `${AUTOMATION_PLUGIN}/assistant`,
|
|
27
|
+
filter: (node): node is Node<null> => node.id === ROOT_ID,
|
|
28
|
+
actions: () => [
|
|
29
|
+
{
|
|
30
|
+
id: `${LayoutAction.UpdateDialog._tag}/assistant/open`,
|
|
31
|
+
data: async () => {
|
|
32
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
33
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
34
|
+
const layout = context.requestCapability(Capabilities.Layout);
|
|
35
|
+
const { graph } = context.requestCapability(Capabilities.AppGraph);
|
|
36
|
+
|
|
37
|
+
// TODO(burdon): Get space from workspace.
|
|
38
|
+
// TODO(burdon): If need to create chat, then add to dispatch stack below.
|
|
39
|
+
let chat: AIChatType | undefined;
|
|
40
|
+
if (layout.active.length > 0) {
|
|
41
|
+
const node = graph.findNode(layout.active[0]);
|
|
42
|
+
if (node) {
|
|
43
|
+
const space = getSpace(node.data);
|
|
44
|
+
if (space) {
|
|
45
|
+
chat = await getOrCreateChat(dispatch, space);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
const space = client.spaces.default;
|
|
50
|
+
chat = await getOrCreateChat(dispatch, space);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!chat) {
|
|
54
|
+
log.warn('no chat found');
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
await dispatch(
|
|
59
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
60
|
+
part: 'dialog',
|
|
61
|
+
subject: ASSISTANT_DIALOG,
|
|
62
|
+
options: {
|
|
63
|
+
state: true,
|
|
64
|
+
blockAlign: 'end',
|
|
65
|
+
props: {
|
|
66
|
+
chat,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
properties: {
|
|
73
|
+
label: ['open assistant label', { ns: AUTOMATION_PLUGIN }],
|
|
74
|
+
icon: 'ph--chat-centered-text--regular',
|
|
75
|
+
disposition: 'pin-end',
|
|
76
|
+
position: 'hoist',
|
|
77
|
+
keyBinding: {
|
|
78
|
+
macos: 'shift+meta+k',
|
|
79
|
+
windows: 'shift+ctrl+k',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
}),
|
|
85
|
+
]);
|
|
86
|
+
|
|
87
|
+
// TODO(burdon): Factor out.
|
|
88
|
+
const getOrCreateChat = async (dispatch: PromiseIntentDispatcher, space: Space): Promise<AIChatType | undefined> => {
|
|
89
|
+
const { objects } = await space.db.query(Filter.schema(AIChatType)).run();
|
|
90
|
+
if (objects.length > 0) {
|
|
91
|
+
// TODO(burdon): Is this the most recent?
|
|
92
|
+
return objects[objects.length - 1];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const { data } = await dispatch(createIntent(AutomationAction.CreateChat, { spaceId: space.id }));
|
|
96
|
+
invariant(data?.object instanceof AIChatType);
|
|
97
|
+
await dispatch(createIntent(SpaceAction.AddObject, { target: space, object: data.object }));
|
|
98
|
+
return data.object;
|
|
99
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
+
import { type AIServiceClientImpl } from '@dxos/assistant';
|
|
7
|
+
|
|
8
|
+
import { AUTOMATION_PLUGIN } from '../meta';
|
|
9
|
+
|
|
10
|
+
export namespace AutomationCapabilities {
|
|
11
|
+
export const AiClient = defineCapability<AIServiceClientImpl>(`${AUTOMATION_PLUGIN}/capability/ai-client`);
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { lazy } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const AiClient = lazy(() => import('./ai-client'));
|
|
8
|
+
export const AutomationSettings = lazy(() => import('./settings'));
|
|
9
|
+
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
10
|
+
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
11
|
+
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
12
|
+
|
|
13
|
+
export * from './capabilities';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
6
|
+
import { ObjectId } from '@dxos/echo-schema';
|
|
7
|
+
import { DXN, QueueSubspaceTags } from '@dxos/keys';
|
|
8
|
+
import { create, refFromDXN } from '@dxos/live-object';
|
|
9
|
+
|
|
10
|
+
import { AutomationAction, AIChatType, TemplateType } from '../types';
|
|
11
|
+
|
|
12
|
+
export default () => [
|
|
13
|
+
contributes(
|
|
14
|
+
Capabilities.IntentResolver,
|
|
15
|
+
createResolver({
|
|
16
|
+
intent: AutomationAction.CreateChat,
|
|
17
|
+
resolve: ({ spaceId, name }) => ({
|
|
18
|
+
data: {
|
|
19
|
+
object: create(AIChatType, {
|
|
20
|
+
name,
|
|
21
|
+
queue: refFromDXN(new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, spaceId, ObjectId.random()])),
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
contributes(
|
|
28
|
+
Capabilities.IntentResolver,
|
|
29
|
+
createResolver({
|
|
30
|
+
intent: AutomationAction.CreateTemplate,
|
|
31
|
+
resolve: ({ name }) => ({
|
|
32
|
+
data: {
|
|
33
|
+
object: create(TemplateType, { name, source: '{{! Template }}' }),
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
];
|