@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.
- package/LICENSE +102 -5
- package/dist/lib/neutral/add-artifact-54DVWE53.mjs +24 -0
- package/dist/lib/neutral/add-artifact-54DVWE53.mjs.map +7 -0
- package/dist/lib/neutral/{agent-6OHUAIA2.mjs → agent-LCBDWP74.mjs} +13 -13
- package/dist/lib/neutral/agent-LCBDWP74.mjs.map +7 -0
- package/dist/lib/neutral/{project-rules-FLUQQRPB.mjs → agent-rules-3TBAIVTS.mjs} +8 -8
- package/dist/lib/neutral/{project-rules-FLUQQRPB.mjs.map → agent-rules-3TBAIVTS.mjs.map} +2 -2
- package/dist/lib/neutral/{chunk-WIV7ZVRS.mjs → chunk-24L572PJ.mjs} +27 -16
- package/dist/lib/neutral/chunk-24L572PJ.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-4T3LJGXI.mjs → chunk-3YH7MWSD.mjs} +27 -16
- package/dist/lib/neutral/chunk-3YH7MWSD.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-CVUA23QI.mjs → chunk-4LFE5PQ3.mjs} +67 -32
- package/dist/lib/neutral/chunk-4LFE5PQ3.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-JN4GARRQ.mjs → chunk-BOB6M2YM.mjs} +20 -11
- package/dist/lib/neutral/chunk-BOB6M2YM.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-EJAQUAKM.mjs → chunk-DLVIJSH6.mjs} +24 -10
- package/dist/lib/neutral/chunk-DLVIJSH6.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-WLR3BGO4.mjs → chunk-FQNZX2SH.mjs} +15 -4
- package/dist/lib/neutral/chunk-FQNZX2SH.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-YXOVSRFU.mjs → chunk-JRUTUKPS.mjs} +11 -13
- package/dist/lib/neutral/chunk-JRUTUKPS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KC2LPECT.mjs +76 -0
- package/dist/lib/neutral/chunk-KC2LPECT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NSAUN2IX.mjs +66 -0
- package/dist/lib/neutral/chunk-NSAUN2IX.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-GSG4JGIY.mjs → chunk-RNIUE4LK.mjs} +38 -23
- package/dist/lib/neutral/chunk-RNIUE4LK.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-KGU725LW.mjs → chunk-SYUTQPSB.mjs} +4 -7
- package/dist/lib/neutral/chunk-SYUTQPSB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-U5FCQXA2.mjs +69 -0
- package/dist/lib/neutral/chunk-U5FCQXA2.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-SVI25Z2Y.mjs → chunk-URUJQGI6.mjs} +72 -58
- package/dist/lib/neutral/chunk-URUJQGI6.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-NR3GTWRC.mjs → chunk-Z3KITY4U.mjs} +9 -14
- package/dist/lib/neutral/chunk-Z3KITY4U.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-VSDP6SRY.mjs → chunk-ZQDWSV26.mjs} +19 -8
- package/dist/lib/neutral/chunk-ZQDWSV26.mjs.map +7 -0
- package/dist/lib/neutral/{context-add-IIDPRRVB.mjs → context-add-KWEKPGMI.mjs} +5 -5
- package/dist/lib/neutral/context-add-KWEKPGMI.mjs.map +7 -0
- package/dist/lib/neutral/{context-remove-RDYV4PD4.mjs → context-remove-HIQFSVHW.mjs} +5 -5
- package/dist/lib/neutral/context-remove-HIQFSVHW.mjs.map +7 -0
- package/dist/lib/neutral/{create-project-MPAMKQ3T.mjs → create-agent-KUTBEXLJ.mjs} +13 -14
- package/dist/lib/neutral/create-agent-KUTBEXLJ.mjs.map +7 -0
- package/dist/lib/neutral/definitions-6HU2P7R7.mjs +17 -0
- package/dist/lib/neutral/delegate-task-E7WLHT6S.mjs +13 -0
- package/dist/lib/neutral/delegate-task-E7WLHT6S.mjs.map +7 -0
- package/dist/lib/neutral/{delete-J3PMWP7Z.mjs → delete-QHGM7N23.mjs} +4 -4
- package/dist/lib/neutral/{delete-J3PMWP7Z.mjs.map → delete-QHGM7N23.mjs.map} +1 -1
- package/dist/lib/neutral/{enable-blueprints-LELPQHY5.mjs → enable-blueprints-OGYSQ7HD.mjs} +14 -15
- package/dist/lib/neutral/enable-blueprints-OGYSQ7HD.mjs.map +7 -0
- package/dist/lib/neutral/fetch-O6G46HJH.mjs +24 -0
- package/dist/lib/neutral/fetch-O6G46HJH.mjs.map +7 -0
- package/dist/lib/neutral/{fetch-messages-OS74FP76.mjs → fetch-messages-4EVGVEQK.mjs} +8 -9
- package/dist/lib/neutral/fetch-messages-4EVGVEQK.mjs.map +7 -0
- package/dist/lib/neutral/{get-context-JRTOOA5O.mjs → get-context-X4FCUMLK.mjs} +26 -12
- package/dist/lib/neutral/get-context-X4FCUMLK.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +640 -479
- package/dist/lib/neutral/index.mjs.map +4 -4
- package/dist/lib/neutral/{load-LI7HHVD6.mjs → load-C4OPO7RD.mjs} +3 -3
- package/dist/lib/neutral/{load-LI7HHVD6.mjs.map → load-C4OPO7RD.mjs.map} +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/object-create-F7R7IRW5.mjs +32 -0
- package/dist/lib/neutral/object-create-F7R7IRW5.mjs.map +7 -0
- package/dist/lib/neutral/{object-delete-I266YAXI.mjs → object-delete-3TJ3XMLN.mjs} +3 -3
- package/dist/lib/neutral/{object-delete-I266YAXI.mjs.map → object-delete-3TJ3XMLN.mjs.map} +1 -1
- package/dist/lib/neutral/{object-update-HY4GI7LA.mjs → object-update-EBRM5AKN.mjs} +4 -4
- package/dist/lib/neutral/{object-update-HY4GI7LA.mjs.map → object-update-EBRM5AKN.mjs.map} +3 -3
- package/dist/lib/neutral/{prompt-4UMXX6QU.mjs → prompt-QL7TTLM3.mjs} +22 -24
- package/dist/lib/neutral/prompt-QL7TTLM3.mjs.map +7 -0
- package/dist/lib/neutral/{qualifier-7BUCOEKK.mjs → qualifier-QAW6LSYF.mjs} +18 -17
- package/dist/lib/neutral/qualifier-QAW6LSYF.mjs.map +7 -0
- package/dist/lib/neutral/{query-U56GNEV6.mjs → query-6XCQIIZC.mjs} +5 -5
- package/dist/lib/neutral/{query-U56GNEV6.mjs.map → query-6XCQIIZC.mjs.map} +4 -4
- package/dist/lib/neutral/{query-B3NOYFCK.mjs → query-QGSHZMCD.mjs} +14 -25
- package/dist/lib/neutral/query-QGSHZMCD.mjs.map +7 -0
- package/dist/lib/neutral/query-blueprints-7NDHHM7U.mjs +17 -0
- package/dist/lib/neutral/query-blueprints-7NDHHM7U.mjs.map +7 -0
- package/dist/lib/neutral/relation-create-WA2DM76W.mjs +31 -0
- package/dist/lib/neutral/relation-create-WA2DM76W.mjs.map +7 -0
- package/dist/lib/neutral/{relation-delete-LXY7W2YO.mjs → relation-delete-66XP7KL7.mjs} +3 -3
- package/dist/lib/neutral/{relation-delete-LXY7W2YO.mjs.map → relation-delete-66XP7KL7.mjs.map} +1 -1
- package/dist/lib/neutral/{save-GWAPLT3Z.mjs → save-HQY35ACW.mjs} +4 -4
- package/dist/lib/neutral/{save-GWAPLT3Z.mjs.map → save-HQY35ACW.mjs.map} +1 -1
- package/dist/lib/neutral/schema-add-2AWYVGOC.mjs +25 -0
- package/dist/lib/neutral/schema-add-2AWYVGOC.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-74CQW2N3.mjs +37 -0
- package/dist/lib/neutral/schema-list-74CQW2N3.mjs.map +7 -0
- package/dist/lib/neutral/{sync-issues-A2RJNPEF.mjs → sync-issues-VUX4OWPO.mjs} +13 -14
- package/dist/lib/neutral/sync-issues-VUX4OWPO.mjs.map +7 -0
- package/dist/lib/neutral/{sync-triggers-NV4JCRN5.mjs → sync-triggers-JEVTYIGU.mjs} +45 -44
- package/dist/lib/neutral/sync-triggers-JEVTYIGU.mjs.map +7 -0
- package/dist/lib/neutral/{tag-add-5NOHUTIE.mjs → tag-add-6EGIY2CC.mjs} +5 -6
- package/dist/lib/neutral/tag-add-6EGIY2CC.mjs.map +7 -0
- package/dist/lib/neutral/{tag-remove-QTKYDJAW.mjs → tag-remove-XVTYJRI7.mjs} +5 -6
- package/dist/lib/neutral/tag-remove-XVTYJRI7.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +10 -13
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- package/dist/lib/neutral/update-tasks-N65UQUHS.mjs +13 -0
- package/dist/lib/neutral/update-tasks-N65UQUHS.mjs.map +7 -0
- package/dist/types/src/blueprints/agent/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent/index.d.ts +3 -0
- package/dist/types/src/blueprints/agent/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent/operations/add-artifact.d.ts +4 -0
- package/dist/types/src/blueprints/agent/operations/add-artifact.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent/operations/agent.d.ts.map +1 -0
- package/dist/types/src/blueprints/{project/functions → agent/operations}/definitions.d.ts +68 -51
- package/dist/types/src/blueprints/agent/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent/operations/get-context.d.ts +4 -0
- package/dist/types/src/blueprints/agent/operations/get-context.d.ts.map +1 -0
- package/dist/types/src/blueprints/{project/functions → agent/operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/agent/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent/operations/qualifier.d.ts +5 -0
- package/dist/types/src/blueprints/agent/operations/qualifier.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent-wizard/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent-wizard/index.d.ts +3 -0
- package/dist/types/src/blueprints/agent-wizard/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/{project-wizard/functions/project-rules.d.ts → agent-wizard/operations/agent-rules.d.ts} +1 -1
- package/dist/types/src/blueprints/agent-wizard/operations/agent-rules.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent-wizard/operations/create-agent.d.ts +56 -0
- package/dist/types/src/blueprints/agent-wizard/operations/create-agent.d.ts.map +1 -0
- package/dist/types/src/blueprints/agent-wizard/operations/definitions.d.ts +105 -0
- package/dist/types/src/blueprints/agent-wizard/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/{project-wizard/functions → agent-wizard/operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/agent-wizard/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/{project-wizard/functions → agent-wizard/operations}/sync-triggers.d.ts +24 -19
- package/dist/types/src/blueprints/agent-wizard/operations/sync-triggers.d.ts.map +1 -0
- package/dist/types/src/blueprints/automation/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts +1 -1
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/blueprint-manager/{functions → operations}/definitions.d.ts +19 -19
- package/dist/types/src/blueprints/blueprint-manager/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/{functions → operations}/enable-blueprints.d.ts +10 -10
- package/dist/types/src/blueprints/blueprint-manager/operations/enable-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/{functions → operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/blueprint-manager/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/{functions → operations}/query-blueprints.d.ts +9 -8
- package/dist/types/src/blueprints/blueprint-manager/operations/query-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/index.d.ts +1 -1
- package/dist/types/src/blueprints/database/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/operations/context-add.d.ts +7 -0
- package/dist/types/src/blueprints/database/operations/context-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/context-remove.d.ts +7 -0
- package/dist/types/src/blueprints/database/operations/context-remove.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/definitions.d.ts +65 -0
- package/dist/types/src/blueprints/database/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/{functions → operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/database/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/load.d.ts +7 -0
- package/dist/types/src/blueprints/database/operations/load.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/object-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/{functions → operations}/object-delete.d.ts +1 -1
- package/dist/types/src/blueprints/database/operations/object-delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/object-update.d.ts +10 -0
- package/dist/types/src/blueprints/database/operations/object-update.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/{functions → operations}/query.d.ts +2 -3
- package/dist/types/src/blueprints/database/operations/query.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/relation-create.d.ts +10 -0
- package/dist/types/src/blueprints/database/operations/relation-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/relation-delete.d.ts +7 -0
- package/dist/types/src/blueprints/database/operations/relation-delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/schema-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/schema-list.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/tag-add.d.ts +11 -0
- package/dist/types/src/blueprints/database/operations/tag-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/operations/tag-remove.d.ts +11 -0
- package/dist/types/src/blueprints/database/operations/tag-remove.d.ts.map +1 -0
- package/dist/types/src/blueprints/delegation/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/delegation/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/delegation/index.d.ts +3 -0
- package/dist/types/src/blueprints/delegation/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/delegation/operations/delegate-task.d.ts +14 -0
- package/dist/types/src/blueprints/delegation/operations/delegate-task.d.ts.map +1 -0
- package/dist/types/src/blueprints/delegation/operations/delegate-task.test.d.ts +2 -0
- package/dist/types/src/blueprints/delegation/operations/delegate-task.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/delegation/operations/index.d.ts +4 -0
- package/dist/types/src/blueprints/delegation/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/index.d.ts +1 -1
- package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/{functions → operations}/definitions.d.ts +2 -3
- package/dist/types/src/blueprints/discord/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/{functions → operations}/fetch-messages.d.ts +2 -3
- package/dist/types/src/blueprints/discord/operations/fetch-messages.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/operations/fetch-messages.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/{functions → operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/discord/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/index.d.ts +1 -1
- package/dist/types/src/blueprints/github/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/operations/definitions.d.ts +7 -0
- package/dist/types/src/blueprints/github/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/{functions → operations}/fetch-prs.d.ts +2 -3
- package/dist/types/src/blueprints/github/operations/fetch-prs.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/{functions → operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/github/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +8 -7
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/index.d.ts +1 -1
- package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/operations/definitions.d.ts +6 -0
- package/dist/types/src/blueprints/linear/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/{functions → operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/linear/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/operations/linear.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/{functions → operations}/sync-issues.d.ts +2 -3
- package/dist/types/src/blueprints/linear/operations/sync-issues.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/index.d.ts +1 -1
- package/dist/types/src/blueprints/memory/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/memory/{functions → operations}/definitions.d.ts +2 -2
- package/dist/types/src/blueprints/memory/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/{functions → operations}/delete.d.ts +2 -2
- package/dist/types/src/blueprints/memory/operations/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/{functions → operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/memory/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/operations/query.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/operations/save.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/index.d.ts +1 -1
- package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/{functions → operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/planning/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/operations/update-tasks.d.ts +24 -0
- package/dist/types/src/blueprints/planning/operations/update-tasks.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/operations/update-tasks.test.d.ts +2 -0
- package/dist/types/src/blueprints/planning/operations/update-tasks.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/testing.d.ts +5 -5
- package/dist/types/src/blueprints/testing.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/index.d.ts +1 -1
- package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/operations/fetch.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/{functions → operations}/index.d.ts +1 -1
- package/dist/types/src/blueprints/websearch/operations/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/toolkit.d.ts +1 -1
- package/dist/types/src/crud/graph.d.ts +8 -11
- package/dist/types/src/crud/graph.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +3 -3
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/functions/agent/blueprint-resolution.test.d.ts +2 -0
- package/dist/types/src/functions/agent/blueprint-resolution.test.d.ts.map +1 -0
- package/dist/types/src/functions/agent/definitions.d.ts +22 -30
- package/dist/types/src/functions/agent/definitions.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/supervisor/delegation-strategy.d.ts +9 -0
- package/dist/types/src/supervisor/delegation-strategy.d.ts.map +1 -0
- package/dist/types/src/supervisor/index.d.ts +2 -0
- package/dist/types/src/supervisor/index.d.ts.map +1 -0
- package/dist/types/src/sync/sync.d.ts +1 -2
- package/dist/types/src/sync/sync.d.ts.map +1 -1
- package/dist/types/src/testing/plugins.d.ts +1 -1
- package/dist/types/src/testing/plugins.d.ts.map +1 -1
- package/dist/types/src/toolkits/WebToolkit.d.ts +1 -1
- package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -1
- package/dist/types/src/types/Agent.d.ts +47 -30
- package/dist/types/src/types/Agent.d.ts.map +1 -1
- package/dist/types/src/types/Agent.test.d.ts +2 -0
- package/dist/types/src/types/Agent.test.d.ts.map +1 -0
- package/dist/types/src/types/Chat.d.ts +17 -20
- package/dist/types/src/types/Chat.d.ts.map +1 -1
- package/dist/types/src/types/McpServer.d.ts +5 -3
- package/dist/types/src/types/McpServer.d.ts.map +1 -1
- package/dist/types/src/types/Memory.d.ts +1 -2
- package/dist/types/src/types/Memory.d.ts.map +1 -1
- package/dist/types/src/types/Plan.d.ts +28 -25
- package/dist/types/src/types/Plan.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -30
- package/src/blueprints/AGENTS.md +13 -0
- package/src/blueprints/agent/blueprint.conversations.json +1 -0
- package/src/blueprints/{project → agent}/blueprint.test.ts +40 -36
- package/src/blueprints/{project → agent}/blueprint.ts +3 -3
- package/src/blueprints/agent/index.ts +6 -0
- package/src/blueprints/{project/functions → agent/operations}/add-artifact.ts +3 -13
- package/src/blueprints/{project/functions → agent/operations}/agent.ts +6 -6
- package/src/blueprints/{project/functions → agent/operations}/definitions.ts +19 -15
- package/src/blueprints/{project/functions → agent/operations}/get-context.ts +17 -5
- package/src/blueprints/{project/functions → agent/operations}/index.ts +1 -1
- package/src/blueprints/{project/functions → agent/operations}/qualifier.ts +9 -8
- package/src/blueprints/{project-wizard → agent-wizard}/blueprint.ts +2 -2
- package/src/blueprints/{project-wizard → agent-wizard}/index.ts +1 -1
- package/src/blueprints/{project-wizard/functions/create-project.ts → agent-wizard/operations/create-agent.ts} +2 -3
- package/src/blueprints/{project-wizard/functions → agent-wizard/operations}/definitions.ts +10 -8
- package/src/blueprints/{project-wizard/functions → agent-wizard/operations}/index.ts +3 -3
- package/src/blueprints/{project-wizard/functions → agent-wizard/operations}/sync-triggers.ts +51 -41
- package/src/blueprints/automation/blueprint.ts +12 -14
- package/src/blueprints/blueprint-manager/blueprint.conversations.json +1 -1
- package/src/blueprints/blueprint-manager/blueprint.test.ts +27 -70
- package/src/blueprints/blueprint-manager/blueprint.ts +6 -6
- package/src/blueprints/blueprint-manager/index.ts +1 -1
- package/src/blueprints/blueprint-manager/operations/definitions.ts +48 -0
- package/src/blueprints/blueprint-manager/{functions → operations}/enable-blueprints.ts +11 -9
- package/src/blueprints/blueprint-manager/{functions → operations}/index.ts +1 -2
- package/src/blueprints/blueprint-manager/operations/query-blueprints.ts +19 -0
- package/src/blueprints/browser/blueprint.conversations.json +1 -0
- package/src/blueprints/browser/blueprint.test.ts +10 -10
- package/src/blueprints/browser/blueprint.ts +1 -1
- package/src/blueprints/database/blueprint.conversations.json +1 -1
- package/src/blueprints/database/blueprint.test.ts +38 -39
- package/src/blueprints/database/blueprint.ts +2 -2
- package/src/blueprints/database/index.ts +1 -16
- package/src/blueprints/database/{functions → operations}/context-add.ts +2 -2
- package/src/blueprints/database/{functions → operations}/context-remove.ts +2 -2
- package/src/blueprints/database/{functions → operations}/definitions.ts +41 -27
- package/src/blueprints/database/{functions → operations}/index.ts +1 -1
- package/src/blueprints/database/{functions → operations}/object-create.ts +8 -6
- package/src/blueprints/database/{functions → operations}/object-update.ts +1 -1
- package/src/blueprints/database/{functions → operations}/query.ts +17 -12
- package/src/blueprints/database/{functions → operations}/relation-create.ts +7 -5
- package/src/blueprints/database/operations/schema-add.ts +23 -0
- package/src/blueprints/database/{functions → operations}/schema-list.ts +12 -9
- package/src/blueprints/database/{functions → operations}/tag-add.ts +2 -3
- package/src/blueprints/database/{functions → operations}/tag-remove.ts +2 -3
- package/src/blueprints/delegation/blueprint.ts +24 -0
- package/src/blueprints/delegation/index.ts +6 -0
- package/src/blueprints/delegation/operations/delegate-task.test.ts +55 -0
- package/src/blueprints/delegation/operations/delegate-task.ts +57 -0
- package/src/blueprints/delegation/operations/index.ts +9 -0
- package/src/blueprints/discord/blueprint.ts +2 -2
- package/src/blueprints/discord/index.ts +1 -1
- package/src/blueprints/discord/{functions → operations}/definitions.ts +5 -4
- package/src/blueprints/discord/{functions → operations}/fetch-messages.test.ts +8 -3
- package/src/blueprints/discord/{functions → operations}/fetch-messages.ts +2 -3
- package/src/blueprints/discord/{functions → operations}/index.ts +1 -1
- package/src/blueprints/github/index.ts +1 -1
- package/src/blueprints/github/{functions → operations}/definitions.ts +5 -4
- package/src/blueprints/github/{functions → operations}/fetch-prs.ts +3 -3
- package/src/blueprints/github/{functions → operations}/index.ts +1 -1
- package/src/blueprints/index.ts +8 -7
- package/src/blueprints/linear/blueprint.ts +2 -2
- package/src/blueprints/linear/index.ts +1 -1
- package/src/blueprints/linear/{functions → operations}/definitions.ts +5 -4
- package/src/blueprints/linear/{functions → operations}/index.ts +1 -1
- package/src/blueprints/linear/{functions → operations}/linear.test.ts +5 -7
- package/src/blueprints/linear/{functions → operations}/sync-issues.ts +6 -7
- package/src/blueprints/memory/blueprint.conversations.json +1 -1
- package/src/blueprints/memory/blueprint.test.ts +11 -12
- package/src/blueprints/memory/blueprint.ts +2 -2
- package/src/blueprints/memory/index.ts +1 -1
- package/src/blueprints/memory/{functions → operations}/definitions.ts +7 -3
- package/src/blueprints/memory/{functions → operations}/index.ts +1 -1
- package/src/blueprints/memory/{functions → operations}/query.ts +1 -1
- package/src/blueprints/planning/blueprint.ts +2 -2
- package/src/blueprints/planning/index.ts +1 -1
- package/src/blueprints/planning/{functions → operations}/index.ts +1 -1
- package/src/blueprints/planning/{functions/definitions.ts → operations/update-tasks.md} +29 -50
- package/src/blueprints/planning/operations/update-tasks.test.ts +55 -0
- package/src/blueprints/planning/operations/update-tasks.ts +71 -0
- package/src/blueprints/testing.ts +12 -6
- package/src/blueprints/websearch/blueprint.conversations.json +1 -1
- package/src/blueprints/websearch/blueprint.test.ts +3 -2
- package/src/blueprints/websearch/blueprint.ts +3 -3
- package/src/blueprints/websearch/index.ts +1 -1
- package/src/blueprints/websearch/{functions → operations}/definitions.ts +3 -1
- package/src/blueprints/websearch/operations/fetch.ts +26 -0
- package/src/blueprints/websearch/{functions → operations}/index.ts +1 -1
- package/src/crud/graph.test.ts +1 -1
- package/src/crud/graph.ts +149 -165
- package/src/errors.ts +3 -3
- package/src/functions/agent/blueprint-resolution.test.ts +131 -0
- package/src/functions/agent/definitions.ts +14 -9
- package/src/functions/agent/prompt.conversations.json +1 -1
- package/src/functions/agent/prompt.test.ts +11 -16
- package/src/functions/agent/prompt.ts +27 -24
- package/src/index.ts +1 -0
- package/src/supervisor/delegation-strategy.ts +188 -0
- package/src/supervisor/index.ts +5 -0
- package/src/sync/sync.ts +9 -8
- package/src/testing/plugins.tsx +10 -15
- package/src/toolkits/WebToolkit.ts +13 -2
- package/src/types/Agent.test.ts +93 -0
- package/src/types/Agent.ts +97 -62
- package/src/types/Chat.ts +11 -21
- package/src/types/McpServer.ts +10 -16
- package/src/types/Memory.ts +5 -7
- package/src/types/Plan.ts +14 -17
- package/dist/lib/neutral/add-artifact-XDFUXRY5.mjs +0 -30
- package/dist/lib/neutral/add-artifact-XDFUXRY5.mjs.map +0 -7
- package/dist/lib/neutral/agent-6OHUAIA2.mjs.map +0 -7
- package/dist/lib/neutral/chunk-4T3LJGXI.mjs.map +0 -7
- package/dist/lib/neutral/chunk-CVUA23QI.mjs.map +0 -7
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GSG4JGIY.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JN4GARRQ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KGU725LW.mjs.map +0 -7
- package/dist/lib/neutral/chunk-NR3GTWRC.mjs.map +0 -7
- package/dist/lib/neutral/chunk-P5LAPHCG.mjs +0 -140
- package/dist/lib/neutral/chunk-P5LAPHCG.mjs.map +0 -7
- package/dist/lib/neutral/chunk-SVI25Z2Y.mjs.map +0 -7
- package/dist/lib/neutral/chunk-VSDP6SRY.mjs.map +0 -7
- package/dist/lib/neutral/chunk-WIV7ZVRS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YSYNXOZA.mjs +0 -68
- package/dist/lib/neutral/chunk-YSYNXOZA.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YXOVSRFU.mjs.map +0 -7
- package/dist/lib/neutral/context-add-IIDPRRVB.mjs.map +0 -7
- package/dist/lib/neutral/context-remove-RDYV4PD4.mjs.map +0 -7
- package/dist/lib/neutral/create-project-MPAMKQ3T.mjs.map +0 -7
- package/dist/lib/neutral/enable-blueprints-LELPQHY5.mjs.map +0 -7
- package/dist/lib/neutral/fetch-KHMHV7JR.mjs +0 -16
- package/dist/lib/neutral/fetch-KHMHV7JR.mjs.map +0 -7
- package/dist/lib/neutral/fetch-messages-OS74FP76.mjs.map +0 -7
- package/dist/lib/neutral/get-context-JRTOOA5O.mjs.map +0 -7
- package/dist/lib/neutral/object-create-52Z7YKIA.mjs +0 -35
- package/dist/lib/neutral/object-create-52Z7YKIA.mjs.map +0 -7
- package/dist/lib/neutral/project-JAU3A7AX.mjs +0 -23
- package/dist/lib/neutral/prompt-4UMXX6QU.mjs.map +0 -7
- package/dist/lib/neutral/qualifier-7BUCOEKK.mjs.map +0 -7
- package/dist/lib/neutral/query-B3NOYFCK.mjs.map +0 -7
- package/dist/lib/neutral/query-blueprints-Z576ABT5.mjs +0 -17
- package/dist/lib/neutral/query-blueprints-Z576ABT5.mjs.map +0 -7
- package/dist/lib/neutral/relation-create-Z3NGW4VU.mjs +0 -34
- package/dist/lib/neutral/relation-create-Z3NGW4VU.mjs.map +0 -7
- package/dist/lib/neutral/schema-add-4TXJO2V7.mjs +0 -24
- package/dist/lib/neutral/schema-add-4TXJO2V7.mjs.map +0 -7
- package/dist/lib/neutral/schema-list-Q7HRRKGR.mjs +0 -39
- package/dist/lib/neutral/schema-list-Q7HRRKGR.mjs.map +0 -7
- package/dist/lib/neutral/sync-issues-A2RJNPEF.mjs.map +0 -7
- package/dist/lib/neutral/sync-triggers-NV4JCRN5.mjs.map +0 -7
- package/dist/lib/neutral/tag-add-5NOHUTIE.mjs.map +0 -7
- package/dist/lib/neutral/tag-remove-QTKYDJAW.mjs.map +0 -7
- package/dist/lib/neutral/update-blueprints-K7A5SHBZ.mjs +0 -17
- package/dist/lib/neutral/update-blueprints-K7A5SHBZ.mjs.map +0 -7
- package/dist/lib/neutral/update-tasks-UGGHWXT5.mjs +0 -46
- package/dist/lib/neutral/update-tasks-UGGHWXT5.mjs.map +0 -7
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +0 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +0 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +0 -5
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +0 -7
- package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts +0 -7
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/definitions.d.ts +0 -59
- package/dist/types/src/blueprints/database/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/load.d.ts +0 -7
- package/dist/types/src/blueprints/database/functions/load.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/object-update.d.ts +0 -10
- package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/query.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts +0 -10
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +0 -7
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts +0 -8
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +0 -1
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +0 -8
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +0 -1
- package/dist/types/src/blueprints/discord/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +0 -1
- package/dist/types/src/blueprints/discord/functions/fetch-messages.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/discord/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/github/functions/definitions.d.ts +0 -8
- package/dist/types/src/blueprints/github/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +0 -1
- package/dist/types/src/blueprints/github/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts +0 -7
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/linear/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/linear/functions/linear.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +0 -1
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/memory/functions/delete.d.ts.map +0 -1
- package/dist/types/src/blueprints/memory/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/memory/functions/query.d.ts.map +0 -1
- package/dist/types/src/blueprints/memory/functions/save.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts +0 -11
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +0 -11
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +0 -1
- package/dist/types/src/blueprints/project/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/project/blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +0 -8
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +0 -1
- package/dist/types/src/blueprints/project/functions/agent.d.ts.map +0 -1
- package/dist/types/src/blueprints/project/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/project/functions/get-context.d.ts +0 -15
- package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +0 -1
- package/dist/types/src/blueprints/project/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +0 -73
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +0 -1
- package/dist/types/src/blueprints/project/index.d.ts +0 -3
- package/dist/types/src/blueprints/project/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/project-wizard/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +0 -52
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +0 -1
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +0 -97
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/project-wizard/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts.map +0 -1
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts.map +0 -1
- package/dist/types/src/blueprints/project-wizard/index.d.ts +0 -3
- package/dist/types/src/blueprints/project-wizard/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/functions/definitions.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/functions/fetch.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/functions/index.d.ts.map +0 -1
- package/src/blueprints/blueprint-manager/functions/definitions.ts +0 -58
- package/src/blueprints/blueprint-manager/functions/query-blueprints.ts +0 -19
- package/src/blueprints/blueprint-manager/functions/update-blueprints.ts +0 -19
- package/src/blueprints/database/functions/schema-add.ts +0 -28
- package/src/blueprints/planning/functions/update-tasks.ts +0 -45
- package/src/blueprints/project/blueprint.conversations.json +0 -1
- package/src/blueprints/project/index.ts +0 -6
- package/src/blueprints/websearch/functions/fetch.ts +0 -18
- /package/dist/lib/neutral/{project-JAU3A7AX.mjs.map → definitions-6HU2P7R7.mjs.map} +0 -0
- /package/dist/types/src/blueprints/{project → agent}/blueprint.d.ts +0 -0
- /package/dist/types/src/blueprints/{project → agent}/blueprint.test.d.ts +0 -0
- /package/dist/types/src/blueprints/{project/functions → agent/operations}/agent.d.ts +0 -0
- /package/dist/types/src/blueprints/{project-wizard → agent-wizard}/blueprint.d.ts +0 -0
- /package/dist/types/src/blueprints/database/{functions → operations}/object-create.d.ts +0 -0
- /package/dist/types/src/blueprints/database/{functions → operations}/schema-add.d.ts +0 -0
- /package/dist/types/src/blueprints/database/{functions → operations}/schema-list.d.ts +0 -0
- /package/dist/types/src/blueprints/discord/{functions → operations}/fetch-messages.test.d.ts +0 -0
- /package/dist/types/src/blueprints/linear/{functions → operations}/linear.test.d.ts +0 -0
- /package/dist/types/src/blueprints/memory/{functions → operations}/query.d.ts +0 -0
- /package/dist/types/src/blueprints/memory/{functions → operations}/save.d.ts +0 -0
- /package/dist/types/src/blueprints/websearch/{functions → operations}/definitions.d.ts +0 -0
- /package/dist/types/src/blueprints/websearch/{functions → operations}/fetch.d.ts +0 -0
- /package/src/blueprints/{project-wizard/functions/project-rules.ts → agent-wizard/operations/agent-rules.ts} +0 -0
- /package/src/blueprints/database/{functions → operations}/load.ts +0 -0
- /package/src/blueprints/database/{functions → operations}/object-delete.ts +0 -0
- /package/src/blueprints/database/{functions → operations}/relation-delete.ts +0 -0
- /package/src/blueprints/memory/{functions → operations}/delete.ts +0 -0
- /package/src/blueprints/memory/{functions → operations}/save.ts +0 -0
package/src/blueprints/{project-wizard/functions → agent-wizard/operations}/sync-triggers.ts
RENAMED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import * as Option from 'effect/Option';
|
|
7
7
|
|
|
8
|
-
import { Trigger } from '@dxos/compute';
|
|
9
|
-
import {
|
|
10
|
-
import { Database, Feed, Filter, Obj, Ref } from '@dxos/echo';
|
|
8
|
+
import { Trigger, Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Feed, Filter, Obj, Ref, Type } from '@dxos/echo';
|
|
11
10
|
import { FeedAnnotation } from '@dxos/schema';
|
|
12
11
|
|
|
13
12
|
import { Agent } from '../../../types';
|
|
@@ -23,7 +22,7 @@ export default SyncTriggers.pipe(
|
|
|
23
22
|
);
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
|
-
* Foreign key {@link AGENT_TRIGGER_EXTENSION_KEY} => <agent id :
|
|
25
|
+
* Foreign key {@link AGENT_TRIGGER_EXTENSION_KEY} => <agent id : EntityId>.
|
|
27
26
|
*/
|
|
28
27
|
const AGENT_TRIGGER_EXTENSION_KEY = 'org.dxos.extension.AgentTrigger';
|
|
29
28
|
|
|
@@ -34,11 +33,11 @@ const AGENT_TRIGGER_TARGET_EXTENSION_KEY = 'org.dxos.extension.AgentTriggerTarge
|
|
|
34
33
|
|
|
35
34
|
/** Checks if an object's schema has the FeedAnnotation. */
|
|
36
35
|
const hasFeedAnnotation = (obj: Obj.Unknown): boolean => {
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
36
|
+
const type = Obj.getType(obj);
|
|
37
|
+
if (!type) {
|
|
39
38
|
return false;
|
|
40
39
|
}
|
|
41
|
-
const annotation = FeedAnnotation.get(
|
|
40
|
+
const annotation = FeedAnnotation.get(Type.getSchema(type));
|
|
42
41
|
return Option.isSome(annotation) && annotation.value === true;
|
|
43
42
|
};
|
|
44
43
|
|
|
@@ -47,9 +46,9 @@ const hasFeedAnnotation = (obj: Obj.Unknown): boolean => {
|
|
|
47
46
|
*/
|
|
48
47
|
const syncAgentTriggers = (agent: Agent.Agent): Effect.Effect<void, never, Database.Service> =>
|
|
49
48
|
Effect.gen(function* () {
|
|
50
|
-
const triggers = yield* Database.
|
|
49
|
+
const triggers = yield* Database.query(
|
|
51
50
|
Filter.foreignKeys(Trigger.Trigger, [{ source: AGENT_TRIGGER_EXTENSION_KEY, id: agent.id }]),
|
|
52
|
-
);
|
|
51
|
+
).run;
|
|
53
52
|
|
|
54
53
|
// Remove all existing triggers — they will be recreated with the current config.
|
|
55
54
|
// This ensures operation, concurrency, and enabled stay in sync when agent fields change.
|
|
@@ -60,10 +59,13 @@ const syncAgentTriggers = (agent: Agent.Agent): Effect.Effect<void, never, Datab
|
|
|
60
59
|
const triggersEnabled = agent.enabled ?? true;
|
|
61
60
|
|
|
62
61
|
// Lazy import to avoid circular dependency issues.
|
|
63
|
-
const { Qualifier, AgentWorker } = yield* Effect.promise(() => import('../../
|
|
62
|
+
const { Qualifier, AgentWorker } = yield* Effect.promise(() => import('../../agent/operations/definitions'));
|
|
64
63
|
|
|
65
64
|
for (const subscription of agent.subscriptions) {
|
|
66
|
-
const targetOption = yield* Database.
|
|
65
|
+
const targetOption = yield* Database.load(subscription).pipe(
|
|
66
|
+
Effect.map(Option.some),
|
|
67
|
+
Effect.catchTag('EntityNotFoundError', () => Effect.succeed(Option.none())),
|
|
68
|
+
);
|
|
67
69
|
if (Option.isNone(targetOption)) {
|
|
68
70
|
continue;
|
|
69
71
|
}
|
|
@@ -74,15 +76,17 @@ const syncAgentTriggers = (agent: Agent.Agent): Effect.Effect<void, never, Datab
|
|
|
74
76
|
feedObj = target;
|
|
75
77
|
} else if (hasFeedAnnotation(target)) {
|
|
76
78
|
const feedRef = (target as Obj.Unknown & { feed?: Ref.Ref<Feed.Feed> }).feed;
|
|
77
|
-
feedObj = feedRef
|
|
79
|
+
feedObj = feedRef
|
|
80
|
+
? Option.getOrUndefined(
|
|
81
|
+
yield* Database.load(feedRef).pipe(
|
|
82
|
+
Effect.map(Option.some),
|
|
83
|
+
Effect.catchTag('EntityNotFoundError', () => Effect.succeed(Option.none())),
|
|
84
|
+
),
|
|
85
|
+
)
|
|
86
|
+
: undefined;
|
|
78
87
|
}
|
|
79
88
|
|
|
80
|
-
|
|
81
|
-
Option.filter(Obj.instanceOf(Feed.Feed)),
|
|
82
|
-
Option.map(Feed.getQueueDxn),
|
|
83
|
-
Option.getOrUndefined,
|
|
84
|
-
);
|
|
85
|
-
if (!queueDxn) {
|
|
89
|
+
if (!feedObj || !Obj.instanceOf(Feed.Feed, feedObj) || !Feed.getQueueUri(feedObj)) {
|
|
86
90
|
continue;
|
|
87
91
|
}
|
|
88
92
|
|
|
@@ -94,11 +98,11 @@ const syncAgentTriggers = (agent: Agent.Agent): Effect.Effect<void, never, Datab
|
|
|
94
98
|
[Obj.Meta]: {
|
|
95
99
|
keys: [
|
|
96
100
|
{ source: AGENT_TRIGGER_EXTENSION_KEY, id: agent.id },
|
|
97
|
-
{ source: AGENT_TRIGGER_TARGET_EXTENSION_KEY, id: subscription.
|
|
101
|
+
{ source: AGENT_TRIGGER_TARGET_EXTENSION_KEY, id: subscription.uri },
|
|
98
102
|
],
|
|
99
103
|
},
|
|
100
104
|
enabled: triggersEnabled,
|
|
101
|
-
spec: Trigger.
|
|
105
|
+
spec: Trigger.specFeed(feedObj),
|
|
102
106
|
function: Ref.make(Operation.serialize(filterEvents ? Qualifier : AgentWorker)),
|
|
103
107
|
input: {
|
|
104
108
|
agent: Ref.make(agent),
|
|
@@ -109,28 +113,34 @@ const syncAgentTriggers = (agent: Agent.Agent): Effect.Effect<void, never, Datab
|
|
|
109
113
|
);
|
|
110
114
|
}
|
|
111
115
|
|
|
112
|
-
if ((agent.filterEvents ?? true) && agent.
|
|
113
|
-
yield* Database.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
[Obj.Meta]: {
|
|
117
|
-
keys: [
|
|
118
|
-
{ source: AGENT_TRIGGER_EXTENSION_KEY, id: agent.id },
|
|
119
|
-
{
|
|
120
|
-
source: AGENT_TRIGGER_TARGET_EXTENSION_KEY,
|
|
121
|
-
id: Obj.getDXN(agent)?.toString() ?? '',
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
},
|
|
125
|
-
function: Ref.make(Operation.serialize(AgentWorker)),
|
|
126
|
-
enabled: triggersEnabled,
|
|
127
|
-
spec: Trigger.specQueue(agent.queue.dxn.toString()),
|
|
128
|
-
input: {
|
|
129
|
-
agent: Ref.make(agent),
|
|
130
|
-
event: '{{event}}',
|
|
131
|
-
},
|
|
132
|
-
}),
|
|
116
|
+
if ((agent.filterEvents ?? true) && agent.feed) {
|
|
117
|
+
const agentFeedOption = yield* Database.load(agent.feed).pipe(
|
|
118
|
+
Effect.map(Option.some),
|
|
119
|
+
Effect.catchTag('EntityNotFoundError', () => Effect.succeed(Option.none())),
|
|
133
120
|
);
|
|
121
|
+
if (Option.isSome(agentFeedOption) && Feed.getQueueUri(agentFeedOption.value)) {
|
|
122
|
+
yield* Database.add(
|
|
123
|
+
Trigger.make({
|
|
124
|
+
[Obj.Parent]: agent,
|
|
125
|
+
[Obj.Meta]: {
|
|
126
|
+
keys: [
|
|
127
|
+
{ source: AGENT_TRIGGER_EXTENSION_KEY, id: agent.id },
|
|
128
|
+
{
|
|
129
|
+
source: AGENT_TRIGGER_TARGET_EXTENSION_KEY,
|
|
130
|
+
id: Obj.getURI(agent) ?? '',
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
function: Ref.make(Operation.serialize(AgentWorker)),
|
|
135
|
+
enabled: triggersEnabled,
|
|
136
|
+
spec: Trigger.specFeed(agentFeedOption.value),
|
|
137
|
+
input: {
|
|
138
|
+
agent: Ref.make(agent),
|
|
139
|
+
event: '{{event}}',
|
|
140
|
+
},
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
143
|
+
}
|
|
134
144
|
}
|
|
135
145
|
|
|
136
146
|
// Timer trigger bypasses the qualifier and invokes the agent worker directly on a schedule.
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Blueprint } from '@dxos/compute';
|
|
6
|
-
import {
|
|
7
|
-
import { Operation } from '@dxos/compute';
|
|
8
|
-
import { Ref } from '@dxos/echo';
|
|
5
|
+
import { Blueprint, Trigger, Operation } from '@dxos/compute';
|
|
6
|
+
import { Ref, Type } from '@dxos/echo';
|
|
9
7
|
import { Text } from '@dxos/schema';
|
|
10
8
|
import { trim } from '@dxos/util';
|
|
11
9
|
|
|
@@ -21,7 +19,7 @@ const instructions = trim`
|
|
|
21
19
|
Triggers are configured by the properties of the Trigger object.
|
|
22
20
|
- enabled: Must be true for trigger to run.
|
|
23
21
|
- spec: Events that the trigger matches.
|
|
24
|
-
- function: Ref to a ${Operation.PersistentOperation
|
|
22
|
+
- 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.
|
|
25
23
|
- input: The spec of the input data that will be passed to the function.
|
|
26
24
|
|
|
27
25
|
## Input patterns
|
|
@@ -34,21 +32,21 @@ const instructions = trim`
|
|
|
34
32
|
{
|
|
35
33
|
item: '{{event.item}}',
|
|
36
34
|
instructions: 'Summarize and perform entity-extraction'
|
|
37
|
-
mailbox: { '/': '
|
|
35
|
+
mailbox: { '/': 'echo://AAA/ZZZ' }
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
## Trigger kinds
|
|
41
39
|
|
|
42
40
|
- Timer: Triggered by a cron schedule.
|
|
43
41
|
- Queue: Subscribes and processes items begginging to end.
|
|
44
|
-
Note: queues are the same as feeds. The queue
|
|
42
|
+
Note: queues are the same as feeds. The queue EID should be of form: echo://<space-id>/<queue-id>.
|
|
45
43
|
- Subscription: Subscribes and processes database items based on a query.
|
|
46
44
|
|
|
47
45
|
Avoid: email and webhook triggers.
|
|
48
46
|
|
|
49
47
|
## Editing triggers
|
|
50
48
|
|
|
51
|
-
Triggers are represented as objects of type ${Trigger.Trigger
|
|
49
|
+
Triggers are represented as objects of type ${Type.getTypename(Trigger.Trigger)}.
|
|
52
50
|
You need access to the Database blueprint to manipulate triggers.
|
|
53
51
|
Read trigger schema before manipulating triggers.
|
|
54
52
|
Having a Trigger object in the database is enough to setup an automation.
|
|
@@ -58,7 +56,7 @@ const instructions = trim`
|
|
|
58
56
|
Timer:
|
|
59
57
|
|
|
60
58
|
{
|
|
61
|
-
"function": { "/": "
|
|
59
|
+
"function": { "/": "echo://AAA/ZZZ" },
|
|
62
60
|
"enabled": true,
|
|
63
61
|
"spec": {
|
|
64
62
|
"kind": "timer",
|
|
@@ -69,22 +67,22 @@ const instructions = trim`
|
|
|
69
67
|
Queue:
|
|
70
68
|
|
|
71
69
|
{
|
|
72
|
-
"function": { "/": "
|
|
70
|
+
"function": { "/": "echo://AAA/ZZZ" },
|
|
73
71
|
"enabled": true,
|
|
74
72
|
"spec": {
|
|
75
73
|
"kind": "queue",
|
|
76
|
-
"queue": "
|
|
74
|
+
"queue": "echo://XXX/YYY"
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
Subscription:
|
|
81
79
|
|
|
82
80
|
{
|
|
83
|
-
"function": { "/": "
|
|
81
|
+
"function": { "/": "echo://AAA/ZZZ" },
|
|
84
82
|
"enabled": true,
|
|
85
83
|
"spec": {
|
|
86
84
|
"kind": "subscription",
|
|
87
|
-
"query": { "ast": { "type": "select", "filter": { "type": "object", "typename": "dxn:
|
|
85
|
+
"query": { "ast": { "type": "select", "filter": { "type": "object", "typename": "dxn:org.dxos.type.person" } } }
|
|
88
86
|
}
|
|
89
87
|
}
|
|
90
88
|
`;
|
|
@@ -95,7 +93,7 @@ const make = () =>
|
|
|
95
93
|
name: 'Triggers',
|
|
96
94
|
description: 'Trigger management and automation.',
|
|
97
95
|
instructions: {
|
|
98
|
-
source: Ref.make(Text.make(instructions)),
|
|
96
|
+
source: Ref.make(Text.make({ content: instructions })),
|
|
99
97
|
},
|
|
100
98
|
});
|
|
101
99
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"conversations":[{"parameters":{"model":"
|
|
1
|
+
{"conversations":[{"parameters":{"model":"ai.claude.model.claude-opus-4-6","stream":true,"tools":[{"name":"query-blueprints","description":"Queries available blueprints.","inputSchema":{"$id":"/schemas/%7B%7D","anyOf":[{"type":"object"},{"type":"array"}]}},{"name":"enable-blueprints","description":"Enables blueprints in the current conversation by their keys. Only blueprints with agentCanEnable=true can be enabled. Always call [query-blueprints] first to discover available blueprint keys.","inputSchema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"string"},"description":"The keys of the blueprints to enable.","examples":[["org.dxos.blueprint.memory","org.dxos.blueprint.database"]]}},"additionalProperties":false}},{"name":"refresh-blueprints","description":"Updates the blueprints saved to the database with the latest version from the registry. Sometimes blueprints in the database can become outdated. Use this function to pull in the latest versions.","inputSchema":{"$id":"/schemas/%7B%7D","anyOf":[{"type":"object"},{"type":"array"}]}}]},"prompt":{"content":[{"role":"system","content":"You can call blueprint manager tools. When asked to refresh or sync blueprints from the registry,\ncall the refresh blueprints tool once and then stop.\n\n## Blueprints Definitions\n\n<blueprint>\n You can query available blueprints and enable them in the current conversation.\n Use [query-blueprints] to refresh the list of available blueprints.\n Use [refresh-blueprints] to update blueprint objects stored in the database from the built-in registry when they have drifted.\n Use [enable-blueprints] to enable blueprints by their keys. Always call [query-blueprints] first.\n Only blueprints with agentCanEnable=true can be enabled by the agent.\n \n <available_blueprints>\n - \"Database\" -- Query and manipulate objects in the ECHO database. [agent-can-enable]\n - \"Discord\" -- Discord integration.\n - \"Memory\" -- Persistent memory storage and retrieval. [agent-can-enable]\n </available_blueprints>\n \n NOTE: You must enable the blueprint to use it, only then the tools from that blueprint will appear.\n</blueprint>","options":{}},{"role":"user","content":"Refresh blueprints from the registry so database copies match the built-in definitions.","options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_01EnWRrZtYvker1hoFaUftiX","modelId":"claude-opus-4-6","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"reasoning-start","id":"0","metadata":{}},{"type":"reasoning-delta","id":"0","delta":"The user wants to refresh blueprints from the registry. I should call the refresh-blueprints tool.","metadata":{}},{"type":"reasoning-delta","id":"0","delta":"","metadata":{"anthropic":{"type":"thinking","signature":"EqgCCmMIDhgCKkBdz2UkSiBc+mB42bn4XBMulDdlfY744r6A3/CtRIj5ka8kLuAbmGbpsDHh15YA4AXwrTKjmGFVws1/iQVVcX0NMg9jbGF1ZGUtb3B1cy00LTY4AEIIdGhpbmtpbmcSDC1IWXx2nxKJlumiFBoMODifRWw+vJr3M9oxIjCNeGHzgul3HZTZVS1Y1fq36Z6+uk9jVJtfR1kiZDmfUabkraoD+PzSoABC7+HQSl4qc4hegrTArcyY5OVZiDXjw5cbBhF72gChkZu+A5b/wqIxjxdVTqj5Mk3W9dVK7gF5K9ATIOu8KeHLwz9wFEZgmK9vBQhhWrX+X0SaZ7Tds2fllZyPf+1u7EbqQUDP0fp8mjeXRSKJLeTBGTw/d5Ul0Y3/DIgYAQ=="}}},{"type":"reasoning-end","id":"0","metadata":{}},{"type":"text-start","id":"1","metadata":{}},{"type":"text-delta","id":"1","delta":"I","metadata":{}},{"type":"text-delta","id":"1","delta":"'ll refresh the blueprints from the registry now.","metadata":{}},{"type":"text-end","id":"1","metadata":{}},{"type":"tool-params-start","id":"toolu_0191HNbgqXmmaNXfW6keirtd","name":"refresh-blueprints","providerExecuted":false,"metadata":{}},{"type":"tool-params-delta","id":"toolu_0191HNbgqXmmaNXfW6keirtd","delta":"","metadata":{}},{"type":"tool-params-end","id":"toolu_0191HNbgqXmmaNXfW6keirtd","metadata":{}},{"type":"finish","reason":"tool-calls","usage":{"inputTokens":1086,"outputTokens":90,"totalTokens":1176},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":1086,"output_tokens":40,"server_tool_use":null,"service_tier":"standard"}}}}]},{"parameters":{"model":"ai.claude.model.claude-opus-4-6","stream":true,"tools":[{"name":"query-blueprints","description":"Queries available blueprints.","inputSchema":{"$id":"/schemas/%7B%7D","anyOf":[{"type":"object"},{"type":"array"}]}},{"name":"enable-blueprints","description":"Enables blueprints in the current conversation by their keys. Only blueprints with agentCanEnable=true can be enabled. Always call [query-blueprints] first to discover available blueprint keys.","inputSchema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"string"},"description":"The keys of the blueprints to enable.","examples":[["org.dxos.blueprint.memory","org.dxos.blueprint.database"]]}},"additionalProperties":false}},{"name":"refresh-blueprints","description":"Updates the blueprints saved to the database with the latest version from the registry. Sometimes blueprints in the database can become outdated. Use this function to pull in the latest versions.","inputSchema":{"$id":"/schemas/%7B%7D","anyOf":[{"type":"object"},{"type":"array"}]}}]},"prompt":{"content":[{"role":"system","content":"You can call blueprint manager tools. When asked to refresh or sync blueprints from the registry,\ncall the refresh blueprints tool once and then stop.\n\n## Blueprints Definitions\n\n<blueprint>\n You can query available blueprints and enable them in the current conversation.\n Use [query-blueprints] to refresh the list of available blueprints.\n Use [refresh-blueprints] to update blueprint objects stored in the database from the built-in registry when they have drifted.\n Use [enable-blueprints] to enable blueprints by their keys. Always call [query-blueprints] first.\n Only blueprints with agentCanEnable=true can be enabled by the agent.\n \n <available_blueprints>\n - \"Database\" -- Query and manipulate objects in the ECHO database. [agent-can-enable]\n - \"Discord\" -- Discord integration.\n - \"Memory\" -- Persistent memory storage and retrieval. [agent-can-enable]\n </available_blueprints>\n \n NOTE: You must enable the blueprint to use it, only then the tools from that blueprint will appear.\n</blueprint>","options":{}},{"role":"user","content":"Refresh blueprints from the registry so database copies match the built-in definitions.","options":{}},{"role":"assistant","content":[{"type":"reasoning","text":"The user wants to refresh blueprints from the registry. I should call the refresh-blueprints tool.","options":{}},{"type":"text","text":"I'll refresh the blueprints from the registry now.","options":{}},{"type":"tool-call","id":"toolu_0191HNbgqXmmaNXfW6keirtd","name":"refresh-blueprints","params":{},"providerExecuted":false,"options":{}}],"options":{}},{"role":"tool","content":[{"type":"tool-result","id":"toolu_0191HNbgqXmmaNXfW6keirtd","name":"refresh-blueprints","isFailure":false,"result":{},"providerExecuted":false,"options":{}}],"options":{"anthropic":{"cacheControl":{"ttl":"5m","type":"ephemeral"}}}}]},"response":[{"type":"response-metadata","id":"msg_01UYmSHxnE5L1YWqDDnmQtpE","modelId":"claude-opus-4-6","timestamp":"1970-01-01T00:00:00.000Z","metadata":{}},{"type":"text-start","id":"0","metadata":{}},{"type":"text-delta","id":"0","delta":"The blueprints stored","metadata":{}},{"type":"text-delta","id":"0","delta":" in the database have been updated to match the latest built-in definitions from the registry. Everything should","metadata":{}},{"type":"text-delta","id":"0","delta":" now be in sync.","metadata":{}},{"type":"text-end","id":"0","metadata":{}},{"type":"finish","reason":"stop","usage":{"inputTokens":1149,"outputTokens":33,"totalTokens":1182},"metadata":{"anthropic":{"usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":1149,"output_tokens":5,"server_tool_use":null,"service_tier":"standard"}}}}]}]}
|
|
@@ -6,21 +6,18 @@ import { describe, expect, it } from '@effect/vitest';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import * as Layer from 'effect/Layer';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { Operation } from '@dxos/compute';
|
|
13
|
-
import { Database, DXN, Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { AiContext, AiSession } from '@dxos/assistant';
|
|
10
|
+
import { Blueprint, Operation } from '@dxos/compute';
|
|
11
|
+
import { Obj } from '@dxos/echo';
|
|
14
12
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
15
13
|
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
16
|
-
import {
|
|
17
|
-
import { trim } from '@dxos/util';
|
|
14
|
+
import { EntityId } from '@dxos/keys';
|
|
18
15
|
|
|
19
16
|
import { DatabaseBlueprint, DiscordBlueprint, MemoryBlueprint } from '../index';
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
17
|
+
import { BlueprintManagerHandlers } from './operations';
|
|
18
|
+
import { EnableBlueprints, QueryBlueprints } from './operations/definitions';
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
EntityId.dangerouslyDisableRandomness();
|
|
24
21
|
|
|
25
22
|
const TestLayer = AssistantTestLayer({
|
|
26
23
|
aiServicePreset: 'edge-remote',
|
|
@@ -30,14 +27,14 @@ const TestLayer = AssistantTestLayer({
|
|
|
30
27
|
tracing: 'pretty',
|
|
31
28
|
});
|
|
32
29
|
|
|
33
|
-
const provideTestLayers = Effect.provide(
|
|
30
|
+
const provideTestLayers = Effect.provide(AiSession.Service.layerNewFeed().pipe(Layer.provideMerge(TestLayer)));
|
|
34
31
|
|
|
35
32
|
/**
|
|
36
33
|
* Gets the conversation DXN for passing to Operation.invoke options.
|
|
37
34
|
*/
|
|
38
|
-
const
|
|
39
|
-
const session = yield*
|
|
40
|
-
return Obj.
|
|
35
|
+
const getConversationDXN = Effect.gen(function* () {
|
|
36
|
+
const session = yield* AiSession.Service;
|
|
37
|
+
return Obj.getURI(session.feed);
|
|
41
38
|
});
|
|
42
39
|
|
|
43
40
|
describe('Blueprint Manager', () => {
|
|
@@ -45,10 +42,10 @@ describe('Blueprint Manager', () => {
|
|
|
45
42
|
'query-blueprints: returns all registered blueprints',
|
|
46
43
|
Effect.fnUntraced(
|
|
47
44
|
function* (_) {
|
|
48
|
-
const conversation = yield*
|
|
45
|
+
const conversation = yield* getConversationDXN;
|
|
49
46
|
const result = yield* Operation.invoke(QueryBlueprints, {}, { conversation });
|
|
50
47
|
expect(result).toHaveLength(3);
|
|
51
|
-
const keys = result.map((blueprint: Blueprint.Blueprint) => blueprint.key);
|
|
48
|
+
const keys = result.map((blueprint: Blueprint.Blueprint) => Obj.getMeta(blueprint).key);
|
|
52
49
|
expect(keys).toContain('org.dxos.blueprint.database');
|
|
53
50
|
expect(keys).toContain('org.dxos.blueprint.memory');
|
|
54
51
|
expect(keys).toContain('org.dxos.blueprint.discord');
|
|
@@ -63,19 +60,21 @@ describe('Blueprint Manager', () => {
|
|
|
63
60
|
'enable-blueprints: enables blueprints with agentCanEnable=true',
|
|
64
61
|
Effect.fnUntraced(
|
|
65
62
|
function* (_) {
|
|
66
|
-
const conversation = yield*
|
|
63
|
+
const conversation = yield* getConversationDXN;
|
|
67
64
|
const { enabled, rejected } = yield* Operation.invoke(
|
|
68
65
|
EnableBlueprints,
|
|
69
66
|
{ keys: ['org.dxos.blueprint.database'] },
|
|
70
67
|
{ conversation },
|
|
71
68
|
);
|
|
72
69
|
expect(enabled).toHaveLength(1);
|
|
73
|
-
expect(enabled[0].key).toBe('org.dxos.blueprint.database');
|
|
70
|
+
expect(Obj.getMeta(enabled[0]).key).toBe('org.dxos.blueprint.database');
|
|
74
71
|
expect(rejected).toHaveLength(0);
|
|
75
72
|
|
|
76
|
-
const { binder } = yield*
|
|
73
|
+
const { binder } = yield* AiContext.Service;
|
|
77
74
|
const bound = binder.getBlueprints();
|
|
78
|
-
expect(bound.some((bp: Blueprint.Blueprint) => bp.key === 'org.dxos.blueprint.database')).toBe(
|
|
75
|
+
expect(bound.some((bp: Blueprint.Blueprint) => Obj.getMeta(bp).key === 'org.dxos.blueprint.database')).toBe(
|
|
76
|
+
true,
|
|
77
|
+
);
|
|
79
78
|
},
|
|
80
79
|
provideTestLayers,
|
|
81
80
|
TestHelpers.provideTestContext,
|
|
@@ -87,7 +86,7 @@ describe('Blueprint Manager', () => {
|
|
|
87
86
|
'enable-blueprints: rejects blueprints without agentCanEnable',
|
|
88
87
|
Effect.fnUntraced(
|
|
89
88
|
function* (_) {
|
|
90
|
-
const conversation = yield*
|
|
89
|
+
const conversation = yield* getConversationDXN;
|
|
91
90
|
const { enabled, rejected } = yield* Operation.invoke(
|
|
92
91
|
EnableBlueprints,
|
|
93
92
|
{ keys: ['org.dxos.blueprint.discord'] },
|
|
@@ -97,9 +96,11 @@ describe('Blueprint Manager', () => {
|
|
|
97
96
|
expect(rejected).toHaveLength(1);
|
|
98
97
|
expect(rejected[0].key).toBe('org.dxos.blueprint.discord');
|
|
99
98
|
|
|
100
|
-
const { binder } = yield*
|
|
99
|
+
const { binder } = yield* AiContext.Service;
|
|
101
100
|
const bound = binder.getBlueprints();
|
|
102
|
-
expect(bound.some((bp: Blueprint.Blueprint) => bp.key === 'org.dxos.blueprint.discord')).toBe(
|
|
101
|
+
expect(bound.some((bp: Blueprint.Blueprint) => Obj.getMeta(bp).key === 'org.dxos.blueprint.discord')).toBe(
|
|
102
|
+
false,
|
|
103
|
+
);
|
|
103
104
|
},
|
|
104
105
|
provideTestLayers,
|
|
105
106
|
TestHelpers.provideTestContext,
|
|
@@ -111,7 +112,7 @@ describe('Blueprint Manager', () => {
|
|
|
111
112
|
'enable-blueprints: mixed keys enables only allowed ones',
|
|
112
113
|
Effect.fnUntraced(
|
|
113
114
|
function* (_) {
|
|
114
|
-
const conversation = yield*
|
|
115
|
+
const conversation = yield* getConversationDXN;
|
|
115
116
|
const { enabled, rejected } = yield* Operation.invoke(
|
|
116
117
|
EnableBlueprints,
|
|
117
118
|
{
|
|
@@ -120,7 +121,7 @@ describe('Blueprint Manager', () => {
|
|
|
120
121
|
{ conversation },
|
|
121
122
|
);
|
|
122
123
|
expect(enabled).toHaveLength(2);
|
|
123
|
-
const enabledKeys = enabled.map((bp: Blueprint.Blueprint) => bp.key);
|
|
124
|
+
const enabledKeys = enabled.map((bp: Blueprint.Blueprint) => Obj.getMeta(bp).key);
|
|
124
125
|
expect(enabledKeys).toContain('org.dxos.blueprint.database');
|
|
125
126
|
expect(enabledKeys).toContain('org.dxos.blueprint.memory');
|
|
126
127
|
expect(rejected).toHaveLength(1);
|
|
@@ -136,7 +137,7 @@ describe('Blueprint Manager', () => {
|
|
|
136
137
|
'enable-blueprints: unknown keys are rejected with reason',
|
|
137
138
|
Effect.fnUntraced(
|
|
138
139
|
function* (_) {
|
|
139
|
-
const conversation = yield*
|
|
140
|
+
const conversation = yield* getConversationDXN;
|
|
140
141
|
const { enabled, rejected } = yield* Operation.invoke(
|
|
141
142
|
EnableBlueprints,
|
|
142
143
|
{ keys: ['org.dxos.blueprint.nonexistent'] },
|
|
@@ -152,48 +153,4 @@ describe('Blueprint Manager', () => {
|
|
|
152
153
|
),
|
|
153
154
|
{ timeout: 30_000 },
|
|
154
155
|
);
|
|
155
|
-
|
|
156
|
-
it.scoped(
|
|
157
|
-
'refresh-blueprints: agent syncs a mutated database blueprint from the registry',
|
|
158
|
-
Effect.fnUntraced(
|
|
159
|
-
function* (_) {
|
|
160
|
-
const registry = yield* Blueprint.RegistryService;
|
|
161
|
-
const canonical = registry.getByKey('org.dxos.blueprint.database');
|
|
162
|
-
expect(canonical).toBeDefined();
|
|
163
|
-
|
|
164
|
-
const stored = yield* Blueprint.upsert('org.dxos.blueprint.database');
|
|
165
|
-
const originalName = stored.name;
|
|
166
|
-
Obj.update(stored, (stored) => {
|
|
167
|
-
stored.name = '___TEST_MUTATED_BLUEPRINT_NAME___';
|
|
168
|
-
});
|
|
169
|
-
yield* Database.flush();
|
|
170
|
-
expect(stored.name).toBe('___TEST_MUTATED_BLUEPRINT_NAME___');
|
|
171
|
-
|
|
172
|
-
const session = yield* AiSessionService;
|
|
173
|
-
yield* Effect.promise(() => session.context.open());
|
|
174
|
-
yield* Effect.promise(() =>
|
|
175
|
-
session.context.bind({
|
|
176
|
-
blueprints: [Ref.make(BlueprintManagerDefinition.make())],
|
|
177
|
-
}),
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
yield* session
|
|
181
|
-
.createRequest({
|
|
182
|
-
system: trim`
|
|
183
|
-
You can call blueprint manager tools. When asked to refresh or sync blueprints from the registry,
|
|
184
|
-
call the refresh blueprints tool once and then stop.
|
|
185
|
-
`,
|
|
186
|
-
prompt: trim`
|
|
187
|
-
Refresh blueprints from the registry so database copies match the built-in definitions.
|
|
188
|
-
`,
|
|
189
|
-
})
|
|
190
|
-
.pipe(Effect.provide(session.makeToolExecutionServices()));
|
|
191
|
-
|
|
192
|
-
expect(stored.name).toBe(originalName);
|
|
193
|
-
},
|
|
194
|
-
provideTestLayers,
|
|
195
|
-
TestHelpers.provideTestContext,
|
|
196
|
-
),
|
|
197
|
-
MemoizedAiService.isGenerationEnabled() ? 240_000 : 60_000,
|
|
198
|
-
);
|
|
199
156
|
});
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Blueprint, Template } from '@dxos/compute';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
import { EnableBlueprints, QueryBlueprints
|
|
9
|
+
import { EnableBlueprints, QueryBlueprints } from './operations/definitions';
|
|
9
10
|
|
|
10
|
-
const BLUEPRINT_KEY = 'org.dxos.blueprint.
|
|
11
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.blueprintManager';
|
|
11
12
|
|
|
12
13
|
const make = () =>
|
|
13
14
|
Blueprint.make({
|
|
@@ -18,7 +19,6 @@ const make = () =>
|
|
|
18
19
|
source: trim`
|
|
19
20
|
You can query available blueprints and enable them in the current conversation.
|
|
20
21
|
Use [query-blueprints] to refresh the list of available blueprints.
|
|
21
|
-
Use [refresh-blueprints] to update blueprint objects stored in the database from the built-in registry when they have drifted.
|
|
22
22
|
Use [enable-blueprints] to enable blueprints by their keys. Always call [query-blueprints] first.
|
|
23
23
|
Only blueprints with agentCanEnable=true can be enabled by the agent.
|
|
24
24
|
|
|
@@ -33,12 +33,12 @@ const make = () =>
|
|
|
33
33
|
inputs: [
|
|
34
34
|
{
|
|
35
35
|
name: 'blueprints',
|
|
36
|
-
kind: '
|
|
37
|
-
|
|
36
|
+
kind: 'operation',
|
|
37
|
+
operation: DXN.getName(QueryBlueprints.meta.key),
|
|
38
38
|
},
|
|
39
39
|
],
|
|
40
40
|
}),
|
|
41
|
-
tools: Blueprint.toolDefinitions({ operations: [QueryBlueprints, EnableBlueprints
|
|
41
|
+
tools: Blueprint.toolDefinitions({ operations: [QueryBlueprints, EnableBlueprints] }),
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
const blueprint: Blueprint.Definition = {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { AiContext } from '@dxos/assistant';
|
|
8
|
+
import { Blueprint, Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Registry, Type } from '@dxos/echo';
|
|
10
|
+
import { DXN } from '@dxos/keys';
|
|
11
|
+
|
|
12
|
+
export const QueryBlueprints = Operation.make({
|
|
13
|
+
meta: {
|
|
14
|
+
key: DXN.make('org.dxos.function.blueprintManager.queryBlueprints'),
|
|
15
|
+
name: 'Query blueprints',
|
|
16
|
+
description: 'Queries available blueprints.',
|
|
17
|
+
icon: 'ph--blueprint--regular',
|
|
18
|
+
},
|
|
19
|
+
input: Schema.Struct({}),
|
|
20
|
+
output: Schema.Array(Type.getSchema(Blueprint.Blueprint)),
|
|
21
|
+
services: [Registry.Service],
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const EnableBlueprints = Operation.make({
|
|
25
|
+
meta: {
|
|
26
|
+
key: DXN.make('org.dxos.function.blueprintManager.enableBlueprints'),
|
|
27
|
+
name: 'Enable blueprints',
|
|
28
|
+
description:
|
|
29
|
+
'Enables blueprints in the current conversation by their keys. Only blueprints with agentCanEnable=true can be enabled. Always call [query-blueprints] first to discover available blueprint keys.',
|
|
30
|
+
icon: 'ph--plugs-connected--regular',
|
|
31
|
+
},
|
|
32
|
+
input: Schema.Struct({
|
|
33
|
+
keys: Schema.Array(Schema.String).annotations({
|
|
34
|
+
description: 'The keys of the blueprints to enable.',
|
|
35
|
+
examples: [['org.dxos.blueprint.memory', 'org.dxos.blueprint.database']],
|
|
36
|
+
}),
|
|
37
|
+
}),
|
|
38
|
+
output: Schema.Struct({
|
|
39
|
+
enabled: Schema.Array(Type.getSchema(Blueprint.Blueprint)),
|
|
40
|
+
rejected: Schema.Array(
|
|
41
|
+
Schema.Struct({
|
|
42
|
+
key: Schema.String,
|
|
43
|
+
reason: Schema.String,
|
|
44
|
+
}),
|
|
45
|
+
),
|
|
46
|
+
}),
|
|
47
|
+
services: [Registry.Service, Database.Service, AiContext.Service],
|
|
48
|
+
});
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Either from 'effect/Either';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import { Blueprint } from '@dxos/compute';
|
|
9
|
-
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { AiContext } from '@dxos/assistant';
|
|
9
|
+
import { Blueprint, Operation } from '@dxos/compute';
|
|
10
10
|
import { Ref } from '@dxos/echo';
|
|
11
11
|
|
|
12
12
|
import { EnableBlueprints } from './definitions';
|
|
@@ -14,17 +14,19 @@ import { EnableBlueprints } from './definitions';
|
|
|
14
14
|
export default EnableBlueprints.pipe(
|
|
15
15
|
Operation.withHandler(
|
|
16
16
|
Effect.fnUntraced(function* ({ keys }) {
|
|
17
|
-
const registry = yield* Blueprint.RegistryService;
|
|
18
17
|
const enabled: Blueprint.Blueprint[] = [];
|
|
19
18
|
const rejected: { key: string; reason: string }[] = [];
|
|
20
19
|
|
|
21
20
|
for (const key of keys) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const result = yield* Blueprint.resolve(key).pipe(
|
|
22
|
+
Effect.mapError(() => ({ key, reason: 'Blueprint not found in registry.' })),
|
|
23
|
+
Effect.either,
|
|
24
|
+
);
|
|
25
|
+
if (Either.isLeft(result)) {
|
|
26
|
+
rejected.push(result.left);
|
|
25
27
|
continue;
|
|
26
28
|
}
|
|
27
|
-
if (!
|
|
29
|
+
if (!result.right.agentCanEnable) {
|
|
28
30
|
rejected.push({ key, reason: 'Blueprint does not allow agent auto-enable (agentCanEnable is not set).' });
|
|
29
31
|
continue;
|
|
30
32
|
}
|
|
@@ -33,7 +35,7 @@ export default EnableBlueprints.pipe(
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
if (enabled.length > 0) {
|
|
36
|
-
yield*
|
|
38
|
+
yield* AiContext.Service.bindContext({
|
|
37
39
|
blueprints: enabled.map(Ref.make),
|
|
38
40
|
});
|
|
39
41
|
}
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
6
|
|
|
7
|
-
export * from './definitions';
|
|
7
|
+
export * as BlueprintManagerOperations from './definitions';
|
|
8
8
|
|
|
9
9
|
export const BlueprintManagerHandlers = OperationHandlerSet.lazy(
|
|
10
10
|
() => import('./query-blueprints'),
|
|
11
11
|
() => import('./enable-blueprints'),
|
|
12
|
-
() => import('./update-blueprints'),
|
|
13
12
|
);
|