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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. package/dist/lib/{browser → neutral}/index.mjs +3835 -2486
  2. package/dist/lib/neutral/index.mjs.map +7 -0
  3. package/dist/lib/neutral/meta.json +1 -0
  4. package/dist/lib/neutral/testing/index.mjs +81 -0
  5. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  6. package/dist/types/src/blueprints/automation/blueprint.d.ts +4 -0
  7. package/dist/types/src/blueprints/automation/blueprint.d.ts.map +1 -0
  8. package/dist/types/src/blueprints/automation/index.d.ts +2 -0
  9. package/dist/types/src/blueprints/automation/index.d.ts.map +1 -0
  10. package/dist/types/src/blueprints/browser/blueprint.d.ts +4 -0
  11. package/dist/types/src/blueprints/browser/blueprint.d.ts.map +1 -0
  12. package/dist/types/src/blueprints/browser/blueprint.test.d.ts +2 -0
  13. package/dist/types/src/blueprints/browser/blueprint.test.d.ts.map +1 -0
  14. package/dist/types/src/blueprints/browser/index.d.ts +2 -0
  15. package/dist/types/src/blueprints/browser/index.d.ts.map +1 -0
  16. package/dist/types/src/blueprints/database/blueprint.d.ts +4 -0
  17. package/dist/types/src/blueprints/database/blueprint.d.ts.map +1 -0
  18. package/dist/types/src/blueprints/database/blueprint.test.d.ts +2 -0
  19. package/dist/types/src/blueprints/database/blueprint.test.d.ts.map +1 -0
  20. package/dist/types/src/blueprints/database/functions/context-add.d.ts +6 -0
  21. package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -0
  22. package/dist/types/src/blueprints/database/functions/context-remove.d.ts +6 -0
  23. package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -0
  24. package/dist/types/src/blueprints/database/functions/index.d.ts +57 -0
  25. package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -0
  26. package/dist/types/src/blueprints/database/functions/load.d.ts +6 -0
  27. package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -0
  28. package/dist/types/src/blueprints/database/functions/object-create.d.ts +6 -0
  29. package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +1 -0
  30. package/dist/types/src/blueprints/database/functions/object-delete.d.ts +6 -0
  31. package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +1 -0
  32. package/dist/types/src/blueprints/database/functions/object-update.d.ts +9 -0
  33. package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -0
  34. package/dist/types/src/blueprints/database/functions/query.d.ts +9 -0
  35. package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -0
  36. package/dist/types/src/blueprints/database/functions/relation-create.d.ts +9 -0
  37. package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -0
  38. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +6 -0
  39. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +1 -0
  40. package/dist/types/src/{initiative/functions/update.d.ts → blueprints/database/functions/schema-add.d.ts} +3 -3
  41. package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +1 -0
  42. package/dist/types/src/blueprints/database/functions/schema-list.d.ts +5 -0
  43. package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -0
  44. package/dist/types/src/blueprints/database/functions/tag-add.d.ts +7 -0
  45. package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -0
  46. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +7 -0
  47. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -0
  48. package/dist/types/src/blueprints/database/index.d.ts +3 -0
  49. package/dist/types/src/blueprints/database/index.d.ts.map +1 -0
  50. package/dist/types/src/blueprints/design/blueprint.d.ts +4 -0
  51. package/dist/types/src/blueprints/design/blueprint.d.ts.map +1 -0
  52. package/dist/types/src/blueprints/design/blueprint.test.d.ts +2 -0
  53. package/dist/types/src/blueprints/design/blueprint.test.d.ts.map +1 -0
  54. package/dist/types/src/blueprints/design/index.d.ts +1 -2
  55. package/dist/types/src/blueprints/design/index.d.ts.map +1 -1
  56. package/dist/types/src/blueprints/discord/blueprint.d.ts +4 -0
  57. package/dist/types/src/blueprints/discord/blueprint.d.ts.map +1 -0
  58. package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +1 -0
  59. package/dist/types/src/blueprints/discord/functions/fetch-messages.test.d.ts.map +1 -0
  60. package/dist/types/src/{functions/discord → blueprints/discord/functions}/index.d.ts +3 -3
  61. package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -0
  62. package/dist/types/src/blueprints/discord/index.d.ts +1 -2
  63. package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
  64. package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -0
  65. package/dist/types/src/blueprints/github/functions/index.d.ts +7 -0
  66. package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -0
  67. package/dist/types/src/blueprints/github/index.d.ts.map +1 -0
  68. package/dist/types/src/blueprints/index.d.ts +13 -6
  69. package/dist/types/src/blueprints/index.d.ts.map +1 -1
  70. package/dist/types/src/blueprints/linear/blueprint.d.ts +4 -0
  71. package/dist/types/src/blueprints/linear/blueprint.d.ts.map +1 -0
  72. package/dist/types/src/{functions/linear → blueprints/linear/functions}/index.d.ts +3 -3
  73. package/dist/types/src/blueprints/linear/functions/index.d.ts.map +1 -0
  74. package/dist/types/src/blueprints/linear/functions/linear.test.d.ts.map +1 -0
  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 +4 -0
  141. package/dist/types/src/blueprints/project/index.d.ts.map +1 -0
  142. package/dist/types/src/blueprints/project/sync-triggers.d.ts +11 -0
  143. package/dist/types/src/blueprints/project/sync-triggers.d.ts.map +1 -0
  144. package/dist/types/src/blueprints/project-wizard/blueprint.d.ts +4 -0
  145. package/dist/types/src/blueprints/project-wizard/blueprint.d.ts.map +1 -0
  146. package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +10 -0
  147. package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +1 -0
  148. package/dist/types/src/blueprints/project-wizard/functions/index.d.ts +31 -0
  149. package/dist/types/src/blueprints/project-wizard/functions/index.d.ts.map +1 -0
  150. package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts +3 -0
  151. package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts.map +1 -0
  152. package/dist/types/src/blueprints/{design/design-blueprint.d.ts → project-wizard/functions/query-blueprints.d.ts} +8 -3
  153. package/dist/types/src/blueprints/project-wizard/functions/query-blueprints.d.ts.map +1 -0
  154. package/dist/types/src/blueprints/project-wizard/index.d.ts +3 -0
  155. package/dist/types/src/blueprints/project-wizard/index.d.ts.map +1 -0
  156. package/dist/types/src/blueprints/research/blueprint.d.ts +4 -0
  157. package/dist/types/src/blueprints/research/blueprint.d.ts.map +1 -0
  158. package/dist/types/src/blueprints/research/blueprint.test.d.ts +2 -0
  159. package/dist/types/src/blueprints/research/blueprint.test.d.ts.map +1 -0
  160. package/dist/types/src/{functions/research → blueprints/research/functions}/document-create.d.ts +2 -1
  161. package/dist/types/src/blueprints/research/functions/document-create.d.ts.map +1 -0
  162. package/dist/types/src/{functions/research → blueprints/research/functions}/index.d.ts +6 -8
  163. package/dist/types/src/blueprints/research/functions/index.d.ts.map +1 -0
  164. package/dist/types/src/{functions/research → blueprints/research/functions}/research.d.ts +1 -1
  165. package/dist/types/src/blueprints/research/functions/research.d.ts.map +1 -0
  166. package/dist/types/src/blueprints/research/functions/research.test.d.ts.map +1 -0
  167. package/dist/types/src/blueprints/research/index.d.ts +2 -2
  168. package/dist/types/src/blueprints/research/index.d.ts.map +1 -1
  169. package/dist/types/src/{functions/research/research-graph.d.ts → blueprints/research/types/ResearchGraph.d.ts} +5 -6
  170. package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts.map +1 -0
  171. package/dist/types/src/blueprints/research/types/index.d.ts +7 -0
  172. package/dist/types/src/blueprints/research/types/index.d.ts.map +1 -0
  173. package/dist/types/src/blueprints/testing.d.ts +17 -3
  174. package/dist/types/src/blueprints/testing.d.ts.map +1 -1
  175. package/dist/types/src/blueprints/websearch/blueprint.d.ts +4 -0
  176. package/dist/types/src/blueprints/websearch/blueprint.d.ts.map +1 -0
  177. package/dist/types/src/blueprints/websearch/functions/fetch.d.ts +5 -0
  178. package/dist/types/src/blueprints/websearch/functions/fetch.d.ts.map +1 -0
  179. package/dist/types/src/blueprints/websearch/functions/index.d.ts +6 -0
  180. package/dist/types/src/blueprints/websearch/functions/index.d.ts.map +1 -0
  181. package/dist/types/src/blueprints/websearch/index.d.ts +3 -3
  182. package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
  183. package/dist/types/src/blueprints/websearch/{websearch-toolkit.d.ts → toolkit.d.ts} +1 -1
  184. package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
  185. package/dist/types/src/crud/graph.d.ts +6 -6
  186. package/dist/types/src/crud/graph.d.ts.map +1 -1
  187. package/dist/types/src/functions/agent/index.d.ts +84 -4
  188. package/dist/types/src/functions/agent/index.d.ts.map +1 -1
  189. package/dist/types/src/functions/agent/prompt.d.ts +9 -1
  190. package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
  191. package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +8 -3
  192. package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +1 -1
  193. package/dist/types/src/functions/entity-extraction/index.d.ts +10 -6
  194. package/dist/types/src/functions/entity-extraction/index.d.ts.map +1 -1
  195. package/dist/types/src/functions/exa/index.d.ts +8 -2
  196. package/dist/types/src/functions/exa/index.d.ts.map +1 -1
  197. package/dist/types/src/functions/index.d.ts +1 -5
  198. package/dist/types/src/functions/index.d.ts.map +1 -1
  199. package/dist/types/src/index.d.ts +2 -1
  200. package/dist/types/src/index.d.ts.map +1 -1
  201. package/dist/types/src/testing/index.d.ts +1 -0
  202. package/dist/types/src/testing/index.d.ts.map +1 -1
  203. package/dist/types/src/testing/plugins.d.ts.map +1 -1
  204. package/dist/types/src/toolkits/WebToolkit.d.ts +38 -0
  205. package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -0
  206. package/dist/types/src/toolkits/index.d.ts +1 -2
  207. package/dist/types/src/toolkits/index.d.ts.map +1 -1
  208. package/dist/types/src/types/Chat.d.ts +31 -0
  209. package/dist/types/src/types/Chat.d.ts.map +1 -0
  210. package/dist/types/src/types/Memory.d.ts +12 -0
  211. package/dist/types/src/types/Memory.d.ts.map +1 -0
  212. package/dist/types/src/types/Plan.d.ts +77 -0
  213. package/dist/types/src/types/Plan.d.ts.map +1 -0
  214. package/dist/types/src/types/Project.d.ts +66 -0
  215. package/dist/types/src/types/Project.d.ts.map +1 -0
  216. package/dist/types/src/types/index.d.ts +5 -0
  217. package/dist/types/src/types/index.d.ts.map +1 -0
  218. package/dist/types/tsconfig.tsbuildinfo +1 -1
  219. package/package.json +38 -43
  220. package/src/blueprints/automation/blueprint.ts +109 -0
  221. package/src/blueprints/automation/index.ts +5 -0
  222. package/src/blueprints/browser/blueprint.conversations.json +1 -0
  223. package/src/blueprints/browser/blueprint.test.ts +70 -0
  224. package/src/blueprints/browser/blueprint.ts +41 -0
  225. package/src/blueprints/browser/index.ts +5 -0
  226. package/src/blueprints/database/blueprint.conversations.json +1 -0
  227. package/src/blueprints/database/blueprint.test.ts +341 -0
  228. package/src/blueprints/database/blueprint.ts +39 -0
  229. package/src/blueprints/database/functions/context-add.ts +35 -0
  230. package/src/blueprints/database/functions/context-remove.ts +35 -0
  231. package/src/blueprints/database/functions/index.ts +33 -0
  232. package/src/blueprints/database/functions/load.ts +31 -0
  233. package/src/blueprints/database/functions/object-create.ts +48 -0
  234. package/src/blueprints/database/functions/object-delete.ts +27 -0
  235. package/src/blueprints/database/functions/object-update.ts +40 -0
  236. package/src/blueprints/database/functions/query.ts +130 -0
  237. package/src/blueprints/database/functions/relation-create.ts +47 -0
  238. package/src/blueprints/database/functions/relation-delete.ts +28 -0
  239. package/src/blueprints/database/functions/schema-add.ts +40 -0
  240. package/src/blueprints/database/functions/schema-list.ts +34 -0
  241. package/src/blueprints/database/functions/tag-add.ts +31 -0
  242. package/src/blueprints/database/functions/tag-remove.ts +30 -0
  243. package/src/blueprints/database/index.ts +6 -0
  244. package/src/blueprints/design/{design-blueprint.test.ts → blueprint.test.ts} +12 -21
  245. package/src/blueprints/design/{design-blueprint.ts → blueprint.ts} +25 -10
  246. package/src/blueprints/design/index.ts +1 -3
  247. package/src/blueprints/discord/blueprint.ts +46 -0
  248. package/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.ts +4 -7
  249. package/src/{functions/discord → blueprints/discord/functions}/fetch-messages.ts +1 -1
  250. package/src/blueprints/discord/functions/index.ts +9 -0
  251. package/src/blueprints/discord/index.ts +1 -3
  252. package/src/{functions/github → blueprints/github/functions}/fetch-prs.ts +1 -1
  253. package/src/blueprints/github/functions/index.ts +9 -0
  254. package/src/blueprints/index.ts +13 -6
  255. package/src/blueprints/linear/blueprint.ts +47 -0
  256. package/src/blueprints/linear/functions/index.ts +9 -0
  257. package/src/blueprints/linear/functions/linear.test.ts +58 -0
  258. package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +7 -7
  259. package/src/blueprints/linear/index.ts +1 -3
  260. package/src/blueprints/markdown/blueprint.ts +38 -0
  261. package/src/blueprints/markdown/functions/create.ts +29 -0
  262. package/src/blueprints/markdown/functions/index.ts +13 -0
  263. package/src/blueprints/markdown/functions/read.ts +32 -0
  264. package/src/{functions/document → blueprints/markdown/functions}/update.ts +6 -7
  265. package/src/blueprints/markdown/index.ts +6 -0
  266. package/src/blueprints/memory/blueprint.conversations.json +1 -0
  267. package/src/blueprints/memory/blueprint.test.ts +135 -0
  268. package/src/blueprints/memory/blueprint.ts +44 -0
  269. package/src/blueprints/memory/functions/delete.ts +25 -0
  270. package/src/blueprints/memory/functions/index.ts +13 -0
  271. package/src/blueprints/memory/functions/query.ts +49 -0
  272. package/src/blueprints/memory/functions/save.ts +32 -0
  273. package/src/blueprints/memory/index.ts +6 -0
  274. package/src/blueprints/planning/blueprint.ts +28 -0
  275. package/src/blueprints/planning/functions/index.ts +9 -0
  276. package/src/blueprints/planning/functions/update-tasks.ts +168 -0
  277. package/src/blueprints/planning/index.ts +2 -4
  278. package/src/blueprints/{planning/planning-blueprint.test.ts → planning-old/blueprint.test.ts} +12 -16
  279. package/src/blueprints/{planning/planning-blueprint.ts → planning-old/blueprint.ts} +24 -10
  280. package/src/blueprints/planning-old/functions/index.ts +11 -0
  281. package/src/{functions/tasks → blueprints/planning-old/functions}/read.ts +6 -7
  282. package/src/{functions/tasks → blueprints/planning-old/functions}/update.ts +6 -7
  283. package/src/blueprints/planning-old/index.ts +5 -0
  284. package/src/{initiative/initiative.test.ts → blueprints/project/blueprint.test.ts} +138 -44
  285. package/src/blueprints/project/blueprint.ts +68 -0
  286. package/src/blueprints/project/functions/add-artifact.ts +41 -0
  287. package/src/blueprints/project/functions/agent.ts +72 -0
  288. package/src/blueprints/project/functions/get-context.ts +63 -0
  289. package/src/blueprints/project/functions/index.ts +15 -0
  290. package/src/blueprints/project/functions/qualifier.ts +96 -0
  291. package/src/blueprints/project/index.ts +7 -0
  292. package/src/blueprints/project/sync-triggers.ts +153 -0
  293. package/src/blueprints/project-wizard/blueprint.ts +45 -0
  294. package/src/blueprints/project-wizard/functions/create-project.ts +57 -0
  295. package/src/blueprints/project-wizard/functions/index.ts +13 -0
  296. package/src/blueprints/project-wizard/functions/project-rules.ts +78 -0
  297. package/src/blueprints/project-wizard/functions/query-blueprints.ts +27 -0
  298. package/src/blueprints/project-wizard/index.ts +6 -0
  299. package/src/blueprints/research/{research-blueprint.ts → blueprint.ts} +25 -11
  300. package/src/{functions/research → blueprints/research/functions}/document-create.ts +9 -12
  301. package/src/blueprints/research/functions/index.ts +11 -0
  302. package/src/{functions/research → blueprints/research/functions}/research-instructions.tpl +5 -5
  303. package/src/blueprints/research/functions/research.conversations.json +1 -0
  304. package/src/{functions/research → blueprints/research/functions}/research.test.ts +33 -55
  305. package/src/{functions/research → blueprints/research/functions}/research.ts +14 -28
  306. package/src/blueprints/research/index.ts +2 -3
  307. package/src/blueprints/research/types/ResearchGraph.ts +49 -0
  308. package/src/{functions/research/types.ts → blueprints/research/types/index.ts} +12 -6
  309. package/src/blueprints/testing.ts +35 -4
  310. package/src/blueprints/websearch/blueprint.ts +32 -0
  311. package/src/blueprints/websearch/functions/fetch.ts +28 -0
  312. package/src/blueprints/websearch/functions/index.ts +9 -0
  313. package/src/blueprints/websearch/index.ts +3 -5
  314. package/src/crud/graph.test.ts +2 -2
  315. package/src/crud/graph.ts +9 -9
  316. package/src/functions/READ_THIS.md +5 -0
  317. package/src/functions/agent/index.ts +4 -6
  318. package/src/functions/agent/prompt.ts +16 -26
  319. package/src/functions/entity-extraction/entity-extraction.conversations.json +1 -6597
  320. package/src/functions/entity-extraction/entity-extraction.test.ts +11 -30
  321. package/src/functions/entity-extraction/entity-extraction.ts +13 -15
  322. package/src/functions/entity-extraction/index.ts +4 -4
  323. package/src/functions/exa/exa.ts +2 -2
  324. package/src/functions/exa/index.ts +7 -2
  325. package/src/functions/exa/mock.ts +1 -1
  326. package/src/functions/index.ts +1 -5
  327. package/src/index.ts +2 -1
  328. package/src/sync/sync.ts +2 -2
  329. package/src/testing/index.ts +1 -0
  330. package/src/testing/plugins.tsx +22 -18
  331. package/src/toolkits/WebToolkit.ts +33 -0
  332. package/src/toolkits/index.ts +1 -2
  333. package/src/types/Chat.ts +51 -0
  334. package/src/types/Memory.ts +23 -0
  335. package/src/types/Plan.ts +110 -0
  336. package/src/types/Project.ts +197 -0
  337. package/src/types/index.ts +8 -0
  338. package/dist/lib/browser/index.mjs.map +0 -7
  339. package/dist/lib/browser/meta.json +0 -1
  340. package/dist/lib/browser/testing/index.mjs +0 -43
  341. package/dist/lib/browser/testing/index.mjs.map +0 -7
  342. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  343. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
  344. package/dist/lib/node-esm/index.mjs +0 -2881
  345. package/dist/lib/node-esm/index.mjs.map +0 -7
  346. package/dist/lib/node-esm/meta.json +0 -1
  347. package/dist/lib/node-esm/testing/index.mjs +0 -44
  348. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  349. package/dist/types/src/blueprints/design/design-blueprint.d.ts.map +0 -1
  350. package/dist/types/src/blueprints/design/design-blueprint.test.d.ts +0 -2
  351. package/dist/types/src/blueprints/design/design-blueprint.test.d.ts.map +0 -1
  352. package/dist/types/src/blueprints/discord/discord-blueprint.d.ts +0 -18
  353. package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +0 -1
  354. package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +0 -18
  355. package/dist/types/src/blueprints/linear/linear-blueprint.d.ts.map +0 -1
  356. package/dist/types/src/blueprints/planning/planning-blueprint.d.ts +0 -18
  357. package/dist/types/src/blueprints/planning/planning-blueprint.d.ts.map +0 -1
  358. package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts +0 -2
  359. package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts.map +0 -1
  360. package/dist/types/src/blueprints/research/research-blueprint.d.ts +0 -18
  361. package/dist/types/src/blueprints/research/research-blueprint.d.ts.map +0 -1
  362. package/dist/types/src/blueprints/research/research-blueprint.test.d.ts +0 -2
  363. package/dist/types/src/blueprints/research/research-blueprint.test.d.ts.map +0 -1
  364. package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts +0 -18
  365. package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts.map +0 -1
  366. package/dist/types/src/blueprints/websearch/websearch-toolkit.d.ts.map +0 -1
  367. package/dist/types/src/experimental/feed.test.d.ts +0 -2
  368. package/dist/types/src/experimental/feed.test.d.ts.map +0 -1
  369. package/dist/types/src/functions/discord/fetch-messages.d.ts.map +0 -1
  370. package/dist/types/src/functions/discord/fetch-messages.test.d.ts.map +0 -1
  371. package/dist/types/src/functions/discord/index.d.ts.map +0 -1
  372. package/dist/types/src/functions/document/index.d.ts +0 -13
  373. package/dist/types/src/functions/document/index.d.ts.map +0 -1
  374. package/dist/types/src/functions/document/read.d.ts.map +0 -1
  375. package/dist/types/src/functions/document/update.d.ts.map +0 -1
  376. package/dist/types/src/functions/github/fetch-prs.d.ts.map +0 -1
  377. package/dist/types/src/functions/linear/index.d.ts.map +0 -1
  378. package/dist/types/src/functions/linear/linear.test.d.ts.map +0 -1
  379. package/dist/types/src/functions/linear/sync-issues.d.ts.map +0 -1
  380. package/dist/types/src/functions/research/document-create.d.ts.map +0 -1
  381. package/dist/types/src/functions/research/index.d.ts.map +0 -1
  382. package/dist/types/src/functions/research/research-graph.d.ts.map +0 -1
  383. package/dist/types/src/functions/research/research.d.ts.map +0 -1
  384. package/dist/types/src/functions/research/research.test.d.ts.map +0 -1
  385. package/dist/types/src/functions/research/types.d.ts +0 -6
  386. package/dist/types/src/functions/research/types.d.ts.map +0 -1
  387. package/dist/types/src/functions/tasks/index.d.ts +0 -15
  388. package/dist/types/src/functions/tasks/index.d.ts.map +0 -1
  389. package/dist/types/src/functions/tasks/read.d.ts +0 -7
  390. package/dist/types/src/functions/tasks/read.d.ts.map +0 -1
  391. package/dist/types/src/functions/tasks/task-list.d.ts.map +0 -1
  392. package/dist/types/src/functions/tasks/task-list.test.d.ts.map +0 -1
  393. package/dist/types/src/functions/tasks/update.d.ts +0 -9
  394. package/dist/types/src/functions/tasks/update.d.ts.map +0 -1
  395. package/dist/types/src/initiative/Initiative.d.ts +0 -84
  396. package/dist/types/src/initiative/Initiative.d.ts.map +0 -1
  397. package/dist/types/src/initiative/InitiativeSchema.d.ts +0 -19
  398. package/dist/types/src/initiative/InitiativeSchema.d.ts.map +0 -1
  399. package/dist/types/src/initiative/functions/agent.d.ts +0 -37
  400. package/dist/types/src/initiative/functions/agent.d.ts.map +0 -1
  401. package/dist/types/src/initiative/functions/getContext.d.ts +0 -17
  402. package/dist/types/src/initiative/functions/getContext.d.ts.map +0 -1
  403. package/dist/types/src/initiative/functions/index.d.ts +0 -4
  404. package/dist/types/src/initiative/functions/index.d.ts.map +0 -1
  405. package/dist/types/src/initiative/functions/update.d.ts.map +0 -1
  406. package/dist/types/src/initiative/index.d.ts.map +0 -1
  407. package/dist/types/src/initiative/initiative.test.d.ts +0 -2
  408. package/dist/types/src/initiative/initiative.test.d.ts.map +0 -1
  409. package/dist/types/src/toolkits/AssistantToolkit.d.ts +0 -43
  410. package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +0 -1
  411. package/dist/types/src/toolkits/AssistantToolkit.test.d.ts +0 -2
  412. package/dist/types/src/toolkits/AssistantToolkit.test.d.ts.map +0 -1
  413. package/dist/types/src/toolkits/SystemToolkit.d.ts +0 -99
  414. package/dist/types/src/toolkits/SystemToolkit.d.ts.map +0 -1
  415. package/src/blueprints/discord/discord-blueprint.ts +0 -32
  416. package/src/blueprints/linear/linear-blueprint.ts +0 -33
  417. package/src/blueprints/websearch/websearch-blueprint.ts +0 -18
  418. package/src/experimental/feed.test.ts +0 -111
  419. package/src/functions/discord/index.ts +0 -9
  420. package/src/functions/document/index.ts +0 -12
  421. package/src/functions/document/read.ts +0 -30
  422. package/src/functions/linear/index.ts +0 -9
  423. package/src/functions/linear/linear.test.ts +0 -84
  424. package/src/functions/research/index.ts +0 -14
  425. package/src/functions/research/research-graph.ts +0 -49
  426. package/src/functions/research/research.conversations.json +0 -1
  427. package/src/functions/tasks/index.ts +0 -11
  428. package/src/initiative/Initiative.ts +0 -99
  429. package/src/initiative/InitiativeSchema.ts +0 -37
  430. package/src/initiative/functions/agent.ts +0 -57
  431. package/src/initiative/functions/getContext.ts +0 -74
  432. package/src/initiative/functions/index.ts +0 -7
  433. package/src/initiative/functions/update.ts +0 -63
  434. package/src/initiative/initiative.conversations.json +0 -1
  435. package/src/toolkits/AssistantToolkit.conversations.json +0 -1
  436. package/src/toolkits/AssistantToolkit.test.ts +0 -94
  437. package/src/toolkits/AssistantToolkit.ts +0 -70
  438. package/src/toolkits/SystemToolkit.ts +0 -299
  439. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  440. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
  441. /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.d.ts +0 -0
  442. /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.d.ts +0 -0
  443. /package/dist/types/src/{functions/github → blueprints/github/functions}/fetch-prs.d.ts +0 -0
  444. /package/dist/types/src/{initiative → blueprints/github}/index.d.ts +0 -0
  445. /package/dist/types/src/{functions/linear → blueprints/linear/functions}/linear.test.d.ts +0 -0
  446. /package/dist/types/src/{functions/linear → blueprints/linear/functions}/sync-issues.d.ts +0 -0
  447. /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.d.ts +0 -0
  448. /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.d.ts +0 -0
  449. /package/dist/types/src/{functions/research → blueprints/research/functions}/research.test.d.ts +0 -0
  450. /package/src/{initiative → blueprints/github}/index.ts +0 -0
  451. /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.ts +0 -0
  452. /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.ts +0 -0
  453. /package/src/blueprints/research/{research-blueprint.test.ts → blueprint.test.ts} +0 -0
  454. /package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +0 -0
