@dxos/assistant-toolkit 0.8.4-main.ae835ea → 0.8.4-main.c351d160a8

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 (460) hide show
  1. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  3. package/dist/lib/{browser → neutral}/index.mjs +3704 -1956
  4. package/dist/lib/neutral/index.mjs.map +7 -0
  5. package/dist/lib/neutral/meta.json +1 -0
  6. package/dist/lib/neutral/testing/index.mjs +81 -0
  7. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  8. package/dist/types/src/blueprints/automation/blueprint.d.ts +4 -0
  9. package/dist/types/src/blueprints/automation/blueprint.d.ts.map +1 -0
  10. package/dist/types/src/blueprints/automation/index.d.ts +2 -0
  11. package/dist/types/src/blueprints/automation/index.d.ts.map +1 -0
  12. package/dist/types/src/blueprints/browser/blueprint.d.ts +4 -0
  13. package/dist/types/src/blueprints/browser/blueprint.d.ts.map +1 -0
  14. package/dist/types/src/blueprints/browser/blueprint.test.d.ts +2 -0
  15. package/dist/types/src/blueprints/browser/blueprint.test.d.ts.map +1 -0
  16. package/dist/types/src/blueprints/browser/index.d.ts +2 -0
  17. package/dist/types/src/blueprints/browser/index.d.ts.map +1 -0
  18. package/dist/types/src/blueprints/database/blueprint.d.ts +4 -0
  19. package/dist/types/src/blueprints/database/blueprint.d.ts.map +1 -0
  20. package/dist/types/src/blueprints/database/blueprint.test.d.ts +2 -0
  21. package/dist/types/src/blueprints/database/blueprint.test.d.ts.map +1 -0
  22. package/dist/types/src/blueprints/database/functions/context-add.d.ts +6 -0
  23. package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -0
  24. package/dist/types/src/blueprints/database/functions/context-remove.d.ts +6 -0
  25. package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -0
  26. package/dist/types/src/blueprints/database/functions/index.d.ts +57 -0
  27. package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -0
  28. package/dist/types/src/blueprints/database/functions/load.d.ts +6 -0
  29. package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -0
  30. package/dist/types/src/blueprints/database/functions/object-create.d.ts +6 -0
  31. package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +1 -0
  32. package/dist/types/src/blueprints/database/functions/object-delete.d.ts +6 -0
  33. package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +1 -0
  34. package/dist/types/src/blueprints/database/functions/object-update.d.ts +9 -0
  35. package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -0
  36. package/dist/types/src/blueprints/database/functions/query.d.ts +9 -0
  37. package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -0
  38. package/dist/types/src/blueprints/database/functions/relation-create.d.ts +9 -0
  39. package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -0
  40. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +6 -0
  41. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +1 -0
  42. package/dist/types/src/blueprints/database/functions/schema-add.d.ts +7 -0
  43. package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +1 -0
  44. package/dist/types/src/blueprints/database/functions/schema-list.d.ts +5 -0
  45. package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -0
  46. package/dist/types/src/blueprints/database/functions/tag-add.d.ts +7 -0
  47. package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -0
  48. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +7 -0
  49. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -0
  50. package/dist/types/src/blueprints/database/index.d.ts +3 -0
  51. package/dist/types/src/blueprints/database/index.d.ts.map +1 -0
  52. package/dist/types/src/blueprints/design/blueprint.d.ts +4 -0
  53. package/dist/types/src/blueprints/design/blueprint.d.ts.map +1 -0
  54. package/dist/types/src/blueprints/design/blueprint.test.d.ts +2 -0
  55. package/dist/types/src/blueprints/design/blueprint.test.d.ts.map +1 -0
  56. package/dist/types/src/blueprints/design/index.d.ts +1 -2
  57. package/dist/types/src/blueprints/design/index.d.ts.map +1 -1
  58. package/dist/types/src/blueprints/discord/blueprint.d.ts +4 -0
  59. package/dist/types/src/blueprints/discord/blueprint.d.ts.map +1 -0
  60. package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.d.ts +1 -1
  61. package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +1 -0
  62. package/dist/types/src/blueprints/discord/functions/fetch-messages.test.d.ts.map +1 -0
  63. package/dist/types/src/{functions/discord → blueprints/discord/functions}/index.d.ts +4 -4
  64. package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -0
  65. package/dist/types/src/blueprints/discord/index.d.ts +1 -2
  66. package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
  67. package/dist/types/src/{functions/github → blueprints/github/functions}/fetch-prs.d.ts +1 -1
  68. package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -0
  69. package/dist/types/src/blueprints/github/functions/index.d.ts +7 -0
  70. package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -0
  71. package/dist/types/src/blueprints/github/index.d.ts +1 -0
  72. package/dist/types/src/blueprints/github/index.d.ts.map +1 -0
  73. package/dist/types/src/blueprints/index.d.ts +13 -6
  74. package/dist/types/src/blueprints/index.d.ts.map +1 -1
  75. package/dist/types/src/blueprints/linear/blueprint.d.ts +4 -0
  76. package/dist/types/src/blueprints/linear/blueprint.d.ts.map +1 -0
  77. package/dist/types/src/blueprints/linear/functions/index.d.ts +9 -0
  78. package/dist/types/src/blueprints/linear/functions/index.d.ts.map +1 -0
  79. package/dist/types/src/blueprints/linear/functions/linear.test.d.ts.map +1 -0
  80. package/dist/types/src/{functions/linear → blueprints/linear/functions}/sync-issues.d.ts +2 -2
  81. package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -0
  82. package/dist/types/src/blueprints/linear/index.d.ts +1 -2
  83. package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
  84. package/dist/types/src/blueprints/markdown/blueprint.d.ts +4 -0
  85. package/dist/types/src/blueprints/markdown/blueprint.d.ts.map +1 -0
  86. package/dist/types/src/{functions/research/create-document.d.ts → blueprints/markdown/functions/create.d.ts} +2 -3
  87. package/dist/types/src/blueprints/markdown/functions/create.d.ts.map +1 -0
  88. package/dist/types/src/blueprints/markdown/functions/index.d.ts +30 -0
  89. package/dist/types/src/blueprints/markdown/functions/index.d.ts.map +1 -0
  90. package/dist/types/src/blueprints/markdown/functions/read.d.ts +14 -0
  91. package/dist/types/src/blueprints/markdown/functions/read.d.ts.map +1 -0
  92. package/dist/types/src/blueprints/markdown/functions/update.d.ts +13 -0
  93. package/dist/types/src/blueprints/markdown/functions/update.d.ts.map +1 -0
  94. package/dist/types/src/blueprints/markdown/index.d.ts +3 -0
  95. package/dist/types/src/blueprints/markdown/index.d.ts.map +1 -0
  96. package/dist/types/src/blueprints/memory/blueprint.d.ts +4 -0
  97. package/dist/types/src/blueprints/memory/blueprint.d.ts.map +1 -0
  98. package/dist/types/src/blueprints/memory/blueprint.test.d.ts +2 -0
  99. package/dist/types/src/blueprints/memory/blueprint.test.d.ts.map +1 -0
  100. package/dist/types/src/blueprints/memory/functions/delete.d.ts +8 -0
  101. package/dist/types/src/blueprints/memory/functions/delete.d.ts.map +1 -0
  102. package/dist/types/src/blueprints/memory/functions/index.d.ts +17 -0
  103. package/dist/types/src/blueprints/memory/functions/index.d.ts.map +1 -0
  104. package/dist/types/src/blueprints/memory/functions/query.d.ts +6 -0
  105. package/dist/types/src/blueprints/memory/functions/query.d.ts.map +1 -0
  106. package/dist/types/src/{functions/document/read.d.ts → blueprints/memory/functions/save.d.ts} +3 -4
  107. package/dist/types/src/blueprints/memory/functions/save.d.ts.map +1 -0
  108. package/dist/types/src/blueprints/memory/index.d.ts +3 -0
  109. package/dist/types/src/blueprints/memory/index.d.ts.map +1 -0
  110. package/dist/types/src/blueprints/planning/blueprint.d.ts +4 -0
  111. package/dist/types/src/blueprints/planning/blueprint.d.ts.map +1 -0
  112. package/dist/types/src/blueprints/planning/functions/index.d.ts +10 -0
  113. package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -0
  114. package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +9 -0
  115. package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -0
  116. package/dist/types/src/blueprints/planning/index.d.ts +1 -2
  117. package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
  118. package/dist/types/src/blueprints/planning-old/blueprint.d.ts +4 -0
  119. package/dist/types/src/blueprints/planning-old/blueprint.d.ts.map +1 -0
  120. package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts +2 -0
  121. package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts.map +1 -0
  122. package/dist/types/src/blueprints/planning-old/functions/index.d.ts +29 -0
  123. package/dist/types/src/blueprints/planning-old/functions/index.d.ts.map +1 -0
  124. package/dist/types/src/blueprints/planning-old/functions/read.d.ts +14 -0
  125. package/dist/types/src/blueprints/planning-old/functions/read.d.ts.map +1 -0
  126. package/dist/types/src/blueprints/planning-old/functions/task-list.d.ts.map +1 -0
  127. package/dist/types/src/blueprints/planning-old/functions/task-list.test.d.ts.map +1 -0
  128. package/dist/types/src/blueprints/planning-old/functions/update.d.ts +16 -0
  129. package/dist/types/src/blueprints/planning-old/functions/update.d.ts.map +1 -0
  130. package/dist/types/src/blueprints/planning-old/index.d.ts +2 -0
  131. package/dist/types/src/blueprints/planning-old/index.d.ts.map +1 -0
  132. package/dist/types/src/blueprints/project/blueprint.d.ts +4 -0
  133. package/dist/types/src/blueprints/project/blueprint.d.ts.map +1 -0
  134. package/dist/types/src/blueprints/project/blueprint.test.d.ts +2 -0
  135. package/dist/types/src/blueprints/project/blueprint.test.d.ts.map +1 -0
  136. package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +7 -0
  137. package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -0
  138. package/dist/types/src/blueprints/project/functions/agent.d.ts +62 -0
  139. package/dist/types/src/blueprints/project/functions/agent.d.ts.map +1 -0
  140. package/dist/types/src/blueprints/project/functions/get-context.d.ts +13 -0
  141. package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -0
  142. package/dist/types/src/blueprints/project/functions/index.d.ts +133 -0
  143. package/dist/types/src/blueprints/project/functions/index.d.ts.map +1 -0
  144. package/dist/types/src/blueprints/project/functions/qualifier.d.ts +60 -0
  145. package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -0
  146. package/dist/types/src/blueprints/project/index.d.ts +4 -0
  147. package/dist/types/src/blueprints/project/index.d.ts.map +1 -0
  148. package/dist/types/src/blueprints/project/sync-triggers.d.ts +11 -0
  149. package/dist/types/src/blueprints/project/sync-triggers.d.ts.map +1 -0
  150. package/dist/types/src/blueprints/project-wizard/blueprint.d.ts +4 -0
  151. package/dist/types/src/blueprints/project-wizard/blueprint.d.ts.map +1 -0
  152. package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +10 -0
  153. package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +1 -0
  154. package/dist/types/src/blueprints/project-wizard/functions/index.d.ts +31 -0
  155. package/dist/types/src/blueprints/project-wizard/functions/index.d.ts.map +1 -0
  156. package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts +3 -0
  157. package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts.map +1 -0
  158. package/dist/types/src/blueprints/project-wizard/functions/query-blueprints.d.ts +23 -0
  159. package/dist/types/src/blueprints/project-wizard/functions/query-blueprints.d.ts.map +1 -0
  160. package/dist/types/src/blueprints/project-wizard/index.d.ts +3 -0
  161. package/dist/types/src/blueprints/project-wizard/index.d.ts.map +1 -0
  162. package/dist/types/src/blueprints/research/blueprint.d.ts +4 -0
  163. package/dist/types/src/blueprints/research/blueprint.d.ts.map +1 -0
  164. package/dist/types/src/blueprints/research/blueprint.test.d.ts +2 -0
  165. package/dist/types/src/blueprints/research/blueprint.test.d.ts.map +1 -0
  166. package/dist/types/src/blueprints/research/functions/document-create.d.ts +10 -0
  167. package/dist/types/src/blueprints/research/functions/document-create.d.ts.map +1 -0
  168. package/dist/types/src/blueprints/research/functions/index.d.ts +19 -0
  169. package/dist/types/src/blueprints/research/functions/index.d.ts.map +1 -0
  170. package/dist/types/src/{functions/research → blueprints/research/functions}/research.d.ts +4 -3
  171. package/dist/types/src/blueprints/research/functions/research.d.ts.map +1 -0
  172. package/dist/types/src/blueprints/research/functions/research.test.d.ts.map +1 -0
  173. package/dist/types/src/blueprints/research/index.d.ts +2 -2
  174. package/dist/types/src/blueprints/research/index.d.ts.map +1 -1
  175. package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts +18 -0
  176. package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts.map +1 -0
  177. package/dist/types/src/blueprints/research/types/index.d.ts +7 -0
  178. package/dist/types/src/blueprints/research/types/index.d.ts.map +1 -0
  179. package/dist/types/src/blueprints/testing.d.ts +18 -4
  180. package/dist/types/src/blueprints/testing.d.ts.map +1 -1
  181. package/dist/types/src/blueprints/websearch/blueprint.d.ts +4 -0
  182. package/dist/types/src/blueprints/websearch/blueprint.d.ts.map +1 -0
  183. package/dist/types/src/blueprints/websearch/functions/fetch.d.ts +5 -0
  184. package/dist/types/src/blueprints/websearch/functions/fetch.d.ts.map +1 -0
  185. package/dist/types/src/blueprints/websearch/functions/index.d.ts +6 -0
  186. package/dist/types/src/blueprints/websearch/functions/index.d.ts.map +1 -0
  187. package/dist/types/src/blueprints/websearch/index.d.ts +3 -3
  188. package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
  189. package/dist/types/src/blueprints/websearch/{websearch-toolkit.d.ts → toolkit.d.ts} +2 -1
  190. package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
  191. package/dist/types/src/{functions/research → crud}/graph.d.ts +14 -11
  192. package/dist/types/src/crud/graph.d.ts.map +1 -0
  193. package/dist/types/src/crud/graph.test.d.ts.map +1 -0
  194. package/dist/types/src/crud/index.d.ts +2 -0
  195. package/dist/types/src/crud/index.d.ts.map +1 -0
  196. package/dist/types/src/functions/agent/index.d.ts +84 -4
  197. package/dist/types/src/functions/agent/index.d.ts.map +1 -1
  198. package/dist/types/src/functions/agent/prompt.d.ts +81 -8
  199. package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
  200. package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +142 -136
  201. package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +1 -1
  202. package/dist/types/src/functions/entity-extraction/index.d.ts +144 -139
  203. package/dist/types/src/functions/entity-extraction/index.d.ts.map +1 -1
  204. package/dist/types/src/functions/exa/data/exa-search-1748337321991.d.ts.map +1 -0
  205. package/dist/types/src/functions/exa/data/exa-search-1748337331526.d.ts.map +1 -0
  206. package/dist/types/src/functions/exa/data/exa-search-1748337344119.d.ts.map +1 -0
  207. package/dist/types/src/functions/exa/data/index.d.ts.map +1 -0
  208. package/dist/types/src/functions/exa/exa.d.ts +1 -1
  209. package/dist/types/src/functions/exa/index.d.ts +8 -2
  210. package/dist/types/src/functions/exa/index.d.ts.map +1 -1
  211. package/dist/types/src/functions/exa/mock.d.ts +1 -1
  212. package/dist/types/src/functions/index.d.ts +1 -5
  213. package/dist/types/src/functions/index.d.ts.map +1 -1
  214. package/dist/types/src/index.d.ts +3 -1
  215. package/dist/types/src/index.d.ts.map +1 -1
  216. package/dist/types/src/sync/sync.d.ts +3 -3
  217. package/dist/types/src/sync/sync.d.ts.map +1 -1
  218. package/dist/types/src/testing/index.d.ts +2 -1
  219. package/dist/types/src/testing/index.d.ts.map +1 -1
  220. package/dist/types/src/testing/plugins.d.ts +19 -0
  221. package/dist/types/src/testing/plugins.d.ts.map +1 -0
  222. package/dist/types/src/toolkits/WebToolkit.d.ts +38 -0
  223. package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -0
  224. package/dist/types/src/toolkits/index.d.ts +2 -0
  225. package/dist/types/src/toolkits/index.d.ts.map +1 -0
  226. package/dist/types/src/types/Chat.d.ts +31 -0
  227. package/dist/types/src/types/Chat.d.ts.map +1 -0
  228. package/dist/types/src/types/Memory.d.ts +12 -0
  229. package/dist/types/src/types/Memory.d.ts.map +1 -0
  230. package/dist/types/src/types/Plan.d.ts +77 -0
  231. package/dist/types/src/types/Plan.d.ts.map +1 -0
  232. package/dist/types/src/types/Project.d.ts +66 -0
  233. package/dist/types/src/types/Project.d.ts.map +1 -0
  234. package/dist/types/src/types/index.d.ts +5 -0
  235. package/dist/types/src/types/index.d.ts.map +1 -0
  236. package/dist/types/tsconfig.tsbuildinfo +1 -1
  237. package/package.json +49 -38
  238. package/src/blueprints/automation/blueprint.ts +109 -0
  239. package/src/blueprints/automation/index.ts +5 -0
  240. package/src/blueprints/browser/blueprint.conversations.json +1 -0
  241. package/src/blueprints/browser/blueprint.test.ts +70 -0
  242. package/src/blueprints/browser/blueprint.ts +41 -0
  243. package/src/blueprints/browser/index.ts +5 -0
  244. package/src/blueprints/database/blueprint.conversations.json +1 -0
  245. package/src/blueprints/database/blueprint.test.ts +341 -0
  246. package/src/blueprints/database/blueprint.ts +39 -0
  247. package/src/blueprints/database/functions/context-add.ts +35 -0
  248. package/src/blueprints/database/functions/context-remove.ts +35 -0
  249. package/src/blueprints/database/functions/index.ts +33 -0
  250. package/src/blueprints/database/functions/load.ts +31 -0
  251. package/src/blueprints/database/functions/object-create.ts +48 -0
  252. package/src/blueprints/database/functions/object-delete.ts +27 -0
  253. package/src/blueprints/database/functions/object-update.ts +40 -0
  254. package/src/blueprints/database/functions/query.ts +130 -0
  255. package/src/blueprints/database/functions/relation-create.ts +47 -0
  256. package/src/blueprints/database/functions/relation-delete.ts +28 -0
  257. package/src/blueprints/database/functions/schema-add.ts +40 -0
  258. package/src/blueprints/database/functions/schema-list.ts +34 -0
  259. package/src/blueprints/database/functions/tag-add.ts +31 -0
  260. package/src/blueprints/database/functions/tag-remove.ts +30 -0
  261. package/src/blueprints/database/index.ts +6 -0
  262. package/src/blueprints/design/{design-blueprint.test.ts → blueprint.test.ts} +25 -37
  263. package/src/blueprints/design/blueprint.ts +46 -0
  264. package/src/blueprints/design/index.ts +1 -3
  265. package/src/blueprints/discord/blueprint.ts +46 -0
  266. package/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.ts +10 -14
  267. package/src/{functions/discord → blueprints/discord/functions}/fetch-messages.ts +12 -11
  268. package/src/blueprints/discord/functions/index.ts +9 -0
  269. package/src/blueprints/discord/index.ts +1 -3
  270. package/src/{functions/github → blueprints/github/functions}/fetch-prs.ts +4 -3
  271. package/src/blueprints/github/functions/index.ts +9 -0
  272. package/src/blueprints/github/index.ts +3 -0
  273. package/src/blueprints/index.ts +13 -6
  274. package/src/blueprints/linear/blueprint.ts +47 -0
  275. package/src/blueprints/linear/functions/index.ts +9 -0
  276. package/src/blueprints/linear/functions/linear.test.ts +58 -0
  277. package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +18 -16
  278. package/src/blueprints/linear/index.ts +1 -3
  279. package/src/blueprints/markdown/blueprint.ts +38 -0
  280. package/src/blueprints/markdown/functions/create.ts +29 -0
  281. package/src/blueprints/markdown/functions/index.ts +13 -0
  282. package/src/blueprints/markdown/functions/read.ts +32 -0
  283. package/src/{functions/document → blueprints/markdown/functions}/update.ts +10 -8
  284. package/src/blueprints/markdown/index.ts +6 -0
  285. package/src/blueprints/memory/blueprint.conversations.json +1 -0
  286. package/src/blueprints/memory/blueprint.test.ts +135 -0
  287. package/src/blueprints/memory/blueprint.ts +44 -0
  288. package/src/blueprints/memory/functions/delete.ts +25 -0
  289. package/src/blueprints/memory/functions/index.ts +13 -0
  290. package/src/blueprints/memory/functions/query.ts +49 -0
  291. package/src/blueprints/memory/functions/save.ts +32 -0
  292. package/src/blueprints/memory/index.ts +6 -0
  293. package/src/blueprints/planning/blueprint.ts +28 -0
  294. package/src/blueprints/planning/functions/index.ts +9 -0
  295. package/src/blueprints/planning/functions/update-tasks.ts +168 -0
  296. package/src/blueprints/planning/index.ts +2 -4
  297. package/src/blueprints/{planning/planning-blueprint.test.ts → planning-old/blueprint.test.ts} +25 -32
  298. package/src/blueprints/{planning/planning-blueprint.ts → planning-old/blueprint.ts} +24 -12
  299. package/src/blueprints/planning-old/functions/index.ts +11 -0
  300. package/src/{functions/tasks → blueprints/planning-old/functions}/read.ts +7 -7
  301. package/src/{functions/tasks → blueprints/planning-old/functions}/update.ts +7 -7
  302. package/src/blueprints/planning-old/index.ts +5 -0
  303. package/src/blueprints/project/blueprint.test.ts +579 -0
  304. package/src/blueprints/project/blueprint.ts +68 -0
  305. package/src/blueprints/project/functions/add-artifact.ts +41 -0
  306. package/src/blueprints/project/functions/agent.ts +72 -0
  307. package/src/blueprints/project/functions/get-context.ts +63 -0
  308. package/src/blueprints/project/functions/index.ts +15 -0
  309. package/src/blueprints/project/functions/qualifier.ts +96 -0
  310. package/src/blueprints/project/index.ts +7 -0
  311. package/src/blueprints/project/sync-triggers.ts +153 -0
  312. package/src/blueprints/project-wizard/blueprint.ts +45 -0
  313. package/src/blueprints/project-wizard/functions/create-project.ts +57 -0
  314. package/src/blueprints/project-wizard/functions/index.ts +13 -0
  315. package/src/blueprints/project-wizard/functions/project-rules.ts +78 -0
  316. package/src/blueprints/project-wizard/functions/query-blueprints.ts +27 -0
  317. package/src/blueprints/project-wizard/index.ts +6 -0
  318. package/src/blueprints/research/blueprint.ts +65 -0
  319. package/src/blueprints/research/functions/document-create.ts +73 -0
  320. package/src/blueprints/research/functions/index.ts +11 -0
  321. package/src/{functions/research/instructions-research.tpl → blueprints/research/functions/research-instructions.tpl} +19 -11
  322. package/src/blueprints/research/functions/research.conversations.json +1 -0
  323. package/src/blueprints/research/functions/research.test.ts +149 -0
  324. package/src/blueprints/research/functions/research.ts +175 -0
  325. package/src/blueprints/research/index.ts +2 -3
  326. package/src/blueprints/research/types/ResearchGraph.ts +49 -0
  327. package/src/blueprints/research/types/index.ts +32 -0
  328. package/src/blueprints/testing.ts +36 -5
  329. package/src/blueprints/websearch/blueprint.ts +32 -0
  330. package/src/blueprints/websearch/functions/fetch.ts +28 -0
  331. package/src/blueprints/websearch/functions/index.ts +9 -0
  332. package/src/blueprints/websearch/index.ts +3 -4
  333. package/src/crud/graph.test.ts +46 -0
  334. package/src/{functions/research → crud}/graph.ts +32 -40
  335. package/src/crud/index.ts +5 -0
  336. package/src/functions/READ_THIS.md +5 -0
  337. package/src/functions/agent/index.ts +4 -6
  338. package/src/functions/agent/prompt.ts +33 -26
  339. package/src/functions/entity-extraction/entity-extraction.conversations.json +1 -1
  340. package/src/functions/entity-extraction/entity-extraction.test.ts +17 -43
  341. package/src/functions/entity-extraction/entity-extraction.ts +55 -37
  342. package/src/functions/entity-extraction/index.ts +4 -4
  343. package/src/functions/exa/exa.ts +2 -2
  344. package/src/functions/exa/index.ts +7 -2
  345. package/src/functions/exa/mock.ts +2 -2
  346. package/src/functions/index.ts +1 -5
  347. package/src/index.ts +3 -1
  348. package/src/sync/sync.ts +38 -30
  349. package/src/testing/index.ts +2 -1
  350. package/src/testing/plugins.tsx +72 -0
  351. package/src/toolkits/WebToolkit.ts +33 -0
  352. package/src/toolkits/index.ts +5 -0
  353. package/src/types/Chat.ts +51 -0
  354. package/src/types/Memory.ts +23 -0
  355. package/src/types/Plan.ts +110 -0
  356. package/src/types/Project.ts +197 -0
  357. package/src/types/index.ts +8 -0
  358. package/dist/lib/browser/index.mjs.map +0 -7
  359. package/dist/lib/browser/meta.json +0 -1
  360. package/dist/lib/node-esm/index.mjs +0 -2483
  361. package/dist/lib/node-esm/index.mjs.map +0 -7
  362. package/dist/lib/node-esm/meta.json +0 -1
  363. package/dist/types/src/blueprints/design/design-blueprint.d.ts +0 -4
  364. package/dist/types/src/blueprints/design/design-blueprint.d.ts.map +0 -1
  365. package/dist/types/src/blueprints/design/design-blueprint.test.d.ts +0 -2
  366. package/dist/types/src/blueprints/design/design-blueprint.test.d.ts.map +0 -1
  367. package/dist/types/src/blueprints/discord/discord-blueprint.d.ts +0 -18
  368. package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +0 -1
  369. package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +0 -18
  370. package/dist/types/src/blueprints/linear/linear-blueprint.d.ts.map +0 -1
  371. package/dist/types/src/blueprints/planning/planning-blueprint.d.ts +0 -4
  372. package/dist/types/src/blueprints/planning/planning-blueprint.d.ts.map +0 -1
  373. package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts +0 -2
  374. package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts.map +0 -1
  375. package/dist/types/src/blueprints/research/research-blueprint.d.ts +0 -4
  376. package/dist/types/src/blueprints/research/research-blueprint.d.ts.map +0 -1
  377. package/dist/types/src/blueprints/research/research-blueprint.test.d.ts +0 -2
  378. package/dist/types/src/blueprints/research/research-blueprint.test.d.ts.map +0 -1
  379. package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts +0 -4
  380. package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts.map +0 -1
  381. package/dist/types/src/blueprints/websearch/websearch-toolkit.d.ts.map +0 -1
  382. package/dist/types/src/experimental/feed.test.d.ts +0 -2
  383. package/dist/types/src/experimental/feed.test.d.ts.map +0 -1
  384. package/dist/types/src/functions/discord/fetch-messages.d.ts.map +0 -1
  385. package/dist/types/src/functions/discord/fetch-messages.test.d.ts.map +0 -1
  386. package/dist/types/src/functions/discord/index.d.ts.map +0 -1
  387. package/dist/types/src/functions/document/index.d.ts +0 -12
  388. package/dist/types/src/functions/document/index.d.ts.map +0 -1
  389. package/dist/types/src/functions/document/read.d.ts.map +0 -1
  390. package/dist/types/src/functions/document/update.d.ts +0 -6
  391. package/dist/types/src/functions/document/update.d.ts.map +0 -1
  392. package/dist/types/src/functions/github/fetch-prs.d.ts.map +0 -1
  393. package/dist/types/src/functions/linear/index.d.ts +0 -9
  394. package/dist/types/src/functions/linear/index.d.ts.map +0 -1
  395. package/dist/types/src/functions/linear/linear.test.d.ts.map +0 -1
  396. package/dist/types/src/functions/linear/sync-issues.d.ts.map +0 -1
  397. package/dist/types/src/functions/research/create-document.d.ts.map +0 -1
  398. package/dist/types/src/functions/research/graph.d.ts.map +0 -1
  399. package/dist/types/src/functions/research/graph.test.d.ts.map +0 -1
  400. package/dist/types/src/functions/research/index.d.ts +0 -19
  401. package/dist/types/src/functions/research/index.d.ts.map +0 -1
  402. package/dist/types/src/functions/research/research-graph.d.ts +0 -18
  403. package/dist/types/src/functions/research/research-graph.d.ts.map +0 -1
  404. package/dist/types/src/functions/research/research.d.ts.map +0 -1
  405. package/dist/types/src/functions/research/research.test.d.ts.map +0 -1
  406. package/dist/types/src/functions/research/types.d.ts +0 -384
  407. package/dist/types/src/functions/research/types.d.ts.map +0 -1
  408. package/dist/types/src/functions/tasks/index.d.ts +0 -15
  409. package/dist/types/src/functions/tasks/index.d.ts.map +0 -1
  410. package/dist/types/src/functions/tasks/read.d.ts +0 -7
  411. package/dist/types/src/functions/tasks/read.d.ts.map +0 -1
  412. package/dist/types/src/functions/tasks/task-list.d.ts.map +0 -1
  413. package/dist/types/src/functions/tasks/task-list.test.d.ts.map +0 -1
  414. package/dist/types/src/functions/tasks/update.d.ts +0 -9
  415. package/dist/types/src/functions/tasks/update.d.ts.map +0 -1
  416. package/dist/types/src/plugins.d.ts +0 -19
  417. package/dist/types/src/plugins.d.ts.map +0 -1
  418. package/dist/types/src/testing/data/exa-search-1748337321991.d.ts.map +0 -1
  419. package/dist/types/src/testing/data/exa-search-1748337331526.d.ts.map +0 -1
  420. package/dist/types/src/testing/data/exa-search-1748337344119.d.ts.map +0 -1
  421. package/dist/types/src/testing/data/index.d.ts.map +0 -1
  422. package/src/blueprints/design/design-blueprint.ts +0 -33
  423. package/src/blueprints/discord/discord-blueprint.ts +0 -34
  424. package/src/blueprints/linear/linear-blueprint.ts +0 -35
  425. package/src/blueprints/research/research-blueprint.ts +0 -45
  426. package/src/blueprints/websearch/websearch-blueprint.ts +0 -20
  427. package/src/experimental/feed.test.ts +0 -108
  428. package/src/functions/discord/index.ts +0 -9
  429. package/src/functions/document/index.ts +0 -11
  430. package/src/functions/document/read.ts +0 -29
  431. package/src/functions/linear/index.ts +0 -9
  432. package/src/functions/linear/linear.test.ts +0 -86
  433. package/src/functions/research/create-document.ts +0 -69
  434. package/src/functions/research/graph.test.ts +0 -69
  435. package/src/functions/research/index.ts +0 -15
  436. package/src/functions/research/research-graph.ts +0 -47
  437. package/src/functions/research/research.conversations.json +0 -10714
  438. package/src/functions/research/research.test.ts +0 -240
  439. package/src/functions/research/research.ts +0 -155
  440. package/src/functions/research/types.ts +0 -24
  441. package/src/functions/tasks/index.ts +0 -11
  442. package/src/plugins.tsx +0 -68
  443. /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.d.ts +0 -0
  444. /package/dist/types/src/{functions/linear → blueprints/linear/functions}/linear.test.d.ts +0 -0
  445. /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.d.ts +0 -0
  446. /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.d.ts +0 -0
  447. /package/dist/types/src/{functions/research → blueprints/research/functions}/research.test.d.ts +0 -0
  448. /package/dist/types/src/{functions/research → crud}/graph.test.d.ts +0 -0
  449. /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337321991.d.ts +0 -0
  450. /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337331526.d.ts +0 -0
  451. /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337344119.d.ts +0 -0
  452. /package/dist/types/src/{testing → functions/exa}/data/index.d.ts +0 -0
  453. /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.ts +0 -0
  454. /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.ts +0 -0
  455. /package/src/blueprints/research/{research-blueprint.test.ts → blueprint.test.ts} +0 -0
  456. /package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +0 -0
  457. /package/src/{testing → functions/exa}/data/exa-search-1748337321991.ts +0 -0
  458. /package/src/{testing → functions/exa}/data/exa-search-1748337331526.ts +0 -0
  459. /package/src/{testing → functions/exa}/data/exa-search-1748337344119.ts +0 -0
  460. /package/src/{testing → functions/exa}/data/index.ts +0 -0
