@dxos/plugin-assistant 0.8.1-main.ba2dec9 → 0.8.1-staging.31c3ee1
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-AMON6O2T.mjs → AssistantDialog-YSHMAHW5.mjs} +15 -14
- package/dist/lib/browser/AssistantDialog-YSHMAHW5.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-SPZK5ZHX.mjs → ChatContainer-V5GP7DYF.mjs} +11 -11
- package/dist/lib/browser/ChatContainer-V5GP7DYF.mjs.map +7 -0
- package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs +78 -0
- package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs.map +7 -0
- package/dist/lib/browser/ai-client-CDZLSNXE.mjs +35 -0
- package/dist/lib/browser/ai-client-CDZLSNXE.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-MF5EVDWW.mjs +209 -0
- package/dist/lib/browser/app-graph-builder-MF5EVDWW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NV7SVHMV.mjs → chunk-3HCI5FIL.mjs} +2 -2
- package/dist/lib/browser/{chunk-NV7SVHMV.mjs.map → chunk-3HCI5FIL.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-HI564NSX.mjs → chunk-FMB7RGMP.mjs} +379 -247
- package/dist/lib/browser/chunk-FMB7RGMP.mjs.map +7 -0
- package/dist/lib/browser/chunk-IAMR2FAE.mjs +183 -0
- package/dist/lib/browser/chunk-IAMR2FAE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FR7IEJ7N.mjs → chunk-KYMKVE6M.mjs} +37 -15
- package/dist/lib/browser/chunk-KYMKVE6M.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EUMPBC4T.mjs → chunk-NFUHCW2J.mjs} +3 -3
- package/dist/lib/browser/{chunk-NTLTGYYS.mjs → chunk-TXJWGWJ7.mjs} +3 -3
- package/dist/lib/browser/chunk-TXJWGWJ7.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +37 -53
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-FQRN6747.mjs → intent-resolver-WJGLKKVO.mjs} +8 -6
- package/dist/lib/browser/{intent-resolver-FQRN6747.mjs.map → intent-resolver-WJGLKKVO.mjs.map} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-GLNUJX7O.mjs → react-surface-57VRDOQT.mjs} +36 -15
- package/dist/lib/browser/react-surface-57VRDOQT.mjs.map +7 -0
- package/dist/lib/browser/{settings-VVQUGG56.mjs → settings-U6UFQX32.mjs} +4 -4
- package/dist/lib/browser/types/index.mjs +6 -2
- package/dist/lib/node/{AssistantDialog-DS7OCVMV.cjs → AssistantDialog-YI2BSGSX.cjs} +18 -17
- package/dist/lib/node/AssistantDialog-YI2BSGSX.cjs.map +7 -0
- package/dist/lib/node/{ChatContainer-7MNRJL6Q.cjs → ChatContainer-ZJ5JXF6A.cjs} +15 -15
- package/dist/lib/node/ChatContainer-ZJ5JXF6A.cjs.map +7 -0
- package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs +104 -0
- package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs.map +7 -0
- package/dist/lib/node/{ai-client-RBDOGK6W.cjs → ai-client-URCCYU6B.cjs} +19 -19
- package/dist/lib/node/ai-client-URCCYU6B.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-N5ZUUI2Z.cjs +220 -0
- package/dist/lib/node/app-graph-builder-N5ZUUI2Z.cjs.map +7 -0
- package/dist/lib/node/{chunk-34WE2FD2.cjs → chunk-APRU3QWK.cjs} +32 -9
- package/dist/lib/node/chunk-APRU3QWK.cjs.map +7 -0
- package/dist/lib/node/{chunk-3WXG6WA6.cjs → chunk-GBUNQ257.cjs} +6 -6
- package/dist/lib/node/chunk-GBUNQ257.cjs.map +7 -0
- package/dist/lib/node/{chunk-GNPXCHFT.cjs → chunk-Q5XWEMHB.cjs} +4 -4
- package/dist/lib/node/{chunk-GNPXCHFT.cjs.map → chunk-Q5XWEMHB.cjs.map} +2 -2
- package/dist/lib/node/{chunk-3HNLL6MY.cjs → chunk-RPBKMP2E.cjs} +350 -222
- package/dist/lib/node/chunk-RPBKMP2E.cjs.map +7 -0
- package/dist/lib/node/{chunk-NV4TQQSU.cjs → chunk-XI2ARIEO.cjs} +6 -6
- package/dist/lib/node/{chunk-PYTGHFKZ.cjs → chunk-ZKOC4ZFY.cjs} +40 -18
- package/dist/lib/node/chunk-ZKOC4ZFY.cjs.map +7 -0
- package/dist/lib/node/index.cjs +78 -94
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-Z37RNNMC.cjs → intent-resolver-R3OSTIMH.cjs} +14 -12
- package/dist/lib/node/intent-resolver-R3OSTIMH.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-PYGRBZY7.cjs → react-surface-NUQTM6MS.cjs} +47 -26
- package/dist/lib/node/react-surface-NUQTM6MS.cjs.map +7 -0
- package/dist/lib/node/{settings-TJHHVI6B.cjs → settings-TXGRCYAL.cjs} +8 -8
- package/dist/lib/node/types/index.cjs +15 -11
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{AssistantDialog-TSVUYKUL.mjs → AssistantDialog-U2FQX5TD.mjs} +15 -14
- package/dist/lib/node-esm/AssistantDialog-U2FQX5TD.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-H4X734PB.mjs → ChatContainer-QW3OOXTT.mjs} +11 -11
- package/dist/lib/node-esm/ChatContainer-QW3OOXTT.mjs.map +7 -0
- package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs +79 -0
- package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs.map +7 -0
- package/dist/lib/node-esm/ai-client-WMHS5EGV.mjs +36 -0
- package/dist/lib/node-esm/ai-client-WMHS5EGV.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-DWBNIMHM.mjs +210 -0
- package/dist/lib/node-esm/app-graph-builder-DWBNIMHM.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ICQN3TDS.mjs → chunk-6JK5HEUQ.mjs} +3 -3
- package/dist/lib/node-esm/chunk-6JK5HEUQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7SV6X6XU.mjs → chunk-ECRK6TUQ.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-7SV6X6XU.mjs.map → chunk-ECRK6TUQ.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-JRP4BQT4.mjs → chunk-GBBXIW5F.mjs} +37 -15
- package/dist/lib/node-esm/chunk-GBBXIW5F.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-E44GXXNE.mjs → chunk-MVDAY3CZ.mjs} +379 -247
- package/dist/lib/node-esm/chunk-MVDAY3CZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MXK2EANZ.mjs +184 -0
- package/dist/lib/node-esm/chunk-MXK2EANZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LBQGJE5T.mjs → chunk-PBZA7XJR.mjs} +3 -3
- package/dist/lib/node-esm/index.mjs +37 -53
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-LOTXWV4J.mjs → intent-resolver-H32TL4X6.mjs} +8 -6
- package/dist/lib/node-esm/{intent-resolver-LOTXWV4J.mjs.map → intent-resolver-H32TL4X6.mjs.map} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-PEQD6IJS.mjs → react-surface-JBVZF6CP.mjs} +36 -15
- package/dist/lib/node-esm/react-surface-JBVZF6CP.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-BVWR244C.mjs → settings-DZU5PNXM.mjs} +4 -4
- 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 +2 -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 +2 -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 +4 -3
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +1 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/AssistantDialog.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +4 -2
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/Prompt.d.ts +3 -0
- package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts +1 -0
- package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts +2 -2
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/references.d.ts +30 -0
- package/dist/types/src/components/Prompt/references.d.ts.map +1 -0
- package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +3 -3
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Thread/Thread.d.ts +11 -1
- package/dist/types/src/components/Thread/Thread.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +3 -0
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +3 -3
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/processor.d.ts +7 -15
- package/dist/types/src/hooks/processor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +11 -2
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextProvider.d.ts +17 -0
- package/dist/types/src/hooks/useContextProvider.d.ts.map +1 -0
- package/dist/types/src/hooks/useMessageQueue.d.ts +3 -3
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -8
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +26 -12
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/chat.d.ts +4 -6
- package/dist/types/src/types/chat.d.ts.map +1 -1
- package/dist/types/src/types/template.d.ts +36 -0
- package/dist/types/src/types/template.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +3 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +58 -55
- package/src/AssistantPlugin.tsx +19 -23
- package/src/capabilities/ai-client.ts +23 -7
- package/src/capabilities/app-graph-builder.ts +100 -5
- package/src/capabilities/capabilities.ts +3 -1
- package/src/capabilities/intent-resolver.ts +4 -3
- package/src/capabilities/react-surface.tsx +27 -9
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +3 -1
- package/src/components/AmbientDialog/AmbientDialog.tsx +11 -11
- package/src/components/AssistantDialog.tsx +8 -2
- package/src/components/AssistantSettings/AssistantSettings.tsx +39 -5
- package/src/components/ChatContainer.tsx +18 -4
- package/src/components/Prompt/Prompt.stories.tsx +34 -0
- package/src/components/Prompt/Prompt.tsx +28 -18
- package/src/components/Prompt/PromptBar.tsx +5 -3
- package/src/components/Prompt/references.ts +180 -0
- package/src/components/TemplateContainer.tsx +79 -4
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +5 -5
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +3 -3
- package/src/components/Thread/Thread.stories.tsx +3 -3
- package/src/components/Thread/Thread.tsx +21 -0
- package/src/components/Thread/ThreadContainer.stories.tsx +9 -14
- package/src/components/Thread/ThreadContainer.tsx +10 -4
- package/src/components/Thread/ThreadMessage.tsx +17 -9
- package/src/components/Toolbox/Toolbox.stories.tsx +2 -2
- package/src/components/index.ts +3 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/processor.ts +57 -116
- package/src/hooks/useChatProcessor.tsx +35 -19
- package/src/hooks/useContextProvider.ts +55 -0
- package/src/hooks/useMessageQueue.ts +4 -6
- package/src/meta.ts +2 -2
- package/src/testing/test-functions.ts +2 -2
- package/src/translations.ts +11 -5
- package/src/types/chat.ts +2 -3
- package/src/types/template.ts +22 -0
- package/src/types/types.ts +3 -1
- package/dist/lib/browser/AssistantDialog-AMON6O2T.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-SPZK5ZHX.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-B7MQNUPY.mjs +0 -23
- package/dist/lib/browser/TemplateContainer-B7MQNUPY.mjs.map +0 -7
- package/dist/lib/browser/ai-client-PORKRZXM.mjs +0 -33
- package/dist/lib/browser/ai-client-PORKRZXM.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-36SKR7CX.mjs +0 -110
- package/dist/lib/browser/app-graph-builder-36SKR7CX.mjs.map +0 -7
- package/dist/lib/browser/chunk-FPXC3LKK.mjs +0 -162
- package/dist/lib/browser/chunk-FPXC3LKK.mjs.map +0 -7
- package/dist/lib/browser/chunk-FR7IEJ7N.mjs.map +0 -7
- package/dist/lib/browser/chunk-HI564NSX.mjs.map +0 -7
- package/dist/lib/browser/chunk-NTLTGYYS.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GLNUJX7O.mjs.map +0 -7
- package/dist/lib/node/AssistantDialog-DS7OCVMV.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-7MNRJL6Q.cjs.map +0 -7
- package/dist/lib/node/TemplateContainer-R4BZZP3E.cjs +0 -53
- package/dist/lib/node/TemplateContainer-R4BZZP3E.cjs.map +0 -7
- package/dist/lib/node/ai-client-RBDOGK6W.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-V5JKKIY5.cjs +0 -122
- package/dist/lib/node/app-graph-builder-V5JKKIY5.cjs.map +0 -7
- package/dist/lib/node/chunk-34WE2FD2.cjs.map +0 -7
- package/dist/lib/node/chunk-3HNLL6MY.cjs.map +0 -7
- package/dist/lib/node/chunk-3WXG6WA6.cjs.map +0 -7
- package/dist/lib/node/chunk-PYTGHFKZ.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-Z37RNNMC.cjs.map +0 -7
- package/dist/lib/node/react-surface-PYGRBZY7.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-TSVUYKUL.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-H4X734PB.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-WSHTZBB5.mjs +0 -24
- package/dist/lib/node-esm/TemplateContainer-WSHTZBB5.mjs.map +0 -7
- package/dist/lib/node-esm/ai-client-OTZVBDUH.mjs +0 -34
- package/dist/lib/node-esm/ai-client-OTZVBDUH.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-DCAP6QAV.mjs +0 -111
- package/dist/lib/node-esm/app-graph-builder-DCAP6QAV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E44GXXNE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ICQN3TDS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JRP4BQT4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LELXJPGJ.mjs +0 -163
- package/dist/lib/node-esm/chunk-LELXJPGJ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-PEQD6IJS.mjs.map +0 -7
- package/dist/types/src/hooks/email.d.ts +0 -4
- package/dist/types/src/hooks/email.d.ts.map +0 -1
- package/src/hooks/email.ts +0 -49
- /package/dist/lib/browser/{chunk-EUMPBC4T.mjs.map → chunk-NFUHCW2J.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-VVQUGG56.mjs.map → settings-U6UFQX32.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-NV4TQQSU.cjs.map → chunk-XI2ARIEO.cjs.map} +0 -0
- /package/dist/lib/node/{settings-TJHHVI6B.cjs.map → settings-TXGRCYAL.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-LBQGJE5T.mjs.map → chunk-PBZA7XJR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-BVWR244C.mjs.map → settings-DZU5PNXM.mjs.map} +0 -0
|
@@ -2,9 +2,10 @@ declare const _default: {
|
|
|
2
2
|
'en-US': {
|
|
3
3
|
[x: string]: {
|
|
4
4
|
'typename label': string;
|
|
5
|
-
'
|
|
6
|
-
'
|
|
5
|
+
'object name placeholder': string;
|
|
6
|
+
'templates label'?: undefined;
|
|
7
7
|
'open ambient chat label'?: undefined;
|
|
8
|
+
'assistant chat label'?: undefined;
|
|
8
9
|
'plugin name'?: undefined;
|
|
9
10
|
'object placeholder'?: undefined;
|
|
10
11
|
'create object label'?: undefined;
|
|
@@ -13,6 +14,8 @@ declare const _default: {
|
|
|
13
14
|
'command placeholder'?: undefined;
|
|
14
15
|
'template placeholder'?: undefined;
|
|
15
16
|
'value placeholder'?: undefined;
|
|
17
|
+
'typename placeholder'?: undefined;
|
|
18
|
+
'description placeholder'?: undefined;
|
|
16
19
|
'select preset template placeholder'?: undefined;
|
|
17
20
|
'service registry label'?: undefined;
|
|
18
21
|
'assistant dialog title'?: undefined;
|
|
@@ -22,13 +25,15 @@ declare const _default: {
|
|
|
22
25
|
'prompt placeholder'?: undefined;
|
|
23
26
|
'microphone button'?: undefined;
|
|
24
27
|
'cancel processing button'?: undefined;
|
|
28
|
+
'settings default label'?: undefined;
|
|
25
29
|
'settings custom prompts label'?: undefined;
|
|
26
|
-
'settings llm
|
|
27
|
-
'settings
|
|
30
|
+
'settings llm provider label'?: undefined;
|
|
31
|
+
'settings edge llm model label'?: undefined;
|
|
32
|
+
'settings ollama llm model label'?: undefined;
|
|
28
33
|
} | {
|
|
29
|
-
'
|
|
30
|
-
'template title placeholder': string;
|
|
34
|
+
'templates label': string;
|
|
31
35
|
'open ambient chat label': string;
|
|
36
|
+
'assistant chat label': string;
|
|
32
37
|
'plugin name': string;
|
|
33
38
|
'object placeholder': string;
|
|
34
39
|
'create object label': string;
|
|
@@ -37,6 +42,8 @@ declare const _default: {
|
|
|
37
42
|
'command placeholder': string;
|
|
38
43
|
'template placeholder': string;
|
|
39
44
|
'value placeholder': string;
|
|
45
|
+
'typename placeholder': string;
|
|
46
|
+
'description placeholder': string;
|
|
40
47
|
'select preset template placeholder': string;
|
|
41
48
|
'service registry label': string;
|
|
42
49
|
'assistant dialog title': string;
|
|
@@ -46,15 +53,18 @@ declare const _default: {
|
|
|
46
53
|
'prompt placeholder': string;
|
|
47
54
|
'microphone button': string;
|
|
48
55
|
'cancel processing button': string;
|
|
56
|
+
'settings default label': string;
|
|
49
57
|
'settings custom prompts label': string;
|
|
50
|
-
'settings llm
|
|
51
|
-
'settings
|
|
58
|
+
'settings llm provider label': string;
|
|
59
|
+
'settings edge llm model label': string;
|
|
60
|
+
'settings ollama llm model label': string;
|
|
52
61
|
'typename label'?: undefined;
|
|
62
|
+
'object name placeholder'?: undefined;
|
|
53
63
|
};
|
|
54
64
|
"dxos.org/plugin/assistant": {
|
|
55
|
-
'
|
|
56
|
-
'template title placeholder': string;
|
|
65
|
+
'templates label': string;
|
|
57
66
|
'open ambient chat label': string;
|
|
67
|
+
'assistant chat label': string;
|
|
58
68
|
'plugin name': string;
|
|
59
69
|
'object placeholder': string;
|
|
60
70
|
'create object label': string;
|
|
@@ -63,6 +73,8 @@ declare const _default: {
|
|
|
63
73
|
'command placeholder': string;
|
|
64
74
|
'template placeholder': string;
|
|
65
75
|
'value placeholder': string;
|
|
76
|
+
'typename placeholder': string;
|
|
77
|
+
'description placeholder': string;
|
|
66
78
|
'select preset template placeholder': string;
|
|
67
79
|
'service registry label': string;
|
|
68
80
|
'assistant dialog title': string;
|
|
@@ -72,9 +84,11 @@ declare const _default: {
|
|
|
72
84
|
'prompt placeholder': string;
|
|
73
85
|
'microphone button': string;
|
|
74
86
|
'cancel processing button': string;
|
|
87
|
+
'settings default label': string;
|
|
75
88
|
'settings custom prompts label': string;
|
|
76
|
-
'settings llm
|
|
77
|
-
'settings
|
|
89
|
+
'settings llm provider label': string;
|
|
90
|
+
'settings edge llm model label': string;
|
|
91
|
+
'settings ollama llm model label': string;
|
|
78
92
|
};
|
|
79
93
|
};
|
|
80
94
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wBA+CE"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { Expando
|
|
1
|
+
import { Expando } from '@dxos/echo-schema';
|
|
2
2
|
declare const AIChatType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
name: S.optional<typeof S.String>;
|
|
7
|
-
queue: import("@dxos/echo-schema").Ref$<Expando>;
|
|
3
|
+
assistantChatQueue: import("@dxos/echo-schema").Ref$<Expando>;
|
|
4
|
+
}, import("@dxos/echo-schema").TypedObjectOptions>, import("effect/Schema").Struct.Encoded<{
|
|
5
|
+
assistantChatQueue: import("@dxos/echo-schema").Ref$<Expando>;
|
|
8
6
|
}>>;
|
|
9
7
|
export declare class AIChatType extends AIChatType_base {
|
|
10
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAoB,MAAM,mBAAmB,CAAC;;;;;;AAE9D,qBAAa,UAAW,SAAQ,eAG9B;CAAG"}
|
|
@@ -15,8 +15,33 @@ export declare const TemplateInputSchema: S.mutable<S.Struct<{
|
|
|
15
15
|
value: S.optional<typeof S.String>;
|
|
16
16
|
}>>;
|
|
17
17
|
export type TemplateInput = S.Schema.Type<typeof TemplateInputSchema>;
|
|
18
|
+
export declare const TemplateKinds: readonly ["always", "schema-matching", "automatically", "manual"];
|
|
19
|
+
export type TemplateKind = (typeof TemplateKinds)[number];
|
|
20
|
+
export declare const TemplateKindSchema: S.Union<[S.Struct<{
|
|
21
|
+
include: S.Literal<["always"]>;
|
|
22
|
+
}>, S.Struct<{
|
|
23
|
+
include: S.Literal<["schema-matching"]>;
|
|
24
|
+
typename: typeof S.String;
|
|
25
|
+
}>, S.Struct<{
|
|
26
|
+
include: S.Literal<["automatically"]>;
|
|
27
|
+
description: typeof S.String;
|
|
28
|
+
}>, S.Struct<{
|
|
29
|
+
include: S.Literal<["manual"]>;
|
|
30
|
+
}>]>;
|
|
31
|
+
export type TemplateKindType = S.Schema.Type<typeof TemplateKindSchema>;
|
|
18
32
|
declare const TemplateType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
|
|
19
33
|
name: S.optional<typeof S.String>;
|
|
34
|
+
kind: S.mutable<S.Union<[S.Struct<{
|
|
35
|
+
include: S.Literal<["always"]>;
|
|
36
|
+
}>, S.Struct<{
|
|
37
|
+
include: S.Literal<["schema-matching"]>;
|
|
38
|
+
typename: typeof S.String;
|
|
39
|
+
}>, S.Struct<{
|
|
40
|
+
include: S.Literal<["automatically"]>;
|
|
41
|
+
description: typeof S.String;
|
|
42
|
+
}>, S.Struct<{
|
|
43
|
+
include: S.Literal<["manual"]>;
|
|
44
|
+
}>]>>;
|
|
20
45
|
source: typeof S.String;
|
|
21
46
|
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
22
47
|
name: typeof S.String;
|
|
@@ -26,6 +51,17 @@ declare const TemplateType_base: import("@dxos/echo-schema").TypedObjectPrototyp
|
|
|
26
51
|
command: S.optional<typeof S.String>;
|
|
27
52
|
}, import("@dxos/echo-schema").TypedObjectOptions>, S.Struct.Encoded<{
|
|
28
53
|
name: S.optional<typeof S.String>;
|
|
54
|
+
kind: S.mutable<S.Union<[S.Struct<{
|
|
55
|
+
include: S.Literal<["always"]>;
|
|
56
|
+
}>, S.Struct<{
|
|
57
|
+
include: S.Literal<["schema-matching"]>;
|
|
58
|
+
typename: typeof S.String;
|
|
59
|
+
}>, S.Struct<{
|
|
60
|
+
include: S.Literal<["automatically"]>;
|
|
61
|
+
description: typeof S.String;
|
|
62
|
+
}>, S.Struct<{
|
|
63
|
+
include: S.Literal<["manual"]>;
|
|
64
|
+
}>]>>;
|
|
29
65
|
source: typeof S.String;
|
|
30
66
|
inputs: S.optional<S.mutable<S.Array$<S.mutable<S.Struct<{
|
|
31
67
|
name: typeof S.String;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/types/template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAGnD,oBAAY,iBAAiB;IAC3B,KAAK,IAAI;IACT,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,eAAO,MAAM,mBAAmB;;;;GAM/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/types/template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAGnD,oBAAY,iBAAiB;IAC3B,KAAK,IAAI;IACT,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,eAAO,MAAM,mBAAmB;;;;GAM/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,aAAa,mEAAoE,CAAC;AAC/F,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,eAAO,MAAM,kBAAkB;;;;;;;;;;IAe9B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACxE,qBAAa,YAAa,SAAQ,iBAMhC;CAAG"}
|
|
@@ -30,7 +30,9 @@ export declare namespace AssistantAction {
|
|
|
30
30
|
export {};
|
|
31
31
|
}
|
|
32
32
|
export declare const AssistantSettingsSchema: S.mutable<S.Struct<{
|
|
33
|
-
|
|
33
|
+
llmProvider: S.optional<S.Literal<["edge", "ollama"]>>;
|
|
34
|
+
edgeModel: S.optional<typeof S.String>;
|
|
35
|
+
ollamaModel: S.optional<typeof S.String>;
|
|
34
36
|
customPrompts: S.optional<typeof S.Boolean>;
|
|
35
37
|
}>>;
|
|
36
38
|
export type AssistantSettingsProps = S.Schema.Type<typeof AssistantSettingsSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,yBAAiB,eAAe,CAAC;;;;;;;;;;;;IAG/B,MAAM,OAAO,UAAW,SAAQ,eAQ9B;KAAG;;;;;;;;;;;IAEL,MAAM,OAAO,cAAe,SAAQ,mBAOlC;KAAG;;CACN;AAED,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,yBAAiB,eAAe,CAAC;;;;;;;;;;;;IAG/B,MAAM,OAAO,UAAW,SAAQ,eAQ9B;KAAG;;;;;;;;;;;IAEL,MAAM,OAAO,cAAe,SAAQ,mBAOlC;KAAG;;CACN;AAED,eAAO,MAAM,uBAAuB;;;;;GAOnC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-assistant",
|
|
3
|
-
"version": "0.8.1-
|
|
3
|
+
"version": "0.8.1-staging.31c3ee1",
|
|
4
4
|
"description": "Assistant plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -42,51 +42,54 @@
|
|
|
42
42
|
"@lezer/highlight": "^1.2.1",
|
|
43
43
|
"@preact/signals-core": "^1.6.0",
|
|
44
44
|
"@xiechao/codemirror-lang-handlebars": "1.0.4",
|
|
45
|
+
"effect": "3.13.3",
|
|
45
46
|
"jsonpointer": "^5.0.1",
|
|
46
47
|
"lodash.get": "^4.4.2",
|
|
47
48
|
"unified": "^11.0.0",
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/conductor": "0.8.1-
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/echo-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/plugin-
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/plugin-
|
|
70
|
-
"@dxos/plugin-
|
|
71
|
-
"@dxos/plugin-
|
|
72
|
-
"@dxos/plugin-
|
|
73
|
-
"@dxos/plugin-
|
|
74
|
-
"@dxos/plugin-
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/react-
|
|
78
|
-
"@dxos/react-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/react-ui-
|
|
81
|
-
"@dxos/react-ui-
|
|
82
|
-
"@dxos/react-ui-
|
|
83
|
-
"@dxos/react-ui-
|
|
84
|
-
"@dxos/react-ui-
|
|
85
|
-
"@dxos/react-ui-
|
|
86
|
-
"@dxos/react-ui-list": "0.8.1-
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/react-ui-syntax-highlighter": "0.8.1-
|
|
89
|
-
"@dxos/
|
|
49
|
+
"@dxos/artifact": "0.8.1-staging.31c3ee1",
|
|
50
|
+
"@dxos/async": "0.8.1-staging.31c3ee1",
|
|
51
|
+
"@dxos/app-framework": "0.8.1-staging.31c3ee1",
|
|
52
|
+
"@dxos/compute": "0.8.1-staging.31c3ee1",
|
|
53
|
+
"@dxos/client": "0.8.1-staging.31c3ee1",
|
|
54
|
+
"@dxos/assistant": "0.8.1-staging.31c3ee1",
|
|
55
|
+
"@dxos/conductor": "0.8.1-staging.31c3ee1",
|
|
56
|
+
"@dxos/context": "0.8.1-staging.31c3ee1",
|
|
57
|
+
"@dxos/echo-protocol": "0.8.1-staging.31c3ee1",
|
|
58
|
+
"@dxos/echo-db": "0.8.1-staging.31c3ee1",
|
|
59
|
+
"@dxos/echo-schema": "0.8.1-staging.31c3ee1",
|
|
60
|
+
"@dxos/edge-client": "0.8.1-staging.31c3ee1",
|
|
61
|
+
"@dxos/effect": "0.8.1-staging.31c3ee1",
|
|
62
|
+
"@dxos/functions": "0.8.1-staging.31c3ee1",
|
|
63
|
+
"@dxos/invariant": "0.8.1-staging.31c3ee1",
|
|
64
|
+
"@dxos/keys": "0.8.1-staging.31c3ee1",
|
|
65
|
+
"@dxos/local-storage": "0.8.1-staging.31c3ee1",
|
|
66
|
+
"@dxos/live-object": "0.8.1-staging.31c3ee1",
|
|
67
|
+
"@dxos/plugin-client": "0.8.1-staging.31c3ee1",
|
|
68
|
+
"@dxos/log": "0.8.1-staging.31c3ee1",
|
|
69
|
+
"@dxos/plugin-deck": "0.8.1-staging.31c3ee1",
|
|
70
|
+
"@dxos/plugin-inbox": "0.8.1-staging.31c3ee1",
|
|
71
|
+
"@dxos/plugin-markdown": "0.8.1-staging.31c3ee1",
|
|
72
|
+
"@dxos/plugin-graph": "0.8.1-staging.31c3ee1",
|
|
73
|
+
"@dxos/plugin-script": "0.8.1-staging.31c3ee1",
|
|
74
|
+
"@dxos/plugin-sketch": "0.8.1-staging.31c3ee1",
|
|
75
|
+
"@dxos/plugin-space": "0.8.1-staging.31c3ee1",
|
|
76
|
+
"@dxos/plugin-stack": "0.8.1-staging.31c3ee1",
|
|
77
|
+
"@dxos/plugin-transcription": "0.8.1-staging.31c3ee1",
|
|
78
|
+
"@dxos/react-edge-client": "0.8.1-staging.31c3ee1",
|
|
79
|
+
"@dxos/react-client": "0.8.1-staging.31c3ee1",
|
|
80
|
+
"@dxos/plugin-wnfs": "0.8.1-staging.31c3ee1",
|
|
81
|
+
"@dxos/react-ui-canvas-compute": "0.8.1-staging.31c3ee1",
|
|
82
|
+
"@dxos/react-ui-canvas-editor": "0.8.1-staging.31c3ee1",
|
|
83
|
+
"@dxos/react-ui-components": "0.8.1-staging.31c3ee1",
|
|
84
|
+
"@dxos/react-ui-dnd": "0.8.1-staging.31c3ee1",
|
|
85
|
+
"@dxos/react-ui-editor": "0.8.1-staging.31c3ee1",
|
|
86
|
+
"@dxos/react-ui-form": "0.8.1-staging.31c3ee1",
|
|
87
|
+
"@dxos/react-ui-list": "0.8.1-staging.31c3ee1",
|
|
88
|
+
"@dxos/react-ui-sfx": "0.8.1-staging.31c3ee1",
|
|
89
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.1-staging.31c3ee1",
|
|
90
|
+
"@dxos/schema": "0.8.1-staging.31c3ee1",
|
|
91
|
+
"@dxos/util": "0.8.1-staging.31c3ee1",
|
|
92
|
+
"@dxos/react-ui-stack": "0.8.1-staging.31c3ee1"
|
|
90
93
|
},
|
|
91
94
|
"devDependencies": {
|
|
92
95
|
"@types/lodash.get": "^4.4.7",
|
|
@@ -96,22 +99,22 @@
|
|
|
96
99
|
"react": "~18.2.0",
|
|
97
100
|
"react-dom": "~18.2.0",
|
|
98
101
|
"vite": "5.4.7",
|
|
99
|
-
"@dxos/echo-db": "0.8.1-
|
|
100
|
-
"@dxos/
|
|
101
|
-
"@dxos/plugin-
|
|
102
|
-
"@dxos/plugin-
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/random": "0.8.1-
|
|
105
|
-
"@dxos/
|
|
106
|
-
"@dxos/react-ui": "0.8.1-
|
|
107
|
-
"@dxos/
|
|
108
|
-
"@dxos/storybook-utils": "0.8.1-
|
|
102
|
+
"@dxos/echo-db": "0.8.1-staging.31c3ee1",
|
|
103
|
+
"@dxos/artifact-testing": "0.8.1-staging.31c3ee1",
|
|
104
|
+
"@dxos/plugin-chess": "0.8.1-staging.31c3ee1",
|
|
105
|
+
"@dxos/plugin-inbox": "0.8.1-staging.31c3ee1",
|
|
106
|
+
"@dxos/plugin-map": "0.8.1-staging.31c3ee1",
|
|
107
|
+
"@dxos/random": "0.8.1-staging.31c3ee1",
|
|
108
|
+
"@dxos/plugin-table": "0.8.1-staging.31c3ee1",
|
|
109
|
+
"@dxos/react-ui": "0.8.1-staging.31c3ee1",
|
|
110
|
+
"@dxos/react-ui-theme": "0.8.1-staging.31c3ee1",
|
|
111
|
+
"@dxos/storybook-utils": "0.8.1-staging.31c3ee1"
|
|
109
112
|
},
|
|
110
113
|
"peerDependencies": {
|
|
111
114
|
"react": "~18.2.0",
|
|
112
115
|
"react-dom": "~18.2.0",
|
|
113
|
-
"@dxos/react-ui": "0.8.1-
|
|
114
|
-
"@dxos/react-ui-theme": "0.8.1-
|
|
116
|
+
"@dxos/react-ui": "0.8.1-staging.31c3ee1",
|
|
117
|
+
"@dxos/react-ui-theme": "0.8.1-staging.31c3ee1"
|
|
115
118
|
},
|
|
116
119
|
"publishConfig": {
|
|
117
120
|
"access": "public"
|
package/src/AssistantPlugin.tsx
CHANGED
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
allOf,
|
|
7
|
+
Capabilities,
|
|
8
|
+
contributes,
|
|
9
|
+
createIntent,
|
|
10
|
+
defineModule,
|
|
11
|
+
definePlugin,
|
|
12
|
+
Events,
|
|
13
|
+
} from '@dxos/app-framework';
|
|
6
14
|
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
7
|
-
import { DeckCapabilities, DeckEvents } from '@dxos/plugin-deck';
|
|
8
15
|
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
9
16
|
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
10
17
|
|
|
11
18
|
import { AiClient, AppGraphBuilder, IntentResolver, ReactSurface, AssistantSettings } from './capabilities';
|
|
12
|
-
import {
|
|
19
|
+
import { meta } from './meta';
|
|
13
20
|
import translations from './translations';
|
|
14
21
|
import { AssistantAction, AIChatType, ServiceType, TemplateType } from './types';
|
|
15
22
|
|
|
@@ -32,14 +39,12 @@ export const AssistantPlugin = () =>
|
|
|
32
39
|
contributes(Capabilities.Metadata, {
|
|
33
40
|
id: TemplateType.typename,
|
|
34
41
|
metadata: {
|
|
35
|
-
placeholder: ['template title placeholder', { ns: ASSISTANT_PLUGIN }],
|
|
36
42
|
icon: 'ph--code-block--regular',
|
|
37
43
|
},
|
|
38
44
|
}),
|
|
39
45
|
contributes(Capabilities.Metadata, {
|
|
40
46
|
id: AIChatType.typename,
|
|
41
47
|
metadata: {
|
|
42
|
-
placeholder: ['chat title placeholder', { ns: ASSISTANT_PLUGIN }],
|
|
43
48
|
icon: 'ph--atom--regular',
|
|
44
49
|
},
|
|
45
50
|
}),
|
|
@@ -60,6 +65,7 @@ export const AssistantPlugin = () =>
|
|
|
60
65
|
SpaceCapabilities.ObjectForm,
|
|
61
66
|
defineObjectForm({
|
|
62
67
|
objectSchema: TemplateType,
|
|
68
|
+
hidden: true,
|
|
63
69
|
getIntent: () => createIntent(AssistantAction.CreateTemplate),
|
|
64
70
|
}),
|
|
65
71
|
),
|
|
@@ -70,23 +76,6 @@ export const AssistantPlugin = () =>
|
|
|
70
76
|
activatesOn: ClientEvents.SetupSchema,
|
|
71
77
|
activate: () => contributes(ClientCapabilities.Schema, [ServiceType, TemplateType]),
|
|
72
78
|
}),
|
|
73
|
-
defineModule({
|
|
74
|
-
id: `${meta.id}/module/complementary-panels`,
|
|
75
|
-
activatesOn: DeckEvents.SetupComplementaryPanels,
|
|
76
|
-
activate: () =>
|
|
77
|
-
contributes(DeckCapabilities.ComplementaryPanel, {
|
|
78
|
-
id: 'service-registry',
|
|
79
|
-
label: ['service registry label', { ns: ASSISTANT_PLUGIN }],
|
|
80
|
-
icon: 'ph--plugs--regular',
|
|
81
|
-
}),
|
|
82
|
-
}),
|
|
83
|
-
defineModule({
|
|
84
|
-
id: `${meta.id}/module/react-surface`,
|
|
85
|
-
activatesOn: Events.SetupReactSurface,
|
|
86
|
-
// TODO(wittjosiah): Should occur before the chat is loaded when surfaces activation is more granular.
|
|
87
|
-
activatesBefore: [Events.SetupArtifactDefinition],
|
|
88
|
-
activate: ReactSurface,
|
|
89
|
-
}),
|
|
90
79
|
defineModule({
|
|
91
80
|
id: `${meta.id}/module/app-graph-builder`,
|
|
92
81
|
activatesOn: Events.SetupAppGraph,
|
|
@@ -97,9 +86,16 @@ export const AssistantPlugin = () =>
|
|
|
97
86
|
activatesOn: Events.SetupIntentResolver,
|
|
98
87
|
activate: IntentResolver,
|
|
99
88
|
}),
|
|
89
|
+
defineModule({
|
|
90
|
+
id: `${meta.id}/module/react-surface`,
|
|
91
|
+
activatesOn: Events.SetupReactSurface,
|
|
92
|
+
// TODO(wittjosiah): Should occur before the chat is loaded when surfaces activation is more granular.
|
|
93
|
+
activatesBefore: [Events.SetupArtifactDefinition],
|
|
94
|
+
activate: ReactSurface,
|
|
95
|
+
}),
|
|
100
96
|
defineModule({
|
|
101
97
|
id: `${meta.id}/module/ai-client`,
|
|
102
|
-
activatesOn: ClientEvents.ClientReady,
|
|
98
|
+
activatesOn: allOf(ClientEvents.ClientReady, Events.SettingsReady),
|
|
103
99
|
activate: AiClient,
|
|
104
100
|
}),
|
|
105
101
|
]);
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
5
|
+
import { effect, signal } from '@preact/signals-core';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
8
|
+
import { type AIServiceClient, AIServiceEdgeClient, OllamaClient } from '@dxos/assistant';
|
|
8
9
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
9
10
|
|
|
10
11
|
import { AssistantCapabilities } from './capabilities';
|
|
12
|
+
import { ASSISTANT_PLUGIN } from '../meta';
|
|
13
|
+
import { type AssistantSettingsProps } from '../types';
|
|
11
14
|
|
|
12
15
|
// TODO(wittjosiah): Factor out.
|
|
13
16
|
const DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';
|
|
@@ -15,8 +18,21 @@ const DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';
|
|
|
15
18
|
export default (context: PluginsContext) => {
|
|
16
19
|
const client = context.requestCapability(ClientCapabilities.Client);
|
|
17
20
|
const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;
|
|
18
|
-
|
|
19
|
-
const ai = new AIServiceEdgeClient({ endpoint });
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
const ai = signal<AIServiceClient>(new AIServiceEdgeClient({ endpoint }));
|
|
23
|
+
|
|
24
|
+
const unsubscribe = effect(() => {
|
|
25
|
+
// TODO(burdon): Could be undefined.
|
|
26
|
+
const settings = context
|
|
27
|
+
.requestCapability(Capabilities.SettingsStore)
|
|
28
|
+
.getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;
|
|
29
|
+
|
|
30
|
+
if (settings?.llmProvider === 'ollama') {
|
|
31
|
+
ai.value = new OllamaClient();
|
|
32
|
+
} else {
|
|
33
|
+
ai.value = new AIServiceEdgeClient({ endpoint });
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return contributes(AssistantCapabilities.AiClient, ai, () => unsubscribe());
|
|
22
38
|
};
|
|
@@ -11,14 +11,23 @@ import {
|
|
|
11
11
|
type PluginsContext,
|
|
12
12
|
} from '@dxos/app-framework';
|
|
13
13
|
import { invariant } from '@dxos/invariant';
|
|
14
|
-
import { log } from '@dxos/log';
|
|
15
14
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
15
|
+
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
16
16
|
import { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';
|
|
17
|
+
import { memoizeQuery } from '@dxos/plugin-space';
|
|
17
18
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
18
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
type Space,
|
|
21
|
+
Filter,
|
|
22
|
+
fullyQualifiedId,
|
|
23
|
+
getSpace,
|
|
24
|
+
isSpace,
|
|
25
|
+
isReactiveObject,
|
|
26
|
+
parseId,
|
|
27
|
+
} from '@dxos/react-client/echo';
|
|
19
28
|
|
|
20
29
|
import { ASSISTANT_DIALOG, ASSISTANT_PLUGIN } from '../meta';
|
|
21
|
-
import { AIChatType, AssistantAction } from '../types';
|
|
30
|
+
import { AIChatType, AssistantAction, TemplateType } from '../types';
|
|
22
31
|
|
|
23
32
|
export default (context: PluginsContext) =>
|
|
24
33
|
contributes(Capabilities.AppGraphBuilder, [
|
|
@@ -51,7 +60,6 @@ export default (context: PluginsContext) =>
|
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
if (!chat) {
|
|
54
|
-
log.warn('no chat found');
|
|
55
63
|
return;
|
|
56
64
|
}
|
|
57
65
|
|
|
@@ -71,7 +79,7 @@ export default (context: PluginsContext) =>
|
|
|
71
79
|
},
|
|
72
80
|
properties: {
|
|
73
81
|
label: ['open assistant label', { ns: ASSISTANT_PLUGIN }],
|
|
74
|
-
icon: 'ph--
|
|
82
|
+
icon: 'ph--star-four--regular',
|
|
75
83
|
disposition: 'pin-end',
|
|
76
84
|
position: 'hoist',
|
|
77
85
|
keyBinding: {
|
|
@@ -82,6 +90,93 @@ export default (context: PluginsContext) =>
|
|
|
82
90
|
},
|
|
83
91
|
],
|
|
84
92
|
}),
|
|
93
|
+
|
|
94
|
+
createExtension({
|
|
95
|
+
id: `${ASSISTANT_PLUGIN}/service-registry`,
|
|
96
|
+
filter: (node): node is Node<null> => node.id === 'root',
|
|
97
|
+
connector: ({ node }) => {
|
|
98
|
+
const layout = context.requestCapability(Capabilities.Layout);
|
|
99
|
+
const client = context.requestCapability(ClientCapabilities.Client);
|
|
100
|
+
const { spaceId } = parseId(layout.workspace);
|
|
101
|
+
const space = spaceId ? client.spaces.get(spaceId) : null;
|
|
102
|
+
|
|
103
|
+
return [
|
|
104
|
+
{
|
|
105
|
+
id: [node.id, 'service-registry'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
106
|
+
type: DECK_COMPANION_TYPE,
|
|
107
|
+
data: space,
|
|
108
|
+
properties: {
|
|
109
|
+
label: ['service registry label', { ns: ASSISTANT_PLUGIN }],
|
|
110
|
+
icon: 'ph--plugs--regular',
|
|
111
|
+
disposition: 'hidden',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
},
|
|
116
|
+
}),
|
|
117
|
+
|
|
118
|
+
createExtension({
|
|
119
|
+
id: `${ASSISTANT_PLUGIN}/object-chat-companion`,
|
|
120
|
+
filter: (node): node is Node<AIChatType> =>
|
|
121
|
+
isReactiveObject(node.data) && node.data.assistantChatQueue && node.data.type !== AIChatType.typename,
|
|
122
|
+
connector: ({ node }) => [
|
|
123
|
+
{
|
|
124
|
+
id: [node.id, 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
125
|
+
type: PLANK_COMPANION_TYPE,
|
|
126
|
+
data: 'assistant-chat',
|
|
127
|
+
properties: {
|
|
128
|
+
label: ['assistant chat label', { ns: ASSISTANT_PLUGIN }],
|
|
129
|
+
icon: 'ph--star-four--regular',
|
|
130
|
+
position: 'hoist',
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
}),
|
|
135
|
+
|
|
136
|
+
createExtension({
|
|
137
|
+
id: `${ASSISTANT_PLUGIN}/root`,
|
|
138
|
+
filter: (node): node is Node<Space> => isSpace(node.data),
|
|
139
|
+
connector: ({ node }) => {
|
|
140
|
+
const templates = memoizeQuery(node.data, Filter.schema(TemplateType));
|
|
141
|
+
return templates.length > 0
|
|
142
|
+
? [
|
|
143
|
+
{
|
|
144
|
+
id: `${ASSISTANT_PLUGIN}/templates`,
|
|
145
|
+
type: `${ASSISTANT_PLUGIN}/templates`,
|
|
146
|
+
data: null,
|
|
147
|
+
properties: {
|
|
148
|
+
label: ['templates label', { ns: ASSISTANT_PLUGIN }],
|
|
149
|
+
icon: 'ph--file-code--regular',
|
|
150
|
+
space: node.data,
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
]
|
|
154
|
+
: [];
|
|
155
|
+
},
|
|
156
|
+
}),
|
|
157
|
+
|
|
158
|
+
createExtension({
|
|
159
|
+
id: `${ASSISTANT_PLUGIN}/templates`,
|
|
160
|
+
filter: (node): node is Node<null, { space: Space }> => node.id === `${ASSISTANT_PLUGIN}/templates`,
|
|
161
|
+
connector: ({ node }) => {
|
|
162
|
+
const templates = memoizeQuery(node.properties.space, Filter.schema(TemplateType));
|
|
163
|
+
return templates
|
|
164
|
+
.toSorted((a, b) => {
|
|
165
|
+
const nameA = a.name ?? '';
|
|
166
|
+
const nameB = b.name ?? '';
|
|
167
|
+
return nameA.localeCompare(nameB);
|
|
168
|
+
})
|
|
169
|
+
.map((template) => ({
|
|
170
|
+
id: fullyQualifiedId(template),
|
|
171
|
+
type: `${ASSISTANT_PLUGIN}/template`,
|
|
172
|
+
data: template,
|
|
173
|
+
properties: {
|
|
174
|
+
label: template.name ?? ['template title placeholder', { ns: ASSISTANT_PLUGIN }],
|
|
175
|
+
icon: 'ph--file-code--regular',
|
|
176
|
+
},
|
|
177
|
+
}));
|
|
178
|
+
},
|
|
179
|
+
}),
|
|
85
180
|
]);
|
|
86
181
|
|
|
87
182
|
// TODO(burdon): Factor out.
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type ReadonlySignal } from '@preact/signals-core';
|
|
6
|
+
|
|
5
7
|
import { defineCapability } from '@dxos/app-framework';
|
|
6
8
|
import { type AIServiceClient } from '@dxos/assistant';
|
|
7
9
|
|
|
8
10
|
import { ASSISTANT_PLUGIN } from '../meta';
|
|
9
11
|
|
|
10
12
|
export namespace AssistantCapabilities {
|
|
11
|
-
export const AiClient = defineCapability<AIServiceClient
|
|
13
|
+
export const AiClient = defineCapability<ReadonlySignal<AIServiceClient>>(`${ASSISTANT_PLUGIN}/capability/ai-client`);
|
|
12
14
|
}
|
|
@@ -17,8 +17,9 @@ export default () => [
|
|
|
17
17
|
resolve: ({ spaceId, name }) => ({
|
|
18
18
|
data: {
|
|
19
19
|
object: create(AIChatType, {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
assistantChatQueue: refFromDXN(
|
|
21
|
+
new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, spaceId, ObjectId.random()]),
|
|
22
|
+
),
|
|
22
23
|
}),
|
|
23
24
|
},
|
|
24
25
|
}),
|
|
@@ -30,7 +31,7 @@ export default () => [
|
|
|
30
31
|
intent: AssistantAction.CreateTemplate,
|
|
31
32
|
resolve: ({ name }) => ({
|
|
32
33
|
data: {
|
|
33
|
-
object: create(TemplateType, { name, source: '{{! Template }}' }),
|
|
34
|
+
object: create(TemplateType, { name, kind: { include: 'manual' }, source: '{{! Template }}' }),
|
|
34
35
|
},
|
|
35
36
|
}),
|
|
36
37
|
}),
|