@dxos/plugin-assistant 0.8.4-main.2e9d522 → 0.8.4-main.5acf9ea

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.
Files changed (109) hide show
  1. package/dist/lib/browser/{TemplateContainer-RPJ2LBOB.mjs → BlueprintContainer-IZ4AK5EO.mjs} +9 -8
  2. package/dist/lib/browser/BlueprintContainer-IZ4AK5EO.mjs.map +7 -0
  3. package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs → ChatContainer-RP3QEXYX.mjs} +3 -3
  4. package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs → ChatDialog-ZVLXFHEY.mjs} +3 -3
  5. package/dist/lib/browser/{app-graph-builder-JTXBKE7O.mjs → app-graph-builder-XSEOKJLG.mjs} +5 -64
  6. package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-OWY4CUQY.mjs → chunk-63GG6U6D.mjs} +18 -37
  8. package/dist/lib/browser/chunk-63GG6U6D.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-JQBVLTM5.mjs → chunk-7W7LHTRH.mjs} +14 -1
  10. package/dist/lib/browser/chunk-7W7LHTRH.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-AEAEKWOC.mjs → chunk-KFXSBNZR.mjs} +10 -19
  12. package/dist/lib/browser/chunk-KFXSBNZR.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-EQDW6BYQ.mjs → chunk-LERGF5YG.mjs} +7 -7
  14. package/dist/lib/browser/{chunk-EQDW6BYQ.mjs.map → chunk-LERGF5YG.mjs.map} +3 -3
  15. package/dist/lib/browser/index.mjs +42 -30
  16. package/dist/lib/browser/index.mjs.map +3 -3
  17. package/dist/lib/browser/{intent-resolver-5RMMCMXG.mjs → intent-resolver-MV3VSZLS.mjs} +19 -4
  18. package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs.map +7 -0
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/{react-surface-66VY37YQ.mjs → react-surface-3GYEHQRP.mjs} +14 -14
  21. package/dist/lib/browser/react-surface-3GYEHQRP.mjs.map +7 -0
  22. package/dist/lib/browser/{settings-2DGP3UTS.mjs → settings-5GTTCVGD.mjs} +2 -2
  23. package/dist/lib/browser/types/index.mjs +1 -1
  24. package/dist/lib/node-esm/{TemplateContainer-A3NAQCZE.mjs → BlueprintContainer-RGTMNLNX.mjs} +9 -8
  25. package/dist/lib/node-esm/BlueprintContainer-RGTMNLNX.mjs.map +7 -0
  26. package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs → ChatContainer-W3W6FWV3.mjs} +3 -3
  27. package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs → ChatDialog-QW4JRKVO.mjs} +3 -3
  28. package/dist/lib/node-esm/{app-graph-builder-OWSOXFTD.mjs → app-graph-builder-PANCJUHV.mjs} +5 -64
  29. package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs.map +7 -0
  30. package/dist/lib/node-esm/{chunk-SENTQAEO.mjs → chunk-BFO3KHYL.mjs} +18 -37
  31. package/dist/lib/node-esm/chunk-BFO3KHYL.mjs.map +7 -0
  32. package/dist/lib/node-esm/{chunk-E33DNNDW.mjs → chunk-MS3PJARN.mjs} +7 -7
  33. package/dist/lib/node-esm/{chunk-E33DNNDW.mjs.map → chunk-MS3PJARN.mjs.map} +3 -3
  34. package/dist/lib/node-esm/{chunk-2XL6MNPE.mjs → chunk-VIIMA3XQ.mjs} +10 -19
  35. package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs.map +7 -0
  36. package/dist/lib/node-esm/{chunk-BISJDTBK.mjs → chunk-Z7PUODRT.mjs} +14 -1
  37. package/dist/lib/node-esm/chunk-Z7PUODRT.mjs.map +7 -0
  38. package/dist/lib/node-esm/index.mjs +42 -30
  39. package/dist/lib/node-esm/index.mjs.map +3 -3
  40. package/dist/lib/node-esm/{intent-resolver-YPPYELY3.mjs → intent-resolver-3FMC3GHC.mjs} +19 -4
  41. package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs.map +7 -0
  42. package/dist/lib/node-esm/meta.json +1 -1
  43. package/dist/lib/node-esm/{react-surface-RJMRBR2M.mjs → react-surface-QDQWJ7FZ.mjs} +14 -14
  44. package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs.map +7 -0
  45. package/dist/lib/node-esm/{settings-47RYZOU4.mjs → settings-J2EXEM5H.mjs} +2 -2
  46. package/dist/lib/node-esm/types/index.mjs +1 -1
  47. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  48. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  49. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  50. package/dist/types/src/capability-definitions.d.ts +7 -0
  51. package/dist/types/src/capability-definitions.d.ts.map +1 -0
  52. package/dist/types/src/components/BlueprintContainer.d.ts +8 -0
  53. package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -0
  54. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +0 -42
  55. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  56. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -1
  57. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  58. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -1
  59. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  60. package/dist/types/src/components/index.d.ts +1 -1
  61. package/dist/types/src/components/index.d.ts.map +1 -1
  62. package/dist/types/src/hooks/useChatServices.d.ts +2 -2
  63. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  64. package/dist/types/src/stories/Chat.stories.d.ts +2 -44
  65. package/dist/types/src/stories/Chat.stories.d.ts.map +1 -1
  66. package/dist/types/src/translations.d.ts +1 -10
  67. package/dist/types/src/translations.d.ts.map +1 -1
  68. package/dist/types/src/types/schema.d.ts +32 -0
  69. package/dist/types/src/types/schema.d.ts.map +1 -1
  70. package/dist/types/tsconfig.tsbuildinfo +1 -1
  71. package/package.json +75 -73
  72. package/src/AssistantPlugin.tsx +32 -6
  73. package/src/capabilities/app-graph-builder.ts +2 -86
  74. package/src/capabilities/intent-resolver.ts +16 -2
  75. package/src/capabilities/react-surface.tsx +7 -7
  76. package/src/capability-definitions.ts +15 -0
  77. package/src/components/BlueprintContainer.tsx +24 -0
  78. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -4
  79. package/src/components/TemplateEditor/TemplateEditor.tsx +12 -10
  80. package/src/components/TemplateEditor/TemplateForm.stories.tsx +4 -4
  81. package/src/components/TemplateEditor/TemplateForm.tsx +3 -2
  82. package/src/components/index.ts +1 -1
  83. package/src/hooks/useChatServices.ts +24 -48
  84. package/src/stories/Chat.stories.tsx +17 -24
  85. package/src/translations.ts +1 -10
  86. package/src/types/schema.ts +13 -0
  87. package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +0 -7
  88. package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
  89. package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +0 -7
  90. package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
  91. package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
  92. package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
  93. package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +0 -7
  94. package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +0 -7
  95. package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
  96. package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +0 -7
  97. package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +0 -7
  98. package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
  99. package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
  100. package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +0 -7
  101. package/dist/types/src/components/TemplateContainer.d.ts +0 -8
  102. package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
  103. package/src/components/TemplateContainer.tsx +0 -24
  104. /package/dist/lib/browser/{ChatContainer-M3IHQLRS.mjs.map → ChatContainer-RP3QEXYX.mjs.map} +0 -0
  105. /package/dist/lib/browser/{ChatDialog-X6VN6QZI.mjs.map → ChatDialog-ZVLXFHEY.mjs.map} +0 -0
  106. /package/dist/lib/browser/{settings-2DGP3UTS.mjs.map → settings-5GTTCVGD.mjs.map} +0 -0
  107. /package/dist/lib/node-esm/{ChatContainer-VZT74PO2.mjs.map → ChatContainer-W3W6FWV3.mjs.map} +0 -0
  108. /package/dist/lib/node-esm/{ChatDialog-RJ6FDX4Q.mjs.map → ChatDialog-QW4JRKVO.mjs.map} +0 -0
  109. /package/dist/lib/node-esm/{settings-47RYZOU4.mjs.map → settings-J2EXEM5H.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-assistant",
3
- "version": "0.8.4-main.2e9d522",
3
+ "version": "0.8.4-main.5acf9ea",
4
4
  "description": "Assistant plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -12,12 +12,14 @@
12
12
  ".": {
13
13
  "types": "./dist/types/src/index.d.ts",
14
14
  "browser": "./dist/lib/browser/index.mjs",
15
- "node": "./dist/lib/node-esm/index.mjs"
15
+ "node": "./dist/lib/node-esm/index.mjs",
16
+ "source": "./src/index.ts"
16
17
  },
17
18
  "./types": {
18
19
  "types": "./dist/types/src/types/index.d.ts",
19
20
  "browser": "./dist/lib/browser/types/index.mjs",
20
- "node": "./dist/lib/node-esm/types/index.mjs"
21
+ "node": "./dist/lib/node-esm/types/index.mjs",
22
+ "source": "./src/types/index.ts"
21
23
  }
22
24
  },
