@dxos/assistant-toolkit 0.8.4-main.fcc0d83b33 → 0.8.4-staging.60fe92afc8

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 (531) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/neutral/add-artifact-54DVWE53.mjs +24 -0
  3. package/dist/lib/neutral/add-artifact-54DVWE53.mjs.map +7 -0
  4. package/dist/lib/neutral/{agent-6OHUAIA2.mjs → agent-LCBDWP74.mjs} +13 -13
  5. package/dist/lib/neutral/agent-LCBDWP74.mjs.map +7 -0
  6. package/dist/lib/neutral/{project-rules-FLUQQRPB.mjs → agent-rules-3TBAIVTS.mjs} +8 -8
  7. package/dist/lib/neutral/{project-rules-FLUQQRPB.mjs.map → agent-rules-3TBAIVTS.mjs.map} +2 -2
  8. package/dist/lib/neutral/{chunk-WIV7ZVRS.mjs → chunk-24L572PJ.mjs} +27 -16
  9. package/dist/lib/neutral/chunk-24L572PJ.mjs.map +7 -0
  10. package/dist/lib/neutral/{chunk-4T3LJGXI.mjs → chunk-3YH7MWSD.mjs} +27 -16
  11. package/dist/lib/neutral/chunk-3YH7MWSD.mjs.map +7 -0
  12. package/dist/lib/neutral/{chunk-CVUA23QI.mjs → chunk-4LFE5PQ3.mjs} +67 -32
  13. package/dist/lib/neutral/chunk-4LFE5PQ3.mjs.map +7 -0
  14. package/dist/lib/neutral/{chunk-JN4GARRQ.mjs → chunk-BOB6M2YM.mjs} +20 -11
  15. package/dist/lib/neutral/chunk-BOB6M2YM.mjs.map +7 -0
  16. package/dist/lib/neutral/{chunk-EJAQUAKM.mjs → chunk-DLVIJSH6.mjs} +24 -10
  17. package/dist/lib/neutral/chunk-DLVIJSH6.mjs.map +7 -0
  18. package/dist/lib/neutral/{chunk-WLR3BGO4.mjs → chunk-FQNZX2SH.mjs} +15 -4
  19. package/dist/lib/neutral/chunk-FQNZX2SH.mjs.map +7 -0
  20. package/dist/lib/neutral/{chunk-YXOVSRFU.mjs → chunk-JRUTUKPS.mjs} +11 -13
  21. package/dist/lib/neutral/chunk-JRUTUKPS.mjs.map +7 -0
  22. package/dist/lib/neutral/chunk-KC2LPECT.mjs +76 -0
  23. package/dist/lib/neutral/chunk-KC2LPECT.mjs.map +7 -0
  24. package/dist/lib/neutral/chunk-NSAUN2IX.mjs +66 -0
  25. package/dist/lib/neutral/chunk-NSAUN2IX.mjs.map +7 -0
  26. package/dist/lib/neutral/{chunk-GSG4JGIY.mjs → chunk-RNIUE4LK.mjs} +38 -23
  27. package/dist/lib/neutral/chunk-RNIUE4LK.mjs.map +7 -0
  28. package/dist/lib/neutral/{chunk-KGU725LW.mjs → chunk-SYUTQPSB.mjs} +4 -7
  29. package/dist/lib/neutral/chunk-SYUTQPSB.mjs.map +7 -0
  30. package/dist/lib/neutral/chunk-U5FCQXA2.mjs +69 -0
  31. package/dist/lib/neutral/chunk-U5FCQXA2.mjs.map +7 -0
  32. package/dist/lib/neutral/{chunk-SVI25Z2Y.mjs → chunk-URUJQGI6.mjs} +72 -58
  33. package/dist/lib/neutral/chunk-URUJQGI6.mjs.map +7 -0
  34. package/dist/lib/neutral/{chunk-NR3GTWRC.mjs → chunk-Z3KITY4U.mjs} +9 -14
  35. package/dist/lib/neutral/chunk-Z3KITY4U.mjs.map +7 -0
  36. package/dist/lib/neutral/{chunk-VSDP6SRY.mjs → chunk-ZQDWSV26.mjs} +19 -8
  37. package/dist/lib/neutral/chunk-ZQDWSV26.mjs.map +7 -0
  38. package/dist/lib/neutral/{context-add-IIDPRRVB.mjs → context-add-KWEKPGMI.mjs} +5 -5
  39. package/dist/lib/neutral/context-add-KWEKPGMI.mjs.map +7 -0
  40. package/dist/lib/neutral/{context-remove-RDYV4PD4.mjs → context-remove-HIQFSVHW.mjs} +5 -5
  41. package/dist/lib/neutral/context-remove-HIQFSVHW.mjs.map +7 -0
  42. package/dist/lib/neutral/{create-project-MPAMKQ3T.mjs → create-agent-KUTBEXLJ.mjs} +13 -14
  43. package/dist/lib/neutral/create-agent-KUTBEXLJ.mjs.map +7 -0
  44. package/dist/lib/neutral/definitions-6HU2P7R7.mjs +17 -0
  45. package/dist/lib/neutral/delegate-task-E7WLHT6S.mjs +13 -0
  46. package/dist/lib/neutral/delegate-task-E7WLHT6S.mjs.map +7 -0
  47. package/dist/lib/neutral/{delete-J3PMWP7Z.mjs → delete-QHGM7N23.mjs} +4 -4
  48. package/dist/lib/neutral/{delete-J3PMWP7Z.mjs.map → delete-QHGM7N23.mjs.map} +1 -1
  49. package/dist/lib/neutral/{enable-blueprints-LELPQHY5.mjs → enable-blueprints-OGYSQ7HD.mjs} +14 -15
  50. package/dist/lib/neutral/enable-blueprints-OGYSQ7HD.mjs.map +7 -0
  51. package/dist/lib/neutral/fetch-O6G46HJH.mjs +24 -0
  52. package/dist/lib/neutral/fetch-O6G46HJH.mjs.map +7 -0
  53. package/dist/lib/neutral/{fetch-messages-OS74FP76.mjs → fetch-messages-4EVGVEQK.mjs} +8 -9
  54. package/dist/lib/neutral/fetch-messages-4EVGVEQK.mjs.map +7 -0
  55. package/dist/lib/neutral/{get-context-JRTOOA5O.mjs → get-context-X4FCUMLK.mjs} +26 -12
  56. package/dist/lib/neutral/get-context-X4FCUMLK.mjs.map +7 -0
  57. package/dist/lib/neutral/index.mjs +640 -479
  58. package/dist/lib/neutral/index.mjs.map +4 -4
  59. package/dist/lib/neutral/{load-LI7HHVD6.mjs → load-C4OPO7RD.mjs} +3 -3
  60. package/dist/lib/neutral/{load-LI7HHVD6.mjs.map → load-C4OPO7RD.mjs.map} +1 -1
  61. package/dist/lib/neutral/meta.json +1 -1
  62. package/dist/lib/neutral/object-create-F7R7IRW5.mjs +32 -0
  63. package/dist/lib/neutral/object-create-F7R7IRW5.mjs.map +7 -0
  64. package/dist/lib/neutral/{object-delete-I266YAXI.mjs → object-delete-3TJ3XMLN.mjs} +3 -3
  65. package/dist/lib/neutral/{object-delete-I266YAXI.mjs.map → object-delete-3TJ3XMLN.mjs.map} +1 -1
  66. package/dist/lib/neutral/{object-update-HY4GI7LA.mjs → object-update-EBRM5AKN.mjs} +4 -4
  67. package/dist/lib/neutral/{object-update-HY4GI7LA.mjs.map → object-update-EBRM5AKN.mjs.map} +3 -3
  68. package/dist/lib/neutral/{prompt-4UMXX6QU.mjs → prompt-QL7TTLM3.mjs} +22 -24
  69. package/dist/lib/neutral/prompt-QL7TTLM3.mjs.map +7 -0
  70. package/dist/lib/neutral/{qualifier-7BUCOEKK.mjs → qualifier-QAW6LSYF.mjs} +18 -17
  71. package/dist/lib/neutral/qualifier-QAW6LSYF.mjs.map +7 -0
  72. package/dist/lib/neutral/{query-U56GNEV6.mjs → query-6XCQIIZC.mjs} +5 -5
  73. package/dist/lib/neutral/{query-U56GNEV6.mjs.map → query-6XCQIIZC.mjs.map} +4 -4
  74. package/dist/lib/neutral/{query-B3NOYFCK.mjs → query-QGSHZMCD.mjs} +14 -25
  75. package/dist/lib/neutral/query-QGSHZMCD.mjs.map +7 -0
  76. package/dist/lib/neutral/query-blueprints-7NDHHM7U.mjs +17 -0
  77. package/dist/lib/neutral/query-blueprints-7NDHHM7U.mjs.map +7 -0
  78. package/dist/lib/neutral/relation-create-WA2DM76W.mjs +31 -0
  79. package/dist/lib/neutral/relation-create-WA2DM76W.mjs.map +7 -0
  80. package/dist/lib/neutral/{relation-delete-LXY7W2YO.mjs → relation-delete-66XP7KL7.mjs} +3 -3
  81. package/dist/lib/neutral/{relation-delete-LXY7W2YO.mjs.map → relation-delete-66XP7KL7.mjs.map} +1 -1
  82. package/dist/lib/neutral/{save-GWAPLT3Z.mjs → save-HQY35ACW.mjs} +4 -4
  83. package/dist/lib/neutral/{save-GWAPLT3Z.mjs.map → save-HQY35ACW.mjs.map} +1 -1
  84. package/dist/lib/neutral/schema-add-2AWYVGOC.mjs +25 -0
  85. package/dist/lib/neutral/schema-add-2AWYVGOC.mjs.map +7 -0
  86. package/dist/lib/neutral/schema-list-74CQW2N3.mjs +37 -0
  87. package/dist/lib/neutral/schema-list-74CQW2N3.mjs.map +7 -0
  88. package/dist/lib/neutral/{sync-issues-A2RJNPEF.mjs → sync-issues-VUX4OWPO.mjs} +13 -14
  89. package/dist/lib/neutral/sync-issues-VUX4OWPO.mjs.map +7 -0
  90. package/dist/lib/neutral/{sync-triggers-NV4JCRN5.mjs → sync-triggers-JEVTYIGU.mjs} +45 -44
  91. package/dist/lib/neutral/sync-triggers-JEVTYIGU.mjs.map +7 -0
  92. package/dist/lib/neutral/{tag-add-5NOHUTIE.mjs → tag-add-6EGIY2CC.mjs} +5 -6
  93. package/dist/lib/neutral/tag-add-6EGIY2CC.mjs.map +7 -0
  94. package/dist/lib/neutral/{tag-remove-QTKYDJAW.mjs → tag-remove-XVTYJRI7.mjs} +5 -6
  95. package/dist/lib/neutral/tag-remove-XVTYJRI7.mjs.map +7 -0
  96. package/dist/lib/neutral/testing/index.mjs +10 -13
  97. package/dist/lib/neutral/testing/index.mjs.map +3 -3
  98. package/dist/lib/neutral/update-tasks-N65UQUHS.mjs +13 -0
  99. package/dist/lib/neutral/update-tasks-N65UQUHS.mjs.map +7 -0
  100. package/dist/types/src/blueprints/agent/blueprint.d.ts.map +1 -0
  101. package/dist/types/src/blueprints/agent/blueprint.test.d.ts.map +1 -0
  102. package/dist/types/src/blueprints/agent/index.d.ts +3 -0
  103. package/dist/types/src/blueprints/agent/index.d.ts.map +1 -0
  104. package/dist/types/src/blueprints/agent/operations/add-artifact.d.ts +4 -0
  105. package/dist/types/src/blueprints/agent/operations/add-artifact.d.ts.map +1 -0
  106. package/dist/types/src/blueprints/agent/operations/agent.d.ts.map +1 -0
  107. package/dist/types/src/blueprints/{project/functions → agent/operations}/definitions.d.ts +68 -51
  108. package/dist/types/src/blueprints/agent/operations/definitions.d.ts.map +1 -0
  109. package/dist/types/src/blueprints/agent/operations/get-context.d.ts +4 -0
  110. package/dist/types/src/blueprints/agent/operations/get-context.d.ts.map +1 -0
  111. package/dist/types/src/blueprints/{project/functions → agent/operations}/index.d.ts +1 -1
  112. package/dist/types/src/blueprints/agent/operations/index.d.ts.map +1 -0
  113. package/dist/types/src/blueprints/agent/operations/qualifier.d.ts +5 -0
  114. package/dist/types/src/blueprints/agent/operations/qualifier.d.ts.map +1 -0
  115. package/dist/types/src/blueprints/agent-wizard/blueprint.d.ts.map +1 -0
  116. package/dist/types/src/blueprints/agent-wizard/index.d.ts +3 -0
  117. package/dist/types/src/blueprints/agent-wizard/index.d.ts.map +1 -0
  118. package/dist/types/src/blueprints/{project-wizard/functions/project-rules.d.ts → agent-wizard/operations/agent-rules.d.ts} +1 -1
  119. package/dist/types/src/blueprints/agent-wizard/operations/agent-rules.d.ts.map +1 -0
  120. package/dist/types/src/blueprints/agent-wizard/operations/create-agent.d.ts +56 -0
  121. package/dist/types/src/blueprints/agent-wizard/operations/create-agent.d.ts.map +1 -0
  122. package/dist/types/src/blueprints/agent-wizard/operations/definitions.d.ts +105 -0
  123. package/dist/types/src/blueprints/agent-wizard/operations/definitions.d.ts.map +1 -0
  124. package/dist/types/src/blueprints/{project-wizard/functions → agent-wizard/operations}/index.d.ts +1 -1
  125. package/dist/types/src/blueprints/agent-wizard/operations/index.d.ts.map +1 -0
  126. package/dist/types/src/blueprints/{project-wizard/functions → agent-wizard/operations}/sync-triggers.d.ts +24 -19
  127. package/dist/types/src/blueprints/agent-wizard/operations/sync-triggers.d.ts.map +1 -0
  128. package/dist/types/src/blueprints/automation/blueprint.d.ts.map +1 -1
  129. package/dist/types/src/blueprints/blueprint-manager/index.d.ts +1 -1
  130. package/dist/types/src/blueprints/blueprint-manager/index.d.ts.map +1 -1
  131. package/dist/types/src/blueprints/blueprint-manager/{functions → operations}/definitions.d.ts +19 -19
  132. package/dist/types/src/blueprints/blueprint-manager/operations/definitions.d.ts.map +1 -0
  133. package/dist/types/src/blueprints/blueprint-manager/{functions → operations}/enable-blueprints.d.ts +10 -10
  134. package/dist/types/src/blueprints/blueprint-manager/operations/enable-blueprints.d.ts.map +1 -0
  135. package/dist/types/src/blueprints/blueprint-manager/{functions → operations}/index.d.ts +1 -1
  136. package/dist/types/src/blueprints/blueprint-manager/operations/index.d.ts.map +1 -0
  137. package/dist/types/src/blueprints/blueprint-manager/{functions → operations}/query-blueprints.d.ts +9 -8
  138. package/dist/types/src/blueprints/blueprint-manager/operations/query-blueprints.d.ts.map +1 -0
  139. package/dist/types/src/blueprints/database/index.d.ts +1 -1
  140. package/dist/types/src/blueprints/database/index.d.ts.map +1 -1
  141. package/dist/types/src/blueprints/database/operations/context-add.d.ts +7 -0
  142. package/dist/types/src/blueprints/database/operations/context-add.d.ts.map +1 -0
  143. package/dist/types/src/blueprints/database/operations/context-remove.d.ts +7 -0
  144. package/dist/types/src/blueprints/database/operations/context-remove.d.ts.map +1 -0
  145. package/dist/types/src/blueprints/database/operations/definitions.d.ts +65 -0
  146. package/dist/types/src/blueprints/database/operations/definitions.d.ts.map +1 -0
  147. package/dist/types/src/blueprints/database/{functions → operations}/index.d.ts +1 -1
  148. package/dist/types/src/blueprints/database/operations/index.d.ts.map +1 -0
  149. package/dist/types/src/blueprints/database/operations/load.d.ts +7 -0
  150. package/dist/types/src/blueprints/database/operations/load.d.ts.map +1 -0
  151. package/dist/types/src/blueprints/database/operations/object-create.d.ts.map +1 -0
  152. package/dist/types/src/blueprints/database/{functions → operations}/object-delete.d.ts +1 -1
  153. package/dist/types/src/blueprints/database/operations/object-delete.d.ts.map +1 -0
  154. package/dist/types/src/blueprints/database/operations/object-update.d.ts +10 -0
  155. package/dist/types/src/blueprints/database/operations/object-update.d.ts.map +1 -0
  156. package/dist/types/src/blueprints/database/{functions → operations}/query.d.ts +2 -3
  157. package/dist/types/src/blueprints/database/operations/query.d.ts.map +1 -0
  158. package/dist/types/src/blueprints/database/operations/relation-create.d.ts +10 -0
  159. package/dist/types/src/blueprints/database/operations/relation-create.d.ts.map +1 -0
  160. package/dist/types/src/blueprints/database/operations/relation-delete.d.ts +7 -0
  161. package/dist/types/src/blueprints/database/operations/relation-delete.d.ts.map +1 -0
  162. package/dist/types/src/blueprints/database/operations/schema-add.d.ts.map +1 -0
  163. package/dist/types/src/blueprints/database/operations/schema-list.d.ts.map +1 -0
  164. package/dist/types/src/blueprints/database/operations/tag-add.d.ts +11 -0
  165. package/dist/types/src/blueprints/database/operations/tag-add.d.ts.map +1 -0
  166. package/dist/types/src/blueprints/database/operations/tag-remove.d.ts +11 -0
  167. package/dist/types/src/blueprints/database/operations/tag-remove.d.ts.map +1 -0
  168. package/dist/types/src/blueprints/delegation/blueprint.d.ts +4 -0
  169. package/dist/types/src/blueprints/delegation/blueprint.d.ts.map +1 -0
  170. package/dist/types/src/blueprints/delegation/index.d.ts +3 -0
  171. package/dist/types/src/blueprints/delegation/index.d.ts.map +1 -0
  172. package/dist/types/src/blueprints/delegation/operations/delegate-task.d.ts +14 -0
  173. package/dist/types/src/blueprints/delegation/operations/delegate-task.d.ts.map +1 -0
  174. package/dist/types/src/blueprints/delegation/operations/delegate-task.test.d.ts +2 -0
  175. package/dist/types/src/blueprints/delegation/operations/delegate-task.test.d.ts.map +1 -0
  176. package/dist/types/src/blueprints/delegation/operations/index.d.ts +4 -0
  177. package/dist/types/src/blueprints/delegation/operations/index.d.ts.map +1 -0
  178. package/dist/types/src/blueprints/discord/index.d.ts +1 -1
  179. package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
  180. package/dist/types/src/blueprints/discord/{functions → operations}/definitions.d.ts +2 -3
  181. package/dist/types/src/blueprints/discord/operations/definitions.d.ts.map +1 -0
  182. package/dist/types/src/blueprints/discord/{functions → operations}/fetch-messages.d.ts +2 -3
  183. package/dist/types/src/blueprints/discord/operations/fetch-messages.d.ts.map +1 -0
  184. package/dist/types/src/blueprints/discord/operations/fetch-messages.test.d.ts.map +1 -0
  185. package/dist/types/src/blueprints/discord/{functions → operations}/index.d.ts +1 -1
  186. package/dist/types/src/blueprints/discord/operations/index.d.ts.map +1 -0
  187. package/dist/types/src/blueprints/github/index.d.ts +1 -1
  188. package/dist/types/src/blueprints/github/index.d.ts.map +1 -1
  189. package/dist/types/src/blueprints/github/operations/definitions.d.ts +7 -0
  190. package/dist/types/src/blueprints/github/operations/definitions.d.ts.map +1 -0
  191. package/dist/types/src/blueprints/github/{functions → operations}/fetch-prs.d.ts +2 -3
  192. package/dist/types/src/blueprints/github/operations/fetch-prs.d.ts.map +1 -0
  193. package/dist/types/src/blueprints/github/{functions → operations}/index.d.ts +1 -1
  194. package/dist/types/src/blueprints/github/operations/index.d.ts.map +1 -0
  195. package/dist/types/src/blueprints/index.d.ts +8 -7
  196. package/dist/types/src/blueprints/index.d.ts.map +1 -1
  197. package/dist/types/src/blueprints/linear/index.d.ts +1 -1
  198. package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
  199. package/dist/types/src/blueprints/linear/operations/definitions.d.ts +6 -0
  200. package/dist/types/src/blueprints/linear/operations/definitions.d.ts.map +1 -0
  201. package/dist/types/src/blueprints/linear/{functions → operations}/index.d.ts +1 -1
  202. package/dist/types/src/blueprints/linear/operations/index.d.ts.map +1 -0
  203. package/dist/types/src/blueprints/linear/operations/linear.test.d.ts.map +1 -0
  204. package/dist/types/src/blueprints/linear/{functions → operations}/sync-issues.d.ts +2 -3
  205. package/dist/types/src/blueprints/linear/operations/sync-issues.d.ts.map +1 -0
  206. package/dist/types/src/blueprints/memory/index.d.ts +1 -1
  207. package/dist/types/src/blueprints/memory/index.d.ts.map +1 -1
  208. package/dist/types/src/blueprints/memory/{functions → operations}/definitions.d.ts +2 -2
  209. package/dist/types/src/blueprints/memory/operations/definitions.d.ts.map +1 -0
  210. package/dist/types/src/blueprints/memory/{functions → operations}/delete.d.ts +2 -2
  211. package/dist/types/src/blueprints/memory/operations/delete.d.ts.map +1 -0
  212. package/dist/types/src/blueprints/memory/{functions → operations}/index.d.ts +1 -1
  213. package/dist/types/src/blueprints/memory/operations/index.d.ts.map +1 -0
  214. package/dist/types/src/blueprints/memory/operations/query.d.ts.map +1 -0
  215. package/dist/types/src/blueprints/memory/operations/save.d.ts.map +1 -0
  216. package/dist/types/src/blueprints/planning/index.d.ts +1 -1
  217. package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
  218. package/dist/types/src/blueprints/planning/{functions → operations}/index.d.ts +1 -1
  219. package/dist/types/src/blueprints/planning/operations/index.d.ts.map +1 -0
  220. package/dist/types/src/blueprints/planning/operations/update-tasks.d.ts +24 -0
  221. package/dist/types/src/blueprints/planning/operations/update-tasks.d.ts.map +1 -0
  222. package/dist/types/src/blueprints/planning/operations/update-tasks.test.d.ts +2 -0
  223. package/dist/types/src/blueprints/planning/operations/update-tasks.test.d.ts.map +1 -0
  224. package/dist/types/src/blueprints/testing.d.ts +5 -5
  225. package/dist/types/src/blueprints/testing.d.ts.map +1 -1
  226. package/dist/types/src/blueprints/websearch/index.d.ts +1 -1
  227. package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
  228. package/dist/types/src/blueprints/websearch/operations/definitions.d.ts.map +1 -0
  229. package/dist/types/src/blueprints/websearch/operations/fetch.d.ts.map +1 -0
  230. package/dist/types/src/blueprints/websearch/{functions → operations}/index.d.ts +1 -1
  231. package/dist/types/src/blueprints/websearch/operations/index.d.ts.map +1 -0
  232. package/dist/types/src/blueprints/websearch/toolkit.d.ts +1 -1
  233. package/dist/types/src/crud/graph.d.ts +8 -11
  234. package/dist/types/src/crud/graph.d.ts.map +1 -1
  235. package/dist/types/src/errors.d.ts +3 -3
  236. package/dist/types/src/errors.d.ts.map +1 -1
  237. package/dist/types/src/functions/agent/blueprint-resolution.test.d.ts +2 -0
  238. package/dist/types/src/functions/agent/blueprint-resolution.test.d.ts.map +1 -0
  239. package/dist/types/src/functions/agent/definitions.d.ts +22 -30
  240. package/dist/types/src/functions/agent/definitions.d.ts.map +1 -1
  241. package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
  242. package/dist/types/src/index.d.ts +1 -0
  243. package/dist/types/src/index.d.ts.map +1 -1
  244. package/dist/types/src/supervisor/delegation-strategy.d.ts +9 -0
  245. package/dist/types/src/supervisor/delegation-strategy.d.ts.map +1 -0
  246. package/dist/types/src/supervisor/index.d.ts +2 -0
  247. package/dist/types/src/supervisor/index.d.ts.map +1 -0
  248. package/dist/types/src/sync/sync.d.ts +1 -2
  249. package/dist/types/src/sync/sync.d.ts.map +1 -1
  250. package/dist/types/src/testing/plugins.d.ts +1 -1
  251. package/dist/types/src/testing/plugins.d.ts.map +1 -1
  252. package/dist/types/src/toolkits/WebToolkit.d.ts +1 -1
  253. package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -1
  254. package/dist/types/src/types/Agent.d.ts +47 -30
  255. package/dist/types/src/types/Agent.d.ts.map +1 -1
  256. package/dist/types/src/types/Agent.test.d.ts +2 -0
  257. package/dist/types/src/types/Agent.test.d.ts.map +1 -0
  258. package/dist/types/src/types/Chat.d.ts +17 -20
  259. package/dist/types/src/types/Chat.d.ts.map +1 -1
  260. package/dist/types/src/types/McpServer.d.ts +5 -3
  261. package/dist/types/src/types/McpServer.d.ts.map +1 -1
  262. package/dist/types/src/types/Memory.d.ts +1 -2
  263. package/dist/types/src/types/Memory.d.ts.map +1 -1
  264. package/dist/types/src/types/Plan.d.ts +28 -25
  265. package/dist/types/src/types/Plan.d.ts.map +1 -1
  266. package/dist/types/tsconfig.tsbuildinfo +1 -1
  267. package/package.json +32 -30
  268. package/src/blueprints/AGENTS.md +13 -0
  269. package/src/blueprints/agent/blueprint.conversations.json +1 -0
  270. package/src/blueprints/{project → agent}/blueprint.test.ts +40 -36
  271. package/src/blueprints/{project → agent}/blueprint.ts +3 -3
  272. package/src/blueprints/agent/index.ts +6 -0
  273. package/src/blueprints/{project/functions → agent/operations}/add-artifact.ts +3 -13
  274. package/src/blueprints/{project/functions → agent/operations}/agent.ts +6 -6
  275. package/src/blueprints/{project/functions → agent/operations}/definitions.ts +19 -15
  276. package/src/blueprints/{project/functions → agent/operations}/get-context.ts +17 -5
  277. package/src/blueprints/{project/functions → agent/operations}/index.ts +1 -1
  278. package/src/blueprints/{project/functions → agent/operations}/qualifier.ts +9 -8
  279. package/src/blueprints/{project-wizard → agent-wizard}/blueprint.ts +2 -2
  280. package/src/blueprints/{project-wizard → agent-wizard}/index.ts +1 -1
  281. package/src/blueprints/{project-wizard/functions/create-project.ts → agent-wizard/operations/create-agent.ts} +2 -3
  282. package/src/blueprints/{project-wizard/functions → agent-wizard/operations}/definitions.ts +10 -8
  283. package/src/blueprints/{project-wizard/functions → agent-wizard/operations}/index.ts +3 -3
  284. package/src/blueprints/{project-wizard/functions → agent-wizard/operations}/sync-triggers.ts +51 -41
  285. package/src/blueprints/automation/blueprint.ts +12 -14
  286. package/src/blueprints/blueprint-manager/blueprint.conversations.json +1 -1
  287. package/src/blueprints/blueprint-manager/blueprint.test.ts +27 -70
  288. package/src/blueprints/blueprint-manager/blueprint.ts +6 -6
  289. package/src/blueprints/blueprint-manager/index.ts +1 -1
  290. package/src/blueprints/blueprint-manager/operations/definitions.ts +48 -0
  291. package/src/blueprints/blueprint-manager/{functions → operations}/enable-blueprints.ts +11 -9
  292. package/src/blueprints/blueprint-manager/{functions → operations}/index.ts +1 -2
  293. package/src/blueprints/blueprint-manager/operations/query-blueprints.ts +19 -0
  294. package/src/blueprints/browser/blueprint.conversations.json +1 -0
  295. package/src/blueprints/browser/blueprint.test.ts +10 -10
  296. package/src/blueprints/browser/blueprint.ts +1 -1
  297. package/src/blueprints/database/blueprint.conversations.json +1 -1
  298. package/src/blueprints/database/blueprint.test.ts +38 -39
  299. package/src/blueprints/database/blueprint.ts +2 -2
  300. package/src/blueprints/database/index.ts +1 -16
  301. package/src/blueprints/database/{functions → operations}/context-add.ts +2 -2
  302. package/src/blueprints/database/{functions → operations}/context-remove.ts +2 -2
  303. package/src/blueprints/database/{functions → operations}/definitions.ts +41 -27
  304. package/src/blueprints/database/{functions → operations}/index.ts +1 -1
  305. package/src/blueprints/database/{functions → operations}/object-create.ts +8 -6
  306. package/src/blueprints/database/{functions → operations}/object-update.ts +1 -1
  307. package/src/blueprints/database/{functions → operations}/query.ts +17 -12
  308. package/src/blueprints/database/{functions → operations}/relation-create.ts +7 -5
  309. package/src/blueprints/database/operations/schema-add.ts +23 -0
  310. package/src/blueprints/database/{functions → operations}/schema-list.ts +12 -9
  311. package/src/blueprints/database/{functions → operations}/tag-add.ts +2 -3
  312. package/src/blueprints/database/{functions → operations}/tag-remove.ts +2 -3
  313. package/src/blueprints/delegation/blueprint.ts +24 -0
  314. package/src/blueprints/delegation/index.ts +6 -0
  315. package/src/blueprints/delegation/operations/delegate-task.test.ts +55 -0
  316. package/src/blueprints/delegation/operations/delegate-task.ts +57 -0
  317. package/src/blueprints/delegation/operations/index.ts +9 -0
  318. package/src/blueprints/discord/blueprint.ts +2 -2
  319. package/src/blueprints/discord/index.ts +1 -1
  320. package/src/blueprints/discord/{functions → operations}/definitions.ts +5 -4
  321. package/src/blueprints/discord/{functions → operations}/fetch-messages.test.ts +8 -3
  322. package/src/blueprints/discord/{functions → operations}/fetch-messages.ts +2 -3
  323. package/src/blueprints/discord/{functions → operations}/index.ts +1 -1
  324. package/src/blueprints/github/index.ts +1 -1
  325. package/src/blueprints/github/{functions → operations}/definitions.ts +5 -4
  326. package/src/blueprints/github/{functions → operations}/fetch-prs.ts +3 -3
  327. package/src/blueprints/github/{functions → operations}/index.ts +1 -1
  328. package/src/blueprints/index.ts +8 -7
  329. package/src/blueprints/linear/blueprint.ts +2 -2
  330. package/src/blueprints/linear/index.ts +1 -1
  331. package/src/blueprints/linear/{functions → operations}/definitions.ts +5 -4
  332. package/src/blueprints/linear/{functions → operations}/index.ts +1 -1
  333. package/src/blueprints/linear/{functions → operations}/linear.test.ts +5 -7
  334. package/src/blueprints/linear/{functions → operations}/sync-issues.ts +6 -7
  335. package/src/blueprints/memory/blueprint.conversations.json +1 -1
  336. package/src/blueprints/memory/blueprint.test.ts +11 -12
  337. package/src/blueprints/memory/blueprint.ts +2 -2
  338. package/src/blueprints/memory/index.ts +1 -1
  339. package/src/blueprints/memory/{functions → operations}/definitions.ts +7 -3
  340. package/src/blueprints/memory/{functions → operations}/index.ts +1 -1
  341. package/src/blueprints/memory/{functions → operations}/query.ts +1 -1
  342. package/src/blueprints/planning/blueprint.ts +2 -2
  343. package/src/blueprints/planning/index.ts +1 -1
  344. package/src/blueprints/planning/{functions → operations}/index.ts +1 -1
  345. package/src/blueprints/planning/{functions/definitions.ts → operations/update-tasks.md} +29 -50
  346. package/src/blueprints/planning/operations/update-tasks.test.ts +55 -0
  347. package/src/blueprints/planning/operations/update-tasks.ts +71 -0
  348. package/src/blueprints/testing.ts +12 -6
  349. package/src/blueprints/websearch/blueprint.conversations.json +1 -1
  350. package/src/blueprints/websearch/blueprint.test.ts +3 -2
  351. package/src/blueprints/websearch/blueprint.ts +3 -3
  352. package/src/blueprints/websearch/index.ts +1 -1
  353. package/src/blueprints/websearch/{functions → operations}/definitions.ts +3 -1
  354. package/src/blueprints/websearch/operations/fetch.ts +26 -0
  355. package/src/blueprints/websearch/{functions → operations}/index.ts +1 -1
  356. package/src/crud/graph.test.ts +1 -1
  357. package/src/crud/graph.ts +149 -165
  358. package/src/errors.ts +3 -3
  359. package/src/functions/agent/blueprint-resolution.test.ts +131 -0
  360. package/src/functions/agent/definitions.ts +14 -9
  361. package/src/functions/agent/prompt.conversations.json +1 -1
  362. package/src/functions/agent/prompt.test.ts +11 -16
  363. package/src/functions/agent/prompt.ts +27 -24
  364. package/src/index.ts +1 -0
  365. package/src/supervisor/delegation-strategy.ts +188 -0
  366. package/src/supervisor/index.ts +5 -0
  367. package/src/sync/sync.ts +9 -8
  368. package/src/testing/plugins.tsx +10 -15
  369. package/src/toolkits/WebToolkit.ts +13 -2
  370. package/src/types/Agent.test.ts +93 -0
  371. package/src/types/Agent.ts +97 -62
  372. package/src/types/Chat.ts +11 -21
  373. package/src/types/McpServer.ts +10 -16
  374. package/src/types/Memory.ts +5 -7
  375. package/src/types/Plan.ts +14 -17
  376. package/dist/lib/neutral/add-artifact-XDFUXRY5.mjs +0 -30
  377. package/dist/lib/neutral/add-artifact-XDFUXRY5.mjs.map +0 -7
  378. package/dist/lib/neutral/agent-6OHUAIA2.mjs.map +0 -7
  379. package/dist/lib/neutral/chunk-4T3LJGXI.mjs.map +0 -7
  380. package/dist/lib/neutral/chunk-CVUA23QI.mjs.map +0 -7
  381. package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +0 -7
  382. package/dist/lib/neutral/chunk-GSG4JGIY.mjs.map +0 -7
  383. package/dist/lib/neutral/chunk-JN4GARRQ.mjs.map +0 -7
  384. package/dist/lib/neutral/chunk-KGU725LW.mjs.map +0 -7
  385. package/dist/lib/neutral/chunk-NR3GTWRC.mjs.map +0 -7
  386. package/dist/lib/neutral/chunk-P5LAPHCG.mjs +0 -140
  387. package/dist/lib/neutral/chunk-P5LAPHCG.mjs.map +0 -7
  388. package/dist/lib/neutral/chunk-SVI25Z2Y.mjs.map +0 -7
  389. package/dist/lib/neutral/chunk-VSDP6SRY.mjs.map +0 -7
  390. package/dist/lib/neutral/chunk-WIV7ZVRS.mjs.map +0 -7
  391. package/dist/lib/neutral/chunk-WLR3BGO4.mjs.map +0 -7
  392. package/dist/lib/neutral/chunk-YSYNXOZA.mjs +0 -68
  393. package/dist/lib/neutral/chunk-YSYNXOZA.mjs.map +0 -7
  394. package/dist/lib/neutral/chunk-YXOVSRFU.mjs.map +0 -7
  395. package/dist/lib/neutral/context-add-IIDPRRVB.mjs.map +0 -7
  396. package/dist/lib/neutral/context-remove-RDYV4PD4.mjs.map +0 -7
  397. package/dist/lib/neutral/create-project-MPAMKQ3T.mjs.map +0 -7
  398. package/dist/lib/neutral/enable-blueprints-LELPQHY5.mjs.map +0 -7
  399. package/dist/lib/neutral/fetch-KHMHV7JR.mjs +0 -16
  400. package/dist/lib/neutral/fetch-KHMHV7JR.mjs.map +0 -7
  401. package/dist/lib/neutral/fetch-messages-OS74FP76.mjs.map +0 -7
  402. package/dist/lib/neutral/get-context-JRTOOA5O.mjs.map +0 -7
  403. package/dist/lib/neutral/object-create-52Z7YKIA.mjs +0 -35
  404. package/dist/lib/neutral/object-create-52Z7YKIA.mjs.map +0 -7
  405. package/dist/lib/neutral/project-JAU3A7AX.mjs +0 -23
  406. package/dist/lib/neutral/prompt-4UMXX6QU.mjs.map +0 -7
  407. package/dist/lib/neutral/qualifier-7BUCOEKK.mjs.map +0 -7
  408. package/dist/lib/neutral/query-B3NOYFCK.mjs.map +0 -7
  409. package/dist/lib/neutral/query-blueprints-Z576ABT5.mjs +0 -17
  410. package/dist/lib/neutral/query-blueprints-Z576ABT5.mjs.map +0 -7
  411. package/dist/lib/neutral/relation-create-Z3NGW4VU.mjs +0 -34
  412. package/dist/lib/neutral/relation-create-Z3NGW4VU.mjs.map +0 -7
  413. package/dist/lib/neutral/schema-add-4TXJO2V7.mjs +0 -24
  414. package/dist/lib/neutral/schema-add-4TXJO2V7.mjs.map +0 -7
  415. package/dist/lib/neutral/schema-list-Q7HRRKGR.mjs +0 -39
  416. package/dist/lib/neutral/schema-list-Q7HRRKGR.mjs.map +0 -7
  417. package/dist/lib/neutral/sync-issues-A2RJNPEF.mjs.map +0 -7
  418. package/dist/lib/neutral/sync-triggers-NV4JCRN5.mjs.map +0 -7
  419. package/dist/lib/neutral/tag-add-5NOHUTIE.mjs.map +0 -7
  420. package/dist/lib/neutral/tag-remove-QTKYDJAW.mjs.map +0 -7
  421. package/dist/lib/neutral/update-blueprints-K7A5SHBZ.mjs +0 -17
  422. package/dist/lib/neutral/update-blueprints-K7A5SHBZ.mjs.map +0 -7
  423. package/dist/lib/neutral/update-tasks-UGGHWXT5.mjs +0 -46
  424. package/dist/lib/neutral/update-tasks-UGGHWXT5.mjs.map +0 -7
  425. package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +0 -1
  426. package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +0 -1
  427. package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +0 -1
  428. package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +0 -1
  429. package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +0 -5
  430. package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts.map +0 -1
  431. package/dist/types/src/blueprints/database/functions/context-add.d.ts +0 -7
  432. package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +0 -1
  433. package/dist/types/src/blueprints/database/functions/context-remove.d.ts +0 -7
  434. package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +0 -1
  435. package/dist/types/src/blueprints/database/functions/definitions.d.ts +0 -59
  436. package/dist/types/src/blueprints/database/functions/definitions.d.ts.map +0 -1
  437. package/dist/types/src/blueprints/database/functions/index.d.ts.map +0 -1
  438. package/dist/types/src/blueprints/database/functions/load.d.ts +0 -7
  439. package/dist/types/src/blueprints/database/functions/load.d.ts.map +0 -1
  440. package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +0 -1
  441. package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +0 -1
  442. package/dist/types/src/blueprints/database/functions/object-update.d.ts +0 -10
  443. package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +0 -1
  444. package/dist/types/src/blueprints/database/functions/query.d.ts.map +0 -1
  445. package/dist/types/src/blueprints/database/functions/relation-create.d.ts +0 -10
  446. package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +0 -1
  447. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +0 -7
  448. package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +0 -1
  449. package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +0 -1
  450. package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +0 -1
  451. package/dist/types/src/blueprints/database/functions/tag-add.d.ts +0 -8
  452. package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +0 -1
  453. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +0 -8
  454. package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +0 -1
  455. package/dist/types/src/blueprints/discord/functions/definitions.d.ts.map +0 -1
  456. package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +0 -1
  457. package/dist/types/src/blueprints/discord/functions/fetch-messages.test.d.ts.map +0 -1
  458. package/dist/types/src/blueprints/discord/functions/index.d.ts.map +0 -1
  459. package/dist/types/src/blueprints/github/functions/definitions.d.ts +0 -8
  460. package/dist/types/src/blueprints/github/functions/definitions.d.ts.map +0 -1
  461. package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +0 -1
  462. package/dist/types/src/blueprints/github/functions/index.d.ts.map +0 -1
  463. package/dist/types/src/blueprints/linear/functions/definitions.d.ts +0 -7
  464. package/dist/types/src/blueprints/linear/functions/definitions.d.ts.map +0 -1
  465. package/dist/types/src/blueprints/linear/functions/index.d.ts.map +0 -1
  466. package/dist/types/src/blueprints/linear/functions/linear.test.d.ts.map +0 -1
  467. package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +0 -1
  468. package/dist/types/src/blueprints/memory/functions/definitions.d.ts.map +0 -1
  469. package/dist/types/src/blueprints/memory/functions/delete.d.ts.map +0 -1
  470. package/dist/types/src/blueprints/memory/functions/index.d.ts.map +0 -1
  471. package/dist/types/src/blueprints/memory/functions/query.d.ts.map +0 -1
  472. package/dist/types/src/blueprints/memory/functions/save.d.ts.map +0 -1
  473. package/dist/types/src/blueprints/planning/functions/definitions.d.ts +0 -11
  474. package/dist/types/src/blueprints/planning/functions/definitions.d.ts.map +0 -1
  475. package/dist/types/src/blueprints/planning/functions/index.d.ts.map +0 -1
  476. package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +0 -11
  477. package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +0 -1
  478. package/dist/types/src/blueprints/project/blueprint.d.ts.map +0 -1
  479. package/dist/types/src/blueprints/project/blueprint.test.d.ts.map +0 -1
  480. package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +0 -8
  481. package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +0 -1
  482. package/dist/types/src/blueprints/project/functions/agent.d.ts.map +0 -1
  483. package/dist/types/src/blueprints/project/functions/definitions.d.ts.map +0 -1
  484. package/dist/types/src/blueprints/project/functions/get-context.d.ts +0 -15
  485. package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +0 -1
  486. package/dist/types/src/blueprints/project/functions/index.d.ts.map +0 -1
  487. package/dist/types/src/blueprints/project/functions/qualifier.d.ts +0 -73
  488. package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +0 -1
  489. package/dist/types/src/blueprints/project/index.d.ts +0 -3
  490. package/dist/types/src/blueprints/project/index.d.ts.map +0 -1
  491. package/dist/types/src/blueprints/project-wizard/blueprint.d.ts.map +0 -1
  492. package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +0 -52
  493. package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +0 -1
  494. package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +0 -97
  495. package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts.map +0 -1
  496. package/dist/types/src/blueprints/project-wizard/functions/index.d.ts.map +0 -1
  497. package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts.map +0 -1
  498. package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts.map +0 -1
  499. package/dist/types/src/blueprints/project-wizard/index.d.ts +0 -3
  500. package/dist/types/src/blueprints/project-wizard/index.d.ts.map +0 -1
  501. package/dist/types/src/blueprints/websearch/functions/definitions.d.ts.map +0 -1
  502. package/dist/types/src/blueprints/websearch/functions/fetch.d.ts.map +0 -1
  503. package/dist/types/src/blueprints/websearch/functions/index.d.ts.map +0 -1
  504. package/src/blueprints/blueprint-manager/functions/definitions.ts +0 -58
  505. package/src/blueprints/blueprint-manager/functions/query-blueprints.ts +0 -19
  506. package/src/blueprints/blueprint-manager/functions/update-blueprints.ts +0 -19
  507. package/src/blueprints/database/functions/schema-add.ts +0 -28
  508. package/src/blueprints/planning/functions/update-tasks.ts +0 -45
  509. package/src/blueprints/project/blueprint.conversations.json +0 -1
  510. package/src/blueprints/project/index.ts +0 -6
  511. package/src/blueprints/websearch/functions/fetch.ts +0 -18
  512. /package/dist/lib/neutral/{project-JAU3A7AX.mjs.map → definitions-6HU2P7R7.mjs.map} +0 -0
  513. /package/dist/types/src/blueprints/{project → agent}/blueprint.d.ts +0 -0
  514. /package/dist/types/src/blueprints/{project → agent}/blueprint.test.d.ts +0 -0
  515. /package/dist/types/src/blueprints/{project/functions → agent/operations}/agent.d.ts +0 -0
  516. /package/dist/types/src/blueprints/{project-wizard → agent-wizard}/blueprint.d.ts +0 -0
  517. /package/dist/types/src/blueprints/database/{functions → operations}/object-create.d.ts +0 -0
  518. /package/dist/types/src/blueprints/database/{functions → operations}/schema-add.d.ts +0 -0
  519. /package/dist/types/src/blueprints/database/{functions → operations}/schema-list.d.ts +0 -0
  520. /package/dist/types/src/blueprints/discord/{functions → operations}/fetch-messages.test.d.ts +0 -0
  521. /package/dist/types/src/blueprints/linear/{functions → operations}/linear.test.d.ts +0 -0
  522. /package/dist/types/src/blueprints/memory/{functions → operations}/query.d.ts +0 -0
  523. /package/dist/types/src/blueprints/memory/{functions → operations}/save.d.ts +0 -0
  524. /package/dist/types/src/blueprints/websearch/{functions → operations}/definitions.d.ts +0 -0
  525. /package/dist/types/src/blueprints/websearch/{functions → operations}/fetch.d.ts +0 -0
  526. /package/src/blueprints/{project-wizard/functions/project-rules.ts → agent-wizard/operations/agent-rules.ts} +0 -0
  527. /package/src/blueprints/database/{functions → operations}/load.ts +0 -0
  528. /package/src/blueprints/database/{functions → operations}/object-delete.ts +0 -0
  529. /package/src/blueprints/database/{functions → operations}/relation-delete.ts +0 -0
  530. /package/src/blueprints/memory/{functions → operations}/delete.ts +0 -0
  531. /package/src/blueprints/memory/{functions → operations}/save.ts +0 -0
