@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
|
@@ -4,16 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { DEFAULT_EDGE_MODELS, DEFAULT_OLLAMA_MODELS } from '@dxos/
|
|
7
|
+
import { DEFAULT_EDGE_MODELS, DEFAULT_OLLAMA_MODELS } from '@dxos/ai';
|
|
8
8
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
10
10
|
|
|
11
11
|
import { ASSISTANT_PLUGIN } from '../../meta';
|
|
12
|
-
import { type AssistantSettingsProps } from '../../types';
|
|
12
|
+
import { LLM_PROVIDERS, type AssistantSettingsProps } from '../../types';
|
|
13
13
|
|
|
14
|
-
// TODO(burdon): Factor out.
|
|
14
|
+
// TODO(burdon): Factor out default Selector.
|
|
15
15
|
const DEFAULT_VALUE = '__default';
|
|
16
16
|
|
|
17
|
+
const LLM_PROVIDER_LABELS = {
|
|
18
|
+
edge: 'DXOS',
|
|
19
|
+
ollama: 'Ollama',
|
|
20
|
+
lmstudio: 'LM Studio',
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
17
23
|
export const AssistantSettings = ({ settings }: { settings: AssistantSettingsProps }) => {
|
|
18
24
|
const { t } = useTranslation(ASSISTANT_PLUGIN);
|
|
19
25
|
|
|
@@ -27,10 +33,26 @@ export const AssistantSettings = ({ settings }: { settings: AssistantSettingsPro
|
|
|
27
33
|
</DeprecatedFormInput>
|
|
28
34
|
|
|
29
35
|
<DeprecatedFormInput label={t('settings llm provider label')}>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
<Select.Root
|
|
37
|
+
value={settings.llmProvider ?? 'edge'}
|
|
38
|
+
onValueChange={(value) => {
|
|
39
|
+
settings.llmProvider = value === DEFAULT_VALUE ? undefined : (value as any);
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<Select.TriggerButton placeholder={t('settings llm provider label')} />
|
|
43
|
+
<Select.Portal>
|
|
44
|
+
<Select.Content>
|
|
45
|
+
<Select.Viewport>
|
|
46
|
+
<Select.Option value={DEFAULT_VALUE}>{t('settings default label')}</Select.Option>
|
|
47
|
+
{LLM_PROVIDERS.map((model) => (
|
|
48
|
+
<Select.Option key={model} value={model}>
|
|
49
|
+
{LLM_PROVIDER_LABELS[model]}
|
|
50
|
+
</Select.Option>
|
|
51
|
+
))}
|
|
52
|
+
</Select.Viewport>
|
|
53
|
+
</Select.Content>
|
|
54
|
+
</Select.Portal>
|
|
55
|
+
</Select.Root>
|
|
34
56
|
</DeprecatedFormInput>
|
|
35
57
|
|
|
36
58
|
<DeprecatedFormInput label={t('settings edge llm model label')}>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
|
|
9
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
10
|
+
|
|
11
|
+
import { BlueprintEditor } from './BlueprintEditor';
|
|
12
|
+
import { RESEARCH_BLUEPRINT } from '../../testing';
|
|
13
|
+
import translations from '../../translations';
|
|
14
|
+
|
|
15
|
+
const meta: Meta<typeof BlueprintEditor> = {
|
|
16
|
+
title: 'plugins/plugin-assistant/BlueprintEditor',
|
|
17
|
+
component: BlueprintEditor,
|
|
18
|
+
decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'mli-auto max-is-[50rem] justify-center' })],
|
|
19
|
+
parameters: {
|
|
20
|
+
translations,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof BlueprintEditor>;
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
blueprint: RESEARCH_BLUEPRINT,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Blueprint, type BlueprintParser } from '@dxos/assistant';
|
|
8
|
+
import { toJsonSchema } from '@dxos/echo-schema';
|
|
9
|
+
import { useThemeContext, type ThemedClassName } from '@dxos/react-ui';
|
|
10
|
+
import {
|
|
11
|
+
createBasicExtensions,
|
|
12
|
+
createJsonExtensions,
|
|
13
|
+
createThemeExtensions,
|
|
14
|
+
editorMonospace,
|
|
15
|
+
useTextEditor,
|
|
16
|
+
} from '@dxos/react-ui-editor';
|
|
17
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
+
|
|
19
|
+
export type BlueprintEditorProps = ThemedClassName<{
|
|
20
|
+
blueprint: BlueprintParser.DSL;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
// TODO(burdon): Factor out JsonEditor.
|
|
24
|
+
// TODO(burdon): Make editable.
|
|
25
|
+
export const BlueprintEditor = ({ classNames, blueprint }: BlueprintEditorProps) => {
|
|
26
|
+
const { themeMode } = useThemeContext();
|
|
27
|
+
const { parentRef } = useTextEditor({
|
|
28
|
+
initialValue: JSON.stringify(blueprint, null, 2),
|
|
29
|
+
extensions: [
|
|
30
|
+
createBasicExtensions({ lineWrapping: false }),
|
|
31
|
+
createThemeExtensions({ themeMode, syntaxHighlighting: true }),
|
|
32
|
+
// TODO(burdon): ERROR: reference "/schemas/any" resolves to more than one schema
|
|
33
|
+
createJsonExtensions({ schema: toJsonSchema(Blueprint) }),
|
|
34
|
+
editorMonospace,
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div ref={parentRef} className={mx('flex w-full pli-2 overflow-x-scroll border-x border-separator', classNames)} />
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { type FC } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, useCapabilities, useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { type AssociatedArtifact } from '@dxos/artifact';
|
|
@@ -13,16 +13,14 @@ import { ThreadContainer } from './Thread';
|
|
|
13
13
|
import { ASSISTANT_PLUGIN } from '../meta';
|
|
14
14
|
import { type AssistantSettingsProps, type AIChatType } from '../types';
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
export const ChatContainer = ({
|
|
18
|
-
role,
|
|
19
|
-
chat,
|
|
20
|
-
associatedArtifact,
|
|
21
|
-
}: {
|
|
16
|
+
export type ChatContainerProps = {
|
|
22
17
|
role: string;
|
|
23
18
|
chat: AIChatType;
|
|
24
19
|
associatedArtifact?: AssociatedArtifact;
|
|
25
|
-
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// TODO(burdon): Attention.
|
|
23
|
+
export const ChatContainer: FC<ChatContainerProps> = ({ role, chat, associatedArtifact }) => {
|
|
26
24
|
const transcription = useCapabilities(TranscriptionCapabilities.Transcriber).length > 0;
|
|
27
25
|
const settings = useCapability(Capabilities.SettingsStore).getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;
|
|
28
26
|
|
|
@@ -7,17 +7,65 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
|
+
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
+
import { log } from '@dxos/log';
|
|
13
|
+
import { TranscriptionPlugin } from '@dxos/plugin-transcription';
|
|
10
14
|
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
11
15
|
|
|
12
16
|
import { Prompt } from './Prompt';
|
|
13
|
-
import { PromptBar } from './PromptBar';
|
|
17
|
+
import { PromptBar, type PromptBarProps } from './PromptBar';
|
|
14
18
|
import type { ReferenceData } from './references';
|
|
15
19
|
import translations from '../../translations';
|
|
16
20
|
|
|
21
|
+
const references: ReferenceData[] = [
|
|
22
|
+
{
|
|
23
|
+
uri: 'dxn:echo:@:AAAAAAAA',
|
|
24
|
+
label: 'Meeting Notes',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
uri: 'dxn:echo:@:BBBBBBBB',
|
|
28
|
+
label: 'Project Plan',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
uri: 'dxn:echo:@:CCCCCCCC',
|
|
32
|
+
label: 'Meeting Plan',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const DefaultStory = (props: PromptBarProps) => {
|
|
37
|
+
const [processing, setProcessing] = useState(false);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
let t: NodeJS.Timeout;
|
|
40
|
+
if (processing) {
|
|
41
|
+
t = setTimeout(() => setProcessing(false), 10_000);
|
|
42
|
+
}
|
|
43
|
+
return () => clearTimeout(t);
|
|
44
|
+
}, [processing]);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<PromptBar
|
|
48
|
+
classNames='w-[25rem] p-1 overflow-hidden border border-gray-200 rounded'
|
|
49
|
+
microphone
|
|
50
|
+
processing={processing}
|
|
51
|
+
onSubmit={() => setProcessing(true)}
|
|
52
|
+
onCancel={() => setProcessing(false)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
17
58
|
const meta: Meta<typeof Prompt> = {
|
|
18
|
-
title: 'plugins/plugin-
|
|
59
|
+
title: 'plugins/plugin-assistant/Prompt',
|
|
19
60
|
component: Prompt,
|
|
20
|
-
|
|
61
|
+
render: DefaultStory,
|
|
62
|
+
decorators: [
|
|
63
|
+
withPluginManager({
|
|
64
|
+
plugins: [IntentPlugin(), SettingsPlugin(), TranscriptionPlugin()],
|
|
65
|
+
}),
|
|
66
|
+
withTheme,
|
|
67
|
+
withLayout(),
|
|
68
|
+
],
|
|
21
69
|
parameters: {
|
|
22
70
|
layout: 'centered',
|
|
23
71
|
translations,
|
|
@@ -26,14 +74,14 @@ const meta: Meta<typeof Prompt> = {
|
|
|
26
74
|
|
|
27
75
|
export default meta;
|
|
28
76
|
|
|
29
|
-
type Story = StoryObj<typeof
|
|
77
|
+
type Story = StoryObj<typeof DefaultStory>;
|
|
30
78
|
|
|
31
|
-
export const Default: Story = {
|
|
79
|
+
export const Default: Story = {};
|
|
80
|
+
|
|
81
|
+
export const WithSuggestions: Story = {
|
|
32
82
|
args: {
|
|
33
|
-
classNames: 'w-96 p-4 rounded outline outline-gray-200',
|
|
34
|
-
autoFocus: true,
|
|
35
83
|
onSubmit: (text) => {
|
|
36
|
-
|
|
84
|
+
log('onSubmit', { text });
|
|
37
85
|
},
|
|
38
86
|
onSuggest: (text) => {
|
|
39
87
|
const trimmed = text.trim().toLowerCase();
|
|
@@ -54,60 +102,19 @@ export const Default: Story = {
|
|
|
54
102
|
},
|
|
55
103
|
};
|
|
56
104
|
|
|
57
|
-
export const
|
|
58
|
-
render: (args) => {
|
|
59
|
-
const [processing, setProcessing] = useState(false);
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
let t: NodeJS.Timeout;
|
|
62
|
-
if (processing) {
|
|
63
|
-
t = setTimeout(() => setProcessing(false), 10_000);
|
|
64
|
-
}
|
|
65
|
-
return () => clearTimeout(t);
|
|
66
|
-
}, [processing]);
|
|
67
|
-
console.log('processing', processing);
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<PromptBar
|
|
71
|
-
classNames='w-[25rem] p-1 overflow-hidden border border-gray-200 rounded'
|
|
72
|
-
microphone
|
|
73
|
-
processing={processing}
|
|
74
|
-
onSubmit={() => setProcessing(true)}
|
|
75
|
-
onCancel={() => setProcessing(false)}
|
|
76
|
-
{...args}
|
|
77
|
-
/>
|
|
78
|
-
);
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const Includes: Story = {
|
|
105
|
+
export const WithReferences: Story = {
|
|
83
106
|
args: {
|
|
84
|
-
classNames: 'w-96 p-4 rounded outline outline-gray-200',
|
|
85
107
|
references: {
|
|
86
108
|
getReferences: async ({ query }) => {
|
|
87
109
|
const res = references.filter((i) => i.label.toLowerCase().startsWith(query.toLowerCase()));
|
|
88
|
-
|
|
110
|
+
log('getReferences', { query, res });
|
|
89
111
|
return res;
|
|
90
112
|
},
|
|
91
113
|
resolveReference: async ({ uri }) => {
|
|
92
114
|
const res = references.find((i) => i.uri === uri);
|
|
93
|
-
|
|
115
|
+
log('resolveReference', { uri, res });
|
|
94
116
|
return res ?? null;
|
|
95
117
|
},
|
|
96
118
|
},
|
|
97
119
|
},
|
|
98
120
|
};
|
|
99
|
-
|
|
100
|
-
const references: ReferenceData[] = [
|
|
101
|
-
{
|
|
102
|
-
uri: 'dxn:echo:@:AAAAAAAA',
|
|
103
|
-
label: 'Meeting Notes',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
uri: 'dxn:echo:@:BBBBBBBB',
|
|
107
|
-
label: 'Project Plan',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
uri: 'dxn:echo:@:CCCCCCCC',
|
|
111
|
-
label: 'Meeting Plan',
|
|
112
|
-
},
|
|
113
|
-
];
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Prec } from '@codemirror/state';
|
|
5
|
+
import { type Extension, Prec } from '@codemirror/state';
|
|
6
6
|
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
9
9
|
import {
|
|
10
|
-
type BasicExtensionsOptions,
|
|
11
10
|
createBasicExtensions,
|
|
12
11
|
createThemeExtensions,
|
|
13
12
|
keymap,
|
|
14
13
|
useTextEditor,
|
|
14
|
+
type BasicExtensionsOptions,
|
|
15
15
|
type UseTextEditorProps,
|
|
16
16
|
} from '@dxos/react-ui-editor';
|
|
17
17
|
import { mx } from '@dxos/react-ui-theme';
|
|
18
|
+
import { isNonNullable } from '@dxos/util';
|
|
18
19
|
|
|
19
|
-
import {
|
|
20
|
+
import { autocompleteExtension, type AutocompleteOptions } from './autocomplete';
|
|
20
21
|
import { promptReferences, type ReferencesProvider } from './references';
|
|
21
22
|
|
|
22
23
|
// TODO(burdon): Handle object references.
|
|
@@ -28,8 +29,9 @@ export interface PromptController {
|
|
|
28
29
|
|
|
29
30
|
export type PromptProps = ThemedClassName<
|
|
30
31
|
{
|
|
31
|
-
|
|
32
|
+
extensions?: Extension;
|
|
32
33
|
references?: ReferencesProvider;
|
|
34
|
+
onOpenChange?: (open: boolean) => void;
|
|
33
35
|
} & AutocompleteOptions &
|
|
34
36
|
Pick<UseTextEditorProps, 'autoFocus'> &
|
|
35
37
|
Pick<BasicExtensionsOptions, 'lineWrapping' | 'placeholder'>
|
|
@@ -37,7 +39,18 @@ export type PromptProps = ThemedClassName<
|
|
|
37
39
|
|
|
38
40
|
export const Prompt = forwardRef<PromptController, PromptProps>(
|
|
39
41
|
(
|
|
40
|
-
{
|
|
42
|
+
{
|
|
43
|
+
classNames,
|
|
44
|
+
extensions,
|
|
45
|
+
references,
|
|
46
|
+
autoFocus,
|
|
47
|
+
lineWrapping = false,
|
|
48
|
+
placeholder,
|
|
49
|
+
onSubmit,
|
|
50
|
+
onSuggest,
|
|
51
|
+
onCancel,
|
|
52
|
+
onOpenChange,
|
|
53
|
+
},
|
|
41
54
|
forwardRef,
|
|
42
55
|
) => {
|
|
43
56
|
const { themeMode } = useThemeContext();
|
|
@@ -46,6 +59,7 @@ export const Prompt = forwardRef<PromptController, PromptProps>(
|
|
|
46
59
|
debug: true,
|
|
47
60
|
autoFocus,
|
|
48
61
|
extensions: [
|
|
62
|
+
autocompleteExtension({ onSubmit, onSuggest, onCancel }),
|
|
49
63
|
createBasicExtensions({
|
|
50
64
|
bracketMatching: false,
|
|
51
65
|
lineWrapping,
|
|
@@ -53,13 +67,12 @@ export const Prompt = forwardRef<PromptController, PromptProps>(
|
|
|
53
67
|
}),
|
|
54
68
|
createThemeExtensions({ themeMode }),
|
|
55
69
|
references ? promptReferences({ provider: references }) : [],
|
|
56
|
-
createAutocompleteExtension({ onSubmit, onSuggest }),
|
|
57
70
|
Prec.highest(
|
|
58
71
|
keymap.of([
|
|
59
72
|
{
|
|
60
73
|
key: 'cmd-ArrowUp',
|
|
61
74
|
preventDefault: true,
|
|
62
|
-
run: (
|
|
75
|
+
run: () => {
|
|
63
76
|
onOpenChange?.(true);
|
|
64
77
|
return true;
|
|
65
78
|
},
|
|
@@ -67,16 +80,17 @@ export const Prompt = forwardRef<PromptController, PromptProps>(
|
|
|
67
80
|
{
|
|
68
81
|
key: 'cmd-ArrowDown',
|
|
69
82
|
preventDefault: true,
|
|
70
|
-
run: (
|
|
83
|
+
run: () => {
|
|
71
84
|
onOpenChange?.(false);
|
|
72
85
|
return true;
|
|
73
86
|
},
|
|
74
87
|
},
|
|
75
88
|
]),
|
|
76
89
|
),
|
|
77
|
-
|
|
90
|
+
extensions,
|
|
91
|
+
].filter(isNonNullable),
|
|
78
92
|
},
|
|
79
|
-
[themeMode, onSubmit, onSuggest],
|
|
93
|
+
[themeMode, extensions, onSubmit, onSuggest],
|
|
80
94
|
);
|
|
81
95
|
|
|
82
96
|
// Expose editor view.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
import React, { useEffect, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
+
import { log } from '@dxos/log';
|
|
13
|
+
import { TranscriptionPlugin } from '@dxos/plugin-transcription';
|
|
14
|
+
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
15
|
+
|
|
16
|
+
import { PromptBar } from './PromptBar';
|
|
17
|
+
import translations from '../../translations';
|
|
18
|
+
|
|
19
|
+
const meta: Meta<typeof PromptBar> = {
|
|
20
|
+
title: 'plugins/plugin-assistant/PromptBar',
|
|
21
|
+
component: PromptBar,
|
|
22
|
+
decorators: [
|
|
23
|
+
withPluginManager({
|
|
24
|
+
plugins: [IntentPlugin(), SettingsPlugin(), TranscriptionPlugin()],
|
|
25
|
+
}),
|
|
26
|
+
withTheme,
|
|
27
|
+
withLayout(),
|
|
28
|
+
],
|
|
29
|
+
parameters: {
|
|
30
|
+
layout: 'centered',
|
|
31
|
+
translations,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default meta;
|
|
36
|
+
|
|
37
|
+
type Story = StoryObj<typeof PromptBar>;
|
|
38
|
+
|
|
39
|
+
export const Default: Story = {
|
|
40
|
+
// args: {
|
|
41
|
+
// classNames: 'w-96 p-4 rounded outline outline-gray-200',
|
|
42
|
+
// },
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Toolbar: Story = {
|
|
46
|
+
render: (args) => {
|
|
47
|
+
const [processing, setProcessing] = useState(false);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
let t: NodeJS.Timeout;
|
|
50
|
+
if (processing) {
|
|
51
|
+
t = setTimeout(() => setProcessing(false), 10_000);
|
|
52
|
+
}
|
|
53
|
+
return () => clearTimeout(t);
|
|
54
|
+
}, [processing]);
|
|
55
|
+
log.info('processing', { processing });
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<PromptBar
|
|
59
|
+
classNames='w-[25rem] p-1 overflow-hidden border border-gray-200 rounded'
|
|
60
|
+
microphone
|
|
61
|
+
processing={processing}
|
|
62
|
+
onSubmit={() => setProcessing(true)}
|
|
63
|
+
onCancel={() => setProcessing(false)}
|
|
64
|
+
{...args}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -2,110 +2,104 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { forwardRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { useVoiceInput } from '@dxos/plugin-transcription';
|
|
8
|
-
import { Icon, IconButton, type ThemedClassName, Tooltip, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { Icon, IconButton, type ThemedClassName, Tooltip, useForwardedRef, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { Spinner } from '@dxos/react-ui-sfx';
|
|
10
|
-
import {
|
|
10
|
+
import { errorText, mx } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
12
|
import { Prompt, type PromptController, type PromptProps } from './Prompt';
|
|
13
13
|
import { ASSISTANT_PLUGIN } from '../../meta';
|
|
14
14
|
|
|
15
15
|
export type PromptBarProps = ThemedClassName<
|
|
16
|
-
Pick<
|
|
16
|
+
Pick<
|
|
17
|
+
PromptProps,
|
|
18
|
+
| 'extensions'
|
|
19
|
+
| 'references'
|
|
20
|
+
| 'placeholder'
|
|
21
|
+
| 'lineWrapping'
|
|
22
|
+
| 'onSubmit'
|
|
23
|
+
| 'onSuggest'
|
|
24
|
+
| 'onCancel'
|
|
25
|
+
| 'onOpenChange'
|
|
26
|
+
> & {
|
|
17
27
|
processing?: boolean;
|
|
18
28
|
error?: Error;
|
|
19
29
|
microphone?: boolean;
|
|
20
|
-
onCancel?: () => void;
|
|
21
30
|
}
|
|
22
31
|
>;
|
|
23
32
|
|
|
24
|
-
export const PromptBar = (
|
|
25
|
-
classNames,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
microphone,
|
|
30
|
-
onCancel,
|
|
31
|
-
references,
|
|
32
|
-
...props
|
|
33
|
-
}: PromptBarProps) => {
|
|
34
|
-
const { t } = useTranslation(ASSISTANT_PLUGIN);
|
|
33
|
+
export const PromptBar = forwardRef<PromptController, PromptBarProps>(
|
|
34
|
+
({ classNames, placeholder, processing, error, microphone, references, onCancel, ...props }, forwardedRef) => {
|
|
35
|
+
const { t } = useTranslation(ASSISTANT_PLUGIN);
|
|
36
|
+
const promptRef = useForwardedRef<PromptController>(forwardedRef);
|
|
37
|
+
const [active, setActive] = useState(false);
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
// TODO(burdon): Configure capability in TranscriptionPlugin.
|
|
40
|
+
const { recording } = useVoiceInput({
|
|
41
|
+
active,
|
|
42
|
+
onUpdate: (text) => {
|
|
43
|
+
promptRef.current?.setText(text);
|
|
44
|
+
promptRef.current?.focus();
|
|
45
|
+
},
|
|
46
|
+
});
|
|
37
47
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<div
|
|
50
|
-
className={mx(
|
|
51
|
-
'shrink-0 w-full grid grid-cols-[var(--rail-action)_1fr_var(--rail-action)] overflow-hidden',
|
|
52
|
-
classNames,
|
|
53
|
-
)}
|
|
54
|
-
>
|
|
55
|
-
<div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
|
|
56
|
-
{(error && (
|
|
57
|
-
<Tooltip.Root delayDuration={0}>
|
|
58
|
-
<Tooltip.Trigger>
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
className={mx(
|
|
51
|
+
'shrink-0 w-full grid grid-cols-[var(--rail-action)_1fr_var(--rail-action)] overflow-hidden',
|
|
52
|
+
classNames,
|
|
53
|
+
)}
|
|
54
|
+
>
|
|
55
|
+
<div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
|
|
56
|
+
{(error && (
|
|
57
|
+
<Tooltip.Trigger content={error.message} delayDuration={0}>
|
|
59
58
|
<Icon icon='ph--warning-circle--regular' classNames={errorText} size={5} />
|
|
60
59
|
</Tooltip.Trigger>
|
|
61
|
-
|
|
62
|
-
<Tooltip.Content>
|
|
63
|
-
<div className={mx('text-sm', errorMessageColors)}>{error.message}</div>
|
|
64
|
-
<Tooltip.Arrow />
|
|
65
|
-
</Tooltip.Content>
|
|
66
|
-
</Tooltip.Portal>
|
|
67
|
-
</Tooltip.Root>
|
|
68
|
-
)) || <Spinner active={processing} />}
|
|
69
|
-
</div>
|
|
70
|
-
<Prompt
|
|
71
|
-
ref={promptRef}
|
|
72
|
-
autoFocus
|
|
73
|
-
classNames='pbs-2'
|
|
74
|
-
lineWrapping={true}
|
|
75
|
-
placeholder={placeholder ?? t('prompt placeholder')}
|
|
76
|
-
references={references}
|
|
77
|
-
{...props}
|
|
78
|
-
/>
|
|
79
|
-
{(onCancel || microphone) && (
|
|
80
|
-
<div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
|
|
81
|
-
{processing && onCancel && (
|
|
82
|
-
<IconButton
|
|
83
|
-
classNames='px-1.5'
|
|
84
|
-
variant='ghost'
|
|
85
|
-
size={5}
|
|
86
|
-
icon='ph--x--regular'
|
|
87
|
-
iconOnly
|
|
88
|
-
label={t('cancel processing button')}
|
|
89
|
-
onClick={onCancel}
|
|
90
|
-
/>
|
|
91
|
-
)}
|
|
92
|
-
{!processing && microphone && (
|
|
93
|
-
<IconButton
|
|
94
|
-
classNames={mx('px-1.5', recording && 'bg-primary-500')}
|
|
95
|
-
variant='ghost'
|
|
96
|
-
size={5}
|
|
97
|
-
icon='ph--microphone--regular'
|
|
98
|
-
iconOnly
|
|
99
|
-
noTooltip
|
|
100
|
-
label={t('microphone button')}
|
|
101
|
-
onMouseDown={() => setActive(true)}
|
|
102
|
-
onMouseUp={() => setActive(false)}
|
|
103
|
-
onTouchStart={() => setActive(true)}
|
|
104
|
-
onTouchEnd={() => setActive(false)}
|
|
105
|
-
/>
|
|
106
|
-
)}
|
|
60
|
+
)) || <Spinner active={processing} />}
|
|
107
61
|
</div>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
62
|
+
<Prompt
|
|
63
|
+
ref={promptRef}
|
|
64
|
+
autoFocus
|
|
65
|
+
classNames='pbs-2'
|
|
66
|
+
lineWrapping={true}
|
|
67
|
+
placeholder={placeholder ?? t('prompt placeholder')}
|
|
68
|
+
references={references}
|
|
69
|
+
onCancel={onCancel}
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
{(onCancel || microphone) && (
|
|
73
|
+
<div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
|
|
74
|
+
{processing && onCancel && (
|
|
75
|
+
<IconButton
|
|
76
|
+
classNames='px-1.5'
|
|
77
|
+
variant='ghost'
|
|
78
|
+
size={5}
|
|
79
|
+
icon='ph--x--regular'
|
|
80
|
+
iconOnly
|
|
81
|
+
label={t('cancel processing button')}
|
|
82
|
+
onClick={onCancel}
|
|
83
|
+
/>
|
|
84
|
+
)}
|
|
85
|
+
{!processing && microphone && (
|
|
86
|
+
<IconButton
|
|
87
|
+
classNames={mx('px-1.5', recording && 'bg-primary-500')}
|
|
88
|
+
variant='ghost'
|
|
89
|
+
size={5}
|
|
90
|
+
icon='ph--microphone--regular'
|
|
91
|
+
iconOnly
|
|
92
|
+
noTooltip
|
|
93
|
+
label={t('microphone button')}
|
|
94
|
+
onMouseDown={() => setActive(true)}
|
|
95
|
+
onMouseUp={() => setActive(false)}
|
|
96
|
+
onTouchStart={() => setActive(true)}
|
|
97
|
+
onTouchEnd={() => setActive(false)}
|
|
98
|
+
/>
|
|
99
|
+
)}
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
},
|
|
105
|
+
);
|