23
25
  "types": "dist/types/src/index.d.ts",
@@ -53,62 +55,62 @@
53
55
  "lodash.defaultsdeep": "^4.6.1",
54
56
  "unified": "^11.0.0",
55
57
  "use-deep-compare-effect": "^1.8.1",
56
- "@dxos/ai": "0.8.4-main.2e9d522",
57
- "@dxos/app-framework": "0.8.4-main.2e9d522",
58
- "@dxos/assistant": "0.8.4-main.2e9d522",
59
- "@dxos/async": "0.8.4-main.2e9d522",
60
- "@dxos/blueprints": "0.8.4-main.2e9d522",
61
- "@dxos/client": "0.8.4-main.2e9d522",
62
- "@dxos/compute": "0.8.4-main.2e9d522",
63
- "@dxos/conductor": "0.8.4-main.2e9d522",
64
- "@dxos/config": "0.8.4-main.2e9d522",
65
- "@dxos/debug": "0.8.4-main.2e9d522",
66
- "@dxos/context": "0.8.4-main.2e9d522",
67
- "@dxos/devtools": "0.8.4-main.2e9d522",
68
- "@dxos/echo": "0.8.4-main.2e9d522",
69
- "@dxos/echo-protocol": "0.8.4-main.2e9d522",
70
- "@dxos/echo-db": "0.8.4-main.2e9d522",
71
- "@dxos/echo-schema": "0.8.4-main.2e9d522",
72
- "@dxos/edge-client": "0.8.4-main.2e9d522",
73
- "@dxos/effect": "0.8.4-main.2e9d522",
74
- "@dxos/functions": "0.8.4-main.2e9d522",
75
- "@dxos/graph": "0.8.4-main.2e9d522",
76
- "@dxos/live-object": "0.8.4-main.2e9d522",
77
- "@dxos/keys": "0.8.4-main.2e9d522",
78
- "@dxos/local-storage": "0.8.4-main.2e9d522",
79
- "@dxos/invariant": "0.8.4-main.2e9d522",
80
- "@dxos/log": "0.8.4-main.2e9d522",
81
- "@dxos/plugin-client": "0.8.4-main.2e9d522",
82
- "@dxos/plugin-deck": "0.8.4-main.2e9d522",
83
- "@dxos/plugin-explorer": "0.8.4-main.2e9d522",
84
- "@dxos/plugin-graph": "0.8.4-main.2e9d522",
85
- "@dxos/plugin-inbox": "0.8.4-main.2e9d522",
86
- "@dxos/plugin-markdown": "0.8.4-main.2e9d522",
87
- "@dxos/plugin-script": "0.8.4-main.2e9d522",
88
- "@dxos/plugin-preview": "0.8.4-main.2e9d522",
89
- "@dxos/plugin-sketch": "0.8.4-main.2e9d522",
90
- "@dxos/plugin-space": "0.8.4-main.2e9d522",
91
- "@dxos/plugin-stack": "0.8.4-main.2e9d522",
92
- "@dxos/plugin-transcription": "0.8.4-main.2e9d522",
93
- "@dxos/plugin-wnfs": "0.8.4-main.2e9d522",
94
- "@dxos/react-client": "0.8.4-main.2e9d522",
95
- "@dxos/react-edge-client": "0.8.4-main.2e9d522",
96
- "@dxos/react-ui-attention": "0.8.4-main.2e9d522",
97
- "@dxos/protocols": "0.8.4-main.2e9d522",
98
- "@dxos/react-ui-canvas-compute": "0.8.4-main.2e9d522",
99
- "@dxos/react-ui-canvas-editor": "0.8.4-main.2e9d522",
100
- "@dxos/react-ui-chat": "0.8.4-main.2e9d522",
101
- "@dxos/react-ui-components": "0.8.4-main.2e9d522",
102
- "@dxos/react-ui-form": "0.8.4-main.2e9d522",
103
- "@dxos/react-ui-editor": "0.8.4-main.2e9d522",
104
- "@dxos/react-ui-graph": "0.8.4-main.2e9d522",
105
- "@dxos/react-ui-list": "0.8.4-main.2e9d522",
106
- "@dxos/react-ui-syntax-highlighter": "0.8.4-main.2e9d522",
107
- "@dxos/react-ui-sfx": "0.8.4-main.2e9d522",
108
- "@dxos/react-ui-stack": "0.8.4-main.2e9d522",
109
- "@dxos/react-ui-tag-picker": "0.8.4-main.2e9d522",
110
- "@dxos/schema": "0.8.4-main.2e9d522",
111
- "@dxos/util": "0.8.4-main.2e9d522"
58
+ "@dxos/ai": "0.8.4-main.5acf9ea",
59
+ "@dxos/app-framework": "0.8.4-main.5acf9ea",
60
+ "@dxos/assistant": "0.8.4-main.5acf9ea",
61
+ "@dxos/async": "0.8.4-main.5acf9ea",
62
+ "@dxos/blueprints": "0.8.4-main.5acf9ea",
63
+ "@dxos/compute": "0.8.4-main.5acf9ea",
64
+ "@dxos/client": "0.8.4-main.5acf9ea",
65
+ "@dxos/config": "0.8.4-main.5acf9ea",
66
+ "@dxos/conductor": "0.8.4-main.5acf9ea",
67
+ "@dxos/context": "0.8.4-main.5acf9ea",
68
+ "@dxos/debug": "0.8.4-main.5acf9ea",
69
+ "@dxos/echo": "0.8.4-main.5acf9ea",
70
+ "@dxos/devtools": "0.8.4-main.5acf9ea",
71
+ "@dxos/echo-protocol": "0.8.4-main.5acf9ea",
72
+ "@dxos/echo-schema": "0.8.4-main.5acf9ea",
73
+ "@dxos/echo-db": "0.8.4-main.5acf9ea",
74
+ "@dxos/edge-client": "0.8.4-main.5acf9ea",
75
+ "@dxos/effect": "0.8.4-main.5acf9ea",
76
+ "@dxos/functions": "0.8.4-main.5acf9ea",
77
+ "@dxos/invariant": "0.8.4-main.5acf9ea",
78
+ "@dxos/graph": "0.8.4-main.5acf9ea",
79
+ "@dxos/keys": "0.8.4-main.5acf9ea",
80
+ "@dxos/local-storage": "0.8.4-main.5acf9ea",
81
+ "@dxos/log": "0.8.4-main.5acf9ea",
82
+ "@dxos/live-object": "0.8.4-main.5acf9ea",
83
+ "@dxos/plugin-client": "0.8.4-main.5acf9ea",
84
+ "@dxos/plugin-deck": "0.8.4-main.5acf9ea",
85
+ "@dxos/plugin-explorer": "0.8.4-main.5acf9ea",
86
+ "@dxos/plugin-graph": "0.8.4-main.5acf9ea",
87
+ "@dxos/plugin-markdown": "0.8.4-main.5acf9ea",
88
+ "@dxos/plugin-inbox": "0.8.4-main.5acf9ea",
89
+ "@dxos/plugin-preview": "0.8.4-main.5acf9ea",
90
+ "@dxos/plugin-script": "0.8.4-main.5acf9ea",
91
+ "@dxos/plugin-sketch": "0.8.4-main.5acf9ea",
92
+ "@dxos/plugin-space": "0.8.4-main.5acf9ea",
93
+ "@dxos/plugin-stack": "0.8.4-main.5acf9ea",
94
+ "@dxos/plugin-wnfs": "0.8.4-main.5acf9ea",
95
+ "@dxos/plugin-transcription": "0.8.4-main.5acf9ea",
96
+ "@dxos/protocols": "0.8.4-main.5acf9ea",
97
+ "@dxos/react-client": "0.8.4-main.5acf9ea",
98
+ "@dxos/react-edge-client": "0.8.4-main.5acf9ea",
99
+ "@dxos/react-ui-attention": "0.8.4-main.5acf9ea",
100
+ "@dxos/react-ui-canvas-editor": "0.8.4-main.5acf9ea",
101
+ "@dxos/react-ui-canvas-compute": "0.8.4-main.5acf9ea",
102
+ "@dxos/react-ui-chat": "0.8.4-main.5acf9ea",
103
+ "@dxos/react-ui-components": "0.8.4-main.5acf9ea",
104
+ "@dxos/react-ui-editor": "0.8.4-main.5acf9ea",
105
+ "@dxos/react-ui-form": "0.8.4-main.5acf9ea",
106
+ "@dxos/react-ui-list": "0.8.4-main.5acf9ea",
107
+ "@dxos/react-ui-graph": "0.8.4-main.5acf9ea",
108
+ "@dxos/react-ui-sfx": "0.8.4-main.5acf9ea",
109
+ "@dxos/react-ui-stack": "0.8.4-main.5acf9ea",
110
+ "@dxos/react-ui-tag-picker": "0.8.4-main.5acf9ea",
111
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-main.5acf9ea",
112
+ "@dxos/schema": "0.8.4-main.5acf9ea",
113
+ "@dxos/util": "0.8.4-main.5acf9ea"
112
114
  },
