@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
@@ -1,31 +1,38 @@
1
1
  import {
2
- AgentPrompt
3
- } from "./chunk-JN4GARRQ.mjs";
2
+ Fetch,
3
+ definitions_exports as definitions_exports8
4
+ } from "./chunk-FQNZX2SH.mjs";
4
5
  import {
5
- DeleteMemory,
6
- QueryMemories,
7
- SaveMemory
8
- } from "./chunk-EJAQUAKM.mjs";
6
+ AgentPrompt
7
+ } from "./chunk-BOB6M2YM.mjs";
9
8
  import {
10
- EnableBlueprints,
11
- QueryBlueprints,
12
- UpdateBlueprints
13
- } from "./chunk-YSYNXOZA.mjs";
9
+ DelegateTask,
10
+ delegate_task_exports
11
+ } from "./chunk-U5FCQXA2.mjs";
14
12
  import {
15
- AgentRules,
16
- CreateAgent,
17
- SyncTriggers
18
- } from "./chunk-4T3LJGXI.mjs";
13
+ FetchMessages,
14
+ definitions_exports as definitions_exports5
15
+ } from "./chunk-ZQDWSV26.mjs";
19
16
  import {
20
17
  SyncIssues,
18
+ definitions_exports as definitions_exports6,
21
19
  syncObjects
22
- } from "./chunk-WIV7ZVRS.mjs";
20
+ } from "./chunk-24L572PJ.mjs";
21
+ import {
22
+ DeleteMemory,
23
+ QueryMemories,
24
+ SaveMemory,
25
+ definitions_exports as definitions_exports7
26
+ } from "./chunk-DLVIJSH6.mjs";
23
27
  import {
24
- UpdateTasks
25
- } from "./chunk-P5LAPHCG.mjs";
28
+ UpdateTasks,
29
+ update_tasks_exports
30
+ } from "./chunk-KC2LPECT.mjs";
26
31
  import {
27
- Fetch
28
- } from "./chunk-WLR3BGO4.mjs";
32
+ EnableBlueprints,
33
+ QueryBlueprints,
34
+ definitions_exports as definitions_exports3
35
+ } from "./chunk-NSAUN2IX.mjs";
29
36
  import {
30
37
  ContextAdd,
31
38
  ContextRemove,
@@ -39,65 +46,73 @@ import {
39
46
  SchemaAdd,
40
47
  SchemaList,
41
48
  TagAdd,
42
- TagRemove
43
- } from "./chunk-CVUA23QI.mjs";
44
- import {
45
- FetchMessages
46
- } from "./chunk-VSDP6SRY.mjs";
49
+ TagRemove,
50
+ definitions_exports as definitions_exports4
51
+ } from "./chunk-4LFE5PQ3.mjs";
47
52
  import {
48
53
  AgentBlueprintHandlers,
49
54
  blueprint_default
50
- } from "./chunk-YXOVSRFU.mjs";
55
+ } from "./chunk-JRUTUKPS.mjs";
56
+ import {
57
+ AgentRules,
58
+ CreateAgent,
59
+ SyncTriggers,
60
+ definitions_exports as definitions_exports2
61
+ } from "./chunk-3YH7MWSD.mjs";
51
62
  import {
52
- AddArtifact,
53
- AgentWorker,
54
- GetContext,
55
- Qualifier
56
- } from "./chunk-GSG4JGIY.mjs";
63
+ definitions_exports
64
+ } from "./chunk-RNIUE4LK.mjs";
57
65
  import {
58
66
  Agent_exports,
59
67
  McpServer_exports,
60
68
  Plan_exports
61
- } from "./chunk-SVI25Z2Y.mjs";
69
+ } from "./chunk-URUJQGI6.mjs";
62
70
  import {
63
71
  Chat_exports
64
- } from "./chunk-NR3GTWRC.mjs";
72
+ } from "./chunk-Z3KITY4U.mjs";
65
73
  import {
66
74
  Memory_exports
67
- } from "./chunk-KGU725LW.mjs";
75
+ } from "./chunk-SYUTQPSB.mjs";
68
76
  import {
69
77
  __export
70
78
  } from "./chunk-J5LGTIGS.mjs";
71
79
 
72
- // src/blueprints/discord/blueprint.ts
73
- import { Blueprint } from "@dxos/compute";
74
- import { Ref } from "@dxos/echo";
75
- import { Text } from "@dxos/schema";
80
+ // src/blueprints/agent-wizard/blueprint.ts
81
+ import { Blueprint, Template } from "@dxos/compute";
76
82
  import { trim } from "@dxos/util";
