@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
|
@@ -2,100 +2,223 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Tool from '@effect/ai/Tool';
|
|
6
|
+
import * as Toolkit from '@effect/ai/Toolkit';
|
|
5
7
|
import * as Array from 'effect/Array';
|
|
8
|
+
import * as Deferred from 'effect/Deferred';
|
|
6
9
|
import * as Effect from 'effect/Effect';
|
|
7
10
|
import * as Function from 'effect/Function';
|
|
11
|
+
import * as Layer from 'effect/Layer';
|
|
8
12
|
import * as Option from 'effect/Option';
|
|
9
13
|
import * as Schema from 'effect/Schema';
|
|
10
14
|
|
|
11
|
-
import { AiService,
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
import { AiService, OpaqueToolkit, ModelName } from '@dxos/ai';
|
|
16
|
+
import {
|
|
17
|
+
AiSession,
|
|
18
|
+
getOperationFromTool,
|
|
19
|
+
makeToolExecutionService,
|
|
20
|
+
makeToolResolverFromOperations,
|
|
21
|
+
} from '@dxos/assistant';
|
|
22
|
+
import { Template, Trace, Operation } from '@dxos/compute';
|
|
23
|
+
import { Database, Feed, Obj, Ref } from '@dxos/echo';
|
|
24
|
+
import { acquireReleaseResource } from '@dxos/effect';
|
|
25
|
+
import { invariant } from '@dxos/invariant';
|
|
16
26
|
import { log } from '@dxos/log';
|
|
27
|
+
import { trim } from '@dxos/util';
|
|
17
28
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
import { PromptError } from '../../errors';
|
|
30
|
+
import * as Chat from '../../types/Chat';
|
|
31
|
+
import { AgentPrompt } from './definitions';
|
|
32
|
+
|
|
33
|
+
const DEFAULT_MODEL: ModelName = '@anthropic/claude-opus-4-6';
|
|
34
|
+
|
|
35
|
+
export default AgentPrompt.pipe(
|
|
36
|
+
Operation.withHandler(
|
|
37
|
+
Effect.fnUntraced(
|
|
38
|
+
function* (data) {
|
|
39
|
+
log.info('processing input', { input: data.input });
|
|
40
|
+
|
|
41
|
+
const input = yield* Ref.isRef(data.input)
|
|
42
|
+
? Database.load(data.input).pipe(Effect.map(Obj.toJSON))
|
|
43
|
+
: Effect.succeed(data.input);
|
|
44
|
+
|
|
45
|
+
yield* Database.flush();
|
|
46
|
+
const prompt = yield* Database.load(data.prompt);
|
|
47
|
+
yield* Trace.emitStatus(`Running ${prompt.id}`);
|
|
48
|
+
|
|
49
|
+
log.info('starting agent', { prompt: prompt.id, input });
|
|
50
|
+
|
|
51
|
+
const blueprints = yield* Function.pipe(
|
|
52
|
+
prompt.blueprints,
|
|
53
|
+
Effect.forEach(Database.loadOption),
|
|
54
|
+
Effect.map(Array.filter(Option.isSome)),
|
|
55
|
+
Effect.map(Array.map((option) => option.value)),
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const objects = yield* Function.pipe(
|
|
59
|
+
prompt.context,
|
|
60
|
+
Effect.forEach(Database.loadOption),
|
|
61
|
+
Effect.map(Array.filter(Option.isSome)),
|
|
62
|
+
Effect.map(Array.map((option) => option.value)),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const promptInstructions = yield* Database.load(prompt.instructions.source);
|
|
66
|
+
let promptText = Template.process(promptInstructions.content, input);
|
|
67
|
+
|
|
68
|
+
if (input !== undefined) {
|
|
69
|
+
promptText += `\n<input>${JSON.stringify(input)}</input>`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let systemText = trim`
|
|
73
|
+
You are an agent running in the non-interactive mode.
|
|
74
|
+
The user is unable to see what you are doing, and cannot answer any questions.
|
|
75
|
+
Do not ask questions.
|
|
76
|
+
Complete the task before you, and at the end call [completeJob] with the output.
|
|
77
|
+
If you are unable to complete the task, call [completeJob] with the failure reason.
|
|
78
|
+
If no output is required, call [completeJob] with an empty object: {}
|
|
79
|
+
Do not stop until you call [completeJob].
|
|
80
|
+
`;
|
|
81
|
+
if (data.systemInstructions) {
|
|
82
|
+
systemText += `\n\n${data.systemInstructions}`;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const modelLayer = AiService.model(data.model ?? DEFAULT_MODEL);
|
|
86
|
+
|
|
87
|
+
let feed: Feed.Feed;
|
|
88
|
+
if (data.chat) {
|
|
89
|
+
const chat = yield* Database.load(data.chat);
|
|
90
|
+
invariant(Obj.instanceOf(Chat.Chat, chat), 'Expected Chat object.');
|
|
91
|
+
feed = yield* Database.load(chat.feed);
|
|
92
|
+
} else {
|
|
93
|
+
feed = yield* Database.add(Feed.make());
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const resultSink = yield* Deferred.make<unknown, PromptError>();
|
|
97
|
+
const promptToolkit = makePromptAgentToolkit({
|
|
98
|
+
output: Schema.Any, // TODO(dmaretskyi): Use prompt's output schema.
|
|
99
|
+
resultSink,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>();
|
|
103
|
+
const session = yield* acquireReleaseResource(() => new AiSession.Session({ feed, runtime }));
|
|
104
|
+
|
|
105
|
+
yield* Effect.promise(() =>
|
|
106
|
+
session.context.bind({
|
|
107
|
+
blueprints: blueprints.map((blueprint) => Ref.make(blueprint)),
|
|
108
|
+
objects: objects.map((object) => Ref.make(object as Obj.Unknown)),
|
|
109
|
+
}),
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
yield* session
|
|
113
|
+
.createRequest({
|
|
114
|
+
prompt: promptText,
|
|
115
|
+
system: systemText,
|
|
116
|
+
toolkit: promptToolkit,
|
|
117
|
+
})
|
|
118
|
+
.pipe(
|
|
119
|
+
Effect.provide(
|
|
120
|
+
Layer.mergeAll(modelLayer, ToolExecutionService({ feed }), makeToolResolverFromOperations()),
|
|
121
|
+
),
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
return yield* Deferred.poll(resultSink).pipe(
|
|
125
|
+
Effect.flatten,
|
|
126
|
+
Effect.flatten,
|
|
127
|
+
Effect.catchTag('NoSuchElementException', () =>
|
|
128
|
+
Effect.gen(function* () {
|
|
129
|
+
yield* session
|
|
130
|
+
.createRequest({
|
|
131
|
+
prompt: 'You must signal task completion by calling [completeJob] with the output or failure reason.',
|
|
132
|
+
system: systemText,
|
|
133
|
+
toolkit: promptToolkit,
|
|
134
|
+
})
|
|
135
|
+
.pipe(
|
|
136
|
+
Effect.provide(
|
|
137
|
+
Layer.mergeAll(modelLayer, ToolExecutionService({ feed }), makeToolResolverFromOperations()),
|
|
138
|
+
),
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
return yield* Deferred.poll(resultSink).pipe(
|
|
142
|
+
Effect.flatten,
|
|
143
|
+
Effect.flatten,
|
|
144
|
+
Effect.catchTag('NoSuchElementException', () =>
|
|
145
|
+
Effect.fail(new PromptError('Agent did not signal task completion.', {})),
|
|
146
|
+
),
|
|
147
|
+
);
|
|
148
|
+
}),
|
|
149
|
+
),
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
Effect.tapBoth({
|
|
153
|
+
onSuccess: () => Database.flush(),
|
|
154
|
+
onFailure: () => Database.flush(),
|
|
155
|
+
}),
|
|
156
|
+
Effect.scoped,
|
|
157
|
+
),
|
|
158
|
+
),
|
|
159
|
+
Operation.opaqueHandler,
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const makePromptAgentToolkit = (options: {
|
|
163
|
+
output: Schema.Schema.Any;
|
|
164
|
+
resultSink: Deferred.Deferred<unknown, PromptError>;
|
|
165
|
+
}) => {
|
|
166
|
+
class PromptAgentToolkit extends Toolkit.make(
|
|
167
|
+
Tool.make('completeJob', {
|
|
168
|
+
parameters: {
|
|
169
|
+
success: Schema.optional(Schema.Any), // TODO(dmaretskyi): Pipe output schema here.
|
|
170
|
+
failure: Schema.optional(
|
|
171
|
+
Schema.Struct({
|
|
172
|
+
message: Schema.String.annotations({
|
|
173
|
+
description: 'Short message describing the error.',
|
|
174
|
+
}),
|
|
175
|
+
description: Schema.optional(Schema.String).annotations({
|
|
176
|
+
description: 'Optional longer message describing in detail what went wrong',
|
|
177
|
+
}),
|
|
178
|
+
}),
|
|
179
|
+
),
|
|
180
|
+
},
|
|
181
|
+
}),
|
|
182
|
+
) {}
|
|
183
|
+
const layer = PromptAgentToolkit.toLayer({
|
|
184
|
+
completeJob: Effect.fnUntraced(function* (result) {
|
|
185
|
+
if (result.failure) {
|
|
186
|
+
yield* Deferred.fail(
|
|
187
|
+
options.resultSink,
|
|
188
|
+
new PromptError(result.failure.message, {
|
|
189
|
+
description: result.failure.description,
|
|
190
|
+
}),
|
|
191
|
+
);
|
|
47
192
|
} else {
|
|
48
|
-
|
|
193
|
+
yield* Deferred.succeed(options.resultSink, result.success);
|
|
49
194
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const session = new AiSession();
|
|
82
|
-
const result = yield* session
|
|
83
|
-
.run({
|
|
84
|
-
prompt: promptText,
|
|
85
|
-
system: systemText,
|
|
86
|
-
blueprints,
|
|
87
|
-
objects: objects as Obj.Any[],
|
|
88
|
-
toolkit,
|
|
89
|
-
observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'agent' })),
|
|
90
|
-
})
|
|
91
|
-
.pipe(Effect.provide(AiService.model(data.model ?? DEFAULT_MODEL)));
|
|
92
|
-
const lastBlock = result
|
|
93
|
-
.at(-1)
|
|
94
|
-
?.blocks.filter((block) => block._tag === 'text')
|
|
95
|
-
.at(-1);
|
|
96
|
-
|
|
97
|
-
return {
|
|
98
|
-
note: lastBlock?.text,
|
|
99
|
-
};
|
|
100
|
-
}),
|
|
101
|
-
});
|
|
195
|
+
}),
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
return OpaqueToolkit.make(PromptAgentToolkit, layer);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
interface ToolExecutionServiceOptions {
|
|
202
|
+
feed: Feed.Feed;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const ToolExecutionService = ({ feed }: ToolExecutionServiceOptions) =>
|
|
206
|
+
Layer.unwrapEffect(
|
|
207
|
+
Effect.gen(function* () {
|
|
208
|
+
const operationInvoker = yield* Operation.Service;
|
|
209
|
+
return makeToolExecutionService({
|
|
210
|
+
invoke: (tool, input) =>
|
|
211
|
+
Effect.gen(function* () {
|
|
212
|
+
const operationDef = getOperationFromTool(tool).pipe(Option.getOrThrow);
|
|
213
|
+
log('invoking operation', { operationDef, input });
|
|
214
|
+
const result = yield* operationInvoker
|
|
215
|
+
.invoke(operationDef, input, {
|
|
216
|
+
conversation: Obj.getDXN(feed).toString(),
|
|
217
|
+
})
|
|
218
|
+
.pipe(Effect.orDie);
|
|
219
|
+
log('result', { result });
|
|
220
|
+
return result;
|
|
221
|
+
}),
|
|
222
|
+
});
|
|
223
|
+
}),
|
|
224
|
+
);
|
package/src/functions/index.ts
CHANGED
package/src/index.ts
CHANGED
package/src/sync/sync.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
8
|
-
import { DatabaseService } from '@dxos/functions';
|
|
7
|
+
import { Database, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
9
8
|
import { failedInvariant } from '@dxos/invariant';
|
|
10
9
|
import { log } from '@dxos/log';
|
|
11
10
|
|
|
@@ -18,18 +17,27 @@ import { log } from '@dxos/log';
|
|
|
18
17
|
* @param opts.foreignKeyId - The key to use for matching objects.
|
|
19
18
|
*/
|
|
20
19
|
export const syncObjects: (
|
|
21
|
-
objs: Obj.
|
|
20
|
+
objs: Obj.Unknown[],
|
|
22
21
|
opts: { foreignKeyId: string },
|
|
23
|
-
) => Effect.Effect<Obj.
|
|
22
|
+
) => Effect.Effect<Obj.Unknown[], never, Database.Service> = Effect.fn('syncObjects')(function* (
|
|
23
|
+
objs,
|
|
24
|
+
{ foreignKeyId },
|
|
25
|
+
) {
|
|
24
26
|
return yield* Effect.forEach(
|
|
25
27
|
objs,
|
|
26
28
|
Effect.fnUntraced(function* (obj) {
|
|
27
29
|
// Sync referenced objects.
|
|
28
30
|
for (const key of Object.keys(obj)) {
|
|
29
|
-
if (typeof key !== 'string' || key === 'id')
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (!
|
|
31
|
+
if (typeof key !== 'string' || key === 'id') {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (!Ref.isRef((obj as any)[key])) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const ref: Ref.Unknown = (obj as any)[key];
|
|
38
|
+
if (!ref.target) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
33
41
|
if (Obj.getDXN(ref.target).isLocalObjectId()) {
|
|
34
42
|
// obj not persisted to db.
|
|
35
43
|
const [target] = yield* syncObjects([ref.target], { foreignKeyId });
|
|
@@ -39,9 +47,7 @@ export const syncObjects: (
|
|
|
39
47
|
|
|
40
48
|
const schema = Obj.getSchema(obj) ?? failedInvariant('No schema.');
|
|
41
49
|
const foreignId = Obj.getKeys(obj, foreignKeyId)[0]?.id ?? failedInvariant('No foreign key.');
|
|
42
|
-
const
|
|
43
|
-
objects: [existing],
|
|
44
|
-
} = yield* DatabaseService.runQuery(
|
|
50
|
+
const [existing] = yield* Database.runQuery(
|
|
45
51
|
Query.select(Filter.foreignKeys(schema, [{ source: foreignKeyId, id: foreignId }])),
|
|
46
52
|
);
|
|
47
53
|
log('sync object', {
|
|
@@ -50,7 +56,7 @@ export const syncObjects: (
|
|
|
50
56
|
existing: existing ? Obj.getDXN(existing) : undefined,
|
|
51
57
|
});
|
|
52
58
|
if (!existing) {
|
|
53
|
-
yield*
|
|
59
|
+
yield* Database.add(obj);
|
|
54
60
|
return obj;
|
|
55
61
|
} else {
|
|
56
62
|
copyObjectData(existing, obj);
|
|
@@ -61,27 +67,39 @@ export const syncObjects: (
|
|
|
61
67
|
);
|
|
62
68
|
});
|
|
63
69
|
|
|
64
|
-
const copyObjectData = (existing: Obj.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
const copyObjectData = (existing: Obj.Unknown, newObj: Obj.Unknown) => {
|
|
71
|
+
Obj.update(existing, (existing) => {
|
|
72
|
+
// Copy properties from newObj to existing.
|
|
73
|
+
for (const key of Object.keys(newObj)) {
|
|
74
|
+
if (typeof key !== 'string' || key === 'id') {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (
|
|
78
|
+
typeof (newObj as any)[key] !== 'string' &&
|
|
79
|
+
typeof (newObj as any)[key] !== 'number' &&
|
|
80
|
+
typeof (newObj as any)[key] !== 'boolean' &&
|
|
81
|
+
!Ref.isRef((newObj as any)[key])
|
|
82
|
+
) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
(existing as any)[key] = (newObj as any)[key];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Delete properties that don't exist in newObj.
|
|
89
|
+
for (const key of Object.keys(existing)) {
|
|
90
|
+
if (typeof key !== 'string' || key === 'id') {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (!(key in newObj)) {
|
|
94
|
+
delete (existing as any)[key];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Update foreign keys.
|
|
99
|
+
for (const foreignKey of Obj.getMeta(newObj).keys) {
|
|
100
|
+
Obj.deleteKeys(existing, foreignKey.source);
|
|
101
|
+
// TODO(dmaretskyi): Doesn't work: `Obj.getMeta(existing).keys.push(foreignKey);`
|
|
102
|
+
Obj.getMeta(existing).keys.push({ ...foreignKey });
|
|
80
103
|
}
|
|
81
|
-
}
|
|
82
|
-
for (const foreignKey of Obj.getMeta(newObj).keys) {
|
|
83
|
-
Obj.deleteKeys(existing, foreignKey.source);
|
|
84
|
-
// TODO(dmaretskyi): Doesn't work: `Obj.getMeta(existing).keys.push(foreignKey);`
|
|
85
|
-
Obj.getMeta(existing).keys.push({ ...foreignKey });
|
|
86
|
-
}
|
|
104
|
+
});
|
|
87
105
|
};
|
package/src/testing/index.ts
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { Format, type Obj, Type } from '@dxos/echo';
|
|
11
|
+
import { Card } from '@dxos/react-ui';
|
|
12
|
+
import { Syntax } from '@dxos/react-ui-syntax-highlighter';
|
|
13
|
+
|
|
14
|
+
export const MapSchema = Schema.Struct({
|
|
15
|
+
coordinates: Format.GeoPoint,
|
|
16
|
+
}).pipe(
|
|
17
|
+
Type.object({
|
|
18
|
+
typename: 'com.example.type.map',
|
|
19
|
+
version: '0.1.0',
|
|
20
|
+
}),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export type MapSchema = Schema.Schema.Type<typeof MapSchema>;
|
|
24
|
+
|
|
25
|
+
// TODO(burdon): Move to ECHO def.
|
|
26
|
+
export type ArtifactsContext = {
|
|
27
|
+
items: Obj.Unknown[];
|
|
28
|
+
getArtifacts: () => Obj.Unknown[];
|
|
29
|
+
addArtifact: (artifact: Obj.Unknown) => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
declare global {
|
|
33
|
+
interface ToolContextExtensions {
|
|
34
|
+
artifacts?: ArtifactsContext;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// TODO(dmaretskyi): Removed images from conductor GPT implementation.
|
|
39
|
+
const isImage = (data: any): data is any => false;
|
|
40
|
+
|
|
41
|
+
export const capabilities: Capability.Any[] = [
|
|
42
|
+
Capability.contributes(
|
|
43
|
+
Capabilities.ReactSurface,
|
|
44
|
+
Surface.create({
|
|
45
|
+
id: 'plugin-image',
|
|
46
|
+
role: 'card--content',
|
|
47
|
+
filter: (data: any): data is any => isImage(data.value),
|
|
48
|
+
component: ({ data }) => (
|
|
49
|
+
<Card.Content>
|
|
50
|
+
<img
|
|
51
|
+
className='grow object-cover'
|
|
52
|
+
src={`data:image/jpeg;base64,${data.value.source.data}`}
|
|
53
|
+
alt={data.value.prompt ?? `Generated image [id=${data.value.id}]`}
|
|
54
|
+
/>
|
|
55
|
+
</Card.Content>
|
|
56
|
+
),
|
|
57
|
+
}),
|
|
58
|
+
),
|
|
59
|
+
Capability.contributes(
|
|
60
|
+
Capabilities.ReactSurface,
|
|
61
|
+
Surface.create({
|
|
62
|
+
id: 'plugin-default',
|
|
63
|
+
role: 'card--content',
|
|
64
|
+
position: 'fallback',
|
|
65
|
+
component: ({ data }) => (
|
|
66
|
+
<Card.Content>
|
|
67
|
+
<Syntax.Root data={data}>
|
|
68
|
+
<Syntax.Content>
|
|
69
|
+
<Syntax.Filter />
|
|
70
|
+
<Syntax.Viewport>
|
|
71
|
+
<Syntax.Code />
|
|
72
|
+
</Syntax.Viewport>
|
|
73
|
+
</Syntax.Content>
|
|
74
|
+
</Syntax.Root>
|
|
75
|
+
</Card.Content>
|
|
76
|
+
),
|
|
77
|
+
}),
|
|
78
|
+
),
|
|
79
|
+
];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as AnthropicTool from '@effect/ai-anthropic/AnthropicTool';
|
|
6
|
+
import * as Tool from '@effect/ai/Tool';
|
|
7
|
+
import * as Toolkit from '@effect/ai/Toolkit';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
import * as Schema from 'effect/Schema';
|
|
10
|
+
|
|
11
|
+
// TODO(dmaretskyi): Testing only.
|
|
12
|
+
export const WebToolkit = Toolkit.make(
|
|
13
|
+
AnthropicTool.WebSearch_20250305({}).pipe(
|
|
14
|
+
// TODO(dmaretskyi): Effect bug -- provider-defined tools don't support annotations.
|
|
15
|
+
// ToolFormatter.assign({
|
|
16
|
+
// debugFormatResult: (result) =>
|
|
17
|
+
// Array.isArray(result) ? result.map(Struct.pick('title', 'type', 'url', 'page_age')) : result,
|
|
18
|
+
// }),
|
|
19
|
+
),
|
|
20
|
+
Tool.make('WebFetch', {
|
|
21
|
+
parameters: {
|
|
22
|
+
url: Schema.String,
|
|
23
|
+
},
|
|
24
|
+
success: Schema.String,
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const layer = WebToolkit.toLayer({
|
|
29
|
+
WebFetch: Effect.fnUntraced(function* ({ url }) {
|
|
30
|
+
const response = yield* Effect.promise(() => fetch(url).then((response) => response.text()));
|
|
31
|
+
return response;
|
|
32
|
+
}),
|
|
33
|
+
});
|