113
115
  "devDependencies": {
114
116
  "@effect-rx/rx-react": "^0.38.0",
@@ -121,18 +123,18 @@
121
123
  "react": "~18.2.0",
122
124
  "react-dom": "~18.2.0",
123
125
  "vite": "5.4.7",
124
- "@dxos/assistant-testing": "0.8.4-main.2e9d522",
125
- "@dxos/echo-db": "0.8.4-main.2e9d522",
126
- "@dxos/plugin-chess": "0.8.4-main.2e9d522",
127
- "@dxos/plugin-inbox": "0.8.4-main.2e9d522",
128
- "@dxos/plugin-markdown": "0.8.4-main.2e9d522",
129
- "@dxos/plugin-map": "0.8.4-main.2e9d522",
130
- "@dxos/plugin-table": "0.8.4-main.2e9d522",
131
- "@dxos/react-ui": "0.8.4-main.2e9d522",
132
- "@dxos/random": "0.8.4-main.2e9d522",
133
- "@dxos/react-ui-menu": "0.8.4-main.2e9d522",
134
- "@dxos/storybook-utils": "0.8.4-main.2e9d522",
135
- "@dxos/react-ui-theme": "0.8.4-main.2e9d522"
126
+ "@dxos/assistant-testing": "0.8.4-main.5acf9ea",
127
+ "@dxos/echo-db": "0.8.4-main.5acf9ea",
128
+ "@dxos/plugin-chess": "0.8.4-main.5acf9ea",
129
+ "@dxos/plugin-inbox": "0.8.4-main.5acf9ea",
130
+ "@dxos/plugin-map": "0.8.4-main.5acf9ea",
131
+ "@dxos/plugin-table": "0.8.4-main.5acf9ea",
132
+ "@dxos/random": "0.8.4-main.5acf9ea",
133
+ "@dxos/plugin-markdown": "0.8.4-main.5acf9ea",
134
+ "@dxos/react-ui": "0.8.4-main.5acf9ea",
135
+ "@dxos/react-ui-menu": "0.8.4-main.5acf9ea",
136
+ "@dxos/react-ui-theme": "0.8.4-main.5acf9ea",
137
+ "@dxos/storybook-utils": "0.8.4-main.5acf9ea"
136
138
  },
