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

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 (571) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/neutral/add-artifact-4IVGW6CI.mjs +30 -0
  3. package/dist/lib/neutral/add-artifact-4IVGW6CI.mjs.map +7 -0
  4. package/dist/lib/neutral/agent-F4L7UXME.mjs +65 -0
  5. package/dist/lib/neutral/agent-F4L7UXME.mjs.map +7 -0
  6. package/dist/lib/neutral/chunk-5GPL2WXU.mjs +292 -0
  7. package/dist/lib/neutral/chunk-5GPL2WXU.mjs.map +7 -0
  8. package/dist/lib/neutral/chunk-7UCYAP3T.mjs +332 -0
  9. package/dist/lib/neutral/chunk-7UCYAP3T.mjs.map +7 -0
  10. package/dist/lib/neutral/chunk-ANSF2BHN.mjs +67 -0
  11. package/dist/lib/neutral/chunk-ANSF2BHN.mjs.map +7 -0
  12. package/dist/lib/neutral/chunk-BCT55UTL.mjs +75 -0
  13. package/dist/lib/neutral/chunk-BCT55UTL.mjs.map +7 -0
  14. package/dist/lib/neutral/chunk-COL54UJ3.mjs +60 -0
  15. package/dist/lib/neutral/chunk-COL54UJ3.mjs.map +7 -0
  16. package/dist/lib/neutral/chunk-EJAQUAKM.mjs +73 -0
  17. package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  19. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  20. package/dist/lib/neutral/chunk-KGU725LW.mjs +29 -0
  21. package/dist/lib/neutral/chunk-KGU725LW.mjs.map +7 -0
  22. package/dist/lib/neutral/chunk-KS3IA6FQ.mjs +101 -0
  23. package/dist/lib/neutral/chunk-KS3IA6FQ.mjs.map +7 -0
  24. package/dist/lib/neutral/chunk-MMQ7HFL4.mjs +107 -0
  25. package/dist/lib/neutral/chunk-MMQ7HFL4.mjs.map +7 -0
  26. package/dist/lib/neutral/chunk-NR3GTWRC.mjs +53 -0
  27. package/dist/lib/neutral/chunk-NR3GTWRC.mjs.map +7 -0
  28. package/dist/lib/neutral/chunk-PLGEBNTO.mjs +65 -0
  29. package/dist/lib/neutral/chunk-PLGEBNTO.mjs.map +7 -0
  30. package/dist/lib/neutral/chunk-W2722TC5.mjs +70 -0
  31. package/dist/lib/neutral/chunk-W2722TC5.mjs.map +7 -0
  32. package/dist/lib/neutral/chunk-WLR3BGO4.mjs +25 -0
  33. package/dist/lib/neutral/chunk-WLR3BGO4.mjs.map +7 -0
  34. package/dist/lib/neutral/chunk-ZFXLTBZG.mjs +73 -0
  35. package/dist/lib/neutral/chunk-ZFXLTBZG.mjs.map +7 -0
  36. package/dist/lib/neutral/context-add-S5MBW2NA.mjs +22 -0
  37. package/dist/lib/neutral/context-add-S5MBW2NA.mjs.map +7 -0
  38. package/dist/lib/neutral/context-remove-35O5T5N5.mjs +22 -0
  39. package/dist/lib/neutral/context-remove-35O5T5N5.mjs.map +7 -0
  40. package/dist/lib/neutral/create-project-3AGXJ4TD.mjs +35 -0
  41. package/dist/lib/neutral/create-project-3AGXJ4TD.mjs.map +7 -0
  42. package/dist/lib/neutral/delete-J3PMWP7Z.mjs +19 -0
  43. package/dist/lib/neutral/delete-J3PMWP7Z.mjs.map +7 -0
  44. package/dist/lib/neutral/enable-blueprints-IVKST3WH.mjs +47 -0
  45. package/dist/lib/neutral/enable-blueprints-IVKST3WH.mjs.map +7 -0
  46. package/dist/lib/neutral/fetch-KHMHV7JR.mjs +16 -0
  47. package/dist/lib/neutral/fetch-KHMHV7JR.mjs.map +7 -0
  48. package/dist/lib/neutral/fetch-messages-QOBBCTGC.mjs +139 -0
  49. package/dist/lib/neutral/fetch-messages-QOBBCTGC.mjs.map +7 -0
  50. package/dist/lib/neutral/get-context-FBYWIP72.mjs +35 -0
  51. package/dist/lib/neutral/get-context-FBYWIP72.mjs.map +7 -0
  52. package/dist/lib/neutral/index.mjs +914 -0
  53. package/dist/lib/neutral/index.mjs.map +7 -0
  54. package/dist/lib/neutral/load-GAT3T2AD.mjs +17 -0
  55. package/dist/lib/neutral/load-GAT3T2AD.mjs.map +7 -0
  56. package/dist/lib/neutral/meta.json +1 -0
  57. package/dist/lib/neutral/object-create-PL3WRP74.mjs +35 -0
  58. package/dist/lib/neutral/object-create-PL3WRP74.mjs.map +7 -0
  59. package/dist/lib/neutral/object-delete-PZJQN5KW.mjs +18 -0
  60. package/dist/lib/neutral/object-delete-PZJQN5KW.mjs.map +7 -0
  61. package/dist/lib/neutral/object-update-R43N3VJX.mjs +28 -0
  62. package/dist/lib/neutral/object-update-R43N3VJX.mjs.map +7 -0
  63. package/dist/lib/neutral/project-VVXXUMAI.mjs +23 -0
  64. package/dist/lib/neutral/project-VVXXUMAI.mjs.map +7 -0
  65. package/dist/lib/neutral/project-rules-KSVSOZJV.mjs +78 -0
  66. package/dist/lib/neutral/project-rules-KSVSOZJV.mjs.map +7 -0
  67. package/dist/lib/neutral/prompt-INL55Q2B.mjs +170 -0
  68. package/dist/lib/neutral/prompt-INL55Q2B.mjs.map +7 -0
  69. package/dist/lib/neutral/qualifier-DAF4H7V3.mjs +88 -0
  70. package/dist/lib/neutral/qualifier-DAF4H7V3.mjs.map +7 -0
  71. package/dist/lib/neutral/query-MP5NSQKO.mjs +69 -0
  72. package/dist/lib/neutral/query-MP5NSQKO.mjs.map +7 -0
  73. package/dist/lib/neutral/query-U56GNEV6.mjs +32 -0
  74. package/dist/lib/neutral/query-U56GNEV6.mjs.map +7 -0
  75. package/dist/lib/neutral/query-blueprints-PLWYVOI3.mjs +16 -0
  76. package/dist/lib/neutral/query-blueprints-PLWYVOI3.mjs.map +7 -0
  77. package/dist/lib/neutral/relation-create-YAAAFTR2.mjs +34 -0
  78. package/dist/lib/neutral/relation-create-YAAAFTR2.mjs.map +7 -0
  79. package/dist/lib/neutral/relation-delete-IEPKERFR.mjs +18 -0
  80. package/dist/lib/neutral/relation-delete-IEPKERFR.mjs.map +7 -0
  81. package/dist/lib/neutral/save-GWAPLT3Z.mjs +23 -0
  82. package/dist/lib/neutral/save-GWAPLT3Z.mjs.map +7 -0
  83. package/dist/lib/neutral/schema-add-5BNIINRS.mjs +24 -0
  84. package/dist/lib/neutral/schema-add-5BNIINRS.mjs.map +7 -0
  85. package/dist/lib/neutral/schema-list-54UK7S4R.mjs +38 -0
  86. package/dist/lib/neutral/schema-list-54UK7S4R.mjs.map +7 -0
  87. package/dist/lib/neutral/sync-issues-DWY76B3M.mjs +166 -0
  88. package/dist/lib/neutral/sync-issues-DWY76B3M.mjs.map +7 -0
  89. package/dist/lib/neutral/sync-triggers-NOIQLELD.mjs +135 -0
  90. package/dist/lib/neutral/sync-triggers-NOIQLELD.mjs.map +7 -0
  91. package/dist/lib/neutral/tag-add-NLVRGTC6.mjs +19 -0
  92. package/dist/lib/neutral/tag-add-NLVRGTC6.mjs.map +7 -0
  93. package/dist/lib/neutral/tag-remove-N4HFBIA2.mjs +19 -0
  94. package/dist/lib/neutral/tag-remove-N4HFBIA2.mjs.map +7 -0
  95. package/dist/lib/neutral/testing/index.mjs +76 -0
  96. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  97. package/dist/lib/neutral/update-blueprints-2SNK6HLG.mjs +16 -0
  98. package/dist/lib/neutral/update-blueprints-2SNK6HLG.mjs.map +7 -0
  99. package/dist/lib/neutral/update-tasks-QQUR53RN.mjs +13 -0
  100. package/dist/lib/neutral/update-tasks-QQUR53RN.mjs.map +7 -0
  101. package/dist/types/src/blueprints/automation/blueprint.d.ts +4 -0
  102. package/dist/types/src/blueprints/automation/blueprint.d.ts.map +1 -0
  103. package/dist/types/src/blueprints/automation/index.d.ts +2 -0
  104. package/dist/types/src/blueprints/automation/index.d.ts.map +1 -0
  105. package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts +4 -0
  106. package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts.map +1 -0
  107. package/dist/types/src/blueprints/blueprint-manager/blueprint.test.d.ts +2 -0
  108. package/dist/types/src/blueprints/blueprint-manager/blueprint.test.d.ts.map +1 -0
  109. package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts +61 -0
  110. package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +1 -0
  111. package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts +36 -0
  112. package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +1 -0
  113. package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts +4 -0
  114. package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +1 -0
  115. package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts +27 -0
  116. package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +1 -0
  117. package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +4 -0
  118. package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts.map +1 -0
  119. package/dist/types/src/blueprints/blueprint-manager/index.d.ts +3 -0
  120. package/dist/types/src/blueprints/blueprint-manager/index.d.ts.map +1 -0
  121. package/dist/types/src/blueprints/browser/blueprint.d.ts +4 -0
  122. package/dist/types/src/blueprints/browser/blueprint.d.ts.map +1 -0
  123. package/dist/types/src/blueprints/browser/blueprint.test.d.ts +2 -0
  124. package/dist/types/src/blueprints/browser/blueprint.test.d.ts.map +1 -0
  125. package/dist/types/src/blueprints/browser/index.d.ts +2 -0
  126. package/dist/types/src/blueprints/browser/index.d.ts.map +1 -0
  127. package/dist/types/src/blueprints/database/blueprint.d.ts +4 -0
  128. package/dist/types/src/blueprints/database/blueprint.d.ts.map +1 -0
  129. package/dist/types/src/blueprints/database/blueprint.test.d.ts +2 -0
  130. package/dist/types/src/blueprints/database/blueprint.test.d.ts.map +1 -0
  131. package/dist/types/src/blueprints/database/functions/context-add.d.ts +7 -0
  132. package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -0
  133. package/dist/types/src/blueprints/database/functions/context-remove.d.ts +7 -0
  134. package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -0
  135. package/dist/types/src/blueprints/database/functions/definitions.d.ts +59 -0
  136. package/dist/types/src/blueprints/database/functions/definitions.d.ts.map +1 -0
  137. package/dist/types/src/blueprints/database/functions/index.d.ts +4 -0
  138. package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -0
  139. package/dist/types/src/blueprints/database/functions/load.d.ts +7 -0
  140. package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -0
  141. package/dist/types/src/blueprints/database/functions/object-create.d.ts +8 -0
  142. package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +1 -0
  143. package/dist/types/src/blueprints/database/functions/object-delete.d.ts +7 -0
  144. package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +1 -0
  145. package/dist/types/src/blueprints/database/functions/object-update.d.ts +10 -0
  146. package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -0
  147. package/dist/types/src/blueprints/database/functions/query.d.ts +12 -0
  148. package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -0
  149. package/dist/types/src/blueprints/database/functions/relation-create.d.ts +10 -0
  150. package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -0
  151. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +7 -0
  152. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +1 -0
  153. package/dist/types/src/blueprints/database/functions/schema-add.d.ts +9 -0
  154. package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +1 -0
  155. package/dist/types/src/blueprints/database/functions/schema-list.d.ts +7 -0
  156. package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -0
  157. package/dist/types/src/blueprints/database/functions/tag-add.d.ts +8 -0
  158. package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -0
  159. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +8 -0
  160. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -0
  161. package/dist/types/src/blueprints/database/index.d.ts +3 -0
  162. package/dist/types/src/blueprints/database/index.d.ts.map +1 -0
  163. package/dist/types/src/blueprints/discord/blueprint.d.ts +4 -0
  164. package/dist/types/src/blueprints/discord/blueprint.d.ts.map +1 -0
  165. package/dist/types/src/blueprints/discord/functions/definitions.d.ts +15 -0
  166. package/dist/types/src/blueprints/discord/functions/definitions.d.ts.map +1 -0
  167. package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.d.ts +3 -2
  168. package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +1 -0
  169. package/dist/types/src/blueprints/discord/functions/fetch-messages.test.d.ts.map +1 -0
  170. package/dist/types/src/blueprints/discord/functions/index.d.ts +4 -0
  171. package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -0
  172. package/dist/types/src/blueprints/discord/index.d.ts +2 -2
  173. package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
  174. package/dist/types/src/blueprints/github/functions/definitions.d.ts +7 -0
  175. package/dist/types/src/blueprints/github/functions/definitions.d.ts.map +1 -0
  176. package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts +8 -0
  177. package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -0
  178. package/dist/types/src/blueprints/github/functions/index.d.ts +4 -0
  179. package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -0
  180. package/dist/types/src/blueprints/github/index.d.ts +2 -0
  181. package/dist/types/src/blueprints/github/index.d.ts.map +1 -0
  182. package/dist/types/src/blueprints/index.d.ts +11 -6
  183. package/dist/types/src/blueprints/index.d.ts.map +1 -1
  184. package/dist/types/src/blueprints/linear/blueprint.d.ts +4 -0
  185. package/dist/types/src/blueprints/linear/blueprint.d.ts.map +1 -0
  186. package/dist/types/src/blueprints/linear/functions/definitions.d.ts +6 -0
  187. package/dist/types/src/blueprints/linear/functions/definitions.d.ts.map +1 -0
  188. package/dist/types/src/blueprints/linear/functions/index.d.ts +4 -0
  189. package/dist/types/src/blueprints/linear/functions/index.d.ts.map +1 -0
  190. package/dist/types/src/blueprints/linear/functions/linear.test.d.ts.map +1 -0
  191. package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts +10 -0
  192. package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -0
  193. package/dist/types/src/blueprints/linear/index.d.ts +2 -2
  194. package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
  195. package/dist/types/src/blueprints/memory/blueprint.d.ts +4 -0
  196. package/dist/types/src/blueprints/memory/blueprint.d.ts.map +1 -0
  197. package/dist/types/src/blueprints/memory/blueprint.test.d.ts +2 -0
  198. package/dist/types/src/blueprints/memory/blueprint.test.d.ts.map +1 -0
  199. package/dist/types/src/blueprints/memory/functions/definitions.d.ts +17 -0
  200. package/dist/types/src/blueprints/memory/functions/definitions.d.ts.map +1 -0
  201. package/dist/types/src/blueprints/memory/functions/delete.d.ts +10 -0
  202. package/dist/types/src/blueprints/memory/functions/delete.d.ts.map +1 -0
  203. package/dist/types/src/blueprints/memory/functions/index.d.ts +4 -0
  204. package/dist/types/src/blueprints/memory/functions/index.d.ts.map +1 -0
  205. package/dist/types/src/blueprints/memory/functions/query.d.ts +8 -0
  206. package/dist/types/src/blueprints/memory/functions/query.d.ts.map +1 -0
  207. package/dist/types/src/blueprints/memory/functions/save.d.ts +8 -0
  208. package/dist/types/src/blueprints/memory/functions/save.d.ts.map +1 -0
  209. package/dist/types/src/blueprints/memory/index.d.ts +3 -0
  210. package/dist/types/src/blueprints/memory/index.d.ts.map +1 -0
  211. package/dist/types/src/blueprints/planning/blueprint.d.ts +4 -0
  212. package/dist/types/src/blueprints/planning/blueprint.d.ts.map +1 -0
  213. package/dist/types/src/blueprints/planning/functions/index.d.ts +4 -0
  214. package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -0
  215. package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +24 -0
  216. package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -0
  217. package/dist/types/src/blueprints/planning/functions/update-tasks.test.d.ts +2 -0
  218. package/dist/types/src/blueprints/planning/functions/update-tasks.test.d.ts.map +1 -0
  219. package/dist/types/src/blueprints/planning/index.d.ts +2 -2
  220. package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
  221. package/dist/types/src/blueprints/project/blueprint.d.ts +4 -0
  222. package/dist/types/src/blueprints/project/blueprint.d.ts.map +1 -0
  223. package/dist/types/src/blueprints/project/blueprint.test.d.ts +2 -0
  224. package/dist/types/src/blueprints/project/blueprint.test.d.ts.map +1 -0
  225. package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +4 -0
  226. package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -0
  227. package/dist/types/src/blueprints/project/functions/agent.d.ts +4 -0
  228. package/dist/types/src/blueprints/project/functions/agent.d.ts.map +1 -0
  229. package/dist/types/src/blueprints/project/functions/definitions.d.ts +166 -0
  230. package/dist/types/src/blueprints/project/functions/definitions.d.ts.map +1 -0
  231. package/dist/types/src/blueprints/project/functions/get-context.d.ts +4 -0
  232. package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -0
  233. package/dist/types/src/blueprints/project/functions/index.d.ts +4 -0
  234. package/dist/types/src/blueprints/project/functions/index.d.ts.map +1 -0
  235. package/dist/types/src/blueprints/project/functions/qualifier.d.ts +77 -0
  236. package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -0
  237. package/dist/types/src/blueprints/project/index.d.ts +3 -0
  238. package/dist/types/src/blueprints/project/index.d.ts.map +1 -0
  239. package/dist/types/src/blueprints/project-wizard/blueprint.d.ts +4 -0
  240. package/dist/types/src/blueprints/project-wizard/blueprint.d.ts.map +1 -0
  241. package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +55 -0
  242. package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +1 -0
  243. package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +104 -0
  244. package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts.map +1 -0
  245. package/dist/types/src/blueprints/project-wizard/functions/index.d.ts +4 -0
  246. package/dist/types/src/blueprints/project-wizard/functions/index.d.ts.map +1 -0
  247. package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts +4 -0
  248. package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts.map +1 -0
  249. package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts +52 -0
  250. package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts.map +1 -0
  251. package/dist/types/src/blueprints/project-wizard/index.d.ts +3 -0
  252. package/dist/types/src/blueprints/project-wizard/index.d.ts.map +1 -0
  253. package/dist/types/src/blueprints/testing.d.ts +9 -5
  254. package/dist/types/src/blueprints/testing.d.ts.map +1 -1
  255. package/dist/types/src/blueprints/websearch/blueprint.d.ts +4 -0
  256. package/dist/types/src/blueprints/websearch/blueprint.d.ts.map +1 -0
  257. package/dist/types/src/blueprints/websearch/blueprint.test.d.ts +2 -0
  258. package/dist/types/src/blueprints/websearch/blueprint.test.d.ts.map +1 -0
  259. package/dist/types/src/blueprints/websearch/functions/definitions.d.ts +5 -0
  260. package/dist/types/src/blueprints/websearch/functions/definitions.d.ts.map +1 -0
  261. package/dist/types/src/blueprints/websearch/functions/fetch.d.ts +6 -0
  262. package/dist/types/src/blueprints/websearch/functions/fetch.d.ts.map +1 -0
  263. package/dist/types/src/blueprints/websearch/functions/index.d.ts +4 -0
  264. package/dist/types/src/blueprints/websearch/functions/index.d.ts.map +1 -0
  265. package/dist/types/src/blueprints/websearch/index.d.ts +3 -3
  266. package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
  267. package/dist/types/src/blueprints/websearch/{websearch-toolkit.d.ts → toolkit.d.ts} +4 -1
  268. package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
  269. package/dist/types/src/{functions/research → crud}/graph.d.ts +12 -11
  270. package/dist/types/src/crud/graph.d.ts.map +1 -0
  271. package/dist/types/src/crud/graph.test.d.ts.map +1 -0
  272. package/dist/types/src/crud/index.d.ts +2 -0
  273. package/dist/types/src/crud/index.d.ts.map +1 -0
  274. package/dist/types/src/errors.d.ts +41 -0
  275. package/dist/types/src/errors.d.ts.map +1 -0
  276. package/dist/types/src/functions/agent/definitions.d.ts +61 -0
  277. package/dist/types/src/functions/agent/definitions.d.ts.map +1 -0
  278. package/dist/types/src/functions/agent/index.d.ts +3 -4
  279. package/dist/types/src/functions/agent/index.d.ts.map +1 -1
  280. package/dist/types/src/functions/agent/prompt.d.ts +2 -9
  281. package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
  282. package/dist/types/src/functions/agent/prompt.test.d.ts +2 -0
  283. package/dist/types/src/functions/agent/prompt.test.d.ts.map +1 -0
  284. package/dist/types/src/functions/index.d.ts +0 -6
  285. package/dist/types/src/functions/index.d.ts.map +1 -1
  286. package/dist/types/src/index.d.ts +3 -1
  287. package/dist/types/src/index.d.ts.map +1 -1
  288. package/dist/types/src/sync/sync.d.ts +3 -4
  289. package/dist/types/src/sync/sync.d.ts.map +1 -1
  290. package/dist/types/src/testing/index.d.ts +2 -1
  291. package/dist/types/src/testing/index.d.ts.map +1 -1
  292. package/dist/types/src/testing/plugins.d.ts +19 -0
  293. package/dist/types/src/testing/plugins.d.ts.map +1 -0
  294. package/dist/types/src/toolkits/WebToolkit.d.ts +38 -0
  295. package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -0
  296. package/dist/types/src/toolkits/index.d.ts +2 -0
  297. package/dist/types/src/toolkits/index.d.ts.map +1 -0
  298. package/dist/types/src/types/Agent.d.ts +79 -0
  299. package/dist/types/src/types/Agent.d.ts.map +1 -0
  300. package/dist/types/src/types/Chat.d.ts +56 -0
  301. package/dist/types/src/types/Chat.d.ts.map +1 -0
  302. package/dist/types/src/types/McpServer.d.ts +21 -0
  303. package/dist/types/src/types/McpServer.d.ts.map +1 -0
  304. package/dist/types/src/types/Memory.d.ts +12 -0
  305. package/dist/types/src/types/Memory.d.ts.map +1 -0
  306. package/dist/types/src/types/Plan.d.ts +89 -0
  307. package/dist/types/src/types/Plan.d.ts.map +1 -0
  308. package/dist/types/src/types/index.d.ts +6 -0
  309. package/dist/types/src/types/index.d.ts.map +1 -0
  310. package/dist/types/src/util/graphql.d.ts.map +1 -1
  311. package/dist/types/tsconfig.tsbuildinfo +1 -1
  312. package/package.json +46 -39
  313. package/src/blueprints/automation/blueprint.ts +105 -0
  314. package/src/blueprints/automation/index.ts +5 -0
  315. package/src/blueprints/blueprint-manager/blueprint.conversations.json +1 -0
  316. package/src/blueprints/blueprint-manager/blueprint.test.ts +202 -0
  317. package/src/blueprints/blueprint-manager/blueprint.ts +49 -0
  318. package/src/blueprints/blueprint-manager/functions/definitions.ts +57 -0
  319. package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +43 -0
  320. package/src/blueprints/blueprint-manager/functions/index.ts +13 -0
  321. package/src/blueprints/blueprint-manager/functions/query-blueprints.ts +18 -0
  322. package/src/blueprints/blueprint-manager/functions/update-blueprints.ts +18 -0
  323. package/src/blueprints/blueprint-manager/index.ts +6 -0
  324. package/src/blueprints/browser/blueprint.test.ts +61 -0
  325. package/src/blueprints/browser/blueprint.ts +40 -0
  326. package/src/blueprints/browser/index.ts +5 -0
  327. package/src/blueprints/database/blueprint.conversations.json +1 -0
  328. package/src/blueprints/database/blueprint.test.ts +531 -0
  329. package/src/blueprints/database/blueprint.ts +66 -0
  330. package/src/blueprints/database/functions/context-add.ts +24 -0
  331. package/src/blueprints/database/functions/context-remove.ts +24 -0
  332. package/src/blueprints/database/functions/definitions.ts +318 -0
  333. package/src/blueprints/database/functions/index.ts +23 -0
  334. package/src/blueprints/database/functions/load.ts +19 -0
  335. package/src/blueprints/database/functions/object-create.ts +38 -0
  336. package/src/blueprints/database/functions/object-delete.ts +20 -0
  337. package/src/blueprints/database/functions/object-update.ts +30 -0
  338. package/src/blueprints/database/functions/query.ts +63 -0
  339. package/src/blueprints/database/functions/relation-create.ts +34 -0
  340. package/src/blueprints/database/functions/relation-delete.ts +21 -0
  341. package/src/blueprints/database/functions/schema-add.ts +28 -0
  342. package/src/blueprints/database/functions/schema-list.ts +33 -0
  343. package/src/blueprints/database/functions/tag-add.ts +21 -0
  344. package/src/blueprints/database/functions/tag-remove.ts +21 -0
  345. package/src/blueprints/database/index.ts +21 -0
  346. package/src/blueprints/discord/blueprint.ts +41 -0
  347. package/src/blueprints/discord/functions/definitions.ts +70 -0
  348. package/src/blueprints/discord/functions/fetch-messages.test.ts +50 -0
  349. package/src/blueprints/discord/functions/fetch-messages.ts +198 -0
  350. package/src/blueprints/discord/functions/index.ts +9 -0
  351. package/src/blueprints/discord/index.ts +2 -3
  352. package/src/blueprints/github/functions/definitions.ts +26 -0
  353. package/src/blueprints/github/functions/fetch-prs.ts +24 -0
  354. package/src/blueprints/github/functions/index.ts +9 -0
  355. package/src/blueprints/github/index.ts +5 -0
  356. package/src/blueprints/index.ts +11 -6
  357. package/src/blueprints/linear/blueprint.ts +42 -0
  358. package/src/blueprints/linear/functions/definitions.ts +23 -0
  359. package/src/blueprints/linear/functions/index.ts +9 -0
  360. package/src/blueprints/linear/functions/linear.test.ts +57 -0
  361. package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +44 -51
  362. package/src/blueprints/linear/index.ts +2 -3
  363. package/src/blueprints/memory/blueprint.conversations.json +1 -0
  364. package/src/blueprints/memory/blueprint.test.ts +139 -0
  365. package/src/blueprints/memory/blueprint.ts +41 -0
  366. package/src/blueprints/memory/functions/definitions.ts +68 -0
  367. package/src/blueprints/memory/functions/delete.ts +20 -0
  368. package/src/blueprints/memory/functions/index.ts +13 -0
  369. package/src/blueprints/memory/functions/query.ts +32 -0
  370. package/src/blueprints/memory/functions/save.ts +20 -0
  371. package/src/blueprints/memory/index.ts +6 -0
  372. package/src/blueprints/planning/blueprint.ts +24 -0
  373. package/src/blueprints/planning/functions/index.ts +9 -0
  374. package/src/blueprints/planning/functions/update-tasks.md +116 -0
  375. package/src/blueprints/planning/functions/update-tasks.test.ts +55 -0
  376. package/src/blueprints/planning/functions/update-tasks.ts +67 -0
  377. package/src/blueprints/planning/index.ts +3 -4
  378. package/src/blueprints/project/blueprint.conversations.json +1 -0
  379. package/src/blueprints/project/blueprint.test.ts +712 -0
  380. package/src/blueprints/project/blueprint.ts +64 -0
  381. package/src/blueprints/project/functions/add-artifact.ts +31 -0
  382. package/src/blueprints/project/functions/agent.ts +69 -0
  383. package/src/blueprints/project/functions/definitions.ts +92 -0
  384. package/src/blueprints/project/functions/get-context.ts +47 -0
  385. package/src/blueprints/project/functions/index.ts +14 -0
  386. package/src/blueprints/project/functions/qualifier.ts +90 -0
  387. package/src/blueprints/project/index.ts +6 -0
  388. package/src/blueprints/project-wizard/blueprint.ts +52 -0
  389. package/src/blueprints/project-wizard/functions/create-project.ts +32 -0
  390. package/src/blueprints/project-wizard/functions/definitions.ts +63 -0
  391. package/src/blueprints/project-wizard/functions/index.ts +13 -0
  392. package/src/blueprints/project-wizard/functions/project-rules.ts +77 -0
  393. package/src/blueprints/project-wizard/functions/sync-triggers.ts +153 -0
  394. package/src/blueprints/project-wizard/index.ts +6 -0
  395. package/src/blueprints/testing.ts +29 -8
  396. package/src/blueprints/websearch/blueprint.conversations.json +1 -0
  397. package/src/blueprints/websearch/blueprint.test.ts +39 -0
  398. package/src/blueprints/websearch/blueprint.ts +30 -0
  399. package/src/blueprints/websearch/functions/definitions.ts +25 -0
  400. package/src/blueprints/websearch/functions/fetch.ts +18 -0
  401. package/src/blueprints/websearch/functions/index.ts +9 -0
  402. package/src/blueprints/websearch/index.ts +3 -4
  403. package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +6 -1
  404. package/src/crud/graph.test.ts +44 -0
  405. package/src/crud/graph.ts +378 -0
  406. package/src/crud/index.ts +5 -0
  407. package/src/errors.ts +25 -0
  408. package/src/functions/READ_THIS.md +5 -0
  409. package/src/functions/agent/definitions.ts +56 -0
  410. package/src/functions/agent/index.ts +3 -5
  411. package/src/functions/agent/prompt.conversations.json +1 -0
  412. package/src/functions/agent/prompt.test.ts +78 -0
  413. package/src/functions/agent/prompt.ts +210 -87
  414. package/src/functions/index.ts +0 -6
  415. package/src/index.ts +3 -1
  416. package/src/sync/sync.ts +52 -34
  417. package/src/testing/index.ts +2 -1
  418. package/src/testing/plugins.tsx +79 -0
  419. package/src/toolkits/WebToolkit.ts +33 -0
  420. package/src/toolkits/index.ts +5 -0
  421. package/src/types/Agent.ts +238 -0
  422. package/src/types/Chat.ts +63 -0
  423. package/src/types/McpServer.ts +37 -0
  424. package/src/types/Memory.ts +24 -0
  425. package/src/types/Plan.ts +111 -0
  426. package/src/types/index.ts +9 -0
  427. package/dist/lib/browser/index.mjs +0 -2481
  428. package/dist/lib/browser/index.mjs.map +0 -7
  429. package/dist/lib/browser/meta.json +0 -1
  430. package/dist/lib/node-esm/index.mjs +0 -2483
  431. package/dist/lib/node-esm/index.mjs.map +0 -7
  432. package/dist/lib/node-esm/meta.json +0 -1
  433. package/dist/types/src/blueprints/design/design-blueprint.d.ts +0 -4
  434. package/dist/types/src/blueprints/design/design-blueprint.d.ts.map +0 -1
  435. package/dist/types/src/blueprints/design/design-blueprint.test.d.ts +0 -2
  436. package/dist/types/src/blueprints/design/design-blueprint.test.d.ts.map +0 -1
  437. package/dist/types/src/blueprints/design/index.d.ts +0 -3
  438. package/dist/types/src/blueprints/design/index.d.ts.map +0 -1
  439. package/dist/types/src/blueprints/discord/discord-blueprint.d.ts +0 -18
  440. package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +0 -1
  441. package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +0 -18
  442. package/dist/types/src/blueprints/linear/linear-blueprint.d.ts.map +0 -1
  443. package/dist/types/src/blueprints/planning/planning-blueprint.d.ts +0 -4
  444. package/dist/types/src/blueprints/planning/planning-blueprint.d.ts.map +0 -1
  445. package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts +0 -2
  446. package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts.map +0 -1
  447. package/dist/types/src/blueprints/research/index.d.ts +0 -3
  448. package/dist/types/src/blueprints/research/index.d.ts.map +0 -1
  449. package/dist/types/src/blueprints/research/research-blueprint.d.ts +0 -4
  450. package/dist/types/src/blueprints/research/research-blueprint.d.ts.map +0 -1
  451. package/dist/types/src/blueprints/research/research-blueprint.test.d.ts +0 -2
  452. package/dist/types/src/blueprints/research/research-blueprint.test.d.ts.map +0 -1
  453. package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts +0 -4
  454. package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts.map +0 -1
  455. package/dist/types/src/blueprints/websearch/websearch-toolkit.d.ts.map +0 -1
  456. package/dist/types/src/experimental/feed.test.d.ts +0 -2
  457. package/dist/types/src/experimental/feed.test.d.ts.map +0 -1
  458. package/dist/types/src/functions/discord/fetch-messages.d.ts.map +0 -1
  459. package/dist/types/src/functions/discord/fetch-messages.test.d.ts.map +0 -1
  460. package/dist/types/src/functions/discord/index.d.ts +0 -12
  461. package/dist/types/src/functions/discord/index.d.ts.map +0 -1
  462. package/dist/types/src/functions/document/index.d.ts +0 -12
  463. package/dist/types/src/functions/document/index.d.ts.map +0 -1
  464. package/dist/types/src/functions/document/read.d.ts +0 -7
  465. package/dist/types/src/functions/document/read.d.ts.map +0 -1
  466. package/dist/types/src/functions/document/update.d.ts +0 -6
  467. package/dist/types/src/functions/document/update.d.ts.map +0 -1
  468. package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +0 -173
  469. package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +0 -1
  470. package/dist/types/src/functions/entity-extraction/entity-extraction.test.d.ts +0 -2
  471. package/dist/types/src/functions/entity-extraction/entity-extraction.test.d.ts.map +0 -1
  472. package/dist/types/src/functions/entity-extraction/index.d.ts +0 -174
  473. package/dist/types/src/functions/entity-extraction/index.d.ts.map +0 -1
  474. package/dist/types/src/functions/exa/exa.d.ts +0 -5
  475. package/dist/types/src/functions/exa/exa.d.ts.map +0 -1
  476. package/dist/types/src/functions/exa/index.d.ts +0 -3
  477. package/dist/types/src/functions/exa/index.d.ts.map +0 -1
  478. package/dist/types/src/functions/exa/mock.d.ts +0 -5
  479. package/dist/types/src/functions/exa/mock.d.ts.map +0 -1
  480. package/dist/types/src/functions/github/fetch-prs.d.ts +0 -6
  481. package/dist/types/src/functions/github/fetch-prs.d.ts.map +0 -1
  482. package/dist/types/src/functions/linear/index.d.ts +0 -9
  483. package/dist/types/src/functions/linear/index.d.ts.map +0 -1
  484. package/dist/types/src/functions/linear/linear.test.d.ts.map +0 -1
  485. package/dist/types/src/functions/linear/sync-issues.d.ts +0 -12
  486. package/dist/types/src/functions/linear/sync-issues.d.ts.map +0 -1
  487. package/dist/types/src/functions/research/create-document.d.ts +0 -7
  488. package/dist/types/src/functions/research/create-document.d.ts.map +0 -1
  489. package/dist/types/src/functions/research/graph.d.ts.map +0 -1
  490. package/dist/types/src/functions/research/graph.test.d.ts.map +0 -1
  491. package/dist/types/src/functions/research/index.d.ts +0 -19
  492. package/dist/types/src/functions/research/index.d.ts.map +0 -1
  493. package/dist/types/src/functions/research/research-graph.d.ts +0 -18
  494. package/dist/types/src/functions/research/research-graph.d.ts.map +0 -1
  495. package/dist/types/src/functions/research/research.d.ts +0 -13
  496. package/dist/types/src/functions/research/research.d.ts.map +0 -1
  497. package/dist/types/src/functions/research/research.test.d.ts +0 -2
  498. package/dist/types/src/functions/research/research.test.d.ts.map +0 -1
  499. package/dist/types/src/functions/research/types.d.ts +0 -384
  500. package/dist/types/src/functions/research/types.d.ts.map +0 -1
  501. package/dist/types/src/functions/tasks/index.d.ts +0 -15
  502. package/dist/types/src/functions/tasks/index.d.ts.map +0 -1
  503. package/dist/types/src/functions/tasks/read.d.ts +0 -7
  504. package/dist/types/src/functions/tasks/read.d.ts.map +0 -1
  505. package/dist/types/src/functions/tasks/task-list.d.ts +0 -74
  506. package/dist/types/src/functions/tasks/task-list.d.ts.map +0 -1
  507. package/dist/types/src/functions/tasks/task-list.test.d.ts +0 -2
  508. package/dist/types/src/functions/tasks/task-list.test.d.ts.map +0 -1
  509. package/dist/types/src/functions/tasks/update.d.ts +0 -9
  510. package/dist/types/src/functions/tasks/update.d.ts.map +0 -1
  511. package/dist/types/src/plugins.d.ts +0 -19
  512. package/dist/types/src/plugins.d.ts.map +0 -1
  513. package/dist/types/src/testing/data/exa-search-1748337321991.d.ts +0 -38
  514. package/dist/types/src/testing/data/exa-search-1748337321991.d.ts.map +0 -1
  515. package/dist/types/src/testing/data/exa-search-1748337331526.d.ts +0 -37
  516. package/dist/types/src/testing/data/exa-search-1748337331526.d.ts.map +0 -1
  517. package/dist/types/src/testing/data/exa-search-1748337344119.d.ts +0 -58
  518. package/dist/types/src/testing/data/exa-search-1748337344119.d.ts.map +0 -1
  519. package/dist/types/src/testing/data/index.d.ts +0 -3
  520. package/dist/types/src/testing/data/index.d.ts.map +0 -1
  521. package/src/blueprints/design/design-blueprint.test.ts +0 -108
  522. package/src/blueprints/design/design-blueprint.ts +0 -33
  523. package/src/blueprints/design/index.ts +0 -7
  524. package/src/blueprints/discord/discord-blueprint.ts +0 -34
  525. package/src/blueprints/linear/linear-blueprint.ts +0 -35
  526. package/src/blueprints/planning/planning-blueprint.test.ts +0 -129
  527. package/src/blueprints/planning/planning-blueprint.ts +0 -98
  528. package/src/blueprints/research/index.ts +0 -7
  529. package/src/blueprints/research/research-blueprint.test.ts +0 -7
  530. package/src/blueprints/research/research-blueprint.ts +0 -45
  531. package/src/blueprints/websearch/websearch-blueprint.ts +0 -20
  532. package/src/experimental/feed.test.ts +0 -108
  533. package/src/functions/discord/fetch-messages.test.ts +0 -59
  534. package/src/functions/discord/fetch-messages.ts +0 -251
  535. package/src/functions/discord/index.ts +0 -9
  536. package/src/functions/document/index.ts +0 -11
  537. package/src/functions/document/read.ts +0 -29
  538. package/src/functions/document/update.ts +0 -30
  539. package/src/functions/entity-extraction/entity-extraction.conversations.json +0 -1
  540. package/src/functions/entity-extraction/entity-extraction.test.ts +0 -100
  541. package/src/functions/entity-extraction/entity-extraction.ts +0 -163
  542. package/src/functions/entity-extraction/index.ts +0 -9
  543. package/src/functions/exa/exa.ts +0 -37
  544. package/src/functions/exa/index.ts +0 -6
  545. package/src/functions/exa/mock.ts +0 -71
  546. package/src/functions/github/fetch-prs.ts +0 -30
  547. package/src/functions/linear/index.ts +0 -9
  548. package/src/functions/linear/linear.test.ts +0 -86
  549. package/src/functions/research/create-document.ts +0 -69
  550. package/src/functions/research/graph.test.ts +0 -69
  551. package/src/functions/research/graph.ts +0 -388
  552. package/src/functions/research/index.ts +0 -15
  553. package/src/functions/research/instructions-research.tpl +0 -98
  554. package/src/functions/research/research-graph.ts +0 -47
  555. package/src/functions/research/research.conversations.json +0 -10714
  556. package/src/functions/research/research.test.ts +0 -240
  557. package/src/functions/research/research.ts +0 -155
  558. package/src/functions/research/types.ts +0 -24
  559. package/src/functions/tasks/index.ts +0 -11
  560. package/src/functions/tasks/read.ts +0 -34
  561. package/src/functions/tasks/task-list.test.ts +0 -99
  562. package/src/functions/tasks/task-list.ts +0 -165
  563. package/src/functions/tasks/update.ts +0 -52
  564. package/src/plugins.tsx +0 -68
  565. package/src/testing/data/exa-search-1748337321991.ts +0 -131
  566. package/src/testing/data/exa-search-1748337331526.ts +0 -144
  567. package/src/testing/data/exa-search-1748337344119.ts +0 -133
  568. package/src/testing/data/index.ts +0 -11
  569. /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.d.ts +0 -0
  570. /package/dist/types/src/{functions/linear → blueprints/linear/functions}/linear.test.d.ts +0 -0
  571. /package/dist/types/src/{functions/research → crud}/graph.test.d.ts +0 -0
