@dxos/assistant-toolkit 0.8.4-main.ae835ea → 0.8.4-main.bc2380dfbc
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-4IVGW6CI.mjs +30 -0
- package/dist/lib/neutral/add-artifact-4IVGW6CI.mjs.map +7 -0
- package/dist/lib/neutral/agent-F4L7UXME.mjs +65 -0
- package/dist/lib/neutral/agent-F4L7UXME.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5GPL2WXU.mjs +292 -0
- package/dist/lib/neutral/chunk-5GPL2WXU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7UCYAP3T.mjs +332 -0
- package/dist/lib/neutral/chunk-7UCYAP3T.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ANSF2BHN.mjs +67 -0
- package/dist/lib/neutral/chunk-ANSF2BHN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-BCT55UTL.mjs +75 -0
- package/dist/lib/neutral/chunk-BCT55UTL.mjs.map +7 -0
- package/dist/lib/neutral/chunk-COL54UJ3.mjs +60 -0
- package/dist/lib/neutral/chunk-COL54UJ3.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-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.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-KS3IA6FQ.mjs +101 -0
- package/dist/lib/neutral/chunk-KS3IA6FQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MMQ7HFL4.mjs +107 -0
- package/dist/lib/neutral/chunk-MMQ7HFL4.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-PLGEBNTO.mjs +65 -0
- package/dist/lib/neutral/chunk-PLGEBNTO.mjs.map +7 -0
- package/dist/lib/neutral/chunk-W2722TC5.mjs +70 -0
- package/dist/lib/neutral/chunk-W2722TC5.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-ZFXLTBZG.mjs +73 -0
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs.map +7 -0
- package/dist/lib/neutral/context-add-S5MBW2NA.mjs +22 -0
- package/dist/lib/neutral/context-add-S5MBW2NA.mjs.map +7 -0
- package/dist/lib/neutral/context-remove-35O5T5N5.mjs +22 -0
- package/dist/lib/neutral/context-remove-35O5T5N5.mjs.map +7 -0
- package/dist/lib/neutral/create-project-3AGXJ4TD.mjs +35 -0
- package/dist/lib/neutral/create-project-3AGXJ4TD.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-IVKST3WH.mjs +47 -0
- package/dist/lib/neutral/enable-blueprints-IVKST3WH.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-FBYWIP72.mjs +35 -0
- package/dist/lib/neutral/get-context-FBYWIP72.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +914 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/load-GAT3T2AD.mjs +17 -0
- package/dist/lib/neutral/load-GAT3T2AD.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/object-create-PL3WRP74.mjs +35 -0
- package/dist/lib/neutral/object-create-PL3WRP74.mjs.map +7 -0
- package/dist/lib/neutral/object-delete-PZJQN5KW.mjs +18 -0
- package/dist/lib/neutral/object-delete-PZJQN5KW.mjs.map +7 -0
- package/dist/lib/neutral/object-update-R43N3VJX.mjs +28 -0
- package/dist/lib/neutral/object-update-R43N3VJX.mjs.map +7 -0
- package/dist/lib/neutral/project-VVXXUMAI.mjs +23 -0
- package/dist/lib/neutral/project-VVXXUMAI.mjs.map +7 -0
- package/dist/lib/neutral/project-rules-KSVSOZJV.mjs +78 -0
- package/dist/lib/neutral/project-rules-KSVSOZJV.mjs.map +7 -0
- package/dist/lib/neutral/prompt-INL55Q2B.mjs +170 -0
- package/dist/lib/neutral/prompt-INL55Q2B.mjs.map +7 -0
- package/dist/lib/neutral/qualifier-DAF4H7V3.mjs +88 -0
- package/dist/lib/neutral/qualifier-DAF4H7V3.mjs.map +7 -0
- package/dist/lib/neutral/query-MP5NSQKO.mjs +69 -0
- package/dist/lib/neutral/query-MP5NSQKO.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-PLWYVOI3.mjs +16 -0
- package/dist/lib/neutral/query-blueprints-PLWYVOI3.mjs.map +7 -0
- package/dist/lib/neutral/relation-create-YAAAFTR2.mjs +34 -0
- package/dist/lib/neutral/relation-create-YAAAFTR2.mjs.map +7 -0
- package/dist/lib/neutral/relation-delete-IEPKERFR.mjs +18 -0
- package/dist/lib/neutral/relation-delete-IEPKERFR.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-5BNIINRS.mjs +24 -0
- package/dist/lib/neutral/schema-add-5BNIINRS.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-54UK7S4R.mjs +38 -0
- package/dist/lib/neutral/schema-list-54UK7S4R.mjs.map +7 -0
- package/dist/lib/neutral/sync-issues-DWY76B3M.mjs +166 -0
- package/dist/lib/neutral/sync-issues-DWY76B3M.mjs.map +7 -0
- package/dist/lib/neutral/sync-triggers-NOIQLELD.mjs +135 -0
- package/dist/lib/neutral/sync-triggers-NOIQLELD.mjs.map +7 -0
- package/dist/lib/neutral/tag-add-NLVRGTC6.mjs +19 -0
- package/dist/lib/neutral/tag-add-NLVRGTC6.mjs.map +7 -0
- package/dist/lib/neutral/tag-remove-N4HFBIA2.mjs +19 -0
- package/dist/lib/neutral/tag-remove-N4HFBIA2.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +76 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/update-blueprints-2SNK6HLG.mjs +16 -0
- package/dist/lib/neutral/update-blueprints-2SNK6HLG.mjs.map +7 -0
- package/dist/lib/neutral/update-tasks-QQUR53RN.mjs +13 -0
- package/dist/lib/neutral/update-tasks-QQUR53RN.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 +2 -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 +61 -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 +36 -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 +27 -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 +4 -0
- package/dist/types/src/blueprints/browser/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/browser/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/index.d.ts +2 -0
- package/dist/types/src/blueprints/browser/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/database/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/database/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -0
- 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 +4 -0
- package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/load.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/object-create.d.ts +8 -0
- package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/object-update.d.ts +10 -0
- package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/query.d.ts +12 -0
- package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts +10 -0
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts +9 -0
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts +8 -0
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +8 -0
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/index.d.ts +3 -0
- package/dist/types/src/blueprints/database/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/discord/blueprint.d.ts.map +1 -0
- 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/{functions/discord → blueprints/discord/functions}/fetch-messages.d.ts +3 -2
- package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/functions/fetch-messages.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/index.d.ts +2 -2
- 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 +8 -0
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/index.d.ts +2 -0
- package/dist/types/src/blueprints/github/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +11 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/linear/blueprint.d.ts.map +1 -0
- 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 +4 -0
- package/dist/types/src/blueprints/linear/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/linear.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts +10 -0
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/index.d.ts +2 -2
- 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 +2 -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 +4 -0
- package/dist/types/src/blueprints/planning/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +24 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -0
- 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/planning/index.d.ts +2 -2
- package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/project/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/project/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +4 -0
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/agent.d.ts +4 -0
- package/dist/types/src/blueprints/project/functions/agent.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/definitions.d.ts +166 -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 +4 -0
- package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/project/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +77 -0
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/index.d.ts +3 -0
- package/dist/types/src/blueprints/project/index.d.ts.map +1 -0
- 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 +55 -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 +104 -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 +52 -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 +9 -5
- package/dist/types/src/blueprints/testing.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/websearch/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/blueprint.test.d.ts +2 -0
- 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 +3 -3
- package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/{websearch-toolkit.d.ts → toolkit.d.ts} +4 -1
- package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
- package/dist/types/src/{functions/research → crud}/graph.d.ts +12 -11
- package/dist/types/src/crud/graph.d.ts.map +1 -0
- package/dist/types/src/crud/graph.test.d.ts.map +1 -0
- package/dist/types/src/crud/index.d.ts +2 -0
- package/dist/types/src/crud/index.d.ts.map +1 -0
- 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 +61 -0
- package/dist/types/src/functions/agent/definitions.d.ts.map +1 -0
- package/dist/types/src/functions/agent/index.d.ts +3 -4
- package/dist/types/src/functions/agent/index.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.d.ts +2 -9
- 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 -6
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/sync/sync.d.ts +3 -4
- package/dist/types/src/sync/sync.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/plugins.d.ts +19 -0
- package/dist/types/src/testing/plugins.d.ts.map +1 -0
- package/dist/types/src/toolkits/WebToolkit.d.ts +38 -0
- package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -0
- package/dist/types/src/toolkits/index.d.ts +2 -0
- package/dist/types/src/toolkits/index.d.ts.map +1 -0
- package/dist/types/src/types/Agent.d.ts +79 -0
- package/dist/types/src/types/Agent.d.ts.map +1 -0
- package/dist/types/src/types/Chat.d.ts +56 -0
- package/dist/types/src/types/Chat.d.ts.map +1 -0
- 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 +89 -0
- package/dist/types/src/types/Plan.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +6 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/util/graphql.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -39
- 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 +202 -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 +61 -0
- package/src/blueprints/browser/blueprint.ts +40 -0
- package/src/blueprints/browser/index.ts +5 -0
- package/src/blueprints/database/blueprint.conversations.json +1 -0
- package/src/blueprints/database/blueprint.test.ts +531 -0
- package/src/blueprints/database/blueprint.ts +66 -0
- package/src/blueprints/database/functions/context-add.ts +24 -0
- package/src/blueprints/database/functions/context-remove.ts +24 -0
- package/src/blueprints/database/functions/definitions.ts +318 -0
- package/src/blueprints/database/functions/index.ts +23 -0
- package/src/blueprints/database/functions/load.ts +19 -0
- package/src/blueprints/database/functions/object-create.ts +38 -0
- package/src/blueprints/database/functions/object-delete.ts +20 -0
- package/src/blueprints/database/functions/object-update.ts +30 -0
- package/src/blueprints/database/functions/query.ts +63 -0
- package/src/blueprints/database/functions/relation-create.ts +34 -0
- package/src/blueprints/database/functions/relation-delete.ts +21 -0
- package/src/blueprints/database/functions/schema-add.ts +28 -0
- package/src/blueprints/database/functions/schema-list.ts +33 -0
- package/src/blueprints/database/functions/tag-add.ts +21 -0
- package/src/blueprints/database/functions/tag-remove.ts +21 -0
- package/src/blueprints/database/index.ts +21 -0
- package/src/blueprints/discord/blueprint.ts +41 -0
- package/src/blueprints/discord/functions/definitions.ts +70 -0
- package/src/blueprints/discord/functions/fetch-messages.test.ts +50 -0
- package/src/blueprints/discord/functions/fetch-messages.ts +198 -0
- package/src/blueprints/discord/functions/index.ts +9 -0
- package/src/blueprints/discord/index.ts +2 -3
- package/src/blueprints/github/functions/definitions.ts +26 -0
- package/src/blueprints/github/functions/fetch-prs.ts +24 -0
- package/src/blueprints/github/functions/index.ts +9 -0
- package/src/blueprints/github/index.ts +5 -0
- package/src/blueprints/index.ts +11 -6
- package/src/blueprints/linear/blueprint.ts +42 -0
- package/src/blueprints/linear/functions/definitions.ts +23 -0
- package/src/blueprints/linear/functions/index.ts +9 -0
- package/src/blueprints/linear/functions/linear.test.ts +57 -0
- package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +44 -51
- package/src/blueprints/linear/index.ts +2 -3
- 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 +24 -0
- package/src/blueprints/planning/functions/index.ts +9 -0
- package/src/blueprints/planning/functions/update-tasks.md +116 -0
- package/src/blueprints/planning/functions/update-tasks.test.ts +55 -0
- package/src/blueprints/planning/functions/update-tasks.ts +67 -0
- package/src/blueprints/planning/index.ts +3 -4
- package/src/blueprints/project/blueprint.conversations.json +1 -0
- package/src/blueprints/project/blueprint.test.ts +712 -0
- package/src/blueprints/project/blueprint.ts +64 -0
- package/src/blueprints/project/functions/add-artifact.ts +31 -0
- package/src/blueprints/project/functions/agent.ts +69 -0
- package/src/blueprints/project/functions/definitions.ts +92 -0
- package/src/blueprints/project/functions/get-context.ts +47 -0
- package/src/blueprints/project/functions/index.ts +14 -0
- package/src/blueprints/project/functions/qualifier.ts +90 -0
- package/src/blueprints/project/index.ts +6 -0
- 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 +153 -0
- package/src/blueprints/project-wizard/index.ts +6 -0
- package/src/blueprints/testing.ts +29 -8
- package/src/blueprints/websearch/blueprint.conversations.json +1 -0
- package/src/blueprints/websearch/blueprint.test.ts +39 -0
- package/src/blueprints/websearch/blueprint.ts +30 -0
- 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 +3 -4
- package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +6 -1
- package/src/crud/graph.test.ts +44 -0
- package/src/crud/graph.ts +378 -0
- package/src/crud/index.ts +5 -0
- package/src/errors.ts +25 -0
- package/src/functions/READ_THIS.md +5 -0
- package/src/functions/agent/definitions.ts +56 -0
- package/src/functions/agent/index.ts +3 -5
- package/src/functions/agent/prompt.conversations.json +1 -0
- package/src/functions/agent/prompt.test.ts +78 -0
- package/src/functions/agent/prompt.ts +210 -87
- package/src/functions/index.ts +0 -6
- package/src/index.ts +3 -1
- package/src/sync/sync.ts +52 -34
- package/src/testing/index.ts +2 -1
- package/src/testing/plugins.tsx +79 -0
- package/src/toolkits/WebToolkit.ts +33 -0
- package/src/toolkits/index.ts +5 -0
- package/src/types/Agent.ts +238 -0
- package/src/types/Chat.ts +63 -0
- package/src/types/McpServer.ts +37 -0
- package/src/types/Memory.ts +24 -0
- package/src/types/Plan.ts +111 -0
- package/src/types/index.ts +9 -0
- package/dist/lib/browser/index.mjs +0 -2481
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/node-esm/index.mjs +0 -2483
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/types/src/blueprints/design/design-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/design/design-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/design-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/design/design-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/index.d.ts +0 -3
- package/dist/types/src/blueprints/design/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/planning/planning-blueprint.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/research-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/research/research-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/research-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/research/research-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/websearch-toolkit.d.ts.map +0 -1
- package/dist/types/src/experimental/feed.test.d.ts +0 -2
- package/dist/types/src/experimental/feed.test.d.ts.map +0 -1
- package/dist/types/src/functions/discord/fetch-messages.d.ts.map +0 -1
- package/dist/types/src/functions/discord/fetch-messages.test.d.ts.map +0 -1
- package/dist/types/src/functions/discord/index.d.ts +0 -12
- package/dist/types/src/functions/discord/index.d.ts.map +0 -1
- package/dist/types/src/functions/document/index.d.ts +0 -12
- package/dist/types/src/functions/document/index.d.ts.map +0 -1
- package/dist/types/src/functions/document/read.d.ts +0 -7
- package/dist/types/src/functions/document/read.d.ts.map +0 -1
- package/dist/types/src/functions/document/update.d.ts +0 -6
- package/dist/types/src/functions/document/update.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +0 -173
- 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 -174
- package/dist/types/src/functions/entity-extraction/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 -3
- 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/functions/github/fetch-prs.d.ts +0 -6
- package/dist/types/src/functions/github/fetch-prs.d.ts.map +0 -1
- package/dist/types/src/functions/linear/index.d.ts +0 -9
- package/dist/types/src/functions/linear/index.d.ts.map +0 -1
- package/dist/types/src/functions/linear/linear.test.d.ts.map +0 -1
- package/dist/types/src/functions/linear/sync-issues.d.ts +0 -12
- package/dist/types/src/functions/linear/sync-issues.d.ts.map +0 -1
- package/dist/types/src/functions/research/create-document.d.ts +0 -7
- package/dist/types/src/functions/research/create-document.d.ts.map +0 -1
- package/dist/types/src/functions/research/graph.d.ts.map +0 -1
- package/dist/types/src/functions/research/graph.test.d.ts.map +0 -1
- package/dist/types/src/functions/research/index.d.ts +0 -19
- package/dist/types/src/functions/research/index.d.ts.map +0 -1
- package/dist/types/src/functions/research/research-graph.d.ts +0 -18
- package/dist/types/src/functions/research/research-graph.d.ts.map +0 -1
- package/dist/types/src/functions/research/research.d.ts +0 -13
- package/dist/types/src/functions/research/research.d.ts.map +0 -1
- package/dist/types/src/functions/research/research.test.d.ts +0 -2
- package/dist/types/src/functions/research/research.test.d.ts.map +0 -1
- package/dist/types/src/functions/research/types.d.ts +0 -384
- package/dist/types/src/functions/research/types.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/index.d.ts +0 -15
- package/dist/types/src/functions/tasks/index.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/read.d.ts +0 -7
- package/dist/types/src/functions/tasks/read.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/task-list.d.ts +0 -74
- package/dist/types/src/functions/tasks/task-list.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/task-list.test.d.ts +0 -2
- package/dist/types/src/functions/tasks/task-list.test.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/update.d.ts +0 -9
- package/dist/types/src/functions/tasks/update.d.ts.map +0 -1
- package/dist/types/src/plugins.d.ts +0 -19
- package/dist/types/src/plugins.d.ts.map +0 -1
- package/dist/types/src/testing/data/exa-search-1748337321991.d.ts +0 -38
- package/dist/types/src/testing/data/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/testing/data/exa-search-1748337331526.d.ts +0 -37
- package/dist/types/src/testing/data/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/testing/data/exa-search-1748337344119.d.ts +0 -58
- package/dist/types/src/testing/data/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/testing/data/index.d.ts +0 -3
- package/dist/types/src/testing/data/index.d.ts.map +0 -1
- package/src/blueprints/design/design-blueprint.test.ts +0 -108
- package/src/blueprints/design/design-blueprint.ts +0 -33
- package/src/blueprints/design/index.ts +0 -7
- package/src/blueprints/discord/discord-blueprint.ts +0 -34
- package/src/blueprints/linear/linear-blueprint.ts +0 -35
- package/src/blueprints/planning/planning-blueprint.test.ts +0 -129
- package/src/blueprints/planning/planning-blueprint.ts +0 -98
- package/src/blueprints/research/index.ts +0 -7
- package/src/blueprints/research/research-blueprint.test.ts +0 -7
- package/src/blueprints/research/research-blueprint.ts +0 -45
- package/src/blueprints/websearch/websearch-blueprint.ts +0 -20
- package/src/experimental/feed.test.ts +0 -108
- package/src/functions/discord/fetch-messages.test.ts +0 -59
- package/src/functions/discord/fetch-messages.ts +0 -251
- package/src/functions/discord/index.ts +0 -9
- package/src/functions/document/index.ts +0 -11
- package/src/functions/document/read.ts +0 -29
- package/src/functions/document/update.ts +0 -30
- package/src/functions/entity-extraction/entity-extraction.conversations.json +0 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +0 -100
- package/src/functions/entity-extraction/entity-extraction.ts +0 -163
- package/src/functions/entity-extraction/index.ts +0 -9
- package/src/functions/exa/exa.ts +0 -37
- package/src/functions/exa/index.ts +0 -6
- package/src/functions/exa/mock.ts +0 -71
- package/src/functions/github/fetch-prs.ts +0 -30
- package/src/functions/linear/index.ts +0 -9
- package/src/functions/linear/linear.test.ts +0 -86
- package/src/functions/research/create-document.ts +0 -69
- package/src/functions/research/graph.test.ts +0 -69
- package/src/functions/research/graph.ts +0 -388
- package/src/functions/research/index.ts +0 -15
- package/src/functions/research/instructions-research.tpl +0 -98
- package/src/functions/research/research-graph.ts +0 -47
- package/src/functions/research/research.conversations.json +0 -10714
- package/src/functions/research/research.test.ts +0 -240
- package/src/functions/research/research.ts +0 -155
- package/src/functions/research/types.ts +0 -24
- package/src/functions/tasks/index.ts +0 -11
- package/src/functions/tasks/read.ts +0 -34
- package/src/functions/tasks/task-list.test.ts +0 -99
- package/src/functions/tasks/task-list.ts +0 -165
- package/src/functions/tasks/update.ts +0 -52
- package/src/plugins.tsx +0 -68
- package/src/testing/data/exa-search-1748337321991.ts +0 -131
- package/src/testing/data/exa-search-1748337331526.ts +0 -144
- package/src/testing/data/exa-search-1748337344119.ts +0 -133
- package/src/testing/data/index.ts +0 -11
- /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.d.ts +0 -0
- /package/dist/types/src/{functions/linear → blueprints/linear/functions}/linear.test.d.ts +0 -0
- /package/dist/types/src/{functions/research → crud}/graph.test.d.ts +0 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { AiContext } from '@dxos/assistant';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Obj, Ref, Relation, Tag } from '@dxos/echo';
|
|
10
|
+
import { trim } from '@dxos/util';
|
|
11
|
+
|
|
12
|
+
export const Query = Operation.make({
|
|
13
|
+
meta: {
|
|
14
|
+
key: 'org.dxos.function.database.query',
|
|
15
|
+
name: 'Query',
|
|
16
|
+
description: trim`
|
|
17
|
+
Query for objects in ECHO.
|
|
18
|
+
Use this tool when searching for information in the space (both automerge and queues).
|
|
19
|
+
Currently, two types of queries are supported:
|
|
20
|
+
- Full-text search - terms may appear anywhere in the object.
|
|
21
|
+
- Type-based search - objects of a specific type.
|
|
22
|
+
You can use them together, for example, to search for objects of a specific type that match a full-text query.
|
|
23
|
+
Important: Whem querying by typename, make sure to list the schema first, to get the exact typename.
|
|
24
|
+
|
|
25
|
+
Omit both typename and text to search for all objects.
|
|
26
|
+
|
|
27
|
+
<output_format>
|
|
28
|
+
You can choose to either return the full object data, or just the DXN, type and label.
|
|
29
|
+
When expecting a lot of results, run with includeContent=false to not pollute the context, and then load specific objects using the load tool.
|
|
30
|
+
|
|
31
|
+
You can choose to get the content right away, if you don't expect a lot of results.
|
|
32
|
+
To load content right away, run with includeContent=true.
|
|
33
|
+
When loading content, set an appropriate limit on the number of results to avoid overwhelming the context.
|
|
34
|
+
</output_format>
|
|
35
|
+
|
|
36
|
+
<example description="All tasks related to Cyberdyne and Bob">
|
|
37
|
+
{
|
|
38
|
+
"typename": "org.dxos.type.task",
|
|
39
|
+
"text": "cyberdyne bob",
|
|
40
|
+
}
|
|
41
|
+
</example>
|
|
42
|
+
|
|
43
|
+
<example description="Financial report Q1 2026">
|
|
44
|
+
{
|
|
45
|
+
"typename": "org.dxos.type.document",
|
|
46
|
+
"text": "financial report Q1 2026",
|
|
47
|
+
"includeContent": true
|
|
48
|
+
"limit": 3
|
|
49
|
+
}
|
|
50
|
+
</example>
|
|
51
|
+
|
|
52
|
+
<example description="Emails from specific mailboxes">
|
|
53
|
+
{
|
|
54
|
+
"in": [{"/" : "dxn:echo:@:YYYYYY"}, {"/" : "dxn:echo:@:XXXXXXX"}],
|
|
55
|
+
"typename": "org.dxos.type.email",
|
|
56
|
+
"includeContent": true,
|
|
57
|
+
"limit": 20
|
|
58
|
+
}
|
|
59
|
+
</example>
|
|
60
|
+
`,
|
|
61
|
+
},
|
|
62
|
+
input: Schema.Struct({
|
|
63
|
+
in: Schema.optional(
|
|
64
|
+
Schema.Array(Ref.Ref(Obj.Unknown)).annotations({
|
|
65
|
+
description:
|
|
66
|
+
'Scope the query to children of specific objects (transitively). ' +
|
|
67
|
+
'Use this to query items within containers such as feeds or folders. ' +
|
|
68
|
+
'For example, to find emails use `in: [mailbox1.feed, mailbox2.feed]`.',
|
|
69
|
+
}),
|
|
70
|
+
),
|
|
71
|
+
typename: Schema.optional(
|
|
72
|
+
Schema.String.annotations({
|
|
73
|
+
description: 'The typename of the objects to list.',
|
|
74
|
+
example: 'org.dxos.type.task',
|
|
75
|
+
}),
|
|
76
|
+
),
|
|
77
|
+
text: Schema.optional(
|
|
78
|
+
Schema.String.annotations({
|
|
79
|
+
description: 'Full text search query.',
|
|
80
|
+
example: 'email cyberdyne bob',
|
|
81
|
+
}),
|
|
82
|
+
),
|
|
83
|
+
includeContent: Schema.optional(
|
|
84
|
+
Schema.Boolean.annotations({
|
|
85
|
+
description: 'Include the full object data in the response.',
|
|
86
|
+
default: false,
|
|
87
|
+
}),
|
|
88
|
+
),
|
|
89
|
+
limit: Schema.optional(
|
|
90
|
+
Schema.Number.annotations({
|
|
91
|
+
description: 'The maximum number of results to return.',
|
|
92
|
+
default: 10,
|
|
93
|
+
}),
|
|
94
|
+
),
|
|
95
|
+
includeQueues: Schema.optional(
|
|
96
|
+
Schema.Boolean.annotations({
|
|
97
|
+
description: 'Search in queues as well as spaces. Only use this if searching for emails.',
|
|
98
|
+
default: false,
|
|
99
|
+
}),
|
|
100
|
+
),
|
|
101
|
+
}),
|
|
102
|
+
output: Schema.Array(Schema.Unknown),
|
|
103
|
+
services: [Database.Service],
|
|
104
|
+
}).pipe(Operation.intrinsic);
|
|
105
|
+
|
|
106
|
+
export const Load = Operation.make({
|
|
107
|
+
meta: {
|
|
108
|
+
key: 'org.dxos.function.database.load',
|
|
109
|
+
name: 'Load object',
|
|
110
|
+
description: trim`
|
|
111
|
+
Loads the object or relation content.
|
|
112
|
+
Can load multiple objects at at time.
|
|
113
|
+
Use the to read the data when you have a DXN.
|
|
114
|
+
Call this tool with an array of one or more DXNs or object IDs.
|
|
115
|
+
When use see a reference ({ '/': 'dxn:...' }), you can call this function to load the object.
|
|
116
|
+
Note that returned data is only a snapshot in time, and might have changed since the object was last loaded.
|
|
117
|
+
`,
|
|
118
|
+
},
|
|
119
|
+
input: Schema.Struct({
|
|
120
|
+
refs: Schema.Array(Ref.Ref(Obj.Unknown)),
|
|
121
|
+
}),
|
|
122
|
+
output: Schema.Unknown,
|
|
123
|
+
services: [Database.Service],
|
|
124
|
+
}).pipe(Operation.intrinsic);
|
|
125
|
+
|
|
126
|
+
export const ObjectCreate = Operation.make({
|
|
127
|
+
meta: {
|
|
128
|
+
key: 'org.dxos.function.database.object-create',
|
|
129
|
+
name: 'Create object',
|
|
130
|
+
description: trim`
|
|
131
|
+
Creates a new object and adds it to the current space.
|
|
132
|
+
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: { "/": "dxn:..." }.
|
|
134
|
+
Reference examples: { "/": "dxn:echo:@:01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "dxn:queue:data:01KG7R1ZXWFMWQ4DA1Q6TN1DG4:01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
|
|
135
|
+
`,
|
|
136
|
+
},
|
|
137
|
+
input: Schema.Struct({
|
|
138
|
+
typename: Schema.String,
|
|
139
|
+
data: Schema.Any,
|
|
140
|
+
}),
|
|
141
|
+
output: Schema.Unknown,
|
|
142
|
+
services: [Database.Service],
|
|
143
|
+
}).pipe(Operation.intrinsic);
|
|
144
|
+
|
|
145
|
+
export const ObjectUpdate = Operation.make({
|
|
146
|
+
meta: {
|
|
147
|
+
key: 'org.dxos.function.database.object-update',
|
|
148
|
+
name: 'Update object',
|
|
149
|
+
description: trim`
|
|
150
|
+
Updates the object properties.
|
|
151
|
+
References are provided in the following format: { "/": "dxn:..." }.
|
|
152
|
+
Reference examples: { "/": "dxn:echo:@:01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }, { "/": "dxn:queue:data:01KG7R1ZXWFMWQ4DA1Q6TN1DG4:01KG7R1ZXWFMWQ4DA1Q6TN1DG4" }
|
|
153
|
+
`,
|
|
154
|
+
},
|
|
155
|
+
input: Schema.Struct({
|
|
156
|
+
obj: Ref.Ref(Obj.Unknown),
|
|
157
|
+
properties: Schema.Record({ key: Schema.String, value: Schema.Any }),
|
|
158
|
+
}),
|
|
159
|
+
output: Schema.Unknown,
|
|
160
|
+
services: [Database.Service],
|
|
161
|
+
}).pipe(Operation.intrinsic);
|
|
162
|
+
|
|
163
|
+
export const ObjectDelete = Operation.make({
|
|
164
|
+
meta: {
|
|
165
|
+
key: 'org.dxos.function.database.object-delete',
|
|
166
|
+
name: 'Delete object',
|
|
167
|
+
description: trim`
|
|
168
|
+
Deletes the object.
|
|
169
|
+
`,
|
|
170
|
+
},
|
|
171
|
+
input: Schema.Struct({
|
|
172
|
+
obj: Ref.Ref(Obj.Unknown),
|
|
173
|
+
}),
|
|
174
|
+
output: Schema.Void,
|
|
175
|
+
services: [Database.Service],
|
|
176
|
+
}).pipe(Operation.intrinsic);
|
|
177
|
+
|
|
178
|
+
export const SchemaAdd = Operation.make({
|
|
179
|
+
meta: {
|
|
180
|
+
key: 'org.dxos.function.database.schema-add',
|
|
181
|
+
name: 'Add schema',
|
|
182
|
+
description: trim`
|
|
183
|
+
Adds a schema to the space.
|
|
184
|
+
The name will be used when displayed to the user.
|
|
185
|
+
`,
|
|
186
|
+
},
|
|
187
|
+
input: Schema.Struct({
|
|
188
|
+
name: Schema.String,
|
|
189
|
+
typename: Schema.String.annotations({
|
|
190
|
+
description: 'The typename of the schema in the format of "com.example.type.type".',
|
|
191
|
+
}),
|
|
192
|
+
jsonSchema: Schema.Any,
|
|
193
|
+
}),
|
|
194
|
+
output: Schema.Void,
|
|
195
|
+
services: [Database.Service],
|
|
196
|
+
}).pipe(Operation.intrinsic);
|
|
197
|
+
|
|
198
|
+
export const SchemaList = Operation.make({
|
|
199
|
+
meta: {
|
|
200
|
+
key: 'org.dxos.function.database.schema-list',
|
|
201
|
+
name: 'List schemas',
|
|
202
|
+
description: trim`
|
|
203
|
+
Lists schemas definitions.
|
|
204
|
+
`,
|
|
205
|
+
},
|
|
206
|
+
input: Schema.Struct({
|
|
207
|
+
limit: Schema.optional(Schema.Number),
|
|
208
|
+
}),
|
|
209
|
+
output: Schema.Array(Schema.Unknown),
|
|
210
|
+
services: [Database.Service],
|
|
211
|
+
}).pipe(Operation.intrinsic);
|
|
212
|
+
|
|
213
|
+
export const ContextAdd = Operation.make({
|
|
214
|
+
meta: {
|
|
215
|
+
key: 'org.dxos.function.database.context-add',
|
|
216
|
+
name: 'Add to context',
|
|
217
|
+
description: trim`
|
|
218
|
+
Adds the object to the chat context.
|
|
219
|
+
Use this it for objects that are useful long-term for the conversation.
|
|
220
|
+
`,
|
|
221
|
+
},
|
|
222
|
+
input: Schema.Struct({
|
|
223
|
+
obj: Ref.Ref(Obj.Unknown).annotations({
|
|
224
|
+
description: 'Object to add to the chat context.',
|
|
225
|
+
}),
|
|
226
|
+
}),
|
|
227
|
+
output: Schema.Void,
|
|
228
|
+
services: [AiContext.Service],
|
|
229
|
+
}).pipe(Operation.intrinsic);
|
|
230
|
+
|
|
231
|
+
export const ContextRemove = Operation.make({
|
|
232
|
+
meta: {
|
|
233
|
+
key: 'org.dxos.function.database.context-remove',
|
|
234
|
+
name: 'Remove from context',
|
|
235
|
+
description: trim`
|
|
236
|
+
Removes the object from the chat context.
|
|
237
|
+
Use this it for objects that are no longer useful for the conversation.
|
|
238
|
+
`,
|
|
239
|
+
},
|
|
240
|
+
input: Schema.Struct({
|
|
241
|
+
obj: Ref.Ref(Obj.Unknown).annotations({
|
|
242
|
+
description: 'Object to remove from the chat context.',
|
|
243
|
+
}),
|
|
244
|
+
}),
|
|
245
|
+
output: Schema.Void,
|
|
246
|
+
services: [AiContext.Service],
|
|
247
|
+
}).pipe(Operation.intrinsic);
|
|
248
|
+
|
|
249
|
+
export const RelationCreate = Operation.make({
|
|
250
|
+
meta: {
|
|
251
|
+
key: 'org.dxos.function.database.relation-create',
|
|
252
|
+
name: 'Create relation',
|
|
253
|
+
description: trim`
|
|
254
|
+
Creates a new relation and adds it to the current space.
|
|
255
|
+
Get the schema from the schema-list tool and ensure that the data matches the corresponding schema.
|
|
256
|
+
`,
|
|
257
|
+
},
|
|
258
|
+
input: Schema.Struct({
|
|
259
|
+
typename: Schema.String,
|
|
260
|
+
source: Ref.Ref(Obj.Unknown),
|
|
261
|
+
target: Ref.Ref(Obj.Unknown),
|
|
262
|
+
properties: Schema.Any.annotations({
|
|
263
|
+
description: 'The data to be stored in the relation.',
|
|
264
|
+
}),
|
|
265
|
+
}),
|
|
266
|
+
output: Schema.Unknown,
|
|
267
|
+
services: [Database.Service],
|
|
268
|
+
}).pipe(Operation.intrinsic);
|
|
269
|
+
|
|
270
|
+
export const RelationDelete = Operation.make({
|
|
271
|
+
meta: {
|
|
272
|
+
key: 'org.dxos.function.database.relation-delete',
|
|
273
|
+
name: 'Delete relation',
|
|
274
|
+
description: trim`
|
|
275
|
+
Deletes the relation.
|
|
276
|
+
`,
|
|
277
|
+
},
|
|
278
|
+
input: Schema.Struct({
|
|
279
|
+
rel: Ref.Ref(Relation.Unknown),
|
|
280
|
+
}),
|
|
281
|
+
output: Schema.Void,
|
|
282
|
+
services: [Database.Service],
|
|
283
|
+
}).pipe(Operation.intrinsic);
|
|
284
|
+
|
|
285
|
+
export const TagAdd = Operation.make({
|
|
286
|
+
meta: {
|
|
287
|
+
key: 'org.dxos.function.database.tag-add',
|
|
288
|
+
name: 'Add tag',
|
|
289
|
+
description: trim`
|
|
290
|
+
Adds a tag to an object.
|
|
291
|
+
Tags are objects of type ${Tag.Tag.typename}.
|
|
292
|
+
You must search database for available tags, or create a new one.
|
|
293
|
+
`,
|
|
294
|
+
},
|
|
295
|
+
input: Schema.Struct({
|
|
296
|
+
tag: Ref.Ref(Obj.Unknown),
|
|
297
|
+
obj: Ref.Ref(Obj.Unknown),
|
|
298
|
+
}),
|
|
299
|
+
output: Schema.Unknown,
|
|
300
|
+
services: [Database.Service],
|
|
301
|
+
}).pipe(Operation.intrinsic);
|
|
302
|
+
|
|
303
|
+
export const TagRemove = Operation.make({
|
|
304
|
+
meta: {
|
|
305
|
+
key: 'org.dxos.function.database.tag-remove',
|
|
306
|
+
name: 'Remove tag',
|
|
307
|
+
description: trim`
|
|
308
|
+
Removes a tag from an object.
|
|
309
|
+
Tags are objects of type ${Tag.Tag.typename}.
|
|
310
|
+
`,
|
|
311
|
+
},
|
|
312
|
+
input: Schema.Struct({
|
|
313
|
+
tag: Ref.Ref(Obj.Unknown),
|
|
314
|
+
obj: Ref.Ref(Obj.Unknown),
|
|
315
|
+
}),
|
|
316
|
+
output: Schema.Unknown,
|
|
317
|
+
services: [Database.Service],
|
|
318
|
+
}).pipe(Operation.intrinsic);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
|
+
|
|
7
|
+
export * from './definitions';
|
|
8
|
+
|
|
9
|
+
export const DatabaseHandlers = OperationHandlerSet.lazy(
|
|
10
|
+
() => import('./context-add'),
|
|
11
|
+
() => import('./context-remove'),
|
|
12
|
+
() => import('./load'),
|
|
13
|
+
() => import('./object-create'),
|
|
14
|
+
() => import('./object-delete'),
|
|
15
|
+
() => import('./object-update'),
|
|
16
|
+
() => import('./query'),
|
|
17
|
+
() => import('./relation-create'),
|
|
18
|
+
() => import('./relation-delete'),
|
|
19
|
+
() => import('./schema-add'),
|
|
20
|
+
() => import('./schema-list'),
|
|
21
|
+
() => import('./tag-add'),
|
|
22
|
+
() => import('./tag-remove'),
|
|
23
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Array from 'effect/Array';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Database, Entity } from '@dxos/echo';
|
|
10
|
+
|
|
11
|
+
import { Load } from './definitions';
|
|
12
|
+
|
|
13
|
+
export default Load.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ refs }) {
|
|
16
|
+
return yield* Effect.forEach(refs, Database.load).pipe(Effect.map(Array.map(Entity.toJSON)));
|
|
17
|
+
}),
|
|
18
|
+
),
|
|
19
|
+
);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Entity, Obj, Type } from '@dxos/echo';
|
|
9
|
+
import { EncodedReference } from '@dxos/echo-protocol';
|
|
10
|
+
import { invariant } from '@dxos/invariant';
|
|
11
|
+
import { deepMapValues } from '@dxos/util';
|
|
12
|
+
|
|
13
|
+
import { ObjectCreate } from './definitions';
|
|
14
|
+
|
|
15
|
+
export default ObjectCreate.pipe(
|
|
16
|
+
Operation.withHandler(
|
|
17
|
+
Effect.fn(function* ({ typename, data }) {
|
|
18
|
+
const { db } = yield* Database.Service;
|
|
19
|
+
const schema = yield* Effect.promise(() =>
|
|
20
|
+
db.schemaRegistry.query({ typename, location: ['database', 'runtime'] }).first(),
|
|
21
|
+
);
|
|
22
|
+
invariant(Type.isObjectSchema(schema), 'Schema is not an object schema');
|
|
23
|
+
|
|
24
|
+
const object = db.add(
|
|
25
|
+
Obj.make(
|
|
26
|
+
schema,
|
|
27
|
+
deepMapValues(data, (value, recurse) => {
|
|
28
|
+
if (EncodedReference.isEncodedReference(value)) {
|
|
29
|
+
return db.makeRef(EncodedReference.toDXN(value));
|
|
30
|
+
}
|
|
31
|
+
return recurse(value);
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
return Entity.toJSON(object);
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { ObjectDelete } from './definitions';
|
|
11
|
+
|
|
12
|
+
export default ObjectDelete.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ obj }) {
|
|
15
|
+
const { db } = yield* Database.Service;
|
|
16
|
+
const object = yield* Database.load(obj);
|
|
17
|
+
db.remove(object);
|
|
18
|
+
}),
|
|
19
|
+
),
|
|
20
|
+
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Entity } from '@dxos/echo';
|
|
9
|
+
import { EncodedReference } from '@dxos/echo-protocol';
|
|
10
|
+
|
|
11
|
+
import { ObjectUpdate } from './definitions';
|
|
12
|
+
|
|
13
|
+
export default ObjectUpdate.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ obj, properties }) {
|
|
16
|
+
const { db } = yield* Database.Service;
|
|
17
|
+
const object = yield* Database.load(obj);
|
|
18
|
+
Entity.update(object as Entity.Any, (obj) => {
|
|
19
|
+
for (const [key, value] of Object.entries(properties)) {
|
|
20
|
+
if (EncodedReference.isEncodedReference(value)) {
|
|
21
|
+
obj[key] = db.makeRef(EncodedReference.toDXN(value));
|
|
22
|
+
} else {
|
|
23
|
+
obj[key] = value;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return Entity.toJSON(object);
|
|
28
|
+
}),
|
|
29
|
+
),
|
|
30
|
+
);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Entity, Filter, Obj, Query as EchoQuery } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { Query } from './definitions';
|
|
11
|
+
|
|
12
|
+
// TODO(burdon): Move to toolkit (i.e., tool not function).
|
|
13
|
+
export default Query.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ in: parents, typename, text, includeContent = false, limit = 10, includeQueues = false }) {
|
|
16
|
+
const { db } = yield* Database.Service;
|
|
17
|
+
let query: EchoQuery.Any;
|
|
18
|
+
if (text) {
|
|
19
|
+
query = EchoQuery.all(
|
|
20
|
+
...text.split(' ').map((term) => EchoQuery.select(Filter.text(term, { type: 'full-text' }))),
|
|
21
|
+
);
|
|
22
|
+
if (typename !== undefined) {
|
|
23
|
+
const schema = yield* Database.runSchemaQuery({ typename, location: ['database', 'runtime'] });
|
|
24
|
+
if (schema.length === 0) {
|
|
25
|
+
return yield* Effect.fail(new Error(`Schema ${typename} not found`));
|
|
26
|
+
}
|
|
27
|
+
query = query.select(Filter.type(schema[0]));
|
|
28
|
+
}
|
|
29
|
+
} else if (typename) {
|
|
30
|
+
const schema = yield* Database.runSchemaQuery({ typename, location: ['database', 'runtime'] });
|
|
31
|
+
if (schema.length === 0) {
|
|
32
|
+
return yield* Effect.fail(new Error(`Schema ${typename} not found`));
|
|
33
|
+
}
|
|
34
|
+
query = EchoQuery.select(Filter.type(schema[0]));
|
|
35
|
+
} else {
|
|
36
|
+
query = EchoQuery.select(Filter.everything());
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (parents && parents.length > 0) {
|
|
40
|
+
query = query.select(Filter.childOf(parents));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
query = query.limit(limit);
|
|
44
|
+
if (includeQueues) {
|
|
45
|
+
// Must scope to the current space: `from({ allFeedsFromSpaces: true })` alone has no spaceIds, so the SQL
|
|
46
|
+
// index returns nothing (see ObjectMetaIndex.buildSourceCondition / early returns when spaceIds are empty).
|
|
47
|
+
query = query.from(db, { includeFeeds: true });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
yield* Database.flush();
|
|
51
|
+
const results = yield* Database.runQuery(query);
|
|
52
|
+
if (includeContent) {
|
|
53
|
+
return results.map((obj) => Entity.toJSON(obj));
|
|
54
|
+
} else {
|
|
55
|
+
return results.map((obj) => ({
|
|
56
|
+
dxn: Obj.getDXN(obj).toString(),
|
|
57
|
+
typename: Obj.getTypename(obj),
|
|
58
|
+
label: Obj.getLabel(obj),
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
),
|
|
63
|
+
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Entity, Relation, Type } from '@dxos/echo';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
|
|
11
|
+
import { RelationCreate } from './definitions';
|
|
12
|
+
|
|
13
|
+
export default RelationCreate.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ typename, source, target, properties }) {
|
|
16
|
+
const { db } = yield* Database.Service;
|
|
17
|
+
const schema = yield* Effect.promise(() =>
|
|
18
|
+
db.schemaRegistry.query({ typename, location: ['database', 'runtime'] }).first(),
|
|
19
|
+
);
|
|
20
|
+
invariant(Type.isRelationSchema(schema), 'Schema is not a relation schema');
|
|
21
|
+
|
|
22
|
+
const sourceObj = yield* Database.load(source);
|
|
23
|
+
const targetObj = yield* Database.load(target);
|
|
24
|
+
const relation = db.add(
|
|
25
|
+
Relation.make(schema, {
|
|
26
|
+
[Relation.Source]: sourceObj,
|
|
27
|
+
[Relation.Target]: targetObj,
|
|
28
|
+
...properties,
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
31
|
+
return Entity.toJSON(relation);
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { RelationDelete } from './definitions';
|
|
11
|
+
|
|
12
|
+
export default RelationDelete.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ rel }) {
|
|
15
|
+
const { db } = yield* Database.Service;
|
|
16
|
+
const relation = yield* Database.load(rel);
|
|
17
|
+
// TODO(dmaretskyi): Echo types broken.
|
|
18
|
+
db.remove(relation as any);
|
|
19
|
+
}),
|
|
20
|
+
),
|
|
21
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { SchemaAdd } from './definitions';
|
|
11
|
+
|
|
12
|
+
export default SchemaAdd.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ name, typename, jsonSchema }) {
|
|
15
|
+
const { db } = yield* Database.Service;
|
|
16
|
+
yield* Effect.promise(() =>
|
|
17
|
+
db.schemaRegistry.register([
|
|
18
|
+
{
|
|
19
|
+
typename,
|
|
20
|
+
version: '0.1.0',
|
|
21
|
+
jsonSchema,
|
|
22
|
+
name,
|
|
23
|
+
},
|
|
24
|
+
]),
|
|
25
|
+
);
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Routine, Blueprint, Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Feed, JsonSchema, Type, View } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { SchemaList } from './definitions';
|
|
11
|
+
|
|
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.PersistentType, View.View, Routine.Routine, Blueprint.Blueprint, Feed.Feed];
|
|
14
|
+
const excludedTypenames = EXCLUDED_TYPES.map((type) => Type.getTypename(type));
|
|
15
|
+
|
|
16
|
+
export default SchemaList.pipe(
|
|
17
|
+
Operation.withHandler(
|
|
18
|
+
Effect.fn(function* () {
|
|
19
|
+
const { db } = yield* Database.Service;
|
|
20
|
+
const schema = yield* Effect.promise(() => db.schemaRegistry.query({ location: ['database', 'runtime'] }).run());
|
|
21
|
+
return schema
|
|
22
|
+
.filter((schema) => !excludedTypenames.includes(Type.getTypename(schema)))
|
|
23
|
+
.map((schema) => {
|
|
24
|
+
const meta = Type.getMeta(schema);
|
|
25
|
+
return {
|
|
26
|
+
typename: Type.getTypename(schema),
|
|
27
|
+
jsonSchema: JsonSchema.toJsonSchema(schema),
|
|
28
|
+
kind: meta?.sourceSchema ? 'relation' : 'record',
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Entity, Obj } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { TagAdd } from './definitions';
|
|
11
|
+
|
|
12
|
+
export default TagAdd.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ tag, obj }) {
|
|
15
|
+
const object = yield* Database.load(obj);
|
|
16
|
+
const tagObj = yield* Database.load(tag);
|
|
17
|
+
Entity.update(object, (object) => Entity.addTag(object, Obj.getDXN(tagObj).toString()));
|
|
18
|
+
return Entity.toJSON(object);
|
|
19
|
+
}),
|
|
20
|
+
),
|
|
21
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Entity, Obj } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { TagRemove } from './definitions';
|
|
11
|
+
|
|
12
|
+
export default TagRemove.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fn(function* ({ tag, obj }) {
|
|
15
|
+
const object = yield* Database.load(obj);
|
|
16
|
+
const tagObj = yield* Database.load(tag);
|
|
17
|
+
Entity.update(object, (object) => Entity.removeTag(object, Obj.getDXN(tagObj).toString()));
|
|
18
|
+
return Entity.toJSON(object);
|
|
19
|
+
}),
|
|
20
|
+
),
|
|
21
|
+
);
|