@dxos/assistant-toolkit 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29
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/dist/lib/neutral/add-artifact-ZUJ5DMSY.mjs +30 -0
- package/dist/lib/neutral/add-artifact-ZUJ5DMSY.mjs.map +7 -0
- package/dist/lib/neutral/agent-5NIKAYUK.mjs +65 -0
- package/dist/lib/neutral/agent-5NIKAYUK.mjs.map +7 -0
- package/dist/lib/neutral/chunk-246ACKSH.mjs +100 -0
- package/dist/lib/neutral/chunk-246ACKSH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs +73 -0
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FIGO6CA6.mjs +140 -0
- package/dist/lib/neutral/chunk-FIGO6CA6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GV66MKAQ.mjs +60 -0
- package/dist/lib/neutral/chunk-GV66MKAQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IKBIORQX.mjs +332 -0
- package/dist/lib/neutral/chunk-IKBIORQX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KGU725LW.mjs +29 -0
- package/dist/lib/neutral/chunk-KGU725LW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NR3GTWRC.mjs +53 -0
- package/dist/lib/neutral/chunk-NR3GTWRC.mjs.map +7 -0
- package/dist/lib/neutral/chunk-P4ZMYO4K.mjs +294 -0
- package/dist/lib/neutral/chunk-P4ZMYO4K.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QO5SU37C.mjs +70 -0
- package/dist/lib/neutral/chunk-QO5SU37C.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ROMZO4CB.mjs +108 -0
- package/dist/lib/neutral/chunk-ROMZO4CB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TO5IX24K.mjs +67 -0
- package/dist/lib/neutral/chunk-TO5IX24K.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs +25 -0
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XUF53B6B.mjs +75 -0
- package/dist/lib/neutral/chunk-XUF53B6B.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs +73 -0
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs.map +7 -0
- package/dist/lib/neutral/context-add-VB7AOY3G.mjs +22 -0
- package/dist/lib/neutral/context-add-VB7AOY3G.mjs.map +7 -0
- package/dist/lib/neutral/context-remove-VCM3VPSO.mjs +22 -0
- package/dist/lib/neutral/context-remove-VCM3VPSO.mjs.map +7 -0
- package/dist/lib/neutral/create-project-EIF4OJMY.mjs +35 -0
- package/dist/lib/neutral/create-project-EIF4OJMY.mjs.map +7 -0
- package/dist/lib/neutral/delete-J3PMWP7Z.mjs +19 -0
- package/dist/lib/neutral/delete-J3PMWP7Z.mjs.map +7 -0
- package/dist/lib/neutral/enable-blueprints-LBDZH2CY.mjs +47 -0
- package/dist/lib/neutral/enable-blueprints-LBDZH2CY.mjs.map +7 -0
- package/dist/lib/neutral/fetch-KHMHV7JR.mjs +16 -0
- package/dist/lib/neutral/fetch-KHMHV7JR.mjs.map +7 -0
- package/dist/lib/neutral/fetch-messages-QOBBCTGC.mjs +139 -0
- package/dist/lib/neutral/fetch-messages-QOBBCTGC.mjs.map +7 -0
- package/dist/lib/neutral/get-context-TN7X7U2H.mjs +35 -0
- package/dist/lib/neutral/get-context-TN7X7U2H.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +581 -3293
- package/dist/lib/neutral/index.mjs.map +4 -4
- package/dist/lib/neutral/load-ALP3TK2E.mjs +17 -0
- package/dist/lib/neutral/load-ALP3TK2E.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/object-create-Z57Y3X6Y.mjs +35 -0
- package/dist/lib/neutral/object-create-Z57Y3X6Y.mjs.map +7 -0
- package/dist/lib/neutral/object-delete-X53LS37B.mjs +18 -0
- package/dist/lib/neutral/object-delete-X53LS37B.mjs.map +7 -0
- package/dist/lib/neutral/object-update-GVKSBR7T.mjs +28 -0
- package/dist/lib/neutral/object-update-GVKSBR7T.mjs.map +7 -0
- package/dist/lib/neutral/project-HPHTZ2CI.mjs +23 -0
- package/dist/lib/neutral/project-HPHTZ2CI.mjs.map +7 -0
- package/dist/lib/neutral/project-rules-IVDHKSKI.mjs +78 -0
- package/dist/lib/neutral/project-rules-IVDHKSKI.mjs.map +7 -0
- package/dist/lib/neutral/prompt-Y7NN7M5D.mjs +170 -0
- package/dist/lib/neutral/prompt-Y7NN7M5D.mjs.map +7 -0
- package/dist/lib/neutral/qualifier-VDOY5CWU.mjs +88 -0
- package/dist/lib/neutral/qualifier-VDOY5CWU.mjs.map +7 -0
- package/dist/lib/neutral/query-PPJU5622.mjs +70 -0
- package/dist/lib/neutral/query-PPJU5622.mjs.map +7 -0
- package/dist/lib/neutral/query-U56GNEV6.mjs +32 -0
- package/dist/lib/neutral/query-U56GNEV6.mjs.map +7 -0
- package/dist/lib/neutral/query-blueprints-KXADGHSA.mjs +16 -0
- package/dist/lib/neutral/query-blueprints-KXADGHSA.mjs.map +7 -0
- package/dist/lib/neutral/relation-create-XJ2IX6X3.mjs +34 -0
- package/dist/lib/neutral/relation-create-XJ2IX6X3.mjs.map +7 -0
- package/dist/lib/neutral/relation-delete-EP4KXAFL.mjs +18 -0
- package/dist/lib/neutral/relation-delete-EP4KXAFL.mjs.map +7 -0
- package/dist/lib/neutral/save-GWAPLT3Z.mjs +23 -0
- package/dist/lib/neutral/save-GWAPLT3Z.mjs.map +7 -0
- package/dist/lib/neutral/schema-add-Z5CY6P24.mjs +24 -0
- package/dist/lib/neutral/schema-add-Z5CY6P24.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-W326VPVX.mjs +38 -0
- package/dist/lib/neutral/schema-list-W326VPVX.mjs.map +7 -0
- package/dist/lib/neutral/sync-issues-4YE5XAK5.mjs +167 -0
- package/dist/lib/neutral/sync-issues-4YE5XAK5.mjs.map +7 -0
- package/dist/lib/neutral/sync-triggers-CDMJVW6E.mjs +136 -0
- package/dist/lib/neutral/sync-triggers-CDMJVW6E.mjs.map +7 -0
- package/dist/lib/neutral/tag-add-VNIIOVJA.mjs +19 -0
- package/dist/lib/neutral/tag-add-VNIIOVJA.mjs.map +7 -0
- package/dist/lib/neutral/tag-remove-6R2R27W3.mjs +19 -0
- package/dist/lib/neutral/tag-remove-6R2R27W3.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +9 -14
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- package/dist/lib/neutral/update-blueprints-N2AK2VUR.mjs +16 -0
- package/dist/lib/neutral/update-blueprints-N2AK2VUR.mjs.map +7 -0
- package/dist/lib/neutral/update-tasks-H7SWIFQL.mjs +46 -0
- package/dist/lib/neutral/update-tasks-H7SWIFQL.mjs.map +7 -0
- package/dist/types/src/blueprints/automation/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/automation/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/automation/index.d.ts +2 -0
- package/dist/types/src/blueprints/automation/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts +63 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts +37 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts +28 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts +3 -0
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/browser/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/database/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +5 -4
- 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 +5 -4
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/definitions.d.ts +59 -0
- package/dist/types/src/blueprints/database/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/index.d.ts +3 -56
- package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/load.d.ts +5 -4
- package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/object-create.d.ts +5 -3
- 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 +5 -4
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/object-update.d.ts +5 -4
- package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/query.d.ts +7 -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 +6 -5
- 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 +5 -4
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts +4 -2
- 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 +4 -2
- 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 +4 -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 +4 -3
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -1
- 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/discord/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/discord/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/functions/definitions.d.ts +15 -0
- package/dist/types/src/blueprints/discord/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts +3 -2
- package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/functions/index.d.ts +3 -11
- package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/index.d.ts +1 -0
- package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/functions/definitions.d.ts +7 -0
- package/dist/types/src/blueprints/github/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts +4 -2
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/functions/index.d.ts +3 -6
- package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/index.d.ts +1 -0
- package/dist/types/src/blueprints/github/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +4 -3
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/linear/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts +6 -0
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/index.d.ts +3 -8
- package/dist/types/src/blueprints/linear/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts +4 -6
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/index.d.ts +1 -0
- package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/memory/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/memory/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts +17 -0
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/delete.d.ts +10 -0
- package/dist/types/src/blueprints/memory/functions/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/memory/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/query.d.ts +8 -0
- package/dist/types/src/blueprints/memory/functions/query.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/save.d.ts +8 -0
- package/dist/types/src/blueprints/memory/functions/save.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/index.d.ts +3 -0
- package/dist/types/src/blueprints/memory/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/planning/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts +11 -0
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/functions/index.d.ts +3 -9
- package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +5 -3
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/index.d.ts +1 -0
- package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/project/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +4 -3
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/agent.d.ts +2 -60
- package/dist/types/src/blueprints/project/functions/agent.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/definitions.d.ts +158 -0
- package/dist/types/src/blueprints/project/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/get-context.d.ts +6 -4
- package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/index.d.ts +3 -132
- package/dist/types/src/blueprints/project/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +30 -17
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/index.d.ts +2 -2
- package/dist/types/src/blueprints/project/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/project-wizard/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/project-wizard/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +51 -0
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +96 -0
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/project-wizard/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts +4 -0
- package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts +48 -0
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/index.d.ts +3 -0
- package/dist/types/src/blueprints/project-wizard/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/testing.d.ts +5 -15
- package/dist/types/src/blueprints/testing.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/websearch/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/functions/definitions.d.ts +5 -0
- package/dist/types/src/blueprints/websearch/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/functions/fetch.d.ts +6 -0
- package/dist/types/src/blueprints/websearch/functions/fetch.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/websearch/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/index.d.ts +2 -1
- package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/toolkit.d.ts +2 -0
- package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -1
- package/dist/types/src/crud/graph.d.ts +1 -1
- package/dist/types/src/crud/graph.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +41 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/functions/agent/definitions.d.ts +62 -0
- package/dist/types/src/functions/agent/definitions.d.ts.map +1 -0
- package/dist/types/src/functions/agent/index.d.ts +3 -84
- package/dist/types/src/functions/agent/index.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.d.ts +2 -82
- package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.test.d.ts +2 -0
- package/dist/types/src/functions/agent/prompt.test.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +0 -2
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/sync/sync.d.ts.map +1 -1
- package/dist/types/src/testing/plugins.d.ts.map +1 -1
- package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -1
- package/dist/types/src/types/Agent.d.ts +77 -0
- package/dist/types/src/types/Agent.d.ts.map +1 -0
- package/dist/types/src/types/Chat.d.ts +32 -7
- package/dist/types/src/types/Chat.d.ts.map +1 -1
- package/dist/types/src/types/McpServer.d.ts +21 -0
- package/dist/types/src/types/McpServer.d.ts.map +1 -0
- package/dist/types/src/types/Memory.d.ts +12 -0
- package/dist/types/src/types/Memory.d.ts.map +1 -0
- package/dist/types/src/types/Plan.d.ts +23 -11
- package/dist/types/src/types/Plan.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/graphql.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -31
- package/src/blueprints/automation/blueprint.ts +105 -0
- package/src/blueprints/automation/index.ts +5 -0
- package/src/blueprints/blueprint-manager/blueprint.conversations.json +1 -0
- package/src/blueprints/blueprint-manager/blueprint.test.ts +198 -0
- package/src/blueprints/blueprint-manager/blueprint.ts +49 -0
- package/src/blueprints/blueprint-manager/functions/definitions.ts +57 -0
- package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +43 -0
- package/src/blueprints/blueprint-manager/functions/index.ts +13 -0
- package/src/blueprints/blueprint-manager/functions/query-blueprints.ts +18 -0
- package/src/blueprints/blueprint-manager/functions/update-blueprints.ts +18 -0
- package/src/blueprints/blueprint-manager/index.ts +6 -0
- package/src/blueprints/browser/blueprint.test.ts +23 -32
- package/src/blueprints/browser/blueprint.ts +5 -6
- package/src/blueprints/database/blueprint.conversations.json +1 -1
- package/src/blueprints/database/blueprint.test.ts +308 -98
- package/src/blueprints/database/blueprint.ts +37 -10
- package/src/blueprints/database/functions/context-add.ts +15 -26
- package/src/blueprints/database/functions/context-remove.ts +16 -27
- package/src/blueprints/database/functions/definitions.ts +318 -0
- package/src/blueprints/database/functions/index.ts +18 -28
- package/src/blueprints/database/functions/load.ts +11 -23
- package/src/blueprints/database/functions/object-create.ts +28 -25
- package/src/blueprints/database/functions/object-delete.ts +13 -20
- package/src/blueprints/database/functions/object-update.ts +23 -25
- package/src/blueprints/database/functions/query.ts +48 -110
- package/src/blueprints/database/functions/relation-create.ts +25 -38
- package/src/blueprints/database/functions/relation-delete.ts +14 -21
- package/src/blueprints/database/functions/schema-add.ts +19 -31
- package/src/blueprints/database/functions/schema-list.ts +26 -27
- package/src/blueprints/database/functions/tag-add.ts +14 -24
- package/src/blueprints/database/functions/tag-remove.ts +14 -23
- package/src/blueprints/database/index.ts +16 -1
- package/src/blueprints/discord/blueprint.ts +6 -11
- package/src/blueprints/discord/functions/definitions.ts +70 -0
- package/src/blueprints/discord/functions/fetch-messages.test.ts +15 -25
- package/src/blueprints/discord/functions/fetch-messages.ts +98 -152
- package/src/blueprints/discord/functions/index.ts +4 -4
- package/src/blueprints/discord/index.ts +1 -0
- package/src/blueprints/github/functions/definitions.ts +26 -0
- package/src/blueprints/github/functions/fetch-prs.ts +15 -22
- package/src/blueprints/github/functions/index.ts +4 -4
- package/src/blueprints/github/index.ts +2 -0
- package/src/blueprints/index.ts +4 -3
- package/src/blueprints/linear/blueprint.ts +6 -11
- package/src/blueprints/linear/functions/definitions.ts +23 -0
- package/src/blueprints/linear/functions/index.ts +4 -4
- package/src/blueprints/linear/functions/linear.test.ts +7 -7
- package/src/blueprints/linear/functions/sync-issues.ts +31 -39
- package/src/blueprints/linear/index.ts +1 -0
- package/src/blueprints/memory/blueprint.conversations.json +1 -0
- package/src/blueprints/memory/blueprint.test.ts +139 -0
- package/src/blueprints/memory/blueprint.ts +41 -0
- package/src/blueprints/memory/functions/definitions.ts +68 -0
- package/src/blueprints/memory/functions/delete.ts +20 -0
- package/src/blueprints/memory/functions/index.ts +13 -0
- package/src/blueprints/memory/functions/query.ts +32 -0
- package/src/blueprints/memory/functions/save.ts +20 -0
- package/src/blueprints/memory/index.ts +6 -0
- package/src/blueprints/planning/blueprint.ts +5 -9
- package/src/blueprints/planning/functions/definitions.ts +137 -0
- package/src/blueprints/planning/functions/index.ts +4 -4
- package/src/blueprints/planning/functions/update-tasks.ts +35 -158
- package/src/blueprints/planning/index.ts +1 -0
- package/src/blueprints/project/blueprint.conversations.json +1 -0
- package/src/blueprints/project/blueprint.test.ts +246 -111
- package/src/blueprints/project/blueprint.ts +21 -25
- package/src/blueprints/project/functions/add-artifact.ts +19 -30
- package/src/blueprints/project/functions/agent.ts +43 -46
- package/src/blueprints/project/functions/definitions.ts +92 -0
- package/src/blueprints/project/functions/get-context.ts +36 -53
- package/src/blueprints/project/functions/index.ts +9 -10
- package/src/blueprints/project/functions/qualifier.ts +66 -72
- package/src/blueprints/project/index.ts +2 -2
- package/src/blueprints/project-wizard/blueprint.ts +52 -0
- package/src/blueprints/project-wizard/functions/create-project.ts +32 -0
- package/src/blueprints/project-wizard/functions/definitions.ts +63 -0
- package/src/blueprints/project-wizard/functions/index.ts +13 -0
- package/src/blueprints/project-wizard/functions/project-rules.ts +77 -0
- package/src/blueprints/project-wizard/functions/sync-triggers.ts +158 -0
- package/src/blueprints/project-wizard/index.ts +6 -0
- package/src/blueprints/testing.ts +7 -23
- package/src/blueprints/websearch/blueprint.conversations.json +1 -0
- package/src/blueprints/websearch/blueprint.test.ts +39 -0
- package/src/blueprints/websearch/blueprint.ts +6 -8
- package/src/blueprints/websearch/functions/definitions.ts +25 -0
- package/src/blueprints/websearch/functions/fetch.ts +18 -0
- package/src/blueprints/websearch/functions/index.ts +9 -0
- package/src/blueprints/websearch/index.ts +2 -1
- package/src/blueprints/websearch/toolkit.ts +6 -1
- package/src/crud/graph.test.ts +10 -12
- package/src/crud/graph.ts +2 -2
- package/src/errors.ts +25 -0
- package/src/functions/agent/definitions.ts +56 -0
- package/src/functions/agent/index.ts +4 -4
- package/src/functions/agent/prompt.conversations.json +1 -0
- package/src/functions/agent/prompt.test.ts +81 -0
- package/src/functions/agent/prompt.ts +212 -96
- package/src/functions/index.ts +0 -2
- package/src/sync/sync.ts +23 -12
- package/src/testing/plugins.tsx +10 -3
- package/src/toolkits/WebToolkit.ts +1 -1
- package/src/types/Agent.ts +240 -0
- package/src/types/Chat.ts +24 -10
- package/src/types/McpServer.ts +37 -0
- package/src/types/Memory.ts +24 -0
- package/src/types/Plan.ts +7 -4
- package/src/types/index.ts +3 -1
- package/dist/types/src/blueprints/design/blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/design/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/index.d.ts +0 -2
- package/dist/types/src/blueprints/design/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/markdown/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/functions/create.d.ts +0 -6
- package/dist/types/src/blueprints/markdown/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/functions/index.d.ts +0 -30
- package/dist/types/src/blueprints/markdown/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/functions/read.d.ts +0 -14
- package/dist/types/src/blueprints/markdown/functions/read.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/functions/update.d.ts +0 -13
- package/dist/types/src/blueprints/markdown/functions/update.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/index.d.ts +0 -3
- package/dist/types/src/blueprints/markdown/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/planning-old/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/index.d.ts +0 -29
- package/dist/types/src/blueprints/planning-old/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/read.d.ts +0 -14
- package/dist/types/src/blueprints/planning-old/functions/read.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/task-list.d.ts +0 -74
- package/dist/types/src/blueprints/planning-old/functions/task-list.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/task-list.test.d.ts +0 -2
- package/dist/types/src/blueprints/planning-old/functions/task-list.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/update.d.ts +0 -16
- package/dist/types/src/blueprints/planning-old/functions/update.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/index.d.ts +0 -2
- package/dist/types/src/blueprints/planning-old/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/research/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/functions/document-create.d.ts +0 -10
- package/dist/types/src/blueprints/research/functions/document-create.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/functions/index.d.ts +0 -19
- package/dist/types/src/blueprints/research/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/functions/research.d.ts +0 -14
- package/dist/types/src/blueprints/research/functions/research.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/functions/research.test.d.ts +0 -2
- package/dist/types/src/blueprints/research/functions/research.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/index.d.ts +0 -3
- package/dist/types/src/blueprints/research/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts +0 -18
- package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/types/index.d.ts +0 -7
- package/dist/types/src/blueprints/research/types/index.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +0 -179
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.test.d.ts +0 -2
- package/dist/types/src/functions/entity-extraction/entity-extraction.test.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/index.d.ts +0 -179
- package/dist/types/src/functions/entity-extraction/index.d.ts.map +0 -1
- package/dist/types/src/functions/exa/data/exa-search-1748337321991.d.ts +0 -38
- package/dist/types/src/functions/exa/data/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/functions/exa/data/exa-search-1748337331526.d.ts +0 -37
- package/dist/types/src/functions/exa/data/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/functions/exa/data/exa-search-1748337344119.d.ts +0 -58
- package/dist/types/src/functions/exa/data/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/functions/exa/data/index.d.ts +0 -3
- package/dist/types/src/functions/exa/data/index.d.ts.map +0 -1
- package/dist/types/src/functions/exa/exa.d.ts +0 -5
- package/dist/types/src/functions/exa/exa.d.ts.map +0 -1
- package/dist/types/src/functions/exa/index.d.ts +0 -9
- package/dist/types/src/functions/exa/index.d.ts.map +0 -1
- package/dist/types/src/functions/exa/mock.d.ts +0 -5
- package/dist/types/src/functions/exa/mock.d.ts.map +0 -1
- package/dist/types/src/types/Project.d.ts +0 -67
- package/dist/types/src/types/Project.d.ts.map +0 -1
- package/src/blueprints/browser/blueprint.conversations.json +0 -1
- package/src/blueprints/design/blueprint.test.ts +0 -96
- package/src/blueprints/design/blueprint.ts +0 -46
- package/src/blueprints/design/index.ts +0 -5
- package/src/blueprints/markdown/blueprint.ts +0 -38
- package/src/blueprints/markdown/functions/create.ts +0 -29
- package/src/blueprints/markdown/functions/index.ts +0 -13
- package/src/blueprints/markdown/functions/read.ts +0 -32
- package/src/blueprints/markdown/functions/update.ts +0 -32
- package/src/blueprints/markdown/index.ts +0 -6
- package/src/blueprints/planning-old/blueprint.test.ts +0 -122
- package/src/blueprints/planning-old/blueprint.ts +0 -110
- package/src/blueprints/planning-old/functions/index.ts +0 -11
- package/src/blueprints/planning-old/functions/read.ts +0 -34
- package/src/blueprints/planning-old/functions/task-list.test.ts +0 -99
- package/src/blueprints/planning-old/functions/task-list.ts +0 -165
- package/src/blueprints/planning-old/functions/update.ts +0 -52
- package/src/blueprints/planning-old/index.ts +0 -5
- package/src/blueprints/research/blueprint.test.ts +0 -7
- package/src/blueprints/research/blueprint.ts +0 -65
- package/src/blueprints/research/functions/document-create.ts +0 -73
- package/src/blueprints/research/functions/index.ts +0 -11
- package/src/blueprints/research/functions/research-instructions.tpl +0 -106
- package/src/blueprints/research/functions/research.conversations.json +0 -1
- package/src/blueprints/research/functions/research.test.ts +0 -149
- package/src/blueprints/research/functions/research.ts +0 -175
- package/src/blueprints/research/index.ts +0 -6
- package/src/blueprints/research/types/ResearchGraph.ts +0 -49
- package/src/blueprints/research/types/index.ts +0 -32
- package/src/functions/entity-extraction/entity-extraction.conversations.json +0 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +0 -74
- package/src/functions/entity-extraction/entity-extraction.ts +0 -181
- package/src/functions/entity-extraction/index.ts +0 -9
- package/src/functions/exa/data/exa-search-1748337321991.ts +0 -131
- package/src/functions/exa/data/exa-search-1748337331526.ts +0 -144
- package/src/functions/exa/data/exa-search-1748337344119.ts +0 -133
- package/src/functions/exa/data/index.ts +0 -11
- package/src/functions/exa/exa.ts +0 -37
- package/src/functions/exa/index.ts +0 -11
- package/src/functions/exa/mock.ts +0 -71
- package/src/types/Project.ts +0 -196
- /package/dist/types/src/blueprints/{design → blueprint-manager}/blueprint.test.d.ts +0 -0
- /package/dist/types/src/blueprints/{planning-old → memory}/blueprint.test.d.ts +0 -0
- /package/dist/types/src/blueprints/{research → websearch}/blueprint.test.d.ts +0 -0
|
@@ -4,33 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, expect, it } from '@effect/vitest';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
|
-
import * as Layer from 'effect/Layer';
|
|
8
7
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
12
|
-
import { Database, Entity, 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, Tag } from '@dxos/echo';
|
|
13
10
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
11
|
+
import { AgentService } from '@dxos/functions-runtime';
|
|
12
|
+
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
14
13
|
import { ObjectId } from '@dxos/keys';
|
|
15
14
|
import { Employer, Organization, Person } from '@dxos/types';
|
|
15
|
+
import { trim } from '@dxos/util';
|
|
16
16
|
|
|
17
17
|
import DatabaseBlueprint from './blueprint';
|
|
18
|
-
import {
|
|
18
|
+
import { DatabaseHandlers } from './functions';
|
|
19
|
+
import { Query as DatabaseQueryOperation } from './functions/definitions';
|
|
19
20
|
|
|
20
21
|
ObjectId.dangerouslyDisableRandomness();
|
|
21
22
|
|
|
22
23
|
const TestLayer = AssistantTestLayer({
|
|
23
|
-
|
|
24
|
-
types: [Organization.Organization, Person.Person, Employer.Employer, Tag.Tag, Blueprint.Blueprint],
|
|
24
|
+
operationHandlers: DatabaseHandlers,
|
|
25
|
+
types: [Organization.Organization, Person.Person, Employer.Employer, Tag.Tag, Blueprint.Blueprint, Feed.Feed],
|
|
26
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
25
27
|
tracing: 'pretty',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const provideTestLayers = Effect.provide(AiConversationService.layerNewQueue().pipe(Layer.provideMerge(TestLayer)));
|
|
29
|
-
|
|
30
|
-
const addDatabaseBlueprint = Effect.fnUntraced(function* () {
|
|
31
|
-
yield* AiContextService.bindContext({
|
|
32
|
-
blueprints: [Ref.make(yield* Database.add(Obj.clone(DatabaseBlueprint.make(), { deep: true })))],
|
|
33
|
-
});
|
|
28
|
+
aiServicePreset: 'edge-remote',
|
|
34
29
|
});
|
|
35
30
|
|
|
36
31
|
describe('Database Blueprint', () => {
|
|
@@ -42,14 +37,13 @@ describe('Database Blueprint', () => {
|
|
|
42
37
|
'schema-list: list available schemas',
|
|
43
38
|
Effect.fnUntraced(
|
|
44
39
|
function* (_) {
|
|
45
|
-
yield*
|
|
46
|
-
|
|
47
|
-
prompt: 'List all available schemas. Tell me what typenames are available.',
|
|
40
|
+
const agent = yield* AgentService.createSession({
|
|
41
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
48
42
|
});
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
yield* agent.submitPrompt('List all available schemas. Tell me what typenames are available.');
|
|
44
|
+
yield* agent.waitForCompletion();
|
|
51
45
|
},
|
|
52
|
-
|
|
46
|
+
Effect.provide(TestLayer),
|
|
53
47
|
TestHelpers.provideTestContext,
|
|
54
48
|
),
|
|
55
49
|
{ timeout: 60_000 },
|
|
@@ -59,18 +53,20 @@ describe('Database Blueprint', () => {
|
|
|
59
53
|
'schema-add: add a new schema',
|
|
60
54
|
Effect.fnUntraced(
|
|
61
55
|
function* (_) {
|
|
62
|
-
yield*
|
|
63
|
-
|
|
64
|
-
prompt:
|
|
65
|
-
'Add a new schema called "Project" with typename "example.com/type/Project" and fields: name (string), description (string), and status (string).',
|
|
56
|
+
const agent = yield* AgentService.createSession({
|
|
57
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
66
58
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
db.schemaRegistry.query({ typename: 'example.com/type/Project', location: ['database', 'runtime'] }).run(),
|
|
59
|
+
yield* agent.submitPrompt(
|
|
60
|
+
'Add a new schema called "Project" with typename "com.example.type.project" and fields: name (string), description (string), and status (string).',
|
|
70
61
|
);
|
|
62
|
+
yield* agent.waitForCompletion();
|
|
63
|
+
const schemas = yield* Database.runSchemaQuery({
|
|
64
|
+
typename: 'com.example.type.project',
|
|
65
|
+
location: ['database', 'runtime'],
|
|
66
|
+
});
|
|
71
67
|
expect(schemas.length).toBeGreaterThanOrEqual(1);
|
|
72
68
|
},
|
|
73
|
-
|
|
69
|
+
Effect.provide(TestLayer),
|
|
74
70
|
TestHelpers.provideTestContext,
|
|
75
71
|
),
|
|
76
72
|
{ timeout: 60_000 },
|
|
@@ -84,14 +80,38 @@ describe('Database Blueprint', () => {
|
|
|
84
80
|
'object-create: create an object',
|
|
85
81
|
Effect.fnUntraced(
|
|
86
82
|
function* (_) {
|
|
87
|
-
yield*
|
|
88
|
-
|
|
89
|
-
prompt: 'Create a new organization called "Cyberdyne Systems".',
|
|
83
|
+
const agent = yield* AgentService.createSession({
|
|
84
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
90
85
|
});
|
|
86
|
+
yield* agent.submitPrompt('Create a new organization called "Cyberdyne Systems".');
|
|
87
|
+
yield* agent.waitForCompletion();
|
|
91
88
|
const orgs = yield* Database.runQuery(Query.type(Organization.Organization, { name: 'Cyberdyne Systems' }));
|
|
92
89
|
expect(orgs).toHaveLength(1);
|
|
93
90
|
},
|
|
94
|
-
|
|
91
|
+
Effect.provide(TestLayer),
|
|
92
|
+
TestHelpers.provideTestContext,
|
|
93
|
+
),
|
|
94
|
+
{ timeout: 60_000 },
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
it.effect(
|
|
98
|
+
'object-create: create an object with a reference',
|
|
99
|
+
Effect.fnUntraced(
|
|
100
|
+
function* (_) {
|
|
101
|
+
const agent = yield* AgentService.createSession({
|
|
102
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
103
|
+
});
|
|
104
|
+
yield* agent.submitPrompt(
|
|
105
|
+
'Create a preson fullName="John Doe" with a reference to the organization "Cyberdyne Systems".',
|
|
106
|
+
);
|
|
107
|
+
yield* agent.waitForCompletion();
|
|
108
|
+
const orgs = yield* Database.runQuery(Query.type(Organization.Organization, { name: 'Cyberdyne Systems' }));
|
|
109
|
+
const persons = yield* Database.runQuery(Query.type(Person.Person, { fullName: 'John Doe' }));
|
|
110
|
+
expect(orgs).toHaveLength(1);
|
|
111
|
+
expect(persons).toHaveLength(1);
|
|
112
|
+
expect(persons[0].organization?.target).toBe(orgs[0]);
|
|
113
|
+
},
|
|
114
|
+
Effect.provide(TestLayer),
|
|
95
115
|
TestHelpers.provideTestContext,
|
|
96
116
|
),
|
|
97
117
|
{ timeout: 60_000 },
|
|
@@ -101,14 +121,15 @@ describe('Database Blueprint', () => {
|
|
|
101
121
|
'object-delete: delete an object',
|
|
102
122
|
Effect.fnUntraced(
|
|
103
123
|
function* (_) {
|
|
104
|
-
yield*
|
|
105
|
-
|
|
106
|
-
yield* AiConversationService.run({
|
|
107
|
-
prompt: `Delete the organization "Obsolete Corp".`,
|
|
124
|
+
const agent = yield* AgentService.createSession({
|
|
125
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
108
126
|
});
|
|
127
|
+
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Obsolete Corp' }));
|
|
128
|
+
yield* agent.submitPrompt(`Delete the organization "Obsolete Corp".`);
|
|
129
|
+
yield* agent.waitForCompletion();
|
|
109
130
|
expect(Obj.isDeleted(org)).toBe(true);
|
|
110
131
|
},
|
|
111
|
-
|
|
132
|
+
Effect.provide(TestLayer),
|
|
112
133
|
TestHelpers.provideTestContext,
|
|
113
134
|
),
|
|
114
135
|
{ timeout: 60_000 },
|
|
@@ -118,14 +139,15 @@ describe('Database Blueprint', () => {
|
|
|
118
139
|
'object-update: update an object',
|
|
119
140
|
Effect.fnUntraced(
|
|
120
141
|
function* (_) {
|
|
121
|
-
yield*
|
|
122
|
-
|
|
123
|
-
yield* AiConversationService.run({
|
|
124
|
-
prompt: `Update the organization "Old Name Inc" and change its name to "New Name Corp".`,
|
|
142
|
+
const agent = yield* AgentService.createSession({
|
|
143
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
125
144
|
});
|
|
145
|
+
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Old Name Inc' }));
|
|
146
|
+
yield* agent.submitPrompt(`Update the organization "Old Name Inc" and change its name to "New Name Corp".`);
|
|
147
|
+
yield* agent.waitForCompletion();
|
|
126
148
|
expect(org.name).toBe('New Name Corp');
|
|
127
149
|
},
|
|
128
|
-
|
|
150
|
+
Effect.provide(TestLayer),
|
|
129
151
|
TestHelpers.provideTestContext,
|
|
130
152
|
),
|
|
131
153
|
{ timeout: 60_000 },
|
|
@@ -139,16 +161,15 @@ describe('Database Blueprint', () => {
|
|
|
139
161
|
'query: search for objects',
|
|
140
162
|
Effect.fnUntraced(
|
|
141
163
|
function* (_) {
|
|
142
|
-
yield*
|
|
164
|
+
const agent = yield* AgentService.createSession({
|
|
165
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
166
|
+
});
|
|
143
167
|
yield* Database.add(Obj.make(Organization.Organization, { name: 'Acme Corp' }));
|
|
144
168
|
yield* Database.add(Obj.make(Organization.Organization, { name: 'Globex Industries' }));
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
});
|
|
148
|
-
const lastMessage = messages.at(-1);
|
|
149
|
-
expect(lastMessage).toBeDefined();
|
|
169
|
+
yield* agent.submitPrompt('Search for all organizations. How many are there?');
|
|
170
|
+
yield* agent.waitForCompletion();
|
|
150
171
|
},
|
|
151
|
-
|
|
172
|
+
Effect.provide(TestLayer),
|
|
152
173
|
TestHelpers.provideTestContext,
|
|
153
174
|
),
|
|
154
175
|
{ timeout: 60_000 },
|
|
@@ -158,18 +179,17 @@ describe('Database Blueprint', () => {
|
|
|
158
179
|
'load: load object details',
|
|
159
180
|
Effect.fnUntraced(
|
|
160
181
|
function* (_) {
|
|
161
|
-
yield*
|
|
182
|
+
const agent = yield* AgentService.createSession({
|
|
183
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
184
|
+
});
|
|
162
185
|
const org = yield* Database.add(
|
|
163
186
|
Obj.make(Organization.Organization, { name: 'Detail Corp', description: 'A detailed organization.' }),
|
|
164
187
|
);
|
|
165
188
|
const dxn = Obj.getDXN(org).toString();
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
});
|
|
169
|
-
const lastMessage = messages.at(-1);
|
|
170
|
-
expect(lastMessage).toBeDefined();
|
|
189
|
+
yield* agent.submitPrompt(`Load the full details of object ${dxn}. What is its description?`);
|
|
190
|
+
yield* agent.waitForCompletion();
|
|
171
191
|
},
|
|
172
|
-
|
|
192
|
+
Effect.provide(TestLayer),
|
|
173
193
|
TestHelpers.provideTestContext,
|
|
174
194
|
),
|
|
175
195
|
{ timeout: 60_000 },
|
|
@@ -183,16 +203,19 @@ describe('Database Blueprint', () => {
|
|
|
183
203
|
'relation-create: create a relation between objects',
|
|
184
204
|
Effect.fnUntraced(
|
|
185
205
|
function* (_) {
|
|
186
|
-
yield*
|
|
187
|
-
|
|
188
|
-
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Cyberdyne Systems' }));
|
|
189
|
-
yield* AiConversationService.run({
|
|
190
|
-
prompt: `Create an Employer relation from person "John Connor" to organization "Cyberdyne Systems" with role "Engineer". List schemas first to find the relation typename.`,
|
|
206
|
+
const agent = yield* AgentService.createSession({
|
|
207
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
191
208
|
});
|
|
209
|
+
yield* Database.add(Obj.make(Person.Person, { fullName: 'John Connor' }));
|
|
210
|
+
yield* Database.add(Obj.make(Organization.Organization, { name: 'Cyberdyne Systems' }));
|
|
211
|
+
yield* agent.submitPrompt(
|
|
212
|
+
`Create an Employer relation from person "John Connor" to organization "Cyberdyne Systems" with role "Engineer". List schemas first to find the relation typename.`,
|
|
213
|
+
);
|
|
214
|
+
yield* agent.waitForCompletion();
|
|
192
215
|
const relations = yield* Database.runQuery(Query.type(Employer.Employer));
|
|
193
216
|
expect(relations.length).toBeGreaterThanOrEqual(1);
|
|
194
217
|
},
|
|
195
|
-
|
|
218
|
+
Effect.provide(TestLayer),
|
|
196
219
|
TestHelpers.provideTestContext,
|
|
197
220
|
),
|
|
198
221
|
{ timeout: 60_000 },
|
|
@@ -202,7 +225,9 @@ describe('Database Blueprint', () => {
|
|
|
202
225
|
'relation-delete: delete a relation',
|
|
203
226
|
Effect.fnUntraced(
|
|
204
227
|
function* (_) {
|
|
205
|
-
yield*
|
|
228
|
+
const agent = yield* AgentService.createSession({
|
|
229
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
230
|
+
});
|
|
206
231
|
const person = yield* Database.add(Obj.make(Person.Person, { fullName: 'Sarah Connor' }));
|
|
207
232
|
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Cyberdyne Systems' }));
|
|
208
233
|
const relation = yield* Database.add(
|
|
@@ -213,12 +238,11 @@ describe('Database Blueprint', () => {
|
|
|
213
238
|
}),
|
|
214
239
|
);
|
|
215
240
|
const relationDxn = Relation.getDXN(relation).toString();
|
|
216
|
-
yield*
|
|
217
|
-
|
|
218
|
-
});
|
|
241
|
+
yield* agent.submitPrompt(`Delete the relation ${relationDxn}.`);
|
|
242
|
+
yield* agent.waitForCompletion();
|
|
219
243
|
expect(Relation.isDeleted(relation)).toBe(true);
|
|
220
244
|
},
|
|
221
|
-
|
|
245
|
+
Effect.provide(TestLayer),
|
|
222
246
|
TestHelpers.provideTestContext,
|
|
223
247
|
),
|
|
224
248
|
{ timeout: 60_000 },
|
|
@@ -232,17 +256,18 @@ describe('Database Blueprint', () => {
|
|
|
232
256
|
'tag-add: add a tag to an object',
|
|
233
257
|
Effect.fnUntraced(
|
|
234
258
|
function* (_) {
|
|
235
|
-
yield*
|
|
259
|
+
const agent = yield* AgentService.createSession({
|
|
260
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
261
|
+
});
|
|
236
262
|
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Tagged Corp' }));
|
|
237
263
|
const tag = yield* Database.add(Tag.make({ label: 'important' }));
|
|
238
|
-
yield*
|
|
239
|
-
|
|
240
|
-
});
|
|
264
|
+
yield* agent.submitPrompt(`Add tag "important" to the organization "Tagged Corp".`);
|
|
265
|
+
yield* agent.waitForCompletion();
|
|
241
266
|
const tags = Obj.getMeta(org).tags ?? [];
|
|
242
267
|
// TODO(dmaretskyi): matcher doesnt work with echo proxies.
|
|
243
268
|
expect([...tags]).toContain(Obj.getDXN(tag).toString());
|
|
244
269
|
},
|
|
245
|
-
|
|
270
|
+
Effect.provide(TestLayer),
|
|
246
271
|
TestHelpers.provideTestContext,
|
|
247
272
|
),
|
|
248
273
|
{ timeout: 60_000 },
|
|
@@ -252,20 +277,21 @@ describe('Database Blueprint', () => {
|
|
|
252
277
|
'tag-remove: remove a tag from an object',
|
|
253
278
|
Effect.fnUntraced(
|
|
254
279
|
function* (_) {
|
|
255
|
-
yield*
|
|
280
|
+
const agent = yield* AgentService.createSession({
|
|
281
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
282
|
+
});
|
|
256
283
|
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Untagged Corp' }));
|
|
257
284
|
const tag = yield* Database.add(Tag.make({ label: 'obsolete' }));
|
|
258
285
|
const tagDxn = Obj.getDXN(tag).toString();
|
|
259
|
-
Entity.
|
|
286
|
+
Entity.update(org, (org) => Entity.addTag(org, tagDxn));
|
|
260
287
|
expect(Obj.getMeta(org).tags ?? []).toContain(tagDxn);
|
|
261
|
-
yield*
|
|
262
|
-
|
|
263
|
-
});
|
|
288
|
+
yield* agent.submitPrompt(`Remove tag "obsolete" from the organization "Untagged Corp".`);
|
|
289
|
+
yield* agent.waitForCompletion();
|
|
264
290
|
const tags = Obj.getMeta(org).tags ?? [];
|
|
265
291
|
// TODO(dmaretskyi): matcher doesnt work with echo proxies.
|
|
266
292
|
expect([...tags]).not.toContain(tagDxn);
|
|
267
293
|
},
|
|
268
|
-
|
|
294
|
+
Effect.provide(TestLayer),
|
|
269
295
|
TestHelpers.provideTestContext,
|
|
270
296
|
),
|
|
271
297
|
{ timeout: 60_000 },
|
|
@@ -279,16 +305,16 @@ describe('Database Blueprint', () => {
|
|
|
279
305
|
'context-add: add object to chat context',
|
|
280
306
|
Effect.fnUntraced(
|
|
281
307
|
function* (_) {
|
|
282
|
-
yield*
|
|
283
|
-
|
|
284
|
-
yield* AiConversationService.run({
|
|
285
|
-
prompt: `Add the organization "Context Corp" to the chat context.`,
|
|
308
|
+
const agent = yield* AgentService.createSession({
|
|
309
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
286
310
|
});
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
311
|
+
yield* Database.add(Obj.make(Organization.Organization, { name: 'Context Corp' }));
|
|
312
|
+
yield* agent.submitPrompt(`Add the organization "Context Corp" to the chat context.`);
|
|
313
|
+
yield* agent.waitForCompletion();
|
|
314
|
+
const contextRefs = yield* agent.getContext();
|
|
315
|
+
expect(contextRefs.length).toBeGreaterThanOrEqual(1);
|
|
290
316
|
},
|
|
291
|
-
|
|
317
|
+
Effect.provide(TestLayer),
|
|
292
318
|
TestHelpers.provideTestContext,
|
|
293
319
|
),
|
|
294
320
|
{ timeout: 60_000 },
|
|
@@ -298,22 +324,206 @@ describe('Database Blueprint', () => {
|
|
|
298
324
|
'context-remove: remove object from chat context',
|
|
299
325
|
Effect.fnUntraced(
|
|
300
326
|
function* (_) {
|
|
301
|
-
yield*
|
|
327
|
+
const agent = yield* AgentService.createSession({
|
|
328
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
329
|
+
});
|
|
302
330
|
const org = yield* Database.add(Obj.make(Organization.Organization, { name: 'Remove Context Corp' }));
|
|
303
331
|
const { db } = yield* Database.Service;
|
|
304
332
|
const ref = db.makeRef(Obj.getDXN(org)) as Ref.Ref<any>;
|
|
305
|
-
|
|
306
|
-
yield* Effect.promise(() => binder.bind({ blueprints: [], objects: [ref] }));
|
|
333
|
+
yield* agent.addContext([ref]);
|
|
307
334
|
const dxn = Obj.getDXN(org).toString();
|
|
308
|
-
yield*
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
const objects = conversation.context.getObjects();
|
|
313
|
-
const found = objects.find((obj) => Obj.getDXN(obj).toString() === dxn);
|
|
335
|
+
yield* agent.submitPrompt(`Remove the organization "Remove Context Corp" from the chat context.`);
|
|
336
|
+
yield* agent.waitForCompletion();
|
|
337
|
+
const contextRefs = yield* agent.getContext();
|
|
338
|
+
const found = contextRefs.find((contextRef) => contextRef.dxn.toString() === dxn);
|
|
314
339
|
expect(found).toBeUndefined();
|
|
315
340
|
},
|
|
316
|
-
|
|
341
|
+
Effect.provide(TestLayer),
|
|
342
|
+
TestHelpers.provideTestContext,
|
|
343
|
+
),
|
|
344
|
+
{ timeout: 60_000 },
|
|
345
|
+
);
|
|
346
|
+
|
|
347
|
+
it.effect(
|
|
348
|
+
'query: includeQueues finds mock email in feed (agent uses Query tool)',
|
|
349
|
+
Effect.fnUntraced(
|
|
350
|
+
function* (_) {
|
|
351
|
+
const feed = Feed.make();
|
|
352
|
+
yield* Database.add(feed);
|
|
353
|
+
yield* Feed.append(feed, [
|
|
354
|
+
Obj.make(Organization.Organization, {
|
|
355
|
+
name: 'Lot Booking Co',
|
|
356
|
+
description: 'Mock email body: your parking reservation is confirmed.',
|
|
357
|
+
}),
|
|
358
|
+
]);
|
|
359
|
+
yield* Database.flush();
|
|
360
|
+
|
|
361
|
+
const agent = yield* AgentService.createSession({
|
|
362
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
363
|
+
});
|
|
364
|
+
yield* agent.submitPrompt(trim`
|
|
365
|
+
A mock email was stored only on a feed (queue), not as a regular space document: organization "Lot Booking Co"
|
|
366
|
+
mentioning a parking reservation.
|
|
367
|
+
|
|
368
|
+
Use the Query tool once: full-text "reservation", includeQueues true, includeContent false, limit 20.
|
|
369
|
+
Confirm the results include Lot Booking Co.
|
|
370
|
+
`);
|
|
371
|
+
yield* agent.waitForCompletion();
|
|
372
|
+
|
|
373
|
+
const { db } = yield* Database.Service;
|
|
374
|
+
const spaceOnly = yield* Database.runQuery(
|
|
375
|
+
Query.select(Filter.text('reservation', { type: 'full-text' })).limit(20),
|
|
376
|
+
);
|
|
377
|
+
expect(spaceOnly).toHaveLength(0);
|
|
378
|
+
|
|
379
|
+
const withFeeds = yield* Database.runQuery(
|
|
380
|
+
Query.select(Filter.text('reservation', { type: 'full-text' }))
|
|
381
|
+
.from(db, { includeFeeds: true })
|
|
382
|
+
.limit(20),
|
|
383
|
+
);
|
|
384
|
+
expect(withFeeds.length).toBeGreaterThanOrEqual(1);
|
|
385
|
+
expect(
|
|
386
|
+
withFeeds.some(
|
|
387
|
+
(obj) =>
|
|
388
|
+
Obj.getTypename(obj) === 'org.dxos.type.organization' &&
|
|
389
|
+
String(Obj.getLabel(obj) ?? '').includes('Lot Booking'),
|
|
390
|
+
),
|
|
391
|
+
).toBe(true);
|
|
392
|
+
|
|
393
|
+
const byTypename = yield* Database.runQuery(
|
|
394
|
+
Query.type(Organization.Organization).from(db, { includeFeeds: true }).limit(20),
|
|
395
|
+
);
|
|
396
|
+
expect(byTypename.length).toBeGreaterThanOrEqual(1);
|
|
397
|
+
},
|
|
398
|
+
Effect.provide(TestLayer),
|
|
399
|
+
TestHelpers.provideTestContext,
|
|
400
|
+
),
|
|
401
|
+
{ timeout: 60_000 },
|
|
402
|
+
);
|
|
403
|
+
|
|
404
|
+
it.effect(
|
|
405
|
+
'query operation: includeQueues via invokeFunction',
|
|
406
|
+
Effect.fnUntraced(
|
|
407
|
+
function* ({ expect }) {
|
|
408
|
+
const feed = Feed.make();
|
|
409
|
+
yield* Database.add(feed);
|
|
410
|
+
yield* Feed.append(feed, [
|
|
411
|
+
Obj.make(Organization.Organization, {
|
|
412
|
+
name: 'Invoke Op Lot Co',
|
|
413
|
+
description: 'Feed-only mock email op-search-token-7f3a2c91 reservation line.',
|
|
414
|
+
}),
|
|
415
|
+
]);
|
|
416
|
+
yield* Database.flush();
|
|
417
|
+
|
|
418
|
+
const noQueues = yield* Operation.invoke(DatabaseQueryOperation, {
|
|
419
|
+
text: 'op-search-token-7f3a2c91',
|
|
420
|
+
includeQueues: false,
|
|
421
|
+
limit: 20,
|
|
422
|
+
});
|
|
423
|
+
expect(noQueues).toHaveLength(0);
|
|
424
|
+
|
|
425
|
+
const withQueues = yield* Operation.invoke(DatabaseQueryOperation, {
|
|
426
|
+
text: 'op-search-token-7f3a2c91',
|
|
427
|
+
includeQueues: true,
|
|
428
|
+
limit: 20,
|
|
429
|
+
});
|
|
430
|
+
type QueryRow = { typename?: string; label?: string };
|
|
431
|
+
expect(withQueues.length).toBeGreaterThanOrEqual(1);
|
|
432
|
+
expect(
|
|
433
|
+
(withQueues as QueryRow[]).some(
|
|
434
|
+
(row) => row.typename === 'org.dxos.type.organization' && String(row.label ?? '').includes('Invoke Op Lot'),
|
|
435
|
+
),
|
|
436
|
+
).toBe(true);
|
|
437
|
+
|
|
438
|
+
const byTypename = yield* Operation.invoke(DatabaseQueryOperation, {
|
|
439
|
+
typename: 'org.dxos.type.organization',
|
|
440
|
+
includeQueues: true,
|
|
441
|
+
limit: 20,
|
|
442
|
+
});
|
|
443
|
+
expect(byTypename.length).toBeGreaterThanOrEqual(1);
|
|
444
|
+
expect(
|
|
445
|
+
(byTypename as QueryRow[]).some(
|
|
446
|
+
(row) => row.typename === 'org.dxos.type.organization' && String(row.label ?? '').includes('Invoke Op Lot'),
|
|
447
|
+
),
|
|
448
|
+
).toBe(true);
|
|
449
|
+
},
|
|
450
|
+
Effect.provide(TestLayer),
|
|
451
|
+
TestHelpers.provideTestContext,
|
|
452
|
+
),
|
|
453
|
+
);
|
|
454
|
+
|
|
455
|
+
it.effect(
|
|
456
|
+
'query: in param scopes to feed children (agent uses Query tool)',
|
|
457
|
+
Effect.fnUntraced(
|
|
458
|
+
function* (_) {
|
|
459
|
+
const feed1 = Feed.make({ name: 'inbox-1' });
|
|
460
|
+
yield* Database.add(feed1);
|
|
461
|
+
yield* Feed.append(feed1, [
|
|
462
|
+
Obj.make(Organization.Organization, {
|
|
463
|
+
name: 'Email Corp Alpha',
|
|
464
|
+
description: 'Mock email in-param-token-a1b2c3.',
|
|
465
|
+
}),
|
|
466
|
+
]);
|
|
467
|
+
|
|
468
|
+
const feed2 = Feed.make({ name: 'inbox-2' });
|
|
469
|
+
yield* Database.add(feed2);
|
|
470
|
+
yield* Feed.append(feed2, [
|
|
471
|
+
Obj.make(Organization.Organization, {
|
|
472
|
+
name: 'Email Corp Beta',
|
|
473
|
+
description: 'Mock email in-param-token-d4e5f6.',
|
|
474
|
+
}),
|
|
475
|
+
]);
|
|
476
|
+
yield* Database.flush();
|
|
477
|
+
|
|
478
|
+
const agent = yield* AgentService.createSession({
|
|
479
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
480
|
+
});
|
|
481
|
+
yield* agent.submitPrompt('Query for organizations in "inbox-1" feed.');
|
|
482
|
+
yield* agent.waitForCompletion();
|
|
483
|
+
},
|
|
484
|
+
Effect.provide(TestLayer),
|
|
485
|
+
TestHelpers.provideTestContext,
|
|
486
|
+
),
|
|
487
|
+
{ timeout: 60_000 },
|
|
488
|
+
);
|
|
489
|
+
|
|
490
|
+
it.effect(
|
|
491
|
+
'query operation: in param can be passed as string',
|
|
492
|
+
Effect.fnUntraced(
|
|
493
|
+
function* (_) {
|
|
494
|
+
const feed1 = Feed.make({ name: 'inbox-1' });
|
|
495
|
+
yield* Database.add(feed1);
|
|
496
|
+
yield* Feed.append(feed1, [
|
|
497
|
+
Obj.make(Organization.Organization, {
|
|
498
|
+
name: 'Email Corp Alpha',
|
|
499
|
+
description: 'Mock email in-param-invoke-token-a1b2c3.',
|
|
500
|
+
}),
|
|
501
|
+
]);
|
|
502
|
+
|
|
503
|
+
const feed2 = Feed.make({ name: 'inbox-2' });
|
|
504
|
+
yield* Database.add(feed2);
|
|
505
|
+
yield* Feed.append(feed2, [
|
|
506
|
+
Obj.make(Organization.Organization, {
|
|
507
|
+
name: 'Email Corp Beta',
|
|
508
|
+
description: 'Mock email in-param-invoke-token-d4e5f6.',
|
|
509
|
+
}),
|
|
510
|
+
]);
|
|
511
|
+
yield* Database.flush();
|
|
512
|
+
|
|
513
|
+
const agent = yield* AgentService.createSession({
|
|
514
|
+
blueprints: [DatabaseBlueprint.make()],
|
|
515
|
+
});
|
|
516
|
+
yield* agent.submitPrompt(
|
|
517
|
+
`Call query tool with precisely ${JSON.stringify({
|
|
518
|
+
includeContent: false,
|
|
519
|
+
limit: 10,
|
|
520
|
+
typename: Organization.Organization.typename,
|
|
521
|
+
in: [Obj.getDXN(feed1).toString()],
|
|
522
|
+
})}`,
|
|
523
|
+
);
|
|
524
|
+
yield* agent.waitForCompletion();
|
|
525
|
+
},
|
|
526
|
+
Effect.provide(TestLayer),
|
|
317
527
|
TestHelpers.provideTestContext,
|
|
318
528
|
),
|
|
319
529
|
{ timeout: 60_000 },
|
|
@@ -2,37 +2,64 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
5
|
+
import { Blueprint } from '@dxos/compute';
|
|
7
6
|
import { Ref } from '@dxos/echo';
|
|
8
7
|
import { Text } from '@dxos/schema';
|
|
9
8
|
import { trim } from '@dxos/util';
|
|
10
9
|
|
|
11
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
Query,
|
|
12
|
+
Load,
|
|
13
|
+
ObjectCreate,
|
|
14
|
+
ObjectUpdate,
|
|
15
|
+
ObjectDelete,
|
|
16
|
+
SchemaAdd,
|
|
17
|
+
SchemaList,
|
|
18
|
+
ContextAdd,
|
|
19
|
+
ContextRemove,
|
|
20
|
+
RelationCreate,
|
|
21
|
+
RelationDelete,
|
|
22
|
+
TagAdd,
|
|
23
|
+
TagRemove,
|
|
24
|
+
} from './functions';
|
|
12
25
|
|
|
13
|
-
const BLUEPRINT_KEY = 'dxos.
|
|
26
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.database';
|
|
14
27
|
|
|
15
28
|
const instructions = trim`
|
|
16
29
|
You can query, create, update, and delete objects in ECHO.
|
|
17
30
|
You can manage schemas, relations, tags, and add objects to the chat context.
|
|
18
31
|
`;
|
|
19
32
|
|
|
20
|
-
const functions = Object.values(DatabaseFunctions);
|
|
21
|
-
|
|
22
33
|
const make = () =>
|
|
23
34
|
Blueprint.make({
|
|
24
35
|
key: BLUEPRINT_KEY,
|
|
25
36
|
name: 'Database',
|
|
26
37
|
description: 'Query and manipulate objects in the ECHO database.',
|
|
38
|
+
agentCanEnable: true,
|
|
27
39
|
instructions: {
|
|
28
|
-
source: Ref.make(Text.make(instructions)),
|
|
40
|
+
source: Ref.make(Text.make({ content: instructions })),
|
|
29
41
|
},
|
|
30
|
-
tools: Blueprint.toolDefinitions({
|
|
42
|
+
tools: Blueprint.toolDefinitions({
|
|
43
|
+
operations: [
|
|
44
|
+
ContextAdd,
|
|
45
|
+
ContextRemove,
|
|
46
|
+
Load,
|
|
47
|
+
ObjectCreate,
|
|
48
|
+
ObjectDelete,
|
|
49
|
+
ObjectUpdate,
|
|
50
|
+
Query,
|
|
51
|
+
RelationCreate,
|
|
52
|
+
RelationDelete,
|
|
53
|
+
SchemaAdd,
|
|
54
|
+
SchemaList,
|
|
55
|
+
TagAdd,
|
|
56
|
+
TagRemove,
|
|
57
|
+
],
|
|
58
|
+
}),
|
|
31
59
|
});
|
|
32
60
|
|
|
33
|
-
const blueprint:
|
|
61
|
+
const blueprint: Blueprint.Definition = {
|
|
34
62
|
key: BLUEPRINT_KEY,
|
|
35
|
-
functions,
|
|
36
63
|
make,
|
|
37
64
|
};
|
|
38
65
|
|