@@ -0,0 +1,96 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as LanguageModel from '@effect/ai/LanguageModel';
6
+ import * as Prompt from '@effect/ai/Prompt';
7
+ import * as Effect from 'effect/Effect';
8
+ import * as Schema from 'effect/Schema';
9
+
10
+ import { AiService } from '@dxos/ai';
11
+ import { Database, Obj, Ref } from '@dxos/echo';
12
+ import { TriggerEvent, defineFunction } from '@dxos/functions';
13
+ import { invariant } from '@dxos/invariant';
14
+ import { trim } from '@dxos/util';
15
+
16
+ import { Plan, Project } from '../../../types';
17
+
18
+ export default defineFunction({
19
+ key: 'org.dxos.function.project.qualifier',
20
+ name: 'Project Qualifier',
21
+ description:
22
+ 'Qualifier that determines if the event is relevant to the project. Puts the data into the input queue of the project.',
23
+ inputSchema: Schema.Struct({
24
+ project: Schema.suspend(() => Ref.Ref(Project.Project)),
25
+ event: TriggerEvent.TriggerEvent,
26
+ }),
27
+ outputSchema: Schema.Void,
28
+ services: [],
29
+ handler: Effect.fnUntraced(
30
+ function* ({ data }) {
31
+ const project = yield* Database.load(data.project);
32
+ invariant(Obj.instanceOf(Project.Project, project));
33
+ invariant(project.chat, 'Project has no chat.');
34
+
35
+ const { id, name, queue } = project;
36
+ if (!queue) {
37
+ throw new Error('Project has no queue.');
38
+ }
39
+
40
+ const plan = yield* Database.load(project.plan);
41
+ const spec = yield* Database.load(project.spec);
42
+
43
+ const {
44
+ value: { isRelevant },
45
+ } = yield* LanguageModel.generateObject({
46
+ schema: Schema.Struct({
47
+ isRelevant: Schema.Boolean,
48
+ }),
49
+ prompt: Prompt.fromMessages([
50
+ Prompt.systemMessage({
51
+ content: trim`
52
+ You are a qualifying agent that determines if the event is relevant to the project.
53
+ Respond with true if the event is relevant to the project, false otherwise.
54
+ If you are not sure, return true.
55
+ The qualified events will be forwarded to the larger agent that will process them.
56
+ <project id="${id}" name="${name}">
57
+ <spec>
58
+ ${spec.content}
59
+ </spec>
60
+ <plan>
61
+ ${Plan.formatPlan(plan)}
62
+ </plan>
63
+ </project>
64
+ `,
65
+ }),
66
+ Prompt.userMessage({
67
+ content: [
68
+ Prompt.makePart('text', {
69
+ text: trim`
70
+ <event>
71
+ ${JSON.stringify(data.event, null, 2)}
72
+ </event>
73
+ `,
74
+ }),
75
+ ],
76
+ }),
77
+ ]),
78
+ });
79
+
80
+ if (isRelevant) {
81
+ const queueTarget = yield* Database.load(queue);
82
+ if ('queue' in data.event && data.event.item) {
83
+ const obj = data.event.item;
84
+ yield* Effect.promise(() => queueTarget.append([obj]));
85
+ } else if ('subject' in data.event && Ref.isRef(data.event.subject)) {
86
+ const obj = yield* Database.load(data.event.subject);
87
+ yield* Effect.promise(() => queueTarget.append([obj]));
88
+ } else {
89
+ throw new Error('Invalid event.');
90
+ }
91
+ }
92
+ },
93
+ Effect.scoped,
94
+ Effect.provide(AiService.model('@anthropic/claude-sonnet-4-5')),
95
+ ),
96
+ });
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { default as ProjectBlueprint } from './blueprint';
6
+ export { ProjectFunctions } from './functions';
7
+ export { syncProjectTriggers } from './sync-triggers';
@@ -0,0 +1,153 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Option from 'effect/Option';
7
+
8
+ import { Database, Feed, Filter, Obj, Ref } from '@dxos/echo';
9
+ import { FunctionDefinition, Trigger } from '@dxos/functions';
10
+ import { FeedAnnotation } from '@dxos/schema';
11
+
12
+ import { Project } from '../../types';
13
+
14
+ import { ProjectFunctions } from './functions';
15
+
16
+ /**
17
+ * Foreign key {@link PROJECT_TRIGGER_EXTENSION_KEY} => <project id : ObjectId>.
18
+ */
19
+ const PROJECT_TRIGGER_EXTENSION_KEY = 'org.dxos.extension.ProjectTrigger';
20
+
21
+ /**
22
+ * Foreign key {@link PROJECT_TRIGGER_TARGET_EXTENSION_KEY} => <dxn string of subscription target>.
23
+ */
24
+ const PROJECT_TRIGGER_TARGET_EXTENSION_KEY = 'org.dxos.extension.ProjectTriggerTarget';
25
+
26
+ /** Checks if an object's schema has the FeedAnnotation. */
27
+ const hasFeedAnnotation = (obj: Obj.Unknown): boolean => {
28
+ const schema = Obj.getSchema(obj);
29
+ if (!schema) {
30
+ return false;
31
+ }
32
+ const annotation = FeedAnnotation.get(schema);
33
+ return Option.isSome(annotation) && annotation.value === true;
34
+ };
35
+
36
+ /**
37
+ * Syncs triggers in the database with the project subscriptions.
38
+ *
39
+ * @param project - The project whose triggers should be synced.
40
+ * @returns An Effect that syncs triggers.
41
+ */
42
+ export const syncProjectTriggers = (project: Project.Project): Effect.Effect<void, never, Database.Service> =>
43
+ Effect.gen(function* () {
44
+ const triggers = yield* Database.runQuery(
45
+ Filter.foreignKeys(Trigger.Trigger, [{ source: PROJECT_TRIGGER_EXTENSION_KEY, id: project.id }]),
46
+ );
47
+
48
+ for (const trigger of triggers) {
49
+ const target = Obj.getKeys(trigger, PROJECT_TRIGGER_TARGET_EXTENSION_KEY).at(0)?.id;
50
+
51
+ const exists = project.subscriptions.find((subscription) => subscription.dxn.toString() === target);
52
+ if (!exists && !(project.useQualifyingAgent && target === Obj.getDXN(project)?.toString())) {
53
+ yield* Database.remove(trigger);
54
+ }
55
+ }
56
+
57
+ for (const subscription of project.subscriptions) {
58
+ const relevantTrigger = triggers.find((trigger) =>
59
+ Obj.getKeys(trigger, PROJECT_TRIGGER_TARGET_EXTENSION_KEY).some(
60
+ (key) => key.id === subscription.dxn.toString(),
61
+ ),
62
+ );
63
+ if (relevantTrigger) {
64
+ continue;
65
+ }
66
+
67
+ const targetOption = yield* Database.loadOption(subscription);
68
+ if (Option.isNone(targetOption)) {
69
+ continue;
70
+ }
71
+ const target = targetOption.value;
72
+
73
+ let feedObj: Feed.Feed | undefined;
74
+ if (Obj.instanceOf(Feed.Feed, target)) {
75
+ feedObj = target;
76
+ } else if (hasFeedAnnotation(target)) {
77
+ const feedRef = (target as Obj.Unknown & { feed?: Ref.Ref<Feed.Feed> }).feed;
78
+ feedObj = feedRef ? Option.getOrUndefined(yield* Database.loadOption(feedRef)) : undefined;
79
+ }
80
+
81
+ const queueDxn = Option.fromNullable(feedObj).pipe(
82
+ Option.filter(Obj.instanceOf(Feed.Feed)),
83
+ Option.map(Feed.getQueueDxn),
84
+ Option.getOrUndefined,
85
+ );
86
+ if (!queueDxn) {
87
+ continue;
88
+ }
89
+
90
+ yield* Database.add(
91
+ Trigger.make({
92
+ [Obj.Parent]: project,
93
+ [Obj.Meta]: {
94
+ keys: [
95
+ { source: PROJECT_TRIGGER_EXTENSION_KEY, id: project.id },
96
+ { source: PROJECT_TRIGGER_TARGET_EXTENSION_KEY, id: subscription.dxn.toString() },
97
+ ],
98
+ },
99
+ enabled: true,
100
+ spec: {
101
+ kind: 'queue',
102
+ queue: queueDxn.toString(),
103
+ },
104
+ function: Ref.make(
105
+ FunctionDefinition.serialize(
106
+ project.useQualifyingAgent ? ProjectFunctions.Qualifier : ProjectFunctions.Agent,
107
+ ),
108
+ ),
109
+ input: {
110
+ project: Ref.make(project),
111
+ event: '{{event}}',
112
+ },
113
+ concurrency: project.useQualifyingAgent ? 5 : undefined,
114
+ }),
115
+ );
116
+ }
117
+
118
+ if (project.useQualifyingAgent) {
119
+ const qualifierTrigger = triggers.find((trigger) =>
120
+ Obj.getKeys(trigger, PROJECT_TRIGGER_TARGET_EXTENSION_KEY).some(
121
+ (key) => key.id === Obj.getDXN(project)?.toString(),
122
+ ),
123
+ );
124
+ if (!qualifierTrigger && project.queue) {
125
+ yield* Database.add(
126
+ Trigger.make({
127
+ [Obj.Parent]: project,
128
+ [Obj.Meta]: {
129
+ keys: [
130
+ { source: PROJECT_TRIGGER_EXTENSION_KEY, id: project.id },
131
+ {
132
+ source: PROJECT_TRIGGER_TARGET_EXTENSION_KEY,
133
+ id: Obj.getDXN(project)?.toString() ?? '',
134
+ },
135
+ ],
136
+ },
137
+ function: Ref.make(FunctionDefinition.serialize(ProjectFunctions.Agent)),
138
+ enabled: true,
139
+ spec: {
140
+ kind: 'queue',
141
+ queue: project.queue.dxn.toString(),
142
+ },
143
+ input: {
144
+ project: Ref.make(project),
145
+ event: '{{event}}',
146
+ },
147
+ }),
148
+ );
149
+ }
150
+ }
151
+
152
+ yield* Database.flush();
153
+ });
@@ -0,0 +1,45 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { type AppCapabilities } from '@dxos/app-toolkit';
6
+ import { Blueprint, Template } from '@dxos/blueprints';
7
+ import { trim } from '@dxos/util';
8
+
9
+ import { ProjectWizardFunctions } from './functions';
10
+
11
+ const BLUEPRINT_KEY = 'org.dxos.blueprint.project-wizard';
12
+
13
+ const functions = Object.values(ProjectWizardFunctions);
14
+
15
+ /**
16
+ * Creates the Project blueprint. This is a function to avoid circular dependency issues.
17
+ */
18
+ const make = () =>
19
+ Blueprint.make({
20
+ key: BLUEPRINT_KEY,
21
+ name: 'Project Wizard',
22
+ description: 'Help the user create a new project.',
23
+ instructions: Template.make({
24
+ source: trim`
25
+ You are a wizard that helps the user create a new project.
26
+
27
+ Projects are goal oriented and autonomously driven by the agent.
28
+ Each project has a spec - the goal of the project.
29
+ The spec also typically describes what actions to perform in reaction to events (emails).
30
+ The project has a number of associated artifacts to work with.
31
+ Projects can subscribe to emails.
32
+
33
+ IMPORTANT: Before attempting to create a project call the [project-rules] tool to get the rules for creating a project.
34
+ `,
35
+ }),
36
+ tools: Blueprint.toolDefinitions({ functions }),
37
+ });
38
+
39
+ const blueprint: AppCapabilities.BlueprintDefinition = {
40
+ key: BLUEPRINT_KEY,
41
+ functions,
42
+ make,
43
+ };
44
+
45
+ export default blueprint;
@@ -0,0 +1,57 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Schema from 'effect/Schema';
7
+ import { Obj, Ref } from '@dxos/echo';
8
+ import { Blueprint } from '@dxos/blueprints';
9
+
10
+ import { defineFunction } from '@dxos/functions';
11
+
12
+ import { Project } from '../../../types';
13
+ import { ProjectBlueprint, syncProjectTriggers } from '../../project';
14
+
15
+ // TODO(dmaretskyi): Remove this with proper function typing.
16
+ const fixEffectType = <A, E, R>(
17
+ eff: Effect.Effect<A, E, R>,
18
+ ): Effect.Effect<A, E, Exclude<R, Blueprint.RegistryService>> => eff as any;
19
+
20
+ export default defineFunction({
21
+ key: 'org.dxos.function.project-wizard.create-project',
22
+ name: 'Create project',
23
+ description: 'Creates a new project.',
24
+ inputSchema: Schema.Struct({
25
+ name: Schema.String.annotations({
26
+ description: 'The name of the project to create.',
27
+ }),
28
+ spec: Schema.String.annotations({
29
+ description:
30
+ 'The goal of the project. Be specic but not to verbose. The agent will use this as a core objective and set of rules to follow.',
31
+ }),
32
+ blueprints: Schema.Array(Schema.String).annotations({
33
+ description: 'The keys blueprints to use for the project.',
34
+ examples: [['org.dxos.blueprint.markdown', 'org.dxos.blueprint.database']],
35
+ }),
36
+ subscriptions: Schema.Array(Ref.Ref(Obj.Unknown)).annotations({
37
+ description: 'The objects to subscribe to for the project. Can be references to mailboxes.',
38
+ }),
39
+ }),
40
+ outputSchema: Project.Project,
41
+ services: [Blueprint.RegistryService],
42
+ handler: Effect.fnUntraced(function* ({ data }) {
43
+ const project = yield* Project.makeInitialized(
44
+ {
45
+ name: data.name,
46
+ spec: data.spec,
47
+ blueprints: yield* Effect.forEach(data.blueprints, (key) =>
48
+ Blueprint.upsert(key).pipe(Effect.map(Ref.make), Effect.orDie),
49
+ ),
50
+ subscriptions: data.subscriptions,
51
+ },
52
+ Obj.clone(ProjectBlueprint.make()),
53
+ );
54
+ yield* syncProjectTriggers(project);
55
+ return project;
56
+ }, fixEffectType),
57
+ });
@@ -0,0 +1,13 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { default as CreateProject } from './create-project';
6
+ import { default as QueryBlueprints } from './query-blueprints';
7
+ import { default as ProjectRules } from './project-rules';
8
+
9
+ export const ProjectWizardFunctions = {
10
+ CreateProject,
11
+ QueryBlueprints,
12
+ ProjectRules,
13
+ };
@@ -0,0 +1,78 @@
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 { defineFunction } from '@dxos/functions';
9
+ import { trim } from '@dxos/util';
10
+
11
+ export default defineFunction({
12
+ key: 'org.dxos.function.project-wizard.project-rules',
13
+ name: 'Project rules',
14
+ description: 'Gets the rules for creating a project.',
15
+ inputSchema: Schema.Struct({}),
16
+ outputSchema: Schema.String,
17
+ handler: Effect.fnUntraced(function* ({ data }) {
18
+ return trim`
19
+ You can ask the user for qualifying questions about the projects.
20
+ If projects should actively read incoming emails, query for mailboxes and add a subscription to them.
21
+ Use [query-blueprints] function to query for available blueprints.
22
+ Use [create-project] function to create a new project.
23
+ After creating a project, explicitly remind the user to enable local triggers so the project can be driven autonomously.
24
+
25
+ Notable blueprints (query to get their keys):
26
+
27
+ - Database -- CRUD on objects in the ECHO database.
28
+ - Markdown -- Create and edit markdown documents.
29
+ - Websearch -- Search the web for information.
30
+ - Browser -- Virtual browser via playwright when simple WebSearch is not enough.
31
+ - Memory -- Memory to store and retrieve information.
32
+
33
+ Experimental blueprints that are discoraged:
34
+
35
+ - Research
36
+ - Design
37
+ - Project (not wizard) -- those are project internals, they are auto-added to every new project.
38
+
39
+ <example_project>
40
+ ## CRM from your inbox
41
+
42
+ Blueprints: database, websearch, browser
43
+
44
+ Subscribe to your inboxes.
45
+ Spec says that on every email we should extract People and Organizations and save them to the database, but first query the database for existing people and organizations to avoid duplicates.
46
+ Also run a quick research on the web to find more information about the person or organization and save it to the database.
47
+ </example_project>
48
+
49
+ <example_project>
50
+ ## Parcel tracking
51
+
52
+ Blueprints: database
53
+
54
+ Based on emails from vendors (amazon, fedex, etc.) track the status of the parcels ordered online and keep a table of orders.
55
+
56
+ Before creating a project, use the Database blueprint to create an Order schema:
57
+ - seller
58
+ - name
59
+ - price
60
+ - status (enum of: pending, shipped, waiting for pickup, delivered, cancelled, returned)
61
+ - tracking numbers/notes
62
+ - date of delivery
63
+ - shipping address
64
+ </example_project>
65
+
66
+ <example_project>
67
+ ## Comms assistant
68
+
69
+ Blueprints: database, markdown, inbox
70
+
71
+ Helps user maintain comms with external parites via email.
72
+ Ask user specifically who they want to communicate with and on what topic.
73
+ Project should keep a markdown document in artifacts outlining the current state of the comms.
74
+ Project should propose drafts to follow up on the comms. Only propose sensible drafts, do not propose drafts that are not relevant or actionable.
75
+ </example_project>
76
+ `;
77
+ }),
78
+ });
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Blueprint } from '@dxos/blueprints';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ import { defineFunction } from '@dxos/functions';
10
+
11
+ // TODO(dmaretskyi): Remove this with proper function typing.
12
+ const fixEffectType = <A, E, R>(
13
+ eff: Effect.Effect<A, E, R>,
14
+ ): Effect.Effect<A, E, Exclude<R, Blueprint.RegistryService>> => eff as any;
15
+
16
+ export default defineFunction({
17
+ key: 'org.dxos.function.project-wizard.query-blueprints',
18
+ name: 'Query blueprints',
19
+ description: 'Queries the blueprints.',
20
+ inputSchema: Schema.Struct({}),
21
+ outputSchema: Schema.Array(Blueprint.Blueprint),
22
+ services: [Blueprint.RegistryService],
23
+ handler: Effect.fnUntraced(function* ({ data }) {
24
+ const registry = yield* Blueprint.RegistryService;
25
+ return registry.query();
26
+ }, fixEffectType),
27
+ });
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { default as ProjectWizardBlueprint } from './blueprint';
6
+ export { ProjectWizardFunctions } from './functions';
@@ -3,12 +3,17 @@
3
3
  //
