@dxos/assistant-toolkit 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/neutral/add-artifact-ZUJ5DMSY.mjs +30 -0
- package/dist/lib/neutral/add-artifact-ZUJ5DMSY.mjs.map +7 -0
- package/dist/lib/neutral/agent-5NIKAYUK.mjs +65 -0
- package/dist/lib/neutral/agent-5NIKAYUK.mjs.map +7 -0
- package/dist/lib/neutral/chunk-246ACKSH.mjs +100 -0
- package/dist/lib/neutral/chunk-246ACKSH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs +73 -0
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FIGO6CA6.mjs +140 -0
- package/dist/lib/neutral/chunk-FIGO6CA6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GV66MKAQ.mjs +60 -0
- package/dist/lib/neutral/chunk-GV66MKAQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IKBIORQX.mjs +332 -0
- package/dist/lib/neutral/chunk-IKBIORQX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KGU725LW.mjs +29 -0
- package/dist/lib/neutral/chunk-KGU725LW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NR3GTWRC.mjs +53 -0
- package/dist/lib/neutral/chunk-NR3GTWRC.mjs.map +7 -0
- package/dist/lib/neutral/chunk-P4ZMYO4K.mjs +294 -0
- package/dist/lib/neutral/chunk-P4ZMYO4K.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QO5SU37C.mjs +70 -0
- package/dist/lib/neutral/chunk-QO5SU37C.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ROMZO4CB.mjs +108 -0
- package/dist/lib/neutral/chunk-ROMZO4CB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TO5IX24K.mjs +67 -0
- package/dist/lib/neutral/chunk-TO5IX24K.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs +25 -0
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XUF53B6B.mjs +75 -0
- package/dist/lib/neutral/chunk-XUF53B6B.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs +73 -0
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs.map +7 -0
- package/dist/lib/neutral/context-add-VB7AOY3G.mjs +22 -0
- package/dist/lib/neutral/context-add-VB7AOY3G.mjs.map +7 -0
- package/dist/lib/neutral/context-remove-VCM3VPSO.mjs +22 -0
- package/dist/lib/neutral/context-remove-VCM3VPSO.mjs.map +7 -0
- package/dist/lib/neutral/create-project-EIF4OJMY.mjs +35 -0
- package/dist/lib/neutral/create-project-EIF4OJMY.mjs.map +7 -0
- package/dist/lib/neutral/delete-J3PMWP7Z.mjs +19 -0
- package/dist/lib/neutral/delete-J3PMWP7Z.mjs.map +7 -0
- package/dist/lib/neutral/enable-blueprints-LBDZH2CY.mjs +47 -0
- package/dist/lib/neutral/enable-blueprints-LBDZH2CY.mjs.map +7 -0
- package/dist/lib/neutral/fetch-KHMHV7JR.mjs +16 -0
- package/dist/lib/neutral/fetch-KHMHV7JR.mjs.map +7 -0
- package/dist/lib/neutral/fetch-messages-QOBBCTGC.mjs +139 -0
- package/dist/lib/neutral/fetch-messages-QOBBCTGC.mjs.map +7 -0
- package/dist/lib/neutral/get-context-TN7X7U2H.mjs +35 -0
- package/dist/lib/neutral/get-context-TN7X7U2H.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +645 -3437
- package/dist/lib/neutral/index.mjs.map +4 -4
- package/dist/lib/neutral/load-ALP3TK2E.mjs +17 -0
- package/dist/lib/neutral/load-ALP3TK2E.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/object-create-Z57Y3X6Y.mjs +35 -0
- package/dist/lib/neutral/object-create-Z57Y3X6Y.mjs.map +7 -0
- package/dist/lib/neutral/object-delete-X53LS37B.mjs +18 -0
- package/dist/lib/neutral/object-delete-X53LS37B.mjs.map +7 -0
- package/dist/lib/neutral/object-update-GVKSBR7T.mjs +28 -0
- package/dist/lib/neutral/object-update-GVKSBR7T.mjs.map +7 -0
- package/dist/lib/neutral/project-HPHTZ2CI.mjs +23 -0
- package/dist/lib/neutral/project-HPHTZ2CI.mjs.map +7 -0
- package/dist/lib/neutral/project-rules-IVDHKSKI.mjs +78 -0
- package/dist/lib/neutral/project-rules-IVDHKSKI.mjs.map +7 -0
- package/dist/lib/neutral/prompt-Y7NN7M5D.mjs +170 -0
- package/dist/lib/neutral/prompt-Y7NN7M5D.mjs.map +7 -0
- package/dist/lib/neutral/qualifier-VDOY5CWU.mjs +88 -0
- package/dist/lib/neutral/qualifier-VDOY5CWU.mjs.map +7 -0
- package/dist/lib/neutral/query-PPJU5622.mjs +70 -0
- package/dist/lib/neutral/query-PPJU5622.mjs.map +7 -0
- package/dist/lib/neutral/query-U56GNEV6.mjs +32 -0
- package/dist/lib/neutral/query-U56GNEV6.mjs.map +7 -0
- package/dist/lib/neutral/query-blueprints-KXADGHSA.mjs +16 -0
- package/dist/lib/neutral/query-blueprints-KXADGHSA.mjs.map +7 -0
- package/dist/lib/neutral/relation-create-XJ2IX6X3.mjs +34 -0
- package/dist/lib/neutral/relation-create-XJ2IX6X3.mjs.map +7 -0
- package/dist/lib/neutral/relation-delete-EP4KXAFL.mjs +18 -0
- package/dist/lib/neutral/relation-delete-EP4KXAFL.mjs.map +7 -0
- package/dist/lib/neutral/save-GWAPLT3Z.mjs +23 -0
- package/dist/lib/neutral/save-GWAPLT3Z.mjs.map +7 -0
- package/dist/lib/neutral/schema-add-Z5CY6P24.mjs +24 -0
- package/dist/lib/neutral/schema-add-Z5CY6P24.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-W326VPVX.mjs +38 -0
- package/dist/lib/neutral/schema-list-W326VPVX.mjs.map +7 -0
- package/dist/lib/neutral/sync-issues-4YE5XAK5.mjs +167 -0
- package/dist/lib/neutral/sync-issues-4YE5XAK5.mjs.map +7 -0
- package/dist/lib/neutral/sync-triggers-CDMJVW6E.mjs +136 -0
- package/dist/lib/neutral/sync-triggers-CDMJVW6E.mjs.map +7 -0
- package/dist/lib/neutral/tag-add-VNIIOVJA.mjs +19 -0
- package/dist/lib/neutral/tag-add-VNIIOVJA.mjs.map +7 -0
- package/dist/lib/neutral/tag-remove-6R2R27W3.mjs +19 -0
- package/dist/lib/neutral/tag-remove-6R2R27W3.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +44 -12
- package/dist/lib/neutral/testing/index.mjs.map +4 -4
- package/dist/lib/neutral/update-blueprints-N2AK2VUR.mjs +16 -0
- package/dist/lib/neutral/update-blueprints-N2AK2VUR.mjs.map +7 -0
- package/dist/lib/neutral/update-tasks-H7SWIFQL.mjs +46 -0
- package/dist/lib/neutral/update-tasks-H7SWIFQL.mjs.map +7 -0
- package/dist/types/src/blueprints/automation/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/automation/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/automation/index.d.ts +2 -0
- package/dist/types/src/blueprints/automation/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.test.d.ts +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 +63 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts +37 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts +28 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts +3 -0
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/blueprint.d.ts +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 -7
- 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 -3
- 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 +62 -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 +1 -3
- 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.map +1 -1
- package/dist/types/src/toolkits/index.d.ts +0 -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 +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/{initiative/plan.d.ts → types/Plan.d.ts} +28 -16
- 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 +29 -29
- 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 -7
- 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/{functions/linear → blueprints/linear/functions}/linear.test.ts +7 -7
- package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +34 -42
- 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/{planning/functions/update-tasks.ts → blueprints/planning/functions/definitions.ts} +13 -44
- 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} +249 -119
- 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 +24 -5
- 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 +10 -12
- package/src/crud/graph.ts +10 -10
- 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 +81 -0
- package/src/functions/agent/prompt.ts +212 -104
- package/src/functions/index.ts +0 -6
- package/src/index.ts +1 -3
- package/src/sync/sync.ts +23 -12
- package/src/testing/index.ts +1 -0
- package/src/testing/plugins.tsx +24 -14
- package/src/toolkits/WebToolkit.ts +3 -4
- package/src/toolkits/index.ts +0 -2
- package/src/types/Agent.ts +240 -0
- package/src/types/Chat.ts +63 -0
- package/src/types/McpServer.ts +37 -0
- package/src/types/Memory.ts +24 -0
- package/src/{initiative/plan.ts → types/Plan.ts} +9 -6
- package/src/types/index.ts +9 -0
- 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/markdown/index.d.ts +0 -3
- package/dist/types/src/blueprints/markdown/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/markdown-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/markdown/markdown-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/chat/Chat.d.ts +0 -31
- package/dist/types/src/chat/Chat.d.ts.map +0 -1
- package/dist/types/src/chat/index.d.ts +0 -2
- package/dist/types/src/chat/index.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/create.d.ts +0 -6
- package/dist/types/src/functions/document/create.d.ts.map +0 -1
- package/dist/types/src/functions/document/index.d.ts +0 -30
- package/dist/types/src/functions/document/index.d.ts.map +0 -1
- package/dist/types/src/functions/document/read.d.ts +0 -14
- package/dist/types/src/functions/document/read.d.ts.map +0 -1
- package/dist/types/src/functions/document/update.d.ts +0 -13
- 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 -29
- package/dist/types/src/functions/tasks/index.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/read.d.ts +0 -14
- 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 -16
- package/dist/types/src/functions/tasks/update.d.ts.map +0 -1
- package/dist/types/src/initiative/Initiative.d.ts +0 -41
- package/dist/types/src/initiative/Initiative.d.ts.map +0 -1
- package/dist/types/src/initiative/blueprint.d.ts +0 -153
- package/dist/types/src/initiative/blueprint.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/addArtifact.d.ts +0 -6
- package/dist/types/src/initiative/functions/addArtifact.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/agent.d.ts +0 -62
- package/dist/types/src/initiative/functions/agent.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/getContext.d.ts +0 -13
- package/dist/types/src/initiative/functions/getContext.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/index.d.ts +0 -5
- package/dist/types/src/initiative/functions/index.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/qualifier.d.ts +0 -60
- package/dist/types/src/initiative/functions/qualifier.d.ts.map +0 -1
- package/dist/types/src/initiative/index.d.ts +0 -6
- 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/initiative/plan.d.ts.map +0 -1
- package/dist/types/src/initiative/util.d.ts +0 -29
- package/dist/types/src/initiative/util.d.ts.map +0 -1
- package/dist/types/src/planning/blueprint.d.ts +0 -18
- package/dist/types/src/planning/blueprint.d.ts.map +0 -1
- package/dist/types/src/planning/functions/index.d.ts +0 -2
- package/dist/types/src/planning/functions/index.d.ts.map +0 -1
- package/dist/types/src/planning/functions/update-tasks.d.ts +0 -9
- package/dist/types/src/planning/functions/update-tasks.d.ts.map +0 -1
- package/dist/types/src/planning/index.d.ts +0 -3
- package/dist/types/src/planning/index.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 -100
- 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/markdown/index.ts +0 -7
- package/src/blueprints/markdown/markdown-blueprint.ts +0 -24
- package/src/blueprints/planning/planning-blueprint.test.ts +0 -120
- 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/chat/Chat.ts +0 -45
- package/src/chat/index.ts +0 -5
- package/src/experimental/feed.test.ts +0 -106
- package/src/functions/discord/fetch-messages.test.ts +0 -54
- package/src/functions/discord/fetch-messages.ts +0 -252
- package/src/functions/discord/index.ts +0 -9
- package/src/functions/document/create.ts +0 -29
- package/src/functions/document/index.ts +0 -13
- package/src/functions/document/read.ts +0 -32
- package/src/functions/document/update.ts +0 -32
- package/src/functions/entity-extraction/entity-extraction.conversations.json +0 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +0 -74
- package/src/functions/entity-extraction/entity-extraction.ts +0 -181
- package/src/functions/entity-extraction/index.ts +0 -9
- package/src/functions/exa/data/exa-search-1748337321991.ts +0 -131
- package/src/functions/exa/data/exa-search-1748337331526.ts +0 -144
- package/src/functions/exa/data/exa-search-1748337344119.ts +0 -133
- package/src/functions/exa/data/index.ts +0 -11
- package/src/functions/exa/exa.ts +0 -37
- package/src/functions/exa/index.ts +0 -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/research/document-create.ts +0 -73
- 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 -144
- package/src/functions/research/research.ts +0 -182
- package/src/functions/research/types.ts +0 -26
- 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/initiative/Initiative.ts +0 -61
- package/src/initiative/blueprint.ts +0 -60
- package/src/initiative/functions/addArtifact.ts +0 -41
- package/src/initiative/functions/agent.ts +0 -77
- package/src/initiative/functions/getContext.ts +0 -62
- package/src/initiative/functions/index.ts +0 -8
- package/src/initiative/functions/qualifier.ts +0 -98
- package/src/initiative/index.ts +0 -9
- package/src/initiative/util.ts +0 -137
- package/src/planning/blueprint.ts +0 -14
- package/src/planning/functions/index.ts +0 -5
- package/src/planning/index.ts +0 -6
- package/src/toolkits/AssistantToolkit.conversations.json +0 -1
- package/src/toolkits/AssistantToolkit.test.ts +0 -72
- package/src/toolkits/AssistantToolkit.ts +0 -70
- package/src/toolkits/SystemToolkit.ts +0 -299
- /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
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
|
-
|
|
8
|
-
import { Database, Type } from '@dxos/echo';
|
|
9
|
-
import { defineFunction } from '@dxos/functions';
|
|
10
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
-
|
|
12
|
-
import { MarkdownTasks, type TaskOperation } from './task-list';
|
|
13
|
-
|
|
14
|
-
export default defineFunction({
|
|
15
|
-
key: 'dxos.org/function/markdown/update-tasks',
|
|
16
|
-
name: 'Update markdown',
|
|
17
|
-
description: 'Creates and updates tasks in markdown documents.',
|
|
18
|
-
inputSchema: Schema.Struct({
|
|
19
|
-
doc: Type.Ref(Markdown.Document).annotations({
|
|
20
|
-
description: 'The ID of the document to update.',
|
|
21
|
-
}),
|
|
22
|
-
operations: Schema.optional(
|
|
23
|
-
Schema.Array(
|
|
24
|
-
Schema.Any.annotations({
|
|
25
|
-
description: 'Task operations to apply.',
|
|
26
|
-
}),
|
|
27
|
-
),
|
|
28
|
-
),
|
|
29
|
-
}),
|
|
30
|
-
outputSchema: Schema.Struct({
|
|
31
|
-
content: Schema.String,
|
|
32
|
-
numberedContent: Schema.String.annotations({
|
|
33
|
-
description: 'Content with line numbers for agent reference.',
|
|
34
|
-
}),
|
|
35
|
-
}),
|
|
36
|
-
handler: Effect.fn(function* ({ data: { doc, operations = [] } }) {
|
|
37
|
-
const document = yield* Database.load(doc);
|
|
38
|
-
|
|
39
|
-
// Create task manager and apply operations if provided.
|
|
40
|
-
const { content } = yield* Database.load(document.content);
|
|
41
|
-
const taskManager = new MarkdownTasks(content);
|
|
42
|
-
if (operations.length > 0) {
|
|
43
|
-
taskManager.applyOperations(operations as TaskOperation[]);
|
|
44
|
-
// TODO: Update the document content when database operations are fixed.
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
content: taskManager.getRawContent(),
|
|
49
|
-
numberedContent: taskManager.getNumberedContent(),
|
|
50
|
-
};
|
|
51
|
-
}),
|
|
52
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2026 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
|
-
|
|
7
|
-
import { Type } from '@dxos/echo';
|
|
8
|
-
import { Queue } from '@dxos/echo-db';
|
|
9
|
-
import { QueueAnnotation, Text } from '@dxos/schema';
|
|
10
|
-
|
|
11
|
-
import * as Chat from '../chat/Chat';
|
|
12
|
-
|
|
13
|
-
import { Plan } from './plan';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Initiative schema definition.
|
|
17
|
-
*/
|
|
18
|
-
export const Initiative = Schema.Struct({
|
|
19
|
-
name: Schema.String,
|
|
20
|
-
|
|
21
|
-
spec: Type.Ref(Text.Text),
|
|
22
|
-
plan: Type.Ref(Plan),
|
|
23
|
-
|
|
24
|
-
artifacts: Schema.Array(
|
|
25
|
-
Schema.Struct({
|
|
26
|
-
// TODO(dmaretskyi): Consider gettings names from the artifact itself using Obj.getLabel.
|
|
27
|
-
name: Schema.String,
|
|
28
|
-
data: Type.Ref(Type.Obj),
|
|
29
|
-
}),
|
|
30
|
-
),
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Incoming queue that the agent processes.
|
|
34
|
-
*/
|
|
35
|
-
// NOTE: Named `queue` to conform to subscribable schema (see QueueAnnotation).
|
|
36
|
-
queue: Schema.optional(Type.Ref(Queue)),
|
|
37
|
-
|
|
38
|
-
// TODO(dmaretskyi): Multiple chats.
|
|
39
|
-
chat: Schema.optional(Type.Ref(Chat.Chat)),
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Objects to subscribe to.
|
|
43
|
-
* References to objects with a a canonical queue property.
|
|
44
|
-
* Schema must have the QueueAnnotation.
|
|
45
|
-
*/
|
|
46
|
-
// TODO(dmaretskyi): Turn into an array of objects when form-data
|
|
47
|
-
subscriptions: Schema.Array(Type.Ref(Type.Obj)),
|
|
48
|
-
|
|
49
|
-
useQualifyingAgent: Schema.optional(Schema.Boolean),
|
|
50
|
-
|
|
51
|
-
newChatOnEveryEvent: Schema.optional(Schema.Boolean),
|
|
52
|
-
|
|
53
|
-
// TODO(dmaretskyi): input queue?
|
|
54
|
-
}).pipe(
|
|
55
|
-
Type.object({
|
|
56
|
-
typename: 'dxos.org/type/Initiative',
|
|
57
|
-
version: '0.1.0',
|
|
58
|
-
}),
|
|
59
|
-
QueueAnnotation.set(true),
|
|
60
|
-
);
|
|
61
|
-
export interface Initiative extends Schema.Schema.Type<typeof Initiative> {}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2026 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Blueprint, Template } from '@dxos/blueprints';
|
|
6
|
-
import { trim } from '@dxos/util';
|
|
7
|
-
|
|
8
|
-
import { addArtifact, agent, getContext, qualifier } from './functions';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Get all initiative functions. This is a function to avoid circular dependency issues.
|
|
12
|
-
*/
|
|
13
|
-
export const getFunctions = () => [getContext, addArtifact, agent, qualifier];
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Creates the Initiative blueprint. This is a function to avoid circular dependency issues.
|
|
17
|
-
*/
|
|
18
|
-
export const makeBlueprint = () =>
|
|
19
|
-
Blueprint.make({
|
|
20
|
-
key: 'dxos.org/blueprint/initiative',
|
|
21
|
-
name: 'Initiative blueprint',
|
|
22
|
-
instructions: Template.make({
|
|
23
|
-
source: trim`
|
|
24
|
-
You work on an initiative. Each initiative has a spec - the goal of the initiative.
|
|
25
|
-
The initiative plan shows the current progress of the initiative.
|
|
26
|
-
Initiative has an number of associated artifacts you can read/write.
|
|
27
|
-
Spec and plan are also artifacts.
|
|
28
|
-
You can edit them if necessary.
|
|
29
|
-
|
|
30
|
-
IMPORTANT: When create a new artifact, always add it to the initiative using the add-artifact function.
|
|
31
|
-
|
|
32
|
-
{{#with initiative}}
|
|
33
|
-
<initiative id="{{id}}" name="{{name}}">
|
|
34
|
-
<spec>
|
|
35
|
-
{{spec}}
|
|
36
|
-
</spec>
|
|
37
|
-
<plan>
|
|
38
|
-
{{plan}}
|
|
39
|
-
</plan>
|
|
40
|
-
|
|
41
|
-
<artifacts>
|
|
42
|
-
{{#each artifacts}}
|
|
43
|
-
<artifact type="{{type}}" dxn="{{dxn}}">
|
|
44
|
-
{{name}}
|
|
45
|
-
</artifact>
|
|
46
|
-
{{/each}}
|
|
47
|
-
</artifacts>
|
|
48
|
-
</initiative>
|
|
49
|
-
{{/with}}
|
|
50
|
-
`,
|
|
51
|
-
inputs: [
|
|
52
|
-
{
|
|
53
|
-
name: 'initiative',
|
|
54
|
-
kind: 'function',
|
|
55
|
-
function: 'dxos.org/function/initiative/get-context',
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
}),
|
|
59
|
-
tools: Blueprint.toolDefinitions({ functions: [addArtifact] }),
|
|
60
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
|
-
|
|
8
|
-
import { AiContextService } from '@dxos/assistant';
|
|
9
|
-
import { Database, Obj, Type } from '@dxos/echo';
|
|
10
|
-
import { defineFunction } from '@dxos/functions';
|
|
11
|
-
|
|
12
|
-
import { getFromChatContext } from '../util';
|
|
13
|
-
|
|
14
|
-
export default defineFunction({
|
|
15
|
-
key: 'dxos.org/function/initiative/add-artifact',
|
|
16
|
-
name: 'Add artifact',
|
|
17
|
-
description: 'Adds a new artifact.',
|
|
18
|
-
inputSchema: Schema.Struct({
|
|
19
|
-
name: Schema.String.annotations({
|
|
20
|
-
description: 'The name of the artifact to add.',
|
|
21
|
-
}),
|
|
22
|
-
artifact: Type.Ref(Type.Obj).annotations({
|
|
23
|
-
description: 'The artifact to add. Do NOT guess or try to generate the ID.',
|
|
24
|
-
}),
|
|
25
|
-
}),
|
|
26
|
-
services: [AiContextService],
|
|
27
|
-
handler: Effect.fnUntraced(function* ({ data }) {
|
|
28
|
-
if (!(yield* Database.load(data.artifact))) {
|
|
29
|
-
throw new Error('Artifact not found.');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const initiative = yield* getFromChatContext;
|
|
33
|
-
|
|
34
|
-
Obj.change(initiative, (initiative) => {
|
|
35
|
-
initiative.artifacts.push({
|
|
36
|
-
name: data.name,
|
|
37
|
-
data: data.artifact,
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}, AiContextService.fixFunctionHandlerType),
|
|
41
|
-
});
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2026 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
|
-
|
|
8
|
-
import { AiService } from '@dxos/ai';
|
|
9
|
-
import { AiContextService, AiConversation, type ContextBinding } from '@dxos/assistant';
|
|
10
|
-
import { Database, Obj, Type } from '@dxos/echo';
|
|
11
|
-
import { type Queue } from '@dxos/echo-db';
|
|
12
|
-
import { acquireReleaseResource } from '@dxos/effect';
|
|
13
|
-
import { TriggerEvent, defineFunction } from '@dxos/functions';
|
|
14
|
-
import { invariant } from '@dxos/invariant';
|
|
15
|
-
import { type Message } from '@dxos/types';
|
|
16
|
-
|
|
17
|
-
import * as Initiative from '../Initiative';
|
|
18
|
-
import { resetChatHistory } from '../util';
|
|
19
|
-
|
|
20
|
-
export default defineFunction({
|
|
21
|
-
key: 'dxos.org/function/initiative/agent',
|
|
22
|
-
name: 'Initiative Agent',
|
|
23
|
-
description: 'Agentic worker that drives the initiative autonomously.',
|
|
24
|
-
inputSchema: Schema.Struct({
|
|
25
|
-
initiative: Schema.suspend(() => Type.Ref(Initiative.Initiative)),
|
|
26
|
-
prompt: Schema.optional(Schema.String),
|
|
27
|
-
event: Schema.optional(TriggerEvent.TriggerEvent),
|
|
28
|
-
}),
|
|
29
|
-
outputSchema: Schema.Void,
|
|
30
|
-
services: [AiContextService],
|
|
31
|
-
handler: Effect.fnUntraced(
|
|
32
|
-
function* ({ data }) {
|
|
33
|
-
const initiative = yield* Database.load(data.initiative);
|
|
34
|
-
invariant(Obj.instanceOf(Initiative.Initiative, initiative));
|
|
35
|
-
invariant(initiative.chat, 'Initiative has no chat.');
|
|
36
|
-
|
|
37
|
-
if (initiative.newChatOnEveryEvent) {
|
|
38
|
-
yield* resetChatHistory(initiative);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const chatQueue = yield* initiative.chat.pipe(
|
|
42
|
-
Database.load,
|
|
43
|
-
Effect.flatMap((chat) => Database.load(chat.queue)),
|
|
44
|
-
);
|
|
45
|
-
invariant(chatQueue, 'Initiative chat queue not found.');
|
|
46
|
-
const conversation = yield* acquireReleaseResource(
|
|
47
|
-
() => new AiConversation({ queue: chatQueue as Queue<Message.Message | ContextBinding> }),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const iniativesInContext = conversation.context.getObjects().filter(Obj.instanceOf(Initiative.Initiative));
|
|
51
|
-
if (iniativesInContext.length !== 1) {
|
|
52
|
-
throw new Error('There should be exactly one initiative in context. Got: ' + iniativesInContext.length);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!data.prompt && !data.event) {
|
|
56
|
-
throw new Error('Either prompt or event must be provided.');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
let input = '';
|
|
60
|
-
if (data.prompt) {
|
|
61
|
-
input += `${data.prompt}\n\n`;
|
|
62
|
-
}
|
|
63
|
-
if (data.event) {
|
|
64
|
-
input += `<event>\n${JSON.stringify(data.event, null, 2)}\n</event>\n\n`;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
yield* conversation
|
|
68
|
-
.createRequest({
|
|
69
|
-
prompt: input,
|
|
70
|
-
})
|
|
71
|
-
.pipe(Effect.retry({ times: 2 }));
|
|
72
|
-
},
|
|
73
|
-
Effect.scoped,
|
|
74
|
-
Effect.provide(AiService.model('@anthropic/claude-sonnet-4-5')),
|
|
75
|
-
AiContextService.fixFunctionHandlerType,
|
|
76
|
-
) as any,
|
|
77
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2026 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
|
-
|
|
8
|
-
import { AiContextService } from '@dxos/assistant';
|
|
9
|
-
import { Database, Obj } from '@dxos/echo';
|
|
10
|
-
import { defineFunction } from '@dxos/functions';
|
|
11
|
-
|
|
12
|
-
import { formatPlan } from '../plan';
|
|
13
|
-
import { getFromChatContext } from '../util';
|
|
14
|
-
|
|
15
|
-
export default defineFunction({
|
|
16
|
-
key: 'dxos.org/function/initiative/get-context',
|
|
17
|
-
name: 'Get Initiative Context',
|
|
18
|
-
description: 'Get the context of an initiative.',
|
|
19
|
-
inputSchema: Schema.Struct({}),
|
|
20
|
-
outputSchema: Schema.Struct({
|
|
21
|
-
id: Schema.String,
|
|
22
|
-
name: Schema.String,
|
|
23
|
-
spec: Schema.String,
|
|
24
|
-
plan: Schema.String,
|
|
25
|
-
artifacts: Schema.Array(
|
|
26
|
-
Schema.Struct({
|
|
27
|
-
name: Schema.String,
|
|
28
|
-
type: Schema.optional(Schema.String),
|
|
29
|
-
dxn: Schema.optional(Schema.String),
|
|
30
|
-
}),
|
|
31
|
-
),
|
|
32
|
-
}),
|
|
33
|
-
services: [AiContextService],
|
|
34
|
-
handler: Effect.fnUntraced(function* ({ data: _data }) {
|
|
35
|
-
const initiative = yield* getFromChatContext;
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
id: initiative.id,
|
|
39
|
-
name: initiative.name,
|
|
40
|
-
spec: yield* initiative.spec.pipe(Database.load).pipe(
|
|
41
|
-
Effect.map((_) => _.content),
|
|
42
|
-
Effect.catchTag('ObjectNotFoundError', () => Effect.succeed('No spec found.')),
|
|
43
|
-
),
|
|
44
|
-
plan: yield* initiative.plan?.pipe(Database.load).pipe(
|
|
45
|
-
Effect.map(formatPlan),
|
|
46
|
-
Effect.catchTag('ObjectNotFoundError', () => Effect.succeed('No plan found.')),
|
|
47
|
-
) ?? Effect.succeed('No plan found.'),
|
|
48
|
-
artifacts: yield* Effect.forEach(initiative.artifacts, (artifact) =>
|
|
49
|
-
Effect.gen(function* () {
|
|
50
|
-
return {
|
|
51
|
-
name: artifact.name,
|
|
52
|
-
type: yield* Database.load(artifact.data).pipe(
|
|
53
|
-
Effect.map(Obj.getTypename),
|
|
54
|
-
Effect.catchTag('ObjectNotFoundError', () => Effect.succeed('Artifact not found.')),
|
|
55
|
-
),
|
|
56
|
-
dxn: artifact.data.dxn.toString(),
|
|
57
|
-
};
|
|
58
|
-
}),
|
|
59
|
-
),
|
|
60
|
-
};
|
|
61
|
-
}, AiContextService.fixFunctionHandlerType),
|
|
62
|
-
});
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2026 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as LanguageModel from '@effect/ai/LanguageModel';
|
|
6
|
-
import * as Prompt from '@effect/ai/Prompt';
|
|
7
|
-
import * as Effect from 'effect/Effect';
|
|
8
|
-
import * as Schema from 'effect/Schema';
|
|
9
|
-
|
|
10
|
-
import { AiService } from '@dxos/ai';
|
|
11
|
-
import { Database, Obj, Ref, Type } from '@dxos/echo';
|
|
12
|
-
import { TriggerEvent, defineFunction } from '@dxos/functions';
|
|
13
|
-
import { invariant } from '@dxos/invariant';
|
|
14
|
-
import { trim } from '@dxos/util';
|
|
15
|
-
|
|
16
|
-
import * as Initiative from '../Initiative';
|
|
17
|
-
import { formatPlan } from '../plan';
|
|
18
|
-
|
|
19
|
-
export default defineFunction({
|
|
20
|
-
key: 'dxos.org/function/initiative/qualifier',
|
|
21
|
-
name: 'Initiative Qualifier',
|
|
22
|
-
description:
|
|
23
|
-
'Qualifier that determines if the event is relevant to the initiative. Puts the data into the input queue of the initiative.',
|
|
24
|
-
inputSchema: Schema.Struct({
|
|
25
|
-
initiative: Schema.suspend(() => Type.Ref(Initiative.Initiative)),
|
|
26
|
-
event: TriggerEvent.TriggerEvent,
|
|
27
|
-
}),
|
|
28
|
-
outputSchema: Schema.Void,
|
|
29
|
-
services: [],
|
|
30
|
-
handler: Effect.fnUntraced(
|
|
31
|
-
function* ({ data }) {
|
|
32
|
-
const initiative = yield* Database.load(data.initiative);
|
|
33
|
-
invariant(Obj.instanceOf(Initiative.Initiative, initiative));
|
|
34
|
-
invariant(initiative.chat, 'Initiative has no chat.');
|
|
35
|
-
|
|
36
|
-
const { id, name, queue } = initiative;
|
|
37
|
-
if (!queue) {
|
|
38
|
-
throw new Error('Initiative has no queue.');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const plan = yield* Database.load(initiative.plan);
|
|
42
|
-
const spec = yield* Database.load(initiative.spec);
|
|
43
|
-
|
|
44
|
-
const {
|
|
45
|
-
value: { isRelevant },
|
|
46
|
-
} = yield* LanguageModel.generateObject({
|
|
47
|
-
schema: Schema.Struct({
|
|
48
|
-
isRelevant: Schema.Boolean,
|
|
49
|
-
}),
|
|
50
|
-
prompt: Prompt.fromMessages([
|
|
51
|
-
Prompt.systemMessage({
|
|
52
|
-
content: trim`
|
|
53
|
-
You are a qualifying agent that determines if the event is relevant to the initiative.
|
|
54
|
-
Respond with true if the event is relevant to the initiative, false otherwise.
|
|
55
|
-
If you are not sure, return true.
|
|
56
|
-
The qualified events will be forwarded to the larger agent that will process them.
|
|
57
|
-
<initiative id="${id}" name="${name}">
|
|
58
|
-
<spec>
|
|
59
|
-
${spec.content}
|
|
60
|
-
</spec>
|
|
61
|
-
<plan>
|
|
62
|
-
${formatPlan(plan)}
|
|
63
|
-
</plan>
|
|
64
|
-
</initiative>
|
|
65
|
-
`,
|
|
66
|
-
}),
|
|
67
|
-
Prompt.userMessage({
|
|
68
|
-
content: [
|
|
69
|
-
Prompt.makePart('text', {
|
|
70
|
-
text: trim`
|
|
71
|
-
<event>
|
|
72
|
-
${JSON.stringify(data.event, null, 2)}
|
|
73
|
-
</event>
|
|
74
|
-
`,
|
|
75
|
-
}),
|
|
76
|
-
],
|
|
77
|
-
}),
|
|
78
|
-
]),
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
if (isRelevant) {
|
|
82
|
-
const queueTarget = yield* Database.load(queue);
|
|
83
|
-
|
|
84
|
-
if ('queue' in data.event && data.event.item) {
|
|
85
|
-
const obj = data.event.item;
|
|
86
|
-
yield* Effect.promise(() => queueTarget.append([obj]));
|
|
87
|
-
} else if ('subject' in data.event && Ref.isRef(data.event.subject)) {
|
|
88
|
-
const obj = yield* Database.load(data.event.subject);
|
|
89
|
-
yield* Effect.promise(() => queueTarget.append([obj]));
|
|
90
|
-
} else {
|
|
91
|
-
throw new Error('Invalid event.');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
Effect.scoped,
|
|
96
|
-
Effect.provide(AiService.model('@anthropic/claude-sonnet-4-5')),
|
|
97
|
-
),
|
|
98
|
-
});
|
package/src/initiative/index.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2026 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
export { Initiative } from './Initiative';
|
|
6
|
-
export { makeInitialized, resetChatHistory, getFromChatContext } from './util';
|
|
7
|
-
export { getFunctions, makeBlueprint } from './blueprint';
|
|
8
|
-
export * from './functions';
|
|
9
|
-
export * from './plan';
|
package/src/initiative/util.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2026 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
|
|
8
|
-
import { AiContextBinder, AiContextService, type ContextBinding } from '@dxos/assistant';
|
|
9
|
-
import { type Blueprint } from '@dxos/blueprints';
|
|
10
|
-
import { Database, Obj, Ref, Relation } from '@dxos/echo';
|
|
11
|
-
import { type ObjectNotFoundError } from '@dxos/echo/Err';
|
|
12
|
-
import { acquireReleaseResource } from '@dxos/effect';
|
|
13
|
-
import { QueueService } from '@dxos/functions';
|
|
14
|
-
import { invariant } from '@dxos/invariant';
|
|
15
|
-
import { Text } from '@dxos/schema';
|
|
16
|
-
import type { Message } from '@dxos/types';
|
|
17
|
-
|
|
18
|
-
import * as Chat from '../chat/Chat';
|
|
19
|
-
|
|
20
|
-
import { Initiative } from './Initiative';
|
|
21
|
-
import { makePlan } from './plan';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Creates a fully initialized Initiative with chat, queue, and context bindings.
|
|
25
|
-
*
|
|
26
|
-
* @param props - Initiative properties including spec, plan, blueprints, and context objects.
|
|
27
|
-
* @param blueprint - The blueprint to use for the initiative context.
|
|
28
|
-
* @returns An Effect that yields the initialized Initiative.
|
|
29
|
-
*/
|
|
30
|
-
export const makeInitialized = (
|
|
31
|
-
props: Omit<Obj.MakeProps<typeof Initiative>, 'spec' | 'plan' | 'artifacts' | 'subscriptions' | 'chat'> &
|
|
32
|
-
Partial<Pick<Obj.MakeProps<typeof Initiative>, 'artifacts' | 'subscriptions'>> & {
|
|
33
|
-
spec: string;
|
|
34
|
-
blueprints?: Ref.Ref<Blueprint.Blueprint>[];
|
|
35
|
-
contextObjects?: Ref.Ref<Obj.Any>[];
|
|
36
|
-
},
|
|
37
|
-
blueprint: Blueprint.Blueprint,
|
|
38
|
-
): Effect.Effect<Initiative, never, QueueService | Database.Service> =>
|
|
39
|
-
Effect.gen(function* () {
|
|
40
|
-
const initiative = Obj.make(Initiative, {
|
|
41
|
-
...props,
|
|
42
|
-
spec: Ref.make(Text.make(props.spec)),
|
|
43
|
-
plan: Ref.make(makePlan({ tasks: [] })),
|
|
44
|
-
artifacts: props.artifacts ?? [],
|
|
45
|
-
subscriptions: props.subscriptions ?? [],
|
|
46
|
-
});
|
|
47
|
-
yield* Database.add(initiative);
|
|
48
|
-
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
49
|
-
const contextBinder = new AiContextBinder({ queue });
|
|
50
|
-
// TODO(dmaretskyi): Blueprint registry.
|
|
51
|
-
const initiativeBlueprint = yield* Database.add(Obj.clone(blueprint, { deep: true }));
|
|
52
|
-
yield* Effect.promise(() =>
|
|
53
|
-
contextBinder.bind({
|
|
54
|
-
blueprints: [Ref.make(initiativeBlueprint), ...(props.blueprints ?? [])],
|
|
55
|
-
objects: [Ref.make(initiative), ...(props.contextObjects ?? [])],
|
|
56
|
-
}),
|
|
57
|
-
);
|
|
58
|
-
const chat = yield* Database.add(
|
|
59
|
-
Chat.make({
|
|
60
|
-
queue: Ref.fromDXN(queue.dxn),
|
|
61
|
-
}),
|
|
62
|
-
);
|
|
63
|
-
yield* Database.add(
|
|
64
|
-
Relation.make(Chat.CompanionTo, {
|
|
65
|
-
[Relation.Source]: chat,
|
|
66
|
-
[Relation.Target]: initiative,
|
|
67
|
-
}),
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const inputQueue = yield* QueueService.createQueue();
|
|
71
|
-
|
|
72
|
-
Obj.change(initiative, (initiative) => {
|
|
73
|
-
initiative.chat = Ref.make(chat);
|
|
74
|
-
initiative.queue = Ref.fromDXN(inputQueue.dxn);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
return initiative;
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Resets the initiative chat history by rebuilding the chat context.
|
|
82
|
-
* Preserves the existing blueprints and objects from the current chat context.
|
|
83
|
-
*
|
|
84
|
-
* @param initiative - The initiative whose chat history should be reset. Must have an existing chat.
|
|
85
|
-
* @returns An Effect that resets the chat history.
|
|
86
|
-
*/
|
|
87
|
-
export const resetChatHistory = (
|
|
88
|
-
initiative: Initiative,
|
|
89
|
-
): Effect.Effect<void, ObjectNotFoundError, QueueService | Database.Service> =>
|
|
90
|
-
Effect.gen(function* () {
|
|
91
|
-
invariant(initiative.chat, 'Initiative must have an existing chat to reset.');
|
|
92
|
-
|
|
93
|
-
const existingQueue = yield* initiative.chat.pipe(Database.load).pipe(
|
|
94
|
-
Effect.map((_) => _.queue),
|
|
95
|
-
Effect.flatMap(Database.load),
|
|
96
|
-
);
|
|
97
|
-
const existingContextBinder = yield* acquireReleaseResource(
|
|
98
|
-
() =>
|
|
99
|
-
new AiContextBinder({
|
|
100
|
-
queue: existingQueue,
|
|
101
|
-
}),
|
|
102
|
-
);
|
|
103
|
-
const blueprints = existingContextBinder.getBlueprints().map((blueprint) => Ref.make(blueprint));
|
|
104
|
-
const objects = existingContextBinder.getObjects().map((object) => Ref.make(object));
|
|
105
|
-
|
|
106
|
-
const queue = yield* QueueService.createQueue();
|
|
107
|
-
const contextBinder = new AiContextBinder({ queue });
|
|
108
|
-
yield* Effect.promise(() =>
|
|
109
|
-
contextBinder.bind({
|
|
110
|
-
blueprints,
|
|
111
|
-
objects,
|
|
112
|
-
}),
|
|
113
|
-
);
|
|
114
|
-
const chat = yield* Database.add(
|
|
115
|
-
Chat.make({
|
|
116
|
-
queue: Ref.fromDXN(queue.dxn),
|
|
117
|
-
}),
|
|
118
|
-
);
|
|
119
|
-
Obj.change(initiative, (initiative) => {
|
|
120
|
-
initiative.chat = Ref.make(chat);
|
|
121
|
-
});
|
|
122
|
-
yield* Database.add(
|
|
123
|
-
Relation.make(Chat.CompanionTo, {
|
|
124
|
-
[Relation.Source]: chat,
|
|
125
|
-
[Relation.Target]: initiative,
|
|
126
|
-
}),
|
|
127
|
-
);
|
|
128
|
-
}).pipe(Effect.scoped);
|
|
129
|
-
|
|
130
|
-
export const getFromChatContext: Effect.Effect<Initiative, never, AiContextService> = Effect.gen(function* () {
|
|
131
|
-
const initiatives = yield* Function.pipe(AiContextService.findObjects(Initiative));
|
|
132
|
-
if (initiatives.length !== 1) {
|
|
133
|
-
throw new Error('There should be exactly one initiative in context. Got: ' + initiatives.length);
|
|
134
|
-
}
|
|
135
|
-
const initiative = initiatives[0];
|
|
136
|
-
return initiative;
|
|
137
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2026 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
6
|
-
|
|
7
|
-
import { updateTasks } from './functions';
|
|
8
|
-
|
|
9
|
-
export const PlanningBlueprint = Blueprint.make({
|
|
10
|
-
key: 'dxos.org/blueprint/planning',
|
|
11
|
-
name: 'Planning',
|
|
12
|
-
description: 'Plans and tracks complex tasks with artifact management.',
|
|
13
|
-
tools: Blueprint.toolDefinitions({ functions: [updateTasks] }),
|
|
14
|
-
});
|