@dxos/assistant-toolkit 0.8.4-main.3fbcb4aa9b → 0.8.4-main.43cb759274
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-ZUJ5DMSY.mjs → add-artifact-ADKF427P.mjs} +6 -6
- package/dist/lib/neutral/{add-artifact-ZUJ5DMSY.mjs.map → add-artifact-ADKF427P.mjs.map} +3 -3
- package/dist/lib/neutral/{agent-5NIKAYUK.mjs → agent-4HT4GKKI.mjs} +9 -9
- package/dist/lib/neutral/{agent-5NIKAYUK.mjs.map → agent-4HT4GKKI.mjs.map} +2 -2
- package/dist/lib/neutral/{chunk-TO5IX24K.mjs → chunk-3ZDYN7BG.mjs} +16 -27
- package/dist/lib/neutral/chunk-3ZDYN7BG.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-EJAQUAKM.mjs → chunk-53BZWMRB.mjs} +12 -8
- package/dist/lib/neutral/chunk-53BZWMRB.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-WLR3BGO4.mjs → chunk-6SYN5IV3.mjs} +4 -2
- package/dist/lib/neutral/chunk-6SYN5IV3.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-QO5SU37C.mjs → chunk-7OQIX2PP.mjs} +4 -4
- package/dist/lib/neutral/{chunk-QO5SU37C.mjs.map → chunk-7OQIX2PP.mjs.map} +1 -1
- package/dist/lib/neutral/{chunk-P4ZMYO4K.mjs → chunk-ALDU6VDG.mjs} +21 -33
- package/dist/lib/neutral/chunk-ALDU6VDG.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-GV66MKAQ.mjs → chunk-AYV2KMAV.mjs} +7 -5
- package/dist/lib/neutral/chunk-AYV2KMAV.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ROMZO4CB.mjs → chunk-BB6X6NT6.mjs} +13 -10
- package/dist/lib/neutral/chunk-BB6X6NT6.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-XUF53B6B.mjs → chunk-DBUT6FKM.mjs} +16 -14
- package/dist/lib/neutral/chunk-DBUT6FKM.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-NR3GTWRC.mjs → chunk-GQRUBCMT.mjs} +8 -13
- package/dist/lib/neutral/chunk-GQRUBCMT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JRYAD4TG.mjs +67 -0
- package/dist/lib/neutral/chunk-JRYAD4TG.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ZFXLTBZG.mjs → chunk-PHZNOLXL.mjs} +5 -3
- package/dist/lib/neutral/chunk-PHZNOLXL.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-KGU725LW.mjs → chunk-SOLG2NPH.mjs} +4 -7
- package/dist/lib/neutral/chunk-SOLG2NPH.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-246ACKSH.mjs → chunk-T3RP4AUP.mjs} +24 -20
- package/dist/lib/neutral/chunk-T3RP4AUP.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-IKBIORQX.mjs → chunk-V3PPVL3C.mjs} +57 -43
- package/dist/lib/neutral/chunk-V3PPVL3C.mjs.map +7 -0
- package/dist/lib/neutral/{context-add-VB7AOY3G.mjs → context-add-2G2CDRCK.mjs} +4 -4
- package/dist/lib/neutral/context-add-2G2CDRCK.mjs.map +7 -0
- package/dist/lib/neutral/{context-remove-VCM3VPSO.mjs → context-remove-QQOT57JC.mjs} +4 -4
- package/dist/lib/neutral/context-remove-QQOT57JC.mjs.map +7 -0
- package/dist/lib/neutral/{create-project-EIF4OJMY.mjs → create-project-LVIH4OLF.mjs} +7 -7
- package/dist/lib/neutral/{delete-J3PMWP7Z.mjs → delete-MRER3QMO.mjs} +3 -3
- package/dist/lib/neutral/{enable-blueprints-LBDZH2CY.mjs → enable-blueprints-GEIKTSRV.mjs} +12 -12
- package/dist/lib/neutral/enable-blueprints-GEIKTSRV.mjs.map +7 -0
- package/dist/lib/neutral/{fetch-KHMHV7JR.mjs → fetch-B2AYJK7F.mjs} +2 -2
- package/dist/lib/neutral/{fetch-messages-QOBBCTGC.mjs → fetch-messages-RUUU63L2.mjs} +2 -2
- package/dist/lib/neutral/{get-context-TN7X7U2H.mjs → get-context-3SXNFRXG.mjs} +10 -10
- package/dist/lib/neutral/{get-context-TN7X7U2H.mjs.map → get-context-3SXNFRXG.mjs.map} +3 -3
- package/dist/lib/neutral/index.mjs +94 -97
- package/dist/lib/neutral/index.mjs.map +3 -3
- package/dist/lib/neutral/{load-ALP3TK2E.mjs → load-YWYQ4THR.mjs} +2 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{object-create-Z57Y3X6Y.mjs → object-create-WME2XFGD.mjs} +9 -12
- package/dist/lib/neutral/object-create-WME2XFGD.mjs.map +7 -0
- package/dist/lib/neutral/{object-delete-X53LS37B.mjs → object-delete-I5OAPI32.mjs} +2 -2
- package/dist/lib/neutral/{object-update-GVKSBR7T.mjs → object-update-VCOL62NX.mjs} +3 -3
- package/dist/lib/neutral/{object-update-GVKSBR7T.mjs.map → object-update-VCOL62NX.mjs.map} +2 -2
- package/dist/lib/neutral/{project-HPHTZ2CI.mjs → project-4BYI2PZC.mjs} +6 -6
- package/dist/lib/neutral/{project-rules-IVDHKSKI.mjs → project-rules-7NYDDQ7K.mjs} +5 -5
- package/dist/lib/neutral/{prompt-Y7NN7M5D.mjs → prompt-DZP2K2NE.mjs} +6 -6
- package/dist/lib/neutral/prompt-DZP2K2NE.mjs.map +7 -0
- package/dist/lib/neutral/{qualifier-VDOY5CWU.mjs → qualifier-NLOWVZCM.mjs} +15 -14
- package/dist/lib/neutral/qualifier-NLOWVZCM.mjs.map +7 -0
- package/dist/lib/neutral/{query-PPJU5622.mjs → query-GZDTQRQ6.mjs} +12 -23
- package/dist/lib/neutral/query-GZDTQRQ6.mjs.map +7 -0
- package/dist/lib/neutral/{query-U56GNEV6.mjs → query-KBKGBYUO.mjs} +3 -3
- package/dist/lib/neutral/{query-blueprints-KXADGHSA.mjs → query-blueprints-MFXXRZBY.mjs} +5 -4
- package/dist/lib/neutral/query-blueprints-MFXXRZBY.mjs.map +7 -0
- package/dist/lib/neutral/{relation-create-XJ2IX6X3.mjs → relation-create-UHBWQQXS.mjs} +8 -11
- package/dist/lib/neutral/relation-create-UHBWQQXS.mjs.map +7 -0
- package/dist/lib/neutral/{relation-delete-EP4KXAFL.mjs → relation-delete-ZSB7JOHO.mjs} +2 -2
- package/dist/lib/neutral/{save-GWAPLT3Z.mjs → save-B2CSSFDG.mjs} +3 -3
- package/dist/lib/neutral/{schema-add-Z5CY6P24.mjs → schema-add-ZJ64RAZK.mjs} +13 -12
- package/dist/lib/neutral/schema-add-ZJ64RAZK.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-3X3VNYYB.mjs +37 -0
- package/dist/lib/neutral/schema-list-3X3VNYYB.mjs.map +7 -0
- package/dist/lib/neutral/{sync-issues-4YE5XAK5.mjs → sync-issues-36TS2R7R.mjs} +5 -6
- package/dist/lib/neutral/sync-issues-36TS2R7R.mjs.map +7 -0
- package/dist/lib/neutral/{sync-triggers-CDMJVW6E.mjs → sync-triggers-MMHKQDNW.mjs} +39 -37
- package/dist/lib/neutral/sync-triggers-MMHKQDNW.mjs.map +7 -0
- package/dist/lib/neutral/{tag-add-VNIIOVJA.mjs → tag-add-7P5O3IAV.mjs} +4 -5
- package/dist/lib/neutral/tag-add-7P5O3IAV.mjs.map +7 -0
- package/dist/lib/neutral/{tag-remove-6R2R27W3.mjs → tag-remove-YZIMOFA4.mjs} +4 -5
- package/dist/lib/neutral/tag-remove-YZIMOFA4.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +9 -12
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- package/dist/lib/neutral/update-tasks-6MJCJ2KC.mjs +13 -0
- package/dist/lib/neutral/update-tasks-6MJCJ2KC.mjs.map +7 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts +12 -15
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts +7 -8
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +1 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts +6 -6
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +3 -3
- package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts +3 -3
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/definitions.d.ts +23 -17
- package/dist/types/src/blueprints/database/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/load.d.ts +2 -2
- package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts +1 -1
- package/dist/types/src/blueprints/database/functions/object-update.d.ts +2 -2
- package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/query.d.ts +2 -3
- package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts +3 -3
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +1 -1
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts +6 -3
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +6 -3
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -1
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts +2 -2
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/memory/functions/delete.d.ts +2 -2
- package/dist/types/src/blueprints/planning/functions/index.d.ts +1 -1
- package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +14 -1
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/functions/update-tasks.test.d.ts +2 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +1 -5
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/definitions.d.ts +60 -45
- package/dist/types/src/blueprints/project/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/get-context.d.ts +1 -12
- package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +3 -71
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -1
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +23 -19
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +1 -1
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +45 -38
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts +21 -17
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts.map +1 -1
- package/dist/types/src/blueprints/testing.d.ts +4 -4
- package/dist/types/src/blueprints/testing.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/functions/definitions.d.ts.map +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/definitions.d.ts +14 -23
- package/dist/types/src/functions/agent/definitions.d.ts.map +1 -1
- 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/types/Agent.d.ts +25 -24
- package/dist/types/src/types/Agent.d.ts.map +1 -1
- 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 +1 -2
- 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 +15 -17
- package/dist/types/src/types/Plan.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -31
- package/src/blueprints/automation/blueprint.ts +3 -3
- package/src/blueprints/blueprint-manager/blueprint.conversations.json +1 -1
- package/src/blueprints/blueprint-manager/blueprint.test.ts +24 -67
- package/src/blueprints/blueprint-manager/blueprint.ts +5 -5
- package/src/blueprints/blueprint-manager/functions/definitions.ts +11 -20
- package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +10 -7
- package/src/blueprints/blueprint-manager/functions/index.ts +0 -1
- package/src/blueprints/blueprint-manager/functions/query-blueprints.ts +3 -2
- package/src/blueprints/browser/blueprint.conversations.json +1 -0
- package/src/blueprints/browser/blueprint.test.ts +4 -3
- package/src/blueprints/database/blueprint.conversations.json +1 -1
- package/src/blueprints/database/blueprint.test.ts +25 -25
- package/src/blueprints/database/functions/context-add.ts +2 -2
- package/src/blueprints/database/functions/context-remove.ts +2 -2
- package/src/blueprints/database/functions/definitions.ts +54 -40
- package/src/blueprints/database/functions/object-create.ts +8 -5
- package/src/blueprints/database/functions/object-update.ts +1 -1
- package/src/blueprints/database/functions/query.ts +16 -11
- package/src/blueprints/database/functions/relation-create.ts +7 -4
- package/src/blueprints/database/functions/schema-add.ts +7 -12
- package/src/blueprints/database/functions/schema-list.ts +12 -7
- package/src/blueprints/database/functions/tag-add.ts +2 -3
- package/src/blueprints/database/functions/tag-remove.ts +2 -3
- package/src/blueprints/discord/functions/definitions.ts +3 -1
- package/src/blueprints/discord/functions/fetch-messages.test.ts +7 -2
- package/src/blueprints/github/functions/definitions.ts +3 -1
- package/src/blueprints/linear/functions/definitions.ts +3 -1
- package/src/blueprints/linear/functions/linear.test.ts +1 -2
- package/src/blueprints/linear/functions/sync-issues.ts +1 -2
- package/src/blueprints/memory/blueprint.conversations.json +1 -1
- package/src/blueprints/memory/blueprint.test.ts +2 -2
- package/src/blueprints/memory/functions/definitions.ts +7 -3
- package/src/blueprints/planning/blueprint.ts +1 -1
- package/src/blueprints/planning/functions/index.ts +1 -1
- package/src/blueprints/planning/functions/{definitions.ts → update-tasks.md} +29 -50
- package/src/blueprints/planning/functions/update-tasks.test.ts +55 -0
- package/src/blueprints/planning/functions/update-tasks.ts +27 -3
- package/src/blueprints/project/blueprint.conversations.json +1 -1
- package/src/blueprints/project/blueprint.test.ts +14 -16
- package/src/blueprints/project/blueprint.ts +1 -1
- package/src/blueprints/project/functions/add-artifact.ts +1 -0
- package/src/blueprints/project/functions/agent.ts +4 -4
- package/src/blueprints/project/functions/definitions.ts +17 -14
- package/src/blueprints/project/functions/get-context.ts +5 -4
- package/src/blueprints/project/functions/qualifier.ts +8 -7
- package/src/blueprints/project-wizard/blueprint.ts +1 -1
- package/src/blueprints/project-wizard/functions/definitions.ts +11 -8
- package/src/blueprints/project-wizard/functions/sync-triggers.ts +33 -35
- package/src/blueprints/testing.ts +10 -4
- package/src/blueprints/websearch/blueprint.conversations.json +1 -1
- package/src/blueprints/websearch/functions/definitions.ts +3 -1
- package/src/crud/graph.test.ts +1 -1
- package/src/crud/graph.ts +143 -153
- package/src/errors.ts +3 -3
- package/src/functions/agent/definitions.ts +5 -3
- package/src/functions/agent/prompt.conversations.json +1 -1
- package/src/functions/agent/prompt.test.ts +10 -13
- package/src/functions/agent/prompt.ts +3 -3
- package/src/sync/sync.ts +7 -6
- package/src/testing/plugins.tsx +10 -15
- package/src/types/Agent.ts +27 -35
- package/src/types/Chat.ts +10 -20
- package/src/types/McpServer.ts +4 -10
- package/src/types/Memory.ts +4 -7
- package/src/types/Plan.ts +4 -11
- package/dist/lib/neutral/chunk-246ACKSH.mjs.map +0 -7
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-FIGO6CA6.mjs +0 -140
- package/dist/lib/neutral/chunk-FIGO6CA6.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GV66MKAQ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-IKBIORQX.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-P4ZMYO4K.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ROMZO4CB.mjs.map +0 -7
- package/dist/lib/neutral/chunk-TO5IX24K.mjs.map +0 -7
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs.map +0 -7
- package/dist/lib/neutral/chunk-XUF53B6B.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs.map +0 -7
- package/dist/lib/neutral/context-add-VB7AOY3G.mjs.map +0 -7
- package/dist/lib/neutral/context-remove-VCM3VPSO.mjs.map +0 -7
- package/dist/lib/neutral/enable-blueprints-LBDZH2CY.mjs.map +0 -7
- package/dist/lib/neutral/object-create-Z57Y3X6Y.mjs.map +0 -7
- package/dist/lib/neutral/prompt-Y7NN7M5D.mjs.map +0 -7
- package/dist/lib/neutral/qualifier-VDOY5CWU.mjs.map +0 -7
- package/dist/lib/neutral/query-PPJU5622.mjs.map +0 -7
- package/dist/lib/neutral/query-blueprints-KXADGHSA.mjs.map +0 -7
- package/dist/lib/neutral/relation-create-XJ2IX6X3.mjs.map +0 -7
- package/dist/lib/neutral/schema-add-Z5CY6P24.mjs.map +0 -7
- package/dist/lib/neutral/schema-list-W326VPVX.mjs +0 -38
- package/dist/lib/neutral/schema-list-W326VPVX.mjs.map +0 -7
- package/dist/lib/neutral/sync-issues-4YE5XAK5.mjs.map +0 -7
- package/dist/lib/neutral/sync-triggers-CDMJVW6E.mjs.map +0 -7
- package/dist/lib/neutral/tag-add-VNIIOVJA.mjs.map +0 -7
- package/dist/lib/neutral/tag-remove-6R2R27W3.mjs.map +0 -7
- package/dist/lib/neutral/update-blueprints-N2AK2VUR.mjs +0 -16
- package/dist/lib/neutral/update-blueprints-N2AK2VUR.mjs.map +0 -7
- package/dist/lib/neutral/update-tasks-H7SWIFQL.mjs +0 -46
- package/dist/lib/neutral/update-tasks-H7SWIFQL.mjs.map +0 -7
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +0 -4
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.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/src/blueprints/blueprint-manager/functions/update-blueprints.ts +0 -18
- /package/dist/lib/neutral/{create-project-EIF4OJMY.mjs.map → create-project-LVIH4OLF.mjs.map} +0 -0
- /package/dist/lib/neutral/{delete-J3PMWP7Z.mjs.map → delete-MRER3QMO.mjs.map} +0 -0
- /package/dist/lib/neutral/{fetch-KHMHV7JR.mjs.map → fetch-B2AYJK7F.mjs.map} +0 -0
- /package/dist/lib/neutral/{fetch-messages-QOBBCTGC.mjs.map → fetch-messages-RUUU63L2.mjs.map} +0 -0
- /package/dist/lib/neutral/{load-ALP3TK2E.mjs.map → load-YWYQ4THR.mjs.map} +0 -0
- /package/dist/lib/neutral/{object-delete-X53LS37B.mjs.map → object-delete-I5OAPI32.mjs.map} +0 -0
- /package/dist/lib/neutral/{project-HPHTZ2CI.mjs.map → project-4BYI2PZC.mjs.map} +0 -0
- /package/dist/lib/neutral/{project-rules-IVDHKSKI.mjs.map → project-rules-7NYDDQ7K.mjs.map} +0 -0
- /package/dist/lib/neutral/{query-U56GNEV6.mjs.map → query-KBKGBYUO.mjs.map} +0 -0
- /package/dist/lib/neutral/{relation-delete-EP4KXAFL.mjs.map → relation-delete-ZSB7JOHO.mjs.map} +0 -0
- /package/dist/lib/neutral/{save-GWAPLT3Z.mjs.map → save-B2CSSFDG.mjs.map} +0 -0
|
@@ -6,11 +6,11 @@ import { describe, expect, it } from '@effect/vitest';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
8
|
import { Blueprint, Operation } from '@dxos/compute';
|
|
9
|
-
import { Database, Entity, Feed, Filter, Obj, Query, Ref, Relation, Tag } from '@dxos/echo';
|
|
9
|
+
import { Database, Entity, Feed, Filter, Obj, Query, Ref, Relation, Scope, Tag, Type } from '@dxos/echo';
|
|
10
10
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
11
|
import { AgentService } from '@dxos/functions-runtime';
|
|
12
12
|
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
13
|
-
import {
|
|
13
|
+
import { EID, EntityId } from '@dxos/keys';
|
|
14
14
|
import { Employer, Organization, Person } from '@dxos/types';
|
|
15
15
|
import { trim } from '@dxos/util';
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ import DatabaseBlueprint from './blueprint';
|
|
|
18
18
|
import { DatabaseHandlers } from './functions';
|
|
19
19
|
import { Query as DatabaseQueryOperation } from './functions/definitions';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
EntityId.dangerouslyDisableRandomness();
|
|
22
22
|
|
|
23
23
|
const TestLayer = AssistantTestLayer({
|
|
24
24
|
operationHandlers: DatabaseHandlers,
|
|
@@ -60,10 +60,10 @@ describe('Database Blueprint', () => {
|
|
|
60
60
|
'Add a new schema called "Project" with typename "com.example.type.project" and fields: name (string), description (string), and status (string).',
|
|
61
61
|
);
|
|
62
62
|
yield* agent.waitForCompletion();
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const allTypes = yield* Database.runQuery(
|
|
64
|
+
Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
65
|
+
);
|
|
66
|
+
const schemas = allTypes.filter((t) => Type.getTypename(t) === 'com.example.type.project');
|
|
67
67
|
expect(schemas.length).toBeGreaterThanOrEqual(1);
|
|
68
68
|
},
|
|
69
69
|
Effect.provide(TestLayer),
|
|
@@ -185,8 +185,8 @@ describe('Database Blueprint', () => {
|
|
|
185
185
|
const org = yield* Database.add(
|
|
186
186
|
Obj.make(Organization.Organization, { name: 'Detail Corp', description: 'A detailed organization.' }),
|
|
187
187
|
);
|
|
188
|
-
const
|
|
189
|
-
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?`);
|
|
190
190
|
yield* agent.waitForCompletion();
|
|
191
191
|
},
|
|
192
192
|
Effect.provide(TestLayer),
|
|
@@ -237,8 +237,8 @@ describe('Database Blueprint', () => {
|
|
|
237
237
|
role: 'Director',
|
|
238
238
|
}),
|
|
239
239
|
);
|
|
240
|
-
const
|
|
241
|
-
yield* agent.submitPrompt(`Delete the relation ${
|
|
240
|
+
const relationUri = Relation.getURI(relation);
|
|
241
|
+
yield* agent.submitPrompt(`Delete the relation ${relationUri}.`);
|
|
242
242
|
yield* agent.waitForCompletion();
|
|
243
243
|
expect(Relation.isDeleted(relation)).toBe(true);
|
|
244
244
|
},
|
|
@@ -263,9 +263,10 @@ describe('Database Blueprint', () => {
|
|
|
263
263
|
const tag = yield* Database.add(Tag.make({ label: 'important' }));
|
|
264
264
|
yield* agent.submitPrompt(`Add tag "important" to the organization "Tagged Corp".`);
|
|
265
265
|
yield* agent.waitForCompletion();
|
|
266
|
-
|
|
267
|
-
//
|
|
268
|
-
|
|
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);
|
|
269
270
|
},
|
|
270
271
|
Effect.provide(TestLayer),
|
|
271
272
|
TestHelpers.provideTestContext,
|
|
@@ -282,14 +283,13 @@ describe('Database Blueprint', () => {
|
|
|
282
283
|
});
|
|
283
284
|
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Untagged Corp' }));
|
|
284
285
|
const tag = yield* Database.add(Tag.make({ label: 'obsolete' }));
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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);
|
|
288
290
|
yield* agent.submitPrompt(`Remove tag "obsolete" from the organization "Untagged Corp".`);
|
|
289
291
|
yield* agent.waitForCompletion();
|
|
290
|
-
|
|
291
|
-
// TODO(dmaretskyi): matcher doesnt work with echo proxies.
|
|
292
|
-
expect([...tags]).not.toContain(tagDxn);
|
|
292
|
+
expect(taggedIds()).not.toContain(tag.id);
|
|
293
293
|
},
|
|
294
294
|
Effect.provide(TestLayer),
|
|
295
295
|
TestHelpers.provideTestContext,
|
|
@@ -329,13 +329,13 @@ describe('Database Blueprint', () => {
|
|
|
329
329
|
});
|
|
330
330
|
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Remove Context Corp' }));
|
|
331
331
|
const { db } = yield* Database.Service;
|
|
332
|
-
const ref = db.makeRef(Obj.
|
|
332
|
+
const ref = db.makeRef(Obj.getURI(org)) as Ref.Ref<any>;
|
|
333
333
|
yield* agent.addContext([ref]);
|
|
334
|
-
const
|
|
334
|
+
const uri = Obj.getURI(org);
|
|
335
335
|
yield* agent.submitPrompt(`Remove the organization "Remove Context Corp" from the chat context.`);
|
|
336
336
|
yield* agent.waitForCompletion();
|
|
337
337
|
const contextRefs = yield* agent.getContext();
|
|
338
|
-
const found = contextRefs.find((contextRef) => contextRef.
|
|
338
|
+
const found = contextRefs.find((contextRef) => contextRef.uri === uri);
|
|
339
339
|
expect(found).toBeUndefined();
|
|
340
340
|
},
|
|
341
341
|
Effect.provide(TestLayer),
|
|
@@ -517,8 +517,8 @@ describe('Database Blueprint', () => {
|
|
|
517
517
|
`Call query tool with precisely ${JSON.stringify({
|
|
518
518
|
includeContent: false,
|
|
519
519
|
limit: 10,
|
|
520
|
-
typename: Organization.Organization
|
|
521
|
-
in: [Obj.
|
|
520
|
+
typename: Type.getTypename(Organization.Organization),
|
|
521
|
+
in: [Obj.getURI(feed1)],
|
|
522
522
|
})}`,
|
|
523
523
|
);
|
|
524
524
|
yield* agent.waitForCompletion();
|
|
@@ -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
|
|
@@ -101,18 +103,19 @@ export const Query = Operation.make({
|
|
|
101
103
|
}),
|
|
102
104
|
output: Schema.Array(Schema.Unknown),
|
|
103
105
|
services: [Database.Service],
|
|
104
|
-
})
|
|
106
|
+
});
|
|
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
|
},
|
|
@@ -121,17 +124,18 @@ export const Load = Operation.make({
|
|
|
121
124
|
}),
|
|
122
125
|
output: Schema.Unknown,
|
|
123
126
|
services: [Database.Service],
|
|
124
|
-
})
|
|
127
|
+
});
|
|
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({
|
|
@@ -140,16 +144,17 @@ export const ObjectCreate = Operation.make({
|
|
|
140
144
|
}),
|
|
141
145
|
output: Schema.Unknown,
|
|
142
146
|
services: [Database.Service],
|
|
143
|
-
})
|
|
147
|
+
});
|
|
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({
|
|
@@ -158,27 +163,29 @@ export const ObjectUpdate = Operation.make({
|
|
|
158
163
|
}),
|
|
159
164
|
output: Schema.Unknown,
|
|
160
165
|
services: [Database.Service],
|
|
161
|
-
})
|
|
166
|
+
});
|
|
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),
|
|
173
179
|
}),
|
|
174
180
|
output: Schema.Void,
|
|
175
181
|
services: [Database.Service],
|
|
176
|
-
})
|
|
182
|
+
});
|
|
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.
|
|
@@ -193,12 +200,13 @@ export const SchemaAdd = Operation.make({
|
|
|
193
200
|
}),
|
|
194
201
|
output: Schema.Void,
|
|
195
202
|
services: [Database.Service],
|
|
196
|
-
})
|
|
203
|
+
});
|
|
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
|
`,
|
|
@@ -208,12 +216,13 @@ export const SchemaList = Operation.make({
|
|
|
208
216
|
}),
|
|
209
217
|
output: Schema.Array(Schema.Unknown),
|
|
210
218
|
services: [Database.Service],
|
|
211
|
-
})
|
|
219
|
+
});
|
|
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: [
|
|
229
|
-
})
|
|
237
|
+
services: [AiContext.Service],
|
|
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: [
|
|
247
|
-
})
|
|
256
|
+
services: [AiContext.Service],
|
|
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.
|
|
@@ -265,54 +276,57 @@ export const RelationCreate = Operation.make({
|
|
|
265
276
|
}),
|
|
266
277
|
output: Schema.Unknown,
|
|
267
278
|
services: [Database.Service],
|
|
268
|
-
})
|
|
279
|
+
});
|
|
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),
|
|
280
292
|
}),
|
|
281
293
|
output: Schema.Void,
|
|
282
294
|
services: [Database.Service],
|
|
283
|
-
})
|
|
295
|
+
});
|
|
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,
|
|
300
313
|
services: [Database.Service],
|
|
301
|
-
})
|
|
314
|
+
});
|
|
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,
|
|
317
331
|
services: [Database.Service],
|
|
318
|
-
})
|
|
332
|
+
});
|
|
@@ -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,20 @@ 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
|
-
|
|
19
|
+
const types = yield* Database.runQuery(
|
|
20
|
+
Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
21
21
|
);
|
|
22
|
-
|
|
22
|
+
const foundSchema = types.find((t) => Type.getTypename(t) === typename);
|
|
23
|
+
invariant(foundSchema, `Schema not found: ${typename}`);
|
|
24
|
+
invariant(Type.isObject(foundSchema), 'Schema is not an object schema');
|
|
25
|
+
const schema = foundSchema;
|
|
23
26
|
|
|
24
27
|
const object = db.add(
|
|
25
28
|
Obj.make(
|
|
26
29
|
schema,
|
|
27
30
|
deepMapValues(data, (value, recurse) => {
|
|
28
31
|
if (EncodedReference.isEncodedReference(value)) {
|
|
29
|
-
return db.makeRef(EncodedReference.
|
|
32
|
+
return db.makeRef(EncodedReference.toURI(value));
|
|
30
33
|
}
|
|
31
34
|
return recurse(value);
|
|
32
35
|
}),
|
|
@@ -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.runQuery(
|
|
24
|
+
EchoQuery.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
25
|
+
);
|
|
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.runQuery(
|
|
34
|
+
EchoQuery.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
35
|
+
);
|
|
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,8 +48,8 @@ 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
|
|
|
@@ -54,7 +59,7 @@ export default Query.pipe(
|
|
|
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,13 @@ 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
|
-
|
|
17
|
+
const types = yield* Database.runQuery(
|
|
18
|
+
Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
19
19
|
);
|
|
20
|
-
|
|
20
|
+
const foundSchema = types.find((t) => Type.getTypename(t) === typename);
|
|
21
|
+
invariant(foundSchema, `Schema not found: ${typename}`);
|
|
22
|
+
invariant(Type.isRelation(foundSchema), 'Schema is not a relation schema');
|
|
23
|
+
const schema = foundSchema;
|
|
21
24
|
|
|
22
25
|
const sourceObj = yield* Database.load(source);
|
|
23
26
|
const targetObj = yield* Database.load(target);
|
|
@@ -5,24 +5,19 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Operation } from '@dxos/compute';
|
|
8
|
-
import { Database } from '@dxos/echo';
|
|
8
|
+
import { Database, Type } from '@dxos/echo';
|
|
9
9
|
|
|
10
10
|
import { SchemaAdd } from './definitions';
|
|
11
11
|
|
|
12
12
|
export default SchemaAdd.pipe(
|
|
13
13
|
Operation.withHandler(
|
|
14
14
|
Effect.fn(function* ({ name, typename, jsonSchema }) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
jsonSchema,
|
|
22
|
-
name,
|
|
23
|
-
},
|
|
24
|
-
]),
|
|
25
|
-
);
|
|
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
|
+
}
|
|
26
21
|
}),
|
|
27
22
|
),
|
|
28
23
|
);
|
|
@@ -5,27 +5,32 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Routine, Blueprint, Operation } from '@dxos/compute';
|
|
8
|
-
import { Database, Feed, JsonSchema, Type, View } from '@dxos/echo';
|
|
8
|
+
import { Database, Feed, Filter, JsonSchema, Query, Scope, Type, View } from '@dxos/echo';
|
|
9
9
|
|
|
10
10
|
import { SchemaList } from './definitions';
|
|
11
11
|
|
|
12
12
|
// TODO(dmaretskyi): This is a balance between not filling the agent's context with too many types and not excluding important types.
|
|
13
|
-
const EXCLUDED_TYPES = [Type.
|
|
13
|
+
const EXCLUDED_TYPES = [Type.Type, View.View, Routine.Routine, Blueprint.Blueprint, Feed.Feed];
|
|
14
14
|
const excludedTypenames = EXCLUDED_TYPES.map((type) => Type.getTypename(type));
|
|
15
15
|
|
|
16
16
|
export default SchemaList.pipe(
|
|
17
17
|
Operation.withHandler(
|
|
18
18
|
Effect.fn(function* () {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const types = yield* Database.runQuery(
|
|
20
|
+
Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()),
|
|
21
|
+
);
|
|
22
|
+
return [...types]
|
|
22
23
|
.filter((schema) => !excludedTypenames.includes(Type.getTypename(schema)))
|
|
24
|
+
.sort((a, b) => {
|
|
25
|
+
const aKey = `${Type.getTypename(a)}:${Type.getVersion(a)}`;
|
|
26
|
+
const bKey = `${Type.getTypename(b)}:${Type.getVersion(b)}`;
|
|
27
|
+
return aKey.localeCompare(bKey);
|
|
28
|
+
})
|
|
23
29
|
.map((schema) => {
|
|
24
|
-
const meta = Type.getMeta(schema);
|
|
25
30
|
return {
|
|
26
31
|
typename: Type.getTypename(schema),
|
|
27
32
|
jsonSchema: JsonSchema.toJsonSchema(schema),
|
|
28
|
-
kind:
|
|
33
|
+
kind: Type.isRelation(schema) ? 'relation' : 'record',
|
|
29
34
|
};
|
|
30
35
|
});
|
|
31
36
|
}),
|
|
@@ -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
|
|
8
|
+
import { Database, Entity } from '@dxos/echo';
|
|
9
9
|
|
|
10
10
|
import { TagAdd } from './definitions';
|
|
11
11
|
|
|
@@ -13,8 +13,7 @@ export default TagAdd.pipe(
|
|
|
13
13
|
Operation.withHandler(
|
|
14
14
|
Effect.fn(function* ({ tag, obj }) {
|
|
15
15
|
const object = yield* Database.load(obj);
|
|
16
|
-
|
|
17
|
-
Entity.update(object, (object) => Entity.addTag(object, Obj.getDXN(tagObj).toString()));
|
|
16
|
+
Entity.update(object, (object) => Entity.addTag(object, tag));
|
|
18
17
|
return Entity.toJSON(object);
|
|
19
18
|
}),
|
|
20
19
|
),
|