@@ -5,21 +5,20 @@
5
5
  import { describe, expect, it } from '@effect/vitest';
6
6
  import * as Effect from 'effect/Effect';
7
7
 
8
- import { Blueprint } from '@dxos/compute';
9
- import { Operation } from '@dxos/compute';
10
- import { Database, Entity, Feed, Filter, Obj, Query, Ref, Relation, Tag } from '@dxos/echo';
8
+ import { Blueprint, Operation } from '@dxos/compute';
9
+ import { Database, Entity, Feed, Filter, Obj, Query, Ref, Relation, Scope, Tag, Type } from '@dxos/echo';
11
10
  import { TestHelpers } from '@dxos/effect/testing';
12
11
  import { AgentService } from '@dxos/functions-runtime';
13
12
  import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
14
- import { ObjectId } from '@dxos/keys';
13
+ import { EID, EntityId } from '@dxos/keys';
15
14
  import { Employer, Organization, Person } from '@dxos/types';
16
15
  import { trim } from '@dxos/util';
17
16
 
18
17
  import DatabaseBlueprint from './blueprint';
19
- import { DatabaseHandlers } from './functions';
20
- import { Query as DatabaseQueryOperation } from './functions/definitions';
18
+ import { DatabaseHandlers } from './operations';
19
+ import { Query as DatabaseQueryOperation } from './operations/definitions';
21
20
 
