@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
|
@@ -5,21 +5,20 @@
|
|
|
5
5
|
import { describe, expect, it } from '@effect/vitest';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
-
import { Blueprint } from '@dxos/compute';
|
|
9
|
-
import {
|
|
10
|
-
import { Database, Entity, Feed, Filter, Obj, Query, Ref, Relation, Tag } from '@dxos/echo';
|
|
8
|
+
import { Blueprint, Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Entity, Feed, Filter, Obj, Query, Ref, Relation, Scope, Tag, Type } from '@dxos/echo';
|
|
11
10
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
11
|
import { AgentService } from '@dxos/functions-runtime';
|
|
13
12
|
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
14
|
-
import {
|
|
13
|
+
import { EID, EntityId } from '@dxos/keys';
|
|
15
14
|
import { Employer, Organization, Person } from '@dxos/types';
|
|
16
15
|
import { trim } from '@dxos/util';
|
|
17
16
|
|
|
18
17
|
import DatabaseBlueprint from './blueprint';
|
|
19
|
-
import { DatabaseHandlers } from './
|
|
20
|
-
import { Query as DatabaseQueryOperation } from './
|
|
18
|
+
import { DatabaseHandlers } from './operations';
|
|
19
|
+
import { Query as DatabaseQueryOperation } from './operations/definitions';
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
EntityId.dangerouslyDisableRandomness();
|
|
23
22
|
|
|
24
23
|
const TestLayer = AssistantTestLayer({
|
|
25
24
|
operationHandlers: DatabaseHandlers,
|
|
@@ -61,10 +60,10 @@ describe('Database Blueprint', () => {
|
|
|
61
60
|
'Add a new schema called "Project" with typename "com.example.type.project" and fields: name (string), description (string), and status (string).',
|
|
62
61
|
);
|
|
63
62
|
yield* agent.waitForCompletion();
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
const allTypes = yield* Database.query(
|
|
64
|
+
Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
65
|
+
).run;
|
|
66
|
+
const schemas = allTypes.filter((t) => Type.getTypename(t) === 'com.example.type.project');
|
|
68
67
|
expect(schemas.length).toBeGreaterThanOrEqual(1);
|
|
69
68
|
},
|
|
70
69
|
Effect.provide(TestLayer),
|
|
@@ -86,7 +85,7 @@ describe('Database Blueprint', () => {
|
|
|
86
85
|
});
|
|
87
86
|
yield* agent.submitPrompt('Create a new organization called "Cyberdyne Systems".');
|
|
88
87
|
yield* agent.waitForCompletion();
|
|
89
|
-
const orgs = yield* Database.
|
|
88
|
+
const orgs = yield* Database.query(Query.type(Organization.Organization, { name: 'Cyberdyne Systems' })).run;
|
|
90
89
|
expect(orgs).toHaveLength(1);
|
|
91
90
|
},
|
|
92
91
|
Effect.provide(TestLayer),
|
|
@@ -106,8 +105,8 @@ describe('Database Blueprint', () => {
|
|
|
106
105
|
'Create a preson fullName="John Doe" with a reference to the organization "Cyberdyne Systems".',
|
|
107
106
|
);
|
|
108
107
|
yield* agent.waitForCompletion();
|
|
109
|
-
const orgs = yield* Database.
|
|
110
|
-
const persons = yield* Database.
|
|
108
|
+
const orgs = yield* Database.query(Query.type(Organization.Organization, { name: 'Cyberdyne Systems' })).run;
|
|
109
|
+
const persons = yield* Database.query(Query.type(Person.Person, { fullName: 'John Doe' })).run;
|
|
111
110
|
expect(orgs).toHaveLength(1);
|
|
112
111
|
expect(persons).toHaveLength(1);
|
|
113
112
|
expect(persons[0].organization?.target).toBe(orgs[0]);
|
|
@@ -186,8 +185,8 @@ describe('Database Blueprint', () => {
|
|
|
186
185
|
const org = yield* Database.add(
|
|
187
186
|
Obj.make(Organization.Organization, { name: 'Detail Corp', description: 'A detailed organization.' }),
|
|
188
187
|
);
|
|
189
|
-
const
|
|
190
|
-
yield* agent.submitPrompt(`Load the full details of object ${
|
|
188
|
+
const uri = Obj.getURI(org);
|
|
189
|
+
yield* agent.submitPrompt(`Load the full details of object ${uri}. What is its description?`);
|
|
191
190
|
yield* agent.waitForCompletion();
|
|
192
191
|
},
|
|
193
192
|
Effect.provide(TestLayer),
|
|
@@ -213,7 +212,7 @@ describe('Database Blueprint', () => {
|
|
|
213
212
|
`Create an Employer relation from person "John Connor" to organization "Cyberdyne Systems" with role "Engineer". List schemas first to find the relation typename.`,
|
|
214
213
|
);
|
|
215
214
|
yield* agent.waitForCompletion();
|
|
216
|
-
const relations = yield* Database.
|
|
215
|
+
const relations = yield* Database.query(Query.type(Employer.Employer)).run;
|
|
217
216
|
expect(relations.length).toBeGreaterThanOrEqual(1);
|
|
218
217
|
},
|
|
219
218
|
Effect.provide(TestLayer),
|
|
@@ -238,8 +237,8 @@ describe('Database Blueprint', () => {
|
|
|
238
237
|
role: 'Director',
|
|
239
238
|
}),
|
|
240
239
|
);
|
|
241
|
-
const
|
|
242
|
-
yield* agent.submitPrompt(`Delete the relation ${
|
|
240
|
+
const relationUri = Relation.getURI(relation);
|
|
241
|
+
yield* agent.submitPrompt(`Delete the relation ${relationUri}.`);
|
|
243
242
|
yield* agent.waitForCompletion();
|
|
244
243
|
expect(Relation.isDeleted(relation)).toBe(true);
|
|
245
244
|
},
|
|
@@ -264,9 +263,10 @@ describe('Database Blueprint', () => {
|
|
|
264
263
|
const tag = yield* Database.add(Tag.make({ label: 'important' }));
|
|
265
264
|
yield* agent.submitPrompt(`Add tag "important" to the organization "Tagged Corp".`);
|
|
266
265
|
yield* agent.waitForCompletion();
|
|
267
|
-
|
|
268
|
-
//
|
|
269
|
-
|
|
266
|
+
// Compare by entity id: a same-space ref stores a local EID (`echo:/<id>`) while
|
|
267
|
+
// `Obj.getURI` returns the fully-qualified form (`echo://<space>/<id>`).
|
|
268
|
+
const taggedIds = Obj.getMeta(org).tags.map((ref) => EID.getEntityId(EID.parse(ref.uri)));
|
|
269
|
+
expect(taggedIds).toContain(tag.id);
|
|
270
270
|
},
|
|
271
271
|
Effect.provide(TestLayer),
|
|
272
272
|
TestHelpers.provideTestContext,
|
|
@@ -283,14 +283,13 @@ describe('Database Blueprint', () => {
|
|
|
283
283
|
});
|
|
284
284
|
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Untagged Corp' }));
|
|
285
285
|
const tag = yield* Database.add(Tag.make({ label: 'obsolete' }));
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
// Compare by entity id (local vs fully-qualified EID forms refer to the same object).
|
|
287
|
+
const taggedIds = () => Obj.getMeta(org).tags.map((ref) => EID.getEntityId(EID.parse(ref.uri)));
|
|
288
|
+
Entity.update(org, (org) => Entity.addTag(org, Ref.make(tag)));
|
|
289
|
+
expect(taggedIds()).toContain(tag.id);
|
|
289
290
|
yield* agent.submitPrompt(`Remove tag "obsolete" from the organization "Untagged Corp".`);
|
|
290
291
|
yield* agent.waitForCompletion();
|
|
291
|
-
|
|
292
|
-
// TODO(dmaretskyi): matcher doesnt work with echo proxies.
|
|
293
|
-
expect([...tags]).not.toContain(tagDxn);
|
|
292
|
+
expect(taggedIds()).not.toContain(tag.id);
|
|
294
293
|
},
|
|
295
294
|
Effect.provide(TestLayer),
|
|
296
295
|
TestHelpers.provideTestContext,
|
|
@@ -330,13 +329,13 @@ describe('Database Blueprint', () => {
|
|
|
330
329
|
});
|
|
331
330
|
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Remove Context Corp' }));
|
|
332
331
|
const { db } = yield* Database.Service;
|
|
333
|
-
const ref = db.makeRef(Obj.
|
|
332
|
+
const ref = db.makeRef(Obj.getURI(org)) as Ref.Ref<any>;
|
|
334
333
|
yield* agent.addContext([ref]);
|
|
335
|
-
const
|
|
334
|
+
const uri = Obj.getURI(org);
|
|
336
335
|
yield* agent.submitPrompt(`Remove the organization "Remove Context Corp" from the chat context.`);
|
|
337
336
|
yield* agent.waitForCompletion();
|
|
338
337
|
const contextRefs = yield* agent.getContext();
|
|
339
|
-
const found = contextRefs.find((contextRef) => contextRef.
|
|
338
|
+
const found = contextRefs.find((contextRef) => contextRef.uri === uri);
|
|
340
339
|
expect(found).toBeUndefined();
|
|
341
340
|
},
|
|
342
341
|
Effect.provide(TestLayer),
|
|
@@ -372,16 +371,16 @@ describe('Database Blueprint', () => {
|
|
|
372
371
|
yield* agent.waitForCompletion();
|
|
373
372
|
|
|
374
373
|
const { db } = yield* Database.Service;
|
|
375
|
-
const spaceOnly = yield* Database.
|
|
374
|
+
const spaceOnly = yield* Database.query(
|
|
376
375
|
Query.select(Filter.text('reservation', { type: 'full-text' })).limit(20),
|
|
377
|
-
);
|
|
376
|
+
).run;
|
|
378
377
|
expect(spaceOnly).toHaveLength(0);
|
|
379
378
|
|
|
380
|
-
const withFeeds = yield* Database.
|
|
379
|
+
const withFeeds = yield* Database.query(
|
|
381
380
|
Query.select(Filter.text('reservation', { type: 'full-text' }))
|
|
382
381
|
.from(db, { includeFeeds: true })
|
|
383
382
|
.limit(20),
|
|
384
|
-
);
|
|
383
|
+
).run;
|
|
385
384
|
expect(withFeeds.length).toBeGreaterThanOrEqual(1);
|
|
386
385
|
expect(
|
|
387
386
|
withFeeds.some(
|
|
@@ -391,9 +390,9 @@ describe('Database Blueprint', () => {
|
|
|
391
390
|
),
|
|
392
391
|
).toBe(true);
|
|
393
392
|
|
|
394
|
-
const byTypename = yield* Database.
|
|
393
|
+
const byTypename = yield* Database.query(
|
|
395
394
|
Query.type(Organization.Organization).from(db, { includeFeeds: true }).limit(20),
|
|
396
|
-
);
|
|
395
|
+
).run;
|
|
397
396
|
expect(byTypename.length).toBeGreaterThanOrEqual(1);
|
|
398
397
|
},
|
|
399
398
|
Effect.provide(TestLayer),
|
|
@@ -518,8 +517,8 @@ describe('Database Blueprint', () => {
|
|
|
518
517
|
`Call query tool with precisely ${JSON.stringify({
|
|
519
518
|
includeContent: false,
|
|
520
519
|
limit: 10,
|
|
521
|
-
typename: Organization.Organization
|
|
522
|
-
in: [Obj.
|
|
520
|
+
typename: Type.getTypename(Organization.Organization),
|
|
521
|
+
in: [Obj.getURI(feed1)],
|
|
523
522
|
})}`,
|
|
524
523
|
);
|
|
525
524
|
yield* agent.waitForCompletion();
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
RelationDelete,
|
|
22
22
|
TagAdd,
|
|
23
23
|
TagRemove,
|
|
24
|
-
} from './
|
|
24
|
+
} from './operations/definitions';
|
|
25
25
|
|
|
26
26
|
const BLUEPRINT_KEY = 'org.dxos.blueprint.database';
|
|
27
27
|
|
|
@@ -37,7 +37,7 @@ const make = () =>
|
|
|
37
37
|
description: 'Query and manipulate objects in the ECHO database.',
|
|
38
38
|
agentCanEnable: true,
|
|
39
39
|
instructions: {
|
|
40
|
-
source: Ref.make(Text.make(instructions)),
|
|
40
|
+
source: Ref.make(Text.make({ content: instructions })),
|
|
41
41
|
},
|
|
42
42
|
tools: Blueprint.toolDefinitions({
|
|
43
43
|
operations: [
|
|
@@ -3,19 +3,4 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
export { default as DatabaseBlueprint } from './blueprint';
|
|
6
|
-
export {
|
|
7
|
-
Query as DatabaseQuery,
|
|
8
|
-
Load as DatabaseLoad,
|
|
9
|
-
ObjectCreate,
|
|
10
|
-
ObjectUpdate,
|
|
11
|
-
ObjectDelete,
|
|
12
|
-
SchemaAdd,
|
|
13
|
-
SchemaList,
|
|
14
|
-
ContextAdd,
|
|
15
|
-
ContextRemove,
|
|
16
|
-
RelationCreate,
|
|
17
|
-
RelationDelete,
|
|
18
|
-
TagAdd,
|
|
19
|
-
TagRemove,
|
|
20
|
-
DatabaseHandlers,
|
|
21
|
-
} from './functions';
|
|
6
|
+
export { DatabaseHandlers, DatabaseOperations } from './operations';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { AiContext } from '@dxos/assistant';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
import { ContextAdd } from './definitions';
|
|
@@ -12,7 +12,7 @@ import { ContextAdd } from './definitions';
|
|
|
12
12
|
export default ContextAdd.pipe(
|
|
13
13
|
Operation.withHandler(
|
|
14
14
|
Effect.fn(function* ({ obj }) {
|
|
15
|
-
const { binder } = yield*
|
|
15
|
+
const { binder } = yield* AiContext.Service;
|
|
16
16
|
yield* Effect.promise(() =>
|
|
17
17
|
binder.bind({
|
|
18
18
|
blueprints: [],
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { AiContext } from '@dxos/assistant';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
import { ContextRemove } from './definitions';
|
|
@@ -12,7 +12,7 @@ import { ContextRemove } from './definitions';
|
|
|
12
12
|
export default ContextRemove.pipe(
|
|
13
13
|
Operation.withHandler(
|
|
14
14
|
Effect.fn(function* ({ obj }) {
|
|
15
|
-
const { binder } = yield*
|
|
15
|
+
const { binder } = yield* AiContext.Service;
|
|
16
16
|
yield* Effect.promise(() =>
|
|
17
17
|
binder.unbind({
|
|
18
18
|
blueprints: [],
|
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { AiContext } from '@dxos/assistant';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
|
-
import { Database, Obj, Ref, Relation, Tag } from '@dxos/echo';
|
|
9
|
+
import { Database, Obj, Ref, Relation, Tag, Type } from '@dxos/echo';
|
|
10
|
+
import { DXN } from '@dxos/keys';
|
|
10
11
|
import { trim } from '@dxos/util';
|
|
11
12
|
|
|
12
13
|
export const Query = Operation.make({
|
|
13
14
|
meta: {
|
|
14
|
-
key: 'org.dxos.function.database.query',
|
|
15
|
+
key: DXN.make('org.dxos.function.database.query'),
|
|
15
16
|
name: 'Query',
|
|
17
|
+
icon: 'ph--magnifying-glass--regular',
|
|
16
18
|
description: trim`
|
|
17
19
|
Query for objects in ECHO.
|
|
18
20
|
Use this tool when searching for information in the space (both automerge and queues).
|
|
@@ -51,7 +53,7 @@ export const Query = Operation.make({
|
|
|
51
53
|
|
|
52
54
|
<example description="Emails from specific mailboxes">
|
|
53
55
|
{
|
|
54
|
-
"in": [{"/" : "
|
|
56
|
+
"in": [{"/" : "echo:/YYYYYY"}, {"/" : "echo:/XXXXXXX"}],
|
|
55
57
|
"typename": "org.dxos.type.email",
|
|
56
58
|
"includeContent": true,
|
|
57
59
|
"limit": 20
|
|
@@ -105,14 +107,15 @@ export const Query = Operation.make({
|
|
|
105
107
|
|
|
106
108
|
export const Load = Operation.make({
|
|
107
109
|
meta: {
|
|
108
|
-
key: 'org.dxos.function.database.load',
|
|
110
|
+
key: DXN.make('org.dxos.function.database.load'),
|
|
109
111
|
name: 'Load object',
|
|
112
|
+
icon: 'ph--download--regular',
|
|
110
113
|
description: trim`
|
|
111
114
|
Loads the object or relation content.
|
|
112
115
|
Can load multiple objects at at time.
|
|
113
116
|
Use the to read the data when you have a DXN.
|
|
114
117
|
Call this tool with an array of one or more DXNs or object IDs.
|
|
115
|
-
When use see a reference ({ '/': '
|
|
118
|
+
When use see a reference ({ '/': 'echo:...' }), you can call this function to load the object.
|
|
116
119
|
Note that returned data is only a snapshot in time, and might have changed since the object was last loaded.
|
|
117
120
|
`,
|
|
118
121
|
},
|
|
@@ -125,13 +128,14 @@ export const Load = Operation.make({
|
|
|
125
128
|
|
|
126
129
|
export const ObjectCreate = Operation.make({
|
|
127
130
|
meta: {
|
|
128
|
-
key: 'org.dxos.function.database.
|
|
131
|
+
key: DXN.make('org.dxos.function.database.objectCreate'),
|
|
129
132
|
name: 'Create object',
|
|
133
|
+
icon: 'ph--plus--regular',
|
|
130
134
|
description: trim`
|
|
131
135
|
Creates a new object and adds it to the current space.
|
|
132
136
|
Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.
|
|
133
|
-
References are provided in the following format: { "/": "
|
|
134
|
-
Reference examples: { "/": "
|
|
137
|
+
References are provided in the following format: { "/": "echo:..." }.
|
|
138
|
+
Reference examples: { "/": "echo:/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "echo://<space id>/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
|
|
135
139
|
`,
|
|
136
140
|
},
|
|
137
141
|
input: Schema.Struct({
|
|
@@ -144,12 +148,13 @@ export const ObjectCreate = Operation.make({
|
|
|
144
148
|
|
|
145
149
|
export const ObjectUpdate = Operation.make({
|
|
146
150
|
meta: {
|
|
147
|
-
key: 'org.dxos.function.database.
|
|
151
|
+
key: DXN.make('org.dxos.function.database.objectUpdate'),
|
|
148
152
|
name: 'Update object',
|
|
153
|
+
icon: 'ph--pencil--regular',
|
|
149
154
|
description: trim`
|
|
150
155
|
Updates the object properties.
|
|
151
|
-
References are provided in the following format: { "/": "
|
|
152
|
-
Reference examples: { "/": "
|
|
156
|
+
References are provided in the following format: { "/": "echo:..." }.
|
|
157
|
+
Reference examples: { "/": "echo:/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "echo://<space id>/01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
|
|
153
158
|
`,
|
|
154
159
|
},
|
|
155
160
|
input: Schema.Struct({
|
|
@@ -162,11 +167,12 @@ export const ObjectUpdate = Operation.make({
|
|
|
162
167
|
|
|
163
168
|
export const ObjectDelete = Operation.make({
|
|
164
169
|
meta: {
|
|
165
|
-
key: 'org.dxos.function.database.
|
|
170
|
+
key: DXN.make('org.dxos.function.database.objectDelete'),
|
|
166
171
|
name: 'Delete object',
|
|
167
172
|
description: trim`
|
|
168
173
|
Deletes the object.
|
|
169
174
|
`,
|
|
175
|
+
icon: 'ph--trash--regular',
|
|
170
176
|
},
|
|
171
177
|
input: Schema.Struct({
|
|
172
178
|
obj: Ref.Ref(Obj.Unknown),
|
|
@@ -177,8 +183,9 @@ export const ObjectDelete = Operation.make({
|
|
|
177
183
|
|
|
178
184
|
export const SchemaAdd = Operation.make({
|
|
179
185
|
meta: {
|
|
180
|
-
key: 'org.dxos.function.database.
|
|
186
|
+
key: DXN.make('org.dxos.function.database.schemaAdd'),
|
|
181
187
|
name: 'Add schema',
|
|
188
|
+
icon: 'ph--plus--regular',
|
|
182
189
|
description: trim`
|
|
183
190
|
Adds a schema to the space.
|
|
184
191
|
The name will be used when displayed to the user.
|
|
@@ -197,8 +204,9 @@ export const SchemaAdd = Operation.make({
|
|
|
197
204
|
|
|
198
205
|
export const SchemaList = Operation.make({
|
|
199
206
|
meta: {
|
|
200
|
-
key: 'org.dxos.function.database.
|
|
207
|
+
key: DXN.make('org.dxos.function.database.schemaList'),
|
|
201
208
|
name: 'List schemas',
|
|
209
|
+
icon: 'ph--list--regular',
|
|
202
210
|
description: trim`
|
|
203
211
|
Lists schemas definitions.
|
|
204
212
|
`,
|
|
@@ -212,8 +220,9 @@ export const SchemaList = Operation.make({
|
|
|
212
220
|
|
|
213
221
|
export const ContextAdd = Operation.make({
|
|
214
222
|
meta: {
|
|
215
|
-
key: 'org.dxos.function.database.
|
|
223
|
+
key: DXN.make('org.dxos.function.database.contextAdd'),
|
|
216
224
|
name: 'Add to context',
|
|
225
|
+
icon: 'ph--plus-circle--regular',
|
|
217
226
|
description: trim`
|
|
218
227
|
Adds the object to the chat context.
|
|
219
228
|
Use this it for objects that are useful long-term for the conversation.
|
|
@@ -225,13 +234,14 @@ export const ContextAdd = Operation.make({
|
|
|
225
234
|
}),
|
|
226
235
|
}),
|
|
227
236
|
output: Schema.Void,
|
|
228
|
-
services: [
|
|
237
|
+
services: [AiContext.Service],
|
|
229
238
|
});
|
|
230
239
|
|
|
231
240
|
export const ContextRemove = Operation.make({
|
|
232
241
|
meta: {
|
|
233
|
-
key: 'org.dxos.function.database.
|
|
242
|
+
key: DXN.make('org.dxos.function.database.contextRemove'),
|
|
234
243
|
name: 'Remove from context',
|
|
244
|
+
icon: 'ph--minus-circle--regular',
|
|
235
245
|
description: trim`
|
|
236
246
|
Removes the object from the chat context.
|
|
237
247
|
Use this it for objects that are no longer useful for the conversation.
|
|
@@ -243,13 +253,14 @@ export const ContextRemove = Operation.make({
|
|
|
243
253
|
}),
|
|
244
254
|
}),
|
|
245
255
|
output: Schema.Void,
|
|
246
|
-
services: [
|
|
256
|
+
services: [AiContext.Service],
|
|
247
257
|
});
|
|
248
258
|
|
|
249
259
|
export const RelationCreate = Operation.make({
|
|
250
260
|
meta: {
|
|
251
|
-
key: 'org.dxos.function.database.
|
|
261
|
+
key: DXN.make('org.dxos.function.database.relationCreate'),
|
|
252
262
|
name: 'Create relation',
|
|
263
|
+
icon: 'ph--arrows-merge--regular',
|
|
253
264
|
description: trim`
|
|
254
265
|
Creates a new relation and adds it to the current space.
|
|
255
266
|
Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.
|
|
@@ -269,11 +280,12 @@ export const RelationCreate = Operation.make({
|
|
|
269
280
|
|
|
270
281
|
export const RelationDelete = Operation.make({
|
|
271
282
|
meta: {
|
|
272
|
-
key: 'org.dxos.function.database.
|
|
283
|
+
key: DXN.make('org.dxos.function.database.relationDelete'),
|
|
273
284
|
name: 'Delete relation',
|
|
274
285
|
description: trim`
|
|
275
286
|
Deletes the relation.
|
|
276
287
|
`,
|
|
288
|
+
icon: 'ph--trash--regular',
|
|
277
289
|
},
|
|
278
290
|
input: Schema.Struct({
|
|
279
291
|
rel: Ref.Ref(Relation.Unknown),
|
|
@@ -284,16 +296,17 @@ export const RelationDelete = Operation.make({
|
|
|
284
296
|
|
|
285
297
|
export const TagAdd = Operation.make({
|
|
286
298
|
meta: {
|
|
287
|
-
key: 'org.dxos.function.database.
|
|
299
|
+
key: DXN.make('org.dxos.function.database.tagAdd'),
|
|
288
300
|
name: 'Add tag',
|
|
301
|
+
icon: 'ph--tag--regular',
|
|
289
302
|
description: trim`
|
|
290
303
|
Adds a tag to an object.
|
|
291
|
-
Tags are objects of type ${Tag.Tag
|
|
304
|
+
Tags are objects of type ${Type.getTypename(Tag.Tag)}.
|
|
292
305
|
You must search database for available tags, or create a new one.
|
|
293
306
|
`,
|
|
294
307
|
},
|
|
295
308
|
input: Schema.Struct({
|
|
296
|
-
tag: Ref.Ref(
|
|
309
|
+
tag: Ref.Ref(Tag.Tag),
|
|
297
310
|
obj: Ref.Ref(Obj.Unknown),
|
|
298
311
|
}),
|
|
299
312
|
output: Schema.Unknown,
|
|
@@ -302,15 +315,16 @@ export const TagAdd = Operation.make({
|
|
|
302
315
|
|
|
303
316
|
export const TagRemove = Operation.make({
|
|
304
317
|
meta: {
|
|
305
|
-
key: 'org.dxos.function.database.
|
|
318
|
+
key: DXN.make('org.dxos.function.database.tagRemove'),
|
|
306
319
|
name: 'Remove tag',
|
|
320
|
+
icon: 'ph--tag--regular',
|
|
307
321
|
description: trim`
|
|
308
322
|
Removes a tag from an object.
|
|
309
|
-
Tags are objects of type ${Tag.Tag
|
|
323
|
+
Tags are objects of type ${Type.getTypename(Tag.Tag)}.
|
|
310
324
|
`,
|
|
311
325
|
},
|
|
312
326
|
input: Schema.Struct({
|
|
313
|
-
tag: Ref.Ref(
|
|
327
|
+
tag: Ref.Ref(Tag.Tag),
|
|
314
328
|
obj: Ref.Ref(Obj.Unknown),
|
|
315
329
|
}),
|
|
316
330
|
output: Schema.Unknown,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Operation } from '@dxos/compute';
|
|
8
|
-
import { Database, Entity, Obj, Type } from '@dxos/echo';
|
|
8
|
+
import { Database, Entity, Filter, Obj, Query, Scope, Type } from '@dxos/echo';
|
|
9
9
|
import { EncodedReference } from '@dxos/echo-protocol';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import { deepMapValues } from '@dxos/util';
|
|
@@ -16,17 +16,19 @@ export default ObjectCreate.pipe(
|
|
|
16
16
|
Operation.withHandler(
|
|
17
17
|
Effect.fn(function* ({ typename, data }) {
|
|
18
18
|
const { db } = yield* Database.Service;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
);
|
|
22
|
-
invariant(
|
|
19
|
+
const types = yield* Database.query(Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()))
|
|
20
|
+
.run;
|
|
21
|
+
const foundSchema = types.find((t) => Type.getTypename(t) === typename);
|
|
22
|
+
invariant(foundSchema, `Schema not found: ${typename}`);
|
|
23
|
+
invariant(Type.isObject(foundSchema), 'Schema is not an object schema');
|
|
24
|
+
const schema = foundSchema;
|
|
23
25
|
|
|
24
26
|
const object = db.add(
|
|
25
27
|
Obj.make(
|
|
26
28
|
schema,
|
|
27
29
|
deepMapValues(data, (value, recurse) => {
|
|
28
30
|
if (EncodedReference.isEncodedReference(value)) {
|
|
29
|
-
return db.makeRef(EncodedReference.
|
|
31
|
+
return db.makeRef(EncodedReference.toURI(value));
|
|
30
32
|
}
|
|
31
33
|
return recurse(value);
|
|
32
34
|
}),
|
|
@@ -18,7 +18,7 @@ export default ObjectUpdate.pipe(
|
|
|
18
18
|
Entity.update(object as Entity.Any, (obj) => {
|
|
19
19
|
for (const [key, value] of Object.entries(properties)) {
|
|
20
20
|
if (EncodedReference.isEncodedReference(value)) {
|
|
21
|
-
obj[key] = db.makeRef(EncodedReference.
|
|
21
|
+
obj[key] = db.makeRef(EncodedReference.toURI(value));
|
|
22
22
|
} else {
|
|
23
23
|
obj[key] = value;
|
|
24
24
|
}
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Operation } from '@dxos/compute';
|
|
8
|
-
import { Entity, Filter, Obj, Query as EchoQuery } from '@dxos/echo';
|
|
9
|
-
import { Database } from '@dxos/echo';
|
|
8
|
+
import { Database, Entity, Filter, Obj, Query as EchoQuery, Scope, Type } from '@dxos/echo';
|
|
10
9
|
|
|
11
10
|
import { Query } from './definitions';
|
|
12
11
|
|
|
@@ -21,18 +20,24 @@ export default Query.pipe(
|
|
|
21
20
|
...text.split(' ').map((term) => EchoQuery.select(Filter.text(term, { type: 'full-text' }))),
|
|
22
21
|
);
|
|
23
22
|
if (typename !== undefined) {
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
const types = yield* Database.query(
|
|
24
|
+
EchoQuery.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
25
|
+
).run;
|
|
26
|
+
const schema = types.find((t) => Type.getTypename(t) === typename);
|
|
27
|
+
if (!schema) {
|
|
26
28
|
return yield* Effect.fail(new Error(`Schema ${typename} not found`));
|
|
27
29
|
}
|
|
28
|
-
query = query.select(Filter.type(schema
|
|
30
|
+
query = query.select(Filter.type(schema));
|
|
29
31
|
}
|
|
30
32
|
} else if (typename) {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
+
const types = yield* Database.query(
|
|
34
|
+
EchoQuery.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
35
|
+
).run;
|
|
36
|
+
const schema = types.find((t) => Type.getTypename(t) === typename);
|
|
37
|
+
if (!schema) {
|
|
33
38
|
return yield* Effect.fail(new Error(`Schema ${typename} not found`));
|
|
34
39
|
}
|
|
35
|
-
query = EchoQuery.select(Filter.type(schema
|
|
40
|
+
query = EchoQuery.select(Filter.type(schema));
|
|
36
41
|
} else {
|
|
37
42
|
query = EchoQuery.select(Filter.everything());
|
|
38
43
|
}
|
|
@@ -43,18 +48,18 @@ export default Query.pipe(
|
|
|
43
48
|
|
|
44
49
|
query = query.limit(limit);
|
|
45
50
|
if (includeQueues) {
|
|
46
|
-
// Must scope to the current space: `from({
|
|
47
|
-
// index returns nothing (see
|
|
51
|
+
// Must scope to the current space: `from({ allFeedsFromSpaces: true })` alone has no spaceIds, so the SQL
|
|
52
|
+
// index returns nothing (see EntityMetaIndex.buildSourceCondition / early returns when spaceIds are empty).
|
|
48
53
|
query = query.from(db, { includeFeeds: true });
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
yield* Database.flush();
|
|
52
|
-
const results = yield* Database.
|
|
57
|
+
const results = yield* Database.query(query).run;
|
|
53
58
|
if (includeContent) {
|
|
54
59
|
return results.map((obj) => Entity.toJSON(obj));
|
|
55
60
|
} else {
|
|
56
61
|
return results.map((obj) => ({
|
|
57
|
-
dxn: Obj.
|
|
62
|
+
dxn: Obj.getURI(obj),
|
|
58
63
|
typename: Obj.getTypename(obj),
|
|
59
64
|
label: Obj.getLabel(obj),
|
|
60
65
|
}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Operation } from '@dxos/compute';
|
|
8
|
-
import { Database, Entity, Relation, Type } from '@dxos/echo';
|
|
8
|
+
import { Database, Entity, Filter, Query, Relation, Scope, Type } from '@dxos/echo';
|
|
9
9
|
import { invariant } from '@dxos/invariant';
|
|
10
10
|
|
|
11
11
|
import { RelationCreate } from './definitions';
|
|
@@ -14,10 +14,12 @@ export default RelationCreate.pipe(
|
|
|
14
14
|
Operation.withHandler(
|
|
15
15
|
Effect.fn(function* ({ typename, source, target, properties }) {
|
|
16
16
|
const { db } = yield* Database.Service;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
);
|
|
20
|
-
invariant(
|
|
17
|
+
const types = yield* Database.query(Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()))
|
|
18
|
+
.run;
|
|
19
|
+
const foundSchema = types.find((t) => Type.getTypename(t) === typename);
|
|
20
|
+
invariant(foundSchema, `Schema not found: ${typename}`);
|
|
21
|
+
invariant(Type.isRelation(foundSchema), 'Schema is not a relation schema');
|
|
22
|
+
const schema = foundSchema;
|
|
21
23
|
|
|
22
24
|
const sourceObj = yield* Database.load(source);
|
|
23
25
|
const targetObj = yield* Database.load(target);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Type } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { SchemaAdd } from './definitions';
|
|
11
|
+
|
|
12
|
+
export default SchemaAdd.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ name, typename, jsonSchema }) {
|
|
15
|
+
const schema = yield* Database.addType(Type.makeObjectFromJsonSchema({ typename, version: '0.1.0', jsonSchema }));
|
|
16
|
+
if (name) {
|
|
17
|
+
Type.update(schema, (draft) => {
|
|
18
|
+
draft.name = name;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}),
|
|
22
|
+
),
|
|
23
|
+
);
|