@dxos/plugin-assistant 0.8.2-staging.7ac8446 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/AssistantDialog-K6POM23O.mjs +46 -0
- package/dist/lib/browser/AssistantDialog-K6POM23O.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-QTO4LE2C.mjs +39 -0
- package/dist/lib/browser/ChatContainer-QTO4LE2C.mjs.map +7 -0
- package/dist/lib/browser/TemplateContainer-AKUYL4AV.mjs +28 -0
- package/dist/lib/browser/TemplateContainer-AKUYL4AV.mjs.map +7 -0
- package/dist/lib/browser/{ai-client-CDZLSNXE.mjs → ai-client-COXVUC6V.mjs} +6 -6
- package/dist/lib/browser/ai-client-COXVUC6V.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-YH4EGNBC.mjs +206 -0
- package/dist/lib/browser/app-graph-builder-YH4EGNBC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TXJWGWJ7.mjs → chunk-3F44MBHU.mjs} +3 -3
- package/dist/lib/browser/chunk-3F44MBHU.mjs.map +7 -0
- package/dist/lib/browser/chunk-IHEBFO5O.mjs +205 -0
- package/dist/lib/browser/chunk-IHEBFO5O.mjs.map +7 -0
- package/dist/lib/browser/chunk-JQFUME3B.mjs +87 -0
- package/dist/lib/{node-esm/chunk-PBZA7XJR.mjs.map → browser/chunk-JQFUME3B.mjs.map} +1 -1
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs +96 -0
- package/dist/lib/browser/chunk-Q6UZ4F3H.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FMB7RGMP.mjs → chunk-QTW7KVDO.mjs} +1669 -1515
- package/dist/lib/browser/chunk-QTW7KVDO.mjs.map +7 -0
- package/dist/lib/browser/chunk-USJBRB3H.mjs +155 -0
- package/dist/lib/browser/chunk-USJBRB3H.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3HCI5FIL.mjs → chunk-XOZ7YMO3.mjs} +3 -3
- package/dist/lib/browser/{chunk-3HCI5FIL.mjs.map → chunk-XOZ7YMO3.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +35 -18
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-WJGLKKVO.mjs → intent-resolver-63EAHENI.mjs} +10 -14
- package/dist/lib/browser/intent-resolver-63EAHENI.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-XCV6NR75.mjs +131 -0
- package/dist/lib/browser/react-surface-XCV6NR75.mjs.map +7 -0
- package/dist/lib/browser/{settings-U6UFQX32.mjs → settings-SHNQ4XXP.mjs} +5 -5
- package/dist/lib/browser/settings-SHNQ4XXP.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +6 -2
- package/dist/lib/node/AssistantDialog-FDATKYE5.cjs +72 -0
- package/dist/lib/node/AssistantDialog-FDATKYE5.cjs.map +7 -0
- package/dist/lib/node/{ChatContainer-ZJ5JXF6A.cjs → ChatContainer-5CLHJOIQ.cjs} +25 -19
- package/dist/lib/node/ChatContainer-5CLHJOIQ.cjs.map +7 -0
- package/dist/lib/node/TemplateContainer-CTG2MB4W.cjs +58 -0
- package/dist/lib/node/TemplateContainer-CTG2MB4W.cjs.map +7 -0
- package/dist/lib/node/{ai-client-URCCYU6B.cjs → ai-client-R2CGEYZW.cjs} +13 -13
- package/dist/lib/node/ai-client-R2CGEYZW.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-PSHIOW3Q.cjs +216 -0
- package/dist/lib/node/app-graph-builder-PSHIOW3Q.cjs.map +7 -0
- package/dist/lib/node/{chunk-XI2ARIEO.cjs → chunk-4EEWTDQK.cjs} +45 -39
- package/dist/lib/node/{chunk-XI2ARIEO.cjs.map → chunk-4EEWTDQK.cjs.map} +1 -1
- package/dist/lib/node/chunk-FLJWJ35M.cjs +181 -0
- package/dist/lib/node/chunk-FLJWJ35M.cjs.map +7 -0
- package/dist/lib/node/{chunk-RPBKMP2E.cjs → chunk-H4A42LNR.cjs} +1504 -1343
- package/dist/lib/node/chunk-H4A42LNR.cjs.map +7 -0
- package/dist/lib/node/chunk-HRNIUYVQ.cjs +128 -0
- package/dist/lib/node/chunk-HRNIUYVQ.cjs.map +7 -0
- package/dist/lib/node/{chunk-Q5XWEMHB.cjs → chunk-P74TWGMG.cjs} +6 -6
- package/dist/lib/node/{chunk-Q5XWEMHB.cjs.map → chunk-P74TWGMG.cjs.map} +1 -1
- package/dist/lib/node/chunk-RXPA2C2A.cjs +230 -0
- package/dist/lib/node/chunk-RXPA2C2A.cjs.map +7 -0
- package/dist/lib/node/{chunk-GBUNQ257.cjs → chunk-TS3H5OSX.cjs} +7 -7
- package/dist/lib/node/chunk-TS3H5OSX.cjs.map +7 -0
- package/dist/lib/node/index.cjs +79 -63
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-R3OSTIMH.cjs → intent-resolver-66F7WLW6.cjs} +13 -17
- package/dist/lib/node/intent-resolver-66F7WLW6.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-TASAPRPQ.cjs +145 -0
- package/dist/lib/node/react-surface-TASAPRPQ.cjs.map +7 -0
- package/dist/lib/node/{settings-TXGRCYAL.cjs → settings-ERKLO6IO.cjs} +9 -9
- package/dist/lib/node/settings-ERKLO6IO.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +17 -13
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/AssistantDialog-PIMYK774.mjs +47 -0
- package/dist/lib/node-esm/AssistantDialog-PIMYK774.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-QTC5NYE2.mjs +40 -0
- package/dist/lib/node-esm/ChatContainer-QTC5NYE2.mjs.map +7 -0
- package/dist/lib/node-esm/TemplateContainer-IVDQ4XQG.mjs +29 -0
- package/dist/lib/node-esm/TemplateContainer-IVDQ4XQG.mjs.map +7 -0
- package/dist/lib/node-esm/{ai-client-WMHS5EGV.mjs → ai-client-I5LXHMOZ.mjs} +6 -6
- package/dist/lib/node-esm/ai-client-I5LXHMOZ.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-Z3GMMJMD.mjs +207 -0
- package/dist/lib/node-esm/app-graph-builder-Z3GMMJMD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ECRK6TUQ.mjs → chunk-BB2TAT4P.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-ECRK6TUQ.mjs.map → chunk-BB2TAT4P.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs +98 -0
- package/dist/lib/node-esm/chunk-CDAILLCU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6JK5HEUQ.mjs → chunk-HLPGKJ7N.mjs} +3 -3
- package/dist/lib/node-esm/chunk-HLPGKJ7N.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PBZA7XJR.mjs → chunk-OYN6HLXZ.mjs} +42 -36
- package/dist/lib/{browser/chunk-NFUHCW2J.mjs.map → node-esm/chunk-OYN6HLXZ.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-QU626JMR.mjs +156 -0
- package/dist/lib/node-esm/chunk-QU626JMR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MVDAY3CZ.mjs → chunk-SI5LOQEO.mjs} +1669 -1515
- package/dist/lib/node-esm/chunk-SI5LOQEO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZKBACPIW.mjs +206 -0
- package/dist/lib/node-esm/chunk-ZKBACPIW.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +35 -18
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-H32TL4X6.mjs → intent-resolver-X3PWH7KM.mjs} +10 -14
- package/dist/lib/node-esm/intent-resolver-X3PWH7KM.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-QMIQCXUM.mjs +132 -0
- package/dist/lib/node-esm/react-surface-QMIQCXUM.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-DZU5PNXM.mjs → settings-IVQRZUCU.mjs} +5 -5
- package/dist/lib/node-esm/settings-IVQRZUCU.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +6 -2
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-client.d.ts +3 -3
- package/dist/types/src/capabilities/ai-client.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -179
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +3 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts +8 -0
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.d.ts.map +1 -0
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts +8 -0
- package/dist/types/src/components/BlueprintEditor/BlueprintEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/BlueprintEditor/index.d.ts +2 -0
- package/dist/types/src/components/BlueprintEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatContainer.d.ts +4 -3
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +5 -2
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +6 -3
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts +9 -4
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts +9 -0
- package/dist/types/src/components/Prompt/PromptBar.stories.d.ts.map +1 -0
- package/dist/types/src/components/Prompt/autocomplete.d.ts +5 -1
- package/dist/types/src/components/Prompt/autocomplete.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/references.d.ts.map +1 -1
- package/dist/types/src/components/PromptSettings.d.ts +6 -0
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -0
- package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/Thread/Thread.d.ts +2 -2
- package/dist/types/src/components/Thread/Thread.d.ts.map +1 -1
- package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +2 -2
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts +4 -2
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ToolInvocations.d.ts +1 -1
- package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +1 -1
- package/dist/types/src/components/Thread/reducer.d.ts +1 -1
- package/dist/types/src/components/Thread/reducer.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +3 -2
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -6
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/experimental/transcription/index.d.ts +1 -0
- package/dist/types/src/experimental/transcription/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +0 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/processor.d.ts +6 -5
- package/dist/types/src/hooks/processor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextProvider.d.ts +1 -1
- package/dist/types/src/hooks/useContextProvider.d.ts.map +1 -1
- package/dist/types/src/hooks/useMessageQueue.d.ts +11 -10
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -1
- package/dist/types/src/hooks/useServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useTextInputEvents.d.ts.map +1 -1
- package/dist/types/src/parser/filter-generator.d.ts +4 -0
- package/dist/types/src/parser/filter-generator.d.ts.map +1 -0
- package/dist/types/src/parser/filter-generator.test.d.ts +2 -0
- package/dist/types/src/parser/filter-generator.test.d.ts.map +1 -0
- package/dist/types/src/parser/index.d.ts +4 -0
- package/dist/types/src/parser/index.d.ts.map +1 -0
- package/dist/types/src/parser/query-parser.d.ts +15 -0
- package/dist/types/src/parser/query-parser.d.ts.map +1 -0
- package/dist/types/src/parser/query-parser.test.d.ts +2 -0
- package/dist/types/src/parser/query-parser.test.d.ts.map +1 -0
- package/dist/types/src/parser/types.d.ts +24 -0
- package/dist/types/src/parser/types.d.ts.map +1 -0
- package/dist/types/src/stories/Prompt.stories.d.ts +8 -0
- package/dist/types/src/stories/Prompt.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Query.stories.d.ts +19 -0
- package/dist/types/src/stories/Query.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Research.stories.d.ts +15 -0
- package/dist/types/src/stories/Research.stories.d.ts.map +1 -0
- package/dist/types/src/stories/test-data.d.ts +3 -0
- package/dist/types/src/stories/test-data.d.ts.map +1 -0
- package/dist/types/src/stories/testing.d.ts +12 -0
- package/dist/types/src/stories/testing.d.ts.map +1 -0
- package/dist/types/src/testing/blueprint.d.ts +7 -0
- package/dist/types/src/testing/blueprint.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-functions.d.ts +1 -1
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/tools/function.d.ts +4 -4
- package/dist/types/src/tools/function.d.ts.map +1 -1
- package/dist/types/src/tools/openapi.d.ts +3 -3
- package/dist/types/src/tools/openapi.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +6 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/chat.d.ts +18 -8
- package/dist/types/src/types/chat.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +96 -95
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/src/types/template.d.ts +52 -52
- package/dist/types/src/types/template.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +25 -20
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +79 -61
- package/src/AssistantPlugin.tsx +7 -6
- package/src/capabilities/ai-client.ts +5 -6
- package/src/capabilities/app-graph-builder.ts +173 -135
- package/src/capabilities/capabilities.ts +1 -1
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/intent-resolver.ts +7 -9
- package/src/capabilities/react-surface.tsx +63 -16
- package/src/capabilities/settings.ts +2 -2
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +2 -2
- package/src/components/AmbientDialog/AmbientDialog.tsx +27 -13
- package/src/components/AssistantDialog.tsx +1 -1
- package/src/components/AssistantSettings/AssistantSettings.tsx +29 -7
- package/src/components/BlueprintEditor/BlueprintEditor.stories.tsx +32 -0
- package/src/components/BlueprintEditor/BlueprintEditor.tsx +41 -0
- package/src/components/BlueprintEditor/index.ts +5 -0
- package/src/components/ChatContainer.tsx +6 -8
- package/src/components/Prompt/Prompt.stories.tsx +59 -52
- package/src/components/Prompt/Prompt.tsx +24 -10
- package/src/components/Prompt/PromptBar.stories.tsx +68 -0
- package/src/components/Prompt/PromptBar.tsx +82 -88
- package/src/components/Prompt/autocomplete.ts +14 -8
- package/src/components/Prompt/references.ts +3 -3
- package/src/components/PromptSettings.tsx +91 -0
- package/src/components/TemplateContainer.tsx +3 -79
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -4
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +3 -3
- package/src/components/TemplateEditor/TemplateForm.tsx +2 -2
- package/src/components/Thread/Thread.stories.tsx +14 -17
- package/src/components/Thread/Thread.tsx +2 -2
- package/src/components/Thread/ThreadContainer.stories.tsx +83 -62
- package/src/components/Thread/ThreadContainer.tsx +26 -5
- package/src/components/Thread/ThreadMessage.tsx +49 -11
- package/src/components/Thread/ToolInvocations.tsx +9 -7
- package/src/components/Thread/reducer.ts +1 -1
- package/src/components/Toolbox/Toolbox.stories.tsx +4 -4
- package/src/components/Toolbox/Toolbox.tsx +5 -4
- package/src/components/index.ts +3 -1
- package/src/experimental/transcription/index.ts +3 -0
- package/src/hooks/index.ts +0 -1
- package/src/hooks/processor.ts +68 -8
- package/src/hooks/useChatProcessor.tsx +12 -11
- package/src/hooks/useContextProvider.ts +21 -17
- package/src/hooks/useMessageQueue.ts +5 -5
- package/src/meta.ts +2 -2
- package/src/parser/filter-generator.test.ts +32 -0
- package/src/parser/filter-generator.ts +81 -0
- package/src/parser/index.ts +7 -0
- package/src/parser/query-parser.test.ts +139 -0
- package/src/parser/query-parser.ts +199 -0
- package/src/parser/types.ts +34 -0
- package/src/shims.d.ts +8 -0
- package/src/stories/Prompt.stories.tsx +59 -0
- package/src/stories/Query.stories.tsx +448 -0
- package/src/stories/Research.stories.tsx +495 -0
- package/src/stories/test-data.ts +128 -0
- package/src/stories/testing.ts +64 -0
- package/src/testing/blueprint.ts +47 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/test-functions.ts +1 -1
- package/src/testing/test-services.ts +6 -6
- package/src/tools/function.ts +11 -12
- package/src/tools/openapi.test.ts +18 -19
- package/src/tools/openapi.ts +24 -17
- package/src/translations.ts +9 -6
- package/src/types/chat.ts +27 -4
- package/src/types/service.ts +39 -37
- package/src/types/template.ts +27 -25
- package/src/types/types.ts +22 -17
- package/dist/lib/browser/AssistantDialog-YSHMAHW5.mjs +0 -117
- package/dist/lib/browser/AssistantDialog-YSHMAHW5.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-V5GP7DYF.mjs +0 -33
- package/dist/lib/browser/ChatContainer-V5GP7DYF.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs +0 -78
- package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs.map +0 -7
- package/dist/lib/browser/ai-client-CDZLSNXE.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-MF5EVDWW.mjs +0 -209
- package/dist/lib/browser/app-graph-builder-MF5EVDWW.mjs.map +0 -7
- package/dist/lib/browser/chunk-FMB7RGMP.mjs.map +0 -7
- package/dist/lib/browser/chunk-IAMR2FAE.mjs +0 -183
- package/dist/lib/browser/chunk-IAMR2FAE.mjs.map +0 -7
- package/dist/lib/browser/chunk-KYMKVE6M.mjs +0 -128
- package/dist/lib/browser/chunk-KYMKVE6M.mjs.map +0 -7
- package/dist/lib/browser/chunk-NFUHCW2J.mjs +0 -81
- package/dist/lib/browser/chunk-TXJWGWJ7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-WJGLKKVO.mjs.map +0 -7
- package/dist/lib/browser/react-surface-57VRDOQT.mjs +0 -90
- package/dist/lib/browser/react-surface-57VRDOQT.mjs.map +0 -7
- package/dist/lib/browser/settings-U6UFQX32.mjs.map +0 -7
- package/dist/lib/node/AssistantDialog-YI2BSGSX.cjs +0 -141
- package/dist/lib/node/AssistantDialog-YI2BSGSX.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-ZJ5JXF6A.cjs.map +0 -7
- package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs +0 -104
- package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs.map +0 -7
- package/dist/lib/node/ai-client-URCCYU6B.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-N5ZUUI2Z.cjs +0 -220
- package/dist/lib/node/app-graph-builder-N5ZUUI2Z.cjs.map +0 -7
- package/dist/lib/node/chunk-APRU3QWK.cjs +0 -206
- package/dist/lib/node/chunk-APRU3QWK.cjs.map +0 -7
- package/dist/lib/node/chunk-GBUNQ257.cjs.map +0 -7
- package/dist/lib/node/chunk-RPBKMP2E.cjs.map +0 -7
- package/dist/lib/node/chunk-ZKOC4ZFY.cjs +0 -152
- package/dist/lib/node/chunk-ZKOC4ZFY.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-R3OSTIMH.cjs.map +0 -7
- package/dist/lib/node/react-surface-NUQTM6MS.cjs +0 -106
- package/dist/lib/node/react-surface-NUQTM6MS.cjs.map +0 -7
- package/dist/lib/node/settings-TXGRCYAL.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-U2FQX5TD.mjs +0 -118
- package/dist/lib/node-esm/AssistantDialog-U2FQX5TD.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-QW3OOXTT.mjs +0 -34
- package/dist/lib/node-esm/ChatContainer-QW3OOXTT.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs +0 -79
- package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-WMHS5EGV.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-DWBNIMHM.mjs +0 -210
- package/dist/lib/node-esm/app-graph-builder-DWBNIMHM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6JK5HEUQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GBBXIW5F.mjs +0 -129
- package/dist/lib/node-esm/chunk-GBBXIW5F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MVDAY3CZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MXK2EANZ.mjs +0 -184
- package/dist/lib/node-esm/chunk-MXK2EANZ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-H32TL4X6.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-JBVZF6CP.mjs +0 -91
- package/dist/lib/node-esm/react-surface-JBVZF6CP.mjs.map +0 -7
- package/dist/lib/node-esm/settings-DZU5PNXM.mjs.map +0 -7
- 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/hooks/invocation-handler.d.ts +0 -5
- package/dist/types/src/hooks/invocation-handler.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/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/hooks/invocation-handler.ts +0 -107
- package/src/hooks/useLocalTriggerManager.ts +0 -82
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ExecutableTool } from '@dxos/ai';
|
|
6
|
+
import { EXA_API_KEY } from '@dxos/ai/testing';
|
|
7
|
+
import { type BlueprintParser, createExaTool, createGraphWriterTool, createLocalSearchTool } from '@dxos/assistant';
|
|
8
|
+
import { type Space } from '@dxos/client/echo';
|
|
9
|
+
import { type DXN } from '@dxos/keys';
|
|
10
|
+
import { DataTypes } from '@dxos/schema';
|
|
11
|
+
import { isNonNullable } from '@dxos/util';
|
|
12
|
+
|
|
13
|
+
// TODO(dmaretskyi): make db available through services (same as function executor).
|
|
14
|
+
// TODO(burdon): Can tools implement "aspects" so that variants can be used rather than an explicit reference?
|
|
15
|
+
export const createTools = (space: Space, queueDxn?: DXN): ExecutableTool[] => {
|
|
16
|
+
return [
|
|
17
|
+
createExaTool({ apiKey: EXA_API_KEY }),
|
|
18
|
+
createLocalSearchTool(space.db),
|
|
19
|
+
queueDxn &&
|
|
20
|
+
createGraphWriterTool({
|
|
21
|
+
db: space.db,
|
|
22
|
+
schemaTypes: DataTypes,
|
|
23
|
+
onDone: async (objects) => {
|
|
24
|
+
const queue = space.queues.get(queueDxn);
|
|
25
|
+
queue.append(objects);
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
].filter(isNonNullable);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const RESEARCH_BLUEPRINT: BlueprintParser.DSL = {
|
|
32
|
+
steps: [
|
|
33
|
+
{
|
|
34
|
+
instructions: 'Research information and entities related to the selected objects.',
|
|
35
|
+
tools: ['search/web_search'],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
instructions:
|
|
39
|
+
'Based on your research find matching entires that are already in the graph. Do exaustive research.',
|
|
40
|
+
tools: ['search/local_search'],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
instructions: 'Add researched data to the graph. Make connections to existing objects.',
|
|
44
|
+
tools: ['search/local_search', 'graph/writer'],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
package/src/testing/index.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { DEFAULT_EDGE_MODEL, type GenerateRequest } from '@dxos/ai';
|
|
5
6
|
import { createSystemPrompt } from '@dxos/artifact';
|
|
6
|
-
import { DEFAULT_EDGE_MODEL, type GenerateRequest } from '@dxos/assistant';
|
|
7
7
|
|
|
8
8
|
export const createProcessorOptions = (artifacts: string[]): Pick<GenerateRequest, 'model' | 'systemPrompt'> => ({
|
|
9
9
|
model: DEFAULT_EDGE_MODEL,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { create } from '@dxos/echo-schema';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
type ApiAuthorization,
|
|
@@ -54,7 +54,7 @@ const VISUAL_CROSSING_CREDENTIALS: ApiAuthorization = {
|
|
|
54
54
|
// - e.g., https://github.com/konfig-sdks/openapi-examples/blob/main/xkcd/openapi.yaml
|
|
55
55
|
|
|
56
56
|
const TEST_SERVICES: ServiceType[] = [
|
|
57
|
-
|
|
57
|
+
create(ServiceType, {
|
|
58
58
|
serviceId: 'amadeus.com/service/FlightSearch',
|
|
59
59
|
name: 'Amadeus Flight Search',
|
|
60
60
|
description: 'Search for local and international flights.',
|
|
@@ -68,7 +68,7 @@ const TEST_SERVICES: ServiceType[] = [
|
|
|
68
68
|
],
|
|
69
69
|
}),
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
create(ServiceType, {
|
|
72
72
|
serviceId: 'amadeus.com/service/HotelSearch',
|
|
73
73
|
name: 'Amadeus Hotel Search',
|
|
74
74
|
description: 'Search for local and international hotels.',
|
|
@@ -82,7 +82,7 @@ const TEST_SERVICES: ServiceType[] = [
|
|
|
82
82
|
],
|
|
83
83
|
}),
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
create(ServiceType, {
|
|
86
86
|
serviceId: 'visualcrossing.com/service/Weather',
|
|
87
87
|
name: 'Visual Crossing Weather',
|
|
88
88
|
description: 'Search for global weather forecasts.',
|
|
@@ -97,7 +97,7 @@ const TEST_SERVICES: ServiceType[] = [
|
|
|
97
97
|
}),
|
|
98
98
|
|
|
99
99
|
// TODO(burdon): Needs auth.
|
|
100
|
-
|
|
100
|
+
create(ServiceType, {
|
|
101
101
|
serviceId: 'abstractapi.com/service/GeoLocation',
|
|
102
102
|
name: 'Abstract GeoLocation',
|
|
103
103
|
description: 'Get the location of any IP address.',
|
|
@@ -115,7 +115,7 @@ const TEST_SERVICES: ServiceType[] = [
|
|
|
115
115
|
//
|
|
116
116
|
|
|
117
117
|
...Array.from({ length: 20 }, (_, i) =>
|
|
118
|
-
|
|
118
|
+
create(ServiceType, {
|
|
119
119
|
serviceId: `example.com/service/test-${i}`,
|
|
120
120
|
name: `Test ${i}`,
|
|
121
121
|
description: `Test ${i}`,
|
package/src/tools/function.ts
CHANGED
|
@@ -2,33 +2,31 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import type { Tool } from '@dxos/artifact';
|
|
5
|
+
import { createTool, type ExecutableTool, ToolResult } from '@dxos/ai';
|
|
7
6
|
import { toEffectSchema } from '@dxos/echo-schema';
|
|
8
|
-
import { getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions
|
|
9
|
-
import type
|
|
7
|
+
import { getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';
|
|
8
|
+
import { type FunctionType } from '@dxos/functions';
|
|
10
9
|
import { log } from '@dxos/log';
|
|
11
|
-
import type
|
|
10
|
+
import { type SpaceId } from '@dxos/react-client/echo';
|
|
12
11
|
import { getMeta } from '@dxos/react-client/echo';
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
// TODO(burdon): Move to @dxos/ai.
|
|
14
|
+
export const convertFunctionToTool = (
|
|
15
15
|
fn: FunctionType,
|
|
16
16
|
edgeUrl: string,
|
|
17
17
|
spaceId?: SpaceId | undefined,
|
|
18
|
-
):
|
|
18
|
+
): ExecutableTool | undefined => {
|
|
19
19
|
if (!fn.description || !fn.inputSchema) {
|
|
20
20
|
return undefined;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
22
|
const existingFunctionUrl = getUserFunctionUrlInMetadata(getMeta(fn));
|
|
24
23
|
if (!existingFunctionUrl) {
|
|
25
24
|
return undefined;
|
|
26
25
|
}
|
|
27
|
-
const url = getInvocationUrl(existingFunctionUrl, edgeUrl, {
|
|
28
|
-
spaceId,
|
|
29
|
-
});
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
const url = getInvocationUrl(existingFunctionUrl, edgeUrl, { spaceId });
|
|
28
|
+
|
|
29
|
+
return createTool('user-function', {
|
|
32
30
|
name: fn.name,
|
|
33
31
|
description: fn.description,
|
|
34
32
|
schema: toEffectSchema(fn.inputSchema),
|
|
@@ -41,6 +39,7 @@ export const covertFunctionToTool = (
|
|
|
41
39
|
},
|
|
42
40
|
body: JSON.stringify(input),
|
|
43
41
|
});
|
|
42
|
+
|
|
44
43
|
return ToolResult.Success(await response.text());
|
|
45
44
|
},
|
|
46
45
|
});
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, expect, test } from 'vitest';
|
|
6
6
|
|
|
7
|
-
import { AIServiceEdgeClient } from '@dxos/
|
|
8
|
-
import { AI_SERVICE_ENDPOINT } from '@dxos/
|
|
7
|
+
import { AIServiceEdgeClient } from '@dxos/ai';
|
|
8
|
+
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
|
|
11
11
|
import { createToolsFromApi, resolveAuthorization } from './openapi';
|
|
@@ -43,12 +43,14 @@ describe.skip('openapi', () => {
|
|
|
43
43
|
describe.skip('invoke tools', () => {
|
|
44
44
|
test('amadeus hotel name autocomplete', async () => {
|
|
45
45
|
const tools = await createToolsFromApi(HOTEL_NAME_AUTOCOMPLETE_API, { authorization: AMADEUS_AUTH });
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
const result = await tools[0].execute(
|
|
47
|
+
{
|
|
48
|
+
keyword: 'William Vale Brooklyn',
|
|
49
|
+
subType: ['HOTEL_LEISURE', 'HOTEL_GDS'],
|
|
50
|
+
countryCode: 'US',
|
|
51
|
+
},
|
|
52
|
+
{},
|
|
53
|
+
);
|
|
52
54
|
|
|
53
55
|
log.info('result', { result });
|
|
54
56
|
});
|
|
@@ -56,11 +58,13 @@ describe.skip('openapi', () => {
|
|
|
56
58
|
test('weather API', async () => {
|
|
57
59
|
const tools = await createToolsFromApi(WEATHER_API, { authorization: VISUAL_CROSSING_CREDENTIALS });
|
|
58
60
|
const forecastTool = tools.find((t) => t.name.includes('forecast'));
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const result = await forecastTool?.execute(
|
|
62
|
+
{
|
|
63
|
+
locations: 'Brooklyn, NY',
|
|
64
|
+
aggregateHours: '24',
|
|
65
|
+
},
|
|
66
|
+
{},
|
|
67
|
+
);
|
|
64
68
|
|
|
65
69
|
log.info('result', { result });
|
|
66
70
|
});
|
|
@@ -68,10 +72,7 @@ describe.skip('openapi', () => {
|
|
|
68
72
|
|
|
69
73
|
describe.skip('AI uses tools', () => {
|
|
70
74
|
test('amadeus flight availabilities', { timeout: 60_000 }, async () => {
|
|
71
|
-
const tools = await createToolsFromApi(FLIGHT_SEARCH_API, {
|
|
72
|
-
authorization: AMADEUS_AUTH,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
+
const tools = await createToolsFromApi(FLIGHT_SEARCH_API, { authorization: AMADEUS_AUTH });
|
|
75
76
|
const client = new AIServiceEdgeClient({
|
|
76
77
|
endpoint: AI_SERVICE_ENDPOINT.LOCAL,
|
|
77
78
|
});
|
|
@@ -86,7 +87,6 @@ describe.skip('openapi', () => {
|
|
|
86
87
|
// TODO(dmaretskyi): Doesn't work.
|
|
87
88
|
test('amadeus hotel name autocomplete', { timeout: 60_000 }, async () => {
|
|
88
89
|
const tools = await createToolsFromApi(HOTEL_NAME_AUTOCOMPLETE_API, { authorization: AMADEUS_AUTH });
|
|
89
|
-
|
|
90
90
|
const client = new AIServiceEdgeClient({
|
|
91
91
|
endpoint: AI_SERVICE_ENDPOINT.LOCAL,
|
|
92
92
|
});
|
|
@@ -101,7 +101,6 @@ describe.skip('openapi', () => {
|
|
|
101
101
|
authorization: VISUAL_CROSSING_CREDENTIALS,
|
|
102
102
|
instructions: WEATHER_INSTRUCTIONS,
|
|
103
103
|
});
|
|
104
|
-
|
|
105
104
|
const client = new AIServiceEdgeClient({
|
|
106
105
|
endpoint: AI_SERVICE_ENDPOINT.LOCAL,
|
|
107
106
|
});
|
package/src/tools/openapi.ts
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import jsonpointer from 'jsonpointer';
|
|
6
7
|
import { type OpenAPIV2, type OpenAPIV3_1 } from 'openapi-types';
|
|
7
8
|
|
|
8
|
-
import { ToolResult,
|
|
9
|
-
import { JsonSchemaType, normalizeSchema,
|
|
9
|
+
import { type ExecutableTool, ToolResult, createRawTool } from '@dxos/ai';
|
|
10
|
+
import { JsonSchemaType, normalizeSchema, toEffectSchema } from '@dxos/echo-schema';
|
|
10
11
|
import { invariant } from '@dxos/invariant';
|
|
11
12
|
import { log } from '@dxos/log';
|
|
12
13
|
import { deepMapValues } from '@dxos/util';
|
|
@@ -18,7 +19,7 @@ export type CreateToolsFromApiOptions = {
|
|
|
18
19
|
instructions?: string;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
export const createToolsFromService = async (service: ServiceType): Promise<
|
|
22
|
+
export const createToolsFromService = async (service: ServiceType): Promise<ExecutableTool[]> => {
|
|
22
23
|
invariant(service.interfaces?.length === 1 && service.interfaces[0].kind === 'api');
|
|
23
24
|
const iface = service.interfaces[0];
|
|
24
25
|
invariant(iface.schemaUrl);
|
|
@@ -26,18 +27,20 @@ export const createToolsFromService = async (service: ServiceType): Promise<Tool
|
|
|
26
27
|
return createToolsFromApi(iface.schemaUrl, { authorization: iface.authorization });
|
|
27
28
|
};
|
|
28
29
|
|
|
29
|
-
export const createToolsFromApi = async (
|
|
30
|
+
export const createToolsFromApi = async (
|
|
31
|
+
url: string,
|
|
32
|
+
options?: CreateToolsFromApiOptions,
|
|
33
|
+
): Promise<ExecutableTool[]> => {
|
|
30
34
|
const res = await fetch(url);
|
|
31
35
|
const spec = (await res.json()) as OpenAPIV2.Document;
|
|
32
36
|
log('spec', { spec });
|
|
33
37
|
|
|
34
|
-
const tools:
|
|
38
|
+
const tools: ExecutableTool[] = [];
|
|
35
39
|
for (const [path, pathItem] of Object.entries(spec.paths)) {
|
|
36
40
|
if (typeof pathItem !== 'object') {
|
|
37
41
|
continue;
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
// TODO(burdon): ???
|
|
41
44
|
const { ...methods } = pathItem;
|
|
42
45
|
for (const [method, m] of Object.entries(methods)) {
|
|
43
46
|
const methodItem: OpenAPIV2.OperationObject = m as OpenAPIV2.OperationObject;
|
|
@@ -49,6 +52,7 @@ export const createToolsFromApi = async (url: string, options?: CreateToolsFromA
|
|
|
49
52
|
return resolved;
|
|
50
53
|
}) ?? [];
|
|
51
54
|
|
|
55
|
+
// TODO(burdon): Reconcile with toFunctionParameterSchema.
|
|
52
56
|
const inputSchema: JsonSchemaType = {
|
|
53
57
|
type: 'object',
|
|
54
58
|
properties: {},
|
|
@@ -82,7 +86,7 @@ export const createToolsFromApi = async (url: string, options?: CreateToolsFromA
|
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
log('inputSchema', { inputSchema });
|
|
85
|
-
|
|
89
|
+
Schema.validateSync(JsonSchemaType)(inputSchema);
|
|
86
90
|
|
|
87
91
|
const description = methodItem.description ?? methodItem.summary;
|
|
88
92
|
if (!description) {
|
|
@@ -98,15 +102,18 @@ export const createToolsFromApi = async (url: string, options?: CreateToolsFromA
|
|
|
98
102
|
authorization: options?.authorization,
|
|
99
103
|
};
|
|
100
104
|
|
|
101
|
-
tools.push(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
tools.push(
|
|
106
|
+
// TODO(burdon): Namespace?
|
|
107
|
+
createRawTool('openapi', {
|
|
108
|
+
name: getToolName(path, method, methodItem),
|
|
109
|
+
description: options?.instructions ? `${options.instructions}\n\n${description}` : description,
|
|
110
|
+
parameters: inputSchema,
|
|
111
|
+
execute: async (input) => {
|
|
112
|
+
const response = await callApiEndpoint(endpoint, input);
|
|
113
|
+
return ToolResult.Success(response);
|
|
114
|
+
},
|
|
115
|
+
}),
|
|
116
|
+
);
|
|
110
117
|
}
|
|
111
118
|
}
|
|
112
119
|
|
|
@@ -200,7 +207,7 @@ const callApiEndpoint = async (endpoint: EndpointDescriptor, input: any) => {
|
|
|
200
207
|
|
|
201
208
|
// Client-side validation
|
|
202
209
|
const effectSchema = toEffectSchema(parameter.schema);
|
|
203
|
-
|
|
210
|
+
Schema.validateSync(effectSchema)(value);
|
|
204
211
|
|
|
205
212
|
if (body) {
|
|
206
213
|
throw new Error(`Duplicate body parameter: ${parameter.name}`);
|
package/src/translations.ts
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { getSchemaTypename } from '@dxos/echo-schema';
|
|
6
|
+
|
|
5
7
|
import { ASSISTANT_PLUGIN } from './meta';
|
|
6
8
|
import { AIChatType, TemplateType } from './types';
|
|
7
9
|
|
|
8
10
|
export default [
|
|
9
11
|
{
|
|
10
12
|
'en-US': {
|
|
11
|
-
[AIChatType
|
|
12
|
-
'typename label': '
|
|
13
|
+
[getSchemaTypename(AIChatType)!]: {
|
|
14
|
+
'typename label': 'Assistant',
|
|
13
15
|
'object name placeholder': 'AI Chat',
|
|
14
16
|
},
|
|
15
17
|
[TemplateType.typename]: {
|
|
@@ -18,9 +20,8 @@ export default [
|
|
|
18
20
|
},
|
|
19
21
|
[ASSISTANT_PLUGIN]: {
|
|
20
22
|
'templates label': 'Templates',
|
|
21
|
-
|
|
22
|
-
'
|
|
23
|
-
'assistant chat label': 'AI chat',
|
|
23
|
+
'open ambient chat label': 'Open Assistant',
|
|
24
|
+
'assistant chat label': 'Assistant',
|
|
24
25
|
'plugin name': 'Assistant',
|
|
25
26
|
'object placeholder': 'New prompt',
|
|
26
27
|
'create object label': 'Create prompt',
|
|
@@ -29,6 +30,7 @@ export default [
|
|
|
29
30
|
'command placeholder': 'Enter slash command...',
|
|
30
31
|
'template placeholder': 'Enter template...',
|
|
31
32
|
'value placeholder': 'Enter value...',
|
|
33
|
+
'prompt rules label': 'Prompt Rules',
|
|
32
34
|
'typename placeholder': 'Enter typename of objects which this template is for',
|
|
33
35
|
'description placeholder': 'Enter description of when this template should be used',
|
|
34
36
|
'select preset template placeholder': 'Select preset',
|
|
@@ -37,6 +39,7 @@ export default [
|
|
|
37
39
|
'assistant dialog title': 'Assistant',
|
|
38
40
|
'open assistant label': 'Open assistant',
|
|
39
41
|
|
|
42
|
+
'search input placeholder': 'Search...',
|
|
40
43
|
'chat input placeholder': 'Ask a question...',
|
|
41
44
|
'chat stop': 'Cancel request.',
|
|
42
45
|
|
|
@@ -46,7 +49,7 @@ export default [
|
|
|
46
49
|
|
|
47
50
|
'settings default label': 'Default',
|
|
48
51
|
'settings custom prompts label': 'Use custom prompts',
|
|
49
|
-
'settings llm provider label': '
|
|
52
|
+
'settings llm provider label': 'LLM provider',
|
|
50
53
|
'settings edge llm model label': 'Remote language model',
|
|
51
54
|
'settings ollama llm model label': 'Ollama language model',
|
|
52
55
|
},
|
package/src/types/chat.ts
CHANGED
|
@@ -2,9 +2,32 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { Type } from '@dxos/echo';
|
|
8
|
+
import { Expando, Ref } from '@dxos/echo-schema';
|
|
9
|
+
|
|
10
|
+
export const AIChatType = Schema.Struct({
|
|
11
|
+
id: Type.ObjectId,
|
|
12
|
+
name: Schema.optional(Schema.String),
|
|
8
13
|
// TODO(wittjosiah): Should be a ref to a Queue.
|
|
9
|
-
|
|
10
|
-
})
|
|
14
|
+
queue: Ref(Expando),
|
|
15
|
+
}).pipe(
|
|
16
|
+
Type.Obj({
|
|
17
|
+
typename: 'dxos.org/type/AIChat',
|
|
18
|
+
version: '0.2.0',
|
|
19
|
+
}),
|
|
20
|
+
);
|
|
21
|
+
export interface AIChatType extends Schema.Schema.Type<typeof AIChatType> {}
|
|
22
|
+
|
|
23
|
+
export const CompanionTo = Schema.Struct({
|
|
24
|
+
id: Type.ObjectId,
|
|
25
|
+
}).pipe(
|
|
26
|
+
Type.Relation({
|
|
27
|
+
typename: 'dxos.org/relation/CompanionTo',
|
|
28
|
+
version: '0.1.0',
|
|
29
|
+
source: AIChatType,
|
|
30
|
+
target: Expando,
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
export interface CompanionTo extends Schema.Schema.Type<typeof CompanionTo> {}
|
package/src/types/service.ts
CHANGED
|
@@ -2,78 +2,80 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
5
7
|
import { ComputeGraph } from '@dxos/conductor';
|
|
6
|
-
import { Ref,
|
|
7
|
-
import { FunctionType } from '@dxos/functions
|
|
8
|
-
|
|
9
|
-
const ApiAuthorizationKey =
|
|
10
|
-
type:
|
|
11
|
-
key:
|
|
12
|
-
placement:
|
|
13
|
-
|
|
14
|
-
type:
|
|
8
|
+
import { Ref, TypedObject, type Ref$ } from '@dxos/echo-schema';
|
|
9
|
+
import { FunctionType } from '@dxos/functions';
|
|
10
|
+
|
|
11
|
+
const ApiAuthorizationKey = Schema.Struct({
|
|
12
|
+
type: Schema.Literal('api-key'),
|
|
13
|
+
key: Schema.String,
|
|
14
|
+
placement: Schema.Union(
|
|
15
|
+
Schema.Struct({
|
|
16
|
+
type: Schema.Literal('authorization-header'),
|
|
15
17
|
}),
|
|
16
|
-
|
|
17
|
-
type:
|
|
18
|
-
name:
|
|
18
|
+
Schema.Struct({
|
|
19
|
+
type: Schema.Literal('query'),
|
|
20
|
+
name: Schema.String,
|
|
19
21
|
}),
|
|
20
22
|
),
|
|
21
23
|
});
|
|
22
24
|
|
|
23
|
-
const ApiAuthorizationOauth =
|
|
24
|
-
type:
|
|
25
|
-
clientId:
|
|
26
|
-
clientSecret:
|
|
27
|
-
tokenUrl:
|
|
28
|
-
grantType:
|
|
25
|
+
const ApiAuthorizationOauth = Schema.Struct({
|
|
26
|
+
type: Schema.Literal('oauth'),
|
|
27
|
+
clientId: Schema.String,
|
|
28
|
+
clientSecret: Schema.String,
|
|
29
|
+
tokenUrl: Schema.String,
|
|
30
|
+
grantType: Schema.String,
|
|
29
31
|
});
|
|
30
32
|
|
|
31
|
-
export const ApiAuthorization =
|
|
32
|
-
export type ApiAuthorization =
|
|
33
|
+
export const ApiAuthorization = Schema.Union(ApiAuthorizationKey, ApiAuthorizationOauth);
|
|
34
|
+
export type ApiAuthorization = Schema.Schema.Type<typeof ApiAuthorization>;
|
|
33
35
|
|
|
34
|
-
const ServiceInterfaceFunction =
|
|
35
|
-
kind:
|
|
36
|
+
const ServiceInterfaceFunction = Schema.Struct({
|
|
37
|
+
kind: Schema.Literal('function'),
|
|
36
38
|
fn: Ref(FunctionType) as Ref$<FunctionType>,
|
|
37
39
|
});
|
|
38
40
|
|
|
39
|
-
const ServiceInterfaceWorkflow =
|
|
40
|
-
kind:
|
|
41
|
+
const ServiceInterfaceWorkflow = Schema.Struct({
|
|
42
|
+
kind: Schema.Literal('workflow'),
|
|
41
43
|
workflow: Ref(ComputeGraph) as Ref$<ComputeGraph>,
|
|
42
44
|
});
|
|
43
45
|
|
|
44
|
-
const ServiceInterfaceApi =
|
|
45
|
-
kind:
|
|
46
|
+
const ServiceInterfaceApi = Schema.Struct({
|
|
47
|
+
kind: Schema.Literal('api'),
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
50
|
* URL to fetch the openapi schema.
|
|
49
51
|
*/
|
|
50
|
-
schemaUrl:
|
|
52
|
+
schemaUrl: Schema.optional(Schema.String),
|
|
51
53
|
|
|
52
54
|
/**
|
|
53
55
|
* Inlined openapi schema.
|
|
54
56
|
*/
|
|
55
|
-
schema:
|
|
57
|
+
schema: Schema.optional(Schema.Any),
|
|
56
58
|
|
|
57
59
|
/**
|
|
58
60
|
* Authorization configuration if required.
|
|
59
61
|
*/
|
|
60
|
-
authorization:
|
|
62
|
+
authorization: Schema.optional(ApiAuthorization),
|
|
61
63
|
});
|
|
62
64
|
|
|
63
|
-
const ServiceInterface =
|
|
64
|
-
export type ServiceInterface =
|
|
65
|
+
const ServiceInterface = Schema.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);
|
|
66
|
+
export type ServiceInterface = Schema.Schema.Type<typeof ServiceInterface>;
|
|
65
67
|
|
|
66
68
|
export class ServiceType extends TypedObject({ typename: 'dxos.org/type/ServiceType', version: '0.1.0' })({
|
|
67
|
-
serviceId:
|
|
68
|
-
name:
|
|
69
|
-
description:
|
|
70
|
-
category:
|
|
71
|
-
enabled:
|
|
69
|
+
serviceId: Schema.String,
|
|
70
|
+
name: Schema.optional(Schema.String),
|
|
71
|
+
description: Schema.optional(Schema.String),
|
|
72
|
+
category: Schema.optional(Schema.String),
|
|
73
|
+
enabled: Schema.optional(Schema.Boolean),
|
|
72
74
|
|
|
73
75
|
/**
|
|
74
76
|
* Entries exposed: functions, workflows, and APIs.
|
|
75
77
|
*/
|
|
76
|
-
interfaces:
|
|
78
|
+
interfaces: Schema.optional(Schema.Array(ServiceInterface)),
|
|
77
79
|
}) {}
|
|
78
80
|
|
|
79
81
|
//
|
package/src/types/template.ts
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { TypedObject } from '@dxos/echo-schema';
|
|
8
|
+
|
|
9
|
+
// TODO(burdon): Change to Schema.Literal (and discriminated union).
|
|
8
10
|
export enum TemplateInputType {
|
|
9
11
|
VALUE = 0,
|
|
10
12
|
PASS_THROUGH = 1,
|
|
@@ -16,41 +18,41 @@ export enum TemplateInputType {
|
|
|
16
18
|
SCHEMA = 7,
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
export const TemplateInputSchema =
|
|
20
|
-
|
|
21
|
-
name:
|
|
22
|
-
type:
|
|
23
|
-
value:
|
|
21
|
+
export const TemplateInputSchema = Schema.mutable(
|
|
22
|
+
Schema.Struct({
|
|
23
|
+
name: Schema.String,
|
|
24
|
+
type: Schema.optional(Schema.Enums(TemplateInputType)),
|
|
25
|
+
value: Schema.optional(Schema.String),
|
|
24
26
|
}),
|
|
25
27
|
);
|
|
26
28
|
|
|
27
|
-
export type TemplateInput =
|
|
29
|
+
export type TemplateInput = Schema.Schema.Type<typeof TemplateInputSchema>;
|
|
28
30
|
|
|
29
31
|
export const TemplateKinds = ['always', 'schema-matching', 'automatically', 'manual'] as const;
|
|
30
32
|
export type TemplateKind = (typeof TemplateKinds)[number];
|
|
31
33
|
|
|
32
|
-
export const TemplateKindSchema =
|
|
33
|
-
|
|
34
|
-
include:
|
|
34
|
+
export const TemplateKindSchema = Schema.Union(
|
|
35
|
+
Schema.Struct({
|
|
36
|
+
include: Schema.Literal('always'),
|
|
35
37
|
}),
|
|
36
|
-
|
|
37
|
-
include:
|
|
38
|
-
typename:
|
|
38
|
+
Schema.Struct({
|
|
39
|
+
include: Schema.Literal('schema-matching'),
|
|
40
|
+
typename: Schema.String,
|
|
39
41
|
}),
|
|
40
|
-
|
|
41
|
-
include:
|
|
42
|
-
description:
|
|
42
|
+
Schema.Struct({
|
|
43
|
+
include: Schema.Literal('automatically'),
|
|
44
|
+
description: Schema.String,
|
|
43
45
|
}),
|
|
44
|
-
|
|
45
|
-
include:
|
|
46
|
+
Schema.Struct({
|
|
47
|
+
include: Schema.Literal('manual'),
|
|
46
48
|
}),
|
|
47
49
|
);
|
|
48
50
|
|
|
49
|
-
export type TemplateKindType =
|
|
51
|
+
export type TemplateKindType = Schema.Schema.Type<typeof TemplateKindSchema>;
|
|
50
52
|
export class TemplateType extends TypedObject({ typename: 'dxos.org/type/Template', version: '0.1.0' })({
|
|
51
|
-
name:
|
|
52
|
-
kind:
|
|
53
|
-
source:
|
|
54
|
-
inputs:
|
|
55
|
-
command:
|
|
53
|
+
name: Schema.optional(Schema.String),
|
|
54
|
+
kind: Schema.mutable(TemplateKindSchema),
|
|
55
|
+
source: Schema.String,
|
|
56
|
+
inputs: Schema.optional(Schema.mutable(Schema.Array(TemplateInputSchema))),
|
|
57
|
+
command: Schema.optional(Schema.String),
|
|
56
58
|
}) {}
|