@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,144 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { inspect } from 'node:util';
|
|
6
|
-
|
|
7
|
-
import { describe, it } from '@effect/vitest';
|
|
8
|
-
import * as Effect from 'effect/Effect';
|
|
9
|
-
|
|
10
|
-
import { ConsolePrinter } from '@dxos/ai';
|
|
11
|
-
import { MemoizedAiService } from '@dxos/ai/testing';
|
|
12
|
-
import { AiConversation, type ContextBinding, GenerationObserver } from '@dxos/assistant';
|
|
13
|
-
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
14
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
15
|
-
import { Database, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
16
|
-
import { acquireReleaseResource } from '@dxos/effect';
|
|
17
|
-
import { TestHelpers } from '@dxos/effect/testing';
|
|
18
|
-
import { FunctionInvocationService, QueueService } from '@dxos/functions';
|
|
19
|
-
import { invariant } from '@dxos/invariant';
|
|
20
|
-
import { ObjectId } from '@dxos/keys';
|
|
21
|
-
import { MarkdownBlueprint } from '@dxos/plugin-markdown/blueprints';
|
|
22
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
23
|
-
import { HasSubject, type Message, Organization } from '@dxos/types';
|
|
24
|
-
|
|
25
|
-
import { ResearchBlueprint } from '../../blueprints';
|
|
26
|
-
|
|
27
|
-
import { default as createDocument } from './document-create';
|
|
28
|
-
import { default as research } from './research';
|
|
29
|
-
import { ResearchGraph, queryResearchGraph } from './research-graph';
|
|
30
|
-
import { ResearchDataTypes } from './types';
|
|
31
|
-
|
|
32
|
-
ObjectId.dangerouslyDisableRandomness();
|
|
33
|
-
|
|
34
|
-
const TestLayer = AssistantTestLayer({
|
|
35
|
-
functions: [research, createDocument, ...MarkdownBlueprint.functions],
|
|
36
|
-
types: [...ResearchDataTypes, ResearchGraph, Blueprint.Blueprint, Markdown.Document, HasSubject.HasSubject],
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
describe('Research', () => {
|
|
40
|
-
it.effect(
|
|
41
|
-
'call a function to generate a research report',
|
|
42
|
-
Effect.fnUntraced(
|
|
43
|
-
function* (_) {
|
|
44
|
-
yield* Database.add(
|
|
45
|
-
Obj.make(Organization.Organization, {
|
|
46
|
-
name: 'BlueYard',
|
|
47
|
-
website: 'https://blueyard.com',
|
|
48
|
-
}),
|
|
49
|
-
);
|
|
50
|
-
yield* Database.flush({ indexes: true });
|
|
51
|
-
const result = yield* FunctionInvocationService.invokeFunction(research, {
|
|
52
|
-
query: 'Founders and portfolio of BlueYard.',
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
console.log(inspect(result, { depth: null, colors: true }));
|
|
56
|
-
console.log(JSON.stringify(result, null, 2));
|
|
57
|
-
|
|
58
|
-
yield* Database.flush({ indexes: true });
|
|
59
|
-
const researchGraph = yield* queryResearchGraph();
|
|
60
|
-
if (researchGraph) {
|
|
61
|
-
const data = yield* Database.load(researchGraph.queue).pipe(
|
|
62
|
-
Effect.flatMap((queue) => Effect.promise(() => queue.queryObjects())),
|
|
63
|
-
);
|
|
64
|
-
console.log(inspect(data, { depth: null, colors: true }));
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
Effect.provide(TestLayer),
|
|
68
|
-
TestHelpers.provideTestContext,
|
|
69
|
-
),
|
|
70
|
-
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
it.scoped(
|
|
74
|
-
'create and update research report',
|
|
75
|
-
Effect.fnUntraced(
|
|
76
|
-
function* (_) {
|
|
77
|
-
const organization = yield* Database.add(
|
|
78
|
-
Obj.make(Organization.Organization, {
|
|
79
|
-
name: 'BlueYard',
|
|
80
|
-
website: 'https://blueyard.com',
|
|
81
|
-
}),
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
85
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
86
|
-
|
|
87
|
-
yield* Database.flush({ indexes: true });
|
|
88
|
-
const researchBlueprint = yield* Database.add(Obj.clone(ResearchBlueprint));
|
|
89
|
-
const markdownBlueprint = yield* Database.add(Obj.clone(MarkdownBlueprint.make()));
|
|
90
|
-
yield* Effect.promise(() =>
|
|
91
|
-
conversation.context.bind({
|
|
92
|
-
blueprints: [Ref.make(researchBlueprint), Ref.make(markdownBlueprint)],
|
|
93
|
-
objects: [Ref.make(organization)],
|
|
94
|
-
}),
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
const observer = GenerationObserver.fromPrinter(new ConsolePrinter());
|
|
98
|
-
|
|
99
|
-
yield* conversation.createRequest({
|
|
100
|
-
observer,
|
|
101
|
-
prompt: `Create a research summary about ${organization.name}.`,
|
|
102
|
-
});
|
|
103
|
-
{
|
|
104
|
-
const docs = yield* Database.runQuery(
|
|
105
|
-
Query.select(Filter.id(organization.id)).targetOf(HasSubject.HasSubject).source(),
|
|
106
|
-
);
|
|
107
|
-
if (docs.length !== 1) {
|
|
108
|
-
throw new Error(`Expected 1 research document; got ${docs.length}: ${docs.map((_) => _.name)}`);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const doc = docs[0];
|
|
112
|
-
invariant(Obj.instanceOf(Markdown.Document, doc));
|
|
113
|
-
console.log({
|
|
114
|
-
name: doc.name,
|
|
115
|
-
content: yield* Database.load(doc.content).pipe(Effect.map((_) => _.content)),
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
yield* conversation.createRequest({
|
|
120
|
-
observer,
|
|
121
|
-
prompt: 'Add a section about their portfolio.',
|
|
122
|
-
});
|
|
123
|
-
{
|
|
124
|
-
const docs = yield* Database.runQuery(
|
|
125
|
-
Query.select(Filter.id(organization.id)).targetOf(HasSubject.HasSubject).source(),
|
|
126
|
-
);
|
|
127
|
-
if (docs.length !== 1) {
|
|
128
|
-
throw new Error(`Expected 1 research document; got ${docs.length}: ${docs.map((_) => _.name)}`);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const doc = docs[0];
|
|
132
|
-
invariant(Obj.instanceOf(Markdown.Document, doc));
|
|
133
|
-
console.log({
|
|
134
|
-
name: doc.name,
|
|
135
|
-
content: yield* Database.load(doc.content).pipe(Effect.map((_) => _.content)),
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
Effect.provide(TestLayer),
|
|
140
|
-
TestHelpers.provideTestContext,
|
|
141
|
-
),
|
|
142
|
-
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
|
143
|
-
);
|
|
144
|
-
});
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Toolkit from '@effect/ai/Toolkit';
|
|
6
|
-
import * as AnthropicTool from '@effect/ai-anthropic/AnthropicTool';
|
|
7
|
-
import * as Array from 'effect/Array';
|
|
8
|
-
import * as Effect from 'effect/Effect';
|
|
9
|
-
import * as Function from 'effect/Function';
|
|
10
|
-
import * as Layer from 'effect/Layer';
|
|
11
|
-
import * as Option from 'effect/Option';
|
|
12
|
-
import * as Schema from 'effect/Schema';
|
|
13
|
-
import * as String from 'effect/String';
|
|
14
|
-
|
|
15
|
-
import { AiService, ConsolePrinter } from '@dxos/ai';
|
|
16
|
-
import { AiSession, GenerationObserver, GenericToolkit, ToolExecutionServices, createToolkit } from '@dxos/assistant';
|
|
17
|
-
import { Template } from '@dxos/blueprints';
|
|
18
|
-
import { type DXN, Entity, Obj } from '@dxos/echo';
|
|
19
|
-
import { Database } from '@dxos/echo';
|
|
20
|
-
import { TracingService, defineFunction } from '@dxos/functions';
|
|
21
|
-
import { FunctionInvocationServiceLayerTestMocked } from '@dxos/functions-runtime/testing';
|
|
22
|
-
import { type Message, Person } from '@dxos/types';
|
|
23
|
-
import { trim } from '@dxos/util';
|
|
24
|
-
|
|
25
|
-
import { LocalSearchHandler, LocalSearchToolkit, makeGraphWriterHandler, makeGraphWriterToolkit } from '../../crud';
|
|
26
|
-
import { exaFunction, exaMockFunction } from '../exa';
|
|
27
|
-
|
|
28
|
-
import { contextQueueLayerFromResearchGraph } from './research-graph';
|
|
29
|
-
import PROMPT from './research-instructions.tpl?raw';
|
|
30
|
-
import { ResearchDataTypes } from './types';
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Exec external service and return the results as a Subgraph.
|
|
34
|
-
*/
|
|
35
|
-
export default defineFunction({
|
|
36
|
-
key: 'dxos.org/function/research',
|
|
37
|
-
name: 'Research',
|
|
38
|
-
description: trim`
|
|
39
|
-
Search the web to research information about the given subject.
|
|
40
|
-
Inserts structured data into the research graph.
|
|
41
|
-
Creates a research summary and returns the objects created.
|
|
42
|
-
`,
|
|
43
|
-
inputSchema: Schema.Struct({
|
|
44
|
-
query: Schema.String.annotations({
|
|
45
|
-
description: trim`
|
|
46
|
-
The search query.
|
|
47
|
-
If doing research on an object then load it first and pass it as JSON.
|
|
48
|
-
`,
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
instructions: Schema.optional(Schema.String).annotations({
|
|
52
|
-
description: trim`
|
|
53
|
-
The instructions for the research agent.
|
|
54
|
-
`,
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
// TOOD(burdon): Move to context.
|
|
58
|
-
mockSearch: Schema.optional(Schema.Boolean).annotations({
|
|
59
|
-
description: 'Whether to use the mock search tool.',
|
|
60
|
-
default: false,
|
|
61
|
-
}),
|
|
62
|
-
|
|
63
|
-
entityExtraction: Schema.optional(Schema.Boolean).annotations({
|
|
64
|
-
description: trim`
|
|
65
|
-
Whether to extract structured entities from the research.
|
|
66
|
-
Experimental feature only enable if user explicitly requests it.
|
|
67
|
-
`,
|
|
68
|
-
default: false,
|
|
69
|
-
}),
|
|
70
|
-
}),
|
|
71
|
-
outputSchema: Schema.Struct({
|
|
72
|
-
document: Schema.optional(Schema.String).annotations({
|
|
73
|
-
description: 'The generated research document.',
|
|
74
|
-
}),
|
|
75
|
-
objects: Schema.Array(Schema.Unknown).annotations({
|
|
76
|
-
description: 'Structured objects created during the research process.',
|
|
77
|
-
}),
|
|
78
|
-
}),
|
|
79
|
-
handler: Effect.fnUntraced(
|
|
80
|
-
function* ({ data: { query, instructions, mockSearch = false, entityExtraction = false } }) {
|
|
81
|
-
if (mockSearch) {
|
|
82
|
-
const mockPerson = yield* Database.add(
|
|
83
|
-
Obj.make(Person.Person, {
|
|
84
|
-
preferredName: 'John Doe',
|
|
85
|
-
emails: [{ value: 'john.doe@example.com' }],
|
|
86
|
-
phoneNumbers: [{ value: '123-456-7890' }],
|
|
87
|
-
}),
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
document: trim`
|
|
92
|
-
The research ran in test-mode and was mocked. Proceed as usual.
|
|
93
|
-
We reference John Doe to test reference: ${Obj.getDXN(mockPerson)}
|
|
94
|
-
`,
|
|
95
|
-
objects: [Obj.toJSON(mockPerson)],
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
yield* Database.flush({ indexes: true });
|
|
100
|
-
yield* TracingService.emitStatus({ message: 'Starting research...' });
|
|
101
|
-
|
|
102
|
-
const NativeWebSearch = Toolkit.make(AnthropicTool.WebSearch_20250305({}));
|
|
103
|
-
|
|
104
|
-
let toolkit: Toolkit.Any = NativeWebSearch;
|
|
105
|
-
let handlers: Layer.Layer<any, any> = Layer.empty as any;
|
|
106
|
-
|
|
107
|
-
const objectDXNs: DXN[] = [];
|
|
108
|
-
if (entityExtraction) {
|
|
109
|
-
const GraphWriterToolkit = makeGraphWriterToolkit({ schema: ResearchDataTypes });
|
|
110
|
-
const GraphWriterHandler = makeGraphWriterHandler(GraphWriterToolkit, {
|
|
111
|
-
onAppend: (dxns) => objectDXNs.push(...dxns),
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
toolkit = Toolkit.merge(toolkit, LocalSearchToolkit, GraphWriterToolkit);
|
|
115
|
-
handlers = Layer.mergeAll(handlers, LocalSearchHandler, GraphWriterHandler).pipe(
|
|
116
|
-
Layer.provide(contextQueueLayerFromResearchGraph),
|
|
117
|
-
) as any;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const finishedToolkit = yield* createToolkit({ toolkit }).pipe(Effect.provide(handlers));
|
|
121
|
-
|
|
122
|
-
const session = new AiSession();
|
|
123
|
-
const result = yield* session.run({
|
|
124
|
-
prompt: query,
|
|
125
|
-
system: join(
|
|
126
|
-
Template.process(PROMPT, { entityExtraction }),
|
|
127
|
-
instructions && `<instructions>${instructions}</instructions>`,
|
|
128
|
-
),
|
|
129
|
-
toolkit: finishedToolkit,
|
|
130
|
-
observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'research' })),
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
const objects = yield* Effect.forEach(objectDXNs, (dxn) => Database.resolve(dxn)).pipe(
|
|
134
|
-
Effect.map(Array.map((obj) => Entity.toJSON(obj))),
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
return {
|
|
138
|
-
document: extractLastTextBlock(result),
|
|
139
|
-
objects,
|
|
140
|
-
};
|
|
141
|
-
},
|
|
142
|
-
Effect.provide(
|
|
143
|
-
Layer.mergeAll(AiService.model('@anthropic/claude-sonnet-4-0'), ToolExecutionServices).pipe(
|
|
144
|
-
Layer.provide(
|
|
145
|
-
// TODO(dmaretskyi): This should be provided by environment.
|
|
146
|
-
|
|
147
|
-
Layer.mergeAll(
|
|
148
|
-
GenericToolkit.providerEmpty,
|
|
149
|
-
FunctionInvocationServiceLayerTestMocked({ functions: [exaFunction, exaMockFunction] }),
|
|
150
|
-
),
|
|
151
|
-
),
|
|
152
|
-
),
|
|
153
|
-
),
|
|
154
|
-
),
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
// TODO(burdon): Factor out.
|
|
158
|
-
const join = (...strings: (string | undefined)[]) => strings.filter(Boolean).join('\n\n');
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Extracts the last text block from the result.
|
|
162
|
-
* Skips citations.
|
|
163
|
-
*/
|
|
164
|
-
// TODO(burdon): Factor out.
|
|
165
|
-
const extractLastTextBlock = (result: Message.Message[]) => {
|
|
166
|
-
return Function.pipe(
|
|
167
|
-
result,
|
|
168
|
-
Array.last,
|
|
169
|
-
Option.map(
|
|
170
|
-
Function.flow(
|
|
171
|
-
(_: Message.Message) => _.blocks,
|
|
172
|
-
Array.reverse,
|
|
173
|
-
Array.dropWhile((_: any) => _._tag === 'summary'),
|
|
174
|
-
Array.takeWhile((_: any) => _._tag === 'text'),
|
|
175
|
-
Array.reverse,
|
|
176
|
-
Array.map((_: any) => _.text),
|
|
177
|
-
Array.reduce('', String.concat),
|
|
178
|
-
),
|
|
179
|
-
),
|
|
180
|
-
Option.getOrElse(() => ''),
|
|
181
|
-
);
|
|
182
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Type } from '@dxos/echo';
|
|
6
|
-
import { Text } from '@dxos/schema';
|
|
7
|
-
import { Event, HasConnection, HasRelationship, LegacyOrganization, LegacyPerson, Pipeline, Task } from '@dxos/types';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Data types for research.
|
|
11
|
-
*/
|
|
12
|
-
export const ResearchDataTypes: Type.Entity.Any[] = [
|
|
13
|
-
// Objects
|
|
14
|
-
Event.Event,
|
|
15
|
-
LegacyOrganization,
|
|
16
|
-
Task.Task,
|
|
17
|
-
Text.Text,
|
|
18
|
-
|
|
19
|
-
// Relations
|
|
20
|
-
// TODO(wittjosiah): Until views (e.g., Table) support relations this needs to be expressed via organization ref.
|
|
21
|
-
// Employer.Employer,
|
|
22
|
-
LegacyPerson,
|
|
23
|
-
Pipeline.Pipeline,
|
|
24
|
-
HasRelationship.HasRelationship,
|
|
25
|
-
HasConnection.HasConnection,
|
|
26
|
-
];
|
|
@@ -1,34 +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
|
-
export default defineFunction({
|
|
13
|
-
key: 'dxos.org/function/markdown/read-tasks',
|
|
14
|
-
name: 'Read',
|
|
15
|
-
description: 'Read markdown tasks.',
|
|
16
|
-
inputSchema: Schema.Struct({
|
|
17
|
-
doc: Type.Ref(Markdown.Document).annotations({
|
|
18
|
-
description: 'The ID of the document to read.',
|
|
19
|
-
}),
|
|
20
|
-
}),
|
|
21
|
-
outputSchema: Schema.Struct({
|
|
22
|
-
content: Schema.String,
|
|
23
|
-
}),
|
|
24
|
-
handler: Effect.fn(function* ({ data: { doc } }) {
|
|
25
|
-
const document = yield* Database.load(doc);
|
|
26
|
-
|
|
27
|
-
// Return content with line numbers prefixed.
|
|
28
|
-
const { content } = yield* Database.load(document.content);
|
|
29
|
-
const lines = content.split('\n');
|
|
30
|
-
const len = String(lines.length).length;
|
|
31
|
-
const numbered = lines.map((line, i) => `${String(i + 1).padStart(len, ' ')}. ${line}`).join('\n');
|
|
32
|
-
return { content: numbered };
|
|
33
|
-
}),
|
|
34
|
-
});
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, expect, it } from 'vitest';
|
|
6
|
-
|
|
7
|
-
import { MarkdownTasks, type TaskOperation } from './task-list';
|
|
8
|
-
|
|
9
|
-
describe('MarkdownTasks', () => {
|
|
10
|
-
it('should initialize with content', () => {
|
|
11
|
-
const content = '- [ ] Task 1\n- [x] Task 2';
|
|
12
|
-
const manager = new MarkdownTasks(content);
|
|
13
|
-
expect(manager.getRawContent()).toBe(content);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('should provide numbered content', () => {
|
|
17
|
-
const manager = new MarkdownTasks('- [ ] Task 1\n - [ ] Subtask');
|
|
18
|
-
const numbered = manager.getNumberedContent();
|
|
19
|
-
expect(numbered).toBe(' 1→- [ ] Task 1\n 2→ - [ ] Subtask');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should insert tasks with indentation', () => {
|
|
23
|
-
const manager = new MarkdownTasks('- [ ] Main task');
|
|
24
|
-
manager.insertTask(2, 'Subtask', false, 2);
|
|
25
|
-
expect(manager.getRawContent()).toBe('- [ ] Main task\n - [ ] Subtask');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('should insert completed tasks', () => {
|
|
29
|
-
const manager = new MarkdownTasks('- [ ] Task 1');
|
|
30
|
-
manager.insertTask(2, 'Completed task', true, 0);
|
|
31
|
-
expect(manager.getRawContent()).toBe('- [ ] Task 1\n- [x] Completed task');
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('should delete tasks', () => {
|
|
35
|
-
const manager = new MarkdownTasks('- [ ] Task 1\n- [ ] Task 2');
|
|
36
|
-
const success = manager.deleteTask(2);
|
|
37
|
-
expect(success).toBe(true);
|
|
38
|
-
expect(manager.getRawContent()).toBe('- [ ] Task 1');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should update task text', () => {
|
|
42
|
-
const manager = new MarkdownTasks('- [ ] Old task');
|
|
43
|
-
const success = manager.updateTaskText(1, 'New task description');
|
|
44
|
-
expect(success).toBe(true);
|
|
45
|
-
expect(manager.getRawContent()).toBe('- [ ] New task description');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('should toggle task completion', () => {
|
|
49
|
-
const manager = new MarkdownTasks('- [ ] Task 1\n- [x] Task 2');
|
|
50
|
-
|
|
51
|
-
// Complete first task
|
|
52
|
-
manager.toggleTaskCompletion(1, true);
|
|
53
|
-
expect(manager.getRawContent()).toBe('- [x] Task 1\n- [x] Task 2');
|
|
54
|
-
|
|
55
|
-
// Uncomplete second task
|
|
56
|
-
manager.toggleTaskCompletion(2, false);
|
|
57
|
-
expect(manager.getRawContent()).toBe('- [x] Task 1\n- [ ] Task 2');
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('should change task indentation', () => {
|
|
61
|
-
const manager = new MarkdownTasks('- [ ] Task 1');
|
|
62
|
-
const success = manager.setTaskIndent(1, 4);
|
|
63
|
-
expect(success).toBe(true);
|
|
64
|
-
expect(manager.getRawContent()).toBe(' - [ ] Task 1');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('should apply multiple operations', () => {
|
|
68
|
-
const manager = new MarkdownTasks('- [ ] Task 1');
|
|
69
|
-
|
|
70
|
-
const operations: TaskOperation[] = [
|
|
71
|
-
{ type: 'insertTask', lineNumber: 2, text: 'New task', indent: 2 },
|
|
72
|
-
{ type: 'toggleTaskCompletion', lineNumber: 1, completed: true },
|
|
73
|
-
{ type: 'insertTask', lineNumber: 3, text: 'Another task', indent: 0 },
|
|
74
|
-
];
|
|
75
|
-
|
|
76
|
-
manager.applyOperations(operations);
|
|
77
|
-
const result = manager.getRawContent();
|
|
78
|
-
expect(result).toBe('- [x] Task 1\n - [ ] New task\n- [ ] Another task');
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('should handle hierarchical task structure', () => {
|
|
82
|
-
const manager = new MarkdownTasks();
|
|
83
|
-
|
|
84
|
-
// Build a hierarchical structure
|
|
85
|
-
manager.insertTask(1, 'Main task', false, 0);
|
|
86
|
-
manager.insertTask(2, 'Subtask 1', false, 2);
|
|
87
|
-
manager.insertTask(3, 'Sub-subtask', false, 4);
|
|
88
|
-
manager.insertTask(4, 'Subtask 2', false, 2);
|
|
89
|
-
|
|
90
|
-
const expected = '- [ ] Main task\n - [ ] Subtask 1\n - [ ] Sub-subtask\n - [ ] Subtask 2';
|
|
91
|
-
expect(manager.getRawContent()).toBe(expected);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('should handle line insertions at the end', () => {
|
|
95
|
-
const manager = new MarkdownTasks('- [ ] Task 1');
|
|
96
|
-
manager.insertTask(999, 'End task', false, 0);
|
|
97
|
-
expect(manager.getRawContent()).toBe('- [ ] Task 1\n- [ ] End task');
|
|
98
|
-
});
|
|
99
|
-
});
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Hierarchical Task List Manager.
|
|
7
|
-
*
|
|
8
|
-
* A framework for managing hierarchical task lists where each line is a task.
|
|
9
|
-
* Designed to work with language model agents that receive documents with line numbers.
|
|
10
|
-
*/
|
|
11
|
-
export class MarkdownTasks {
|
|
12
|
-
private _lineEndings: string;
|
|
13
|
-
private _content: string[];
|
|
14
|
-
|
|
15
|
-
constructor(initialContent: string = '') {
|
|
16
|
-
// Detect line endings.
|
|
17
|
-
this._lineEndings = initialContent.includes('\r\n') ? '\r\n' : '\n';
|
|
18
|
-
this._content = initialContent ? initialContent.split(this._lineEndings) : [];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Get the current document content with line numbers prefixed.
|
|
23
|
-
*/
|
|
24
|
-
getNumberedContent(): string {
|
|
25
|
-
return this._content
|
|
26
|
-
.map((line, index) => `${(index + 1).toString().padStart(3, ' ')}→${line}`)
|
|
27
|
-
.join(this._lineEndings);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Get the raw document content without line numbers.
|
|
32
|
-
*/
|
|
33
|
-
getRawContent(): string {
|
|
34
|
-
return this._content.join(this._lineEndings);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Insert a new task at the specified line number (1-based).
|
|
39
|
-
* Indentation level determines hierarchy (0, 2, 4, 6 spaces etc.)
|
|
40
|
-
*/
|
|
41
|
-
insertTask(lineNumber: number, taskText: string, completed: boolean = false, indent: number = 0): void {
|
|
42
|
-
const indentStr = ' '.repeat(indent);
|
|
43
|
-
const taskLine = completed ? `${indentStr}- [x] ${taskText}` : `${indentStr}- [ ] ${taskText}`;
|
|
44
|
-
const insertIndex = Math.max(0, Math.min(lineNumber - 1, this._content.length));
|
|
45
|
-
this._content.splice(insertIndex, 0, taskLine);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Delete a task at the specified line number (1-based).
|
|
50
|
-
*/
|
|
51
|
-
deleteTask(lineNumber: number): boolean {
|
|
52
|
-
if (lineNumber < 1 || lineNumber > this._content.length) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
this._content.splice(lineNumber - 1, 1);
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Update the text of a task at the specified line number (1-based).
|
|
61
|
-
*/
|
|
62
|
-
updateTaskText(lineNumber: number, newText: string): boolean {
|
|
63
|
-
if (lineNumber < 1 || lineNumber > this._content.length) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const currentLine = this._content[lineNumber - 1];
|
|
68
|
-
const taskMatch = currentLine.match(/^(\s*- \[[x ]\] )(.*)$/);
|
|
69
|
-
|
|
70
|
-
if (taskMatch) {
|
|
71
|
-
this._content[lineNumber - 1] = `${taskMatch[1]}${newText}`;
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Mark a task as complete or incomplete at the specified line number (1-based).
|
|
79
|
-
*/
|
|
80
|
-
toggleTaskCompletion(lineNumber: number, completed?: boolean): boolean {
|
|
81
|
-
if (lineNumber < 1 || lineNumber > this._content.length) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const currentLine = this._content[lineNumber - 1];
|
|
86
|
-
const taskMatch = currentLine.match(/^(\s*- \[)([x ])(.*)$/);
|
|
87
|
-
if (taskMatch) {
|
|
88
|
-
const isCurrentlyComplete = taskMatch[2] === 'x';
|
|
89
|
-
const newStatus = completed !== undefined ? completed : !isCurrentlyComplete;
|
|
90
|
-
const statusChar = newStatus ? 'x' : ' ';
|
|
91
|
-
this._content[lineNumber - 1] = `${taskMatch[1]}${statusChar}${taskMatch[3]}`;
|
|
92
|
-
return true;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Change the indentation level of a task (for hierarchy).
|
|
100
|
-
*/
|
|
101
|
-
setTaskIndent(lineNumber: number, indent: number): boolean {
|
|
102
|
-
if (lineNumber < 1 || lineNumber > this._content.length) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const currentLine = this._content[lineNumber - 1];
|
|
107
|
-
const taskMatch = currentLine.match(/^\s*- (\[[x ]\] .*)$/);
|
|
108
|
-
if (taskMatch) {
|
|
109
|
-
const indentStr = ' '.repeat(indent);
|
|
110
|
-
this._content[lineNumber - 1] = `${indentStr}- ${taskMatch[1]}`;
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Get the total number of lines in the document.
|
|
119
|
-
*/
|
|
120
|
-
getLineCount(): number {
|
|
121
|
-
return this._content.length;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Apply multiple operations atomically.
|
|
126
|
-
*/
|
|
127
|
-
applyOperations(operations: TaskOperation[]): void {
|
|
128
|
-
// Sort operations by line number in descending order to avoid index shifts.
|
|
129
|
-
const sortedOps = [...operations].sort((a, b) => {
|
|
130
|
-
const aLine = 'lineNumber' in a ? a.lineNumber : 0;
|
|
131
|
-
const bLine = 'lineNumber' in b ? b.lineNumber : 0;
|
|
132
|
-
return bLine - aLine;
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
for (const op of sortedOps) {
|
|
136
|
-
switch (op.type) {
|
|
137
|
-
case 'insertTask':
|
|
138
|
-
this.insertTask(op.lineNumber, op.text, op.completed, op.indent);
|
|
139
|
-
break;
|
|
140
|
-
case 'deleteTask':
|
|
141
|
-
this.deleteTask(op.lineNumber);
|
|
142
|
-
break;
|
|
143
|
-
case 'updateTaskText':
|
|
144
|
-
this.updateTaskText(op.lineNumber, op.text);
|
|
145
|
-
break;
|
|
146
|
-
case 'toggleTaskCompletion':
|
|
147
|
-
this.toggleTaskCompletion(op.lineNumber, op.completed);
|
|
148
|
-
break;
|
|
149
|
-
case 'setTaskIndent':
|
|
150
|
-
this.setTaskIndent(op.lineNumber, op.indent);
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Operation types for batch task updates.
|
|
159
|
-
*/
|
|
160
|
-
export type TaskOperation =
|
|
161
|
-
| { type: 'insertTask'; lineNumber: number; text: string; completed?: boolean; indent?: number }
|
|
162
|
-
| { type: 'deleteTask'; lineNumber: number }
|
|
163
|
-
| { type: 'updateTaskText'; lineNumber: number; text: string }
|
|
164
|
-
| { type: 'toggleTaskCompletion'; lineNumber: number; completed?: boolean }
|
|
165
|
-
| { type: 'setTaskIndent'; lineNumber: number; indent: number };
|