22
- ObjectId.dangerouslyDisableRandomness();
21
+ EntityId.dangerouslyDisableRandomness();
23
22
 
24
23
  const TestLayer = AssistantTestLayer({
25
24
  operationHandlers: DatabaseHandlers,
@@ -61,10 +60,10 @@ describe('Database Blueprint', () => {
61
60
  'Add a new schema called "Project" with typename "com.example.type.project" and fields: name (string), description (string), and status (string).',
62
61
  );
63
62
  yield* agent.waitForCompletion();
64
- const schemas = yield* Database.runSchemaQuery({
65
- typename: 'com.example.type.project',
66
- location: ['database', 'runtime'],
67
- });
63
+ const allTypes = yield* Database.query(
64
+ Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
65
+ ).run;
66
+ const schemas = allTypes.filter((t) => Type.getTypename(t) === 'com.example.type.project');
68
67
  expect(schemas.length).toBeGreaterThanOrEqual(1);
69
68
  },
70
69
  Effect.provide(TestLayer),
@@ -86,7 +85,7 @@ describe('Database Blueprint', () => {
86
85
  });
87
86
  yield* agent.submitPrompt('Create a new organization called "Cyberdyne Systems".');
88
87
  yield* agent.waitForCompletion();
89
- const orgs = yield* Database.runQuery(Query.type(Organization.Organization, { name: 'Cyberdyne Systems' }));
88
+ const orgs = yield* Database.query(Query.type(Organization.Organization, { name: 'Cyberdyne Systems' })).run;
90
89
  expect(orgs).toHaveLength(1);
91
90
  },
92
91
  Effect.provide(TestLayer),
@@ -106,8 +105,8 @@ describe('Database Blueprint', () => {
106
105
  'Create a preson fullName="John Doe" with a reference to the organization "Cyberdyne Systems".',
107
106
  );
108
107
  yield* agent.waitForCompletion();
109
- const orgs = yield* Database.runQuery(Query.type(Organization.Organization, { name: 'Cyberdyne Systems' }));
110
- const persons = yield* Database.runQuery(Query.type(Person.Person, { fullName: 'John Doe' }));
108
+ const orgs = yield* Database.query(Query.type(Organization.Organization, { name: 'Cyberdyne Systems' })).run;
109
+ const persons = yield* Database.query(Query.type(Person.Person, { fullName: 'John Doe' })).run;
111
110
  expect(orgs).toHaveLength(1);
112
111
  expect(persons).toHaveLength(1);
113
112
  expect(persons[0].organization?.target).toBe(orgs[0]);
@@ -186,8 +185,8 @@ describe('Database Blueprint', () => {
186
185
  const org = yield* Database.add(
187
186
  Obj.make(Organization.Organization, { name: 'Detail Corp', description: 'A detailed organization.' }),
188
187
  );
189
- const dxn = Obj.getDXN(org).toString();
190
- yield* agent.submitPrompt(`Load the full details of object ${dxn}. What is its description?`);
188
+ const uri = Obj.getURI(org);
189
+ yield* agent.submitPrompt(`Load the full details of object ${uri}. What is its description?`);
191
190
  yield* agent.waitForCompletion();
192
191
  },
193
192
  Effect.provide(TestLayer),
@@ -213,7 +212,7 @@ describe('Database Blueprint', () => {
213
212
  `Create an Employer relation from person "John Connor" to organization "Cyberdyne Systems" with role "Engineer". List schemas first to find the relation typename.`,
214
213
  );
215
214
  yield* agent.waitForCompletion();
216
- const relations = yield* Database.runQuery(Query.type(Employer.Employer));
215
+ const relations = yield* Database.query(Query.type(Employer.Employer)).run;
217
216
  expect(relations.length).toBeGreaterThanOrEqual(1);
218
217
  },
219
218
  Effect.provide(TestLayer),
@@ -238,8 +237,8 @@ describe('Database Blueprint', () => {
238
237
  role: 'Director',
239
238
  }),
240
239
  );
241
- const relationDxn = Relation.getDXN(relation).toString();
242
- yield* agent.submitPrompt(`Delete the relation ${relationDxn}.`);
240
+ const relationUri = Relation.getURI(relation);
241
+ yield* agent.submitPrompt(`Delete the relation ${relationUri}.`);
243
242
  yield* agent.waitForCompletion();
244
243
  expect(Relation.isDeleted(relation)).toBe(true);
245
244
  },
@@ -264,9 +263,10 @@ describe('Database Blueprint', () => {
264
263
  const tag = yield* Database.add(Tag.make({ label: 'important' }));
265
264
  yield* agent.submitPrompt(`Add tag "important" to the organization "Tagged Corp".`);
266
265
  yield* agent.waitForCompletion();
267
- const tags = Obj.getMeta(org).tags ?? [];
268
- // TODO(dmaretskyi): matcher doesnt work with echo proxies.
269
- expect([...tags]).toContain(Obj.getDXN(tag).toString());
266
+ // Compare by entity id: a same-space ref stores a local EID (`echo:/<id>`) while
267
+ // `Obj.getURI` returns the fully-qualified form (`echo://<space>/<id>`).
268
+ const taggedIds = Obj.getMeta(org).tags.map((ref) => EID.getEntityId(EID.parse(ref.uri)));
269
+ expect(taggedIds).toContain(tag.id);
270
270
  },
271
271
  Effect.provide(TestLayer),
272
272
  TestHelpers.provideTestContext,
@@ -283,14 +283,13 @@ describe('Database Blueprint', () => {
283
283
  });
284
284
  const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Untagged Corp' }));
285
285
  const tag = yield* Database.add(Tag.make({ label: 'obsolete' }));
286
- const tagDxn = Obj.getDXN(tag).toString();
287
- Entity.update(org, (org) => Entity.addTag(org, tagDxn));
288
- expect(Obj.getMeta(org).tags ?? []).toContain(tagDxn);
286
+ // Compare by entity id (local vs fully-qualified EID forms refer to the same object).
287
+ const taggedIds = () => Obj.getMeta(org).tags.map((ref) => EID.getEntityId(EID.parse(ref.uri)));
288
+ Entity.update(org, (org) => Entity.addTag(org, Ref.make(tag)));
289
+ expect(taggedIds()).toContain(tag.id);
289
290
  yield* agent.submitPrompt(`Remove tag "obsolete" from the organization "Untagged Corp".`);
290
291
  yield* agent.waitForCompletion();
291
- const tags = Obj.getMeta(org).tags ?? [];
292
- // TODO(dmaretskyi): matcher doesnt work with echo proxies.
293
- expect([...tags]).not.toContain(tagDxn);
292
+ expect(taggedIds()).not.toContain(tag.id);
294
293
  },
295
294
  Effect.provide(TestLayer),
296
295
  TestHelpers.provideTestContext,
@@ -330,13 +329,13 @@ describe('Database Blueprint', () => {
330
329
  });
331
330
  const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Remove Context Corp' }));
332
331
  const { db } = yield* Database.Service;
333
- const ref = db.makeRef(Obj.getDXN(org)) as Ref.Ref<any>;
332
+ const ref = db.makeRef(Obj.getURI(org)) as Ref.Ref<any>;
334
333
  yield* agent.addContext([ref]);
335
- const dxn = Obj.getDXN(org).toString();
334
+ const uri = Obj.getURI(org);
336
335
  yield* agent.submitPrompt(`Remove the organization "Remove Context Corp" from the chat context.`);
337
336
  yield* agent.waitForCompletion();
338
337
  const contextRefs = yield* agent.getContext();
339
- const found = contextRefs.find((contextRef) => contextRef.dxn.toString() === dxn);
338
+ const found = contextRefs.find((contextRef) => contextRef.uri === uri);
340
339
  expect(found).toBeUndefined();
341
340
  },
