@dxos/assistant-toolkit 0.8.4-main.66e292d → 0.8.4-main.6fa680abb7

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 (418) 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 +3478 -2472
  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/browser/blueprint.d.ts +4 -0
  9. package/dist/types/src/blueprints/browser/blueprint.d.ts.map +1 -0
  10. package/dist/types/src/blueprints/browser/blueprint.test.d.ts +2 -0
  11. package/dist/types/src/blueprints/browser/blueprint.test.d.ts.map +1 -0
  12. package/dist/types/src/blueprints/browser/index.d.ts +2 -0
  13. package/dist/types/src/blueprints/browser/index.d.ts.map +1 -0
  14. package/dist/types/src/blueprints/database/blueprint.d.ts +4 -0
  15. package/dist/types/src/blueprints/database/blueprint.d.ts.map +1 -0
  16. package/dist/types/src/blueprints/database/blueprint.test.d.ts +2 -0
  17. package/dist/types/src/blueprints/database/blueprint.test.d.ts.map +1 -0
  18. package/dist/types/src/blueprints/database/functions/context-add.d.ts +6 -0
  19. package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -0
  20. package/dist/types/src/blueprints/database/functions/context-remove.d.ts +6 -0
  21. package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -0
  22. package/dist/types/src/blueprints/database/functions/index.d.ts +57 -0
  23. package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -0
  24. package/dist/types/src/blueprints/database/functions/load.d.ts +6 -0
  25. package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -0
  26. package/dist/types/src/blueprints/database/functions/object-create.d.ts +6 -0
  27. package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +1 -0
  28. package/dist/types/src/blueprints/database/functions/object-delete.d.ts +6 -0
  29. package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +1 -0
  30. package/dist/types/src/blueprints/database/functions/object-update.d.ts +9 -0
  31. package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -0
  32. package/dist/types/src/blueprints/database/functions/query.d.ts +9 -0
  33. package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -0
  34. package/dist/types/src/blueprints/database/functions/relation-create.d.ts +9 -0
  35. package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -0
  36. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +6 -0
  37. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +1 -0
  38. package/dist/types/src/blueprints/database/functions/schema-add.d.ts +7 -0
  39. package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +1 -0
  40. package/dist/types/src/blueprints/database/functions/schema-list.d.ts +5 -0
  41. package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -0
  42. package/dist/types/src/blueprints/database/functions/tag-add.d.ts +7 -0
  43. package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -0
  44. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +7 -0
  45. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -0
  46. package/dist/types/src/blueprints/database/index.d.ts +3 -0
  47. package/dist/types/src/blueprints/database/index.d.ts.map +1 -0
  48. package/dist/types/src/blueprints/design/blueprint.d.ts +4 -0
  49. package/dist/types/src/blueprints/design/blueprint.d.ts.map +1 -0
  50. package/dist/types/src/blueprints/design/blueprint.test.d.ts +2 -0
  51. package/dist/types/src/blueprints/design/blueprint.test.d.ts.map +1 -0
  52. package/dist/types/src/blueprints/design/index.d.ts +1 -2
  53. package/dist/types/src/blueprints/design/index.d.ts.map +1 -1
  54. package/dist/types/src/blueprints/discord/blueprint.d.ts +4 -0
  55. package/dist/types/src/blueprints/discord/blueprint.d.ts.map +1 -0
  56. package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +1 -0
  57. package/dist/types/src/blueprints/discord/functions/fetch-messages.test.d.ts.map +1 -0
  58. package/dist/types/src/{functions/discord → blueprints/discord/functions}/index.d.ts +3 -3
  59. package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -0
  60. package/dist/types/src/blueprints/discord/index.d.ts +1 -2
  61. package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
  62. package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -0
  63. package/dist/types/src/blueprints/github/functions/index.d.ts +7 -0
  64. package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -0
  65. package/dist/types/src/blueprints/github/index.d.ts +1 -0
  66. package/dist/types/src/blueprints/github/index.d.ts.map +1 -0
  67. package/dist/types/src/blueprints/index.d.ts +11 -6
  68. package/dist/types/src/blueprints/index.d.ts.map +1 -1
  69. package/dist/types/src/blueprints/linear/blueprint.d.ts +4 -0
  70. package/dist/types/src/blueprints/linear/blueprint.d.ts.map +1 -0
  71. package/dist/types/src/blueprints/linear/functions/index.d.ts +9 -0
  72. package/dist/types/src/blueprints/linear/functions/index.d.ts.map +1 -0
  73. package/dist/types/src/blueprints/linear/functions/linear.test.d.ts.map +1 -0
  74. package/dist/types/src/{functions/linear → blueprints/linear/functions}/sync-issues.d.ts +1 -1
  75. package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -0
  76. package/dist/types/src/blueprints/linear/index.d.ts +1 -2
  77. package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
  78. package/dist/types/src/blueprints/markdown/blueprint.d.ts +4 -0
  79. package/dist/types/src/blueprints/markdown/blueprint.d.ts.map +1 -0
  80. package/dist/types/src/{functions/document/update.d.ts → blueprints/markdown/functions/create.d.ts} +2 -2
  81. package/dist/types/src/blueprints/markdown/functions/create.d.ts.map +1 -0
  82. package/dist/types/src/blueprints/markdown/functions/index.d.ts +30 -0
  83. package/dist/types/src/blueprints/markdown/functions/index.d.ts.map +1 -0
  84. package/dist/types/src/blueprints/markdown/functions/read.d.ts +14 -0
  85. package/dist/types/src/blueprints/markdown/functions/read.d.ts.map +1 -0
  86. package/dist/types/src/blueprints/markdown/functions/update.d.ts +13 -0
  87. package/dist/types/src/blueprints/markdown/functions/update.d.ts.map +1 -0
  88. package/dist/types/src/blueprints/markdown/index.d.ts +3 -0
  89. package/dist/types/src/blueprints/markdown/index.d.ts.map +1 -0
  90. package/dist/types/src/blueprints/memory/blueprint.d.ts +4 -0
  91. package/dist/types/src/blueprints/memory/blueprint.d.ts.map +1 -0
  92. package/dist/types/src/blueprints/memory/blueprint.test.d.ts +2 -0
  93. package/dist/types/src/blueprints/memory/blueprint.test.d.ts.map +1 -0
  94. package/dist/types/src/blueprints/memory/functions/delete.d.ts +8 -0
  95. package/dist/types/src/blueprints/memory/functions/delete.d.ts.map +1 -0
  96. package/dist/types/src/blueprints/memory/functions/index.d.ts +17 -0
  97. package/dist/types/src/blueprints/memory/functions/index.d.ts.map +1 -0
  98. package/dist/types/src/blueprints/memory/functions/query.d.ts +6 -0
  99. package/dist/types/src/blueprints/memory/functions/query.d.ts.map +1 -0
  100. package/dist/types/src/{functions/document/read.d.ts → blueprints/memory/functions/save.d.ts} +3 -4
  101. package/dist/types/src/blueprints/memory/functions/save.d.ts.map +1 -0
  102. package/dist/types/src/blueprints/memory/index.d.ts +3 -0
  103. package/dist/types/src/blueprints/memory/index.d.ts.map +1 -0
  104. package/dist/types/src/blueprints/planning/blueprint.d.ts +4 -0
  105. package/dist/types/src/blueprints/planning/blueprint.d.ts.map +1 -0
  106. package/dist/types/src/blueprints/planning/functions/index.d.ts +10 -0
  107. package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -0
  108. package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +9 -0
  109. package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -0
  110. package/dist/types/src/blueprints/planning/index.d.ts +1 -2
  111. package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
  112. package/dist/types/src/blueprints/planning-old/blueprint.d.ts +4 -0
  113. package/dist/types/src/blueprints/planning-old/blueprint.d.ts.map +1 -0
  114. package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts +2 -0
  115. package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts.map +1 -0
  116. package/dist/types/src/blueprints/planning-old/functions/index.d.ts +29 -0
  117. package/dist/types/src/blueprints/planning-old/functions/index.d.ts.map +1 -0
  118. package/dist/types/src/blueprints/planning-old/functions/read.d.ts +14 -0
  119. package/dist/types/src/blueprints/planning-old/functions/read.d.ts.map +1 -0
  120. package/dist/types/src/blueprints/planning-old/functions/task-list.d.ts.map +1 -0
  121. package/dist/types/src/blueprints/planning-old/functions/task-list.test.d.ts.map +1 -0
  122. package/dist/types/src/blueprints/planning-old/functions/update.d.ts +16 -0
  123. package/dist/types/src/blueprints/planning-old/functions/update.d.ts.map +1 -0
  124. package/dist/types/src/blueprints/planning-old/index.d.ts +2 -0
  125. package/dist/types/src/blueprints/planning-old/index.d.ts.map +1 -0
  126. package/dist/types/src/blueprints/project/blueprint.d.ts +4 -0
  127. package/dist/types/src/blueprints/project/blueprint.d.ts.map +1 -0
  128. package/dist/types/src/blueprints/project/blueprint.test.d.ts +2 -0
  129. package/dist/types/src/blueprints/project/blueprint.test.d.ts.map +1 -0
  130. package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +7 -0
  131. package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -0
  132. package/dist/types/src/blueprints/project/functions/agent.d.ts +62 -0
  133. package/dist/types/src/blueprints/project/functions/agent.d.ts.map +1 -0
  134. package/dist/types/src/blueprints/project/functions/get-context.d.ts +13 -0
  135. package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -0
  136. package/dist/types/src/blueprints/project/functions/index.d.ts +133 -0
  137. package/dist/types/src/blueprints/project/functions/index.d.ts.map +1 -0
  138. package/dist/types/src/blueprints/project/functions/qualifier.d.ts +60 -0
  139. package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -0
  140. package/dist/types/src/blueprints/project/index.d.ts +3 -0
  141. package/dist/types/src/blueprints/project/index.d.ts.map +1 -0
  142. package/dist/types/src/blueprints/research/blueprint.d.ts +4 -0
  143. package/dist/types/src/blueprints/research/blueprint.d.ts.map +1 -0
  144. package/dist/types/src/blueprints/research/blueprint.test.d.ts +2 -0
  145. package/dist/types/src/blueprints/research/blueprint.test.d.ts.map +1 -0
  146. package/dist/types/src/{functions/research → blueprints/research/functions}/document-create.d.ts +2 -1
  147. package/dist/types/src/blueprints/research/functions/document-create.d.ts.map +1 -0
  148. package/dist/types/src/{functions/research → blueprints/research/functions}/index.d.ts +6 -8
  149. package/dist/types/src/blueprints/research/functions/index.d.ts.map +1 -0
  150. package/dist/types/src/{functions/research → blueprints/research/functions}/research.d.ts +1 -1
  151. package/dist/types/src/blueprints/research/functions/research.d.ts.map +1 -0
  152. package/dist/types/src/blueprints/research/functions/research.test.d.ts.map +1 -0
  153. package/dist/types/src/blueprints/research/index.d.ts +2 -2
  154. package/dist/types/src/blueprints/research/index.d.ts.map +1 -1
  155. package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts +18 -0
  156. package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts.map +1 -0
  157. package/dist/types/src/blueprints/research/types/index.d.ts +7 -0
  158. package/dist/types/src/blueprints/research/types/index.d.ts.map +1 -0
  159. package/dist/types/src/blueprints/testing.d.ts +18 -4
  160. package/dist/types/src/blueprints/testing.d.ts.map +1 -1
  161. package/dist/types/src/blueprints/websearch/blueprint.d.ts +4 -0
  162. package/dist/types/src/blueprints/websearch/blueprint.d.ts.map +1 -0
  163. package/dist/types/src/blueprints/websearch/index.d.ts +2 -3
  164. package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
  165. package/dist/types/src/blueprints/websearch/{websearch-toolkit.d.ts → toolkit.d.ts} +1 -1
  166. package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
  167. package/dist/types/src/crud/graph.d.ts +14 -11
  168. package/dist/types/src/crud/graph.d.ts.map +1 -1
  169. package/dist/types/src/functions/agent/index.d.ts +84 -4
  170. package/dist/types/src/functions/agent/index.d.ts.map +1 -1
  171. package/dist/types/src/functions/agent/prompt.d.ts +79 -4
  172. package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
  173. package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +136 -129
  174. package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +1 -1
  175. package/dist/types/src/functions/entity-extraction/index.d.ts +138 -132
  176. package/dist/types/src/functions/entity-extraction/index.d.ts.map +1 -1
  177. package/dist/types/src/functions/exa/data/exa-search-1748337321991.d.ts.map +1 -0
  178. package/dist/types/src/functions/exa/data/exa-search-1748337331526.d.ts.map +1 -0
  179. package/dist/types/src/functions/exa/data/exa-search-1748337344119.d.ts.map +1 -0
  180. package/dist/types/src/functions/exa/data/index.d.ts.map +1 -0
  181. package/dist/types/src/functions/exa/index.d.ts +8 -2
  182. package/dist/types/src/functions/exa/index.d.ts.map +1 -1
  183. package/dist/types/src/functions/index.d.ts +1 -5
  184. package/dist/types/src/functions/index.d.ts.map +1 -1
  185. package/dist/types/src/index.d.ts +2 -2
  186. package/dist/types/src/index.d.ts.map +1 -1
  187. package/dist/types/src/sync/sync.d.ts +3 -3
  188. package/dist/types/src/sync/sync.d.ts.map +1 -1
  189. package/dist/types/src/testing/index.d.ts +2 -1
  190. package/dist/types/src/testing/index.d.ts.map +1 -1
  191. package/dist/types/src/testing/plugins.d.ts +19 -0
  192. package/dist/types/src/testing/plugins.d.ts.map +1 -0
  193. package/dist/types/src/toolkits/WebToolkit.d.ts +38 -0
  194. package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -0
  195. package/dist/types/src/toolkits/index.d.ts +1 -2
  196. package/dist/types/src/toolkits/index.d.ts.map +1 -1
  197. package/dist/types/src/types/Chat.d.ts +31 -0
  198. package/dist/types/src/types/Chat.d.ts.map +1 -0
  199. package/dist/types/src/types/Memory.d.ts +12 -0
  200. package/dist/types/src/types/Memory.d.ts.map +1 -0
  201. package/dist/types/src/types/Plan.d.ts +77 -0
  202. package/dist/types/src/types/Plan.d.ts.map +1 -0
  203. package/dist/types/src/types/Project.d.ts +67 -0
  204. package/dist/types/src/types/Project.d.ts.map +1 -0
  205. package/dist/types/src/types/index.d.ts +5 -0
  206. package/dist/types/src/types/index.d.ts.map +1 -0
  207. package/dist/types/tsconfig.tsbuildinfo +1 -1
  208. package/package.json +49 -40
  209. package/src/blueprints/browser/blueprint.conversations.json +1 -0
  210. package/src/blueprints/browser/blueprint.test.ts +70 -0
  211. package/src/blueprints/browser/blueprint.ts +41 -0
  212. package/src/blueprints/browser/index.ts +5 -0
  213. package/src/blueprints/database/blueprint.conversations.json +1 -0
  214. package/src/blueprints/database/blueprint.test.ts +321 -0
  215. package/src/blueprints/database/blueprint.ts +39 -0
  216. package/src/blueprints/database/functions/context-add.ts +35 -0
  217. package/src/blueprints/database/functions/context-remove.ts +35 -0
  218. package/src/blueprints/database/functions/index.ts +33 -0
  219. package/src/blueprints/database/functions/load.ts +31 -0
  220. package/src/blueprints/database/functions/object-create.ts +35 -0
  221. package/src/blueprints/database/functions/object-delete.ts +27 -0
  222. package/src/blueprints/database/functions/object-update.ts +32 -0
  223. package/src/blueprints/database/functions/query.ts +126 -0
  224. package/src/blueprints/database/functions/relation-create.ts +47 -0
  225. package/src/blueprints/database/functions/relation-delete.ts +28 -0
  226. package/src/blueprints/database/functions/schema-add.ts +40 -0
  227. package/src/blueprints/database/functions/schema-list.ts +34 -0
  228. package/src/blueprints/database/functions/tag-add.ts +31 -0
  229. package/src/blueprints/database/functions/tag-remove.ts +30 -0
  230. package/src/blueprints/database/index.ts +6 -0
  231. package/src/blueprints/design/{design-blueprint.test.ts → blueprint.test.ts} +19 -26
  232. package/src/blueprints/design/{design-blueprint.ts → blueprint.ts} +24 -11
  233. package/src/blueprints/design/index.ts +1 -3
  234. package/src/blueprints/discord/blueprint.ts +46 -0
  235. package/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.ts +5 -8
  236. package/src/{functions/discord → blueprints/discord/functions}/fetch-messages.ts +2 -2
  237. package/src/blueprints/discord/functions/index.ts +9 -0
  238. package/src/blueprints/discord/index.ts +1 -3
  239. package/src/{functions/github → blueprints/github/functions}/fetch-prs.ts +4 -3
  240. package/src/blueprints/github/functions/index.ts +9 -0
  241. package/src/blueprints/github/index.ts +3 -0
  242. package/src/blueprints/index.ts +11 -6
  243. package/src/blueprints/linear/blueprint.ts +47 -0
  244. package/src/blueprints/linear/functions/index.ts +9 -0
  245. package/src/blueprints/linear/functions/linear.test.ts +58 -0
  246. package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +13 -11
  247. package/src/blueprints/linear/index.ts +1 -3
  248. package/src/blueprints/markdown/blueprint.ts +38 -0
  249. package/src/blueprints/markdown/functions/create.ts +29 -0
  250. package/src/blueprints/markdown/functions/index.ts +13 -0
  251. package/src/blueprints/markdown/functions/read.ts +32 -0
  252. package/src/{functions/document → blueprints/markdown/functions}/update.ts +10 -8
  253. package/src/blueprints/markdown/index.ts +6 -0
  254. package/src/blueprints/memory/blueprint.conversations.json +1 -0
  255. package/src/blueprints/memory/blueprint.test.ts +135 -0
  256. package/src/blueprints/memory/blueprint.ts +44 -0
  257. package/src/blueprints/memory/functions/delete.ts +25 -0
  258. package/src/blueprints/memory/functions/index.ts +13 -0
  259. package/src/blueprints/memory/functions/query.ts +49 -0
  260. package/src/blueprints/memory/functions/save.ts +32 -0
  261. package/src/blueprints/memory/index.ts +6 -0
  262. package/src/blueprints/planning/blueprint.ts +28 -0
  263. package/src/blueprints/planning/functions/index.ts +9 -0
  264. package/src/blueprints/planning/functions/update-tasks.ts +168 -0
  265. package/src/blueprints/planning/index.ts +2 -4
  266. package/src/blueprints/{planning/planning-blueprint.test.ts → planning-old/blueprint.test.ts} +17 -19
  267. package/src/blueprints/{planning/planning-blueprint.ts → planning-old/blueprint.ts} +23 -11
  268. package/src/blueprints/planning-old/functions/index.ts +11 -0
  269. package/src/{functions/tasks → blueprints/planning-old/functions}/read.ts +7 -7
  270. package/src/{functions/tasks → blueprints/planning-old/functions}/update.ts +7 -7
  271. package/src/blueprints/planning-old/index.ts +5 -0
  272. package/src/blueprints/project/blueprint.test.ts +579 -0
  273. package/src/blueprints/project/blueprint.ts +68 -0
  274. package/src/blueprints/project/functions/add-artifact.ts +41 -0
  275. package/src/blueprints/project/functions/agent.ts +72 -0
  276. package/src/blueprints/project/functions/get-context.ts +63 -0
  277. package/src/blueprints/project/functions/index.ts +15 -0
  278. package/src/blueprints/project/functions/qualifier.ts +96 -0
  279. package/src/blueprints/project/index.ts +6 -0
  280. package/src/blueprints/research/{research-blueprint.ts → blueprint.ts} +24 -12
  281. package/src/{functions/research → blueprints/research/functions}/document-create.ts +10 -12
  282. package/src/blueprints/research/functions/index.ts +11 -0
  283. package/src/{functions/research → blueprints/research/functions}/research-instructions.tpl +5 -5
  284. package/src/blueprints/research/functions/research.conversations.json +1 -0
  285. package/src/{functions/research → blueprints/research/functions}/research.test.ts +40 -70
  286. package/src/{functions/research → blueprints/research/functions}/research.ts +19 -34
  287. package/src/blueprints/research/index.ts +2 -3
  288. package/src/blueprints/research/types/ResearchGraph.ts +49 -0
  289. package/src/{functions/research/types.ts → blueprints/research/types/index.ts} +12 -6
  290. package/src/blueprints/testing.ts +36 -5
  291. package/src/blueprints/websearch/blueprint.ts +32 -0
  292. package/src/blueprints/websearch/index.ts +2 -4
  293. package/src/crud/graph.test.ts +6 -29
  294. package/src/crud/graph.ts +21 -23
  295. package/src/functions/READ_THIS.md +5 -0
  296. package/src/functions/agent/index.ts +4 -6
  297. package/src/functions/agent/prompt.ts +20 -26
  298. package/src/functions/entity-extraction/entity-extraction.conversations.json +1 -1
  299. package/src/functions/entity-extraction/entity-extraction.test.ts +13 -31
  300. package/src/functions/entity-extraction/entity-extraction.ts +44 -27
  301. package/src/functions/entity-extraction/index.ts +4 -4
  302. package/src/functions/exa/exa.ts +2 -2
  303. package/src/functions/exa/index.ts +7 -2
  304. package/src/functions/exa/mock.ts +2 -2
  305. package/src/functions/index.ts +1 -5
  306. package/src/index.ts +2 -2
  307. package/src/sync/sync.ts +38 -30
  308. package/src/testing/index.ts +2 -1
  309. package/src/{plugins.tsx → testing/plugins.tsx} +27 -23
  310. package/src/toolkits/WebToolkit.ts +33 -0
  311. package/src/toolkits/index.ts +1 -2
  312. package/src/types/Chat.ts +51 -0
  313. package/src/types/Memory.ts +23 -0
  314. package/src/types/Plan.ts +110 -0
  315. package/src/types/Project.ts +198 -0
  316. package/src/types/index.ts +8 -0
  317. package/dist/lib/browser/index.mjs.map +0 -7
  318. package/dist/lib/browser/meta.json +0 -1
  319. package/dist/lib/node-esm/index.mjs +0 -2779
  320. package/dist/lib/node-esm/index.mjs.map +0 -7
  321. package/dist/lib/node-esm/meta.json +0 -1
  322. package/dist/types/src/blueprints/design/design-blueprint.d.ts +0 -4
  323. package/dist/types/src/blueprints/design/design-blueprint.d.ts.map +0 -1
  324. package/dist/types/src/blueprints/design/design-blueprint.test.d.ts +0 -2
  325. package/dist/types/src/blueprints/design/design-blueprint.test.d.ts.map +0 -1
  326. package/dist/types/src/blueprints/discord/discord-blueprint.d.ts +0 -19
  327. package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +0 -1
  328. package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +0 -19
  329. package/dist/types/src/blueprints/linear/linear-blueprint.d.ts.map +0 -1
  330. package/dist/types/src/blueprints/planning/planning-blueprint.d.ts +0 -4
  331. package/dist/types/src/blueprints/planning/planning-blueprint.d.ts.map +0 -1
  332. package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts +0 -2
  333. package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts.map +0 -1
  334. package/dist/types/src/blueprints/research/research-blueprint.d.ts +0 -4
  335. package/dist/types/src/blueprints/research/research-blueprint.d.ts.map +0 -1
  336. package/dist/types/src/blueprints/research/research-blueprint.test.d.ts +0 -2
  337. package/dist/types/src/blueprints/research/research-blueprint.test.d.ts.map +0 -1
  338. package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts +0 -4
  339. package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts.map +0 -1
  340. package/dist/types/src/blueprints/websearch/websearch-toolkit.d.ts.map +0 -1
  341. package/dist/types/src/experimental/feed.test.d.ts +0 -2
  342. package/dist/types/src/experimental/feed.test.d.ts.map +0 -1
  343. package/dist/types/src/functions/discord/fetch-messages.d.ts.map +0 -1
  344. package/dist/types/src/functions/discord/fetch-messages.test.d.ts.map +0 -1
  345. package/dist/types/src/functions/discord/index.d.ts.map +0 -1
  346. package/dist/types/src/functions/document/index.d.ts +0 -13
  347. package/dist/types/src/functions/document/index.d.ts.map +0 -1
  348. package/dist/types/src/functions/document/read.d.ts.map +0 -1
  349. package/dist/types/src/functions/document/update.d.ts.map +0 -1
  350. package/dist/types/src/functions/github/fetch-prs.d.ts.map +0 -1
  351. package/dist/types/src/functions/linear/index.d.ts +0 -9
  352. package/dist/types/src/functions/linear/index.d.ts.map +0 -1
  353. package/dist/types/src/functions/linear/linear.test.d.ts.map +0 -1
  354. package/dist/types/src/functions/linear/sync-issues.d.ts.map +0 -1
  355. package/dist/types/src/functions/research/document-create.d.ts.map +0 -1
  356. package/dist/types/src/functions/research/index.d.ts.map +0 -1
  357. package/dist/types/src/functions/research/research-graph.d.ts +0 -18
  358. package/dist/types/src/functions/research/research-graph.d.ts.map +0 -1
  359. package/dist/types/src/functions/research/research.d.ts.map +0 -1
  360. package/dist/types/src/functions/research/research.test.d.ts.map +0 -1
  361. package/dist/types/src/functions/research/types.d.ts +0 -6
  362. package/dist/types/src/functions/research/types.d.ts.map +0 -1
  363. package/dist/types/src/functions/tasks/index.d.ts +0 -15
  364. package/dist/types/src/functions/tasks/index.d.ts.map +0 -1
  365. package/dist/types/src/functions/tasks/read.d.ts +0 -7
  366. package/dist/types/src/functions/tasks/read.d.ts.map +0 -1
  367. package/dist/types/src/functions/tasks/task-list.d.ts.map +0 -1
  368. package/dist/types/src/functions/tasks/task-list.test.d.ts.map +0 -1
  369. package/dist/types/src/functions/tasks/update.d.ts +0 -9
  370. package/dist/types/src/functions/tasks/update.d.ts.map +0 -1
  371. package/dist/types/src/plugins.d.ts +0 -19
  372. package/dist/types/src/plugins.d.ts.map +0 -1
  373. package/dist/types/src/testing/data/exa-search-1748337321991.d.ts.map +0 -1
  374. package/dist/types/src/testing/data/exa-search-1748337331526.d.ts.map +0 -1
  375. package/dist/types/src/testing/data/exa-search-1748337344119.d.ts.map +0 -1
  376. package/dist/types/src/testing/data/index.d.ts.map +0 -1
  377. package/dist/types/src/toolkits/AssistantToolkit.d.ts +0 -17
  378. package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +0 -1
  379. package/dist/types/src/toolkits/AssistantToolkit.test.d.ts +0 -2
  380. package/dist/types/src/toolkits/AssistantToolkit.test.d.ts.map +0 -1
  381. package/dist/types/src/toolkits/SystemToolkit.d.ts +0 -67
  382. package/dist/types/src/toolkits/SystemToolkit.d.ts.map +0 -1
  383. package/src/blueprints/discord/discord-blueprint.ts +0 -34
  384. package/src/blueprints/linear/linear-blueprint.ts +0 -35
  385. package/src/blueprints/websearch/websearch-blueprint.ts +0 -20
  386. package/src/experimental/feed.test.ts +0 -111
  387. package/src/functions/discord/index.ts +0 -9
  388. package/src/functions/document/index.ts +0 -12
  389. package/src/functions/document/read.ts +0 -29
  390. package/src/functions/linear/index.ts +0 -9
  391. package/src/functions/linear/linear.test.ts +0 -83
  392. package/src/functions/research/index.ts +0 -14
  393. package/src/functions/research/research-graph.ts +0 -49
  394. package/src/functions/research/research.conversations.json +0 -1
  395. package/src/functions/tasks/index.ts +0 -11
  396. package/src/toolkits/AssistantToolkit.conversations.json +0 -1
  397. package/src/toolkits/AssistantToolkit.test.ts +0 -88
  398. package/src/toolkits/AssistantToolkit.ts +0 -47
  399. package/src/toolkits/SystemToolkit.ts +0 -231
  400. /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.d.ts +0 -0
  401. /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.d.ts +0 -0
  402. /package/dist/types/src/{functions/github → blueprints/github/functions}/fetch-prs.d.ts +0 -0
  403. /package/dist/types/src/{functions/linear → blueprints/linear/functions}/linear.test.d.ts +0 -0
  404. /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.d.ts +0 -0
  405. /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.d.ts +0 -0
  406. /package/dist/types/src/{functions/research → blueprints/research/functions}/research.test.d.ts +0 -0
  407. /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337321991.d.ts +0 -0
  408. /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337331526.d.ts +0 -0
  409. /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337344119.d.ts +0 -0
  410. /package/dist/types/src/{testing → functions/exa}/data/index.d.ts +0 -0
  411. /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.ts +0 -0
  412. /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.ts +0 -0
  413. /package/src/blueprints/research/{research-blueprint.test.ts → blueprint.test.ts} +0 -0
  414. /package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +0 -0
  415. /package/src/{testing → functions/exa}/data/exa-search-1748337321991.ts +0 -0
  416. /package/src/{testing → functions/exa}/data/exa-search-1748337331526.ts +0 -0
  417. /package/src/{testing → functions/exa}/data/exa-search-1748337344119.ts +0 -0
  418. /package/src/{testing → functions/exa}/data/index.ts +0 -0