137
139
  "peerDependencies": {
138
140
  "@effect-rx/rx-react": "^0.34.1",
@@ -140,8 +142,8 @@
140
142
  "effect": "^3.13.3",
141
143
  "react": "~18.2.0",
142
144
  "react-dom": "~18.2.0",
143
- "@dxos/react-ui": "0.8.4-main.2e9d522",
144
- "@dxos/react-ui-theme": "0.8.4-main.2e9d522"
145
+ "@dxos/react-ui": "0.8.4-main.5acf9ea",
146
+ "@dxos/react-ui-theme": "0.8.4-main.5acf9ea"
145
147
  },
146
148
  "publishConfig": {
147
149
  "access": "public"
@@ -2,8 +2,11 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ import { Layer } from 'effect';
6
+
7
+ import { AiServiceTestingPreset } from '@dxos/ai/testing';
5
8
  import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
6
- import { Template } from '@dxos/blueprints';
9
+ import { Blueprint } from '@dxos/blueprints';
7
10
  import { Sequence } from '@dxos/conductor';
8
11
  import { Type } from '@dxos/echo';
9
12
  import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
@@ -11,6 +14,7 @@ import { SpaceCapabilities, SpaceEvents } from '@dxos/plugin-space';
11
14
  import { defineObjectForm } from '@dxos/plugin-space/types';
12
15
 
13
16
  import { AppGraphBuilder, IntentResolver, ReactSurface, Settings } from './capabilities';
17
+ import { AssistantCapabilities } from './capability-definitions';
14
18
  import { meta } from './meta';
15
19
  import { translations } from './translations';
16
20
  import { Assistant, ServiceType } from './types';
@@ -32,15 +36,21 @@ export const AssistantPlugin = () =>
32
36
  activatesOn: Events.SetupMetadata,
33
37
  activate: () => [
34
38
  contributes(Capabilities.Metadata, {
35
- id: Type.getTypename(Sequence),
39
+ id: Type.getTypename(Assistant.Chat),
36
40
  metadata: {
37
- icon: 'ph--circuitry--regular',
41
+ icon: 'ph--atom--regular',
38
42
  },
39
43
  }),
40
44
  contributes(Capabilities.Metadata, {
41
- id: Type.getTypename(Assistant.Chat),
45
+ id: Type.getTypename(Blueprint.Blueprint),
42
46
  metadata: {
43
- icon: 'ph--atom--regular',
47
+ icon: 'ph--blueprint--regular',
48
+ },
49
+ }),
50
+ contributes(Capabilities.Metadata, {
51
+ id: Type.getTypename(Sequence),
52
+ metadata: {
53
+ icon: 'ph--circuitry--regular',
44
54
  },
45
55
  }),
46
56
  ],
@@ -56,6 +66,14 @@ export const AssistantPlugin = () =>
56
66
  getIntent: (_, options) => createIntent(Assistant.CreateChat, { space: options.space }),
57
67
  }),