@@ -1,240 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { inspect } from 'node:util';
6
-
7
- import { describe, it } from '@effect/vitest';
8
- import * as Effect from 'effect/Effect';
9
- import * as Layer from 'effect/Layer';
10
-
11
- import { AiService, ConsolePrinter, MemoizedAiService } from '@dxos/ai';
12
- import { AiServiceTestingPreset, EXA_API_KEY } from '@dxos/ai/testing';
13
- import {
14
- AiConversation,
15
- type ContextBinding,
16
- GenerationObserver,
17
- makeToolExecutionServiceFromFunctions,
18
- makeToolResolverFromFunctions,
19
- } from '@dxos/assistant';
20
- import { Blueprint } from '@dxos/blueprints';
21
- import { Obj, Ref, Type } from '@dxos/echo';
22
- import { TestHelpers, acquireReleaseResource } from '@dxos/effect';
23
- import {
24
- ComputeEventLogger,
25
- CredentialsService,
26
- DatabaseService,
27
- FunctionInvocationService,
28
- QueueService,
29
- TracingService,
30
- } from '@dxos/functions';
31
- import { TestDatabaseLayer } from '@dxos/functions/testing';
32
- import { ObjectId } from '@dxos/keys';
33
- import { DataType } from '@dxos/schema';
34
-
35
- import { ResearchBlueprint } from '../../blueprints';
36
- import { testToolkit } from '../../blueprints/testing';
37
-
38
- import createDocument from './create-document';
39
- import { createExtractionSchema, getSanitizedSchemaName } from './graph';
40
- import { default as research } from './research';
41
- import { ResearchGraph, queryResearchGraph } from './research-graph';
42
- import { ResearchDataTypes } from './types';
43
-
44
- ObjectId.dangerouslyDisableRandomness();
45
-
46
- const TestLayer = Layer.mergeAll(
47
- AiService.model('@anthropic/claude-opus-4-0'),
48
- makeToolResolverFromFunctions([research, createDocument], testToolkit),
49
- makeToolExecutionServiceFromFunctions(testToolkit, testToolkit.toLayer({}) as any),
50
- ComputeEventLogger.layerFromTracing,
51
- ).pipe(
52
- Layer.provideMerge(FunctionInvocationService.layerTest({ functions: [research, createDocument] })),
53
- Layer.provideMerge(
54
- Layer.mergeAll(
55
- MemoizedAiService.layerTest().pipe(Layer.provide(AiServiceTestingPreset('direct'))),
56
- TestDatabaseLayer({
57
- indexing: { vector: true },
58
- types: [...ResearchDataTypes, ResearchGraph, Blueprint.Blueprint],
59
- }),
60
- CredentialsService.configuredLayer([{ service: 'exa.ai', apiKey: EXA_API_KEY }]),
61
- TracingService.layerNoop,
62
- ),
63
- ),
64
- );
65
-
66
- // TODO(dmaretskyi): Out-of-memory.
67
- describe.skip('Research', () => {
68
- it.effect(
69
- 'call a function to generate a research report',
70
- Effect.fnUntraced(
71
- function* (_) {
72
- yield* DatabaseService.add(
73
- Obj.make(DataType.Organization, {
74
- name: 'Airbnb',
75
- website: 'https://www.airbnb.com/',
76
- }),
77
- );
78
- yield* DatabaseService.flush({ indexes: true });
79
-
80
- const result = yield* FunctionInvocationService.invokeFunction(research, {
81
- query: 'Founders and investors of airbnb.',
82
- mockSearch: false,
83
- });
84
-
85
- console.log(inspect(result, { depth: null, colors: true }));
86
- console.log(JSON.stringify(result, null, 2));
87
-
88
- yield* DatabaseService.flush({ indexes: true });
89
- const researchGraph = yield* queryResearchGraph();
90
- const data = yield* DatabaseService.load(researchGraph!.queue).pipe(
91
- Effect.flatMap((queue) => Effect.promise(() => queue.queryObjects())),
92
- );
93
- console.log(inspect(data, { depth: null, colors: true }));
94
- },
95
- Effect.provide(TestLayer),
96
- TestHelpers.provideTestContext,
97
- ),
98
- MemoizedAiService.isGenerationEnabled() ? 240_000 : undefined,
99
- );
100
-
101
- it.scoped(
102
- 'research blueprint',
103
- Effect.fnUntraced(
104
- function* (_) {
105
- const queue = yield* QueueService.createQueue<DataType.Message | ContextBinding>();
106
- const conversation = yield* acquireReleaseResource(() => new AiConversation(queue));
107
-
108
- const org = Obj.make(DataType.Organization, { name: 'Airbnb', website: 'https://www.airbnb.com/' });
109
- yield* DatabaseService.add(org);
110
- yield* DatabaseService.flush({ indexes: true });
111
-
112
- const blueprint = yield* DatabaseService.add(Obj.clone(ResearchBlueprint));
113
- yield* Effect.promise(() => conversation.context.bind({ blueprints: [Ref.make(blueprint)] }));
114
-
115
- const observer = GenerationObserver.fromPrinter(new ConsolePrinter());
116
- yield* conversation.createRequest({
117
- observer,
118
- prompt: `Research airbnb founders.`,
119
- });
120
-
121
- const researchGraph = yield* queryResearchGraph();
122
- const data = yield* DatabaseService.load(researchGraph!.queue).pipe(
123
- Effect.flatMap((queue) => Effect.promise(() => queue.queryObjects())),
124
- );
125
- console.log(inspect(data, { depth: null, colors: true }));
126
- },
127
- Effect.provide(TestLayer),
128
- TestHelpers.provideTestContext,
129
- ),
130
- MemoizedAiService.isGenerationEnabled() ? 240_000 : undefined,
131
- );
132
- });
133
-
134
- describe('misc', () => {
135
- it('createExtractionSchema', () => {
136
- const _schema = createExtractionSchema(ResearchDataTypes);
137
- // log.info('schema', { schema });
138
- });
139
-
140
- it('getSanitizedSchemaName', () => {
141
- const _names = ResearchDataTypes.map(getSanitizedSchemaName);
142
- // log.info('names', { names }) ;
143
- });
144
-
145
- it('getTypeAnnotation', () => {
146
- for (const schema of ResearchDataTypes) {
147
- const _dxn = Type.getDXN(schema);
148
- // log.info('dxn', { schema, dxn });
149
- }
150
- });
151
-
152
- it.skip('sanitizeObjects', () => {
153
- const _TEST_DATA = {
154
- objects_dxos_org_type_Project: [
155
- {
156
- name: 'Reor',
157
- description:
158
- 'A private & local AI personal knowledge management app focused on high entropy thinkers. Features include Q&A chat with full context of notes, automatic connection of ideas, semantic search, and local-first architecture with LLMs and vector databases.',
159
- image: 'https://reorhomepage-2-cwy0zagzg-reor-team.vercel.app/opengraph-image.jpg',
160
- id: 'reor-project-01',
161
- },
162
- {
163
- name: 'Personal AI',
164
- description:
165
- 'A platform for creating personal AI models with unlimited memory capabilities. Features include memory stacking, data uploads, and personalized language models that can be trained on individual knowledge bases.',
166
- image: 'https://cdn.prod.website-files.com/5ff65c460ce39f5ec5681c6a/663d12aab1b425e1ad40d3a6_Memory-min.jpg',
167
- id: 'personal-ai-project-01',
168
- },
169
- {
170
- name: 'IKI AI',
171
- description:
172
- 'An AI-native workspace for research, strategy, and creative work. Offers features like AI summarization, content analysis, and team knowledge sharing capabilities.',
173
- image: 'https://framerusercontent.com/assets/cI6Uo7x4q0W3uxzOt2preXjv6aE.jpg',
174
- id: 'iki-ai-project-01',
175
- },
176
- {
177
- name: 'Forethink',
178
- description:
179
- 'A privacy-first, on-device AI system that proactively links current activities to relevant knowledge. Features real-time learning across teams and local data processing.',
180
- image: 'https://framerusercontent.com/assets/XDhN6tICnlElB134JWcWXOuXc.jpeg',
181
- id: 'forethink-project-01',
182
- },
183
- {
184
- name: 'Amurex',
185
- description:
186
- 'An invisible AI companion that handles tasks, remembers important information, and supports workflow. Includes features for meeting automation, email categorization, and cross-platform search.',
187
- image: 'https://amurex.ai/ogimages/og_amurex.jpg',
188
- id: 'amurex-project-01',
189
- },
190
- ],
191
- objects_dxos_org_type_Organization: [
192
- {
193
- name: 'Reor',
194
- description:
195
- 'A technology company focused on developing local-first AI solutions for personal knowledge management.',
196
- status: 'active',
197
- website: 'https://www.reorproject.org',
198
- id: 'reor-org-01',
199
- },
200
- {
201
- name: 'Personal.ai',
202
- description: 'A company specializing in personal AI development and memory management solutions.',
203
- status: 'active',
204
- website: 'https://www.personal.ai',
205
- id: 'personal-ai-org-01',
206
- },
207
- {
208
- name: 'IKI AI',
209
- description: 'A startup backed by 500 Global, developing AI-native workspaces for knowledge workers.',
210
- status: 'active',
211
- website: 'https://iki.ai',
212
- id: 'iki-ai-org-01',
213
- },
214
- {
215
- name: 'Forethink.ai',
216
- description:
217
- 'A company focused on privacy-first AI solutions for knowledge management and team collaboration.',
218
- status: 'active',
219
- website: 'https://www.forethink.ai',
220
- id: 'forethink-org-01',
221
- },
222
- ],
223
- objects_dxos_org_type_Text: [
224
- {
225
- content:
226
- 'Current trends in AI-powered Personal Knowledge Management (PKM) systems include: 1) Shift from document-based to graph-based systems for better knowledge connection, 2) Integration of large language models for enhanced content understanding and retrieval, 3) Focus on privacy-first and local-first architectures, 4) Emphasis on automatic knowledge connection and discovery, 5) Implementation of semantic search capabilities.',
227
- id: 'pkm-trends-text-01',
228
- },
229
- {
230
- content:
231
- 'Key features emerging across modern PKM tools include: automated content categorization, semantic analysis and linking, personalized AI models that learn from user interaction, integration with existing workflows, and robust privacy protection. These tools are increasingly focusing on proactive knowledge surfacing rather than passive storage.',
232
- id: 'pkm-features-text-01',
233
- },
234
- ],
235
- };
236
-
237
- // const data = await sanitizeObjects(TYPES, TEST_DATA, db);
238
- // log.info('data', { data });
239
- });
240
- });
@@ -1,155 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Toolkit from '@effect/ai/Toolkit';
6
- import * as AnthropicTool from '@effect/ai-anthropic/AnthropicTool';
7
- import * as Array from 'effect/Array';
8
- import * as Effect from 'effect/Effect';
9
- import * as Layer from 'effect/Layer';
10
- import * as Schema from 'effect/Schema';
11
-
12
- import { AiService, ConsolePrinter } from '@dxos/ai';
13
- import {
14
- AiSession,
15
- GenerationObserver,
16
- createToolkit,
17
- makeToolExecutionServiceFromFunctions,
18
- makeToolResolverFromFunctions,
19
- } from '@dxos/assistant';
20
- import { type DXN, Obj } from '@dxos/echo';
21
- import { DatabaseService, FunctionInvocationService, TracingService, defineFunction } from '@dxos/functions';
22
- import { DataType } from '@dxos/schema';
23
- import { trim } from '@dxos/util';
24
-
25
- import { exaFunction, exaMockFunction } from '../exa';
26
-
27
- import { LocalSearchHandler, LocalSearchToolkit, makeGraphWriterHandler, makeGraphWriterToolkit } from './graph';
28
- // TODO(dmaretskyi): Vite build bug with instruction files with the same filename getting mixed-up.
29
- import PROMPT from './instructions-research.tpl?raw';
30
- import { contextQueueLayerFromResearchGraph } from './research-graph';
31
- import { ResearchDataTypes } from './types';
32
-
33
- /**
34
- * Exec external service and return the results as a Subgraph.
35
- */
36
- export default defineFunction({
37
- key: 'dxos.org/function/research',
38
- name: 'Research',
39
- description: trim`
40
- Research the web for information.
41
- Inserts structured data into the research graph.
42
- Will return research summary and the objects created.
43
- `,
44
- inputSchema: Schema.Struct({
45
- query: Schema.String.annotations({
46
- description: trim`
47
- The query to search for.
48
- If doing research on an object, load it first and pass it as a JSON string.
49
- `,
50
- }),
51
-
52
- researchInstructions: Schema.optional(Schema.String).annotations({
53
- description: trim`
54
- The instructions for the research agent.
55
- E.g., preference on fast responses or in-depth analysis, number of web searcher or the objects created.
56
- `,
57
- }),
58
-
59
- // TOOD(burdon): Move to context.
60
- mockSearch: Schema.optional(Schema.Boolean).annotations({
61
- description: 'Whether to use the mock search tool.',
62
- default: false,
63
- }),
64
- }),
65
- outputSchema: Schema.Struct({
66
- note: Schema.optional(Schema.String).annotations({
67
- description: 'A note from the research agent.',
68
- }),
69
- objects: Schema.Array(Schema.Unknown).annotations({
70
- description: 'The structured objects created as a result of the research.',
71
- }),
72
- }),
73
- handler: Effect.fnUntraced(
74
- function* ({ data: { query, mockSearch, researchInstructions } }) {
75
- if (mockSearch) {
76
- const mockPerson = yield* DatabaseService.add(
77
- Obj.make(DataType.Person, {
78
- preferredName: 'John Doe',
79
- emails: [{ value: 'john.doe@example.com' }],
80
- phoneNumbers: [{ value: '123-456-7890' }],
81
- }),
82
- );
83
-
84
- return {
85
- note: trim`
86
- The research run in test-mode and was mocked.
87
- Proceed as usual.
88
- We reference John Doe to test reference: ${Obj.getDXN(mockPerson)}
89
- `,
90
- objects: [Obj.toJSON(mockPerson)],
91
- };
92
- }
93
-
94
- yield* DatabaseService.flush({ indexes: true });
95
- yield* TracingService.emitStatus({ message: 'Researching...' });
96
-
97
- const objectDXNs: DXN[] = [];
98
- const GraphWriterToolkit = makeGraphWriterToolkit({ schema: ResearchDataTypes });
99
- const GraphWriterHandler = makeGraphWriterHandler(GraphWriterToolkit, {
100
- onAppend: (dxns) => objectDXNs.push(...dxns),
101
- });
102
- const NativeWebSearch = Toolkit.make(AnthropicTool.WebSearch_20250305({}));
103
-
104
- const toolkit = yield* createToolkit({
105
- toolkit: Toolkit.merge(LocalSearchToolkit, GraphWriterToolkit, NativeWebSearch),
106
- // toolIds: [mockSearch ? ToolId.make(exaMockFunction.key) : ToolId.make(exaFunction.key)],
107
- }).pipe(
108
- Effect.provide(
109
- Layer.mergeAll(
110
- //
111
- GraphWriterHandler,
112
- LocalSearchHandler,
113
- ).pipe(Layer.provide(contextQueueLayerFromResearchGraph)),
114
- ),
115
- );
116
-
117
- const session = new AiSession();
118
- const result = yield* session.run({
119
- prompt: query,
120
- system:
121
- PROMPT +
122
- (researchInstructions
123
- ? '\n\n' + `<research_instructions>${researchInstructions}</research_instructions>`
124
- : ''),
125
- toolkit,
126
- observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'research' })),
127
- });
128
- const note = result
129
- .at(-1)
130
- ?.blocks.filter((block) => block._tag === 'text')
131
- .at(-1)?.text;
132
- const objects = yield* Effect.forEach(objectDXNs, (dxn) => DatabaseService.resolve(dxn)).pipe(
133
- Effect.map(Array.map((obj) => Obj.toJSON(obj))),
134
- );
135
-
136
- return {
137
- note,
138
- objects,
139
- };
140
- },
141
- Effect.provide(
142
- Layer.mergeAll(
143
- AiService.model('@anthropic/claude-sonnet-4-0'),
144
- // TODO(dmaretskyi): Extract.
145
- makeToolResolverFromFunctions([exaFunction, exaMockFunction], Toolkit.make()),
146
- makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
147
- ).pipe(
148
- Layer.provide(
149
- // TODO(dmaretskyi): This should be provided by environment.
150
- Layer.mergeAll(FunctionInvocationService.layerTestMocked({ functions: [exaFunction, exaMockFunction] })),
151
- ),
152
- ),
153
- ),
154
- ),
155
- });
@@ -1,24 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { DataType } from '@dxos/schema';
6
-
7
- /**
8
- * Data types for research.
9
- */
10
- export const ResearchDataTypes = [
11
- // Objects
12
- DataType.Event,
13
- DataType.LegacyOrganization,
14
- DataType.LegacyPerson,
15
- DataType.Project,
16
- DataType.Task,
17
- DataType.Text,
18
-
19
- // Relations
20
- // TODO(wittjosiah): Until views (e.g. table) support relations this needs to be expressed via organization ref.
21
- // DataType.Employer,
22
- DataType.HasRelationship,
23
- DataType.HasConnection,
24
- ];
@@ -1,11 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { default as read$ } from './read';
6
- import { default as update$ } from './update';
7
-
8
- export namespace Tasks {
9
- export const read = read$;
10
- export const update = update$;
11
- }
package/src/plugins.tsx DELETED
@@ -1,68 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Schema from 'effect/Schema';
6
- import React from 'react';
7
-
8
- import { type AnyCapability, Capabilities, contributes, createSurface } from '@dxos/app-framework';
9
- import { type Obj, Type } from '@dxos/echo';
10
- import { JsonFilter } from '@dxos/react-ui-syntax-highlighter';
11
-
12
- export const MapSchema = Schema.Struct({
13
- coordinates: Type.Format.GeoPoint,
14
- }).pipe(
15
- Type.Obj({
16
- typename: 'example.com/type/Map',
17
- version: '0.1.0',
18
- }),
19
- );
20
-
21
- export type MapSchema = Schema.Schema.Type<typeof MapSchema>;
22
-
23
- // TODO(burdon): Move to ECHO def.
24
- export type ArtifactsContext = {
25
- items: Obj.Any[];
26
- getArtifacts: () => Obj.Any[];
27
- addArtifact: (artifact: Obj.Any) => void;
28
- };
29
-
30
- declare global {
31
- interface ToolContextExtensions {
32
- artifacts?: ArtifactsContext;
33
- }
34
- }
35
-
36
- // TODO(dmaretskyi): Removed images from conductor GPT implementation.
37
- const isImage = (data: any): data is any => false;
38
-
39
- export const capabilities: AnyCapability[] = [
40
- contributes(
41
- Capabilities.ReactSurface,
42
- createSurface({
43
- id: 'plugin-image',
44
- role: 'card--extrinsic',
45
- filter: (data: any): data is any => isImage(data.value),
46
- component: ({ data }) => (
47
- <img
48
- className='grow object-cover'
49
- src={`data:image/jpeg;base64,${data.value.source.data}`}
50
- alt={data.value.prompt ?? `Generated image [id=${data.value.id}]`}
51
- />
52
- ),
53
- }),
54
- ),
55
-
56
- //
57
- // Default
58
- //
59
- contributes(
60
- Capabilities.ReactSurface,
61
- createSurface({
62
- id: 'plugin-default',
63
- role: 'card--extrinsic',
64
- position: 'fallback',
65
- component: ({ role, data }) => <JsonFilter data={data} />,
66
- }),
67
- ),
68
- ];
File without changes