@dxos/plugin-automation 0.7.5-staging.b81e783 → 0.8.0
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-ITYXSN5Z.mjs +132 -0
- package/dist/lib/browser/AutomationPanel-ITYXSN5Z.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HZSTXZWK.mjs → chunk-OFDNNRLE.mjs} +3 -8
- package/dist/lib/browser/chunk-OFDNNRLE.mjs.map +7 -0
- package/dist/lib/browser/chunk-U7QLNY2S.mjs +8 -0
- package/dist/lib/browser/chunk-U7QLNY2S.mjs.map +7 -0
- package/dist/lib/browser/chunk-WY2C7JY4.mjs +119 -0
- package/dist/lib/browser/chunk-WY2C7JY4.mjs.map +7 -0
- package/dist/lib/browser/complementary-panel-4CPOJL4Y.mjs +56 -0
- package/dist/lib/browser/complementary-panel-4CPOJL4Y.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +18 -395
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-SAPMN4PF.mjs +27 -0
- package/dist/lib/browser/react-surface-SAPMN4PF.mjs.map +7 -0
- package/dist/lib/node/{chunk-V4L7LTWM.cjs → AutomationPanel-X33HHDMQ.cjs} +19 -132
- package/dist/lib/node/AutomationPanel-X33HHDMQ.cjs.map +7 -0
- package/dist/lib/node/chunk-7Q5SNGCL.cjs +148 -0
- package/dist/lib/node/chunk-7Q5SNGCL.cjs.map +7 -0
- package/dist/lib/node/chunk-CB5OB6JH.cjs +40 -0
- package/dist/lib/node/chunk-CB5OB6JH.cjs.map +7 -0
- package/dist/lib/node/{chunk-BAQRBGOJ.cjs → chunk-ORMEYEBE.cjs} +6 -12
- package/dist/lib/node/chunk-ORMEYEBE.cjs.map +7 -0
- package/dist/lib/node/complementary-panel-ZYJJ42ZU.cjs +72 -0
- package/dist/lib/node/complementary-panel-ZYJJ42ZU.cjs.map +7 -0
- package/dist/lib/node/index.cjs +33 -396
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-IXKIJFRP.cjs → react-surface-2WRVAPGR.cjs} +9 -34
- package/dist/lib/node/react-surface-2WRVAPGR.cjs.map +7 -0
- package/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs +133 -0
- package/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IG4GSWZN.mjs → chunk-6MUUH67V.mjs} +3 -8
- package/dist/lib/node-esm/chunk-6MUUH67V.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-R3P2WPBQ.mjs +10 -0
- package/dist/lib/node-esm/chunk-R3P2WPBQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UDD2VA6G.mjs +120 -0
- package/dist/lib/node-esm/chunk-UDD2VA6G.mjs.map +7 -0
- package/dist/lib/node-esm/complementary-panel-S42RIIAY.mjs +57 -0
- package/dist/lib/node-esm/complementary-panel-S42RIIAY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +18 -395
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-QWLPOYXO.mjs +28 -0
- package/dist/lib/node-esm/react-surface-QWLPOYXO.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/{ai-client.d.ts → complementary-panel.d.ts} +2 -3
- package/dist/types/src/capabilities/complementary-panel.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +1 -180
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -11
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +0 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-functions.d.ts +0 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -112
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +21 -74
- package/src/AutomationPlugin.tsx +7 -76
- package/src/capabilities/complementary-panel.ts +56 -0
- package/src/capabilities/index.ts +1 -5
- package/src/capabilities/react-surface.tsx +3 -23
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -2
- package/src/components/AutomationPanel/AutomationPanel.tsx +56 -49
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +1 -2
- package/src/components/index.ts +0 -8
- package/src/index.ts +2 -3
- package/src/meta.ts +1 -4
- package/src/testing/index.ts +0 -1
- package/src/testing/test-functions.ts +0 -7
- package/src/translations.ts +1 -37
- package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs +0 -8
- package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-AZPLZJ5H.mjs +0 -12
- package/dist/lib/browser/ChatContainer-AZPLZJ5H.mjs.map +0 -7
- package/dist/lib/browser/ai-client-T2PBJISL.mjs +0 -22
- package/dist/lib/browser/ai-client-T2PBJISL.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-F22H4YBQ.mjs +0 -111
- package/dist/lib/browser/app-graph-builder-F22H4YBQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-67KDIIM6.mjs +0 -15
- package/dist/lib/browser/chunk-67KDIIM6.mjs.map +0 -7
- package/dist/lib/browser/chunk-HZSTXZWK.mjs.map +0 -7
- package/dist/lib/browser/chunk-L2YLAKCS.mjs +0 -151
- package/dist/lib/browser/chunk-L2YLAKCS.mjs.map +0 -7
- package/dist/lib/browser/chunk-LJ7F4KDM.mjs +0 -243
- package/dist/lib/browser/chunk-LJ7F4KDM.mjs.map +0 -7
- package/dist/lib/browser/chunk-M4MWUOUC.mjs +0 -382
- package/dist/lib/browser/chunk-M4MWUOUC.mjs.map +0 -7
- package/dist/lib/browser/chunk-U435IUIA.mjs +0 -1775
- package/dist/lib/browser/chunk-U435IUIA.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MONKAKTY.mjs +0 -30
- package/dist/lib/browser/intent-resolver-MONKAKTY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-7QWCWE4K.mjs +0 -58
- package/dist/lib/browser/react-surface-7QWCWE4K.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -24
- package/dist/lib/browser/types/index.mjs.map +0 -7
- package/dist/lib/node/AutomationPanel-6COLKRIB.cjs +0 -26
- package/dist/lib/node/AutomationPanel-6COLKRIB.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-SBEUFMQ3.cjs +0 -33
- package/dist/lib/node/ChatContainer-SBEUFMQ3.cjs.map +0 -7
- package/dist/lib/node/ai-client-L5GUSAER.cjs +0 -38
- package/dist/lib/node/ai-client-L5GUSAER.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-OCSH5R6U.cjs +0 -123
- package/dist/lib/node/app-graph-builder-OCSH5R6U.cjs.map +0 -7
- package/dist/lib/node/chunk-BAQRBGOJ.cjs.map +0 -7
- package/dist/lib/node/chunk-BZFAEBME.cjs +0 -1747
- package/dist/lib/node/chunk-BZFAEBME.cjs.map +0 -7
- package/dist/lib/node/chunk-K3F5JNZ6.cjs +0 -394
- package/dist/lib/node/chunk-K3F5JNZ6.cjs.map +0 -7
- package/dist/lib/node/chunk-NUOYHYAF.cjs +0 -174
- package/dist/lib/node/chunk-NUOYHYAF.cjs.map +0 -7
- package/dist/lib/node/chunk-V4L7LTWM.cjs.map +0 -7
- package/dist/lib/node/chunk-VNBYGJ4K.cjs +0 -34
- package/dist/lib/node/chunk-VNBYGJ4K.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-KQGTYVF2.cjs +0 -45
- package/dist/lib/node/intent-resolver-KQGTYVF2.cjs.map +0 -7
- package/dist/lib/node/react-surface-IXKIJFRP.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -46
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-3MPIAO7R.mjs +0 -9
- package/dist/lib/node-esm/AutomationPanel-3MPIAO7R.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-JCDLYMDZ.mjs +0 -13
- package/dist/lib/node-esm/ChatContainer-JCDLYMDZ.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-45LZLW7V.mjs +0 -23
- package/dist/lib/node-esm/ai-client-45LZLW7V.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-XSM7DETF.mjs +0 -112
- package/dist/lib/node-esm/app-graph-builder-XSM7DETF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-53FFD4VO.mjs +0 -1776
- package/dist/lib/node-esm/chunk-53FFD4VO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AWAU4BHR.mjs +0 -244
- package/dist/lib/node-esm/chunk-AWAU4BHR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IG4GSWZN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K5NNSGIV.mjs +0 -152
- package/dist/lib/node-esm/chunk-K5NNSGIV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RAT3GSJP.mjs +0 -383
- package/dist/lib/node-esm/chunk-RAT3GSJP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SS7U6GCX.mjs +0 -16
- package/dist/lib/node-esm/chunk-SS7U6GCX.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-XSZRLU6V.mjs +0 -31
- package/dist/lib/node-esm/intent-resolver-XSZRLU6V.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-FZAAAXGR.mjs +0 -59
- package/dist/lib/node-esm/react-surface-FZAAAXGR.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -25
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -181
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +0 -7
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +0 -8
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/AmbientDialog/index.d.ts +0 -2
- package/dist/types/src/components/AmbientDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/AssistantDialog/AssistantDialog.d.ts +0 -6
- package/dist/types/src/components/AssistantDialog/AssistantDialog.d.ts.map +0 -1
- package/dist/types/src/components/AssistantDialog/index.d.ts +0 -2
- package/dist/types/src/components/AssistantDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer/ChatContainer.d.ts +0 -6
- package/dist/types/src/components/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer/index.d.ts +0 -4
- package/dist/types/src/components/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +0 -13
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +0 -9
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts +0 -10
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/autocomplete.d.ts +0 -21
- package/dist/types/src/components/Prompt/autocomplete.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/index.d.ts +0 -3
- package/dist/types/src/components/Prompt/index.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts +0 -9
- 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 +0 -18
- package/dist/types/src/components/PromptEditor/types.d.ts.map +0 -1
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +0 -5
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +0 -1
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +0 -8
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +0 -1
- package/dist/types/src/components/ServiceRegistry/index.d.ts +0 -2
- package/dist/types/src/components/ServiceRegistry/index.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.d.ts +0 -15
- package/dist/types/src/components/Thread/Thread.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.stories.d.ts +0 -11
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +0 -8
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +0 -15
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +0 -13
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +0 -13
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +0 -1
- package/dist/types/src/components/Thread/index.d.ts +0 -3
- package/dist/types/src/components/Thread/index.d.ts.map +0 -1
- package/dist/types/src/components/Thread/reducer.d.ts +0 -12
- package/dist/types/src/components/Thread/reducer.d.ts.map +0 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +0 -19
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +0 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +0 -8
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +0 -1
- package/dist/types/src/components/Toolbox/index.d.ts +0 -2
- package/dist/types/src/components/Toolbox/index.d.ts.map +0 -1
- package/dist/types/src/hooks/email.d.ts +0 -4
- package/dist/types/src/hooks/email.d.ts.map +0 -1
- package/dist/types/src/hooks/index.d.ts +0 -7
- package/dist/types/src/hooks/index.d.ts.map +0 -1
- package/dist/types/src/hooks/invocation-handler.d.ts +0 -5
- package/dist/types/src/hooks/invocation-handler.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.d.ts +0 -75
- package/dist/types/src/hooks/processor.d.ts.map +0 -1
- package/dist/types/src/hooks/processor.test.d.ts +0 -2
- package/dist/types/src/hooks/processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +0 -7
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +0 -1
- package/dist/types/src/hooks/useLocalTriggerManager.d.ts +0 -3
- package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +0 -1
- package/dist/types/src/hooks/useMessageQueue.d.ts +0 -41
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +0 -1
- package/dist/types/src/hooks/useServices.d.ts +0 -7
- package/dist/types/src/hooks/useServices.d.ts.map +0 -1
- package/dist/types/src/hooks/useTextInputEvents.d.ts +0 -13
- package/dist/types/src/hooks/useTextInputEvents.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/test-services.d.ts +0 -5
- package/dist/types/src/testing/test-services.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -4
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/registry.d.ts +0 -10
- package/dist/types/src/types/registry.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -221
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -19
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/ai-client.ts +0 -19
- package/src/capabilities/app-graph-builder.ts +0 -100
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/intent-resolver.ts +0 -26
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +0 -81
- package/src/components/AmbientDialog/AmbientDialog.tsx +0 -103
- package/src/components/AmbientDialog/index.ts +0 -5
- package/src/components/AssistantDialog/AssistantDialog.tsx +0 -23
- package/src/components/AssistantDialog/index.ts +0 -5
- package/src/components/ChatContainer/ChatContainer.tsx +0 -19
- package/src/components/ChatContainer/index.ts +0 -9
- package/src/components/Prompt/Prompt.stories.tsx +0 -79
- package/src/components/Prompt/Prompt.tsx +0 -79
- package/src/components/Prompt/PromptBar.tsx +0 -100
- package/src/components/Prompt/autocomplete.ts +0 -212
- package/src/components/Prompt/index.ts +0 -6
- package/src/components/PromptEditor/PromptEditor.stories.tsx +0 -64
- package/src/components/PromptEditor/PromptEditor.tsx +0 -222
- package/src/components/PromptEditor/index.ts +0 -5
- package/src/components/PromptEditor/prompt-extension.ts +0 -43
- package/src/components/PromptEditor/types.tsx +0 -28
- package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +0 -49
- package/src/components/ServiceRegistry/ServiceRegistry.tsx +0 -76
- package/src/components/ServiceRegistry/index.ts +0 -5
- package/src/components/Thread/Thread.stories.tsx +0 -210
- package/src/components/Thread/Thread.tsx +0 -106
- package/src/components/Thread/ThreadContainer.stories.tsx +0 -245
- package/src/components/Thread/ThreadContainer.tsx +0 -67
- package/src/components/Thread/ThreadMessage.tsx +0 -187
- package/src/components/Thread/ToolInvocations.tsx +0 -86
- package/src/components/Thread/index.ts +0 -6
- package/src/components/Thread/reducer.ts +0 -52
- package/src/components/Toolbox/Toolbox.stories.tsx +0 -66
- package/src/components/Toolbox/Toolbox.tsx +0 -89
- package/src/components/Toolbox/index.ts +0 -5
- package/src/hooks/email.ts +0 -49
- package/src/hooks/index.ts +0 -11
- package/src/hooks/invocation-handler.ts +0 -109
- package/src/hooks/processor.test.ts +0 -15
- package/src/hooks/processor.ts +0 -218
- package/src/hooks/useChatProcessor.tsx +0 -75
- package/src/hooks/useLocalTriggerManager.ts +0 -82
- package/src/hooks/useMessageQueue.ts +0 -23
- package/src/hooks/useServices.ts +0 -28
- package/src/hooks/useTextInputEvents.ts +0 -49
- package/src/presets.ts +0 -248
- package/src/testing/test-services.ts +0 -131
- package/src/tools/function.ts +0 -47
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -224
- package/src/tools/openapi.ts +0 -331
- package/src/types/index.ts +0 -7
- package/src/types/registry.ts +0 -26
- package/src/types/schema.ts +0 -132
- package/src/types/types.ts +0 -22
- package/src/typings.d.ts +0 -9
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '@dxos/functions';
|
|
16
16
|
import { type Client, useClient } from '@dxos/react-client';
|
|
17
17
|
import { create, Filter, useQuery, type Space, type ReactiveObject, getSpace } from '@dxos/react-client/echo';
|
|
18
|
-
import { IconButton, Input, useTranslation
|
|
18
|
+
import { Clipboard, IconButton, Input, useTranslation } from '@dxos/react-ui';
|
|
19
19
|
import { List } from '@dxos/react-ui-list';
|
|
20
20
|
import { ghostHover, mx } from '@dxos/react-ui-theme';
|
|
21
21
|
|
|
@@ -73,57 +73,62 @@ export const AutomationPanel = ({ space, object }: AutomationPanelProps) => {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
return (
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
{
|
|
79
|
-
<
|
|
80
|
-
{triggers
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<Input.Switch
|
|
90
|
-
checked={trigger.enabled}
|
|
91
|
-
onCheckedChange={(checked) => (trigger.enabled = checked)}
|
|
92
|
-
/>
|
|
93
|
-
</Input.Root>
|
|
94
|
-
|
|
95
|
-
<div className={'flex'}>
|
|
96
|
-
<List.ItemTitle
|
|
97
|
-
classNames='px-1 cursor-pointer w-0 shrink truncate'
|
|
98
|
-
onClick={() => handleSelect(trigger)}
|
|
76
|
+
<Clipboard.Provider>
|
|
77
|
+
<div className='flex flex-col w-full'>
|
|
78
|
+
{!trigger && (
|
|
79
|
+
<List.Root<FunctionTrigger> items={triggers} isItem={S.is(FunctionTrigger)} getId={(field) => field.id}>
|
|
80
|
+
{({ items: triggers }) => (
|
|
81
|
+
<div role='list' className='flex flex-col w-full'>
|
|
82
|
+
{triggers?.map((trigger) => {
|
|
83
|
+
const copyAction = getCopyAction(client, trigger);
|
|
84
|
+
return (
|
|
85
|
+
<List.Item<FunctionTrigger>
|
|
86
|
+
key={trigger.id}
|
|
87
|
+
item={trigger}
|
|
88
|
+
classNames={mx(grid, ghostHover, 'items-center', 'px-2')}
|
|
99
89
|
>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
90
|
+
<Input.Root>
|
|
91
|
+
<Input.Switch
|
|
92
|
+
checked={trigger.enabled}
|
|
93
|
+
onCheckedChange={(checked) => (trigger.enabled = checked)}
|
|
94
|
+
/>
|
|
95
|
+
</Input.Root>
|
|
96
|
+
|
|
97
|
+
<div className={'flex'}>
|
|
98
|
+
<List.ItemTitle
|
|
99
|
+
classNames='px-1 cursor-pointer w-0 shrink truncate'
|
|
100
|
+
onClick={() => handleSelect(trigger)}
|
|
101
|
+
>
|
|
102
|
+
{getFunctionName(scripts, functions, trigger) ?? '∅'}
|
|
103
|
+
</List.ItemTitle>
|
|
104
|
+
|
|
105
|
+
{/* TODO: a better way to expose copy action */}
|
|
106
|
+
{copyAction && (
|
|
107
|
+
<Clipboard.IconButton
|
|
108
|
+
label={t(copyAction.translationKey)}
|
|
109
|
+
value={copyAction.contentProvider()}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<List.ItemDeleteButton onClick={() => handleDelete(trigger)} />
|
|
115
|
+
</List.Item>
|
|
116
|
+
);
|
|
117
|
+
})}
|
|
118
|
+
</div>
|
|
119
|
+
)}
|
|
120
|
+
</List.Root>
|
|
116
121
|
)}
|
|
117
|
-
</List.Root>
|
|
118
122
|
|
|
119
|
-
|
|
123
|
+
{trigger && <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />}
|
|
120
124
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
{!trigger && (
|
|
126
|
+
<div className='flex p-2 justify-center'>
|
|
127
|
+
<IconButton icon='ph--plus--regular' label={t('new trigger label')} onClick={handleAdd} />
|
|
128
|
+
</div>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
</Clipboard.Provider>
|
|
127
132
|
);
|
|
128
133
|
};
|
|
129
134
|
|
|
@@ -148,8 +153,10 @@ const getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {
|
|
|
148
153
|
};
|
|
149
154
|
|
|
150
155
|
const getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTriggerType) => {
|
|
156
|
+
// TODO(wittjosiah): Truncation should be done in the UI.
|
|
157
|
+
// Warning that the List component is currently a can of worms.
|
|
151
158
|
const shortId = trigger.function && `${trigger.function?.slice(0, 16)}…`;
|
|
152
|
-
const functionObject = functions.find((fn) => fn.name === trigger.function);
|
|
159
|
+
const functionObject = functions.find((fn) => `dxn:worker:${fn.name}` === trigger.function);
|
|
153
160
|
if (!functionObject) {
|
|
154
161
|
return shortId;
|
|
155
162
|
}
|
|
@@ -16,7 +16,6 @@ import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
|
16
16
|
import { TriggerEditor } from './TriggerEditor';
|
|
17
17
|
import { functions } from '../../testing';
|
|
18
18
|
import translations from '../../translations';
|
|
19
|
-
import { ChainPromptType } from '../../types';
|
|
20
19
|
|
|
21
20
|
const DefaultStory = () => {
|
|
22
21
|
const spaces = useSpaces();
|
|
@@ -50,7 +49,7 @@ const meta: Meta = {
|
|
|
50
49
|
withClientProvider({
|
|
51
50
|
createIdentity: true,
|
|
52
51
|
createSpace: true,
|
|
53
|
-
types: [FunctionType, FunctionTrigger
|
|
52
|
+
types: [FunctionType, FunctionTrigger],
|
|
54
53
|
onSpaceCreated: ({ space }) => {
|
|
55
54
|
for (const fn of functions) {
|
|
56
55
|
space.db.add(create(FunctionType, fn));
|
package/src/components/index.ts
CHANGED
|
@@ -4,14 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export * from './AssistantDialog';
|
|
8
|
-
export * from './AutomationPanel';
|
|
9
|
-
export * from './ChatContainer';
|
|
10
|
-
export * from './PromptEditor';
|
|
11
|
-
export * from './ServiceRegistry';
|
|
12
|
-
export * from './Thread';
|
|
13
7
|
export * from './TriggerEditor';
|
|
14
|
-
export * from './Toolbox';
|
|
15
8
|
|
|
16
9
|
export const AutomationPanel = lazy(() => import('./AutomationPanel'));
|
|
17
|
-
export const ChatContainer = lazy(() => import('./ChatContainer'));
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -6,14 +6,11 @@ import { type PluginMeta } from '@dxos/app-framework';
|
|
|
6
6
|
|
|
7
7
|
export const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';
|
|
8
8
|
|
|
9
|
-
export const ASSISTANT_DIALOG = `${AUTOMATION_PLUGIN}/assistant/dialog`;
|
|
10
|
-
|
|
11
9
|
export const meta = {
|
|
12
10
|
id: AUTOMATION_PLUGIN,
|
|
13
11
|
name: 'Automation',
|
|
14
12
|
description:
|
|
15
13
|
'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',
|
|
16
|
-
icon: 'ph--
|
|
14
|
+
icon: 'ph--robot--regular',
|
|
17
15
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation',
|
|
18
|
-
tags: ['experimental'],
|
|
19
16
|
} satisfies PluginMeta;
|
package/src/testing/index.ts
CHANGED
|
@@ -2,15 +2,8 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { createSystemPrompt } from '@dxos/artifact';
|
|
6
|
-
import { type GenerateRequest } from '@dxos/assistant';
|
|
7
5
|
import { AST, S, toJsonSchema } from '@dxos/echo-schema';
|
|
8
6
|
|
|
9
|
-
export const createProcessorOptions = (artifacts: string[]): Pick<GenerateRequest, 'model' | 'systemPrompt'> => ({
|
|
10
|
-
model: '@anthropic/claude-3-5-sonnet-20241022',
|
|
11
|
-
systemPrompt: createSystemPrompt({ artifacts }),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
7
|
export const functions = [
|
|
15
8
|
{
|
|
16
9
|
name: 'example.com/function/chess',
|
package/src/translations.ts
CHANGED
|
@@ -3,42 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { AUTOMATION_PLUGIN } from './meta';
|
|
6
|
-
import { AIChatType } from './types';
|
|
7
6
|
|
|
8
7
|
export default [
|
|
9
8
|
{
|
|
10
9
|
'en-US': {
|
|
11
|
-
[AIChatType.typename]: {
|
|
12
|
-
'typename label': 'AI Chat',
|
|
13
|
-
},
|
|
14
10
|
[AUTOMATION_PLUGIN]: {
|
|
15
|
-
'open ambient chat label': 'Open AI chat',
|
|
16
11
|
'plugin name': 'Automation',
|
|
17
|
-
'object placeholder': 'New prompt',
|
|
18
|
-
'create object label': 'Create prompt',
|
|
19
|
-
'create trigger label': 'Create trigger',
|
|
20
|
-
'create stack section label': 'Create prompt',
|
|
21
|
-
'command placeholder': 'Enter slash command...',
|
|
22
|
-
'template placeholder': 'Enter template...',
|
|
23
|
-
'value placeholder': 'Enter value...',
|
|
24
|
-
'select preset template placeholder': 'Select preset',
|
|
25
|
-
'open automation panel label': 'Show Automations',
|
|
26
12
|
'automation panel label': 'Automations',
|
|
27
|
-
'service registry label': 'Service Registry',
|
|
28
|
-
|
|
29
|
-
'assistant dialog title': 'Assistant',
|
|
30
|
-
'open assistant label': 'Open assistant',
|
|
31
|
-
|
|
32
|
-
'chat input placeholder': 'Ask a question...',
|
|
33
|
-
'chat stop': 'Cancel request.',
|
|
34
|
-
|
|
35
|
-
'function select label': 'Function',
|
|
36
|
-
'function select placeholder': 'Select function',
|
|
37
|
-
'function enabled': 'Enabled',
|
|
38
|
-
|
|
39
|
-
'trigger select label': 'Trigger',
|
|
40
|
-
'trigger select placeholder': 'Trigger type',
|
|
41
13
|
|
|
14
|
+
'new trigger label': 'New Trigger',
|
|
42
15
|
'trigger type timer': 'Timer',
|
|
43
16
|
'trigger type webhook': 'Webhook',
|
|
44
17
|
'trigger type websocket': 'Websocket',
|
|
@@ -46,21 +19,12 @@ export default [
|
|
|
46
19
|
'trigger type email': 'Email',
|
|
47
20
|
'trigger type queue': 'Queue',
|
|
48
21
|
|
|
49
|
-
'trigger filter': 'Filter',
|
|
50
|
-
'trigger cron': 'Cron',
|
|
51
|
-
'trigger method': 'Method',
|
|
52
|
-
'trigger endpoint': 'Endpoint',
|
|
53
|
-
|
|
54
22
|
'trigger copy url': 'Copy URL',
|
|
55
23
|
'trigger copy email': 'Copy Email',
|
|
56
24
|
|
|
57
25
|
'trigger meta add': 'Add',
|
|
58
26
|
'trigger meta remove': 'Remove',
|
|
59
27
|
'trigger meta prop name placeholder': 'New meta property name',
|
|
60
|
-
|
|
61
|
-
'prompt placeholder': 'Ask a question...',
|
|
62
|
-
'microphone button': 'Click to speak',
|
|
63
|
-
'cancel processing button': 'Stop processing',
|
|
64
28
|
},
|
|
65
29
|
},
|
|
66
30
|
},
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChatContainer,
|
|
3
|
-
ChatContainer_default
|
|
4
|
-
} from "./chunk-U435IUIA.mjs";
|
|
5
|
-
import "./chunk-67KDIIM6.mjs";
|
|
6
|
-
import "./chunk-L2YLAKCS.mjs";
|
|
7
|
-
import "./chunk-HZSTXZWK.mjs";
|
|
8
|
-
export {
|
|
9
|
-
ChatContainer,
|
|
10
|
-
ChatContainer_default as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=ChatContainer-AZPLZJ5H.mjs.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutomationCapabilities
|
|
3
|
-
} from "./chunk-67KDIIM6.mjs";
|
|
4
|
-
import "./chunk-HZSTXZWK.mjs";
|
|
5
|
-
|
|
6
|
-
// packages/plugins/experimental/plugin-automation/src/capabilities/ai-client.ts
|
|
7
|
-
import { contributes } from "@dxos/app-framework";
|
|
8
|
-
import { AIServiceClientImpl } from "@dxos/assistant";
|
|
9
|
-
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
10
|
-
var DEFAULT_AI_SERVICE_URL = "http://localhost:8788";
|
|
11
|
-
var ai_client_default = (context) => {
|
|
12
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
13
|
-
const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;
|
|
14
|
-
const aiClient = new AIServiceClientImpl({
|
|
15
|
-
endpoint
|
|
16
|
-
});
|
|
17
|
-
return contributes(AutomationCapabilities.AiClient, aiClient);
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
ai_client_default as default
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=ai-client-T2PBJISL.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/ai-client.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext } from '@dxos/app-framework';\nimport { AIServiceClientImpl } from '@dxos/assistant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { AutomationCapabilities } from './capabilities';\n\n// TODO(wittjosiah): Factor out.\nconst DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';\n\nexport default (context: PluginsContext) => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;\n const aiClient = new AIServiceClientImpl({ endpoint });\n return contributes(AutomationCapabilities.AiClient, aiClient);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,mBAAwC;AACjD,SAASC,2BAA2B;AACpC,SAASC,0BAA0B;AAKnC,IAAMC,yBAAyB;AAE/B,IAAA,oBAAe,CAACC,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,mBAAmBC,MAAM;AAClE,QAAMC,WAAWJ,OAAOK,OAAOC,OAAOC,SAASC,UAAUC,IAAIC,UAAUZ;AACvE,QAAMa,WAAW,IAAIC,oBAAoB;IAAER;EAAS,CAAA;AACpD,SAAOS,YAAYC,uBAAuBC,UAAUJ,QAAAA;AACtD;",
|
|
6
|
-
"names": ["contributes", "AIServiceClientImpl", "ClientCapabilities", "DEFAULT_AI_SERVICE_URL", "context", "client", "requestCapability", "ClientCapabilities", "Client", "endpoint", "config", "values", "runtime", "services", "ai", "server", "aiClient", "AIServiceClientImpl", "contributes", "AutomationCapabilities", "AiClient"]
|
|
7
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AIChatType,
|
|
3
|
-
AutomationAction
|
|
4
|
-
} from "./chunk-L2YLAKCS.mjs";
|
|
5
|
-
import {
|
|
6
|
-
ASSISTANT_DIALOG,
|
|
7
|
-
AUTOMATION_PLUGIN
|
|
8
|
-
} from "./chunk-HZSTXZWK.mjs";
|
|
9
|
-
|
|
10
|
-
// packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts
|
|
11
|
-
import { Capabilities, contributes, createIntent, LayoutAction } from "@dxos/app-framework";
|
|
12
|
-
import { invariant } from "@dxos/invariant";
|
|
13
|
-
import { log } from "@dxos/log";
|
|
14
|
-
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
15
|
-
import { createExtension, ROOT_ID } from "@dxos/plugin-graph";
|
|
16
|
-
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
17
|
-
import { Filter, getSpace } from "@dxos/react-client/echo";
|
|
18
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/capabilities/app-graph-builder.ts";
|
|
19
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
|
|
20
|
-
createExtension({
|
|
21
|
-
id: `${AUTOMATION_PLUGIN}/assistant`,
|
|
22
|
-
filter: (node) => node.id === ROOT_ID,
|
|
23
|
-
actions: () => [
|
|
24
|
-
{
|
|
25
|
-
id: `${LayoutAction.UpdateDialog._tag}/assistant/open`,
|
|
26
|
-
data: async () => {
|
|
27
|
-
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
28
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
29
|
-
const layout = context.requestCapability(Capabilities.Layout);
|
|
30
|
-
const { graph } = context.requestCapability(Capabilities.AppGraph);
|
|
31
|
-
let chat;
|
|
32
|
-
if (layout.active.length > 0) {
|
|
33
|
-
const node = graph.findNode(layout.active[0]);
|
|
34
|
-
if (node) {
|
|
35
|
-
const space = getSpace(node.data);
|
|
36
|
-
if (space) {
|
|
37
|
-
chat = await getOrCreateChat(dispatch, space);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
const space = client.spaces.default;
|
|
42
|
-
chat = await getOrCreateChat(dispatch, space);
|
|
43
|
-
}
|
|
44
|
-
if (!chat) {
|
|
45
|
-
log.warn("no chat found", void 0, {
|
|
46
|
-
F: __dxlog_file,
|
|
47
|
-
L: 54,
|
|
48
|
-
S: void 0,
|
|
49
|
-
C: (f, a) => f(...a)
|
|
50
|
-
});
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
await dispatch(createIntent(LayoutAction.UpdateDialog, {
|
|
54
|
-
part: "dialog",
|
|
55
|
-
subject: ASSISTANT_DIALOG,
|
|
56
|
-
options: {
|
|
57
|
-
state: true,
|
|
58
|
-
blockAlign: "end",
|
|
59
|
-
props: {
|
|
60
|
-
chat
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}));
|
|
64
|
-
},
|
|
65
|
-
properties: {
|
|
66
|
-
label: [
|
|
67
|
-
"open assistant label",
|
|
68
|
-
{
|
|
69
|
-
ns: AUTOMATION_PLUGIN
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
// TODO(wittjosiah): Use logo icon.
|
|
73
|
-
icon: "ph--chat-centered-text--regular",
|
|
74
|
-
disposition: "item",
|
|
75
|
-
position: "hoist",
|
|
76
|
-
keyBinding: {
|
|
77
|
-
macos: "shift+meta+k",
|
|
78
|
-
windows: "shift+ctrl+k"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
})
|
|
84
|
-
]);
|
|
85
|
-
var getOrCreateChat = async (dispatch, space) => {
|
|
86
|
-
const { objects } = await space.db.query(Filter.schema(AIChatType)).run();
|
|
87
|
-
if (objects.length > 0) {
|
|
88
|
-
return objects[objects.length - 1];
|
|
89
|
-
}
|
|
90
|
-
const { data } = await dispatch(createIntent(AutomationAction.CreateChat, {
|
|
91
|
-
spaceId: space.id
|
|
92
|
-
}));
|
|
93
|
-
invariant(data?.object instanceof AIChatType, void 0, {
|
|
94
|
-
F: __dxlog_file,
|
|
95
|
-
L: 97,
|
|
96
|
-
S: void 0,
|
|
97
|
-
A: [
|
|
98
|
-
"data?.object instanceof AIChatType",
|
|
99
|
-
""
|
|
100
|
-
]
|
|
101
|
-
});
|
|
102
|
-
await dispatch(createIntent(SpaceAction.AddObject, {
|
|
103
|
-
target: space,
|
|
104
|
-
object: data.object
|
|
105
|
-
}));
|
|
106
|
-
return data.object;
|
|
107
|
-
};
|
|
108
|
-
export {
|
|
109
|
-
app_graph_builder_default as default
|
|
110
|
-
};
|
|
111
|
-
//# sourceMappingURL=app-graph-builder-F22H4YBQ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n LayoutAction,\n type PromiseIntentDispatcher,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { type Space, Filter, getSpace } from '@dxos/react-client/echo';\n\nimport { ASSISTANT_DIALOG, AUTOMATION_PLUGIN } from '../meta';\nimport { AIChatType, AutomationAction } from '../types';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${AUTOMATION_PLUGIN}/assistant`,\n filter: (node): node is Node<null> => node.id === ROOT_ID,\n actions: () => [\n {\n id: `${LayoutAction.UpdateDialog._tag}/assistant/open`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n const client = context.requestCapability(ClientCapabilities.Client);\n const layout = context.requestCapability(Capabilities.Layout);\n const { graph } = context.requestCapability(Capabilities.AppGraph);\n\n // TODO(burdon): Get space from workspace.\n // TODO(burdon): If need to create chat, then add to dispatch stack below.\n let chat: AIChatType | undefined;\n if (layout.active.length > 0) {\n const node = graph.findNode(layout.active[0]);\n if (node) {\n const space = getSpace(node.data);\n if (space) {\n chat = await getOrCreateChat(dispatch, space);\n }\n }\n } else {\n const space = client.spaces.default;\n chat = await getOrCreateChat(dispatch, space);\n }\n\n if (!chat) {\n log.warn('no chat found');\n return;\n }\n\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: ASSISTANT_DIALOG,\n options: {\n state: true,\n blockAlign: 'end',\n props: {\n chat,\n },\n },\n }),\n );\n },\n properties: {\n label: ['open assistant label', { ns: AUTOMATION_PLUGIN }],\n // TODO(wittjosiah): Use logo icon.\n icon: 'ph--chat-centered-text--regular',\n disposition: 'item',\n position: 'hoist',\n keyBinding: {\n macos: 'shift+meta+k',\n windows: 'shift+ctrl+k',\n },\n },\n },\n ],\n }),\n ]);\n\n// TODO(burdon): Factor out.\nconst getOrCreateChat = async (dispatch: PromiseIntentDispatcher, space: Space): Promise<AIChatType | undefined> => {\n const { objects } = await space.db.query(Filter.schema(AIChatType)).run();\n if (objects.length > 0) {\n // TODO(burdon): Is this the most recent?\n return objects[objects.length - 1];\n }\n\n const { data } = await dispatch(createIntent(AutomationAction.CreateChat, { spaceId: space.id }));\n invariant(data?.object instanceof AIChatType);\n await dispatch(createIntent(SpaceAction.AddObject, { target: space, object: data.object }));\n return data.object;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,SACEA,cACAC,aACAC,cACAC,oBAGK;AACP,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,0BAA0B;AACnC,SAASC,iBAA4BC,eAAe;AACpD,SAASC,mBAAmB;AAC5B,SAAqBC,QAAQC,gBAAgB;;AAK7C,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,iBAAAA;IACPC,QAAQ,CAACC,SAA6BA,KAAKH,OAAOI;IAClDC,SAAS,MAAM;MACb;QACEL,IAAI,GAAGM,aAAaC,aAAaC,IAAI;QACrCC,MAAM,YAAA;AACJ,gBAAM,EAAEC,iBAAiBC,SAAQ,IAAKhB,QAAQiB,kBAAkBf,aAAagB,gBAAgB;AAC7F,gBAAMC,SAASnB,QAAQiB,kBAAkBG,mBAAmBC,MAAM;AAClE,gBAAMC,SAAStB,QAAQiB,kBAAkBf,aAAaqB,MAAM;AAC5D,gBAAM,EAAEC,MAAK,IAAKxB,QAAQiB,kBAAkBf,aAAauB,QAAQ;AAIjE,cAAIC;AACJ,cAAIJ,OAAOK,OAAOC,SAAS,GAAG;AAC5B,kBAAMpB,OAAOgB,MAAMK,SAASP,OAAOK,OAAO,CAAA,CAAE;AAC5C,gBAAInB,MAAM;AACR,oBAAMsB,QAAQC,SAASvB,KAAKM,IAAI;AAChC,kBAAIgB,OAAO;AACTJ,uBAAO,MAAMM,gBAAgBhB,UAAUc,KAAAA;cACzC;YACF;UACF,OAAO;AACL,kBAAMA,QAAQX,OAAOc,OAAOC;AAC5BR,mBAAO,MAAMM,gBAAgBhB,UAAUc,KAAAA;UACzC;AAEA,cAAI,CAACJ,MAAM;AACTS,gBAAIC,KAAK,iBAAA,QAAA;;;;;;AACT;UACF;AAEA,gBAAMpB,SACJqB,aAAa1B,aAAaC,cAAc;YACtC0B,MAAM;YACNC,SAASC;YACTC,SAAS;cACPC,OAAO;cACPC,YAAY;cACZC,OAAO;gBACLlB;cACF;YACF;UACF,CAAA,CAAA;QAEJ;QACAmB,YAAY;UACVC,OAAO;YAAC;YAAwB;cAAEC,IAAIzC;YAAkB;;;UAExD0C,MAAM;UACNC,aAAa;UACbC,UAAU;UACVC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;;EAEJ,CAAA;CACD;AAGH,IAAMrB,kBAAkB,OAAOhB,UAAmCc,UAAAA;AAChE,QAAM,EAAEwB,QAAO,IAAK,MAAMxB,MAAMyB,GAAGC,MAAMC,OAAOC,OAAOC,UAAAA,CAAAA,EAAaC,IAAG;AACvE,MAAIN,QAAQ1B,SAAS,GAAG;AAEtB,WAAO0B,QAAQA,QAAQ1B,SAAS,CAAA;EAClC;AAEA,QAAM,EAAEd,KAAI,IAAK,MAAME,SAASqB,aAAawB,iBAAiBC,YAAY;IAAEC,SAASjC,MAAMzB;EAAG,CAAA,CAAA;AAC9F2D,YAAUlD,MAAMmD,kBAAkBN,YAAAA,QAAAA;;;;;;;;;AAClC,QAAM3C,SAASqB,aAAa6B,YAAYC,WAAW;IAAEC,QAAQtC;IAAOmC,QAAQnD,KAAKmD;EAAO,CAAA,CAAA;AACxF,SAAOnD,KAAKmD;AACd;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "createIntent", "LayoutAction", "invariant", "log", "ClientCapabilities", "createExtension", "ROOT_ID", "SpaceAction", "Filter", "getSpace", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "AUTOMATION_PLUGIN", "filter", "node", "ROOT_ID", "actions", "LayoutAction", "UpdateDialog", "_tag", "data", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "client", "ClientCapabilities", "Client", "layout", "Layout", "graph", "AppGraph", "chat", "active", "length", "findNode", "space", "getSpace", "getOrCreateChat", "spaces", "default", "log", "warn", "createIntent", "part", "subject", "ASSISTANT_DIALOG", "options", "state", "blockAlign", "props", "properties", "label", "ns", "icon", "disposition", "position", "keyBinding", "macos", "windows", "objects", "db", "query", "Filter", "schema", "AIChatType", "run", "AutomationAction", "CreateChat", "spaceId", "invariant", "object", "SpaceAction", "AddObject", "target"]
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AUTOMATION_PLUGIN
|
|
3
|
-
} from "./chunk-HZSTXZWK.mjs";
|
|
4
|
-
|
|
5
|
-
// packages/plugins/experimental/plugin-automation/src/capabilities/capabilities.ts
|
|
6
|
-
import { defineCapability } from "@dxos/app-framework";
|
|
7
|
-
var AutomationCapabilities;
|
|
8
|
-
(function(AutomationCapabilities2) {
|
|
9
|
-
AutomationCapabilities2.AiClient = defineCapability(`${AUTOMATION_PLUGIN}/capability/ai-client`);
|
|
10
|
-
})(AutomationCapabilities || (AutomationCapabilities = {}));
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
AutomationCapabilities
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=chunk-67KDIIM6.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type AIServiceClientImpl } from '@dxos/assistant';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport namespace AutomationCapabilities {\n export const AiClient = defineCapability<AIServiceClientImpl>(`${AUTOMATION_PLUGIN}/capability/ai-client`);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,wBAAwB;;UAKhBC,yBAAAA;0BACFC,WAAWC,iBAAsC,GAAGC,iBAAAA,uBAAwC;AAC3G,GAFiBH,2BAAAA,yBAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["defineCapability", "AutomationCapabilities", "AiClient", "defineCapability", "AUTOMATION_PLUGIN"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';\n\nexport const ASSISTANT_DIALOG = `${AUTOMATION_PLUGIN}/assistant/dialog`;\n\nexport const meta = {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description:\n 'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',\n icon: 'ph--magic-wand--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-automation',\n tags: ['experimental'],\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,oBAAoB;AAE1B,IAAMC,mBAAmB,GAAGD,iBAAAA;AAE5B,IAAME,OAAO;EAClBC,IAAIH;EACJI,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;",
|
|
6
|
-
"names": ["AUTOMATION_PLUGIN", "ASSISTANT_DIALOG", "meta", "id", "name", "description", "icon", "source", "tags"]
|
|
7
|
-
}
|