58
68
  ),
69
+ contributes(
70
+ SpaceCapabilities.ObjectForm,
71
+ defineObjectForm({
72
+ objectSchema: Blueprint.Blueprint,
73
+ formSchema: Assistant.BlueprintForm,
74
+ getIntent: (props) => createIntent(Assistant.CreateBlueprint, props),
75
+ }),
76
+ ),
59
77
  contributes(
60
78
  SpaceCapabilities.ObjectForm,
61
79
  defineObjectForm({
@@ -68,7 +86,7 @@ export const AssistantPlugin = () =>
68
86
  defineModule({
69
87
  id: `${meta.id}/module/schema`,
70
88
  activatesOn: ClientEvents.SetupSchema,
71
- activate: () => contributes(ClientCapabilities.Schema, [ServiceType, Template.Template, Assistant.CompanionTo]),
89
+ activate: () => contributes(ClientCapabilities.Schema, [ServiceType, Assistant.CompanionTo]),
72
90
  }),
73
91
  defineModule({
74
92
  id: `${meta.id}/module/on-space-created`,
@@ -95,4 +113,12 @@ export const AssistantPlugin = () =>
95
113
  activatesBefore: [Events.SetupArtifactDefinition],
96
114
  activate: ReactSurface,
97
115
  }),
116
+ defineModule({
117
+ id: `${meta.id}/module/ai-service`,
118
+ activatesOn: Events.Startup,
119
+ activate: () => [
120
+ // TODO(dmaretskyi): Read config from settings.
121
+ contributes(AssistantCapabilities.AiServiceLayer, AiServiceTestingPreset('edge-remote').pipe(Layer.orDie)),
122
+ ],
123
+ }),
98
124
  ]);
@@ -13,7 +13,6 @@ import {
13
13
  type PromiseIntentDispatcher,
14
14
  type PluginContext,
15
15
  } from '@dxos/app-framework';
16
- import { Template } from '@dxos/blueprints';
17
16
  import { Sequence } from '@dxos/conductor';
18
17
  import { Obj } from '@dxos/echo';
19
18
  import { invariant } from '@dxos/invariant';
@@ -21,16 +20,8 @@ import { ClientCapabilities } from '@dxos/plugin-client';
21
20
  import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
22
21
  import { createExtension, ROOT_ID } from '@dxos/plugin-graph';
23
22
  import { getActiveSpace, rxFromQuery } from '@dxos/plugin-space';
24
- import { SPACE_TYPE, SpaceAction } from '@dxos/plugin-space/types';
25
- import {
26
- type Space,
27
- Filter,
28
- Query,
29
- type QueryResult,
30
- fullyQualifiedId,
31
- getSpace,
32
- isSpace,
33
- } from '@dxos/react-client/echo';
23
+ import { SpaceAction } from '@dxos/plugin-space/types';
24
+ import { type Space, Filter, Query, type QueryResult, fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
34
25
 
35
26
  import { ASSISTANT_DIALOG, meta } from '../meta';
36
27
  import { Assistant } from '../types';
@@ -152,81 +143,6 @@ export default (context: PluginContext) =>
152
143
  ),
153
144
  ),
