@dxos/plugin-automation 0.7.5-main.b19bfc8 → 0.7.5-main.d9d2d4e
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 +17 -199
- 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/{TemplateContainer-3YCM6XPU.cjs → chunk-CB5OB6JH.cjs} +8 -21
- 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 +32 -198
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{ChatContainer-4QTLL7TH.cjs → react-surface-2WRVAPGR.cjs} +20 -30
- 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 +17 -199
- 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 -181
- 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 -17
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- 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 -127
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +21 -77
- package/src/AutomationPlugin.tsx +7 -86
- package/src/capabilities/complementary-panel.ts +56 -0
- package/src/capabilities/index.ts +1 -6
- package/src/capabilities/react-surface.tsx +3 -44
- 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 -9
- package/src/index.ts +0 -1
- 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 -47
- package/dist/lib/browser/AssistantDialog-V67OWLRP.mjs +0 -116
- package/dist/lib/browser/AssistantDialog-V67OWLRP.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs +0 -8
- package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-5BS6THNV.mjs +0 -33
- package/dist/lib/browser/ChatContainer-5BS6THNV.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-HJJV44CE.mjs +0 -23
- package/dist/lib/browser/TemplateContainer-HJJV44CE.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-IR3CGVM6.mjs +0 -110
- package/dist/lib/browser/app-graph-builder-IR3CGVM6.mjs.map +0 -7
- package/dist/lib/browser/chunk-62E2AEXF.mjs +0 -162
- package/dist/lib/browser/chunk-62E2AEXF.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-BQ4WHY4D.mjs +0 -1818
- package/dist/lib/browser/chunk-BQ4WHY4D.mjs.map +0 -7
- package/dist/lib/browser/chunk-HZSTXZWK.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-QH5E22EL.mjs +0 -108
- package/dist/lib/browser/chunk-QH5E22EL.mjs.map +0 -7
- package/dist/lib/browser/chunk-XAIWETH6.mjs +0 -81
- package/dist/lib/browser/chunk-XAIWETH6.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-ICLE6FSI.mjs +0 -44
- package/dist/lib/browser/intent-resolver-ICLE6FSI.mjs.map +0 -7
- package/dist/lib/browser/react-surface-KEKVLCPQ.mjs +0 -80
- package/dist/lib/browser/react-surface-KEKVLCPQ.mjs.map +0 -7
- package/dist/lib/browser/settings-FE5DDWOE.mjs +0 -22
- package/dist/lib/browser/settings-FE5DDWOE.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/AssistantDialog-E62O72KI.cjs +0 -140
- package/dist/lib/node/AssistantDialog-E62O72KI.cjs.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-4QTLL7TH.cjs.map +0 -7
- package/dist/lib/node/TemplateContainer-3YCM6XPU.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-ECNVGTRT.cjs +0 -122
- package/dist/lib/node/app-graph-builder-ECNVGTRT.cjs.map +0 -7
- package/dist/lib/node/chunk-3QSK6IPK.cjs +0 -133
- package/dist/lib/node/chunk-3QSK6IPK.cjs.map +0 -7
- package/dist/lib/node/chunk-76F5BCJE.cjs +0 -111
- package/dist/lib/node/chunk-76F5BCJE.cjs.map +0 -7
- package/dist/lib/node/chunk-B37JIAOP.cjs +0 -1795
- package/dist/lib/node/chunk-B37JIAOP.cjs.map +0 -7
- package/dist/lib/node/chunk-BAQRBGOJ.cjs.map +0 -7
- package/dist/lib/node/chunk-UVWK2XJE.cjs +0 -183
- package/dist/lib/node/chunk-UVWK2XJE.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-4MQZULXW.cjs +0 -58
- package/dist/lib/node/intent-resolver-4MQZULXW.cjs.map +0 -7
- package/dist/lib/node/react-surface-4RVHY6WI.cjs +0 -95
- package/dist/lib/node/react-surface-4RVHY6WI.cjs.map +0 -7
- package/dist/lib/node/settings-GOIB2WJQ.cjs +0 -36
- package/dist/lib/node/settings-GOIB2WJQ.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/AssistantDialog-IPRBJKWA.mjs +0 -117
- package/dist/lib/node-esm/AssistantDialog-IPRBJKWA.mjs.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-4IWUGMGM.mjs +0 -34
- package/dist/lib/node-esm/ChatContainer-4IWUGMGM.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-YJIXR24Z.mjs +0 -24
- package/dist/lib/node-esm/TemplateContainer-YJIXR24Z.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-HMRKSZ2X.mjs +0 -111
- package/dist/lib/node-esm/app-graph-builder-HMRKSZ2X.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5BKKHYO5.mjs +0 -163
- package/dist/lib/node-esm/chunk-5BKKHYO5.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-CAWPHOY4.mjs +0 -82
- package/dist/lib/node-esm/chunk-CAWPHOY4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-I32H7MCF.mjs +0 -109
- package/dist/lib/node-esm/chunk-I32H7MCF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IG4GSWZN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QHKP5HT2.mjs +0 -1819
- package/dist/lib/node-esm/chunk-QHKP5HT2.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-ZS7XTYLG.mjs +0 -45
- package/dist/lib/node-esm/intent-resolver-ZS7XTYLG.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-5ILD642V.mjs +0 -81
- package/dist/lib/node-esm/react-surface-5ILD642V.mjs.map +0 -7
- package/dist/lib/node-esm/settings-ANNQPPRY.mjs +0 -23
- package/dist/lib/node-esm/settings-ANNQPPRY.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/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.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.d.ts +0 -7
- package/dist/types/src/components/AssistantDialog.d.ts.map +0 -1
- package/dist/types/src/components/AutomationSettings/AutomationSettings.d.ts +0 -5
- package/dist/types/src/components/AutomationSettings/AutomationSettings.d.ts.map +0 -1
- package/dist/types/src/components/AutomationSettings/index.d.ts +0 -2
- package/dist/types/src/components/AutomationSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer.d.ts +0 -7
- package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +0 -17
- 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/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/TemplateContainer.d.ts +0 -7
- package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +0 -12
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +0 -8
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +0 -10
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +0 -8
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/index.d.ts +0 -2
- package/dist/types/src/components/TemplateEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/TemplateEditor/types.d.ts +0 -18
- package/dist/types/src/components/TemplateEditor/types.d.ts.map +0 -1
- package/dist/types/src/components/Thread/Thread.d.ts +0 -17
- 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 -10
- 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 -8
- 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/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/chat.d.ts +0 -12
- package/dist/types/src/types/chat.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -5
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/service.d.ts +0 -160
- package/dist/types/src/types/service.d.ts.map +0 -1
- package/dist/types/src/types/template.d.ts +0 -40
- package/dist/types/src/types/template.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -37
- 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 -99
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/intent-resolver.ts +0 -38
- package/src/capabilities/settings.ts +0 -19
- 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.tsx +0 -33
- package/src/components/AutomationSettings/AutomationSettings.tsx +0 -49
- package/src/components/AutomationSettings/index.ts +0 -5
- package/src/components/ChatContainer.tsx +0 -29
- package/src/components/Prompt/Prompt.stories.tsx +0 -79
- package/src/components/Prompt/Prompt.tsx +0 -100
- 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/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/TemplateContainer.tsx +0 -21
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +0 -72
- package/src/components/TemplateEditor/TemplateEditor.tsx +0 -76
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +0 -65
- package/src/components/TemplateEditor/TemplateForm.tsx +0 -184
- package/src/components/TemplateEditor/index.ts +0 -5
- package/src/components/TemplateEditor/types.tsx +0 -28
- package/src/components/Thread/Thread.stories.tsx +0 -212
- package/src/components/Thread/Thread.tsx +0 -97
- package/src/components/Thread/ThreadContainer.stories.tsx +0 -258
- package/src/components/Thread/ThreadContainer.tsx +0 -78
- package/src/components/Thread/ThreadMessage.tsx +0 -187
- package/src/components/Thread/ToolInvocations.tsx +0 -93
- package/src/components/Thread/index.ts +0 -6
- package/src/components/Thread/reducer.ts +0 -52
- package/src/components/Toolbox/Toolbox.stories.tsx +0 -65
- package/src/components/Toolbox/Toolbox.tsx +0 -117
- 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 -219
- package/src/hooks/useChatProcessor.tsx +0 -77
- 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/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/chat.ts +0 -11
- package/src/types/index.ts +0 -8
- package/src/types/service.ts +0 -102
- package/src/types/template.ts +0 -34
- package/src/types/types.ts +0 -41
- package/src/typings.d.ts +0 -9
package/src/tools/openapi.ts
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import jsonpointer from 'jsonpointer';
|
|
6
|
-
import { type OpenAPIV2, type OpenAPIV3_1 } from 'openapi-types';
|
|
7
|
-
|
|
8
|
-
import { ToolResult, type Tool } from '@dxos/artifact';
|
|
9
|
-
import { JsonSchemaType, normalizeSchema, S, toEffectSchema } from '@dxos/echo-schema';
|
|
10
|
-
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { log } from '@dxos/log';
|
|
12
|
-
import { deepMapValues } from '@dxos/util';
|
|
13
|
-
|
|
14
|
-
import type { ApiAuthorization, ServiceType } from '../types';
|
|
15
|
-
|
|
16
|
-
export type CreateToolsFromApiOptions = {
|
|
17
|
-
authorization?: ApiAuthorization;
|
|
18
|
-
instructions?: string;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const createToolsFromService = async (service: ServiceType): Promise<Tool[]> => {
|
|
22
|
-
invariant(service.interfaces?.length === 1 && service.interfaces[0].kind === 'api');
|
|
23
|
-
const iface = service.interfaces[0];
|
|
24
|
-
invariant(iface.schemaUrl);
|
|
25
|
-
invariant(iface.schemaUrl);
|
|
26
|
-
return createToolsFromApi(iface.schemaUrl, { authorization: iface.authorization });
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const createToolsFromApi = async (url: string, options?: CreateToolsFromApiOptions): Promise<Tool[]> => {
|
|
30
|
-
const res = await fetch(url);
|
|
31
|
-
const spec = (await res.json()) as OpenAPIV2.Document;
|
|
32
|
-
log('spec', { spec });
|
|
33
|
-
|
|
34
|
-
const tools: Tool[] = [];
|
|
35
|
-
for (const [path, pathItem] of Object.entries(spec.paths)) {
|
|
36
|
-
if (typeof pathItem !== 'object') {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// TODO(burdon): ???
|
|
41
|
-
const { ...methods } = pathItem;
|
|
42
|
-
for (const [method, m] of Object.entries(methods)) {
|
|
43
|
-
const methodItem: OpenAPIV2.OperationObject = m as OpenAPIV2.OperationObject;
|
|
44
|
-
log('methodItem', { path, method, methodItem });
|
|
45
|
-
|
|
46
|
-
const parametersResolved: OpenAPIV2.ParameterObject[] =
|
|
47
|
-
methodItem.parameters?.map((parameter: any) => {
|
|
48
|
-
const resolved = resolveJsonSchema(parameter, spec);
|
|
49
|
-
return resolved;
|
|
50
|
-
}) ?? [];
|
|
51
|
-
|
|
52
|
-
const inputSchema: JsonSchemaType = {
|
|
53
|
-
type: 'object',
|
|
54
|
-
properties: {},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const endpointParameters: OpenAPIV2.ParameterObject[] = [];
|
|
58
|
-
for (const parameter of parametersResolved) {
|
|
59
|
-
log('parameter', { parameter });
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
options?.authorization?.type === 'api-key' &&
|
|
63
|
-
options.authorization.placement.type === 'query' &&
|
|
64
|
-
parameter.in === 'query' &&
|
|
65
|
-
parameter.name === options.authorization.placement.name
|
|
66
|
-
) {
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
endpointParameters.push(parameter);
|
|
71
|
-
|
|
72
|
-
if (parameter.schema) {
|
|
73
|
-
inputSchema.properties![parameter.name] = normalizeSchema(parameter.schema);
|
|
74
|
-
} else if (typeof parameter.type === 'string') {
|
|
75
|
-
const { name, in: _in, required, ...schema } = parameter;
|
|
76
|
-
inputSchema.properties![name] = normalizeSchema(schema);
|
|
77
|
-
if (required) {
|
|
78
|
-
inputSchema.required ??= [];
|
|
79
|
-
inputSchema.required!.push(name);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
log('inputSchema', { inputSchema });
|
|
85
|
-
S.validateSync(JsonSchemaType)(inputSchema);
|
|
86
|
-
|
|
87
|
-
const description = methodItem.description ?? methodItem.summary;
|
|
88
|
-
if (!description) {
|
|
89
|
-
log.warn('no description', { path, method });
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const endpoint: EndpointDescriptor = {
|
|
94
|
-
document: spec,
|
|
95
|
-
path,
|
|
96
|
-
method,
|
|
97
|
-
parameters: endpointParameters,
|
|
98
|
-
authorization: options?.authorization,
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
tools.push({
|
|
102
|
-
name: getToolName(path, method, methodItem),
|
|
103
|
-
description: options?.instructions ? `${options.instructions}\n\n${description}` : description,
|
|
104
|
-
parameters: inputSchema,
|
|
105
|
-
execute: async (input) => {
|
|
106
|
-
const response = await callApiEndpoint(endpoint, input);
|
|
107
|
-
return ToolResult.Success(response);
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return tools;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const getToolName = (path: string, method: string, methodItem: OpenAPIV2.OperationObject) => {
|
|
117
|
-
if (methodItem.operationId) {
|
|
118
|
-
return methodItem.operationId;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Generate a name from the path and method.
|
|
122
|
-
let name = `${method.toLowerCase()}_${path.replaceAll(/[{}/]/g, '_')}`;
|
|
123
|
-
while (name.length > MAX_TOOL_NAME_LENGTH) {
|
|
124
|
-
const lengthBefore = name.length;
|
|
125
|
-
|
|
126
|
-
for (const word of GENERIC_WORDS) {
|
|
127
|
-
if (name.includes(word)) {
|
|
128
|
-
name = name.replace(word, '');
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
name = name.replaceAll('__', '_').replace(/_$/, '');
|
|
133
|
-
|
|
134
|
-
const lengthAfter = name.length;
|
|
135
|
-
if (lengthBefore === lengthAfter) {
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
name = name.replaceAll('__', '_').replace(/_$/, '').replace(/^_/, '');
|
|
140
|
-
|
|
141
|
-
return name.slice(0, MAX_TOOL_NAME_LENGTH);
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const MAX_TOOL_NAME_LENGTH = 64;
|
|
145
|
-
const GENERIC_WORDS = [
|
|
146
|
-
'services',
|
|
147
|
-
'service',
|
|
148
|
-
'api',
|
|
149
|
-
'rest',
|
|
150
|
-
'endpoint',
|
|
151
|
-
'get',
|
|
152
|
-
'post',
|
|
153
|
-
'put',
|
|
154
|
-
'delete',
|
|
155
|
-
'patch',
|
|
156
|
-
'head',
|
|
157
|
-
'options',
|
|
158
|
-
'trace',
|
|
159
|
-
'service',
|
|
160
|
-
'api',
|
|
161
|
-
'endpoint',
|
|
162
|
-
];
|
|
163
|
-
|
|
164
|
-
type EndpointDescriptor = {
|
|
165
|
-
document: OpenAPIV3_1.Document | OpenAPIV2.Document;
|
|
166
|
-
path: string;
|
|
167
|
-
method: string;
|
|
168
|
-
parameters: OpenAPIV2.ParameterObject[];
|
|
169
|
-
authorization?: ApiAuthorization;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const callApiEndpoint = async (endpoint: EndpointDescriptor, input: any) => {
|
|
173
|
-
log.info('endpoint', { method: endpoint.method, name: endpoint.path, input });
|
|
174
|
-
|
|
175
|
-
let url = getEndpointUrl(endpoint);
|
|
176
|
-
const request: RequestInit = {
|
|
177
|
-
method: endpoint.method,
|
|
178
|
-
headers: {},
|
|
179
|
-
};
|
|
180
|
-
const query = new URLSearchParams();
|
|
181
|
-
let body: any;
|
|
182
|
-
for (const parameter of endpoint.parameters) {
|
|
183
|
-
if (input[parameter.name] === undefined) {
|
|
184
|
-
continue;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
switch (parameter.in) {
|
|
188
|
-
case 'header': {
|
|
189
|
-
if (parameter.example) {
|
|
190
|
-
(request.headers as any)[parameter.name] = parameter.default;
|
|
191
|
-
}
|
|
192
|
-
break;
|
|
193
|
-
}
|
|
194
|
-
case 'path': {
|
|
195
|
-
url = url.replace(`{${parameter.name}}`, encodeURIComponent(input[parameter.name]));
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
case 'body': {
|
|
199
|
-
const value = input[parameter.name];
|
|
200
|
-
|
|
201
|
-
// Client-side validation
|
|
202
|
-
const effectSchema = toEffectSchema(parameter.schema);
|
|
203
|
-
S.validateSync(effectSchema)(value);
|
|
204
|
-
|
|
205
|
-
if (body) {
|
|
206
|
-
throw new Error(`Duplicate body parameter: ${parameter.name}`);
|
|
207
|
-
}
|
|
208
|
-
body = value;
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
case 'query': {
|
|
212
|
-
query.set(parameter.name, input[parameter.name]);
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (
|
|
219
|
-
(endpoint.authorization?.type === 'api-key' && endpoint.authorization.placement.type === 'authorization-header') ||
|
|
220
|
-
endpoint.authorization?.type === 'oauth'
|
|
221
|
-
) {
|
|
222
|
-
(request.headers as any).Authorization = await resolveAuthorization(endpoint.authorization);
|
|
223
|
-
} else if (endpoint.authorization?.type === 'api-key' && endpoint.authorization.placement.type === 'query') {
|
|
224
|
-
query.set(endpoint.authorization.placement.name, endpoint.authorization.key);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
if (query.size > 0) {
|
|
228
|
-
url += `?${query.toString()}`;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (body) {
|
|
232
|
-
request.body = JSON.stringify(body);
|
|
233
|
-
(request.headers as any)['Content-Type'] = 'application/json';
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
log.info('request', { url, request });
|
|
237
|
-
const response = await fetch(url, request);
|
|
238
|
-
|
|
239
|
-
log.info('response', { ok: response.ok, status: response.status, statusText: response.statusText });
|
|
240
|
-
|
|
241
|
-
if (response.ok) {
|
|
242
|
-
const contentType = response.headers.get('Content-Type');
|
|
243
|
-
if (contentType?.includes('application/json')) {
|
|
244
|
-
return await response.json();
|
|
245
|
-
} else {
|
|
246
|
-
return await response.text();
|
|
247
|
-
}
|
|
248
|
-
} else {
|
|
249
|
-
if (response.headers.get('Content-Type')?.includes('application/json')) {
|
|
250
|
-
const responseBody = await response.text();
|
|
251
|
-
let error: any;
|
|
252
|
-
try {
|
|
253
|
-
error = JSON.parse(responseBody);
|
|
254
|
-
} catch {
|
|
255
|
-
error = responseBody;
|
|
256
|
-
}
|
|
257
|
-
log.error('error', { error });
|
|
258
|
-
throw new Error(error.message);
|
|
259
|
-
} else {
|
|
260
|
-
const error = await response.text();
|
|
261
|
-
log.error('error', { error });
|
|
262
|
-
throw new Error(error);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
const getEndpointUrl = (endpoint: EndpointDescriptor) => {
|
|
268
|
-
let url = '';
|
|
269
|
-
if (isV3_1(endpoint.document) && endpoint.document.servers && endpoint.document.servers.length > 0) {
|
|
270
|
-
url = endpoint.document.servers[0].url;
|
|
271
|
-
} else {
|
|
272
|
-
invariant(!isV3_1(endpoint.document));
|
|
273
|
-
url = `${endpoint.document.schemes?.[0] ?? 'https'}://${endpoint.document.host}`;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (!isV3_1(endpoint.document) && endpoint.document.basePath) {
|
|
277
|
-
url += endpoint.document.basePath;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
url += endpoint.path;
|
|
281
|
-
|
|
282
|
-
return url;
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
export const resolveAuthorization = async (authorization: ApiAuthorization): Promise<string> => {
|
|
286
|
-
switch (authorization.type) {
|
|
287
|
-
case 'api-key': {
|
|
288
|
-
invariant(authorization.placement.type === 'authorization-header');
|
|
289
|
-
return `Bearer ${authorization.key}`;
|
|
290
|
-
}
|
|
291
|
-
case 'oauth': {
|
|
292
|
-
const response = await fetch(authorization.tokenUrl, {
|
|
293
|
-
method: 'POST',
|
|
294
|
-
headers: {
|
|
295
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
296
|
-
},
|
|
297
|
-
body: `grant_type=${authorization.grantType}&client_id=${authorization.clientId}&client_secret=${authorization.clientSecret}`,
|
|
298
|
-
});
|
|
299
|
-
const data = await response.json();
|
|
300
|
-
return `Bearer ${data.access_token}`;
|
|
301
|
-
}
|
|
302
|
-
default: {
|
|
303
|
-
throw new Error(`Unknown authorization type: ${(authorization as any).type}`);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Resolves all $ref properties in a JSON schema.
|
|
310
|
-
* Doesn't assume the structure of the schema.
|
|
311
|
-
* The function looks from $ref properties in the schema and resolves them to their values in the base object.
|
|
312
|
-
*/
|
|
313
|
-
const resolveJsonSchema = (schema: any, base: any) => {
|
|
314
|
-
return deepMapValues(schema, (value, recurse) => {
|
|
315
|
-
if (typeof value === 'object' && value !== null && '$ref' in value && typeof value.$ref === 'string') {
|
|
316
|
-
if (value.$ref.startsWith('#')) {
|
|
317
|
-
const resolved = jsonpointer.get(base, value.$ref.slice(1));
|
|
318
|
-
if (resolved) {
|
|
319
|
-
return recurse(resolved);
|
|
320
|
-
} else {
|
|
321
|
-
log.warn('unresolved', { ref: value.$ref, base });
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
return recurse(value);
|
|
326
|
-
});
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
const isV3_1 = (document: OpenAPIV3_1.Document | OpenAPIV2.Document): document is OpenAPIV3_1.Document => {
|
|
330
|
-
return (document as any).openapi === '3.0.1';
|
|
331
|
-
};
|
package/src/types/chat.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Expando, Ref, S, TypedObject } from '@dxos/echo-schema';
|
|
6
|
-
|
|
7
|
-
export class AIChatType extends TypedObject({ typename: 'dxos.org/type/AIChat', version: '0.1.0' })({
|
|
8
|
-
name: S.optional(S.String),
|
|
9
|
-
// TODO(wittjosiah): Should be a ref to a Queue.
|
|
10
|
-
queue: Ref(Expando),
|
|
11
|
-
}) {}
|
package/src/types/index.ts
DELETED
package/src/types/service.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ComputeGraph } from '@dxos/conductor';
|
|
6
|
-
import { Ref, S, TypedObject, type Ref$ } from '@dxos/echo-schema';
|
|
7
|
-
import { FunctionType } from '@dxos/functions';
|
|
8
|
-
|
|
9
|
-
const ApiAuthorizationKey = S.Struct({
|
|
10
|
-
type: S.Literal('api-key'),
|
|
11
|
-
key: S.String,
|
|
12
|
-
placement: S.Union(
|
|
13
|
-
S.Struct({
|
|
14
|
-
type: S.Literal('authorization-header'),
|
|
15
|
-
}),
|
|
16
|
-
S.Struct({
|
|
17
|
-
type: S.Literal('query'),
|
|
18
|
-
name: S.String,
|
|
19
|
-
}),
|
|
20
|
-
),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const ApiAuthorizationOauth = S.Struct({
|
|
24
|
-
type: S.Literal('oauth'),
|
|
25
|
-
clientId: S.String,
|
|
26
|
-
clientSecret: S.String,
|
|
27
|
-
tokenUrl: S.String,
|
|
28
|
-
grantType: S.String,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export const ApiAuthorization = S.Union(ApiAuthorizationKey, ApiAuthorizationOauth);
|
|
32
|
-
export type ApiAuthorization = S.Schema.Type<typeof ApiAuthorization>;
|
|
33
|
-
|
|
34
|
-
const ServiceInterfaceFunction = S.Struct({
|
|
35
|
-
kind: S.Literal('function'),
|
|
36
|
-
fn: Ref(FunctionType) as Ref$<FunctionType>,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const ServiceInterfaceWorkflow = S.Struct({
|
|
40
|
-
kind: S.Literal('workflow'),
|
|
41
|
-
workflow: Ref(ComputeGraph) as Ref$<ComputeGraph>,
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const ServiceInterfaceApi = S.Struct({
|
|
45
|
-
kind: S.Literal('api'),
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* URL to fetch the openapi schema.
|
|
49
|
-
*/
|
|
50
|
-
schemaUrl: S.optional(S.String),
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Inlined openapi schema.
|
|
54
|
-
*/
|
|
55
|
-
schema: S.optional(S.Any),
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Authorization configuration if required.
|
|
59
|
-
*/
|
|
60
|
-
authorization: S.optional(ApiAuthorization),
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const ServiceInterface = S.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);
|
|
64
|
-
export type ServiceInterface = S.Schema.Type<typeof ServiceInterface>;
|
|
65
|
-
|
|
66
|
-
export class ServiceType extends TypedObject({ typename: 'dxos.org/type/ServiceType', version: '0.1.0' })({
|
|
67
|
-
serviceId: S.String,
|
|
68
|
-
name: S.optional(S.String),
|
|
69
|
-
description: S.optional(S.String),
|
|
70
|
-
category: S.optional(S.String),
|
|
71
|
-
enabled: S.optional(S.Boolean),
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Entries exposed: functions, workflows, and APIs.
|
|
75
|
-
*/
|
|
76
|
-
interfaces: S.optional(S.Array(ServiceInterface)),
|
|
77
|
-
}) {}
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
// Service Registry
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
export type ServiceQuery = {
|
|
84
|
-
name?: string;
|
|
85
|
-
category?: string;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export interface BaseServiceRegistry {
|
|
89
|
-
queryServices(query?: ServiceQuery): Promise<ServiceType[]>;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export const categoryIcons: Record<string, string> = {
|
|
93
|
-
finance: 'ph--bank--regular',
|
|
94
|
-
health: 'ph--heart--regular',
|
|
95
|
-
geolocation: 'ph--globe-simple--regular',
|
|
96
|
-
education: 'ph--books--regular',
|
|
97
|
-
entertainment: 'ph--music-notes--regular',
|
|
98
|
-
shopping: 'ph--shopping-cart--regular',
|
|
99
|
-
travel: 'ph--airplane-takeoff--regular',
|
|
100
|
-
utilities: 'ph--lightning--regular',
|
|
101
|
-
weather: 'ph--cloud-rain--regular',
|
|
102
|
-
} as const;
|
package/src/types/template.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { S, TypedObject } from '@dxos/echo-schema';
|
|
6
|
-
|
|
7
|
-
// TODO(burdon): Change to S.Literal (and discriminated union).
|
|
8
|
-
export enum TemplateInputType {
|
|
9
|
-
VALUE = 0,
|
|
10
|
-
PASS_THROUGH = 1,
|
|
11
|
-
RETRIEVER = 2,
|
|
12
|
-
FUNCTION = 3,
|
|
13
|
-
QUERY = 4,
|
|
14
|
-
RESOLVER = 5,
|
|
15
|
-
CONTEXT = 6,
|
|
16
|
-
SCHEMA = 7,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const TemplateInputSchema = S.mutable(
|
|
20
|
-
S.Struct({
|
|
21
|
-
name: S.String,
|
|
22
|
-
type: S.optional(S.Enums(TemplateInputType)),
|
|
23
|
-
value: S.optional(S.String),
|
|
24
|
-
}),
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
export type TemplateInput = S.Schema.Type<typeof TemplateInputSchema>;
|
|
28
|
-
|
|
29
|
-
export class TemplateType extends TypedObject({ typename: 'dxos.org/type/Template', version: '0.1.0' })({
|
|
30
|
-
name: S.optional(S.String),
|
|
31
|
-
source: S.String,
|
|
32
|
-
inputs: S.optional(S.mutable(S.Array(TemplateInputSchema))),
|
|
33
|
-
command: S.optional(S.String),
|
|
34
|
-
}) {}
|
package/src/types/types.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { S } from '@dxos/echo-schema';
|
|
6
|
-
|
|
7
|
-
import { AIChatType } from './chat';
|
|
8
|
-
import { TemplateType } from './template';
|
|
9
|
-
import { AUTOMATION_PLUGIN } from '../meta';
|
|
10
|
-
|
|
11
|
-
export namespace AutomationAction {
|
|
12
|
-
const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;
|
|
13
|
-
|
|
14
|
-
export class CreateChat extends S.TaggedClass<CreateChat>()(`${AUTOMATION_ACTION}/create-chat`, {
|
|
15
|
-
input: S.Struct({
|
|
16
|
-
spaceId: S.optional(S.String),
|
|
17
|
-
name: S.optional(S.String),
|
|
18
|
-
}),
|
|
19
|
-
output: S.Struct({
|
|
20
|
-
object: AIChatType,
|
|
21
|
-
}),
|
|
22
|
-
}) {}
|
|
23
|
-
|
|
24
|
-
export class CreateTemplate extends S.TaggedClass<CreateTemplate>()(`${AUTOMATION_ACTION}/create-template`, {
|
|
25
|
-
input: S.Struct({
|
|
26
|
-
name: S.optional(S.String),
|
|
27
|
-
}),
|
|
28
|
-
output: S.Struct({
|
|
29
|
-
object: TemplateType,
|
|
30
|
-
}),
|
|
31
|
-
}) {}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const AutomationSettingsSchema = S.mutable(
|
|
35
|
-
S.Struct({
|
|
36
|
-
llmModel: S.optional(S.String),
|
|
37
|
-
customPrompts: S.optional(S.Boolean),
|
|
38
|
-
}),
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
export type AutomationSettingsProps = S.Schema.Type<typeof AutomationSettingsSchema>;
|