83
+ var BLUEPRINT_KEY = "org.dxos.blueprint.agentWizard";
84
+ var make = () => Blueprint.make({
85
+ key: BLUEPRINT_KEY,
86
+ name: "Agent Wizard",
87
+ description: "Help the user create a new agent (subscriptions, optional cron timer, sync-triggers after edits).",
88
+ agentCanEnable: true,
89
+ instructions: Template.make({
90
+ source: trim`
91
+ You are a wizard that helps the user create a new agent.
77
92
 
78
- // src/blueprints/discord/functions/index.ts
79
- import { OperationHandlerSet } from "@dxos/compute";
80
- var DiscordHandlers = OperationHandlerSet.lazy(() => import("./fetch-messages-OS74FP76.mjs"));
93
+ Agents are goal oriented and autonomously driven.
94
+ Each agent has instructions - the goal of the agent.
95
+ The instructions also typically describe what actions to perform in reaction to events (emails).
96
+ The agent has a number of associated artifacts to work with.
97
+ Agents can subscribe to emails.
81
98
 
82
- // src/blueprints/discord/blueprint.ts
83
- var BLUEPRINT_KEY = "org.dxos.blueprint.discord";
84
- var instructions = trim`
85
- You are able to fetch messages from Discord servers.
99
+ Agents have a \`cron\` field: when set, the agent runs on a timer on that schedule (standard cron syntax).
100
+ Use \`cron\` when the user wants the agent to run periodically (e.g. "every morning", "once a day", "every 5 minutes").
101
+ Examples: \`0 9 * * *\` for daily at 09:00, or \`*/5 * * * *\` for every 5 minutes.
102
+ Timer triggers bypass the qualifier and invoke the agent worker directly on the schedule.
86
103
 
87
- Known servers:
104
+ The agent itself is an ECHO object and can be edited like any other object using the database blueprint.
105
+ You can edit the agent's instructions, name, and other properties directly.
106
+ If you edit the agent's \`enabled\` field, \`filterEvents\` field, subscriptions array, or \`cron\` field, you MUST call the sync-triggers function afterward to synchronize the triggers (\`enabled\` is applied to all triggers).
88
107
 
89
- DXOS serverId: 837138313172353095
90
- `;
91
- var make = () => Blueprint.make({
92
- key: BLUEPRINT_KEY,
93
- name: "Discord",
94
- description: "Discord integration.",
95
- instructions: {
96
- source: Ref.make(Text.make(instructions))
97
- },
108
+ IMPORTANT: Before attempting to create an agent call the [agent-rules] tool to get the rules for creating an agent.
109
+ `
110
+ }),
98
111
  tools: Blueprint.toolDefinitions({
99
112
  operations: [
100
- FetchMessages
113
+ AgentRules,
114
+ CreateAgent,
115
+ SyncTriggers
101
116
  ]
102
117
  })
103
118
  });
@@ -107,38 +122,102 @@ var blueprint = {
107
122
  };
108
123
  var blueprint_default2 = blueprint;
109
124
 
110
- // src/blueprints/linear/blueprint.ts
111
- import { Blueprint as Blueprint2 } from "@dxos/compute";
112
- import { Ref as Ref2 } from "@dxos/echo";
113
- import { Text as Text2 } from "@dxos/schema";
125
+ // src/blueprints/agent-wizard/operations/index.ts
126
+ import { OperationHandlerSet } from "@dxos/compute";
127
+ var AgentWizardHandlers = OperationHandlerSet.lazy(() => import("./create-agent-KUTBEXLJ.mjs"), () => import("./agent-rules-3TBAIVTS.mjs"), () => import("./sync-triggers-JEVTYIGU.mjs"));
128
+
129
+ // src/blueprints/automation/blueprint.ts
130
+ import { Blueprint as Blueprint2, Trigger, Operation } from "@dxos/compute";
131
+ import { Ref, Type } from "@dxos/echo";
132
+ import { Text } from "@dxos/schema";
114
133
  import { trim as trim2 } from "@dxos/util";
134
+ var BLUEPRINT_KEY2 = "dxos.org/blueprint/automation";
135
+ var instructions = trim2`
136
+ Automation allows you to automatically initiate actions based on events.
137
+ Automations are configured by creating a trigger that references a function.
138
+ Whenever event that matches the trigger occurs, the function is invoked.
115
139
 
116
- // src/blueprints/linear/functions/index.ts
117
- import { OperationHandlerSet as OperationHandlerSet2 } from "@dxos/compute";
118
- var LinearHandlers = OperationHandlerSet2.lazy(() => import("./sync-issues-A2RJNPEF.mjs"));
140
+ ## Configuration
119
141
 
120
- // src/blueprints/linear/blueprint.ts
121
- var BLUEPRINT_KEY2 = "org.dxos.blueprint.linear";
122
- var instructions2 = trim2`
123
- You are able to sync Linear workspaces.
124
- Sometimes sync does not complete in one go and you need to call the function again.
142
+ Triggers are configured by the properties of the Trigger object.
143
+ - enabled: Must be true for trigger to run.
144
+ - spec: Events that the trigger matches.
145
+ - function: Ref to a ${Type.getTypename(Operation.PersistentOperation)} object that will be invoked. Query the functions present in the space first, and reference them in the trigger.
146
+ - input: The spec of the input data that will be passed to the function.
125
147
 
126
- Known workspaces:
148
+ ## Input patterns
127
149
 
128
- DXOS teamId: 1127c63a-6f77-4725-9229-50f6cd47321c
150
+ Input to the invoked function is defined by the input property of the Trigger object.
151
+ It's an object that supports constants or template strings.
152
+
153
+ Example:
154
+
155
+ {
156
+ item: '{{event.item}}',
157
+ instructions: 'Summarize and perform entity-extraction'
158
+ mailbox: { '/': 'echo://AAA/ZZZ' }
159
+ }
160
+
161
+ ## Trigger kinds
162
+
163
+ - Timer: Triggered by a cron schedule.
164
+ - Queue: Subscribes and processes items begginging to end.
165
+ Note: queues are the same as feeds. The queue EID should be of form: echo://<space-id>/<queue-id>.
166
+ - Subscription: Subscribes and processes database items based on a query.
167
+
168
+ Avoid: email and webhook triggers.
169
+
170
+ ## Editing triggers
171
+
172
+ Triggers are represented as objects of type ${Type.getTypename(Trigger.Trigger)}.
173
+ You need access to the Database blueprint to manipulate triggers.
174
+ Read trigger schema before manipulating triggers.
175
+ Having a Trigger object in the database is enough to setup an automation.
176
+
177
+ ## Examples
178
+
179
+ Timer:
180
+
181
+ {
182
+ "function": { "/": "echo://AAA/ZZZ" },
183
+ "enabled": true,
184
+ "spec": {
185
+ "kind": "timer",
186
+ "cron": "*/5 * * * *"
187
+ }
188
+ }
189
+
190
+ Queue:
191
+
192
+ {
193
+ "function": { "/": "echo://AAA/ZZZ" },
194
+ "enabled": true,
195
+ "spec": {
196
+ "kind": "queue",
197
+ "queue": "echo://XXX/YYY"
198
+ }
199
+ }
200
+
201
+ Subscription:
202
+
203
+ {
204
+ "function": { "/": "echo://AAA/ZZZ" },
205
+ "enabled": true,
206
+ "spec": {
207
+ "kind": "subscription",
208
+ "query": { "ast": { "type": "select", "filter": { "type": "object", "typename": "dxn:org.dxos.type.person" } } }
209
+ }
210
+ }
129
211
  `;
130
212
  var make2 = () => Blueprint2.make({
131
213
  key: BLUEPRINT_KEY2,
132
- name: "Linear",
133
- description: "Syncs Linear workspaces.",
214
+ name: "Triggers",
215
+ description: "Trigger management and automation.",
134
216
  instructions: {
135
- source: Ref2.make(Text2.make(instructions2))
136
- },
137
- tools: Blueprint2.toolDefinitions({
138
- operations: [
139
- SyncIssues
140
- ]
141
- })
217
+ source: Ref.make(Text.make({
218
+ content: instructions
219
+ }))
220
+ }
142
221
  });
143
222
  var blueprint2 = {
144
223
  key: BLUEPRINT_KEY2,
@@ -146,22 +225,42 @@ var blueprint2 = {
146
225
  };
147
226
  var blueprint_default3 = blueprint2;
148
227
 
149
- // src/blueprints/planning/blueprint.ts
150
- import { Blueprint as Blueprint3 } from "@dxos/compute";
151
-
152
- // src/blueprints/planning/functions/index.ts
153
- import { OperationHandlerSet as OperationHandlerSet3 } from "@dxos/compute";
154
- var PlanningHandlers = OperationHandlerSet3.lazy(() => import("./update-tasks-UGGHWXT5.mjs"));
155
-
156
- // src/blueprints/planning/blueprint.ts
157
- var BLUEPRINT_KEY3 = "org.dxos.blueprint.planning";
228
+ // src/blueprints/blueprint-manager/blueprint.ts
229
+ import { Blueprint as Blueprint3, Template as Template2 } from "@dxos/compute";
230
+ import { DXN } from "@dxos/keys";
231
+ import { trim as trim3 } from "@dxos/util";
232
+ var BLUEPRINT_KEY3 = "org.dxos.blueprint.blueprintManager";
158
233
  var make3 = () => Blueprint3.make({
159
234
  key: BLUEPRINT_KEY3,
160
- name: "Planning",
161
- description: "Plans and tracks complex tasks with artifact management.",
235
+ name: "Blueprint Manager",
236
+ description: "Query and enable blueprints in the current conversation.",
237
+ instructions: Template2.make({
238
+ source: trim3`
239
+ You can query available blueprints and enable them in the current conversation.
240
+ Use [query-blueprints] to refresh the list of available blueprints.
241
+ Use [enable-blueprints] to enable blueprints by their keys. Always call [query-blueprints] first.
242
+ Only blueprints with agentCanEnable=true can be enabled by the agent.
243
+
244
+ <available_blueprints>
245
+ {{#each blueprints}}
246
+ - {{key}} "{{name}}"{{#if description}} -- {{description}}{{/if}}{{#if agentCanEnable}} [agent-can-enable]{{/if}}
247
+ {{/each}}
248
+ </available_blueprints>
249
+
250
+ NOTE: You must enable the blueprint to use it, only then the tools from that blueprint will appear.
251
+ `,
252
+ inputs: [
253
+ {
254
+ name: "blueprints",
255
+ kind: "operation",
256
+ operation: DXN.getName(QueryBlueprints.meta.key)
257
+ }
258
+ ]
259
+ }),
162
260
  tools: Blueprint3.toolDefinitions({
163
261
  operations: [
164
- UpdateTasks
262
+ QueryBlueprints,
263
+ EnableBlueprints
165
264
  ]
166
265
  })
167
266
  });
@@ -171,65 +270,29 @@ var blueprint3 = {
171
270
  };
172
271
  var blueprint_default4 = blueprint3;
173
272
 
174
- // src/blueprints/websearch/blueprint.ts
175
- import { Blueprint as Blueprint4 } from "@dxos/compute";
176
- import { Ref as Ref3 } from "@dxos/echo";
177
- import { Text as Text3 } from "@dxos/schema";
178
-
179
- // src/blueprints/websearch/functions/index.ts
180
- import { OperationHandlerSet as OperationHandlerSet4 } from "@dxos/compute";
181
- var WebSearchHandlers = OperationHandlerSet4.lazy(() => import("./fetch-KHMHV7JR.mjs"));
182
-
183
- // src/blueprints/websearch/blueprint.ts
184
- var BLUEPRINT_KEY4 = "org.dxos.blueprint.web-search";
185
- var make4 = () => Blueprint4.make({
186
- key: BLUEPRINT_KEY4,
187
- name: "Web Search",
188
- description: "Search the web.",
189
- agentCanEnable: true,
190
- instructions: {
191
- source: Ref3.make(Text3.make())
192
- },
193
- tools: Blueprint4.toolDefinitions({
194
- operations: [
195
- Fetch
196
- ],
197
- tools: [
198
- "AnthropicWebSearch"
199
- ]
200
- })
201
- });
202
- var blueprint4 = {
203
- key: BLUEPRINT_KEY4,
204
- make: make4
205
- };
206
- var blueprint_default5 = blueprint4;
207
-
208
- // src/blueprints/websearch/toolkit.ts
209
- import * as AnthropicTool from "@effect/ai-anthropic/AnthropicTool";
210
- import * as Toolkit from "@effect/ai/Toolkit";
211
- import * as Layer from "effect/Layer";
212
- import { OpaqueToolkit } from "@dxos/ai";
213
- var WebSearchToolkit = Toolkit.make(AnthropicTool.WebSearch_20250305({}));
214
- var WebSearchToolkitOpaque = OpaqueToolkit.make(WebSearchToolkit, Layer.empty);
273
+ // src/blueprints/blueprint-manager/operations/index.ts
274
+ import { OperationHandlerSet as OperationHandlerSet2 } from "@dxos/compute";
275
+ var BlueprintManagerHandlers = OperationHandlerSet2.lazy(() => import("./query-blueprints-7NDHHM7U.mjs"), () => import("./enable-blueprints-OGYSQ7HD.mjs"));
215
276
 
216
277
  // src/blueprints/browser/blueprint.ts
217
- import { Blueprint as Blueprint5 } from "@dxos/compute";
218
- import { Ref as Ref4 } from "@dxos/echo";
219
- import { Text as Text4 } from "@dxos/schema";
220
- import { trim as trim3 } from "@dxos/util";
221
- var BLUEPRINT_KEY5 = "org.dxos.blueprint.browser";
222
- var instructions3 = trim3`
278
+ import { Blueprint as Blueprint4 } from "@dxos/compute";
279
+ import { Ref as Ref2 } from "@dxos/echo";
280
+ import { Text as Text2 } from "@dxos/schema";
281
+ import { trim as trim4 } from "@dxos/util";
282
+ var BLUEPRINT_KEY4 = "org.dxos.blueprint.browser";
283
+ var instructions2 = trim4`
223
284
  You are able to connect and use a virtual browser with persistent session.
224
285
  Browser tools are provided via MCP.
225
286
  `;
226
- var make6 = () => Blueprint5.make({
227
- key: BLUEPRINT_KEY5,
287
+ var make4 = () => Blueprint4.make({
288
+ key: BLUEPRINT_KEY4,
228
289
  name: "Browser",
229
290
  description: "Access to a real isolated browser.",
230
291
  agentCanEnable: true,
231
292
  instructions: {
232
- source: Ref4.make(Text4.make(instructions3))
293
+ source: Ref2.make(Text2.make({
294
+ content: instructions2
295
+ }))
233
296
  },
234
297
  mcpServers: [
235
298
  {
@@ -239,37 +302,33 @@ var make6 = () => Blueprint5.make({
239
302
  }
240
303
  ]
241
304
  });
242
- var blueprint5 = {
243
- key: BLUEPRINT_KEY5,
244
- make: make6
305
+ var blueprint4 = {
306
+ key: BLUEPRINT_KEY4,
307
+ make: make4
245
308
  };
246
- var blueprint_default6 = blueprint5;
247
-
248
- // src/blueprints/database/blueprint.ts
249
- import { Blueprint as Blueprint6 } from "@dxos/compute";
250
- import { Ref as Ref5 } from "@dxos/echo";
251
- import { Text as Text5 } from "@dxos/schema";
252
- import { trim as trim4 } from "@dxos/util";
253
-
254
- // src/blueprints/database/functions/index.ts
255
- import { OperationHandlerSet as OperationHandlerSet5 } from "@dxos/compute";
256
- var DatabaseHandlers = OperationHandlerSet5.lazy(() => import("./context-add-IIDPRRVB.mjs"), () => import("./context-remove-RDYV4PD4.mjs"), () => import("./load-LI7HHVD6.mjs"), () => import("./object-create-52Z7YKIA.mjs"), () => import("./object-delete-I266YAXI.mjs"), () => import("./object-update-HY4GI7LA.mjs"), () => import("./query-B3NOYFCK.mjs"), () => import("./relation-create-Z3NGW4VU.mjs"), () => import("./relation-delete-LXY7W2YO.mjs"), () => import("./schema-add-4TXJO2V7.mjs"), () => import("./schema-list-Q7HRRKGR.mjs"), () => import("./tag-add-5NOHUTIE.mjs"), () => import("./tag-remove-QTKYDJAW.mjs"));
309
+ var blueprint_default5 = blueprint4;
257
310
 
258
311
  // src/blueprints/database/blueprint.ts
259
- var BLUEPRINT_KEY6 = "org.dxos.blueprint.database";
260
- var instructions4 = trim4`
312
+ import { Blueprint as Blueprint5 } from "@dxos/compute";
313
+ import { Ref as Ref3 } from "@dxos/echo";
314
+ import { Text as Text3 } from "@dxos/schema";
315
+ import { trim as trim5 } from "@dxos/util";
316
+ var BLUEPRINT_KEY5 = "org.dxos.blueprint.database";
317
+ var instructions3 = trim5`
261
318
  You can query, create, update, and delete objects in ECHO.
262
319
  You can manage schemas, relations, tags, and add objects to the chat context.
263
320
  `;
264
- var make7 = () => Blueprint6.make({
265
- key: BLUEPRINT_KEY6,
321
+ var make5 = () => Blueprint5.make({
322
+ key: BLUEPRINT_KEY5,
266
323
  name: "Database",
267
324
  description: "Query and manipulate objects in the ECHO database.",
268
325
  agentCanEnable: true,
269
326
  instructions: {
270
- source: Ref5.make(Text5.make(instructions4))
327
+ source: Ref3.make(Text3.make({
328
+ content: instructions3
329
+ }))
271
330
  },
272
- tools: Blueprint6.toolDefinitions({
331
+ tools: Blueprint5.toolDefinitions({
273
332
  operations: [
274
333
  ContextAdd,
275
334
  ContextRemove,
@@ -287,25 +346,123 @@ var make7 = () => Blueprint6.make({
287
346
  ]
288
347
  })
289
348
  });
290
- var blueprint6 = {
291
- key: BLUEPRINT_KEY6,
292
- make: make7
349
+ var blueprint5 = {
350
+ key: BLUEPRINT_KEY5,
351
+ make: make5
352
+ };
353
+ var blueprint_default6 = blueprint5;
354
+
355
+ // src/blueprints/database/operations/index.ts
356
+ import { OperationHandlerSet as OperationHandlerSet3 } from "@dxos/compute";
357
+ var DatabaseHandlers = OperationHandlerSet3.lazy(() => import("./context-add-KWEKPGMI.mjs"), () => import("./context-remove-HIQFSVHW.mjs"), () => import("./load-C4OPO7RD.mjs"), () => import("./object-create-F7R7IRW5.mjs"), () => import("./object-delete-3TJ3XMLN.mjs"), () => import("./object-update-EBRM5AKN.mjs"), () => import("./query-QGSHZMCD.mjs"), () => import("./relation-create-WA2DM76W.mjs"), () => import("./relation-delete-66XP7KL7.mjs"), () => import("./schema-add-2AWYVGOC.mjs"), () => import("./schema-list-74CQW2N3.mjs"), () => import("./tag-add-6EGIY2CC.mjs"), () => import("./tag-remove-XVTYJRI7.mjs"));
358
+
359
+ // src/blueprints/delegation/blueprint.ts
360
+ import { Blueprint as Blueprint6 } from "@dxos/compute";
361
+ var BLUEPRINT_KEY6 = "org.dxos.blueprint.delegation";
362
+ var make6 = () => Blueprint6.make({
363
+ key: BLUEPRINT_KEY6,
364
+ name: "Delegation",
365
+ description: "Delegates work to sub-agents and tracks it as plan tasks.",
366
+ tools: Blueprint6.toolDefinitions({
367
+ operations: [
368
+ DelegateTask
369
+ ]
370
+ })
371
+ });
372
+ var blueprint6 = {
373
+ key: BLUEPRINT_KEY6,
374
+ make: make6
375
+ };
376
+ var blueprint_default7 = blueprint6;
377
+
378
+ // src/blueprints/delegation/operations/index.ts
379
+ import { OperationHandlerSet as OperationHandlerSet4 } from "@dxos/compute";
380
+ var DelegationHandlers = OperationHandlerSet4.lazy(() => import("./delegate-task-E7WLHT6S.mjs"));
381
+
382
+ // src/blueprints/discord/blueprint.ts
383
+ import { Blueprint as Blueprint7 } from "@dxos/compute";
384
+ import { Ref as Ref4 } from "@dxos/echo";
385
+ import { Text as Text4 } from "@dxos/schema";
386
+ import { trim as trim6 } from "@dxos/util";
387
+ var BLUEPRINT_KEY7 = "org.dxos.blueprint.discord";
388
+ var instructions4 = trim6`
389
+ You are able to fetch messages from Discord servers.
390
+
391
+ Known servers:
392
+
393
+ DXOS serverId: 837138313172353095
394
+ `;
395
+ var make7 = () => Blueprint7.make({
396
+ key: BLUEPRINT_KEY7,
397
+ name: "Discord",
398
+ description: "Discord integration.",
399
+ instructions: {
400
+ source: Ref4.make(Text4.make({
401
+ content: instructions4
402
+ }))
403
+ },
404
+ tools: Blueprint7.toolDefinitions({
405
+ operations: [
406
+ FetchMessages
407
+ ]
408
+ })
409
+ });
410
+ var blueprint7 = {
411
+ key: BLUEPRINT_KEY7,
412
+ make: make7
413
+ };
414
+ var blueprint_default8 = blueprint7;
415
+
416
+ // src/blueprints/discord/operations/index.ts
417
+ import { OperationHandlerSet as OperationHandlerSet5 } from "@dxos/compute";
418
+ var DiscordHandlers = OperationHandlerSet5.lazy(() => import("./fetch-messages-4EVGVEQK.mjs"));
419
+
420
+ // src/blueprints/linear/blueprint.ts
421
+ import { Blueprint as Blueprint8 } from "@dxos/compute";
422
+ import { Ref as Ref5 } from "@dxos/echo";
423
+ import { Text as Text5 } from "@dxos/schema";
424
+ import { trim as trim7 } from "@dxos/util";
425
+ var BLUEPRINT_KEY8 = "org.dxos.blueprint.linear";
426
+ var instructions5 = trim7`
427
+ You are able to sync Linear workspaces.
428
+ Sometimes sync does not complete in one go and you need to call the function again.
429
+
430
+ Known workspaces:
431
+
432
+ DXOS teamId: 1127c63a-6f77-4725-9229-50f6cd47321c
433
+ `;
434
+ var make8 = () => Blueprint8.make({
435
+ key: BLUEPRINT_KEY8,
436
+ name: "Linear",
437
+ description: "Syncs Linear workspaces.",
438
+ instructions: {
439
+ source: Ref5.make(Text5.make({
440
+ content: instructions5
441
+ }))
442
+ },
443
+ tools: Blueprint8.toolDefinitions({
444
+ operations: [
445
+ SyncIssues
446
+ ]
447
+ })
448
+ });
449
+ var blueprint8 = {
450
+ key: BLUEPRINT_KEY8,
451
+ make: make8
293
452
  };
294
- var blueprint_default7 = blueprint6;
295
-
296
- // src/blueprints/memory/blueprint.ts
297
- import { Blueprint as Blueprint7 } from "@dxos/compute";
298
- import { Ref as Ref6 } from "@dxos/echo";
299
- import { Text as Text6 } from "@dxos/schema";
300
- import { trim as trim5 } from "@dxos/util";
453
+ var blueprint_default9 = blueprint8;
301
454
 
302
- // src/blueprints/memory/functions/index.ts
455
+ // src/blueprints/linear/operations/index.ts
303
456
  import { OperationHandlerSet as OperationHandlerSet6 } from "@dxos/compute";
304
- var MemoryHandlers = OperationHandlerSet6.lazy(() => import("./save-GWAPLT3Z.mjs"), () => import("./query-U56GNEV6.mjs"), () => import("./delete-J3PMWP7Z.mjs"));
457
+ var LinearHandlers = OperationHandlerSet6.lazy(() => import("./sync-issues-VUX4OWPO.mjs"));
305
458
 
306
459
  // src/blueprints/memory/blueprint.ts
307
- var BLUEPRINT_KEY7 = "org.dxos.blueprint.memory";
308
- var instructions5 = trim5`
460
+ import { Blueprint as Blueprint9 } from "@dxos/compute";
461
+ import { Ref as Ref6 } from "@dxos/echo";
462
+ import { Text as Text6 } from "@dxos/schema";
463
+ import { trim as trim8 } from "@dxos/util";
464
+ var BLUEPRINT_KEY9 = "org.dxos.blueprint.memory";
465
+ var instructions6 = trim8`
309
466
  You have the ability to save and recall memories.
310
467
  Memories are persistent knowledge units stored in the database.
311
468
  Use memories to remember facts, user preferences, decisions, and any knowledge that should persist across conversations.
@@ -314,15 +471,17 @@ var instructions5 = trim5`
314
471
  When the user asks about something you might have stored, query your memories first.
315
472
  You can also delete outdated or incorrect memories.
316
473
  `;
317
- var make8 = () => Blueprint7.make({
318
- key: BLUEPRINT_KEY7,
474
+ var make9 = () => Blueprint9.make({
475
+ key: BLUEPRINT_KEY9,
319
476
  name: "Memory",
320
477
  description: "Persistent memory storage and retrieval.",
321
478
  agentCanEnable: true,
322
479
  instructions: {
323
- source: Ref6.make(Text6.make(instructions5))
480
+ source: Ref6.make(Text6.make({
481
+ content: instructions6
482
+ }))
324
483
  },
325
- tools: Blueprint7.toolDefinitions({
484
+ tools: Blueprint9.toolDefinitions({
326
485
  operations: [
327
486
  SaveMemory,
328
487
  QueryMemories,
@@ -330,213 +489,75 @@ var make8 = () => Blueprint7.make({
330
489
  ]
331
490
  })
332
491
  });
333
- var blueprint7 = {
334
- key: BLUEPRINT_KEY7,
335
- make: make8
336
- };
337
- var blueprint_default8 = blueprint7;
338
-
339
- // src/blueprints/automation/blueprint.ts
340
- import { Blueprint as Blueprint8 } from "@dxos/compute";
341
- import { Trigger } from "@dxos/compute";
342
- import { Operation } from "@dxos/compute";
343
- import { Ref as Ref7 } from "@dxos/echo";
344
- import { Text as Text7 } from "@dxos/schema";
345
- import { trim as trim6 } from "@dxos/util";
346
- var BLUEPRINT_KEY8 = "dxos.org/blueprint/automation";
347
- var instructions6 = trim6`
348
- Automation allows you to automatically initiate actions based on events.
349
- Automations are configured by creating a trigger that references a function.
350
- Whenever event that matches the trigger occurs, the function is invoked.
351
-
352
- ## Configuration
353
-
354
- Triggers are configured by the properties of the Trigger object.
355
- - enabled: Must be true for trigger to run.
356
- - spec: Events that the trigger matches.
357
- - function: Ref to a ${Operation.PersistentOperation.typename} object that will be invoked. Query the functions present in the space first, and reference them in the trigger.
358
- - input: The spec of the input data that will be passed to the function.
359
-
360
- ## Input patterns
361
-
362
- Input to the invoked function is defined by the input property of the Trigger object.
363
- It's an object that supports constants or template strings.
364
-
365
- Example:
366
-
367
- {
368
- item: '{{event.item}}',
369
- instructions: 'Summarize and perform entity-extraction'
370
- mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
371
- }
372
-
373
- ## Trigger kinds
374
-
375
- - Timer: Triggered by a cron schedule.
376
- - Queue: Subscribes and processes items begginging to end.
377
- Note: queues are the same as feeds. The queue DXN should be of form: dxn:queue:data:<space-id>:<queue-id>.
378
- - Subscription: Subscribes and processes database items based on a query.
379
-
380
- Avoid: email and webhook triggers.
381
-
382
- ## Editing triggers
383
-
384
- Triggers are represented as objects of type ${Trigger.Trigger.typename}.
385
- You need access to the Database blueprint to manipulate triggers.
386
- Read trigger schema before manipulating triggers.
387
- Having a Trigger object in the database is enough to setup an automation.
388
-
389
- ## Examples
390
-
391
- Timer:
392
-
393
- {
394
- "function": { "/": "dxn:echo:AAA:ZZZ" },
395
- "enabled": true,
396
- "spec": {
397
- "kind": "timer",
398
- "cron": "*/5 * * * *"
399
- }
400
- }
401
-
402
- Queue:
403
-
404
- {
405
- "function": { "/": "dxn:echo:AAA:ZZZ" },
406
- "enabled": true,
407
- "spec": {
408
- "kind": "queue",
409
- "queue": "dxn:queue:data:XXX:YYY"
410
- }
411
- }
412
-
413
- Subscription:
414
-
415
- {
416
- "function": { "/": "dxn:echo:AAA:ZZZ" },
417
- "enabled": true,
418
- "spec": {
419
- "kind": "subscription",
420
- "query": { "ast": { "type": "select", "filter": { "type": "object", "typename": "dxn:type:org.dxos.type.person" } } }
421
- }
422
- }
423
- `;
424
- var make9 = () => Blueprint8.make({
425
- key: BLUEPRINT_KEY8,
426
- name: "Triggers",
427
- description: "Trigger management and automation.",
428
- instructions: {
429
- source: Ref7.make(Text7.make(instructions6))
430
- }
431
- });
432
- var blueprint8 = {
433
- key: BLUEPRINT_KEY8,
492
+ var blueprint9 = {
493
+ key: BLUEPRINT_KEY9,
434
494
  make: make9
435
495
  };
436
- var blueprint_default9 = blueprint8;
437
-
438
- // src/blueprints/blueprint-manager/blueprint.ts
439
- import { Blueprint as Blueprint9, Template } from "@dxos/compute";
440
- import { trim as trim7 } from "@dxos/util";
496
+ var blueprint_default10 = blueprint9;
441
497
 
442
- // src/blueprints/blueprint-manager/functions/index.ts
498
+ // src/blueprints/memory/operations/index.ts
443
499
  import { OperationHandlerSet as OperationHandlerSet7 } from "@dxos/compute";
444
- var BlueprintManagerHandlers = OperationHandlerSet7.lazy(() => import("./query-blueprints-Z576ABT5.mjs"), () => import("./enable-blueprints-LELPQHY5.mjs"), () => import("./update-blueprints-K7A5SHBZ.mjs"));
445
-
446
- // src/blueprints/blueprint-manager/blueprint.ts
447
- var BLUEPRINT_KEY9 = "org.dxos.blueprint.blueprint-manager";
448
- var make10 = () => Blueprint9.make({
449
- key: BLUEPRINT_KEY9,
450
- name: "Blueprint Manager",
451
- description: "Query and enable blueprints in the current conversation.",
452
- instructions: Template.make({
453
- source: trim7`
454
- You can query available blueprints and enable them in the current conversation.
455
- Use [query-blueprints] to refresh the list of available blueprints.
456
- Use [refresh-blueprints] to update blueprint objects stored in the database from the built-in registry when they have drifted.
457
- Use [enable-blueprints] to enable blueprints by their keys. Always call [query-blueprints] first.
458
- Only blueprints with agentCanEnable=true can be enabled by the agent.
459
-
460
- <available_blueprints>
461
- {{#each blueprints}}
462
- - {{key}} "{{name}}"{{#if description}} -- {{description}}{{/if}}{{#if agentCanEnable}} [agent-can-enable]{{/if}}
463
- {{/each}}
464
- </available_blueprints>
500
+ var MemoryHandlers = OperationHandlerSet7.lazy(() => import("./save-HQY35ACW.mjs"), () => import("./query-6XCQIIZC.mjs"), () => import("./delete-QHGM7N23.mjs"));
465
501
 
466
- NOTE: You must enable the blueprint to use it, only then the tools from that blueprint will appear.
467
- `,
468
- inputs: [
469
- {
470
- name: "blueprints",
471
- kind: "function",
472
- function: QueryBlueprints.meta.key
473
- }
474
- ]
475
- }),
476
- tools: Blueprint9.toolDefinitions({
502
+ // src/blueprints/planning/blueprint.ts
503
+ import { Blueprint as Blueprint10 } from "@dxos/compute";
504
+ var BLUEPRINT_KEY10 = "org.dxos.blueprint.planning";
505
+ var make10 = () => Blueprint10.make({
506
+ key: BLUEPRINT_KEY10,
507
+ name: "Planning",
508
+ description: "Plans and tracks complex tasks using artifacts.",
509
+ tools: Blueprint10.toolDefinitions({
477
510
  operations: [
478
- QueryBlueprints,
479
- EnableBlueprints,
480
- UpdateBlueprints
511
+ UpdateTasks
481
512
  ]
482
513
  })
483
514
  });
484
- var blueprint9 = {
485
- key: BLUEPRINT_KEY9,
515
+ var blueprint10 = {
516
+ key: BLUEPRINT_KEY10,
486
517
  make: make10
487
518
  };
488
- var blueprint_default10 = blueprint9;
489
-
490
- // src/blueprints/project-wizard/blueprint.ts
491
- import { Blueprint as Blueprint10, Template as Template2 } from "@dxos/compute";
492
- import { trim as trim8 } from "@dxos/util";
519
+ var blueprint_default11 = blueprint10;
493
520
 
494
- // src/blueprints/project-wizard/functions/index.ts
521
+ // src/blueprints/planning/operations/index.ts
495
522
  import { OperationHandlerSet as OperationHandlerSet8 } from "@dxos/compute";
496
- var AgentWizardHandlers = OperationHandlerSet8.lazy(() => import("./create-project-MPAMKQ3T.mjs"), () => import("./project-rules-FLUQQRPB.mjs"), () => import("./sync-triggers-NV4JCRN5.mjs"));
523
+ var PlanningHandlers = OperationHandlerSet8.lazy(() => import("./update-tasks-N65UQUHS.mjs"));
497
524
 
498
- // src/blueprints/project-wizard/blueprint.ts
499
- var BLUEPRINT_KEY10 = "org.dxos.blueprint.agent-wizard";
500
- var make11 = () => Blueprint10.make({
501
- key: BLUEPRINT_KEY10,
502
- name: "Agent Wizard",
503
- description: "Help the user create a new agent (subscriptions, optional cron timer, sync-triggers after edits).",
525
+ // src/blueprints/websearch/blueprint.ts
526
+ import { Blueprint as Blueprint11 } from "@dxos/compute";
527
+ import { Ref as Ref7 } from "@dxos/echo";
528
+ import { Text as Text7 } from "@dxos/schema";
529
+ var BLUEPRINT_KEY11 = "org.dxos.blueprint.webSearch";
530
+ var make11 = () => Blueprint11.make({
531
+ key: BLUEPRINT_KEY11,
532
+ name: "Web Search",
533
+ description: "Search the web.",
504
534
  agentCanEnable: true,
505
- instructions: Template2.make({
506
- source: trim8`
507
- You are a wizard that helps the user create a new agent.
508
-
509
- Agents are goal oriented and autonomously driven.
510
- Each agent has instructions - the goal of the agent.
511
- The instructions also typically describe what actions to perform in reaction to events (emails).
512
- The agent has a number of associated artifacts to work with.
513
- Agents can subscribe to emails.
514
-
515
- Agents have a \`cron\` field: when set, the agent runs on a timer on that schedule (standard cron syntax).
516
- Use \`cron\` when the user wants the agent to run periodically (e.g. "every morning", "once a day", "every 5 minutes").
517
- Examples: \`0 9 * * *\` for daily at 09:00, or \`*/5 * * * *\` for every 5 minutes.
518
- Timer triggers bypass the qualifier and invoke the agent worker directly on the schedule.
519
-
520
- The agent itself is an ECHO object and can be edited like any other object using the database blueprint.
521
- You can edit the agent's instructions, name, and other properties directly.
522
- If you edit the agent's \`enabled\` field, \`filterEvents\` field, subscriptions array, or \`cron\` field, you MUST call the sync-triggers function afterward to synchronize the triggers (\`enabled\` is applied to all triggers).
523
-
524
- IMPORTANT: Before attempting to create an agent call the [agent-rules] tool to get the rules for creating an agent.
525
- `
526
- }),
527
- tools: Blueprint10.toolDefinitions({
535
+ instructions: {
536
+ source: Ref7.make(Text7.make())
537
+ },
538
+ tools: Blueprint11.toolDefinitions({
528
539
  operations: [
529
- AgentRules,
530
- CreateAgent,
531
- SyncTriggers
540
+ Fetch
532
541
  ]
533
542
  })
534
543
  });
535
- var blueprint10 = {
536
- key: BLUEPRINT_KEY10,
544
+ var blueprint11 = {
545
+ key: BLUEPRINT_KEY11,
537
546
  make: make11
538
547
  };
539
- var blueprint_default11 = blueprint10;
548
+ var blueprint_default12 = blueprint11;
549
+
550
+ // src/blueprints/websearch/toolkit.ts
551
+ import * as AnthropicTool from "@effect/ai-anthropic/AnthropicTool";
552
+ import * as Toolkit from "@effect/ai/Toolkit";
553
+ import * as Layer from "effect/Layer";
554
+ import { OpaqueToolkit } from "@dxos/ai";
555
+ var WebSearchToolkit = Toolkit.make(AnthropicTool.WebSearch_20250305({}));
556
+ var WebSearchToolkitOpaque = OpaqueToolkit.make(WebSearchToolkit, Layer.empty);
557
+
558
+ // src/blueprints/websearch/operations/index.ts
559
+ import { OperationHandlerSet as OperationHandlerSet9 } from "@dxos/compute";
560
+ var WebSearchHandlers = OperationHandlerSet9.lazy(() => import("./fetch-O6G46HJH.mjs"));
540
561
 
541
562
  // src/crud/graph.ts
542
563
  import * as Tool from "@effect/ai/Tool";
@@ -547,41 +568,37 @@ import * as Function from "effect/Function";
547
568
  import * as Option from "effect/Option";
548
569
  import * as Schema from "effect/Schema";
549
570
  import * as SchemaAST from "effect/SchemaAST";
550
- import { ContextQueueService } from "@dxos/compute";
551
- import { Entity, Filter, Obj, Query as Query2, Type } from "@dxos/echo";
552
- import { Database } from "@dxos/echo";
571
+ import { Database, Entity, Feed, Filter, Query as Query2, Relation, Scope, Type as Type2 } from "@dxos/echo";
553
572
  import { isEncodedReference } from "@dxos/echo-protocol";
554
- import { ReferenceAnnotationId, RelationSourceDXNId, RelationSourceId, RelationTargetDXNId, RelationTargetId, createObject, getTypeAnnotation, getTypeIdentifierAnnotation } from "@dxos/echo/internal";
555
- import { mapAst } from "@dxos/effect";
556
- import { DXN, ObjectId } from "@dxos/keys";
573
+ import { ReferenceAnnotationId, getTypeAnnotation, getTypeIdentifierAnnotation } from "@dxos/echo/Annotation";
574
+ import { createObject } from "@dxos/echo/internal";
575
+ import { SchemaEx } from "@dxos/effect";
576
+ import { DXN as DXN2, EID, EntityId } from "@dxos/keys";
557
577
  import { log } from "@dxos/log";
558
578
  import { deepMapValues, isNonNullable, trim as trim9 } from "@dxos/util";
559
- var __dxlog_file = "/__w/dxos/dxos/packages/core/assistant-toolkit/src/crud/graph.ts";
579
+ var __dxlog_file = "/__w/dxos/dxos/packages/core/compute/assistant-toolkit/src/crud/graph.ts";
560
580
  var Subgraph = Schema.Struct({
561
581
  /** Objects and relations. */
562
582
  objects: Schema.Array(Schema.Any)
563
583
  });
564
584
  var findRelatedSchema = async (db, anchor) => {
565
- const allSchemas = await db.graph.schemaRegistry.query().run();
585
+ const allSchemas = await db.query(Query2.select(Filter.type(Type2.Type)).from(Scope.space(), Scope.registry())).run();
566
586
  return allSchemas.filter((schema) => {
567
- if (getTypeAnnotation(schema)?.kind !== Entity.Kind.Relation) {
587
+ const annotation = getTypeAnnotation(Type2.getSchema(schema));
588
+ if (annotation?.kind !== Entity.Kind.Relation) {
568
589
  return false;
569
590
  }
570
- return isSchemaAddressableByDxn(anchor, DXN.parse(getTypeAnnotation(schema).sourceSchema)) || isSchemaAddressableByDxn(anchor, DXN.parse(getTypeAnnotation(schema).targetSchema));
591
+ return isSchemaAddressableByDXN(anchor, annotation.sourceSchema) || isSchemaAddressableByDXN(anchor, annotation.targetSchema);
571
592
  }).map((schema) => ({
572
593
  kind: "relation",
573
594
  schema
574
595
  }));
575
596
  };
576
- var isSchemaAddressableByDxn = (schema, dxn) => {
577
- if (getTypeIdentifierAnnotation(schema) === dxn.toString()) {
597
+ var isSchemaAddressableByDXN = (type, dxn) => {
598
+ if (getTypeIdentifierAnnotation(Type2.getSchema(type)) === dxn) {
578
599
  return true;
579
600
  }
580
- const t = dxn.asTypeDXN();
581
- if (t) {
582
- return t.type === Type.getTypename(schema);
583
- }
584
- return false;
601
+ return DXN2.getName(dxn) === Type2.getTypename(type);
585
602
  };
586
603
  var LocalSearchToolkit = Toolkit2.make(Tool.make("search_local_search", {
587
604
  description: "Search the local database for information using a vector index",
@@ -593,21 +610,22 @@ var LocalSearchToolkit = Toolkit2.make(Tool.make("search_local_search", {
593
610
  success: Schema.Unknown,
594
611
  failure: Schema.Never,
595
612
  dependencies: [
596
- Database.Service
613
+ Database.Service,
614
+ Feed.FeedService
597
615
  ]
598
616
  }));
599
617
  var LocalSearchHandler = LocalSearchToolkit.toLayer({
600
618
  search_local_search: Effect.fn(function* ({ query }) {
601
- const objects = yield* Database.runQuery(Query2.select(Filter.text(query, {
619
+ const objects = yield* Database.query(Query2.select(Filter.text(query, {
602
620
  type: "vector"
603
- })));
621
+ }))).run;
604
622
  const results = [
605
623
  ...objects
606
624
  ];
607
- const option = yield* Effect.serviceOption(ContextQueueService);
608
- if (Option.isSome(option)) {
609
- const queueObjects = yield* Effect.promise(() => option.value.queue.queryObjects());
610
- results.push(...queueObjects);
625
+ const feedOption = yield* Effect.serviceOption(Feed.ContextFeedService);
626
+ if (Option.isSome(feedOption)) {
627
+ const feedObjects = yield* Feed.runQuery(feedOption.value.feed, Filter.everything());
628
+ results.push(...feedObjects);
611
629
  }
612
630
  return trim9`
613
631
  <local_context>
@@ -626,7 +644,8 @@ var makeGraphWriterToolkit = ({ schema }) => {
626
644
  failure: Schema.Never,
627
645
  dependencies: [
628
646
  Database.Service,
629
- ContextQueueService
647
+ Feed.ContextFeedService,
648
+ Feed.FeedService
630
649
  ]
631
650
  }).annotateContext(Context.make(GraphWriterSchema, {
632
651
  schema
@@ -637,10 +656,10 @@ var makeGraphWriterHandler = (toolkit, { onAppend } = {}) => {
637
656
  return toolkit.toLayer({
638
657
  graph_writer: Effect.fn(function* (input) {
639
658
  const { db } = yield* Database.Service;
640
- const { queue } = yield* ContextQueueService;
641
- const data = yield* Effect.promise(() => sanitizeObjects(schema, input, db, queue));
642
- yield* Effect.promise(() => queue.append(data));
643
- const dxns = data.map((obj) => Obj.getDXN(obj));
659
+ const { feed } = yield* Feed.ContextFeedService;
660
+ const data = yield* sanitizeObjects(schema, input, db, feed);
661
+ yield* Feed.append(feed, data);
662
+ const dxns = data.map((obj) => Entity.getURI(obj));
644
663
  onAppend?.(dxns);
645
664
  return dxns;
646
665
  })
@@ -648,18 +667,18 @@ var makeGraphWriterHandler = (toolkit, { onAppend } = {}) => {
648
667
  };
649
668
  var createExtractionSchema = (types) => {
650
669
  return Schema.Struct({
651
- ...Object.fromEntries(types.map(preprocessSchema).map((schema, index) => [
670
+ ...Object.fromEntries(types.map((type) => preprocessSchema(Type2.getSchema(type))).map((schema, index) => [
652
671
  `objects_${getSanitizedSchemaName(types[index])}`,
653
672
  Schema.optional(Schema.Array(schema)).annotations({
654
- description: `The objects of type: ${Type.getDXN(types[index])?.asTypeDXN().type}. ${SchemaAST.getDescriptionAnnotation(types[index].ast).pipe(Option.getOrElse(() => ""))}`
673
+ description: `The objects of type: ${DXN2.getName(DXN2.tryMake(Type2.getURI(types[index])))}. ${SchemaAST.getDescriptionAnnotation(Type2.getSchema(types[index]).ast).pipe(Option.getOrElse(() => ""))}`
655
674
  })
656
675
  ]))
657
676
  });
658
677
  };
659
678
  var getSanitizedSchemaName = (schema) => {
660
- return Type.getDXN(schema).asTypeDXN().type.replaceAll(/[^a-zA-Z0-9]+/g, "_");
679
+ return DXN2.getName(DXN2.tryMake(Type2.getURI(schema))).replaceAll(/[^a-zA-Z0-9]+/g, "_");
661
680
  };
662
- var sanitizeObjects = async (types, data, db, queue) => {
681
+ var sanitizeObjects = (types, data, db, feed) => Effect.gen(function* () {
663
682
  const entries = types.map((type) => data[`objects_${getSanitizedSchemaName(type)}`]?.map((object) => ({
664
683
  data: object,
665
684
  schema: type
@@ -668,21 +687,25 @@ var sanitizeObjects = async (types, data, db, queue) => {
668
687
  const existingIds = /* @__PURE__ */ new Set();
669
688
  const enitties = /* @__PURE__ */ new Map();
670
689
  const resolveId = (id) => {
671
- if (ObjectId.isValid(id)) {
690
+ if (EntityId.isValid(id)) {
672
691
  existingIds.add(id);
673
- return DXN.fromLocalObjectId(id);
692
+ return EID.make({
693
+ entityId: id
694
+ });
674
695
  }
675
696
  const mappedId = idMap.get(id);
676
- if (mappedId) {
677
- return DXN.fromLocalObjectId(mappedId);
697
+ if (mappedId && EntityId.isValid(mappedId)) {
698
+ return EID.make({
699
+ entityId: mappedId
700
+ });
678
701
  }
679
702
  return void 0;
680
703
  };
681
704
  const res = entries.map((entry) => {
682
- if (ObjectId.isValid(entry.data.id)) {
705
+ if (EntityId.isValid(entry.data.id)) {
683
706
  return entry;
684
707
  }
685
- idMap.set(entry.data.id, ObjectId.random());
708
+ idMap.set(entry.data.id, EntityId.random());
686
709
  entry.data.id = idMap.get(entry.data.id);
687
710
  return entry;
688
711
  }).map((entry) => {
@@ -702,64 +725,62 @@ var sanitizeObjects = async (types, data, db, queue) => {
702
725
  }
703
726
  return recurse(value);
704
727
  });
705
- if (Entity.getKind(entry.schema) === "relation") {
706
- const sourceDxn = resolveId(data2.source);
707
- if (!sourceDxn) {
728
+ let sourceUri;
729
+ let targetUri;
730
+ if (Entity.getKind(Type2.getSchema(entry.schema)) === "relation") {
731
+ sourceUri = resolveId(data2.source);
732
+ if (!sourceUri) {
708
733
  log.warn("source not found", {
709
734
  source: data2.source
710
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 193, S: void 0 });
735
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 196, S: this });
711
736
  }
712
- const targetDxn = resolveId(data2.target);
713
- if (!targetDxn) {
737
+ targetUri = resolveId(data2.target);
738
+ if (!targetUri) {
714
739
  log.warn("target not found", {
715
740
  target: data2.target
716
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 199, S: void 0 });
741
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 202, S: this });
717
742
  }
718
743
  delete data2.source;
719
744
  delete data2.target;
720
- data2[RelationSourceDXNId] = sourceDxn;
721
- data2[RelationTargetDXNId] = targetDxn;
722
745
  }
723
746
  return {
724
747
  data: data2,
725
- schema: entry.schema
748
+ schema: entry.schema,
749
+ sourceUri,
750
+ targetUri
726
751
  };
727
752
  }).filter((object) => !existingIds.has(object.data.id));
728
- const dbObjects = await db.query(Query2.select(Filter.id(...existingIds))).run();
729
- const queueObjects = await queue?.getObjectsById([
730
- ...existingIds
731
- ]) ?? [];
753
+ const dbObjects = yield* Effect.promise(() => db.query(Query2.select(Filter.id(...existingIds))).run());
754
+ const feedObjects = feed && existingIds.size > 0 ? yield* Feed.runQuery(feed, Filter.id(...existingIds)) : [];
732
755
  const objects = [
733
756
  ...dbObjects,
734
- ...queueObjects
757
+ ...feedObjects
735
758
  ].filter(isNonNullable);
736
759
  log.info("objects", {
737
760
  dbObjects,
738
- queueObjects,
761
+ feedObjects,
739
762
  existingIds
740
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 223, S: void 0 });
763
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 224, S: this });
741
764
  const missing = Array.from(existingIds).filter((id) => !objects.some((object) => object.id === id));
742
765
  if (missing.length > 0) {
743
766
  throw new Error(`Object IDs do not point to existing objects: ${missing.join(", ")}`);
744
767
  }
745
- return res.flatMap(({ data: data2, schema }) => {
768
+ return res.flatMap(({ data: data2, schema, sourceUri, targetUri }) => {
746
769
  let skip = false;
747
- if (RelationSourceDXNId in data2) {
748
- const id = data2[RelationSourceDXNId].asEchoDXN()?.echoId;
749
- const obj = objects.find((object) => object.id === id) ?? enitties.get(id);
770
+ if (sourceUri) {
771
+ const id = EID.getEntityId(sourceUri);
772
+ const obj = objects.find((object) => object.id === id) ?? (id ? enitties.get(id) : void 0);
750
773
  if (obj) {
751
- delete data2[RelationSourceDXNId];
752
- data2[RelationSourceId] = obj;
774
+ data2[Relation.Source] = obj;
753
775
  } else {
754
776
  skip = true;
755
777
  }
756
778
  }
757
- if (RelationTargetDXNId in data2) {
758
- const id = data2[RelationTargetDXNId].asEchoDXN()?.echoId;
759
- const obj = objects.find((object) => object.id === id) ?? enitties.get(id);
779
+ if (targetUri) {
780
+ const id = EID.getEntityId(targetUri);
781
+ const obj = objects.find((object) => object.id === id) ?? (id ? enitties.get(id) : void 0);
760
782
  if (obj) {
761
- delete data2[RelationTargetDXNId];
762
- data2[RelationTargetId] = obj;
783
+ data2[Relation.Target] = obj;
763
784
  } else {
764
785
  skip = true;
765
786
  }
@@ -773,7 +794,7 @@ var sanitizeObjects = async (types, data, db, queue) => {
773
794
  }
774
795
  return [];
775
796
  });
776
- };
797
+ });
777
798
  var SoftRef = Schema.Struct({
778
799
  "/": Schema.String
779
800
  }).annotations({
@@ -789,9 +810,9 @@ var preprocessSchema = (schema) => {
789
810
  if (SchemaAST.getAnnotation(ast, ReferenceAnnotationId).pipe(Option.isSome)) {
790
811
  return SoftRef.ast;
791
812
  }
792
- return mapAst(ast, (child) => go(child, visited));
813
+ return SchemaEx.mapAst(ast, (child) => go(child, visited));
793
814
  };
794
- return Schema.make(mapAst(schema.ast, (ast) => go(ast))).pipe(Schema.omit("id"), Schema.extend(Schema.Struct({
815
+ return Schema.make(SchemaEx.mapAst(schema.ast, (ast) => go(ast))).pipe(Schema.omit("id"), Schema.extend(Schema.Struct({
795
816
  id: Schema.String.annotations({
796
817
  description: "The id of this object. Come up with a unique id based on your judgement."
797
818
  })
@@ -806,8 +827,154 @@ var preprocessSchema = (schema) => {
806
827
  };
807
828
 
808
829
  // src/functions/agent/index.ts
809
- import { OperationHandlerSet as OperationHandlerSet9 } from "@dxos/compute";
810
- var AgentHandlers = OperationHandlerSet9.lazy(() => import("./prompt-4UMXX6QU.mjs"));
830
+ import { OperationHandlerSet as OperationHandlerSet10 } from "@dxos/compute";
831
+ var AgentHandlers = OperationHandlerSet10.lazy(() => import("./prompt-QL7TTLM3.mjs"));
832
+
833
+ // src/supervisor/delegation-strategy.ts
834
+ import * as Cause from "effect/Cause";
835
+ import * as Effect2 from "effect/Effect";
836
+ import * as Exit from "effect/Exit";
837
+ import { AiContext } from "@dxos/assistant";
838
+ import { Routine } from "@dxos/compute";
839
+ import { ProcessManager } from "@dxos/compute-runtime";
840
+ import { Database as Database2, Feed as Feed2, Filter as Filter2, Obj, Ref as Ref8 } from "@dxos/echo";
841
+ import { EffectEx } from "@dxos/effect";
842
+ import { log as log2 } from "@dxos/log";
843
+ import { Message } from "@dxos/types";
844
+ import { trim as trim10 } from "@dxos/util";
845
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/core/compute/assistant-toolkit/src/supervisor/delegation-strategy.ts";
846
+ var findAgentForFeed = (feed) => Effect2.gen(function* () {
847
+ const agents = yield* Database2.query(Filter2.type(Agent_exports.Agent)).run;
848
+ for (const agent of agents) {
849
+ if (!agent.chat) {
850
+ continue;
851
+ }
852
+ const matches = yield* Effect2.gen(function* () {
853
+ const chat = yield* Database2.load(agent.chat);
854
+ const chatFeed = yield* Database2.load(chat.feed);
855
+ return chatFeed.id === feed.id;
856
+ }).pipe(Effect2.orElseSucceed(() => false));
857
+ if (matches) {
858
+ return agent;
859
+ }
860
+ }
861
+ return void 0;
862
+ });
863
+ var formatResult = (value) => typeof value === "string" ? value : JSON.stringify(value);
864
+ var extractArtifactIds = (value) => {
865
+ if (typeof value !== "object" || value === null) {
866
+ return [];
867
+ }
868
+ const record = value;
869
+ const ids = Array.isArray(record.artifactIds) ? record.artifactIds : typeof record.artifactId === "string" ? [
870
+ record.artifactId
871
+ ] : [];
872
+ return ids.filter((id) => typeof id === "string");
873
+ };
874
+ var makeDelegationStrategy = () => ({
875
+ reconcile: (feed, activeIds) => Effect2.gen(function* () {
876
+ const agent = yield* findAgentForFeed(feed);
877
+ if (!agent) {
878
+ return [];
879
+ }
880
+ const plan = yield* Database2.load(agent.plan).pipe(Effect2.orElseSucceed(() => void 0));
881
+ if (!plan) {
882
+ return [];
883
+ }
884
+ const pending = plan.tasks.filter((task) => task.delegated === true && task.status === "in-progress" && !activeIds.has(task.id));
885
+ if (pending.length === 0) {
886
+ return [];
887
+ }
888
+ const inheritedBlueprints = yield* Effect2.gen(function* () {
889
+ const runtime2 = yield* Effect2.runtime();
890
+ const binder = yield* EffectEx.acquireReleaseResource(() => new AiContext.Binder({
891
+ feed,
892
+ runtime: runtime2
893
+ }));
894
+ return binder.getBlueprints().filter((blueprint12) => Obj.getMeta(blueprint12).key !== blueprint_default7.key);
895
+ }).pipe(Effect2.scoped);
896
+ const blueprints = inheritedBlueprints.map((blueprint12) => Ref8.make(blueprint12));
897
+ const delegations = [];
898
+ for (const task of pending) {
899
+ const routine = yield* Database2.add(Routine.make({
900
+ name: task.title,
901
+ instructions: trim10`
902
+ Complete the following task and report the result concisely.
903
+
904
+ If you create any documents or artifacts, call completeJob with a JSON object of the
905
+ form { "summary": string, "artifactIds": string[] }, where artifactIds are the exact
906
+ ids returned by the tools that created them. Otherwise return a short summary string.
907
+
908
+ Task: ${task.title}
909
+ `,
910
+ blueprints
911
+ }));
912
+ delegations.push({
913
+ id: task.id,
914
+ spawn: Effect2.gen(function* () {
915
+ const invoker = yield* ProcessManager.ProcessOperationInvoker.Service;
916
+ const fiber = yield* invoker.invokeFiber(AgentPrompt, {
917
+ prompt: Ref8.make(routine),
918
+ input: {}
919
+ });
920
+ return fiber.pid;
921
+ })
922
+ });
923
+ }
924
+ return delegations;
925
+ }),
926
+ onComplete: (feed, id, exit) => Effect2.gen(function* () {
927
+ const agent = yield* findAgentForFeed(feed);
928
+ const plan = agent ? yield* Database2.load(agent.plan).pipe(Effect2.orElseSucceed(() => void 0)) : void 0;
929
+ let title = id;
930
+ if (plan) {
931
+ Obj.update(plan, (plan2) => {
932
+ const task = plan2.tasks.find((task2) => task2.id === id);
933
+ if (task) {
934
+ task.status = Exit.isSuccess(exit) ? "done" : "failed";
935
+ title = task.title;
936
+ }
937
+ });
938
+ }
939
+ const artifactRefs = [];
940
+ if (agent && Exit.isSuccess(exit)) {
941
+ for (const artifactId of extractArtifactIds(exit.value)) {
942
+ const ref = yield* Agent_exports.addArtifact(agent, {
943
+ name: title,
944
+ id: artifactId
945
+ }).pipe(Effect2.orElseSucceed(() => void 0));
946
+ if (ref) {
947
+ artifactRefs.push(ref);
948
+ }
949
+ }
950
+ }
951
+ const failureCause = Exit.isFailure(exit) ? Cause.pretty(exit.cause) : void 0;
952
+ if (failureCause) {
953
+ log2.warn("sub-agent failed", {
954
+ taskId: id,
955
+ title,
956
+ cause: failureCause
957
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 149, S: this });
958
+ }
959
+ const text = Exit.isSuccess(exit) ? `The sub-agent completed "${title}".${artifactRefs.length === 0 ? ` ${formatResult(exit.value)}` : ""}` : `The sub-agent failed to complete "${title}": ${failureCause ?? "unknown error"}`;
960
+ const blocks = [
961
+ {
962
+ _tag: "text",
963
+ text
964
+ },
965
+ ...artifactRefs.map((reference) => ({
966
+ _tag: "reference",
967
+ reference
968
+ }))
969
+ ];
970
+ yield* Feed2.append(feed, [
971
+ Message.make({
972
+ sender: "assistant",
973
+ blocks
974
+ })
975
+ ]);
976
+ })
977
+ });
811
978
 
812
979
  // src/toolkits/WebToolkit.ts
813
980
  var WebToolkit_exports = {};
@@ -818,8 +985,9 @@ __export(WebToolkit_exports, {
818
985
  import * as AnthropicTool2 from "@effect/ai-anthropic/AnthropicTool";
819
986
  import * as Tool2 from "@effect/ai/Tool";
820
987
  import * as Toolkit3 from "@effect/ai/Toolkit";
821
- import * as Effect2 from "effect/Effect";
988
+ import * as Effect3 from "effect/Effect";
822
989
  import * as Schema2 from "effect/Schema";
990
+ import { proxyFetchLegacy } from "@dxos/edge-client/cors-proxy";
823
991
  var WebToolkit = Toolkit3.make(AnthropicTool2.WebSearch_20250305({}).pipe(), Tool2.make("WebFetch", {
824
992
  parameters: {
825
993
  url: Schema2.String
@@ -827,77 +995,70 @@ var WebToolkit = Toolkit3.make(AnthropicTool2.WebSearch_20250305({}).pipe(), Too
827
995
  success: Schema2.String
828
996
  }));
829
997
  var layer = WebToolkit.toLayer({
830
- WebFetch: Effect2.fnUntraced(function* ({ url }) {
831
- const response = yield* Effect2.promise(() => fetch(url).then((response2) => response2.text()));
832
- return response;
998
+ WebFetch: Effect3.fnUntraced(function* ({ url }) {
999
+ return yield* Effect3.tryPromise({
1000
+ try: async () => {
1001
+ const response = await proxyFetchLegacy(new URL(url));
1002
+ if (!response.ok) {
1003
+ const body = await response.text();
1004
+ return `Fetch failed with status ${response.status}: ${body.slice(0, 256)}`;
1005
+ }
1006
+ return await response.text();
1007
+ },
1008
+ catch: (cause) => new Error(String(cause))
1009
+ }).pipe(Effect3.catchAll((err) => Effect3.succeed(err.message)));
833
1010
  })
834
1011
  });
835
1012
  export {
836
- AddArtifact,
837
1013
  Agent_exports as Agent,
838
1014
  blueprint_default as AgentBlueprint,
839
1015
  AgentBlueprintHandlers,
1016
+ definitions_exports as AgentBlueprintOperations,
840
1017
  AgentHandlers,
841
1018
  AgentPrompt,
842
- AgentRules,
843
- blueprint_default11 as AgentWizardBlueprint,
1019
+ blueprint_default2 as AgentWizardBlueprint,
844
1020
  AgentWizardHandlers,
845
- AgentWorker,
846
- blueprint_default9 as AutomationBlueprint,
847
- blueprint_default10 as BlueprintManagerBlueprint,
1021
+ definitions_exports2 as AgentWizardOperations,
1022
+ blueprint_default3 as AutomationBlueprint,
1023
+ blueprint_default4 as BlueprintManagerBlueprint,
848
1024
  BlueprintManagerHandlers,
849
- blueprint_default6 as BrowserBlueprint,
1025
+ definitions_exports3 as BlueprintManagerOperations,
1026
+ blueprint_default5 as BrowserBlueprint,
850
1027
  Chat_exports as Chat,
851
- ContextAdd,
852
- ContextRemove,
853
- CreateAgent,
854
- blueprint_default7 as DatabaseBlueprint,
1028
+ blueprint_default6 as DatabaseBlueprint,
855
1029
  DatabaseHandlers,
856
- Load as DatabaseLoad,
857
- Query as DatabaseQuery,
858
- DeleteMemory,
859
- blueprint_default2 as DiscordBlueprint,
1030
+ definitions_exports4 as DatabaseOperations,
1031
+ blueprint_default7 as DelegationBlueprint,
1032
+ DelegationHandlers,
1033
+ delegate_task_exports as DelegationOperations,
1034
+ blueprint_default8 as DiscordBlueprint,
860
1035
  DiscordHandlers,
861
- EnableBlueprints,
862
- FetchMessages,
863
- GetContext,
864
- blueprint_default3 as LinearBlueprint,
1036
+ definitions_exports5 as DiscordOperations,
1037
+ blueprint_default9 as LinearBlueprint,
865
1038
  LinearHandlers,
1039
+ definitions_exports6 as LinearOperations,
866
1040
  LocalSearchHandler,
867
1041
  LocalSearchToolkit,
868
1042
  McpServer_exports as McpServer,
869
1043
  Memory_exports as Memory,
870
- blueprint_default8 as MemoryBlueprint,
1044
+ blueprint_default10 as MemoryBlueprint,
871
1045
  MemoryHandlers,
872
- ObjectCreate,
873
- ObjectDelete,
874
- ObjectUpdate,
1046
+ definitions_exports7 as MemoryOperations,
875
1047
  Plan_exports as Plan,
876
- blueprint_default4 as PlanningBlueprint,
1048
+ blueprint_default11 as PlanningBlueprint,
877
1049
  PlanningHandlers,
878
- UpdateTasks as PlanningUpdateTasks,
879
- Qualifier,
880
- QueryBlueprints,
881
- QueryMemories,
882
- RelationCreate,
883
- RelationDelete,
884
- SaveMemory,
885
- SchemaAdd,
886
- SchemaList,
1050
+ update_tasks_exports as PlanningOperations,
887
1051
  Subgraph,
888
- SyncIssues,
889
- SyncTriggers,
890
- TagAdd,
891
- TagRemove,
892
- blueprint_default5 as WebSearchBlueprint,
893
- Fetch as WebSearchFetch,
1052
+ blueprint_default12 as WebSearchBlueprint,
894
1053
  WebSearchHandlers,
1054
+ definitions_exports8 as WebSearchOperations,
895
1055
  WebSearchToolkit,
896
1056
  WebSearchToolkitOpaque,
897
1057
  WebToolkit_exports as WebToolkit,
898
1058
  createExtractionSchema,
899
1059
  findRelatedSchema,
900
1060
  getSanitizedSchemaName,
1061
+ makeDelegationStrategy,
901
1062
  makeGraphWriterHandler,
902
1063
  makeGraphWriterToolkit,
903
1064
  sanitizeObjects,