154
145
  }),
155
-
156
- createExtension({
157
- id: `${meta.id}/root`,
158
- connector: (node) => {
159
- let query: QueryResult<Template.Template> | undefined;
160
- return Rx.make((get) =>
161
- pipe(
162
- get(node),
163
- Option.flatMap((node) =>
164
- node.type === SPACE_TYPE && isSpace(node.data) ? Option.some(node.data) : Option.none(),
165
- ),
166
- Option.map((space) => {
167
- if (!query) {
168
- query = space.db.query(Query.type(Template.Template));
169
- }
170
-
171
- const templates = get(rxFromQuery(query));
172
- return templates.length > 0
173
- ? [
174
- {
175
- id: `${meta.id}/templates`,
176
- type: `${meta.id}/templates`,
177
- data: null,
178
- properties: {
179
- label: ['templates label', { ns: meta.id }],
180
- icon: 'ph--file-code--regular',
181
- space,
182
- },
183
- },
184
- ]
185
- : [];
186
- }),
187
- Option.getOrElse(() => []),
188
- ),
189
- );
190
- },
191
- }),
192
-
193
- createExtension({
194
- id: `${meta.id}/templates`,
195
- connector: (node) => {
196
- let query: QueryResult<Template.Template> | undefined;
197
- return Rx.make((get) =>
198
- pipe(
199
- get(node),
200
- Option.flatMap((node) =>
201
- node.id === `${meta.id}/templates` && isSpace(node.properties.space)
202
- ? Option.some(node.properties.space)
203
- : Option.none(),
204
- ),
205
- Option.map((space) => {
206
- if (!query) {
207
- query = space.db.query(Query.type(Template.Template));
208
- }
209
- return get(rxFromQuery(query))
210
- .toSorted((a, b) => {
211
- const nameA = a.name ?? '';
212
- const nameB = b.name ?? '';
213
- return nameA.localeCompare(nameB);
214
- })
215
- .map((template) => ({
216
- id: fullyQualifiedId(template),
217
- type: `${meta.id}/template`,
218
- data: template,
219
- properties: {
220
- label: template.name ?? ['object placeholder', { ns: meta.id }],
221
- icon: 'ph--file-code--regular',
222
- },
223
- }));
224
- }),
225
- Option.getOrElse(() => []),
226
- ),
227
- );
228
- },
229
- }),
230
146
  ]);
231
147
 
232
148
  // TODO(burdon): Factor out.
@@ -5,6 +5,7 @@
5
5
  import { Effect } from 'effect';
6
6
 
7
7
  import { Capabilities, contributes, createIntent, createResolver, type PluginContext } from '@dxos/app-framework';
8
+ import { Blueprint } from '@dxos/blueprints';
8
9
  import { Sequence } from '@dxos/conductor';
9
10
  import { Key, Obj, Ref } from '@dxos/echo';
10
11
  import { CollectionAction } from '@dxos/plugin-space/types';
@@ -18,13 +19,20 @@ export default (context: PluginContext) => [
18
19
  resolve: ({ space, rootCollection }) =>
19
20
  Effect.gen(function* () {
20
21
  const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
21
- const { object: collection } = yield* dispatch(
22
+ const { object: chatCollection } = yield* dispatch(
22
23
  createIntent(CollectionAction.CreateQueryCollection, { typename: Assistant.Chat.typename }),
23
24
  );
24
- rootCollection.objects.push(Ref.make(collection));
25
+ const { object: blueprintCollection } = yield* dispatch(
26
+ createIntent(CollectionAction.CreateQueryCollection, { typename: Blueprint.Blueprint.typename }),
27
+ );
28
+ rootCollection.objects.push(Ref.make(chatCollection), Ref.make(blueprintCollection));
25
29
 
26
30
  const { object: chat } = yield* dispatch(createIntent(Assistant.CreateChat, { space }));
27
31
  space.db.add(chat);
32
+
33
+ // TODO(wittjosiah): Create default blueprint.
34
+ // const { object: blueprint } = yield* dispatch(createIntent(Assistant.CreateBlueprint, { ... }));
35
+ // space.db.add(blueprint);
28
36
  }),
29
37
  }),
30
38
  createResolver({
@@ -38,6 +46,12 @@ export default (context: PluginContext) => [
38
46
  },
39
47
  }),
40
48
  }),