@@ -1,67 +0,0 @@
1
- import * as Tool from '@effect/ai/Tool';
2
- import * as Toolkit from '@effect/ai/Toolkit';
3
- import type * as Layer from 'effect/Layer';
4
- import * as Schema from 'effect/Schema';
5
- import { DatabaseService } from '@dxos/functions';
6
- export declare const SystemToolkit: Toolkit.Toolkit<{
7
- readonly "schema-list": Tool.Tool<"schema-list", {
8
- readonly parameters: Schema.Struct<{
9
- limit: typeof Schema.Number;
10
- }>;
11
- readonly success: typeof Schema.Any;
12
- readonly failure: typeof Schema.Never;
13
- }, DatabaseService>;
14
- readonly "schema-add": Tool.Tool<"schema-add", {
15
- readonly parameters: Schema.Struct<{
16
- name: typeof Schema.String;
17
- typename: typeof Schema.String;
18
- jsonSchema: typeof Schema.Any;
19
- }>;
20
- readonly success: typeof Schema.Any;
21
- readonly failure: typeof Schema.Never;
22
- }, DatabaseService>;
23
- readonly "object-create": Tool.Tool<"object-create", {
24
- readonly parameters: Schema.Struct<{
25
- typename: typeof Schema.String;
26
- data: typeof Schema.Any;
27
- }>;
28
- readonly success: typeof Schema.Any;
29
- readonly failure: typeof Schema.Never;
30
- }, DatabaseService>;
31
- readonly "object-remove": Tool.Tool<"object-remove", {
32
- readonly parameters: Schema.Struct<{
33
- id: Schema.Schema<string, string, never>;
34
- }>;
35
- readonly success: typeof Schema.Any;
36
- readonly failure: typeof Schema.Never;
37
- }, DatabaseService>;
38
- readonly "relation-create": Tool.Tool<"relation-create", {
39
- readonly parameters: Schema.Struct<{
40
- typename: typeof Schema.String;
41
- source: Schema.Schema<string, string, never>;
42
- target: Schema.Schema<string, string, never>;
43
- data: Schema.SchemaClass<any, any, never>;
44
- }>;
45
- readonly success: typeof Schema.Any;
46
- readonly failure: typeof Schema.Never;
47
- }, DatabaseService>;
48
- readonly "tag-add": Tool.Tool<"tag-add", {
49
- readonly parameters: Schema.Struct<{
50
- tagId: Schema.Schema<string, string, never>;
51
- objectId: Schema.Schema<string, string, never>;
52
- }>;
53
- readonly success: typeof Schema.Any;
54
- readonly failure: typeof Schema.Never;
55
- }, DatabaseService>;
56
- readonly "tag-remove": Tool.Tool<"tag-remove", {
57
- readonly parameters: Schema.Struct<{
58
- tagId: Schema.Schema<string, string, never>;
59
- objectId: Schema.Schema<string, string, never>;
60
- }>;
61
- readonly success: typeof Schema.Any;
62
- readonly failure: typeof Schema.Never;
63
- }, DatabaseService>;
64
- }>;
65
- export declare const tools: ("schema-list" | "schema-add" | "object-create" | "object-remove" | "relation-create" | "tag-add" | "tag-remove")[];
66
- export declare const layer: () => Layer.Layer<Tool.Handler<any>, never, never>;
67
- //# sourceMappingURL=SystemToolkit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SystemToolkit.d.ts","sourceRoot":"","sources":["../../../../src/toolkits/SystemToolkit.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoIzB,CAAC;AAEF,eAAO,MAAM,KAAK,qHAAmC,CAAC;AAEtD,eAAO,MAAM,KAAK,QAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,CA8EhE,CAAC"}
@@ -1,34 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { ToolId } from '@dxos/ai';
6
- import { Blueprint } from '@dxos/blueprints';
7
- import { Obj, Ref } from '@dxos/echo';
8
- import { Text } from '@dxos/schema';
9
- import { trim } from '@dxos/util';
10
-
11
- import { Discord } from '../../functions';
12
-
13
- /**
14
- * Agent prompt instructions for managing hierarchical task lists.
15
- */
16
- const instructions = trim`
17
- You are able to fetch messages from Discord servers.
18
-
19
- Known servers:
20
-
21
- DXOS serverId: 837138313172353095
22
- `;
23
-
24
- export const blueprint = Obj.make(Blueprint.Blueprint, {
25
- key: 'dxos.org/blueprint/discord',
26
- name: 'Discord',
27
- description: 'Discord integration.',
28
- instructions: {
29
- source: Ref.make(Text.make(instructions)),
30
- },
31
- tools: [ToolId.make(Discord.fetch.key)],
32
- });
33
-
34
- export default blueprint;
@@ -1,35 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { ToolId } from '@dxos/ai';
6
- import { Blueprint } from '@dxos/blueprints';
7
- import { Obj, Ref } from '@dxos/echo';
8
- import { Text } from '@dxos/schema';
9
- import { trim } from '@dxos/util';
10
-
11
- import { Linear } from '../../functions';
12
-
13
- /**
14
- * Agent prompt instructions for managing hierarchical task lists.
15
- */
16
- const instructions = trim`
17
- You are able to sync Linear workspaces.
18
- Sometimes sync does not complete in one go and you need to call the function again.
19
-
20
- Known workspaces:
21
-
22
- DXOS teamId: 1127c63a-6f77-4725-9229-50f6cd47321c
23
- `;
24
-
25
- export const blueprint = Obj.make(Blueprint.Blueprint, {
26
- key: 'dxos.org/blueprint/linear',
27
- name: 'Linear',
28
- description: 'Syncs Linear workspaces.',
29
- instructions: {
30
- source: Ref.make(Text.make(instructions)),
31
- },
32
- tools: [Linear.sync].map((tool) => ToolId.make(tool.key)),
33
- });
34
-
35
- export default blueprint;
@@ -1,20 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { ToolId } from '@dxos/ai';
6
- import { Blueprint } from '@dxos/blueprints';
7
- import { Obj, Ref } from '@dxos/echo';
8
- import { Text } from '@dxos/schema';
9
-
10
- const blueprint: Blueprint.Blueprint = Obj.make(Blueprint.Blueprint, {
11
- key: 'dxos.org/blueprint/web-search',
12
- name: 'Web Search',
13
- description: 'Search the web.',
14
- instructions: {
15
- source: Ref.make(Text.make()),
16
- },
17
- tools: [ToolId.make('AnthropicWebSearch')],
18
- });
19
-
20
- export default blueprint;
@@ -1,111 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Toolkit from '@effect/ai/Toolkit';
6
- import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
7
- import { describe, it } from '@effect/vitest';
8
- import * as Config from 'effect/Config';
9
- import * as Effect from 'effect/Effect';
10
- import * as Layer from 'effect/Layer';
11
- import * as Redacted from 'effect/Redacted';
12
-
13
- import { AiService } from '@dxos/ai';
14
- import { AiServiceTestingPreset, EXA_API_KEY } from '@dxos/ai/testing';
15
- import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
16
- import { TestHelpers } from '@dxos/effect';
17
- import { CredentialsService, FunctionInvocationService } from '@dxos/functions';
18
- import { TracingServiceExt } from '@dxos/functions-runtime';
19
- import {
20
- FunctionInvocationServiceLayerTestMocked,
21
- TestDatabaseLayer,
22
- testStoragePath,
23
- } from '@dxos/functions-runtime/testing';
24
-
25
- import { Discord, Linear } from '../functions';
26
-
27
- const TestLayer = Layer.mergeAll(
28
- AiService.model('@anthropic/claude-opus-4-0'),
29
- makeToolResolverFromFunctions([], Toolkit.make()),
30
- makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
31
- ).pipe(
32
- Layer.provideMerge(
33
- Layer.mergeAll(
34
- AiServiceTestingPreset('direct'),
35
- TestDatabaseLayer({
36
- indexing: { vector: true },
37
- types: [],
38
- storagePath: testStoragePath({ name: 'feed-test' }),
39
- }),
40
- CredentialsService.layerConfig([
41
- { service: 'exa.ai', apiKey: Config.succeed(Redacted.make(EXA_API_KEY)) },
42
- { service: 'discord.com', apiKey: Config.redacted('DISCORD_TOKEN') },
43
- { service: 'linear.app', apiKey: Config.redacted('LINEAR_API_KEY') },
44
- ]),
45
- FunctionInvocationServiceLayerTestMocked({ functions: [Linear.sync, Discord.fetch] }).pipe(
46
- Layer.provideMerge(TracingServiceExt.layerLogInfo()),
47
- ),
48
- FetchHttpClient.layer,
49
- ),
50
- ),
51
- );
52
-
53
- describe('Feed', { timeout: 600_000 }, () => {
54
- it.effect(
55
- 'fetch discord messages',
56
- Effect.fnUntraced(
57
- function* (_) {
58
- // const messages = yield* LocalFunctionExecutionService.invokeFunction(fetchDiscordMessages, {
59
- // serverId: '837138313172353095',
60
- // // channelId: '1404487604761526423',
61
- // after: Date.now() / 1000 - 128 * 3600,
62
- // });
63
- // for (const message of messages) {
64
- // console.log(message.sender.name, message.blocks.find((block) => block._tag === 'text')?.text);
65
- // }
66
- // console.log(`Fetched ${messages.length} messages`);
67
-
68
- // const result = yield* AiSession.run({
69
- // history: [
70
- // Obj.make(Message.Message, {
71
- // created: new Date().toISOString(),
72
- // sender: { role: 'user' },
73
- // blocks: messages
74
- // .map(
75
- // (message) =>
76
- // ({
77
- // _tag: 'text',
78
- // text: message.sender.name + ': ' + message.blocks.find((block) => block._tag === 'text')?.text,
79
- // }) as const,
80
- // )
81
- // .filter((block) => block._tag === 'text' && block.text.trim().length > 0),
82
- // }),
83
- // ],
84
- // prompt: 'Summarize the messages.',
85
- // system: 'Summarize the messages.',
86
- // }).pipe(Effect.provide(AiService.model('@anthropic/claude-3-5-haiku-latest')));
87
- // console.log(result);
88
-
89
- const linearIssues = yield* FunctionInvocationService.invokeFunction(Linear.sync, {
90
- team: '1127c63a-6f77-4725-9229-50f6cd47321c',
91
- });
92
- console.log(linearIssues);
93
-
94
- // const result = yield* AiSession.run({
95
- // history: [
96
- // Obj.make(Message.Message, {
97
- // created: new Date().toISOString(),
98
- // sender: { role: 'user' },
99
- // blocks: [{ _tag: 'text', text: JSON.stringify(linearIssues) }],
100
- // }),
101
- // ],
102
- // prompt: 'Summarize the whats new.',
103
- // system: 'Summarize the whats new. Reference specific people by name.',
104
- // }).pipe(Effect.provide(AiService.model('@anthropic/claude-sonnet-4-0')));
105
- // console.log(result.at(-1)?.blocks.find((block) => block._tag === 'text')?.text);
106
- },
107
- Effect.provide(TestLayer),
108
- TestHelpers.taggedTest('llm'),
109
- ),
110
- );
111
- });
@@ -1,9 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { default as fetch$ } from './fetch-messages';
6
-
7
- export namespace Discord {
8
- export const fetch = fetch$;
9
- }
@@ -1,12 +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
- /** @deprecated */
9
- export namespace Document {
10
- export const read = read$;
11
- export const update = update$;
12
- }
@@ -1,29 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
- import * as Schema from 'effect/Schema';
7
-
8
- import { ArtifactId } from '@dxos/assistant';
9
- import { DatabaseService, defineFunction } from '@dxos/functions';
10
- import { Markdown } from '@dxos/plugin-markdown/types';
11
-
12
- export default defineFunction({
13
- key: 'dxos.org/function/markdown/read',
14
- name: 'Read markdown document',
15
- description: 'Read markdown document.',
16
- inputSchema: Schema.Struct({
17
- id: ArtifactId.annotations({
18
- description: 'The ID of the document to read.',
19
- }),
20
- }),
21
- outputSchema: Schema.Struct({
22
- content: Schema.String,
23
- }),
24
- handler: Effect.fn(function* ({ data: { id } }) {
25
- const doc = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Markdown.Document);
26
- const { content } = yield* DatabaseService.load(doc.content);
27
- return { content };
28
- }),
29
- });
@@ -1,9 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { default as sync$ } from './sync-issues';
6
-
7
- export namespace Linear {
8
- export const sync = sync$;
9
- }
@@ -1,83 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Toolkit from '@effect/ai/Toolkit';
6
- import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
7
- import { describe, it } from '@effect/vitest';
8
- import * as Config from 'effect/Config';
9
- import * as Effect from 'effect/Effect';
10
- import * as Layer from 'effect/Layer';
11
-
12
- import { AiService } from '@dxos/ai';
13
- import { AiServiceTestingPreset } from '@dxos/ai/testing';
14
- import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
15
- import { Obj, Query } from '@dxos/echo';
16
- import { TestHelpers } from '@dxos/effect';
17
- import { CredentialsService, DatabaseService, FunctionInvocationService } from '@dxos/functions';
18
- import { TracingServiceExt } from '@dxos/functions-runtime';
19
- import {
20
- FunctionInvocationServiceLayerTestMocked,
21
- TestDatabaseLayer,
22
- testStoragePath,
23
- } from '@dxos/functions-runtime/testing';
24
- import { Person, Project, Task } from '@dxos/types';
25
-
26
- import { LINEAR_ID_KEY, default as fetchLinearIssues } from './sync-issues';
27
-
28
- const TestLayer = Layer.mergeAll(
29
- AiService.model('@anthropic/claude-opus-4-0'),
30
- makeToolResolverFromFunctions([], Toolkit.make()),
31
- makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
32
- ).pipe(
33
- Layer.provideMerge(
34
- Layer.mergeAll(
35
- AiServiceTestingPreset('direct'),
36
- TestDatabaseLayer({
37
- // indexing: { vector: true },
38
- types: [Task.Task, Person.Person, Project.Project],
39
- storagePath: testStoragePath({ name: 'feed-test-13' }),
40
- }),
41
- CredentialsService.layerConfig([{ service: 'linear.app', apiKey: Config.redacted('LINEAR_API_KEY') }]),
42
- FunctionInvocationServiceLayerTestMocked({ functions: [fetchLinearIssues] }).pipe(
43
- Layer.provideMerge(TracingServiceExt.layerLogInfo()),
44
- ),
45
- FetchHttpClient.layer,
46
- ),
47
- ),
48
- );
49
-
50
- describe('Linear', { timeout: 600_000 }, () => {
51
- it.effect(
52
- 'sync',
53
- Effect.fnUntraced(
54
- function* (_) {
55
- yield* DatabaseService.flush({ indexes: true });
56
-
57
- yield* FunctionInvocationService.invokeFunction(fetchLinearIssues, {
58
- team: '1127c63a-6f77-4725-9229-50f6cd47321c',
59
- });
60
-
61
- const { objects: persons } = yield* DatabaseService.runQuery(Query.type(Person.Person));
62
- console.log('people', {
63
- count: persons.length,
64
- people: persons.map((_) => `(${_.id}) ${Obj.getLabel(_)} [${Obj.getKeys(_, LINEAR_ID_KEY)[0]?.id}]`),
65
- });
66
- const { objects: projects } = yield* DatabaseService.runQuery(Query.type(Project.Project));
67
- console.log('projects', {
68
- count: projects.length,
69
- projects: projects.map((_) => `(${_.id}) ${Obj.getLabel(_)} [${Obj.getKeys(_, LINEAR_ID_KEY)[0]?.id}]`),
70
- });
71
- const { objects: tasks } = yield* DatabaseService.runQuery(Query.type(Task.Task));
72
- console.log('tasks', {
73
- count: tasks.length,
74
- tasks: tasks.map((_) => `(${_.id}) ${Obj.getLabel(_)} [${Obj.getKeys(_, LINEAR_ID_KEY)[0]?.id}]`),
75
- });
76
-
77
- yield* DatabaseService.flush({ indexes: true });
78
- },
79
- Effect.provide(TestLayer),
80
- TestHelpers.taggedTest('sync'),
81
- ),
82
- );
83
- });
@@ -1,14 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { default as create$ } from './document-create';
6
- import { default as research$ } from './research';
7
-
8
- export * from './research-graph';
9
- export * from './types';
10
-
11
- export namespace Research {
12
- export const create = create$;
13
- export const research = research$;
14
- }
@@ -1,49 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
- import * as Layer from 'effect/Layer';
7
- import * as Schema from 'effect/Schema';
8
-
9
- import { Obj, Query, Ref, Type } from '@dxos/echo';
10
- import { SystemTypeAnnotation } from '@dxos/echo/internal';
11
- import { Queue } from '@dxos/echo-db';
12
- import { ContextQueueService, DatabaseService, QueueService } from '@dxos/functions';
13
-
14
- /**
15
- * Container for a set of ephemeral research results.
16
- */
17
- export const ResearchGraph = Schema.Struct({
18
- queue: Type.Ref(Queue),
19
- }).pipe(
20
- Type.Obj({
21
- typename: 'dxos.org/type/ResearchGraph',
22
- version: '0.1.0',
23
- }),
24
- SystemTypeAnnotation.set(true),
25
- );
26
-
27
- export interface ResearchGraph extends Schema.Schema.Type<typeof ResearchGraph> {}
28
-
29
- export const queryResearchGraph: () => Effect.Effect<ResearchGraph | undefined, never, DatabaseService> = Effect.fn(
30
- 'queryResearchGraph',
31
- )(function* () {
32
- const { objects } = yield* DatabaseService.runQuery(Query.type(ResearchGraph));
33
- return objects.at(0);
34
- });
35
-
36
- export const createResearchGraph: () => Effect.Effect<ResearchGraph, never, DatabaseService | QueueService> = Effect.fn(
37
- 'createResearchGraph',
38
- )(function* () {
39
- const queue = yield* QueueService.createQueue();
40
- return yield* DatabaseService.add(Obj.make(ResearchGraph, { queue: Ref.fromDXN(queue.dxn) }));
41
- });
42
-
43
- export const contextQueueLayerFromResearchGraph = Layer.unwrapEffect(
44
- Effect.gen(function* () {
45
- const researchGraph = (yield* queryResearchGraph()) ?? (yield* createResearchGraph());
46
- const researchQueue = yield* DatabaseService.load(researchGraph.queue);
47
- return ContextQueueService.layer(researchQueue);
48
- }),
49
- );