@dxos/plugin-automation 0.7.5-labs.ff2ff30 → 0.7.5-main.6a330ac
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-R4JH4TLE.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 +21 -377
- 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-QXIHYOMF.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-EQYHOTGG.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 +36 -378
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-LWDY7SQG.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-EMVA6QUT.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 +21 -377
- 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 +1 -2
- 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.d.ts +1 -2
- package/dist/types/src/components/TriggerEditor/TriggerEditor.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 +1 -12
- 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 -94
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +23 -73
- package/src/AutomationPlugin.tsx +9 -64
- 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 -29
- package/dist/lib/browser/AutomationPanel-VW2XIUPU.mjs +0 -8
- package/dist/lib/browser/AutomationPanel-VW2XIUPU.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-5TAVTN3T.mjs +0 -12
- package/dist/lib/browser/ChatContainer-5TAVTN3T.mjs.map +0 -7
- package/dist/lib/browser/ai-client-5CNY6JBF.mjs +0 -22
- package/dist/lib/browser/ai-client-5CNY6JBF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-FZGK55G7.mjs +0 -197
- package/dist/lib/browser/app-graph-builder-FZGK55G7.mjs.map +0 -7
- package/dist/lib/browser/chunk-2H2EUYXL.mjs +0 -15
- package/dist/lib/browser/chunk-2H2EUYXL.mjs.map +0 -7
- package/dist/lib/browser/chunk-DVE33EZL.mjs +0 -1602
- package/dist/lib/browser/chunk-DVE33EZL.mjs.map +0 -7
- package/dist/lib/browser/chunk-MJK7GL5P.mjs +0 -307
- package/dist/lib/browser/chunk-MJK7GL5P.mjs.map +0 -7
- package/dist/lib/browser/chunk-NQFZ6XRX.mjs +0 -243
- package/dist/lib/browser/chunk-NQFZ6XRX.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q4IMHYGH.mjs +0 -150
- package/dist/lib/browser/chunk-Q4IMHYGH.mjs.map +0 -7
- package/dist/lib/browser/chunk-R4JH4TLE.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-BWAXKT27.mjs +0 -29
- package/dist/lib/browser/intent-resolver-BWAXKT27.mjs.map +0 -7
- package/dist/lib/browser/react-surface-ILBDBZCN.mjs +0 -58
- package/dist/lib/browser/react-surface-ILBDBZCN.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-G6EDDYWW.cjs +0 -26
- package/dist/lib/node/AutomationPanel-G6EDDYWW.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-EN24W3K4.cjs +0 -33
- package/dist/lib/node/ChatContainer-EN24W3K4.cjs.map +0 -7
- package/dist/lib/node/ai-client-FKLPDELV.cjs +0 -38
- package/dist/lib/node/ai-client-FKLPDELV.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-T76NYV42.cjs +0 -212
- package/dist/lib/node/app-graph-builder-T76NYV42.cjs.map +0 -7
- package/dist/lib/node/chunk-CJGJXNY3.cjs +0 -1586
- package/dist/lib/node/chunk-CJGJXNY3.cjs.map +0 -7
- package/dist/lib/node/chunk-EQYHOTGG.cjs.map +0 -7
- package/dist/lib/node/chunk-GB7245FH.cjs +0 -173
- package/dist/lib/node/chunk-GB7245FH.cjs.map +0 -7
- package/dist/lib/node/chunk-HMBKP6VG.cjs +0 -324
- package/dist/lib/node/chunk-HMBKP6VG.cjs.map +0 -7
- package/dist/lib/node/chunk-QXIHYOMF.cjs.map +0 -7
- package/dist/lib/node/chunk-U5Z7LFWB.cjs +0 -34
- package/dist/lib/node/chunk-U5Z7LFWB.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-C6OKFVEW.cjs +0 -44
- package/dist/lib/node/intent-resolver-C6OKFVEW.cjs.map +0 -7
- package/dist/lib/node/react-surface-LWDY7SQG.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-V3IWQAMO.mjs +0 -9
- package/dist/lib/node-esm/AutomationPanel-V3IWQAMO.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-CNTY3C2D.mjs +0 -13
- package/dist/lib/node-esm/ChatContainer-CNTY3C2D.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-XGNA6SJ5.mjs +0 -23
- package/dist/lib/node-esm/ai-client-XGNA6SJ5.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-IJQEN7WT.mjs +0 -198
- package/dist/lib/node-esm/app-graph-builder-IJQEN7WT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6HLBYDUI.mjs +0 -244
- package/dist/lib/node-esm/chunk-6HLBYDUI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DNCXRGAF.mjs +0 -151
- package/dist/lib/node-esm/chunk-DNCXRGAF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EMVA6QUT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IJRTDSKN.mjs +0 -16
- package/dist/lib/node-esm/chunk-IJRTDSKN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QP47VJT6.mjs +0 -1603
- package/dist/lib/node-esm/chunk-QP47VJT6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZLIAMW45.mjs +0 -308
- package/dist/lib/node-esm/chunk-ZLIAMW45.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-DCP4ZDBA.mjs +0 -30
- package/dist/lib/node-esm/intent-resolver-DCP4ZDBA.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-SBDXFVIN.mjs +0 -59
- package/dist/lib/node-esm/react-surface-SBDXFVIN.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/artifacts.stories.d.ts +0 -16
- package/dist/types/src/artifacts.stories.d.ts.map +0 -1
- 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/AmbientChatDialog/AmbientChatDialog.d.ts +0 -3
- package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.d.ts.map +0 -1
- package/dist/types/src/components/AmbientChatDialog/index.d.ts +0 -2
- package/dist/types/src/components/AmbientChatDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/Box/StatusLine.d.ts +0 -11
- package/dist/types/src/components/Box/StatusLine.d.ts.map +0 -1
- package/dist/types/src/components/Box/StatusLine.stories.d.ts +0 -9
- package/dist/types/src/components/Box/StatusLine.stories.d.ts.map +0 -1
- package/dist/types/src/components/Box/Tabbed.d.ts +0 -15
- package/dist/types/src/components/Box/Tabbed.d.ts.map +0 -1
- package/dist/types/src/components/Box/Tabbed.stories.d.ts +0 -8
- package/dist/types/src/components/Box/Tabbed.stories.d.ts.map +0 -1
- package/dist/types/src/components/Box/ToggleContainer.d.ts +0 -13
- package/dist/types/src/components/Box/ToggleContainer.d.ts.map +0 -1
- package/dist/types/src/components/Box/ToggleContainer.stories.d.ts +0 -9
- package/dist/types/src/components/Box/ToggleContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/Box/index.d.ts +0 -4
- package/dist/types/src/components/Box/index.d.ts.map +0 -1
- package/dist/types/src/components/ChatContainer/ChatContainer.d.ts +0 -7
- 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/MarkdownViewer/MarkdownViewer.d.ts +0 -14
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts +0 -8
- package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownViewer/index.d.ts +0 -2
- package/dist/types/src/components/MarkdownViewer/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +0 -7
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +0 -8
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/index.d.ts +0 -2
- package/dist/types/src/components/Prompt/index.d.ts.map +0 -1
- package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts +0 -20
- package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts +0 -10
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts +0 -6
- package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/index.d.ts +0 -2
- package/dist/types/src/components/PromptEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/prompt-extension.d.ts +0 -4
- package/dist/types/src/components/PromptEditor/prompt-extension.d.ts.map +0 -1
- package/dist/types/src/components/PromptEditor/types.d.ts +0 -18
- package/dist/types/src/components/PromptEditor/types.d.ts.map +0 -1
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +0 -6
- 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 -11
- 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/ThreadMessage.d.ts +0 -12
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
- package/dist/types/src/components/Thread/index.d.ts +0 -2
- package/dist/types/src/components/Thread/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 -6
- 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 -70
- 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/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 -18
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/artifacts.stories.tsx +0 -241
- package/src/capabilities/ai-client.ts +0 -19
- package/src/capabilities/app-graph-builder.ts +0 -187
- package/src/capabilities/capabilities.ts +0 -12
- package/src/capabilities/intent-resolver.ts +0 -27
- package/src/components/AmbientChatDialog/AmbientChatDialog.tsx +0 -26
- package/src/components/AmbientChatDialog/index.ts +0 -5
- package/src/components/Box/StatusLine.stories.tsx +0 -52
- package/src/components/Box/StatusLine.tsx +0 -76
- package/src/components/Box/Tabbed.stories.tsx +0 -51
- package/src/components/Box/Tabbed.tsx +0 -89
- package/src/components/Box/ToggleContainer.stories.tsx +0 -110
- package/src/components/Box/ToggleContainer.tsx +0 -108
- package/src/components/Box/index.ts +0 -7
- package/src/components/ChatContainer/ChatContainer.tsx +0 -52
- package/src/components/ChatContainer/index.ts +0 -8
- package/src/components/MarkdownViewer/MarkdownViewer.stories.tsx +0 -56
- package/src/components/MarkdownViewer/MarkdownViewer.tsx +0 -79
- package/src/components/MarkdownViewer/index.ts +0 -5
- package/src/components/Prompt/Prompt.stories.tsx +0 -50
- package/src/components/Prompt/Prompt.tsx +0 -36
- package/src/components/Prompt/index.ts +0 -5
- package/src/components/Prompt/prompt-autocomplete.ts +0 -200
- 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 -75
- package/src/components/ServiceRegistry/index.ts +0 -5
- package/src/components/Thread/Thread.stories.tsx +0 -197
- package/src/components/Thread/Thread.tsx +0 -156
- package/src/components/Thread/ThreadMessage.tsx +0 -225
- package/src/components/Thread/index.ts +0 -5
- package/src/hooks/email.ts +0 -49
- package/src/hooks/index.ts +0 -10
- package/src/hooks/invocation-handler.ts +0 -109
- package/src/hooks/processor.test.ts +0 -15
- package/src/hooks/processor.ts +0 -210
- package/src/hooks/useChatProcessor.tsx +0 -86
- package/src/hooks/useLocalTriggerManager.ts +0 -82
- package/src/hooks/useMessageQueue.ts +0 -23
- package/src/hooks/useServices.ts +0 -28
- 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 -227
- 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 -21
package/src/hooks/processor.ts
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Signal, batch, computed, signal } from '@preact/signals-core';
|
|
6
|
-
|
|
7
|
-
import { type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import { type Tool, Message, type MessageContentBlock } from '@dxos/artifact';
|
|
9
|
-
import {
|
|
10
|
-
isToolUse,
|
|
11
|
-
runTools,
|
|
12
|
-
type AIServiceClientImpl,
|
|
13
|
-
type GenerateRequest,
|
|
14
|
-
type GenerationStream,
|
|
15
|
-
MixedStreamParser,
|
|
16
|
-
} from '@dxos/assistant';
|
|
17
|
-
import { createStatic } from '@dxos/echo-schema';
|
|
18
|
-
import { invariant } from '@dxos/invariant';
|
|
19
|
-
import { log } from '@dxos/log';
|
|
20
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
21
|
-
|
|
22
|
-
// TODO(burdon): Factor out.
|
|
23
|
-
declare global {
|
|
24
|
-
interface ToolContextExtensions {
|
|
25
|
-
space?: Space;
|
|
26
|
-
dispatch?: PromiseIntentDispatcher;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
type RequestOptions = {
|
|
31
|
-
history?: Message[];
|
|
32
|
-
onComplete?: (messages: Message[]) => void;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export type ChatProcessorOptions = Pick<GenerateRequest, 'model' | 'systemPrompt'>;
|
|
36
|
-
|
|
37
|
-
const defaultOptions: ChatProcessorOptions = {
|
|
38
|
-
model: '@anthropic/claude-3-5-sonnet-20241022',
|
|
39
|
-
systemPrompt: 'you are a helpful assistant',
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Handles interactions with the AI service.
|
|
44
|
-
* Maintains a queue of messages and handles streaming responses from the AI service.
|
|
45
|
-
* Executes tools based on AI responses.
|
|
46
|
-
* Supports cancellation of in-progress requests.
|
|
47
|
-
*/
|
|
48
|
-
export class ChatProcessor {
|
|
49
|
-
/** SSE stream parser. */
|
|
50
|
-
private readonly _parser = new MixedStreamParser();
|
|
51
|
-
|
|
52
|
-
/** Current streaming response (iterator). */
|
|
53
|
-
private _stream: GenerationStream | undefined;
|
|
54
|
-
|
|
55
|
-
/** Pending messages (incl. the user request). */
|
|
56
|
-
private readonly _pending: Signal<Message[]> = signal([]);
|
|
57
|
-
|
|
58
|
-
/** Current streaming block (from the AI service). */
|
|
59
|
-
private readonly _block: Signal<MessageContentBlock | undefined> = signal(undefined);
|
|
60
|
-
|
|
61
|
-
/** Prior history from queue. */
|
|
62
|
-
private _history: Message[] = [];
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Streaming state.
|
|
66
|
-
* @reactive
|
|
67
|
-
*/
|
|
68
|
-
public readonly streaming: Signal<boolean> = computed(() => this._block.value !== undefined);
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Array of Messages (incl. the current message being streamed).
|
|
72
|
-
* @reactive
|
|
73
|
-
*/
|
|
74
|
-
public readonly messages: Signal<Message[]> = computed(() => {
|
|
75
|
-
const messages = [...this._pending.value];
|
|
76
|
-
if (this._block.value) {
|
|
77
|
-
const current = messages.pop();
|
|
78
|
-
invariant(current);
|
|
79
|
-
const { content, ...rest } = current;
|
|
80
|
-
const message = { ...rest, content: [...content, this._block.value] };
|
|
81
|
-
messages.push(message);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return messages;
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
constructor(
|
|
88
|
-
private readonly _client: AIServiceClientImpl,
|
|
89
|
-
private _tools?: Tool[],
|
|
90
|
-
private readonly _extensions?: ToolContextExtensions,
|
|
91
|
-
private readonly _options: ChatProcessorOptions = defaultOptions,
|
|
92
|
-
) {
|
|
93
|
-
// Message complete.
|
|
94
|
-
this._parser.message.on((message) => {
|
|
95
|
-
batch(() => {
|
|
96
|
-
this._pending.value = [...this._pending.value, message];
|
|
97
|
-
this._block.value = undefined;
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// Streaming update (happens before message complete).
|
|
102
|
-
this._parser.update.on((block) => {
|
|
103
|
-
batch(() => {
|
|
104
|
-
this._block.value = block;
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Update tools.
|
|
111
|
-
*/
|
|
112
|
-
setTools(tools: Tool[]) {
|
|
113
|
-
this._tools = tools;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Make GPT request.
|
|
118
|
-
*/
|
|
119
|
-
async request(message: string, options: RequestOptions = {}): Promise<Message[]> {
|
|
120
|
-
batch(() => {
|
|
121
|
-
this._history = options.history ?? [];
|
|
122
|
-
this._pending.value = [
|
|
123
|
-
createStatic(Message, {
|
|
124
|
-
role: 'user',
|
|
125
|
-
content: [{ type: 'text', text: message }],
|
|
126
|
-
}),
|
|
127
|
-
];
|
|
128
|
-
this._block.value = undefined;
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
await this._generate();
|
|
132
|
-
options.onComplete?.(this._pending.value);
|
|
133
|
-
return this._reset();
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Cancel pending requests.
|
|
138
|
-
* @returns Pending requests (incl. the request message).
|
|
139
|
-
*/
|
|
140
|
-
async cancel(): Promise<Message[]> {
|
|
141
|
-
log.info('cancelling...');
|
|
142
|
-
this._stream?.abort();
|
|
143
|
-
return this._reset();
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
private async _reset(): Promise<Message[]> {
|
|
147
|
-
const messages = this._pending.value;
|
|
148
|
-
batch(() => {
|
|
149
|
-
this._history = [];
|
|
150
|
-
this._pending.value = [];
|
|
151
|
-
this._block.value = undefined;
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
return messages;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Generate a response from the AI service.
|
|
159
|
-
* Iterates over tool requests.
|
|
160
|
-
*/
|
|
161
|
-
private async _generate() {
|
|
162
|
-
try {
|
|
163
|
-
let more = false;
|
|
164
|
-
do {
|
|
165
|
-
log.info('requesting...', { history: this._history.length, messages: this._pending.value.length });
|
|
166
|
-
this._stream = await this._client.generate({
|
|
167
|
-
...this._options,
|
|
168
|
-
// TODO(burdon): Rename messages or separate history/message.
|
|
169
|
-
history: [...this._history, ...this._pending.value],
|
|
170
|
-
tools: this._tools,
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
// Wait until complete.
|
|
174
|
-
await this._parser.parse(this._stream);
|
|
175
|
-
await this._stream.complete();
|
|
176
|
-
|
|
177
|
-
// Add messages.
|
|
178
|
-
log.info('response', { messages: this._pending.value });
|
|
179
|
-
|
|
180
|
-
// Resolve tool use locally.
|
|
181
|
-
more = false;
|
|
182
|
-
const message = this._pending.value.at(-1);
|
|
183
|
-
invariant(message);
|
|
184
|
-
if (isToolUse(message)) {
|
|
185
|
-
log.info('tool request...');
|
|
186
|
-
const response = await runTools({
|
|
187
|
-
message: this._pending.value.at(-1)!,
|
|
188
|
-
tools: this._tools ?? [],
|
|
189
|
-
extensions: this._extensions,
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
log.info('tool response', { response });
|
|
193
|
-
switch (response.type) {
|
|
194
|
-
case 'continue': {
|
|
195
|
-
this._pending.value = [...this._pending.value, response.message];
|
|
196
|
-
more = true;
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
} while (more);
|
|
202
|
-
} catch (err) {
|
|
203
|
-
// TODO(burdon): Handle error.
|
|
204
|
-
log.catch('request failed', { err });
|
|
205
|
-
} finally {
|
|
206
|
-
log.info('done');
|
|
207
|
-
this._stream = undefined;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, useCapabilities, useCapability, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import { createSystemPrompt, type Tool } from '@dxos/artifact';
|
|
9
|
-
import { FunctionType } from '@dxos/functions';
|
|
10
|
-
import { useConfig } from '@dxos/react-client';
|
|
11
|
-
import { Filter, getSpace, useQuery } from '@dxos/react-client/echo';
|
|
12
|
-
import { isNotNullOrUndefined } from '@dxos/util';
|
|
13
|
-
|
|
14
|
-
import { AutomationCapabilities } from '../capabilities';
|
|
15
|
-
import { ChatProcessor } from '../hooks';
|
|
16
|
-
import { covertFunctionToTool, createToolsFromService } from '../tools';
|
|
17
|
-
import { ServiceType, type AIChatType } from '../types';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Creates a processor for the chat.
|
|
21
|
-
*/
|
|
22
|
-
export const useChatProcessor = (chat: AIChatType) => {
|
|
23
|
-
const aiClient = useCapability(AutomationCapabilities.AiClient);
|
|
24
|
-
const globalTools = useCapabilities(Capabilities.Tools);
|
|
25
|
-
const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
|
|
26
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
27
|
-
const space = getSpace(chat);
|
|
28
|
-
|
|
29
|
-
// Services.
|
|
30
|
-
const services = useQuery(space, Filter.schema(ServiceType));
|
|
31
|
-
const [serviceTools, setServiceTools] = useState<Tool[]>([]);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
queueMicrotask(async () => {
|
|
34
|
-
const tools = await Promise.all(services.map((service) => createToolsFromService(service)));
|
|
35
|
-
setServiceTools(tools.flat());
|
|
36
|
-
});
|
|
37
|
-
}, [services]);
|
|
38
|
-
|
|
39
|
-
// Tools.
|
|
40
|
-
const config = useConfig();
|
|
41
|
-
const functions = useQuery(space, Filter.schema(FunctionType));
|
|
42
|
-
const tools = useMemo(
|
|
43
|
-
() => [
|
|
44
|
-
...globalTools.flat(),
|
|
45
|
-
...artifactDefinitions.flatMap((definition) => definition.tools),
|
|
46
|
-
...serviceTools,
|
|
47
|
-
...functions
|
|
48
|
-
.map((fn) => covertFunctionToTool(fn, config.values.runtime?.services?.edge?.url ?? '', space?.id))
|
|
49
|
-
.filter(isNotNullOrUndefined),
|
|
50
|
-
],
|
|
51
|
-
[globalTools, artifactDefinitions, serviceTools, functions, space?.id],
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
// Prompt.
|
|
55
|
-
const systemPrompt = useMemo(
|
|
56
|
-
() => createSystemPrompt({ artifacts: artifactDefinitions.map((definition) => definition.instructions) }),
|
|
57
|
-
[artifactDefinitions],
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
// Create processor.
|
|
61
|
-
const processor = useMemo(
|
|
62
|
-
() =>
|
|
63
|
-
new ChatProcessor(
|
|
64
|
-
aiClient,
|
|
65
|
-
tools,
|
|
66
|
-
{
|
|
67
|
-
space,
|
|
68
|
-
dispatch,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
model: '@anthropic/claude-3-5-sonnet-20241022',
|
|
72
|
-
systemPrompt,
|
|
73
|
-
},
|
|
74
|
-
),
|
|
75
|
-
[aiClient, tools, space, dispatch, systemPrompt],
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
// Update processor.
|
|
79
|
-
// useEffect(() => {
|
|
80
|
-
// if (processor) {
|
|
81
|
-
// processor.setTools(tools.flat());
|
|
82
|
-
// }
|
|
83
|
-
// }, [processor, tools]);
|
|
84
|
-
|
|
85
|
-
return processor;
|
|
86
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useEffect, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Mutex } from '@dxos/async';
|
|
8
|
-
import { Context } from '@dxos/context';
|
|
9
|
-
import { createSubscriptionTrigger, type TriggerFactory } from '@dxos/functions';
|
|
10
|
-
import { FunctionTrigger } from '@dxos/functions';
|
|
11
|
-
import { invariant } from '@dxos/invariant';
|
|
12
|
-
import { log } from '@dxos/log';
|
|
13
|
-
import { useClient } from '@dxos/react-client';
|
|
14
|
-
import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
|
|
15
|
-
|
|
16
|
-
import { invokeFunction } from './invocation-handler';
|
|
17
|
-
|
|
18
|
-
const registerTriggersMutex = new Mutex();
|
|
19
|
-
|
|
20
|
-
export const useLocalTriggerManager = (space: Space) => {
|
|
21
|
-
const client = useClient();
|
|
22
|
-
|
|
23
|
-
// TODO(burdon): Factor out, creating context for plugin (runs outside of component).
|
|
24
|
-
const [registry] = useState(new Map<string, Context>());
|
|
25
|
-
const triggers = useQuery(space, Filter.schema(FunctionTrigger));
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
setTimeout(async () => {
|
|
28
|
-
// Mark-and-sweep removing disabled triggers.
|
|
29
|
-
await registerTriggersMutex.executeSynchronized(async () => {
|
|
30
|
-
const deprecated = new Set(Array.from(registry.keys()));
|
|
31
|
-
log('triggers', {
|
|
32
|
-
deprecated,
|
|
33
|
-
all: triggers.map((t) => t.id),
|
|
34
|
-
enabled: triggers.filter((t) => t.enabled).map((t) => t.id),
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
for (const trigger of triggers) {
|
|
38
|
-
if (trigger.enabled) {
|
|
39
|
-
if (registry.has(trigger.id)) {
|
|
40
|
-
deprecated.delete(trigger.id);
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
log.info('activating trigger', trigger.id);
|
|
44
|
-
|
|
45
|
-
const ctx = new Context();
|
|
46
|
-
registry.set(trigger.id, ctx);
|
|
47
|
-
const triggerSpec = trigger.spec;
|
|
48
|
-
invariant(triggerSpec);
|
|
49
|
-
|
|
50
|
-
let triggerFactory: TriggerFactory<any>;
|
|
51
|
-
if (triggerSpec.type === 'subscription') {
|
|
52
|
-
triggerFactory = createSubscriptionTrigger;
|
|
53
|
-
} else {
|
|
54
|
-
log.info('unsupported trigger', { type: triggerSpec.type });
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
await triggerFactory(ctx, space, trigger.spec, (data: any) => {
|
|
59
|
-
return invokeFunction(client, space, trigger, data);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
for (const id of deprecated) {
|
|
65
|
-
const ctx = registry.get(id);
|
|
66
|
-
if (ctx) {
|
|
67
|
-
await ctx.dispose();
|
|
68
|
-
registry.delete(id);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}, [JSON.stringify(triggers)]);
|
|
74
|
-
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
return () => {
|
|
77
|
-
for (const ctx of registry.values()) {
|
|
78
|
-
void ctx.dispose();
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
}, []);
|
|
82
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Message } from '@dxos/artifact';
|
|
8
|
-
import { DXN, QueueSubspaceTags } from '@dxos/keys';
|
|
9
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
10
|
-
import { useEdgeClient, useQueue } from '@dxos/react-edge-client';
|
|
11
|
-
|
|
12
|
-
import { type AIChatType } from '../types';
|
|
13
|
-
|
|
14
|
-
export const useMessageQueue = (chat: AIChatType) => {
|
|
15
|
-
const edgeClient = useEdgeClient();
|
|
16
|
-
const space = getSpace(chat);
|
|
17
|
-
const queueDxn = useMemo(
|
|
18
|
-
() => new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, space!.id, chat.queue.dxn.parts.at(-1)!]),
|
|
19
|
-
[chat.queue.dxn],
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
return useQueue<Message>(edgeClient, queueDxn);
|
|
23
|
-
};
|
package/src/hooks/useServices.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Space } from '@dxos/client/echo';
|
|
8
|
-
|
|
9
|
-
import { MockServiceRegistry } from '../testing';
|
|
10
|
-
import { type ServiceType, type ServiceQuery } from '../types';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Retrieves matching services from the registry.
|
|
14
|
-
*/
|
|
15
|
-
export const useServices = (space: Space, query?: ServiceQuery): ServiceType[] => {
|
|
16
|
-
const registry = useMemo(() => new MockServiceRegistry(), []);
|
|
17
|
-
const [services, setServices] = useState<ServiceType[]>([]);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
const t = setTimeout(async () => {
|
|
20
|
-
const services = await registry.queryServices(query);
|
|
21
|
-
setServices(services);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
return () => clearTimeout(t);
|
|
25
|
-
}, [query, registry]);
|
|
26
|
-
|
|
27
|
-
return services;
|
|
28
|
-
};
|
package/src/presets.ts
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { create } from '@dxos/live-object';
|
|
6
|
-
|
|
7
|
-
import { ChainInputType, ChainPromptType } from './types';
|
|
8
|
-
|
|
9
|
-
export const str = (...text: (string | undefined | boolean)[]): string =>
|
|
10
|
-
text
|
|
11
|
-
.filter((value) => value !== undefined && value !== false)
|
|
12
|
-
.flat()
|
|
13
|
-
.join('\n');
|
|
14
|
-
|
|
15
|
-
export type Preset = {
|
|
16
|
-
id: string;
|
|
17
|
-
title: string;
|
|
18
|
-
createPrompt: () => ChainPromptType;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const chainPresets: Preset[] = [
|
|
22
|
-
{
|
|
23
|
-
id: 'dxos.org/prompt/translate',
|
|
24
|
-
title: 'Translate',
|
|
25
|
-
createPrompt: () =>
|
|
26
|
-
create(ChainPromptType, {
|
|
27
|
-
command: 'say',
|
|
28
|
-
template: str(
|
|
29
|
-
// prettier-ignore
|
|
30
|
-
'Translate the following into {language}:',
|
|
31
|
-
'',
|
|
32
|
-
'---',
|
|
33
|
-
'',
|
|
34
|
-
'{input}',
|
|
35
|
-
),
|
|
36
|
-
inputs: [
|
|
37
|
-
{
|
|
38
|
-
type: ChainInputType.VALUE,
|
|
39
|
-
name: 'language',
|
|
40
|
-
value: 'japanese',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
type: ChainInputType.PASS_THROUGH,
|
|
44
|
-
name: 'input',
|
|
45
|
-
},
|
|
46
|
-
// TODO(burdon): Message.
|
|
47
|
-
// {
|
|
48
|
-
// type: ChainInputType.CONTEXT,
|
|
49
|
-
// name: 'input',
|
|
50
|
-
// value: 'object.text',
|
|
51
|
-
// },
|
|
52
|
-
],
|
|
53
|
-
}),
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: 'dxos.org/prompt/chess',
|
|
57
|
-
title: 'Chess',
|
|
58
|
-
createPrompt: () =>
|
|
59
|
-
create(ChainPromptType, {
|
|
60
|
-
command: 'hint',
|
|
61
|
-
template: str(
|
|
62
|
-
// prettier-ignore
|
|
63
|
-
'You are a machine that is an expert chess player.',
|
|
64
|
-
'',
|
|
65
|
-
'The move history of the current game is: {history}',
|
|
66
|
-
'',
|
|
67
|
-
'Suggest the next move and very briefly explain your strategy in a couple of sentences.',
|
|
68
|
-
),
|
|
69
|
-
inputs: [
|
|
70
|
-
{
|
|
71
|
-
type: ChainInputType.CONTEXT,
|
|
72
|
-
name: 'history',
|
|
73
|
-
value: 'object.pgn',
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
}),
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 'dxos.org/prompt/mermaid',
|
|
80
|
-
title: 'Mermaid',
|
|
81
|
-
createPrompt: () =>
|
|
82
|
-
create(ChainPromptType, {
|
|
83
|
-
command: 'draw',
|
|
84
|
-
template: str(
|
|
85
|
-
// prettier-ignore
|
|
86
|
-
'Create a simplified mermaid graph representing the text below.',
|
|
87
|
-
'Do not explain anything.',
|
|
88
|
-
'',
|
|
89
|
-
'---',
|
|
90
|
-
'',
|
|
91
|
-
'{input}',
|
|
92
|
-
),
|
|
93
|
-
inputs: [
|
|
94
|
-
{
|
|
95
|
-
type: ChainInputType.PASS_THROUGH,
|
|
96
|
-
name: 'input',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
}),
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
id: 'dxos.org/prompt/list',
|
|
103
|
-
title: 'List',
|
|
104
|
-
createPrompt: () =>
|
|
105
|
-
create(ChainPromptType, {
|
|
106
|
-
command: 'list',
|
|
107
|
-
template: str(
|
|
108
|
-
// prettier-ignore
|
|
109
|
-
'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',
|
|
110
|
-
'Your entire response should be a single array of JSON objects.',
|
|
111
|
-
'',
|
|
112
|
-
'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',
|
|
113
|
-
'',
|
|
114
|
-
'{schema}',
|
|
115
|
-
'',
|
|
116
|
-
'---',
|
|
117
|
-
'',
|
|
118
|
-
'{question}',
|
|
119
|
-
),
|
|
120
|
-
inputs: [
|
|
121
|
-
{
|
|
122
|
-
type: ChainInputType.SCHEMA,
|
|
123
|
-
name: 'schema',
|
|
124
|
-
value: 'example.com/type/project',
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
type: ChainInputType.PASS_THROUGH,
|
|
128
|
-
name: 'question',
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
}),
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
id: 'dxos.org/prompt/base',
|
|
135
|
-
title: 'RAG',
|
|
136
|
-
createPrompt: () =>
|
|
137
|
-
create(ChainPromptType, {
|
|
138
|
-
command: 'rag',
|
|
139
|
-
template: str(
|
|
140
|
-
// prettier-ignore
|
|
141
|
-
"Very briefly answer the question based only on the following context and say if you don't know the answer.",
|
|
142
|
-
// 'answer the question using the following context as well as your training data:',
|
|
143
|
-
'',
|
|
144
|
-
'{context}',
|
|
145
|
-
'',
|
|
146
|
-
'---',
|
|
147
|
-
'',
|
|
148
|
-
'question: {question}',
|
|
149
|
-
),
|
|
150
|
-
inputs: [
|
|
151
|
-
{
|
|
152
|
-
type: ChainInputType.RETRIEVER,
|
|
153
|
-
name: 'context',
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
type: ChainInputType.CONTEXT,
|
|
157
|
-
name: 'question',
|
|
158
|
-
value: 'object.text',
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
}),
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
id: 'dxos.org/prompt/lookup',
|
|
165
|
-
title: 'Lookup',
|
|
166
|
-
createPrompt: () =>
|
|
167
|
-
create(ChainPromptType, {
|
|
168
|
-
command: 'lookup',
|
|
169
|
-
template: str(
|
|
170
|
-
// prettier-ignore
|
|
171
|
-
'Lookup and very briefly summarize the following topic in one or two sentences:',
|
|
172
|
-
'',
|
|
173
|
-
'---',
|
|
174
|
-
'',
|
|
175
|
-
'{input}',
|
|
176
|
-
),
|
|
177
|
-
inputs: [
|
|
178
|
-
{
|
|
179
|
-
type: ChainInputType.CONTEXT,
|
|
180
|
-
name: 'input',
|
|
181
|
-
value: 'text',
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
}),
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
id: 'dxos.org/prompt/extract',
|
|
188
|
-
title: 'Extract',
|
|
189
|
-
createPrompt: () =>
|
|
190
|
-
create(ChainPromptType, {
|
|
191
|
-
command: 'extract',
|
|
192
|
-
template: str(
|
|
193
|
-
// prettier-ignore
|
|
194
|
-
'List all people and companies mentioned in the text below.',
|
|
195
|
-
'',
|
|
196
|
-
'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',
|
|
197
|
-
'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',
|
|
198
|
-
'',
|
|
199
|
-
'{contact}',
|
|
200
|
-
'{company}',
|
|
201
|
-
'',
|
|
202
|
-
'---',
|
|
203
|
-
'',
|
|
204
|
-
'{input}',
|
|
205
|
-
),
|
|
206
|
-
inputs: [
|
|
207
|
-
{
|
|
208
|
-
type: ChainInputType.SCHEMA,
|
|
209
|
-
name: 'contact',
|
|
210
|
-
value: 'example.com/type/contact',
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
type: ChainInputType.SCHEMA,
|
|
214
|
-
name: 'company',
|
|
215
|
-
value: 'example.com/type/organization',
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
type: ChainInputType.CONTEXT,
|
|
219
|
-
name: 'input',
|
|
220
|
-
value: 'text',
|
|
221
|
-
},
|
|
222
|
-
],
|
|
223
|
-
}),
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
id: 'dxos.org/prompt/discord',
|
|
227
|
-
title: 'Summarize',
|
|
228
|
-
createPrompt: () =>
|
|
229
|
-
create(ChainPromptType, {
|
|
230
|
-
command: 'summarize',
|
|
231
|
-
template: str(
|
|
232
|
-
// prettier-ignore
|
|
233
|
-
'Summarize what the team is working on and format it as a markdown table without any explanation.',
|
|
234
|
-
'',
|
|
235
|
-
'---',
|
|
236
|
-
'',
|
|
237
|
-
'{context}',
|
|
238
|
-
),
|
|
239
|
-
inputs: [
|
|
240
|
-
{
|
|
241
|
-
type: ChainInputType.RESOLVER,
|
|
242
|
-
name: 'context',
|
|
243
|
-
value: 'discord.messages.recent',
|
|
244
|
-
},
|
|
245
|
-
],
|
|
246
|
-
}),
|
|
247
|
-
},
|
|
248
|
-
];
|