49
+ createResolver({
50
+ intent: Assistant.CreateBlueprint,
51
+ resolve: ({ name, description }) => ({
52
+ data: { object: Blueprint.make({ name, description }) },
53
+ }),
54
+ }),
41
55
  createResolver({
42
56
  intent: Assistant.CreateSequence,
43
57
  resolve: ({ name }) => ({
@@ -6,7 +6,7 @@ import { Effect } from 'effect';
6
6
  import React, { useEffect, useMemo } from 'react';
7
7
 
8
8
  import { Capabilities, contributes, createIntent, createSurface, useIntentDispatcher } from '@dxos/app-framework';
9
- import { Template } from '@dxos/blueprints';
9
+ import { Blueprint } from '@dxos/blueprints';
10
10
  import { fullyQualifiedId, getSpace, getTypename } from '@dxos/client/echo';
11
11
  import { Sequence } from '@dxos/conductor';
12
12
  import { InvocationTraceContainer } from '@dxos/devtools';
@@ -17,11 +17,11 @@ import { StackItem } from '@dxos/react-ui-stack';
17
17
 
18
18
  import {
19
19
  AssistantSettings,
20
+ BlueprintContainer,
20
21
  ChatContainer,
21
22
  ChatDialog,
22
23
  PromptSettings,
23
24
  SequenceContainer,
24
- TemplateContainer,
25
25
  } from '../components';
26
26
  import { meta, ASSISTANT_DIALOG } from '../meta';
27
27
  import { Assistant } from '../types';
@@ -118,16 +118,16 @@ export default () =>
118
118
  },
119
119
  }),
120
120
  createSurface({
121
- id: `${meta.id}/template`,
121
+ id: `${meta.id}/blueprint`,
122
122
  role: 'article',
123
- filter: (data): data is { subject: Template.Template } => Obj.instanceOf(Template.Template, data.subject),
124
- component: ({ data }) => <TemplateContainer template={data.subject} />,
123
+ filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
124
+ component: ({ data }) => <BlueprintContainer blueprint={data.subject} />,
125
125
  }),
126
126
  createSurface({
127
127
  id: `${meta.id}/prompt-settings`,
128
128
  role: 'object-settings',
129
- filter: (data): data is { subject: Template.Template } => Obj.instanceOf(Template.Template, data.subject),
130
- component: ({ data }) => <PromptSettings template={data.subject} />,
129
+ filter: (data): data is { subject: Blueprint.Blueprint } => Obj.instanceOf(Blueprint.Blueprint, data.subject),
130
+ component: ({ data }) => <PromptSettings template={data.subject.instructions} />,
131
131
  }),
132
132
  createSurface({
133
133
  id: ASSISTANT_DIALOG,
@@ -0,0 +1,15 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Layer } from 'effect';
6
+
7
+ import { type AiService } from '@dxos/ai';
8
+ import { defineCapability } from '@dxos/app-framework';
9
+
10
+ import { ASSISTANT_PLUGIN } from './meta';
11
+
12
+ export namespace AssistantCapabilities {
13
+ export type AiServiceLayer = Layer.Layer<AiService>;
14
+ export const AiServiceLayer = defineCapability<AiServiceLayer>(`${ASSISTANT_PLUGIN}/capability/ai-service-factory`);
15
+ }
@@ -0,0 +1,24 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type Blueprint } from '@dxos/blueprints';
8
+ import { StackItem } from '@dxos/react-ui-stack';
9
+
10
+ import { TemplateEditor } from './TemplateEditor';
11
+
12
+ export type BlueprintContainerProps = {
13
+ blueprint: Blueprint.Blueprint;
14
+ };
15
+
16
+ export const BlueprintContainer = ({ blueprint }: BlueprintContainerProps) => {
17
+ return (
18
+ <StackItem.Content classNames='container-max-width'>
19
+ <TemplateEditor id={blueprint.id} template={blueprint.instructions} />
20
+ </StackItem.Content>
21
+ );
22
+ };
23
+
24
+ export default BlueprintContainer;
@@ -8,7 +8,7 @@ import { type Meta } from '@storybook/react-vite';
8
8
  import React, { useState } from 'react';
9
9
 
10
10
  import { createSystemPrompt } from '@dxos/assistant';
11
- import { Template } from '@dxos/blueprints';
11
+ import { Blueprint, Template } from '@dxos/blueprints';
12
12
  import { useClient } from '@dxos/react-client';
13
13
  import { withClientProvider } from '@dxos/react-client/testing';
14
14
  import { ColumnContainer, withLayout, withTheme } from '@dxos/storybook-utils';
@@ -35,12 +35,12 @@ const TEMPLATE = trim`
35
35
 
36
36
  const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
37
37
  const client = useClient();
38
- const [template] = useState(() => {
38
+ const [blueprint] = useState(() => {
39
39
  const space = client.spaces.default;
40
- return space.db.add(Template.make({ source }));
40
+ return space.db.add(Blueprint.make({ name: 'Test', instructions: { source } }));
41
41
  });
42
42
 
43
- return <TemplateEditor template={template} />;
43
+ return <TemplateEditor id={blueprint.id} template={blueprint.instructions} />;
44
44
  };
45
45
 
46
46
  const meta: Meta<typeof DefaultStory> = {
@@ -8,7 +8,6 @@ import { handlebarsLanguage } from '@xiechao/codemirror-lang-handlebars';
8
8
  import React from 'react';
9
9
 
10
10
  import { type Template } from '@dxos/blueprints';
11
- import { invariant } from '@dxos/invariant';
12
11
  import { createDocAccessor } from '@dxos/react-client/echo';
13
12
  import { useThemeContext, useTranslation, type ThemedClassName } from '@dxos/react-ui';
14
13
  import {
@@ -18,6 +17,7 @@ import {
18
17
  useTextEditor,
19
18
  } from '@dxos/react-ui-editor';
20
19
  import { mx } from '@dxos/react-ui-theme';
20
+ import { isNotFalsy } from '@dxos/util';
21
21
 
22
22
  import { meta } from '../../meta';
23
23
 
@@ -30,21 +30,23 @@ handlebarsLanguage.configure({
30
30
  });
31
31
 
32
32
  export type TemplateEditorProps = ThemedClassName<{
33
+ id: string;
33
34
  template: Template.Template;
34
35
  }>;
35
36
 
36
- export const TemplateEditor = ({ classNames, template }: TemplateEditorProps) => {
37
+ export const TemplateEditor = ({ id, classNames, template }: TemplateEditorProps) => {
37
38
  const { t } = useTranslation(meta.id);
38
39
  const { themeMode } = useThemeContext();
39
40
  const { parentRef } = useTextEditor(() => {
40
- invariant(template.source.target);
41
+ const text = template.source?.target;
41
42
  return {
42
- initialValue: template.source.target.content,
43
+ initialValue: text?.content ?? '',
43
44
  extensions: [
44
- createDataExtensions({
45
- id: template.id,
46
- text: createDocAccessor(template.source.target, ['content']),
47
- }),
45
+ text &&
46
+ createDataExtensions({
47
+ id,
48
+ text: createDocAccessor(text, ['content']),
49
+ }),
48
50
  createBasicExtensions({
49
51
  bracketMatching: false,
50
52
  lineNumbers: true,
@@ -58,9 +60,9 @@ export const TemplateEditor = ({ classNames, template }: TemplateEditorProps) =>
58
60
 
59
61
  // https://github.com/xiechao/lang-handlebars
60
62
  new LanguageSupport(handlebarsLanguage, syntaxHighlighting(handlebarsHighlightStyle)),
61
- ],
63
+ ].filter(isNotFalsy),
62
64
  };
63
- }, [themeMode, template]);
65
+ }, [themeMode, template.source?.target]);
64
66
 
65
67
  return <div ref={parentRef} className={mx('h-full', classNames)} />;
66
68
  };
@@ -7,7 +7,7 @@ import '@dxos-theme';
7
7
  import { type Meta } from '@storybook/react-vite';
8
8
  import React, { useState } from 'react';
9
9
 
10
- import { Template } from '@dxos/blueprints';
10
+ import { Blueprint, Template } from '@dxos/blueprints';
11
11
  import { useClient } from '@dxos/react-client';
12
12
  import { withClientProvider } from '@dxos/react-client/testing';
13
13
  import { withLayout, withTheme } from '@dxos/storybook-utils';
@@ -28,14 +28,14 @@ const TEMPLATE = trim`
28
28
 
29
29
  const DefaultStory = () => {
30
30
  const client = useClient();
31
- const [template] = useState(() => {
31
+ const [blueprint] = useState(() => {
32
32
  const space = client.spaces.default;
33
- return space.db.add(Template.make({ source: TEMPLATE }));
33
+ return space.db.add(Blueprint.make({ name: 'Test', instructions: { source: TEMPLATE } }));
34
34
  });
35
35
 
36
36
  return (
37
37
  <div role='none' className='flex w-[40rem] border border-separator overflow-hidden'>
38
- <TemplateForm template={template} />
38
+ <TemplateForm id={blueprint.id} template={blueprint.instructions} />
39
39
  </div>
40
40
  );
41
41
  };
@@ -14,12 +14,13 @@ import { TemplateEditor } from './TemplateEditor';
14
14
  import { meta } from '../../meta';
15
15
 
16
16
  export type TemplateFormProps = {
17
+ id: string;
17
18
  template: Template.Template;
18
19
  schema?: Schema.Schema<any, any, any>;
19
20
  commandEditable?: boolean;
20
21
  };
21
22
 
22
- export const TemplateForm = ({ template, commandEditable = true }: TemplateFormProps) => {
23
+ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateFormProps) => {
23
24
  const { t } = useTranslation(meta.id);
24
25
  usePromptInputs(template);
25
26
 
@@ -41,7 +42,7 @@ export const TemplateForm = ({ template, commandEditable = true }: TemplateFormP
41
42
  </div>
42
43
  )} */}
43
44
 
44
- <TemplateEditor template={template} classNames={[attentionSurface, 'min-h-[120px]']} />
45
+ <TemplateEditor id={id} template={template} classNames={[attentionSurface, 'min-h-[120px]']} />
45
46
 
46
47
  {(template.inputs?.length ?? 0) > 0 && (
47
48
  <div className='grid grid-cols-[10rem_10rem_1fr] gap-1 items-center'>
@@ -14,7 +14,7 @@ export * from './Toolbox';
14
14
  // Repro: open assistant dialog then close.
15
15
  // https://github.com/microsoft/fluentui/issues/34020
16
16
 
17
+ export const BlueprintContainer = lazy(() => import('./BlueprintContainer'));
17
18
  export const ChatContainer = lazy(() => import('./ChatContainer'));
18
19
  export const ChatDialog = lazy(() => import('./ChatDialog'));
19
20
  export const SequenceContainer = lazy(() => import('./SequenceContainer'));
20
- export const TemplateContainer = lazy(() => import('./TemplateContainer'));