@dxos/plugin-assistant 0.8.2-main.fbd8ed0 → 0.8.2-staging.42af850
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/{node-esm/ChatContainer-FAYGNMQW.mjs.map → browser/ChatContainer-QTO4LE2C.mjs.map} +1 -1
- package/dist/lib/browser/TemplateContainer-AKUYL4AV.mjs +28 -0
- package/dist/lib/{node-esm/TemplateContainer-3LEBT5ZC.mjs.map → browser/TemplateContainer-AKUYL4AV.mjs.map} +1 -1
- package/dist/lib/browser/{ai-client-5PRCXI7N.mjs → ai-client-COXVUC6V.mjs} +4 -4
- package/dist/lib/browser/ai-client-COXVUC6V.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-HTK3HFGM.mjs → app-graph-builder-YH4EGNBC.mjs} +45 -28
- 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-OWZHLWW5.mjs → chunk-QTW7KVDO.mjs} +1595 -1452
- 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 +24 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-QV5AAVJZ.mjs → intent-resolver-63EAHENI.mjs} +6 -5
- 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-OZX7J65A.mjs → settings-SHNQ4XXP.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +4 -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-WVAAOEOH.cjs → ChatContainer-5CLHJOIQ.cjs} +25 -19
- package/dist/lib/node/{ChatContainer-WVAAOEOH.cjs.map → ChatContainer-5CLHJOIQ.cjs.map} +1 -1
- package/dist/lib/node/{TemplateContainer-EQXKHWTF.cjs → TemplateContainer-CTG2MB4W.cjs} +18 -12
- package/dist/lib/node/{TemplateContainer-EQXKHWTF.cjs.map → TemplateContainer-CTG2MB4W.cjs.map} +1 -1
- package/dist/lib/node/{ai-client-OUPSRQT7.cjs → ai-client-R2CGEYZW.cjs} +12 -12
- package/dist/lib/node/ai-client-R2CGEYZW.cjs.map +7 -0
- package/dist/lib/node/{app-graph-builder-LEO63CZZ.cjs → app-graph-builder-PSHIOW3Q.cjs} +62 -46
- 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-OOHFSPWR.cjs → chunk-H4A42LNR.cjs} +1126 -983
- 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 +72 -59
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-QDGZMWLY.cjs → intent-resolver-66F7WLW6.cjs} +13 -12
- 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-WLTC7XO5.cjs → settings-ERKLO6IO.cjs} +8 -8
- package/dist/lib/node/types/index.cjs +16 -14
- 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/{browser/ChatContainer-ZNKENYKZ.mjs.map → node-esm/ChatContainer-QTC5NYE2.mjs.map} +1 -1
- package/dist/lib/node-esm/TemplateContainer-IVDQ4XQG.mjs +29 -0
- package/dist/lib/{browser/TemplateContainer-WKU5XFSO.mjs.map → node-esm/TemplateContainer-IVDQ4XQG.mjs.map} +1 -1
- package/dist/lib/node-esm/{ai-client-RZQWEDUX.mjs → ai-client-I5LXHMOZ.mjs} +4 -4
- package/dist/lib/node-esm/ai-client-I5LXHMOZ.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-WXJNZDYB.mjs → app-graph-builder-Z3GMMJMD.mjs} +45 -28
- 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-ED55ZE4G.mjs → chunk-SI5LOQEO.mjs} +1595 -1452
- 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 +24 -10
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-Q3I6S6HN.mjs → intent-resolver-X3PWH7KM.mjs} +6 -5
- 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-CLE57WEP.mjs → settings-IVQRZUCU.mjs} +3 -3
- package/dist/lib/node-esm/types/index.mjs +4 -2
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-client.d.ts +1 -1
- package/dist/types/src/capabilities/ai-client.d.ts.map +1 -1
- 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 +1 -1
- 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/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/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/Thread/Thread.d.ts +2 -2
- package/dist/types/src/components/Thread/Thread.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 +2 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -0
- 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/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/useMessageQueue.d.ts +11 -7
- package/dist/types/src/hooks/useMessageQueue.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 +63 -6
- 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/types.d.ts +6 -3
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +73 -61
- package/src/AssistantPlugin.tsx +5 -4
- package/src/capabilities/ai-client.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +34 -24
- package/src/capabilities/capabilities.ts +1 -1
- package/src/capabilities/intent-resolver.ts +3 -2
- package/src/capabilities/react-surface.tsx +58 -13
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +1 -1
- package/src/components/AmbientDialog/AmbientDialog.tsx +27 -13
- package/src/components/AssistantDialog.tsx +1 -1
- package/src/components/AssistantSettings/AssistantSettings.tsx +1 -1
- 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/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 -80
- package/src/components/Prompt/autocomplete.ts +14 -8
- package/src/components/Prompt/references.ts +3 -3
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +1 -1
- package/src/components/Thread/Thread.stories.tsx +2 -2
- package/src/components/Thread/Thread.tsx +2 -2
- package/src/components/Thread/ThreadContainer.stories.tsx +77 -47
- package/src/components/Thread/ThreadContainer.tsx +8 -9
- package/src/components/Thread/ThreadMessage.tsx +43 -8
- package/src/components/Thread/ToolInvocations.tsx +9 -7
- package/src/components/Thread/reducer.ts +1 -1
- package/src/components/Toolbox/Toolbox.stories.tsx +1 -1
- package/src/components/Toolbox/Toolbox.tsx +2 -1
- package/src/components/index.ts +2 -0
- package/src/experimental/transcription/index.ts +3 -0
- package/src/hooks/processor.ts +65 -27
- package/src/hooks/useChatProcessor.tsx +4 -4
- package/src/hooks/useContextProvider.ts +6 -6
- package/src/hooks/useMessageQueue.ts +4 -4
- 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/tools/function.ts +8 -7
- package/src/tools/openapi.test.ts +18 -19
- package/src/tools/openapi.ts +20 -14
- package/src/translations.ts +4 -2
- package/src/types/chat.ts +27 -4
- package/src/types/types.ts +3 -1
- package/dist/lib/browser/AssistantDialog-DTWVEQBB.mjs +0 -117
- package/dist/lib/browser/AssistantDialog-DTWVEQBB.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-ZNKENYKZ.mjs +0 -33
- package/dist/lib/browser/TemplateContainer-WKU5XFSO.mjs +0 -22
- package/dist/lib/browser/ai-client-5PRCXI7N.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-HTK3HFGM.mjs.map +0 -7
- package/dist/lib/browser/chunk-5P7U35RJ.mjs +0 -192
- package/dist/lib/browser/chunk-5P7U35RJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-7VDZP5WX.mjs +0 -143
- package/dist/lib/browser/chunk-7VDZP5WX.mjs.map +0 -7
- package/dist/lib/browser/chunk-NFUHCW2J.mjs +0 -81
- package/dist/lib/browser/chunk-OWZHLWW5.mjs.map +0 -7
- package/dist/lib/browser/chunk-TXJWGWJ7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-QV5AAVJZ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JJPYWEIN.mjs +0 -90
- package/dist/lib/browser/react-surface-JJPYWEIN.mjs.map +0 -7
- package/dist/lib/node/AssistantDialog-RJJHZI63.cjs +0 -141
- package/dist/lib/node/AssistantDialog-RJJHZI63.cjs.map +0 -7
- package/dist/lib/node/ai-client-OUPSRQT7.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-LEO63CZZ.cjs.map +0 -7
- package/dist/lib/node/chunk-GBUNQ257.cjs.map +0 -7
- package/dist/lib/node/chunk-GQ3XS5FZ.cjs +0 -169
- package/dist/lib/node/chunk-GQ3XS5FZ.cjs.map +0 -7
- package/dist/lib/node/chunk-OOHFSPWR.cjs.map +0 -7
- package/dist/lib/node/chunk-VG2UQY4S.cjs +0 -216
- package/dist/lib/node/chunk-VG2UQY4S.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-QDGZMWLY.cjs.map +0 -7
- package/dist/lib/node/react-surface-XNEIJJYJ.cjs +0 -106
- package/dist/lib/node/react-surface-XNEIJJYJ.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-D33WZUGR.mjs +0 -118
- package/dist/lib/node-esm/AssistantDialog-D33WZUGR.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-FAYGNMQW.mjs +0 -34
- package/dist/lib/node-esm/TemplateContainer-3LEBT5ZC.mjs +0 -23
- package/dist/lib/node-esm/ai-client-RZQWEDUX.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-WXJNZDYB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6JK5HEUQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-74GFINWJ.mjs +0 -144
- package/dist/lib/node-esm/chunk-74GFINWJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ED55ZE4G.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UZWYXNR5.mjs +0 -193
- package/dist/lib/node-esm/chunk-UZWYXNR5.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-Q3I6S6HN.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RI3JONQY.mjs +0 -91
- package/dist/lib/node-esm/react-surface-RI3JONQY.mjs.map +0 -7
- /package/dist/lib/browser/{settings-OZX7J65A.mjs.map → settings-SHNQ4XXP.mjs.map} +0 -0
- /package/dist/lib/node/{settings-WLTC7XO5.cjs.map → settings-ERKLO6IO.cjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-CLE57WEP.mjs.map → settings-IVQRZUCU.mjs.map} +0 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
8
|
+
import { Schema } from 'effect';
|
|
9
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
|
+
|
|
11
|
+
import { AIServiceEdgeClient, type AIServiceEdgeClientOptions } from '@dxos/ai';
|
|
12
|
+
import { SpyAIService } from '@dxos/ai/testing';
|
|
13
|
+
import { Events } from '@dxos/app-framework';
|
|
14
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
15
|
+
import { localServiceEndpoints, remoteServiceEndpoints } from '@dxos/artifact-testing';
|
|
16
|
+
import { BlueprintParser, BlueprintMachine, setConsolePrinter } from '@dxos/assistant';
|
|
17
|
+
import { Filter, Queue, type Space } from '@dxos/client/echo';
|
|
18
|
+
import { Type } from '@dxos/echo';
|
|
19
|
+
import { type AnyEchoObject, create, getLabelForObject, getTypename, Ref } from '@dxos/echo-schema';
|
|
20
|
+
import { SelectionModel } from '@dxos/graph';
|
|
21
|
+
import { log } from '@dxos/log';
|
|
22
|
+
import { D3ForceGraph, type D3ForceGraphProps } from '@dxos/plugin-explorer';
|
|
23
|
+
import { faker } from '@dxos/random';
|
|
24
|
+
import { useClient } from '@dxos/react-client';
|
|
25
|
+
import { useQueue } from '@dxos/react-client/echo';
|
|
26
|
+
import { Dialog, IconButton, Toolbar, useAsyncState, useTranslation } from '@dxos/react-ui';
|
|
27
|
+
import {
|
|
28
|
+
matchCompletion,
|
|
29
|
+
staticCompletion,
|
|
30
|
+
typeahead,
|
|
31
|
+
type TypeaheadContext,
|
|
32
|
+
type TypeaheadOptions,
|
|
33
|
+
} from '@dxos/react-ui-editor';
|
|
34
|
+
import { List } from '@dxos/react-ui-list';
|
|
35
|
+
import { JsonFilter } from '@dxos/react-ui-syntax-highlighter';
|
|
36
|
+
import { getHashColor, mx } from '@dxos/react-ui-theme';
|
|
37
|
+
import { DataType, SpaceGraphModel } from '@dxos/schema';
|
|
38
|
+
import { createObjectFactory, type TypeSpec, type ValueGenerator } from '@dxos/schema/testing';
|
|
39
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
40
|
+
|
|
41
|
+
import { addTestData } from './test-data';
|
|
42
|
+
import { testPlugins } from './testing';
|
|
43
|
+
import { AmbientDialog, PromptBar, type PromptController, type PromptBarProps } from '../components';
|
|
44
|
+
import { ASSISTANT_PLUGIN } from '../meta';
|
|
45
|
+
import { createFilter, type Expression, QueryParser } from '../parser';
|
|
46
|
+
import { RESEARCH_BLUEPRINT, createTools } from '../testing';
|
|
47
|
+
import translations from '../translations';
|
|
48
|
+
|
|
49
|
+
faker.seed(1);
|
|
50
|
+
|
|
51
|
+
// TODO(burdon): Evolve dxos/random to support this directly.
|
|
52
|
+
const generator = faker as any as ValueGenerator;
|
|
53
|
+
|
|
54
|
+
const LOCAL = false;
|
|
55
|
+
const endpoints = LOCAL ? localServiceEndpoints : remoteServiceEndpoints;
|
|
56
|
+
|
|
57
|
+
// TODO(burdon) Move to story args.
|
|
58
|
+
const aiConfig: AIServiceEdgeClientOptions = {
|
|
59
|
+
endpoint: endpoints.ai,
|
|
60
|
+
defaultGenerationOptions: {
|
|
61
|
+
model: '@anthropic/claude-3-5-sonnet-20241022',
|
|
62
|
+
// model: '@anthropic/claude-sonnet-4-20250514',
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
type Mode = 'graph' | 'list';
|
|
67
|
+
|
|
68
|
+
type StoryProps = { mode?: Mode; spec?: TypeSpec[] } & D3ForceGraphProps;
|
|
69
|
+
|
|
70
|
+
const DefaultStory = ({ mode, spec, ...props }: StoryProps) => {
|
|
71
|
+
const { t } = useTranslation(ASSISTANT_PLUGIN);
|
|
72
|
+
const showList = mode !== 'graph';
|
|
73
|
+
const showGraph = mode !== 'list';
|
|
74
|
+
|
|
75
|
+
const [ast, setAst] = useState<Expression | undefined>();
|
|
76
|
+
const [filter, setFilter] = useState<Filter.Any>();
|
|
77
|
+
|
|
78
|
+
const selection = useMemo(() => new SelectionModel(), []);
|
|
79
|
+
|
|
80
|
+
//
|
|
81
|
+
// Graph
|
|
82
|
+
//
|
|
83
|
+
|
|
84
|
+
const [model] = useState<SpaceGraphModel | undefined>(() => {
|
|
85
|
+
if (!showGraph) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return new SpaceGraphModel().setOptions({
|
|
90
|
+
onCreateEdge: (edge, relation) => {
|
|
91
|
+
// TODO(burdon): Check type.
|
|
92
|
+
if ((relation as any).active === false) {
|
|
93
|
+
edge.data.force = false;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const client = useClient();
|
|
100
|
+
const [space, setSpace] = useState<Space | undefined>();
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
const spaces = client.spaces.get().filter((space) => space.isOpen);
|
|
103
|
+
if (spaces.length) {
|
|
104
|
+
setSpace(spaces[0]);
|
|
105
|
+
}
|
|
106
|
+
}, [client]);
|
|
107
|
+
|
|
108
|
+
const [researchGraph] = useAsyncState(async () => {
|
|
109
|
+
if (!space) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const { objects } = await space.db.query(Filter.type(ResearchGraph)).run();
|
|
114
|
+
if (objects.length > 0) {
|
|
115
|
+
return objects[0];
|
|
116
|
+
} else {
|
|
117
|
+
const queue = space.queues.create();
|
|
118
|
+
return space.db.add(
|
|
119
|
+
create(ResearchGraph, {
|
|
120
|
+
// TODO(dmaretskyi): Ref.make(queue)
|
|
121
|
+
queue: Ref.fromDXN(queue.dxn),
|
|
122
|
+
}),
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}, [space]);
|
|
126
|
+
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
model?.setFilter(filter ?? Filter.everything());
|
|
129
|
+
}, [model, filter]);
|
|
130
|
+
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!space || !model) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const queue = researchGraph?.queue && space.queues.get(researchGraph.queue.dxn);
|
|
137
|
+
void model.open(space, queue);
|
|
138
|
+
return () => {
|
|
139
|
+
void model.close();
|
|
140
|
+
};
|
|
141
|
+
}, [space, model, researchGraph?.queue.dxn.toString()]);
|
|
142
|
+
|
|
143
|
+
// TODO(burdon): Hack to filter out invalid (queue) objects.
|
|
144
|
+
const objects =
|
|
145
|
+
model?.nodes
|
|
146
|
+
.filter((node) => {
|
|
147
|
+
try {
|
|
148
|
+
getTypename(node.data.object as AnyEchoObject);
|
|
149
|
+
return true;
|
|
150
|
+
} catch {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
.map((node) => node.data.object as AnyEchoObject) ?? [];
|
|
155
|
+
|
|
156
|
+
//
|
|
157
|
+
// AI
|
|
158
|
+
//
|
|
159
|
+
|
|
160
|
+
const aiClient = useMemo(() => new SpyAIService(new AIServiceEdgeClient(aiConfig)), []);
|
|
161
|
+
|
|
162
|
+
const researchQueue = useQueue(researchGraph?.queue.dxn, { pollInterval: 1_000 });
|
|
163
|
+
|
|
164
|
+
const researchBlueprint = useMemo(() => {
|
|
165
|
+
if (!space || !researchGraph) {
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const tools = createTools(space, researchGraph?.queue.dxn);
|
|
170
|
+
return BlueprintParser.create(tools).parse(RESEARCH_BLUEPRINT);
|
|
171
|
+
}, [space, researchGraph?.queue.dxn]);
|
|
172
|
+
|
|
173
|
+
//
|
|
174
|
+
// Handlers
|
|
175
|
+
//
|
|
176
|
+
|
|
177
|
+
const handleRefresh = useCallback(() => {
|
|
178
|
+
model?.invalidate();
|
|
179
|
+
}, [model]);
|
|
180
|
+
|
|
181
|
+
const handleResearch = useCallback(async () => {
|
|
182
|
+
if (!space || !researchBlueprint) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const selected = selection.selected.value;
|
|
187
|
+
log.info('starting research...', { selected });
|
|
188
|
+
const { objects } = await space.db.query(Filter.ids(...selected)).run();
|
|
189
|
+
const machine = new BlueprintMachine(researchBlueprint);
|
|
190
|
+
setConsolePrinter(machine, true);
|
|
191
|
+
await machine.runToCompletion({ aiService: aiClient, input: objects });
|
|
192
|
+
}, [space, aiClient, researchBlueprint, selection]);
|
|
193
|
+
|
|
194
|
+
const handleGenerate = useCallback(async () => {
|
|
195
|
+
if (!space) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (spec) {
|
|
200
|
+
const createObjects = createObjectFactory(space.db, generator);
|
|
201
|
+
await createObjects(spec);
|
|
202
|
+
} else {
|
|
203
|
+
await addTestData(space);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// TODO(burdon): BUG: objects are not persisted unless this is called.
|
|
207
|
+
await space.db.flush({ indexes: true });
|
|
208
|
+
}, [space, generator, spec]);
|
|
209
|
+
|
|
210
|
+
const handleReset = useCallback(
|
|
211
|
+
async (reset = false) => {
|
|
212
|
+
if (reset) {
|
|
213
|
+
// TODO(burdon): Doesn't cleanly restart.
|
|
214
|
+
log.info('resetting client...');
|
|
215
|
+
await client.reset();
|
|
216
|
+
log.info('client reset');
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (space) {
|
|
221
|
+
await space.close();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const newSpace = await client.spaces.create();
|
|
225
|
+
setSpace(newSpace);
|
|
226
|
+
setAst(undefined);
|
|
227
|
+
setFilter(undefined);
|
|
228
|
+
promptRef.current?.setText('');
|
|
229
|
+
},
|
|
230
|
+
[space, client],
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
const handleSubmit = useCallback<NonNullable<PromptBarProps['onSubmit']>>(
|
|
234
|
+
(text) => {
|
|
235
|
+
try {
|
|
236
|
+
const parser = new QueryParser(text);
|
|
237
|
+
const ast = parser.parse();
|
|
238
|
+
setAst(ast);
|
|
239
|
+
const filter = createFilter(ast);
|
|
240
|
+
setFilter(filter);
|
|
241
|
+
} catch (err) {
|
|
242
|
+
// TODO(mykola): Make hybrid search.
|
|
243
|
+
const filter = Filter.text(text, { type: 'vector' });
|
|
244
|
+
setFilter(filter);
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
[space],
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
//
|
|
251
|
+
// Prompt
|
|
252
|
+
//
|
|
253
|
+
|
|
254
|
+
const promptRef = useRef<PromptController>(null);
|
|
255
|
+
const handleCancel = useCallback<NonNullable<PromptBarProps['onCancel']>>(() => {
|
|
256
|
+
setAst(undefined);
|
|
257
|
+
setFilter(undefined);
|
|
258
|
+
promptRef.current?.setText('');
|
|
259
|
+
}, []);
|
|
260
|
+
|
|
261
|
+
const handleMatch = useCallback<NonNullable<TypeaheadOptions['onComplete']>>(createMatcher(space), [space]);
|
|
262
|
+
|
|
263
|
+
const extensions = useMemo(() => [typeahead({ onComplete: handleMatch })], [handleMatch]);
|
|
264
|
+
|
|
265
|
+
return (
|
|
266
|
+
<div className='grow grid overflow-hidden'>
|
|
267
|
+
<div className={mx('grow grid overflow-hidden', !mode && 'grid-cols-[1fr_30rem]')}>
|
|
268
|
+
{showGraph && (
|
|
269
|
+
<D3ForceGraph classNames='border-ie border-separator' model={model} selection={selection} {...props} />
|
|
270
|
+
)}
|
|
271
|
+
|
|
272
|
+
{showList && (
|
|
273
|
+
<div className='grow grid grid-rows-[min-content_1fr_1fr] overflow-hidden divide-y divide-separator'>
|
|
274
|
+
<Toolbar.Root>
|
|
275
|
+
<IconButton icon='ph--arrow-clockwise--regular' iconOnly label='refresh' onClick={handleRefresh} />
|
|
276
|
+
<IconButton icon='ph--sparkle--regular' iconOnly label='research' onClick={handleResearch} />
|
|
277
|
+
<IconButton icon='ph--plus--regular' iconOnly label='generate' onClick={handleGenerate} />
|
|
278
|
+
<IconButton
|
|
279
|
+
icon='ph--trash--regular'
|
|
280
|
+
iconOnly
|
|
281
|
+
label='reset'
|
|
282
|
+
onClick={(event) => handleReset(event.shiftKey)}
|
|
283
|
+
/>
|
|
284
|
+
</Toolbar.Root>
|
|
285
|
+
<ItemList items={objects} />
|
|
286
|
+
<JsonFilter
|
|
287
|
+
data={{
|
|
288
|
+
space: client.spaces.get().length,
|
|
289
|
+
db: space?.db.toJSON(),
|
|
290
|
+
queue: researchQueue?.toJSON(),
|
|
291
|
+
model: model?.toJSON(),
|
|
292
|
+
selection: selection.toJSON(),
|
|
293
|
+
ast,
|
|
294
|
+
}}
|
|
295
|
+
/>
|
|
296
|
+
</div>
|
|
297
|
+
)}
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
<Dialog.Root modal={false} open>
|
|
301
|
+
<AmbientDialog resizeable={false} onEscape={handleCancel}>
|
|
302
|
+
<PromptBar
|
|
303
|
+
ref={promptRef}
|
|
304
|
+
placeholder={t('search input placeholder')}
|
|
305
|
+
extensions={extensions}
|
|
306
|
+
onSubmit={handleSubmit}
|
|
307
|
+
onCancel={handleCancel}
|
|
308
|
+
/>
|
|
309
|
+
</AmbientDialog>
|
|
310
|
+
</Dialog.Root>
|
|
311
|
+
</div>
|
|
312
|
+
);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
// TODO(burdon): Factor out; match against expression grammar.
|
|
316
|
+
const createMatcher =
|
|
317
|
+
(space?: Space) =>
|
|
318
|
+
({ line }: TypeaheadContext) => {
|
|
319
|
+
const words = line.split(/\s+/).filter(Boolean);
|
|
320
|
+
if (words.length > 0) {
|
|
321
|
+
const word = words.at(-1)!;
|
|
322
|
+
|
|
323
|
+
// Match type.
|
|
324
|
+
const match = word.match(/^type:(.+)/);
|
|
325
|
+
if (match) {
|
|
326
|
+
const part = match[1];
|
|
327
|
+
for (const schema of space?.db.graph.schemaRegistry.schemas ?? []) {
|
|
328
|
+
const typename = Type.getTypename(schema);
|
|
329
|
+
if (typename) {
|
|
330
|
+
const completion = matchCompletion(typename, part);
|
|
331
|
+
if (completion) {
|
|
332
|
+
return completion;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Match static.
|
|
339
|
+
return staticCompletion(['type:', 'AND', 'OR', 'NOT'])({ line });
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Container for a set of ephemeral research results.
|
|
345
|
+
*/
|
|
346
|
+
const ResearchGraph = Schema.Struct({
|
|
347
|
+
queue: Ref(Queue),
|
|
348
|
+
}).pipe(
|
|
349
|
+
Type.Obj({
|
|
350
|
+
typename: 'dxos.org/type/ResearchGraph',
|
|
351
|
+
version: '0.1.0',
|
|
352
|
+
}),
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
// TODO(burdon): Replace with card list.
|
|
356
|
+
const ItemList = <T extends AnyEchoObject>({ items = [] }: { items?: T[] }) => {
|
|
357
|
+
return (
|
|
358
|
+
<List.Root<T> items={items}>
|
|
359
|
+
{({ items }) => (
|
|
360
|
+
<div role='list' className='grow flex flex-col overflow-y-auto'>
|
|
361
|
+
{/* TODO(burdon): Virtualize. */}
|
|
362
|
+
{items.map((item) => (
|
|
363
|
+
<List.Item<T>
|
|
364
|
+
key={item.id}
|
|
365
|
+
item={item}
|
|
366
|
+
classNames='grid grid-cols-[4rem_16rem_1fr] min-h-[32px] items-center'
|
|
367
|
+
>
|
|
368
|
+
<div className='text-xs font-mono font-thin px-1 text-subdued'>{item.id.slice(-6)}</div>
|
|
369
|
+
<div className={mx('text-xs font-mono font-thin truncate px-1', getHashColor(getTypename(item))?.text)}>
|
|
370
|
+
{getTypename(item)}
|
|
371
|
+
</div>
|
|
372
|
+
<List.ItemTitle>{getLabelForObject(item)}</List.ItemTitle>
|
|
373
|
+
</List.Item>
|
|
374
|
+
))}
|
|
375
|
+
</div>
|
|
376
|
+
)}
|
|
377
|
+
</List.Root>
|
|
378
|
+
);
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
const meta: Meta<typeof DefaultStory> = {
|
|
382
|
+
title: 'plugins/plugin-assistant/Query',
|
|
383
|
+
render: DefaultStory,
|
|
384
|
+
decorators: [
|
|
385
|
+
withPluginManager({
|
|
386
|
+
fireEvents: [Events.SetupArtifactDefinition],
|
|
387
|
+
plugins: testPlugins({
|
|
388
|
+
types: [ResearchGraph],
|
|
389
|
+
config: {
|
|
390
|
+
runtime: {
|
|
391
|
+
client: {
|
|
392
|
+
storage: {
|
|
393
|
+
persistent: true,
|
|
394
|
+
},
|
|
395
|
+
enableVectorIndexing: true,
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
}),
|
|
400
|
+
}),
|
|
401
|
+
withTheme,
|
|
402
|
+
withLayout({ fullscreen: true }),
|
|
403
|
+
],
|
|
404
|
+
parameters: {
|
|
405
|
+
translations,
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
type Story = StoryObj<typeof DefaultStory>;
|
|
410
|
+
|
|
411
|
+
export default meta;
|
|
412
|
+
|
|
413
|
+
export const Default: Story = {
|
|
414
|
+
args: {
|
|
415
|
+
grid: false,
|
|
416
|
+
drag: true,
|
|
417
|
+
spec: [
|
|
418
|
+
{ type: DataType.Organization, count: 10 },
|
|
419
|
+
{ type: DataType.Person, count: 30 },
|
|
420
|
+
],
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
export const WithList: Story = {
|
|
425
|
+
args: {
|
|
426
|
+
mode: 'list',
|
|
427
|
+
spec: [
|
|
428
|
+
{ type: DataType.Organization, count: 30 },
|
|
429
|
+
{ type: DataType.Person, count: 50 },
|
|
430
|
+
],
|
|
431
|
+
},
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
export const GraphList: Story = {
|
|
435
|
+
args: {
|
|
436
|
+
mode: 'graph',
|
|
437
|
+
spec: [
|
|
438
|
+
{ type: DataType.Organization, count: 30 },
|
|
439
|
+
{ type: DataType.Person, count: 50 },
|
|
440
|
+
],
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
export const Research: Story = {
|
|
445
|
+
args: {
|
|
446
|
+
drag: true,
|
|
447
|
+
},
|
|
448
|
+
};
|