342
341
  Effect.provide(TestLayer),
@@ -372,16 +371,16 @@ describe('Database Blueprint', () => {
372
371
  yield* agent.waitForCompletion();
373
372
 
374
373
  const { db } = yield* Database.Service;
375
- const spaceOnly = yield* Database.runQuery(
374
+ const spaceOnly = yield* Database.query(
376
375
  Query.select(Filter.text('reservation', { type: 'full-text' })).limit(20),
377
- );
376
+ ).run;
378
377
  expect(spaceOnly).toHaveLength(0);
379
378
 
380
- const withFeeds = yield* Database.runQuery(
379
+ const withFeeds = yield* Database.query(
381
380
  Query.select(Filter.text('reservation', { type: 'full-text' }))
382
381
  .from(db, { includeFeeds: true })
383
382
  .limit(20),
384
- );
383
+ ).run;
385
384
  expect(withFeeds.length).toBeGreaterThanOrEqual(1);
386
385
  expect(
387
386
  withFeeds.some(
@@ -391,9 +390,9 @@ describe('Database Blueprint', () => {
391
390
  ),
392
391
  ).toBe(true);
393
392
 
394
- const byTypename = yield* Database.runQuery(
393
+ const byTypename = yield* Database.query(
395
394
  Query.type(Organization.Organization).from(db, { includeFeeds: true }).limit(20),
396
- );
395
+ ).run;
397
396
  expect(byTypename.length).toBeGreaterThanOrEqual(1);
398
397
  },
399
398
  Effect.provide(TestLayer),
@@ -518,8 +517,8 @@ describe('Database Blueprint', () => {
518
517
  `Call query tool with precisely ${JSON.stringify({
519
518
  includeContent: false,
520
519
  limit: 10,
521
- typename: Organization.Organization.typename,
522
- in: [Obj.getDXN(feed1).toString()],
520
+ typename: Type.getTypename(Organization.Organization),
521
+ in: [Obj.getURI(feed1)],
523
522
  })}`,
524
523
  );
525
524
  yield* agent.waitForCompletion();
@@ -21,7 +21,7 @@ import {
21
21
  RelationDelete,
22
22
  TagAdd,
23
23
  TagRemove,
24
- } from './functions';
24
+ } from './operations/definitions';
25
25
 
26
26
  const BLUEPRINT_KEY = 'org.dxos.blueprint.database';
27
27
 
@@ -37,7 +37,7 @@ const make = () =>
37
37
  description: 'Query and manipulate objects in the ECHO database.',
38
38
  agentCanEnable: true,
39
39
  instructions: {
40
- source: Ref.make(Text.make(instructions)),
40
+ source: Ref.make(Text.make({ content: instructions })),
41
41
  },
42
42
  tools: Blueprint.toolDefinitions({
43
43
  operations: [
@@ -3,19 +3,4 @@
3
3
  //
4
4
 
5
5
  export { default as DatabaseBlueprint } from './blueprint';
6
- export {
7
- Query as DatabaseQuery,
8
- Load as DatabaseLoad,
9
- ObjectCreate,
10
- ObjectUpdate,
11
- ObjectDelete,
12
- SchemaAdd,
13
- SchemaList,
14
- ContextAdd,
15
- ContextRemove,
16
- RelationCreate,
17
- RelationDelete,
18
- TagAdd,
19
- TagRemove,
20
- DatabaseHandlers,
21
- } from './functions';
6
+ export { DatabaseHandlers, DatabaseOperations } from './operations';
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { AiContextService } from '@dxos/assistant';
7
+ import { AiContext } from '@dxos/assistant';
8
8
  import { Operation } from '@dxos/compute';
9
9
 
10
10
  import { ContextAdd } from './definitions';
@@ -12,7 +12,7 @@ import { ContextAdd } from './definitions';
12
12
  export default ContextAdd.pipe(
13
13
  Operation.withHandler(
14
14
  Effect.fn(function* ({ obj }) {
15
- const { binder } = yield* AiContextService;
15
+ const { binder } = yield* AiContext.Service;
16
16
  yield* Effect.promise(() =>
17
17
  binder.bind({
18
18
  blueprints: [],
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { AiContextService } from '@dxos/assistant';
7
+ import { AiContext } from '@dxos/assistant';
8
8
  import { Operation } from '@dxos/compute';
9
9
 
10
10
  import { ContextRemove } from './definitions';
@@ -12,7 +12,7 @@ import { ContextRemove } from './definitions';
12
12
  export default ContextRemove.pipe(
13
13
  Operation.withHandler(
14
14
  Effect.fn(function* ({ obj }) {
15
- const { binder } = yield* AiContextService;
15
+ const { binder } = yield* AiContext.Service;
16
16
  yield* Effect.promise(() =>
17
17
  binder.unbind({
18
18
  blueprints: [],
@@ -4,15 +4,17 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { AiContextService } from '@dxos/assistant';
7
+ import { AiContext } from '@dxos/assistant';
8
8
  import { Operation } from '@dxos/compute';
9
- import { Database, Obj, Ref, Relation, Tag } from '@dxos/echo';
9
+ import { Database, Obj, Ref, Relation, Tag, Type } from '@dxos/echo';
10
+ import { DXN } from '@dxos/keys';
10
11
  import { trim } from '@dxos/util';
11
12
 
12
13
  export const Query = Operation.make({
13
14
  meta: {
14
- key: 'org.dxos.function.database.query',
15
+ key: DXN.make('org.dxos.function.database.query'),
15
16
  name: 'Query',
17
+ icon: 'ph--magnifying-glass--regular',
16
18
  description: trim`
17
19
  Query for objects in ECHO.
18
20
  Use this tool when searching for information in the space (both automerge and queues).
@@ -51,7 +53,7 @@ export const Query = Operation.make({
51
53
 
52
54
  <example description="Emails from specific mailboxes">
53
55
  {
54
- "in": [{"/" : "dxn:echo:@:YYYYYY"}, {"/" : "dxn:echo:@:XXXXXXX"}],
56
+ "in": [{"/" : "echo:/YYYYYY"}, {"/" : "echo:/XXXXXXX"}],
55
57
  "typename": "org.dxos.type.email",
56
58
  "includeContent": true,
57
59
  "limit": 20
@@ -105,14 +107,15 @@ export const Query = Operation.make({
105
107
 
106
108
  export const Load = Operation.make({
107
109
  meta: {
108
- key: 'org.dxos.function.database.load',
110
+ key: DXN.make('org.dxos.function.database.load'),
109
111
  name: 'Load object',
112
+ icon: 'ph--download--regular',
110
113
  description: trim`
111
114
  Loads the object or relation content.
112
115
  Can load multiple objects at at time.
113
116
  Use the to read the data when you have a DXN.
114
117
  Call this tool with an array of one or more DXNs or object IDs.
115
- When use see a reference ({ '/': 'dxn:...' }), you can call this function to load the object.
118
+ When use see a reference ({ '/': 'echo:...' }), you can call this function to load the object.
116
119
  Note that returned data is only a snapshot in time, and might have changed since the object was last loaded.
117
120
  `,
118
121
  },
@@ -125,13 +128,14 @@ export const Load = Operation.make({
125
128
 
126
129
  export const ObjectCreate = Operation.make({
127
130
  meta: {
128
- key: 'org.dxos.function.database.object-create',
131
+ key: DXN.make('org.dxos.function.database.objectCreate'),
129
132
  name: 'Create object',
133
+ icon: 'ph--plus--regular',
130
134
  description: trim`
131
135
  Creates a new object and adds it to the current space.
132
136
  Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.
133
- References are provided in the following format: { "/": "dxn:..." }.
134
- Reference examples: { "/": "dxn:echo:@:01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "dxn:queue:data:01KG7R1ZXWFMWQ4DA1Q6TN1DG4:01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
137
+ References are provided in the following format: { "/": "echo:..." }.
138
+ Reference examples: { "/": "echo:/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "echo://<space id>/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
135
139
  `,
136
140
  },
137
141
  input: Schema.Struct({
@@ -144,12 +148,13 @@ export const ObjectCreate = Operation.make({
144
148
 
145
149
  export const ObjectUpdate = Operation.make({
146
150
  meta: {
147
- key: 'org.dxos.function.database.object-update',
151
+ key: DXN.make('org.dxos.function.database.objectUpdate'),
148
152
  name: 'Update object',
153
+ icon: 'ph--pencil--regular',
149
154
  description: trim`
150
155
  Updates the object properties.
151
- References are provided in the following format: { "/": "dxn:..." }.
152
- Reference examples: { "/": "dxn:echo:@:01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "dxn:queue:data:01KG7R1ZXWFMWQ4DA1Q6TN1DG4:01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
156
+ References are provided in the following format: { "/": "echo:..." }.
157
+ Reference examples: { "/": "echo:/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "echo://<space id>/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
153
158
  `,
154
159
  },
155
160
  input: Schema.Struct({
@@ -162,11 +167,12 @@ export const ObjectUpdate = Operation.make({
162
167
 
163
168
  export const ObjectDelete = Operation.make({
164
169
  meta: {
165
- key: 'org.dxos.function.database.object-delete',
170
+ key: DXN.make('org.dxos.function.database.objectDelete'),
166
171
  name: 'Delete object',
167
172
  description: trim`
168
173
  Deletes the object.
169
174
  `,
175
+ icon: 'ph--trash--regular',
170
176
  },
171
177
  input: Schema.Struct({
172
178
  obj: Ref.Ref(Obj.Unknown),
@@ -177,8 +183,9 @@ export const ObjectDelete = Operation.make({
177
183
 
178
184
  export const SchemaAdd = Operation.make({
179
185
  meta: {
180
- key: 'org.dxos.function.database.schema-add',
186
+ key: DXN.make('org.dxos.function.database.schemaAdd'),
181
187
  name: 'Add schema',
188
+ icon: 'ph--plus--regular',
182
189
  description: trim`
183
190
  Adds a schema to the space.
184
191
  The name will be used when displayed to the user.
@@ -197,8 +204,9 @@ export const SchemaAdd = Operation.make({
197
204
 
198
205
  export const SchemaList = Operation.make({
199
206
  meta: {
200
- key: 'org.dxos.function.database.schema-list',
207
+ key: DXN.make('org.dxos.function.database.schemaList'),
201
208
  name: 'List schemas',
209
+ icon: 'ph--list--regular',
202
210
  description: trim`
203
211
  Lists schemas definitions.
204
212
  `,
@@ -212,8 +220,9 @@ export const SchemaList = Operation.make({
212
220
 
213
221
  export const ContextAdd = Operation.make({
214
222
  meta: {
215
- key: 'org.dxos.function.database.context-add',
223
+ key: DXN.make('org.dxos.function.database.contextAdd'),
216
224
  name: 'Add to context',
225
+ icon: 'ph--plus-circle--regular',
217
226
  description: trim`
218
227
  Adds the object to the chat context.
219
228
  Use this it for objects that are useful long-term for the conversation.
@@ -225,13 +234,14 @@ export const ContextAdd = Operation.make({
225
234
  }),
226
235
  }),
227
236
  output: Schema.Void,
228
- services: [AiContextService],
237
+ services: [AiContext.Service],
229
238
  });
230
239
 
231
240
  export const ContextRemove = Operation.make({
232
241
  meta: {
233
- key: 'org.dxos.function.database.context-remove',
242
+ key: DXN.make('org.dxos.function.database.contextRemove'),
234
243
  name: 'Remove from context',
244
+ icon: 'ph--minus-circle--regular',
235
245
  description: trim`
236
246
  Removes the object from the chat context.
237
247
  Use this it for objects that are no longer useful for the conversation.
@@ -243,13 +253,14 @@ export const ContextRemove = Operation.make({
243
253
  }),
244
254
  }),
245
255
  output: Schema.Void,
246
- services: [AiContextService],
256
+ services: [AiContext.Service],
247
257
  });
248
258
 
249
259
  export const RelationCreate = Operation.make({
250
260
  meta: {
251
- key: 'org.dxos.function.database.relation-create',
261
+ key: DXN.make('org.dxos.function.database.relationCreate'),
252
262
  name: 'Create relation',
263
+ icon: 'ph--arrows-merge--regular',
253
264
  description: trim`
254
265
  Creates a new relation and adds it to the current space.
255
266
  Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.
@@ -269,11 +280,12 @@ export const RelationCreate = Operation.make({
269
280
 
270
281
  export const RelationDelete = Operation.make({
271
282
  meta: {
272
- key: 'org.dxos.function.database.relation-delete',
283
+ key: DXN.make('org.dxos.function.database.relationDelete'),
273
284
  name: 'Delete relation',
274
285
  description: trim`
275
286
  Deletes the relation.
276
287
  `,
288
+ icon: 'ph--trash--regular',
277
289
  },
278
290
  input: Schema.Struct({
279
291
  rel: Ref.Ref(Relation.Unknown),
@@ -284,16 +296,17 @@ export const RelationDelete = Operation.make({
284
296
 
285
297
  export const TagAdd = Operation.make({
286
298
  meta: {
287
- key: 'org.dxos.function.database.tag-add',
299
+ key: DXN.make('org.dxos.function.database.tagAdd'),
288
300
  name: 'Add tag',
301
+ icon: 'ph--tag--regular',
289
302
  description: trim`
290
303
  Adds a tag to an object.
291
- Tags are objects of type ${Tag.Tag.typename}.
304
+ Tags are objects of type ${Type.getTypename(Tag.Tag)}.
292
305
  You must search database for available tags, or create a new one.
293
306
  `,
294
307
  },
295
308
  input: Schema.Struct({
296
- tag: Ref.Ref(Obj.Unknown),
309
+ tag: Ref.Ref(Tag.Tag),
297
310
  obj: Ref.Ref(Obj.Unknown),
298
311
  }),
299
312
  output: Schema.Unknown,
@@ -302,15 +315,16 @@ export const TagAdd = Operation.make({
302
315
 
303
316
  export const TagRemove = Operation.make({
304
317
  meta: {
305
- key: 'org.dxos.function.database.tag-remove',
318
+ key: DXN.make('org.dxos.function.database.tagRemove'),
306
319
  name: 'Remove tag',
320
+ icon: 'ph--tag--regular',
307
321
  description: trim`
308
322
  Removes a tag from an object.
309
- Tags are objects of type ${Tag.Tag.typename}.
323
+ Tags are objects of type ${Type.getTypename(Tag.Tag)}.
310
324
  `,
311
325
  },
312
326
  input: Schema.Struct({
313
- tag: Ref.Ref(Obj.Unknown),
327
+ tag: Ref.Ref(Tag.Tag),
314
328
  obj: Ref.Ref(Obj.Unknown),
315
329
  }),
316
330
  output: Schema.Unknown,
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { OperationHandlerSet } from '@dxos/compute';
6
6
 
7
- export * from './definitions';
7
+ export * as DatabaseOperations from './definitions';
8
8
 
9
9
  export const DatabaseHandlers = OperationHandlerSet.lazy(
10
10
  () => import('./context-add'),
@@ -5,7 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Operation } from '@dxos/compute';
8
- import { Database, Entity, Obj, Type } from '@dxos/echo';
8
+ import { Database, Entity, Filter, Obj, Query, Scope, Type } from '@dxos/echo';
9
9
  import { EncodedReference } from '@dxos/echo-protocol';
10
10
  import { invariant } from '@dxos/invariant';
11
11
  import { deepMapValues } from '@dxos/util';
@@ -16,17 +16,19 @@ export default ObjectCreate.pipe(
16
16
  Operation.withHandler(
17
17
  Effect.fn(function* ({ typename, data }) {
18
18
  const { db } = yield* Database.Service;
19
- const schema = yield* Effect.promise(() =>
20
- db.schemaRegistry.query({ typename, location: ['database', 'runtime'] }).first(),
21
- );
22
- invariant(Type.isObjectSchema(schema), 'Schema is not an object schema');
19
+ const types = yield* Database.query(Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()))
20
+ .run;
21
+ const foundSchema = types.find((t) => Type.getTypename(t) === typename);
22
+ invariant(foundSchema, `Schema not found: ${typename}`);
23
+ invariant(Type.isObject(foundSchema), 'Schema is not an object schema');
24
+ const schema = foundSchema;
23
25
 
24
26
  const object = db.add(
25
27
  Obj.make(
26
28
  schema,
27
29
  deepMapValues(data, (value, recurse) => {
28
30
  if (EncodedReference.isEncodedReference(value)) {
29
- return db.makeRef(EncodedReference.toDXN(value));
31
+ return db.makeRef(EncodedReference.toURI(value));
30
32
  }
31
33
  return recurse(value);
32
34
  }),
@@ -18,7 +18,7 @@ export default ObjectUpdate.pipe(
18
18
  Entity.update(object as Entity.Any, (obj) => {
19
19
  for (const [key, value] of Object.entries(properties)) {
20
20
  if (EncodedReference.isEncodedReference(value)) {
21
- obj[key] = db.makeRef(EncodedReference.toDXN(value));
21
+ obj[key] = db.makeRef(EncodedReference.toURI(value));
22
22
  } else {
23
23
  obj[key] = value;
24
24
  }
@@ -5,8 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Operation } from '@dxos/compute';
8
- import { Entity, Filter, Obj, Query as EchoQuery } from '@dxos/echo';
9
- import { Database } from '@dxos/echo';
8
+ import { Database, Entity, Filter, Obj, Query as EchoQuery, Scope, Type } from '@dxos/echo';
10
9
 
11
10
  import { Query } from './definitions';
12
11
 
@@ -21,18 +20,24 @@ export default Query.pipe(
21
20
  ...text.split(' ').map((term) => EchoQuery.select(Filter.text(term, { type: 'full-text' }))),
22
21
  );
23
22
  if (typename !== undefined) {
24
- const schema = yield* Database.runSchemaQuery({ typename, location: ['database', 'runtime'] });
25
- if (schema.length === 0) {
23
+ const types = yield* Database.query(
24
+ EchoQuery.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
25
+ ).run;
26
+ const schema = types.find((t) => Type.getTypename(t) === typename);
27
+ if (!schema) {
26
28
  return yield* Effect.fail(new Error(`Schema ${typename} not found`));
27
29
  }
28
- query = query.select(Filter.type(schema[0]));
30
+ query = query.select(Filter.type(schema));
29
31
  }
30
32
  } else if (typename) {
31
- const schema = yield* Database.runSchemaQuery({ typename, location: ['database', 'runtime'] });
32
- if (schema.length === 0) {
33
+ const types = yield* Database.query(
34
+ EchoQuery.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
35
+ ).run;
36
+ const schema = types.find((t) => Type.getTypename(t) === typename);
37
+ if (!schema) {
33
38
  return yield* Effect.fail(new Error(`Schema ${typename} not found`));
34
39
  }
35
- query = EchoQuery.select(Filter.type(schema[0]));
40
+ query = EchoQuery.select(Filter.type(schema));
36
41
  } else {
37
42
  query = EchoQuery.select(Filter.everything());
38
43
  }
@@ -43,18 +48,18 @@ export default Query.pipe(
43
48
 
44
49
  query = query.limit(limit);
45
50
  if (includeQueues) {
46
- // Must scope to the current space: `from({ allQueuesFromSpaces: true })` alone has no spaceIds, so the SQL
47
- // index returns nothing (see ObjectMetaIndex.buildSourceCondition / early returns when spaceIds are empty).
51
+ // Must scope to the current space: `from({ allFeedsFromSpaces: true })` alone has no spaceIds, so the SQL
52
+ // index returns nothing (see EntityMetaIndex.buildSourceCondition / early returns when spaceIds are empty).
48
53
  query = query.from(db, { includeFeeds: true });
49
54
  }
50
55
 
51
56
  yield* Database.flush();
52
- const results = yield* Database.runQuery(query);
57
+ const results = yield* Database.query(query).run;
53
58
  if (includeContent) {
54
59
  return results.map((obj) => Entity.toJSON(obj));
55
60
  } else {
56
61
  return results.map((obj) => ({
57
- dxn: Obj.getDXN(obj).toString(),
62
+ dxn: Obj.getURI(obj),
58
63
  typename: Obj.getTypename(obj),
59
64
  label: Obj.getLabel(obj),
60
65
  }));
@@ -5,7 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Operation } from '@dxos/compute';
8
- import { Database, Entity, Relation, Type } from '@dxos/echo';
8
+ import { Database, Entity, Filter, Query, Relation, Scope, Type } from '@dxos/echo';
9
9
  import { invariant } from '@dxos/invariant';
10
10
 
11
11
  import { RelationCreate } from './definitions';
@@ -14,10 +14,12 @@ export default RelationCreate.pipe(
14
14
  Operation.withHandler(
15
15
  Effect.fn(function* ({ typename, source, target, properties }) {
16
16
  const { db } = yield* Database.Service;
17
- const schema = yield* Effect.promise(() =>
18
- db.schemaRegistry.query({ typename, location: ['database', 'runtime'] }).first(),
19
- );
20
- invariant(Type.isRelationSchema(schema), 'Schema is not a relation schema');
17
+ const types = yield* Database.query(Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()))
18
+ .run;
19
+ const foundSchema = types.find((t) => Type.getTypename(t) === typename);
20
+ invariant(foundSchema, `Schema not found: ${typename}`);
21
+ invariant(Type.isRelation(foundSchema), 'Schema is not a relation schema');
22
+ const schema = foundSchema;
21
23
 
22
24
  const sourceObj = yield* Database.load(source);
23
25
  const targetObj = yield* Database.load(target);
@@ -0,0 +1,23 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Operation } from '@dxos/compute';
8
+ import { Database, Type } from '@dxos/echo';
9
+
10
+ import { SchemaAdd } from './definitions';
11
+
12
+ export default SchemaAdd.pipe(
13
+ Operation.withHandler(
14
+ Effect.fn(function* ({ name, typename, jsonSchema }) {
15
+ const schema = yield* Database.addType(Type.makeObjectFromJsonSchema({ typename, version: '0.1.0', jsonSchema }));
16
+ if (name) {
17
+ Type.update(schema, (draft) => {
18
+ draft.name = name;
19
+ });
20
+ }
21
+ }),
22
+ ),
23
+ );