@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
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { ComputeGraph } from '@dxos/conductor';
|
|
2
|
-
import { Expando, S, type Ref$ } from '@dxos/echo-schema';
|
|
3
|
-
import { FunctionType } from '@dxos/functions';
|
|
4
|
-
export declare enum ChainInputType {
|
|
5
|
-
VALUE = 0,
|
|
6
|
-
PASS_THROUGH = 1,
|
|
7
|
-
RETRIEVER = 2,
|
|
8
|
-
FUNCTION = 3,
|
|
9
|
-
QUERY = 4,
|
|
10
|
-
RESOLVER = 5,
|
|
11
|
-
CONTEXT = 6,
|
|
12
|
-
SCHEMA = 7
|
|
13
|
-
}
|
|
14
|
-
export declare const ChainInputSchema: S.mutable<S.Struct<{
|
|
15
|
-
name: typeof S.String;
|
|
16
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
17
|
-
value: S.optional<typeof S.String>;
|
|
18
|
-
}>>;
|
|
19
|
-
export type ChainInput = S.Schema.Type<typeof ChainInputSchema>;
|
|
20
|
-
declare const ChainPromptType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
21
|
-
command: S.optional<typeof S.String>;
|
|
22
|
-
template: typeof S.String;
|
|
23
|
-
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
24
|
-
name: typeof S.String;
|
|
25
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
26
|
-
value: S.optional<typeof S.String>;
|
|
27
|
-
}>>>>>;
|
|
28
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
29
|
-
command: S.optional<typeof S.String>;
|
|
30
|
-
template: typeof S.String;
|
|
31
|
-
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
32
|
-
name: typeof S.String;
|
|
33
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
34
|
-
value: S.optional<typeof S.String>;
|
|
35
|
-
}>>>>>;
|
|
36
|
-
}>>;
|
|
37
|
-
export declare class ChainPromptType extends ChainPromptType_base {
|
|
38
|
-
}
|
|
39
|
-
declare const ChainType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
40
|
-
name: S.optional<typeof S.String>;
|
|
41
|
-
prompts: S.optional<S.mutable<S.Array$<Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
42
|
-
command: S.optional<typeof S.String>;
|
|
43
|
-
template: typeof S.String;
|
|
44
|
-
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
45
|
-
name: typeof S.String;
|
|
46
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
47
|
-
value: S.optional<typeof S.String>;
|
|
48
|
-
}>>>>>;
|
|
49
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>>;
|
|
50
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
51
|
-
name: S.optional<typeof S.String>;
|
|
52
|
-
prompts: S.optional<S.mutable<S.Array$<Ref$<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
53
|
-
command: S.optional<typeof S.String>;
|
|
54
|
-
template: typeof S.String;
|
|
55
|
-
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
56
|
-
name: typeof S.String;
|
|
57
|
-
type: S.optional<S.Enums<typeof ChainInputType>>;
|
|
58
|
-
value: S.optional<typeof S.String>;
|
|
59
|
-
}>>>>>;
|
|
60
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>>>;
|
|
61
|
-
}>>;
|
|
62
|
-
export declare class ChainType extends ChainType_base {
|
|
63
|
-
}
|
|
64
|
-
declare const AIChatType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
65
|
-
name: S.optional<typeof S.String>;
|
|
66
|
-
queue: Ref$<Expando>;
|
|
67
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
68
|
-
name: S.optional<typeof S.String>;
|
|
69
|
-
queue: Ref$<Expando>;
|
|
70
|
-
}>>;
|
|
71
|
-
export declare class AIChatType extends AIChatType_base {
|
|
72
|
-
}
|
|
73
|
-
export declare const ApiAuthorization: S.Union<[S.Struct<{
|
|
74
|
-
type: S.Literal<["api-key"]>;
|
|
75
|
-
key: typeof S.String;
|
|
76
|
-
placement: S.Union<[S.Struct<{
|
|
77
|
-
type: S.Literal<["authorization-header"]>;
|
|
78
|
-
}>, S.Struct<{
|
|
79
|
-
type: S.Literal<["query"]>;
|
|
80
|
-
name: typeof S.String;
|
|
81
|
-
}>]>;
|
|
82
|
-
}>, S.Struct<{
|
|
83
|
-
type: S.Literal<["oauth"]>;
|
|
84
|
-
clientId: typeof S.String;
|
|
85
|
-
clientSecret: typeof S.String;
|
|
86
|
-
tokenUrl: typeof S.String;
|
|
87
|
-
grantType: typeof S.String;
|
|
88
|
-
}>]>;
|
|
89
|
-
export type ApiAuthorization = S.Schema.Type<typeof ApiAuthorization>;
|
|
90
|
-
declare const ServiceInterface: S.Union<[S.Struct<{
|
|
91
|
-
kind: S.Literal<["function"]>;
|
|
92
|
-
fn: Ref$<FunctionType>;
|
|
93
|
-
}>, S.Struct<{
|
|
94
|
-
kind: S.Literal<["workflow"]>;
|
|
95
|
-
workflow: Ref$<ComputeGraph>;
|
|
96
|
-
}>, S.Struct<{
|
|
97
|
-
kind: S.Literal<["api"]>;
|
|
98
|
-
/**
|
|
99
|
-
* URL to fetch the openapi schema.
|
|
100
|
-
*/
|
|
101
|
-
schemaUrl: S.optional<typeof S.String>;
|
|
102
|
-
/**
|
|
103
|
-
* Inlined openapi schema.
|
|
104
|
-
*/
|
|
105
|
-
schema: S.optional<typeof S.Any>;
|
|
106
|
-
/**
|
|
107
|
-
* Authorization configuration if required.
|
|
108
|
-
*/
|
|
109
|
-
authorization: S.optional<S.Union<[S.Struct<{
|
|
110
|
-
type: S.Literal<["api-key"]>;
|
|
111
|
-
key: typeof S.String;
|
|
112
|
-
placement: S.Union<[S.Struct<{
|
|
113
|
-
type: S.Literal<["authorization-header"]>;
|
|
114
|
-
}>, S.Struct<{
|
|
115
|
-
type: S.Literal<["query"]>;
|
|
116
|
-
name: typeof S.String;
|
|
117
|
-
}>]>;
|
|
118
|
-
}>, S.Struct<{
|
|
119
|
-
type: S.Literal<["oauth"]>;
|
|
120
|
-
clientId: typeof S.String;
|
|
121
|
-
clientSecret: typeof S.String;
|
|
122
|
-
tokenUrl: typeof S.String;
|
|
123
|
-
grantType: typeof S.String;
|
|
124
|
-
}>]>>;
|
|
125
|
-
}>]>;
|
|
126
|
-
export type ServiceInterface = S.Schema.Type<typeof ServiceInterface>;
|
|
127
|
-
declare const ServiceType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectFields<{
|
|
128
|
-
serviceId: typeof S.String;
|
|
129
|
-
name: S.optional<typeof S.String>;
|
|
130
|
-
description: S.optional<typeof S.String>;
|
|
131
|
-
category: S.optional<typeof S.String>;
|
|
132
|
-
enabled: S.optional<typeof S.Boolean>;
|
|
133
|
-
/**
|
|
134
|
-
* Entries exposed: functions, workflows, and APIs.
|
|
135
|
-
*/
|
|
136
|
-
interfaces: S.optional<S.Array$<S.Union<[S.Struct<{
|
|
137
|
-
kind: S.Literal<["function"]>;
|
|
138
|
-
fn: Ref$<FunctionType>;
|
|
139
|
-
}>, S.Struct<{
|
|
140
|
-
kind: S.Literal<["workflow"]>;
|
|
141
|
-
workflow: Ref$<ComputeGraph>;
|
|
142
|
-
}>, S.Struct<{
|
|
143
|
-
kind: S.Literal<["api"]>;
|
|
144
|
-
/**
|
|
145
|
-
* URL to fetch the openapi schema.
|
|
146
|
-
*/
|
|
147
|
-
schemaUrl: S.optional<typeof S.String>;
|
|
148
|
-
/**
|
|
149
|
-
* Inlined openapi schema.
|
|
150
|
-
*/
|
|
151
|
-
schema: S.optional<typeof S.Any>;
|
|
152
|
-
/**
|
|
153
|
-
* Authorization configuration if required.
|
|
154
|
-
*/
|
|
155
|
-
authorization: S.optional<S.Union<[S.Struct<{
|
|
156
|
-
type: S.Literal<["api-key"]>;
|
|
157
|
-
key: typeof S.String;
|
|
158
|
-
placement: S.Union<[S.Struct<{
|
|
159
|
-
type: S.Literal<["authorization-header"]>;
|
|
160
|
-
}>, S.Struct<{
|
|
161
|
-
type: S.Literal<["query"]>;
|
|
162
|
-
name: typeof S.String;
|
|
163
|
-
}>]>;
|
|
164
|
-
}>, S.Struct<{
|
|
165
|
-
type: S.Literal<["oauth"]>;
|
|
166
|
-
clientId: typeof S.String;
|
|
167
|
-
clientSecret: typeof S.String;
|
|
168
|
-
tokenUrl: typeof S.String;
|
|
169
|
-
grantType: typeof S.String;
|
|
170
|
-
}>]>>;
|
|
171
|
-
}>]>>>;
|
|
172
|
-
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
173
|
-
serviceId: typeof S.String;
|
|
174
|
-
name: S.optional<typeof S.String>;
|
|
175
|
-
description: S.optional<typeof S.String>;
|
|
176
|
-
category: S.optional<typeof S.String>;
|
|
177
|
-
enabled: S.optional<typeof S.Boolean>;
|
|
178
|
-
/**
|
|
179
|
-
* Entries exposed: functions, workflows, and APIs.
|
|
180
|
-
*/
|
|
181
|
-
interfaces: S.optional<S.Array$<S.Union<[S.Struct<{
|
|
182
|
-
kind: S.Literal<["function"]>;
|
|
183
|
-
fn: Ref$<FunctionType>;
|
|
184
|
-
}>, S.Struct<{
|
|
185
|
-
kind: S.Literal<["workflow"]>;
|
|
186
|
-
workflow: Ref$<ComputeGraph>;
|
|
187
|
-
}>, S.Struct<{
|
|
188
|
-
kind: S.Literal<["api"]>;
|
|
189
|
-
/**
|
|
190
|
-
* URL to fetch the openapi schema.
|
|
191
|
-
*/
|
|
192
|
-
schemaUrl: S.optional<typeof S.String>;
|
|
193
|
-
/**
|
|
194
|
-
* Inlined openapi schema.
|
|
195
|
-
*/
|
|
196
|
-
schema: S.optional<typeof S.Any>;
|
|
197
|
-
/**
|
|
198
|
-
* Authorization configuration if required.
|
|
199
|
-
*/
|
|
200
|
-
authorization: S.optional<S.Union<[S.Struct<{
|
|
201
|
-
type: S.Literal<["api-key"]>;
|
|
202
|
-
key: typeof S.String;
|
|
203
|
-
placement: S.Union<[S.Struct<{
|
|
204
|
-
type: S.Literal<["authorization-header"]>;
|
|
205
|
-
}>, S.Struct<{
|
|
206
|
-
type: S.Literal<["query"]>;
|
|
207
|
-
name: typeof S.String;
|
|
208
|
-
}>]>;
|
|
209
|
-
}>, S.Struct<{
|
|
210
|
-
type: S.Literal<["oauth"]>;
|
|
211
|
-
clientId: typeof S.String;
|
|
212
|
-
clientSecret: typeof S.String;
|
|
213
|
-
tokenUrl: typeof S.String;
|
|
214
|
-
grantType: typeof S.String;
|
|
215
|
-
}>]>>;
|
|
216
|
-
}>]>>>;
|
|
217
|
-
}>>;
|
|
218
|
-
export declare class ServiceType extends ServiceType_base {
|
|
219
|
-
}
|
|
220
|
-
export {};
|
|
221
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAO,CAAC,EAAe,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,oBAAY,cAAc;IACxB,KAAK,IAAI;IACT,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,eAAO,MAAM,gBAAgB;;;;GAM5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;;;;;;;;;;;;;;;;;;AAEhE,qBAAa,eAAgB,SAAQ,oBAInC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;AAEL,qBAAa,SAAU,SAAQ,cAG7B;CAAG;;;;;;;;AAEL,qBAAa,UAAW,SAAQ,eAI9B;CAAG;AAwBL,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;IAAsD,CAAC;AACpF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AA+BtE,QAAA,MAAM,gBAAgB;;QA3BK,IAAI,CAAC,YAAY,CAAC;;;cAKZ,IAAI,CAAC,YAAY,CAAC;;;IAMjD;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;IAIoG,CAAC;AAC1G,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;;;;;;;IAyBpE;;OAEG;;;YAvDsB,IAAI,CAAC,YAAY,CAAC;;;kBAKZ,IAAI,CAAC,YAAY,CAAC;;;QAMjD;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;IA8BH;;OAEG;;;YAvDsB,IAAI,CAAC,YAAY,CAAC;;;kBAKZ,IAAI,CAAC,YAAY,CAAC;;;QAMjD;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;;;;;;;;;;;;;;;;;;AAuBL,qBAAa,WAAY,SAAQ,gBAW/B;CAAG"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { S } from '@dxos/echo-schema';
|
|
2
|
-
import { AIChatType } from './schema';
|
|
3
|
-
export declare namespace AutomationAction {
|
|
4
|
-
const CreateChat_base: S.TaggedClass<CreateChat, "dxos.org/plugin/automation/action/create-chat", {
|
|
5
|
-
readonly _tag: S.tag<"dxos.org/plugin/automation/action/create-chat">;
|
|
6
|
-
} & {
|
|
7
|
-
input: S.Struct<{
|
|
8
|
-
spaceId: S.optional<typeof S.String>;
|
|
9
|
-
name: S.optional<typeof S.String>;
|
|
10
|
-
}>;
|
|
11
|
-
output: S.Struct<{
|
|
12
|
-
object: typeof AIChatType;
|
|
13
|
-
}>;
|
|
14
|
-
}>;
|
|
15
|
-
export class CreateChat extends CreateChat_base {
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,yBAAiB,gBAAgB,CAAC;;;;;;;;;;;;IAGhC,MAAM,OAAO,UAAW,SAAQ,eAQ9B;KAAG;;CACN"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
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
|
-
// TODO(wittjosiah): Use logo icon.
|
|
75
|
-
icon: 'ph--chat-centered-text--regular',
|
|
76
|
-
disposition: 'item',
|
|
77
|
-
position: 'hoist',
|
|
78
|
-
keyBinding: {
|
|
79
|
-
macos: 'shift+meta+k',
|
|
80
|
-
windows: 'shift+ctrl+k',
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
}),
|
|
86
|
-
]);
|
|
87
|
-
|
|
88
|
-
// TODO(burdon): Factor out.
|
|
89
|
-
const getOrCreateChat = async (dispatch: PromiseIntentDispatcher, space: Space): Promise<AIChatType | undefined> => {
|
|
90
|
-
const { objects } = await space.db.query(Filter.schema(AIChatType)).run();
|
|
91
|
-
if (objects.length > 0) {
|
|
92
|
-
// TODO(burdon): Is this the most recent?
|
|
93
|
-
return objects[objects.length - 1];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const { data } = await dispatch(createIntent(AutomationAction.CreateChat, { spaceId: space.id }));
|
|
97
|
-
invariant(data?.object instanceof AIChatType);
|
|
98
|
-
await dispatch(createIntent(SpaceAction.AddObject, { target: space, object: data.object }));
|
|
99
|
-
return data.object;
|
|
100
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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 } 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
|
-
);
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
-
import React, { useState } from 'react';
|
|
9
|
-
|
|
10
|
-
import { IntentPlugin } from '@dxos/app-framework';
|
|
11
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { Config } from '@dxos/client';
|
|
13
|
-
import { faker } from '@dxos/random';
|
|
14
|
-
import { withClientProvider } from '@dxos/react-client/testing';
|
|
15
|
-
import { Dialog, Toolbar, Button } from '@dxos/react-ui';
|
|
16
|
-
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
17
|
-
|
|
18
|
-
import { AmbientDialog } from './AmbientDialog';
|
|
19
|
-
import translations from '../../translations';
|
|
20
|
-
|
|
21
|
-
const meta: Meta<typeof AmbientDialog> = {
|
|
22
|
-
title: 'plugins/plugin-automation/AmbientDialog',
|
|
23
|
-
component: AmbientDialog,
|
|
24
|
-
render: () => {
|
|
25
|
-
const [open, setOpen] = useState(true);
|
|
26
|
-
const [items, setItems] = useState<string[]>([]);
|
|
27
|
-
return (
|
|
28
|
-
<>
|
|
29
|
-
<div>
|
|
30
|
-
<Toolbar.Root>
|
|
31
|
-
<Toolbar.Button onClick={() => setOpen(true)}>Open</Toolbar.Button>
|
|
32
|
-
</Toolbar.Root>
|
|
33
|
-
</div>
|
|
34
|
-
<Dialog.Root open={open} onOpenChange={setOpen}>
|
|
35
|
-
<AmbientDialog>
|
|
36
|
-
<div className='flex flex-col h-full overflow-hidden'>
|
|
37
|
-
<div className='flex flex-col h-full gap-2 overflow-auto'>
|
|
38
|
-
{items.map((item) => (
|
|
39
|
-
<div key={item} className='px-2'>
|
|
40
|
-
{item}
|
|
41
|
-
</div>
|
|
42
|
-
))}
|
|
43
|
-
{items.length > 0 && <div className='pbe-2' />}
|
|
44
|
-
</div>
|
|
45
|
-
<div className='shrink-0 h-[40px]'>
|
|
46
|
-
<Button onClick={() => setItems([...items, faker.lorem.word()])}>Add</Button>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</AmbientDialog>
|
|
50
|
-
</Dialog.Root>
|
|
51
|
-
</>
|
|
52
|
-
);
|
|
53
|
-
},
|
|
54
|
-
decorators: [
|
|
55
|
-
withClientProvider({
|
|
56
|
-
config: new Config({
|
|
57
|
-
runtime: {
|
|
58
|
-
client: { edgeFeatures: { signaling: true } },
|
|
59
|
-
services: {
|
|
60
|
-
edge: { url: 'https://edge.dxos.workers.dev/' },
|
|
61
|
-
iceProviders: [{ urls: 'https://edge.dxos.workers.dev/ice' }],
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
}),
|
|
65
|
-
createIdentity: true,
|
|
66
|
-
createSpace: true,
|
|
67
|
-
}),
|
|
68
|
-
withPluginManager({ plugins: [IntentPlugin()] }),
|
|
69
|
-
withTheme,
|
|
70
|
-
withLayout({ fullscreen: true, tooltips: true }),
|
|
71
|
-
],
|
|
72
|
-
parameters: {
|
|
73
|
-
translations,
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export default meta;
|
|
78
|
-
|
|
79
|
-
type Story = StoryObj<typeof AmbientDialog>;
|
|
80
|
-
|
|
81
|
-
export const Default: Story = {};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type PropsWithChildren, useCallback, useEffect, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Dialog, Icon, IconButton } from '@dxos/react-ui';
|
|
8
|
-
import { resizeAttributes, ResizeHandle, type Size, sizeStyle } from '@dxos/react-ui-dnd';
|
|
9
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
10
|
-
|
|
11
|
-
const preventDefault = (event: Event) => event.preventDefault();
|
|
12
|
-
|
|
13
|
-
const minSize = 5;
|
|
14
|
-
|
|
15
|
-
// TODO(burdon): Factor out.
|
|
16
|
-
export const AmbientDialog = ({
|
|
17
|
-
children,
|
|
18
|
-
open: _open,
|
|
19
|
-
title,
|
|
20
|
-
onOpenChange,
|
|
21
|
-
}: PropsWithChildren<{ open?: boolean; onOpenChange?: (open: boolean) => void; title?: string }>) => {
|
|
22
|
-
const [resizeKey, setReizeKey] = useState(0);
|
|
23
|
-
const [size, setSize] = useState<Size>('min-content');
|
|
24
|
-
const [open, setOpen] = useState(_open);
|
|
25
|
-
|
|
26
|
-
// Update controlled value.
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
setOpen(_open);
|
|
29
|
-
}, [_open]);
|
|
30
|
-
|
|
31
|
-
// Update size and key.
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
setSize(open ? 'min-content' : minSize);
|
|
34
|
-
setReizeKey((key) => key + 1);
|
|
35
|
-
}, [open]);
|
|
36
|
-
|
|
37
|
-
// TODO(burdon): Animate open/close.
|
|
38
|
-
// NOTE: We set the min size to 5rem (80px), and the header and prompt bar to 40px (i.e., the rail-size) each.
|
|
39
|
-
// The dialog has no vertical padding and has box-content so that when closed it collapses to the size of the header and prompt bar.
|
|
40
|
-
const handleToggle = useCallback(() => {
|
|
41
|
-
setOpen((open) => {
|
|
42
|
-
onOpenChange?.(!open);
|
|
43
|
-
return !open;
|
|
44
|
-
});
|
|
45
|
-
}, []);
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<div role='none' className='dx-dialog__overlay bg-transparent pointer-events-none' data-block-align='end'>
|
|
49
|
-
<Dialog.Content
|
|
50
|
-
classNames='relative box-content py-0 px-2 md:is-[35rem] md:max-is-none overflow-hidden pointer-events-auto transition-[block-size] ease-in-out duration-0 [&:not([data-dx-resizing="true"])]:duration-200'
|
|
51
|
-
inOverlayLayout
|
|
52
|
-
{...resizeAttributes}
|
|
53
|
-
style={{
|
|
54
|
-
...sizeStyle(size, 'vertical', true),
|
|
55
|
-
maxBlockSize: 'calc(100dvh - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 8rem)',
|
|
56
|
-
}}
|
|
57
|
-
onInteractOutside={preventDefault}
|
|
58
|
-
>
|
|
59
|
-
<ResizeHandle
|
|
60
|
-
key={resizeKey}
|
|
61
|
-
side='block-start'
|
|
62
|
-
defaultSize='min-content'
|
|
63
|
-
minSize={minSize}
|
|
64
|
-
fallbackSize={minSize}
|
|
65
|
-
iconPosition='center'
|
|
66
|
-
onSizeChange={setSize}
|
|
67
|
-
/>
|
|
68
|
-
|
|
69
|
-
<DialogHeader open={open} title={title} onToggle={handleToggle} />
|
|
70
|
-
|
|
71
|
-
{children}
|
|
72
|
-
</Dialog.Content>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Matches same layout grid as PromptBar.
|
|
79
|
-
*/
|
|
80
|
-
const DialogHeader = ({ open, title, onToggle }: { open?: boolean; title?: string; onToggle: () => void }) => {
|
|
81
|
-
return (
|
|
82
|
-
<div className='flex shrink-0 w-full grid grid-cols-[var(--rail-action)_1fr_var(--rail-action)] items-center overflow-hidden'>
|
|
83
|
-
<div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
|
|
84
|
-
<Dialog.Close>
|
|
85
|
-
<Icon icon='ph--x--regular' />
|
|
86
|
-
</Dialog.Close>
|
|
87
|
-
</div>
|
|
88
|
-
<div className='grow'>
|
|
89
|
-
<Dialog.Title classNames='flex justify-center text-xs text-subdued'>{title}</Dialog.Title>
|
|
90
|
-
</div>
|
|
91
|
-
<div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
|
|
92
|
-
<IconButton
|
|
93
|
-
variant='ghost'
|
|
94
|
-
icon={'ph--caret-up--regular'}
|
|
95
|
-
classNames={mx('[&>svg]:transition [&>svg]:duration-200', open && '[&>svg]:rotate-180')}
|
|
96
|
-
iconOnly
|
|
97
|
-
label='Shrink'
|
|
98
|
-
onClick={onToggle}
|
|
99
|
-
/>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
);
|
|
103
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type FC, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
-
|
|
9
|
-
import { AUTOMATION_PLUGIN } from '../../meta';
|
|
10
|
-
import { type AIChatType } from '../../types';
|
|
11
|
-
import { AmbientDialog } from '../AmbientDialog';
|
|
12
|
-
import { ThreadContainer } from '../Thread';
|
|
13
|
-
|
|
14
|
-
export const AssistantDialog: FC<{ chat?: AIChatType }> = ({ chat }) => {
|
|
15
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
16
|
-
const [open, setOpen] = useState(false);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<AmbientDialog open={open} onOpenChange={setOpen} title={t('assistant dialog title')}>
|
|
20
|
-
<ThreadContainer chat={chat} onOpenChange={setOpen} />
|
|
21
|
-
</AmbientDialog>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
8
|
-
|
|
9
|
-
import { type AIChatType } from '../../types';
|
|
10
|
-
import { ThreadContainer } from '../Thread';
|
|
11
|
-
|
|
12
|
-
// TODO(burdon): Attention.
|
|
13
|
-
export const ChatContainer = ({ chat, role }: { chat: AIChatType; role: string }) => {
|
|
14
|
-
return (
|
|
15
|
-
<StackItem.Content toolbar={false} role={role} classNames='mli-auto w-full max-w-[50rem]'>
|
|
16
|
-
<ThreadContainer chat={chat} />
|
|
17
|
-
</StackItem.Content>
|
|
18
|
-
);
|
|
19
|
-
};
|