@@ -1,108 +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 { ComputeEventLogger, CredentialsService, FunctionInvocationService, TracingService } from '@dxos/functions';
18
- import { TestDatabaseLayer, testStoragePath } from '@dxos/functions/testing';
19
-
20
- import { Discord, Linear } from '../functions';
21
-
22
- const TestLayer = Layer.mergeAll(
23
- AiService.model('@anthropic/claude-opus-4-0'),
24
- makeToolResolverFromFunctions([], Toolkit.make()),
25
- makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
26
- ComputeEventLogger.layerFromTracing,
27
- ).pipe(
28
- Layer.provideMerge(
29
- Layer.mergeAll(
30
- AiServiceTestingPreset('direct'),
31
- TestDatabaseLayer({
32
- indexing: { vector: true },
33
- types: [],
34
- storagePath: testStoragePath({ name: 'feed-test' }),
35
- }),
36
- CredentialsService.layerConfig([
37
- { service: 'exa.ai', apiKey: Config.succeed(Redacted.make(EXA_API_KEY)) },
38
- { service: 'discord.com', apiKey: Config.redacted('DISCORD_TOKEN') },
39
- { service: 'linear.app', apiKey: Config.redacted('LINEAR_API_KEY') },
40
- ]),
41
- FunctionInvocationService.layerTestMocked({ functions: [Linear.sync, Discord.fetch] }).pipe(
42
- Layer.provideMerge(ComputeEventLogger.layerFromTracing),
43
- Layer.provideMerge(TracingService.layerLogInfo()),
44
- ),
45
- FetchHttpClient.layer,
46
- ),
47
- ),
48
- );
49
-
50
- describe('Feed', { timeout: 600_000 }, () => {
51
- it.effect(
52
- 'fetch discord messages',
53
- Effect.fnUntraced(
54
- function* (_) {
55
- // const messages = yield* LocalFunctionExecutionService.invokeFunction(fetchDiscordMessages, {
56
- // serverId: '837138313172353095',
57
- // // channelId: '1404487604761526423',
58
- // after: Date.now() / 1000 - 128 * 3600,
59
- // });
60
- // for (const message of messages) {
61
- // console.log(message.sender.name, message.blocks.find((block) => block._tag === 'text')?.text);
62
- // }
63
- // console.log(`Fetched ${messages.length} messages`);
64
-
65
- // const result = yield* AiSession.run({
66
- // history: [
67
- // Obj.make(DataType.Message, {
68
- // created: new Date().toISOString(),
69
- // sender: { role: 'user' },
70
- // blocks: messages
71
- // .map(
72
- // (message) =>
73
- // ({
74
- // _tag: 'text',
75
- // text: message.sender.name + ': ' + message.blocks.find((block) => block._tag === 'text')?.text,
76
- // }) as const,
77
- // )
78
- // .filter((block) => block._tag === 'text' && block.text.trim().length > 0),
79
- // }),
80
- // ],
81
- // prompt: 'Summarize the messages.',
82
- // system: 'Summarize the messages.',
83
- // }).pipe(Effect.provide(AiService.model('@anthropic/claude-3-5-haiku-latest')));
84
- // console.log(result);
85
-
86
- const linearIssues = yield* FunctionInvocationService.invokeFunction(Linear.sync, {
87
- team: '1127c63a-6f77-4725-9229-50f6cd47321c',
88
- });
89
- console.log(linearIssues);
90
-
91
- // const result = yield* AiSession.run({
92
- // history: [
93
- // Obj.make(DataType.Message, {
94
- // created: new Date().toISOString(),
95
- // sender: { role: 'user' },
96
- // blocks: [{ _tag: 'text', text: JSON.stringify(linearIssues) }],
97
- // }),
98
- // ],
99
- // prompt: 'Summarize the whats new.',
100
- // system: 'Summarize the whats new. Reference specific people by name.',
101
- // }).pipe(Effect.provide(AiService.model('@anthropic/claude-sonnet-4-0')));
102
- // console.log(result.at(-1)?.blocks.find((block) => block._tag === 'text')?.text);
103
- },
104
- Effect.provide(TestLayer),
105
- TestHelpers.taggedTest('llm'),
106
- ),
107
- );
108
- });
@@ -1,59 +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 { TestHelpers } from '@dxos/effect';
16
- import { ComputeEventLogger, CredentialsService, FunctionInvocationService, TracingService } from '@dxos/functions';
17
- import { TestDatabaseLayer } from '@dxos/functions/testing';
18
-
19
- import { default as fetchMessages } from './fetch-messages';
20
-
21
- const TestLayer = Layer.mergeAll(
22
- AiService.model('@anthropic/claude-opus-4-0'),
23
- makeToolResolverFromFunctions([], Toolkit.make()),
24
- makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
25
- ComputeEventLogger.layerFromTracing,
26
- ).pipe(
27
- Layer.provideMerge(
28
- Layer.mergeAll(
29
- AiServiceTestingPreset('direct'),
30
- TestDatabaseLayer({}),
31
- CredentialsService.layerConfig([{ service: 'discord.com', apiKey: Config.redacted('DISCORD_TOKEN') }]),
32
- FetchHttpClient.layer,
33
- FunctionInvocationService.layerTestMocked({ functions: [fetchMessages] }).pipe(
34
- Layer.provideMerge(ComputeEventLogger.layerFromTracing),
35
- Layer.provideMerge(TracingService.layerLogInfo()),
36
- ),
37
- ),
38
- ),
39
- );
40
-
41
- const DXOS_SERVER_ID = '837138313172353095';
42
-
43
- describe('Feed', { timeout: 600_000 }, () => {
44
- it.effect(
45
- 'fetch discord messages',
46
- Effect.fnUntraced(
47
- function* (_) {
48
- const messages = yield* FunctionInvocationService.invokeFunction(fetchMessages, {
49
- serverId: DXOS_SERVER_ID,
50
- // channelId: '1404487604761526423',
51
- last: '7d',
52
- });
53
- console.log(messages);
54
- },
55
- Effect.provide(TestLayer),
56
- TestHelpers.taggedTest('sync'),
57
- ),
58
- );
59
- });
@@ -1,251 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
6
- import { DiscordConfig, DiscordREST, DiscordRESTMemoryLive } from 'dfx';
7
- import type {
8
- GuildChannelResponse,
9
- MessageResponse,
10
- PrivateChannelResponse,
11
- PrivateGroupChannelResponse,
12
- ThreadResponse,
13
- } from 'dfx/types';
14
- import * as Array from 'effect/Array';
15
- import * as Effect from 'effect/Effect';
16
- import * as Function from 'effect/Function';
17
- import * as Layer from 'effect/Layer';
18
- import * as Option from 'effect/Option';
19
- import * as Schema from 'effect/Schema';
20
-
21
- import { Obj } from '@dxos/echo';
22
- import { CredentialsService, TracingService, defineFunction } from '@dxos/functions';
23
- import { log } from '@dxos/log';
24
- import { DataType } from '@dxos/schema';
25
-
26
- // TODO(dmaretskyi): Extract.
27
- const TimeRange = class extends Schema.String.pipe(Schema.pattern(/\d+(s|m|h|d)/)).annotations({
28
- description: 'Time range. 1d - 1 day, 2h - 2 hours, 30m - 30 minutes, 15s - 15 seconds.',
29
- examples: ['1d', '2h', '30m', '15s'],
30
- }) {
31
- static toSeconds(timeRange: Schema.Schema.Type<typeof TimeRange>) {
32
- const match = timeRange.match(/(\d+)(s|m|h|d)/);
33
- if (!match) {
34
- throw new Error(`Invalid time range: ${timeRange}`);
35
- }
36
- const [_, amount, unit] = match;
37
- switch (unit) {
38
- case 's':
39
- return Number(amount);
40
- case 'm':
41
- return Number(amount) * 60;
42
- case 'h':
43
- return Number(amount) * 60 * 60;
44
- case 'd':
45
- return Number(amount) * 24 * 60 * 60;
46
- default:
47
- throw new Error(`Invalid time range unit: ${unit}`);
48
- }
49
- }
50
- };
51
- type TimeRange = Schema.Schema.Type<typeof TimeRange>;
52
-
53
- const DiscordConfigFromCredential = Layer.unwrapEffect(
54
- Effect.gen(function* () {
55
- return DiscordConfig.layer({
56
- token: yield* CredentialsService.getApiKey({ service: 'discord.com' }),
57
- rest: {
58
- baseUrl: 'https://api-proxy.dxos.workers.dev/discord.com/api/v10',
59
- },
60
- });
61
- }),
62
- );
63
-
64
- type DiscordChannel = GuildChannelResponse | PrivateChannelResponse | PrivateGroupChannelResponse | ThreadResponse;
65
-
66
- const DEFAULT_AFTER = 1704067200; // 2024-01-01
67
- const DEFAULT_LIMIT = 500;
68
- const DEFAULT_IGNORE_USERNAMES = ['GitHub', 'Needle'];
69
-
70
- // TODO(dmaretskyi): Align with standard thread type.
71
- type Thread = {
72
- discordChannelId: string;
73
- name?: string;
74
- messages: DataType.Message[];
75
- };
76
-
77
- export default defineFunction({
78
- key: 'dxos.org/function/fetch-discord-messages',
79
- name: 'Sync Discord messages',
80
- inputSchema: Schema.Struct({
81
- serverId: Schema.String.annotations({
82
- description: 'The ID of the server to fetch messages from.',
83
- }),
84
- channelId: Schema.optional(Schema.String).annotations({
85
- description:
86
- 'The ID of the channel to fetch messages from. Will crawl all channels from the server if not specified.',
87
- }),
88
- after: Schema.optional(Schema.Number).annotations({
89
- description:
90
- 'Fetch messages that were sent after a given date. Unix timestamp in seconds. Exclusive with `last`.',
91
- }),
92
- last: TimeRange.annotations({
93
- description:
94
- 'Time range to fetch most recent messages. Specifies the range in the past, from now. "1d" would fetch messages from the last 24 hours.',
95
- }),
96
- limit: Schema.optional(Schema.Number).annotations({
97
- description: 'The maximum number of messages to fetch.',
98
- }),
99
- pageSize: Schema.optional(Schema.Number).annotations({
100
- description: 'The number of messages to fetch per page.',
101
- }),
102
- ignoreUsernames: Schema.optional(Schema.Array(Schema.String)).annotations({
103
- description: 'Exclude messages from these usernames.',
104
- }),
105
- }),
106
- handler: Effect.fnUntraced(
107
- function* ({
108
- data: {
109
- serverId,
110
- channelId,
111
- after,
112
- last,
113
- pageSize = 100,
114
- limit = DEFAULT_LIMIT,
115
- ignoreUsernames = DEFAULT_IGNORE_USERNAMES,
116
- },
117
- }) {
118
- if (!after && !last) {
119
- throw new Error('cannot specify both `after` and `last`');
120
- }
121
- const afterTs = last ? Date.now() / 1000 - TimeRange.toSeconds(last) : (after ?? DEFAULT_AFTER);
122
-
123
- const rest = yield* DiscordREST;
124
-
125
- let channels: DiscordChannel[] = [];
126
- channels.push(...(yield* rest.listGuildChannels(serverId)));
127
- const { threads: guildThreads } = yield* rest.getActiveGuildThreads(serverId);
128
- channels.push(...guildThreads);
129
- if (channelId) {
130
- channels = channels.filter((channel) => channel.id === channelId);
131
- }
132
- if (channels.length === 0) {
133
- throw new Error('no channels found');
134
- }
135
- for (const channel of channels) {
136
- console.log(channel.id, 'name' in channel ? channel.name : undefined);
137
- }
138
-
139
- yield* TracingService.emitStatus({ message: `Will fetch from channels: ${channels.length}` });
140
-
141
- const threads = yield* Effect.forEach(
142
- channels,
143
- Effect.fnUntraced(function* (channel) {
144
- const allMessages: DataType.Message[] = [];
145
-
146
- let lastMessage: Option.Option<DataType.Message> = Option.none();
147
- while (true) {
148
- const { id: lastId = undefined } = Function.pipe(
149
- lastMessage,
150
- Option.map(Obj.getKeys('discord.com')),
151
- Option.flatMap(Option.fromIterable),
152
- Option.getOrElse(() => ({ id: undefined })),
153
- );
154
-
155
- const options = {
156
- after: !lastId ? `${generateSnowflake(afterTs)}` : lastId,
157
- limit: pageSize,
158
- };
159
- log.info('fetching messages', {
160
- lastId,
161
- afterTs,
162
- afterSnowflake: options.after,
163
- after: parseSnowflake(options.after),
164
- limit: options.limit,
165
- });
166
- const messages = yield* rest.listMessages(channel.id, options).pipe(
167
- Effect.map(Array.map(makeMessage)),
168
- Effect.map(Array.reverse),
169
- Effect.catchTag('ErrorResponse', (err) =>
170
- err.cause.code === 50001 ? Effect.succeed([]) : Effect.fail(err),
171
- ),
172
- );
173
- if (messages.length > 0) {
174
- lastMessage = Option.fromNullable(messages.at(-1));
175
- allMessages.push(...messages);
176
- } else {
177
- break;
178
- }
179
- yield* TracingService.emitStatus({ message: `Fetched messages: ${allMessages.length}` });
180
- if (allMessages.length >= limit) {
181
- break;
182
- }
183
- }
184
-
185
- return {
186
- discordChannelId: channel.id,
187
- name: 'name' in channel ? (channel.name ?? undefined) : undefined,
188
- messages: allMessages
189
- .filter((message) => !message.sender.name || !ignoreUsernames.includes(message.sender.name))
190
- .filter((message) =>
191
- message.blocks.some((block) => block._tag === 'text' && block.text.trim().length > 0),
192
- ),
193
- } satisfies Thread;
194
- }),
195
- { concurrency: 10 },
196
- );
197
-
198
- return threads
199
- .filter((thread) => thread.messages.length > 0)
200
- .map(serializeThread)
201
- .join('\n');
202
- },
203
- Effect.provide(
204
- DiscordRESTMemoryLive.pipe(Layer.provideMerge(DiscordConfigFromCredential)).pipe(
205
- Layer.provide(FetchHttpClient.layer),
206
- ),
207
- ),
208
- Effect.orDie,
209
- ),
210
- });
211
-
212
- /**
213
- * @param unixTimestamp in seconds
214
- */
215
- const generateSnowflake = (unixTimestamp: number): bigint => {
216
- const discordEpoch = 1420070400000n; // Discord Epoch (ms)
217
- return (BigInt(unixTimestamp * 1000) - discordEpoch) << 22n;
218
- };
219
-
220
- const parseSnowflake = (snowflake: string): Date => {
221
- const discordEpoch = 1420070400000n; // Discord Epoch (ms)
222
- return new Date(Number((BigInt(snowflake) >> 22n) + discordEpoch));
223
- };
224
-
225
- const makeMessage = (message: MessageResponse): DataType.Message =>
226
- Obj.make(DataType.Message, {
227
- [Obj.Meta]: {
228
- keys: [
229
- { id: message.id, source: 'discord.com' },
230
- { id: message.channel_id, source: 'discord.com/thread' },
231
- ],
232
- },
233
- sender: { name: message.author.username },
234
- created: message.timestamp,
235
- blocks: [{ _tag: 'text', text: message.content }],
236
- });
237
-
238
- /**
239
- * Standard JSON serialization is to verbose for large amounts of data.
240
- */
241
- const serializeThread = (thread: Thread): string => {
242
- return `<thread id=${thread.discordChannelId} name=${thread.name ?? ''}>\n${thread.messages
243
- .map(
244
- (message) =>
245
- ` ${message.sender.name}: ${message.blocks
246
- .filter((block) => block._tag === 'text')
247
- .map((block) => block.text)
248
- .join(' ')}`,
249
- )
250
- .join('\n')}\n</thread>`;
251
- };
@@ -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,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 Document {
9
- export const read = read$;
10
- export const update = update$;
11
- }
@@ -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,30 +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/update',
14
- name: 'Update markdown',
15
- description: 'Updates the entire contents of the markdown document.',
16
- inputSchema: Schema.Struct({
17
- id: ArtifactId.annotations({
18
- description: 'The ID of the document to write.',
19
- }),
20
- content: Schema.String.annotations({
21
- description: 'New content to write to the document.',
22
- }),
23
- }),
24
- outputSchema: Schema.Void,
25
- handler: Effect.fn(function* ({ data: { id, content } }) {
26
- const doc = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Markdown.Document);
27
- const text = yield* DatabaseService.load(doc.content);
28
- text.content = content;
29
- }),
30
- });