@dxos/assistant-toolkit 0.8.4-main.9735255 → 0.8.4-main.abd8ff62ef
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-BA5WQRDU.mjs +30 -0
- package/dist/lib/neutral/add-artifact-BA5WQRDU.mjs.map +7 -0
- package/dist/lib/neutral/agent-M2EW5M36.mjs +65 -0
- package/dist/lib/neutral/agent-M2EW5M36.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CLHVRIYF.mjs +293 -0
- package/dist/lib/neutral/chunk-CLHVRIYF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CVUA23QI.mjs +332 -0
- package/dist/lib/neutral/chunk-CVUA23QI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-D5MG5OKX.mjs +75 -0
- package/dist/lib/neutral/chunk-D5MG5OKX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-E2XRNXWP.mjs +100 -0
- package/dist/lib/neutral/chunk-E2XRNXWP.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-J37DYY7A.mjs +51 -0
- package/dist/lib/neutral/chunk-J37DYY7A.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JCYLFOFK.mjs +70 -0
- package/dist/lib/neutral/chunk-JCYLFOFK.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-KY2TIPJ5.mjs +108 -0
- package/dist/lib/neutral/chunk-KY2TIPJ5.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MMTKJBB5.mjs +140 -0
- package/dist/lib/neutral/chunk-MMTKJBB5.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-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-ZFXLTBZG.mjs +73 -0
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs.map +7 -0
- package/dist/lib/neutral/context-add-IIDPRRVB.mjs +22 -0
- package/dist/lib/neutral/context-add-IIDPRRVB.mjs.map +7 -0
- package/dist/lib/neutral/context-remove-RDYV4PD4.mjs +22 -0
- package/dist/lib/neutral/context-remove-RDYV4PD4.mjs.map +7 -0
- package/dist/lib/neutral/create-project-GLDEAWTT.mjs +35 -0
- package/dist/lib/neutral/create-project-GLDEAWTT.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-PWGUG5G3.mjs +139 -0
- package/dist/lib/neutral/fetch-messages-PWGUG5G3.mjs.map +7 -0
- package/dist/lib/neutral/get-context-B55SX5Y4.mjs +35 -0
- package/dist/lib/neutral/get-context-B55SX5Y4.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +904 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/load-LI7HHVD6.mjs +17 -0
- package/dist/lib/neutral/load-LI7HHVD6.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/object-create-52Z7YKIA.mjs +35 -0
- package/dist/lib/neutral/object-create-52Z7YKIA.mjs.map +7 -0
- package/dist/lib/neutral/object-delete-I266YAXI.mjs +18 -0
- package/dist/lib/neutral/object-delete-I266YAXI.mjs.map +7 -0
- package/dist/lib/neutral/object-update-HY4GI7LA.mjs +28 -0
- package/dist/lib/neutral/object-update-HY4GI7LA.mjs.map +7 -0
- package/dist/lib/neutral/project-2YBPW5N7.mjs +23 -0
- package/dist/lib/neutral/project-rules-XUBEPDP6.mjs +78 -0
- package/dist/lib/neutral/project-rules-XUBEPDP6.mjs.map +7 -0
- package/dist/lib/neutral/prompt-2WZQERT4.mjs +167 -0
- package/dist/lib/neutral/prompt-2WZQERT4.mjs.map +7 -0
- package/dist/lib/neutral/qualifier-2AC2ICOB.mjs +88 -0
- package/dist/lib/neutral/qualifier-2AC2ICOB.mjs.map +7 -0
- package/dist/lib/neutral/query-B3NOYFCK.mjs +70 -0
- package/dist/lib/neutral/query-B3NOYFCK.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-Z3NGW4VU.mjs +34 -0
- package/dist/lib/neutral/relation-create-Z3NGW4VU.mjs.map +7 -0
- package/dist/lib/neutral/relation-delete-LXY7W2YO.mjs +18 -0
- package/dist/lib/neutral/relation-delete-LXY7W2YO.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-4TXJO2V7.mjs +24 -0
- package/dist/lib/neutral/schema-add-4TXJO2V7.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-PJS5AFZ3.mjs +38 -0
- package/dist/lib/neutral/schema-list-PJS5AFZ3.mjs.map +7 -0
- package/dist/lib/neutral/sync-issues-LOLHZNFL.mjs +167 -0
- package/dist/lib/neutral/sync-issues-LOLHZNFL.mjs.map +7 -0
- package/dist/lib/neutral/sync-triggers-EYJM4QWR.mjs +136 -0
- package/dist/lib/neutral/sync-triggers-EYJM4QWR.mjs.map +7 -0
- package/dist/lib/neutral/tag-add-5NOHUTIE.mjs +19 -0
- package/dist/lib/neutral/tag-add-5NOHUTIE.mjs.map +7 -0
- package/dist/lib/neutral/tag-remove-QTKYDJAW.mjs +19 -0
- package/dist/lib/neutral/tag-remove-QTKYDJAW.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-N2AK2VUR.mjs +16 -0
- package/dist/lib/neutral/update-blueprints-N2AK2VUR.mjs.map +7 -0
- package/dist/lib/neutral/update-tasks-ML2FCYU5.mjs +46 -0
- package/dist/lib/neutral/update-tasks-ML2FCYU5.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 +59 -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 +35 -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 +26 -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 +13 -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/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 +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 +11 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.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 +8 -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 +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 +15 -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 +73 -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 +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 +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} +3 -1
- package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
- package/dist/types/src/crud/graph.d.ts +7 -7
- 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 +60 -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 -74
- 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 +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/sync/sync.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/plugins.d.ts.map +1 -1
- 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 +1 -2
- package/dist/types/src/toolkits/index.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 +56 -0
- package/dist/types/src/types/Chat.d.ts.map +1 -0
- package/dist/types/src/types/McpServer.d.ts +18 -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 +34 -43
- 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 +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 +64 -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 +45 -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 +58 -0
- package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +37 -45
- 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/definitions.ts +137 -0
- package/src/blueprints/planning/functions/index.ts +9 -0
- package/src/blueprints/planning/functions/update-tasks.ts +45 -0
- package/src/blueprints/planning/index.ts +3 -4
- package/src/blueprints/project/blueprint.conversations.json +1 -0
- package/src/{initiative/initiative.test.ts → blueprints/project/blueprint.test.ts} +279 -50
- package/src/blueprints/project/blueprint.ts +64 -0
- package/src/blueprints/project/functions/add-artifact.ts +30 -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 +46 -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 +158 -0
- package/src/blueprints/project-wizard/index.ts +6 -0
- package/src/blueprints/testing.ts +23 -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 -5
- package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +6 -1
- package/src/crud/graph.test.ts +12 -14
- package/src/crud/graph.ts +11 -11
- package/src/errors.ts +25 -0
- package/src/functions/READ_THIS.md +5 -0
- package/src/functions/agent/definitions.ts +51 -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 +81 -0
- package/src/functions/agent/prompt.ts +209 -106
- package/src/functions/index.ts +0 -6
- package/src/index.ts +2 -1
- package/src/sync/sync.ts +25 -14
- package/src/testing/index.ts +1 -0
- package/src/testing/plugins.tsx +30 -19
- package/src/toolkits/WebToolkit.ts +33 -0
- package/src/toolkits/index.ts +1 -2
- package/src/types/Agent.ts +239 -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 +110 -0
- package/src/types/index.ts +9 -0
- package/dist/lib/browser/index.mjs +0 -2880
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/testing/index.mjs +0 -43
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/index.mjs +0 -2881
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/testing/index.mjs +0 -44
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/blueprints/design/design-blueprint.d.ts +0 -18
- 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 -18
- 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 -18
- 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 -18
- 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 -13
- 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 -174
- 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 -175
- 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 -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/document-create.d.ts +0 -9
- package/dist/types/src/functions/research/document-create.d.ts.map +0 -1
- package/dist/types/src/functions/research/index.d.ts +0 -21
- package/dist/types/src/functions/research/index.d.ts.map +0 -1
- package/dist/types/src/functions/research/research-graph.d.ts +0 -19
- package/dist/types/src/functions/research/research-graph.d.ts.map +0 -1
- package/dist/types/src/functions/research/research.d.ts +0 -14
- 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 -6
- 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/initiative/Initiative.d.ts +0 -84
- package/dist/types/src/initiative/Initiative.d.ts.map +0 -1
- package/dist/types/src/initiative/InitiativeSchema.d.ts +0 -19
- package/dist/types/src/initiative/InitiativeSchema.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/agent.d.ts +0 -37
- package/dist/types/src/initiative/functions/agent.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/getContext.d.ts +0 -17
- package/dist/types/src/initiative/functions/getContext.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/index.d.ts +0 -4
- package/dist/types/src/initiative/functions/index.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/update.d.ts +0 -7
- package/dist/types/src/initiative/functions/update.d.ts.map +0 -1
- package/dist/types/src/initiative/index.d.ts +0 -1
- package/dist/types/src/initiative/index.d.ts.map +0 -1
- package/dist/types/src/initiative/initiative.test.d.ts +0 -2
- package/dist/types/src/initiative/initiative.test.d.ts.map +0 -1
- package/dist/types/src/toolkits/AssistantToolkit.d.ts +0 -43
- package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +0 -1
- package/dist/types/src/toolkits/AssistantToolkit.test.d.ts +0 -2
- package/dist/types/src/toolkits/AssistantToolkit.test.d.ts.map +0 -1
- package/dist/types/src/toolkits/SystemToolkit.d.ts +0 -99
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +0 -1
- package/src/blueprints/design/design-blueprint.test.ts +0 -105
- package/src/blueprints/design/design-blueprint.ts +0 -31
- package/src/blueprints/design/index.ts +0 -7
- package/src/blueprints/discord/discord-blueprint.ts +0 -32
- package/src/blueprints/linear/linear-blueprint.ts +0 -33
- package/src/blueprints/planning/planning-blueprint.test.ts +0 -126
- package/src/blueprints/planning/planning-blueprint.ts +0 -96
- 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 -51
- package/src/blueprints/websearch/websearch-blueprint.ts +0 -18
- package/src/experimental/feed.test.ts +0 -111
- package/src/functions/discord/fetch-messages.test.ts +0 -58
- package/src/functions/discord/fetch-messages.ts +0 -252
- package/src/functions/discord/index.ts +0 -9
- package/src/functions/document/index.ts +0 -12
- package/src/functions/document/read.ts +0 -30
- package/src/functions/document/update.ts +0 -33
- package/src/functions/entity-extraction/entity-extraction.conversations.json +0 -6597
- package/src/functions/entity-extraction/entity-extraction.test.ts +0 -93
- package/src/functions/entity-extraction/entity-extraction.ts +0 -183
- 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 -6
- package/src/functions/exa/mock.ts +0 -71
- package/src/functions/github/fetch-prs.ts +0 -31
- package/src/functions/linear/index.ts +0 -9
- package/src/functions/linear/linear.test.ts +0 -84
- package/src/functions/research/document-create.ts +0 -76
- package/src/functions/research/index.ts +0 -14
- package/src/functions/research/research-graph.ts +0 -49
- package/src/functions/research/research-instructions.tpl +0 -106
- package/src/functions/research/research.conversations.json +0 -1
- package/src/functions/research/research.test.ts +0 -171
- package/src/functions/research/research.ts +0 -189
- package/src/functions/research/types.ts +0 -26
- package/src/functions/tasks/index.ts +0 -11
- package/src/functions/tasks/read.ts +0 -35
- 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 -53
- package/src/initiative/Initiative.ts +0 -99
- package/src/initiative/InitiativeSchema.ts +0 -37
- package/src/initiative/functions/agent.ts +0 -57
- package/src/initiative/functions/getContext.ts +0 -74
- package/src/initiative/functions/index.ts +0 -7
- package/src/initiative/functions/update.ts +0 -63
- package/src/initiative/index.ts +0 -3
- package/src/initiative/initiative.conversations.json +0 -1
- package/src/toolkits/AssistantToolkit.conversations.json +0 -1
- package/src/toolkits/AssistantToolkit.test.ts +0 -94
- package/src/toolkits/AssistantToolkit.ts +0 -70
- package/src/toolkits/SystemToolkit.ts +0 -299
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/project-2YBPW5N7.mjs.map} +0 -0
- /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
|
@@ -2,64 +2,148 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { describe, it } from '@effect/vitest';
|
|
5
|
+
import { describe, expect, it } from '@effect/vitest';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Exit from 'effect/Exit';
|
|
7
8
|
|
|
8
9
|
import { MemoizedAiService } from '@dxos/ai/testing';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { Blueprint } from '@dxos/
|
|
12
|
-
import { Database, Obj, Ref } from '@dxos/echo';
|
|
10
|
+
import { AiSession } from '@dxos/assistant';
|
|
11
|
+
import { SpaceProperties } from '@dxos/client-protocol';
|
|
12
|
+
import { Blueprint, Trigger, Operation, OperationHandlerSet } from '@dxos/compute';
|
|
13
|
+
import { Database, Feed, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
14
|
+
import { Collection } from '@dxos/echo';
|
|
13
15
|
import { acquireReleaseResource } from '@dxos/effect';
|
|
14
16
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
15
|
-
import {
|
|
17
|
+
import { QueueService } from '@dxos/functions';
|
|
16
18
|
import { TriggerDispatcher } from '@dxos/functions-runtime';
|
|
19
|
+
import { AssistantTestLayerWithTriggers } from '@dxos/functions-runtime/testing';
|
|
17
20
|
import { invariant } from '@dxos/invariant';
|
|
18
21
|
import { ObjectId } from '@dxos/keys';
|
|
22
|
+
import { MarkdownBlueprint } from '@dxos/plugin-markdown/blueprints';
|
|
23
|
+
import { MarkdownOperationHandlerSet } from '@dxos/plugin-markdown/operations';
|
|
24
|
+
import { WithProperties } from '@dxos/plugin-markdown/testing';
|
|
25
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
19
26
|
import { Text } from '@dxos/schema';
|
|
20
27
|
import { Message } from '@dxos/types';
|
|
21
28
|
import { trim } from '@dxos/util';
|
|
22
29
|
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
30
|
+
import { Chat, Plan, Agent } from '../../types';
|
|
31
|
+
import { PlanningBlueprint, PlanningHandlers } from '../planning';
|
|
32
|
+
import { AgentWizardHandlers, SyncTriggers } from '../project-wizard';
|
|
33
|
+
import AgentBlueprintDef from './blueprint';
|
|
34
|
+
import { AgentWorker, AgentBlueprintHandlers } from './functions';
|
|
25
35
|
|
|
26
36
|
ObjectId.dangerouslyDisableRandomness();
|
|
27
37
|
|
|
28
38
|
const TestLayer = AssistantTestLayerWithTriggers({
|
|
29
39
|
aiServicePreset: 'edge-remote',
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
operationHandlers: OperationHandlerSet.merge(
|
|
41
|
+
AgentBlueprintHandlers,
|
|
42
|
+
AgentWizardHandlers,
|
|
43
|
+
MarkdownOperationHandlerSet,
|
|
44
|
+
PlanningHandlers,
|
|
45
|
+
),
|
|
46
|
+
types: [
|
|
47
|
+
Agent.Agent,
|
|
48
|
+
Plan.Plan,
|
|
49
|
+
Chat.CompanionTo,
|
|
50
|
+
Chat.Chat,
|
|
51
|
+
SpaceProperties,
|
|
52
|
+
Blueprint.Blueprint,
|
|
53
|
+
Trigger.Trigger,
|
|
54
|
+
Text.Text,
|
|
55
|
+
Markdown.Document,
|
|
56
|
+
Collection.Collection,
|
|
57
|
+
],
|
|
32
58
|
tracing: 'pretty',
|
|
33
59
|
});
|
|
34
60
|
|
|
35
61
|
const SYSTEM = trim`
|
|
36
|
-
|
|
62
|
+
You are a helpful assistant that can help with tasks in the outside world.
|
|
63
|
+
Be transparent about what you are doing and what you are not doing.
|
|
64
|
+
If you do not have tools to complete the task, inform the user.
|
|
65
|
+
DO NOT PRETEND TO DO SOMETHING YOU CAN'T DO.
|
|
37
66
|
`;
|
|
38
67
|
|
|
39
|
-
describe('
|
|
68
|
+
describe('Agent', () => {
|
|
69
|
+
const blueprint = AgentBlueprintDef.make();
|
|
70
|
+
|
|
40
71
|
it.scoped(
|
|
41
|
-
'
|
|
72
|
+
'agent adds artifact to agent',
|
|
42
73
|
Effect.fnUntraced(
|
|
43
74
|
function* (_) {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
name: '
|
|
47
|
-
|
|
48
|
-
|
|
75
|
+
const agent = yield* Agent.makeInitialized(
|
|
76
|
+
{
|
|
77
|
+
name: 'Test Project',
|
|
78
|
+
instructions: 'A test project for adding artifacts.',
|
|
79
|
+
blueprints: [Ref.make(MarkdownBlueprint.make())],
|
|
80
|
+
},
|
|
81
|
+
blueprint,
|
|
49
82
|
);
|
|
50
|
-
|
|
51
|
-
yield* Database.Service.flush({ indexes: true });
|
|
52
|
-
const conversation = yield* acquireReleaseResource(
|
|
53
|
-
() => new AiConversation({ queue: initiative.chat?.target as any }),
|
|
54
|
-
);
|
|
55
|
-
yield* Effect.promise(() => conversation.context.open());
|
|
83
|
+
yield* Database.flush();
|
|
56
84
|
|
|
57
|
-
yield*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
85
|
+
const document = yield* Database.add(
|
|
86
|
+
Obj.make(Markdown.Document, {
|
|
87
|
+
name: 'Test Document',
|
|
88
|
+
content: Ref.make(Text.make('This is a test document with some content.')),
|
|
89
|
+
}),
|
|
90
|
+
);
|
|
91
|
+
yield* Database.flush();
|
|
92
|
+
|
|
93
|
+
expect(agent.artifacts).toHaveLength(0);
|
|
94
|
+
|
|
95
|
+
const chatFeed = agent.chat?.target?.feed?.target;
|
|
96
|
+
invariant(chatFeed, 'Agent chat feed not found.');
|
|
97
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>();
|
|
98
|
+
const session = yield* acquireReleaseResource(() => new AiSession({ feed: chatFeed, runtime }));
|
|
99
|
+
yield* Effect.promise(() => session.context.open());
|
|
100
|
+
|
|
101
|
+
const documentDxn = Obj.getDXN(document);
|
|
102
|
+
yield* session
|
|
103
|
+
.createRequest({
|
|
104
|
+
system: SYSTEM,
|
|
105
|
+
prompt: `Please add the document ${documentDxn} as an artifact named "My Test Document" to this agent.`,
|
|
106
|
+
})
|
|
107
|
+
.pipe(Effect.provide(session.makeToolExecutionServices()));
|
|
108
|
+
|
|
109
|
+
expect(agent.artifacts).toHaveLength(1);
|
|
110
|
+
expect(agent.artifacts[0].name).toBe('My Test Document');
|
|
111
|
+
const artifactData = yield* agent.artifacts[0].data.pipe(Database.load);
|
|
112
|
+
expect(Obj.instanceOf(Markdown.Document, artifactData)).toBe(true);
|
|
113
|
+
},
|
|
114
|
+
Effect.provide(TestLayer),
|
|
115
|
+
TestHelpers.provideTestContext,
|
|
116
|
+
),
|
|
117
|
+
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
|
118
|
+
);
|
|
61
119
|
|
|
62
|
-
|
|
120
|
+
it.scoped(
|
|
121
|
+
'shopping list',
|
|
122
|
+
Effect.fnUntraced(
|
|
123
|
+
function* (_) {
|
|
124
|
+
const agent = yield* Agent.makeInitialized(
|
|
125
|
+
{
|
|
126
|
+
name: 'Shopping list',
|
|
127
|
+
instructions: 'Keep a shopping list of items to buy.',
|
|
128
|
+
blueprints: [Ref.make(MarkdownBlueprint.make())],
|
|
129
|
+
},
|
|
130
|
+
blueprint,
|
|
131
|
+
);
|
|
132
|
+
const chatFeed = agent.chat?.target?.feed?.target;
|
|
133
|
+
invariant(chatFeed, 'Agent chat feed not found.');
|
|
134
|
+
yield* Database.flush();
|
|
135
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>();
|
|
136
|
+
const session = yield* acquireReleaseResource(() => new AiSession({ feed: chatFeed, runtime }));
|
|
137
|
+
yield* Effect.promise(() => session.context.open());
|
|
138
|
+
|
|
139
|
+
yield* session
|
|
140
|
+
.createRequest({
|
|
141
|
+
system: SYSTEM,
|
|
142
|
+
prompt: `List ingredients for a scrambled eggs on a toast breakfast.`,
|
|
143
|
+
})
|
|
144
|
+
.pipe(Effect.provide(session.makeToolExecutionServices()));
|
|
145
|
+
|
|
146
|
+
console.log(yield* Effect.promise(() => dumpAgent(agent)));
|
|
63
147
|
},
|
|
64
148
|
Effect.provide(TestLayer),
|
|
65
149
|
TestHelpers.provideTestContext,
|
|
@@ -71,35 +155,33 @@ describe('Initiative', () => {
|
|
|
71
155
|
'expense tracking list',
|
|
72
156
|
Effect.fnUntraced(
|
|
73
157
|
function* (_) {
|
|
74
|
-
const
|
|
75
|
-
|
|
158
|
+
const agent = yield* Agent.makeInitialized(
|
|
159
|
+
{
|
|
76
160
|
name: 'Expense tracking',
|
|
77
|
-
|
|
161
|
+
instructions: trim`
|
|
78
162
|
Keep a list of expenses in a markdown document (create artifact "Expenses").
|
|
79
163
|
Process incoming emails, add the relevant ones to the list.
|
|
80
164
|
|
|
81
165
|
Format:
|
|
82
166
|
|
|
83
|
-
##
|
|
84
|
-
|
|
167
|
+
## Expenses
|
|
85
168
|
- Flight to London (2026-02-01): £100
|
|
86
169
|
- Hotel in London (2026-02-01): £100
|
|
87
170
|
`,
|
|
88
|
-
|
|
171
|
+
blueprints: [Ref.make(MarkdownBlueprint.make())],
|
|
172
|
+
},
|
|
173
|
+
blueprint,
|
|
89
174
|
);
|
|
90
|
-
yield* Database.
|
|
175
|
+
yield* Database.flush();
|
|
91
176
|
|
|
92
177
|
const inboxQueue = yield* QueueService.createQueue();
|
|
93
|
-
yield* Database.
|
|
178
|
+
yield* Database.add(
|
|
94
179
|
Trigger.make({
|
|
95
180
|
enabled: true,
|
|
96
|
-
spec:
|
|
97
|
-
|
|
98
|
-
queue: inboxQueue.dxn.toString(),
|
|
99
|
-
},
|
|
100
|
-
function: Ref.make(FunctionDefinition.serialize(agent)),
|
|
181
|
+
spec: Trigger.specQueue(inboxQueue.dxn.toString()),
|
|
182
|
+
function: Ref.make(Operation.serialize(AgentWorker)),
|
|
101
183
|
input: {
|
|
102
|
-
|
|
184
|
+
agent: Ref.make(agent),
|
|
103
185
|
event: '{{event}}',
|
|
104
186
|
},
|
|
105
187
|
}),
|
|
@@ -111,25 +193,172 @@ describe('Initiative', () => {
|
|
|
111
193
|
);
|
|
112
194
|
|
|
113
195
|
const dispatcher = yield* TriggerDispatcher;
|
|
114
|
-
yield* dispatcher.invokeScheduledTriggers({ kinds: ['queue'], untilExhausted: true });
|
|
196
|
+
const invocations = yield* dispatcher.invokeScheduledTriggers({ kinds: ['queue'], untilExhausted: true });
|
|
197
|
+
expect(invocations.every((invocation) => Exit.isSuccess(invocation.result))).toBe(true);
|
|
198
|
+
|
|
199
|
+
console.log(yield* Effect.promise(() => dumpAgent(agent)));
|
|
200
|
+
},
|
|
201
|
+
WithProperties,
|
|
202
|
+
Effect.provide(TestLayer),
|
|
203
|
+
TestHelpers.provideTestContext,
|
|
204
|
+
),
|
|
205
|
+
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
it.scoped(
|
|
209
|
+
'cron field creates a timer trigger that invokes the agent worker',
|
|
210
|
+
Effect.fnUntraced(
|
|
211
|
+
function* ({ expect }) {
|
|
212
|
+
const cron = '*/5 * * * *';
|
|
213
|
+
const agent = yield* Agent.makeInitialized(
|
|
214
|
+
{
|
|
215
|
+
name: 'Scheduled agent',
|
|
216
|
+
instructions: 'A scheduled agent that runs on a timer.',
|
|
217
|
+
blueprints: [Ref.make(MarkdownBlueprint.make())],
|
|
218
|
+
cron,
|
|
219
|
+
},
|
|
220
|
+
blueprint,
|
|
221
|
+
);
|
|
222
|
+
yield* Database.flush();
|
|
223
|
+
|
|
224
|
+
yield* Operation.invoke(SyncTriggers, { agent: Ref.make(agent) });
|
|
225
|
+
|
|
226
|
+
const triggers = yield* Database.runQuery(
|
|
227
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('assistant-toolkit.blueprint.test.timer'),
|
|
228
|
+
);
|
|
229
|
+
const timerTriggers = triggers.filter(
|
|
230
|
+
(trigger) => trigger.spec?.kind === 'timer' && trigger.spec.cron === cron,
|
|
231
|
+
);
|
|
232
|
+
expect(timerTriggers).toHaveLength(1);
|
|
233
|
+
|
|
234
|
+
const timerTrigger = timerTriggers[0];
|
|
235
|
+
invariant(timerTrigger.spec?.kind === 'timer');
|
|
236
|
+
expect(timerTrigger.spec.cron).toBe(cron);
|
|
237
|
+
expect(timerTrigger.enabled).toBe(true);
|
|
238
|
+
|
|
239
|
+
// Timer trigger bypasses the qualifier and points to the agent worker.
|
|
240
|
+
invariant(timerTrigger.function);
|
|
241
|
+
const operation = yield* Database.load(timerTrigger.function);
|
|
242
|
+
invariant(Obj.instanceOf(Operation.PersistentOperation, operation));
|
|
243
|
+
expect(operation.key).toBe(AgentWorker.meta.key);
|
|
244
|
+
},
|
|
245
|
+
Effect.provide(TestLayer),
|
|
246
|
+
TestHelpers.provideTestContext,
|
|
247
|
+
),
|
|
248
|
+
);
|
|
115
249
|
|
|
116
|
-
|
|
250
|
+
it.scoped(
|
|
251
|
+
'planning',
|
|
252
|
+
Effect.fnUntraced(
|
|
253
|
+
function* (_) {
|
|
254
|
+
const agent = yield* Agent.makeInitialized(
|
|
255
|
+
{
|
|
256
|
+
name: 'Egg making',
|
|
257
|
+
instructions: trim`
|
|
258
|
+
I'm testing how planning (task management) works.
|
|
259
|
+
Create tasks to make scrambled eggs.
|
|
260
|
+
|
|
261
|
+
Then simulate this plan execution in a markdown document.
|
|
262
|
+
The document should reflect the state of all objects involved in the cooking process.
|
|
263
|
+
The document should also have the log of actions taken.
|
|
264
|
+
|
|
265
|
+
Important: simualte actions one by one, in the order they are listed.
|
|
266
|
+
Simlate by updating the local document.
|
|
267
|
+
|
|
268
|
+
<example>
|
|
269
|
+
# State
|
|
270
|
+
|
|
271
|
+
- 2 raw eggs
|
|
272
|
+
- 1 frying pan
|
|
273
|
+
|
|
274
|
+
# Action log
|
|
275
|
+
|
|
276
|
+
- Taken 2 raw eggs out of the fridge.
|
|
277
|
+
</example>
|
|
278
|
+
`,
|
|
279
|
+
blueprints: [Ref.make(MarkdownBlueprint.make()), Ref.make(Obj.clone(PlanningBlueprint.make()))],
|
|
280
|
+
},
|
|
281
|
+
blueprint,
|
|
282
|
+
);
|
|
283
|
+
yield* Database.flush();
|
|
284
|
+
|
|
285
|
+
const chatFeed = agent.chat?.target?.feed?.target;
|
|
286
|
+
invariant(chatFeed, 'Agent chat feed not found.');
|
|
287
|
+
yield* Database.flush();
|
|
288
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>();
|
|
289
|
+
const session = yield* acquireReleaseResource(() => new AiSession({ feed: chatFeed, runtime }));
|
|
290
|
+
yield* Effect.promise(() => session.context.open());
|
|
291
|
+
|
|
292
|
+
yield* session
|
|
293
|
+
.createRequest({
|
|
294
|
+
system: SYSTEM,
|
|
295
|
+
prompt: `Go`,
|
|
296
|
+
})
|
|
297
|
+
.pipe(Effect.provide(session.makeToolExecutionServices()));
|
|
298
|
+
|
|
299
|
+
console.log(yield* Effect.promise(() => dumpAgent(agent)));
|
|
117
300
|
},
|
|
301
|
+
WithProperties,
|
|
118
302
|
Effect.provide(TestLayer),
|
|
119
303
|
TestHelpers.provideTestContext,
|
|
120
304
|
),
|
|
121
305
|
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
|
122
306
|
);
|
|
307
|
+
|
|
308
|
+
it.scoped(
|
|
309
|
+
'sync-triggers sets trigger enabled from agent.enabled',
|
|
310
|
+
Effect.fnUntraced(
|
|
311
|
+
function* ({ expect }) {
|
|
312
|
+
const agent = yield* Agent.makeInitialized(
|
|
313
|
+
{
|
|
314
|
+
name: 'Toggle agent',
|
|
315
|
+
instructions: 'Test enabled propagation.',
|
|
316
|
+
blueprints: [Ref.make(MarkdownBlueprint.make())],
|
|
317
|
+
enabled: false,
|
|
318
|
+
cron: '0 9 * * *',
|
|
319
|
+
},
|
|
320
|
+
blueprint,
|
|
321
|
+
);
|
|
322
|
+
yield* Database.flush();
|
|
323
|
+
|
|
324
|
+
yield* Operation.invoke(SyncTriggers, { agent: Ref.make(agent) });
|
|
325
|
+
|
|
326
|
+
const triggers = yield* Database.runQuery(
|
|
327
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('assistant-toolkit.blueprint.test.toggle-enabled'),
|
|
328
|
+
);
|
|
329
|
+
expect(triggers.every((trigger) => trigger.enabled === false)).toBe(true);
|
|
330
|
+
|
|
331
|
+
Obj.update(agent, (agent) => {
|
|
332
|
+
agent.enabled = true;
|
|
333
|
+
});
|
|
334
|
+
yield* Database.flush();
|
|
335
|
+
yield* Operation.invoke(SyncTriggers, { agent: Ref.make(agent) });
|
|
336
|
+
|
|
337
|
+
const triggersAfter = yield* Database.runQuery(
|
|
338
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('assistant-toolkit.blueprint.test.after'),
|
|
339
|
+
);
|
|
340
|
+
expect(triggersAfter).toHaveLength(triggers.length);
|
|
341
|
+
expect(triggersAfter.every((trigger) => trigger.enabled === true)).toBe(true);
|
|
342
|
+
},
|
|
343
|
+
Effect.provide(TestLayer),
|
|
344
|
+
TestHelpers.provideTestContext,
|
|
345
|
+
),
|
|
346
|
+
);
|
|
123
347
|
});
|
|
124
348
|
|
|
125
|
-
const
|
|
349
|
+
const dumpAgent = async (agent: Agent.Agent) => {
|
|
126
350
|
let text = '';
|
|
127
|
-
text += `==============
|
|
128
|
-
|
|
351
|
+
text += `============== Agent: ${agent.name} ==============\n\n`;
|
|
352
|
+
text += `============== Instructions ==============\n\n`;
|
|
353
|
+
text += `${await agent.instructions.load().then((_) => _.content)}\n`;
|
|
354
|
+
text += `============== Plan ==============\n\n`;
|
|
355
|
+
text += `${await agent.plan?.load().then((_) => Plan.formatPlan(_))}\n`;
|
|
356
|
+
text += `============== Artifacts ==============\n\n`;
|
|
357
|
+
for (const artifact of agent.artifacts) {
|
|
129
358
|
const data = await artifact.data.load();
|
|
130
359
|
text += `============== ${artifact.name} (${Obj.getTypename(data)}) ==============\n`;
|
|
131
|
-
if (Obj.instanceOf(
|
|
132
|
-
text +=
|
|
360
|
+
if (Obj.instanceOf(Markdown.Document, data)) {
|
|
361
|
+
text += `# ${Obj.getLabel(data)}\n\n${await data.content.load().then((_) => _.content)}\n`;
|
|
133
362
|
} else {
|
|
134
363
|
text += ` ${JSON.stringify(data, null, 2)}\n`;
|
|
135
364
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
import { AddArtifact } from './functions';
|
|
9
|
+
|
|
10
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.agent';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates the Agent blueprint. This is a function to avoid circular dependency issues.
|
|
14
|
+
*/
|
|
15
|
+
// TODO(dmaretskyi): Combine with Agent Wizard.
|
|
16
|
+
const make = () =>
|
|
17
|
+
Blueprint.make({
|
|
18
|
+
key: BLUEPRINT_KEY,
|
|
19
|
+
name: 'Agent blueprint',
|
|
20
|
+
instructions: Template.make({
|
|
21
|
+
source: trim`
|
|
22
|
+
You work on an agent. Each agent has instructions - the goal of the agent.
|
|
23
|
+
The agent plan shows the current progress of the agent.
|
|
24
|
+
Agent has a number of associated artifacts you can read/write.
|
|
25
|
+
You can edit them if necessary.
|
|
26
|
+
|
|
27
|
+
IMPORTANT: When creating a new artifact, always add it to the agent using the add-artifact function.
|
|
28
|
+
|
|
29
|
+
{{#with agent}}
|
|
30
|
+
<agent id="{{id}}" name="{{name}}">
|
|
31
|
+
<instructions>
|
|
32
|
+
{{instructions}}
|
|
33
|
+
</instructions>
|
|
34
|
+
<plan>
|
|
35
|
+
{{plan}}
|
|
36
|
+
</plan>
|
|
37
|
+
|
|
38
|
+
<artifacts>
|
|
39
|
+
{{#each artifacts}}
|
|
40
|
+
<artifact type="{{type}}" dxn="{{dxn}}">
|
|
41
|
+
{{name}}
|
|
42
|
+
</artifact>
|
|
43
|
+
{{/each}}
|
|
44
|
+
</artifacts>
|
|
45
|
+
</agent>
|
|
46
|
+
{{/with}}
|
|
47
|
+
`,
|
|
48
|
+
inputs: [
|
|
49
|
+
{
|
|
50
|
+
name: 'agent',
|
|
51
|
+
kind: 'function',
|
|
52
|
+
function: 'org.dxos.function.agent.get-context',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
}),
|
|
56
|
+
tools: Blueprint.toolDefinitions({ operations: [AddArtifact] }),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const blueprint: Blueprint.Definition = {
|
|
60
|
+
key: BLUEPRINT_KEY,
|
|
61
|
+
make,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default blueprint;
|
|
@@ -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, Obj } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { Agent } from '../../../types';
|
|
11
|
+
import { AddArtifact } from './definitions';
|
|
12
|
+
|
|
13
|
+
export default AddArtifact.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fnUntraced(function* ({ name, artifact }) {
|
|
16
|
+
if (!(yield* Database.load(artifact))) {
|
|
17
|
+
throw new Error('Artifact not found.');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const agent = yield* Agent.getFromChatContext;
|
|
21
|
+
|
|
22
|
+
Obj.update(agent, (agent) => {
|
|
23
|
+
agent.artifacts.push({
|
|
24
|
+
name,
|
|
25
|
+
data: artifact,
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}) as any,
|
|
29
|
+
),
|
|
30
|
+
);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Layer from 'effect/Layer';
|
|
7
|
+
|
|
8
|
+
import { AiService } from '@dxos/ai';
|
|
9
|
+
import { AiSession, ToolExecutionServices } from '@dxos/assistant';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
import { Database, Feed, Obj } from '@dxos/echo';
|
|
12
|
+
import { acquireReleaseResource } from '@dxos/effect';
|
|
13
|
+
import { invariant } from '@dxos/invariant';
|
|
14
|
+
import { ContentBlock } from '@dxos/types';
|
|
15
|
+
|
|
16
|
+
import { Agent } from '../../../types';
|
|
17
|
+
import { AgentWorker } from './definitions';
|
|
18
|
+
|
|
19
|
+
export default AgentWorker.pipe(
|
|
20
|
+
Operation.withHandler(
|
|
21
|
+
Effect.fnUntraced(function* ({ agent: agentRef, prompt, event }) {
|
|
22
|
+
const agent = yield* Database.load(agentRef).pipe(
|
|
23
|
+
Effect.catchTag('ObjectNotFoundError', () => Effect.die(new Error('Unable to load agent object.'))),
|
|
24
|
+
);
|
|
25
|
+
invariant(Obj.instanceOf(Agent.Agent, agent));
|
|
26
|
+
invariant(agent.chat, 'Agent has no chat.');
|
|
27
|
+
|
|
28
|
+
const chatFeed = yield* agent.chat.pipe(
|
|
29
|
+
Database.load,
|
|
30
|
+
Effect.flatMap((chat) => Database.load(chat.feed)),
|
|
31
|
+
Effect.catchTag('ObjectNotFoundError', () => Effect.die(new Error('Unable to load agent chat feed object.'))),
|
|
32
|
+
);
|
|
33
|
+
invariant(chatFeed, 'Agent chat feed not found.');
|
|
34
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>();
|
|
35
|
+
const session = yield* acquireReleaseResource(() => new AiSession({ feed: chatFeed, runtime }));
|
|
36
|
+
|
|
37
|
+
const agentsInContext = session.context.getObjects().filter(Obj.instanceOf(Agent.Agent));
|
|
38
|
+
if (agentsInContext.length !== 1) {
|
|
39
|
+
throw new Error('There should be exactly one agent in context. Got: ' + agentsInContext.length);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!prompt && !event) {
|
|
43
|
+
throw new Error('Either prompt or event must be provided.');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let input: ContentBlock.Any[] = [];
|
|
47
|
+
if (prompt) {
|
|
48
|
+
input.push({ _tag: 'text', text: prompt, disposition: 'synthetic' });
|
|
49
|
+
}
|
|
50
|
+
if (event) {
|
|
51
|
+
input.push({ _tag: 'text', text: JSON.stringify(event), disposition: 'synthetic' });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
yield* session
|
|
55
|
+
.createRequest({
|
|
56
|
+
prompt: input,
|
|
57
|
+
})
|
|
58
|
+
.pipe(
|
|
59
|
+
Effect.provide(
|
|
60
|
+
Layer.mergeAll(AiService.model('@anthropic/claude-opus-4-6'), ToolExecutionServices).pipe(
|
|
61
|
+
Layer.provideMerge(Operation.withInvocationOptions({ conversation: Obj.getDXN(chatFeed).toString() })),
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
Effect.retry({ times: 2 }),
|
|
65
|
+
);
|
|
66
|
+
}, Effect.scoped),
|
|
67
|
+
),
|
|
68
|
+
Operation.opaqueHandler,
|
|
69
|
+
);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { AiService, OpaqueToolkit } from '@dxos/ai';
|
|
8
|
+
import { AiContextService } from '@dxos/assistant';
|
|
9
|
+
import { Trace, TriggerEvent, Operation, OperationRegistry } from '@dxos/compute';
|
|
10
|
+
import { Database, Feed, Obj, Ref } from '@dxos/echo';
|
|
11
|
+
import { QueueService } from '@dxos/functions';
|
|
12
|
+
|
|
13
|
+
import { Agent } from '../../../types';
|
|
14
|
+
|
|
15
|
+
export const AgentWorker = Operation.make({
|
|
16
|
+
meta: {
|
|
17
|
+
key: 'org.dxos.function.agent.worker',
|
|
18
|
+
name: 'Agent Worker',
|
|
19
|
+
description: 'Agentic worker that drives the agent autonomously.',
|
|
20
|
+
},
|
|
21
|
+
input: Schema.Struct({
|
|
22
|
+
agent: Schema.suspend(() => Ref.Ref(Agent.Agent)),
|
|
23
|
+
prompt: Schema.optional(Schema.String),
|
|
24
|
+
event: Schema.optional(TriggerEvent.TriggerEvent),
|
|
25
|
+
}),
|
|
26
|
+
output: Schema.Void,
|
|
27
|
+
services: [
|
|
28
|
+
AiService.AiService,
|
|
29
|
+
Database.Service,
|
|
30
|
+
QueueService,
|
|
31
|
+
Feed.FeedService,
|
|
32
|
+
OperationRegistry.Service,
|
|
33
|
+
Trace.TraceService,
|
|
34
|
+
OpaqueToolkit.OpaqueToolkitProvider,
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const Qualifier = Operation.make({
|
|
39
|
+
meta: {
|
|
40
|
+
key: 'org.dxos.function.agent.qualifier',
|
|
41
|
+
name: 'Agent Qualifier',
|
|
42
|
+
description:
|
|
43
|
+
'Qualifier that determines if the event is relevant to the agent. Puts the data into the input queue of the agent.',
|
|
44
|
+
},
|
|
45
|
+
input: Schema.Struct({
|
|
46
|
+
agent: Schema.suspend(() => Ref.Ref(Agent.Agent)),
|
|
47
|
+
event: TriggerEvent.TriggerEvent,
|
|
48
|
+
}),
|
|
49
|
+
output: Schema.Void,
|
|
50
|
+
services: [AiService.AiService, Database.Service],
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const GetContext = Operation.make({
|
|
54
|
+
meta: {
|
|
55
|
+
key: 'org.dxos.function.agent.get-context',
|
|
56
|
+
name: 'Get Agent Context',
|
|
57
|
+
description: 'Get the context of an agent.',
|
|
58
|
+
},
|
|
59
|
+
input: Schema.Struct({}),
|
|
60
|
+
output: Schema.Struct({
|
|
61
|
+
id: Schema.String,
|
|
62
|
+
name: Schema.String,
|
|
63
|
+
instructions: Schema.String,
|
|
64
|
+
plan: Schema.String,
|
|
65
|
+
artifacts: Schema.Array(
|
|
66
|
+
Schema.Struct({
|
|
67
|
+
name: Schema.String,
|
|
68
|
+
type: Schema.optional(Schema.String),
|
|
69
|
+
dxn: Schema.optional(Schema.String),
|
|
70
|
+
}),
|
|
71
|
+
),
|
|
72
|
+
}),
|
|
73
|
+
services: [AiContextService, Database.Service],
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export const AddArtifact = Operation.make({
|
|
77
|
+
meta: {
|
|
78
|
+
key: 'org.dxos.function.agent.add-artifact',
|
|
79
|
+
name: 'Add artifact',
|
|
80
|
+
description: 'Adds a new artifact.',
|
|
81
|
+
},
|
|
82
|
+
input: Schema.Struct({
|
|
83
|
+
name: Schema.String.annotations({
|
|
84
|
+
description: 'The name of the artifact to add.',
|
|
85
|
+
}),
|
|
86
|
+
artifact: Ref.Ref(Obj.Unknown).annotations({
|
|
87
|
+
description: 'The artifact to add. Do NOT guess or try to generate the ID.',
|
|
88
|
+
}),
|
|
89
|
+
}),
|
|
90
|
+
output: Schema.Void,
|
|
91
|
+
services: [AiContextService, Database.Service],
|
|
92
|
+
});
|