4
4
 
5
5
  import { ToolId } from '@dxos/ai';
6
+ import { type AppCapabilities } from '@dxos/app-toolkit';
6
7
  import { Blueprint } from '@dxos/blueprints';
7
8
  import { Ref } from '@dxos/echo';
8
9
  import { Text } from '@dxos/schema';
9
10
  import { trim } from '@dxos/util';
10
11
 
11
- import { Research } from '../../functions';
12
+ import { ResearchFunctions } from './functions';
13
+
14
+ const BLUEPRINT_KEY = 'org.dxos.blueprint.research';
15
+
16
+ const functions = Object.values(ResearchFunctions);
12
17
 
13
18
  /**
14
19
  * Agent prompt instructions for managing hierarchical task lists.
@@ -20,7 +25,7 @@ const instructions = trim`
20
25
  Structured data extraction is an experimental feature -- only enable it if the user explicitly requests it in the prompt.
21
26
  Prefer updating existing notes instead of creating new ones.
22
27
 
23
- <strcutured_mode>
28
+ <structured_mode>
24
29
  When you are done, reply with the created objects.
25
30
  Do not print the data, instead reply with inline references to the created objects.
26
31
  Those will be later substituted with the pills representing the created objects.
@@ -40,12 +45,21 @@ const instructions = trim`
40
45
  </unstructured_mode>
41
46
  `;
42
47
 
43
- export const blueprint = Blueprint.make({
44
- key: 'dxos.org/blueprint/research',
45
- name: 'Research',
46
- description: 'Researches the web and creates structured data.',
47
- instructions: {
48
- source: Ref.make(Text.make(instructions)),
49
- },
50
- tools: [Research.create, Research.research].map((fn) => ToolId.make(fn.key)),
51
- });
48
+ const make = () =>
49
+ Blueprint.make({
50
+ key: BLUEPRINT_KEY,
51
+ name: 'Research',
52
+ description: 'Researches the web and creates structured data.',
53
+ instructions: {
54
+ source: Ref.make(Text.make(instructions)),
55
+ },
56
+ tools: functions.map((fn) => ToolId.make(fn.key)),
57
+ });
58
+
59
+ const blueprint: AppCapabilities.BlueprintDefinition = {
60
+ key: BLUEPRINT_KEY,
61
+ functions,
62
+ make,
63
+ };
64
+
65
+ export default blueprint;
@@ -5,9 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
  import * as Schema from 'effect/Schema';
7
7
 
8
- import { ArtifactId } from '@dxos/assistant';
9
- import { Obj, Relation } from '@dxos/echo';
10
- import { Database } from '@dxos/echo';
8
+ import { Database, Obj, Ref, Relation } from '@dxos/echo';
11
9
  import { TracingService, defineFunction } from '@dxos/functions';
12
10
  import { log } from '@dxos/log';
13
11
  import { Markdown } from '@dxos/plugin-markdown/types';
@@ -15,11 +13,11 @@ import { HasSubject } from '@dxos/types';
15
13
  import { trim } from '@dxos/util';
16
14
 
17
15
  export default defineFunction({
18
- key: 'dxos.org/function/research/document-create',
16
+ key: 'org.dxos.function.research.document-create',
19
17
  name: 'Create research document',
20
18
  description: 'Creates a note summarizing the research.',
21
19
  inputSchema: Schema.Struct({
22
- subject: ArtifactId.annotations({
20
+ subject: Ref.Ref(Obj.Unknown).annotations({
23
21
  description: trim`
24
22
  ID of the object (organization, contact, etc.) for which the research was performed.
25
23
  `,
@@ -35,7 +33,7 @@ export default defineFunction({
35
33
  }),
36
34
  }),
37
35
  outputSchema: Schema.Struct({
38
- document: ArtifactId.annotations({
36
+ document: Schema.String.annotations({
39
37
  description: 'DXN of the created document.',
40
38
  }),
41
39
  }),
@@ -43,14 +41,13 @@ export default defineFunction({
43
41
  log.info('Creating research document', { subject, name, content });
44
42
 
45
43
  // TODO(burdon): Auto flush before and after calling function?
46
- yield* Database.Service.flush({ indexes: true });
44
+ yield* Database.flush();
47
45
  yield* TracingService.emitStatus({ message: 'Creating research document...' });
48
46
 
49
- // TODO(burdon): Type check.
50
- const target = (yield* Database.Service.resolve(ArtifactId.toDXN(subject))) as Obj.Unknown;
47
+ const target = yield* Database.load(subject);
51
48
 
52
49
  // Create document.
53
- const object = yield* Database.Service.add(
50
+ const object = yield* Database.add(
54
51
  Markdown.make({
55
52
  name,
56
53
  content,
@@ -58,7 +55,7 @@ export default defineFunction({
58
55
  );
59
56
 
60
57
  // Create relation.
61
- yield* Database.Service.add(
58
+ yield* Database.add(
62
59
  Relation.make(HasSubject.HasSubject, {
63
60
  [Relation.Source]: object,
64
61
  [Relation.Target]: target,
@@ -66,7 +63,7 @@ export default defineFunction({
66
63
  }),
67
64
  );
68
65
 
69
- yield* Database.Service.flush({ indexes: true });
66
+ yield* Database.flush();
70
67
  log.info('Created research document', { subject, object });
71
68
 
72
69
  return {
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import Create from './document-create';
6
+ import Research from './research';
7
+
8
+ export const ResearchFunctions = {
9
+ Create,
10
+ Research,
11
+ };
@@ -92,11 +92,11 @@ The following objects are already in the database, I will not submit them again,
92
92
 
93
93
  I will use the following schema to construct new objects:
94
94
 
95
- - type:dxos.org/type/Organization for Alphabet Inc.
96
- - type:dxos.org/type/Person for Ivan Zhao
97
- - type:dxos.org/type/Person for Simon Last
98
- - dxn:type:dxos.org/relation/Employer for Ivan's employer
99
- - dxn:type:dxos.org/relation/Employer for Simon's employer
95
+ - type:org.dxos.type.organization for Alphabet Inc.
96
+ - type:org.dxos.type.person for Ivan Zhao
97
+ - type:org.dxos.type.person for Simon Last
98
+ - dxn:type:org.dxos.relation.employer for Ivan's employer
99
+ - dxn:type:org.dxos.relation.employer for Simon's employer
100
100
 
101
101
  <status>Formatting results</status>
102
102