@dxos/assistant-toolkit 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29
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 +581 -3293
- 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 +9 -14
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- 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.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 +2 -2
- package/dist/types/src/blueprints/browser/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/database/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +5 -4
- package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts +5 -4
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -1
- 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 +3 -56
- package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/load.d.ts +5 -4
- package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/object-create.d.ts +5 -3
- package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts +5 -4
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/object-update.d.ts +5 -4
- package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/query.d.ts +7 -3
- package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts +6 -5
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +5 -4
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts +4 -2
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts +4 -2
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts +4 -3
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +4 -3
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -1
- package/dist/types/src/blueprints/database/index.d.ts +1 -1
- package/dist/types/src/blueprints/database/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/discord/blueprint.d.ts.map +1 -1
- 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/blueprints/discord/functions/fetch-messages.d.ts +3 -2
- package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/functions/index.d.ts +3 -11
- package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/index.d.ts +1 -0
- 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 +4 -2
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/functions/index.d.ts +3 -6
- package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/index.d.ts +1 -0
- package/dist/types/src/blueprints/github/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +4 -3
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/linear/blueprint.d.ts.map +1 -1
- 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 +3 -8
- package/dist/types/src/blueprints/linear/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts +4 -6
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/index.d.ts +1 -0
- 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.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 +2 -2
- package/dist/types/src/blueprints/planning/blueprint.d.ts.map +1 -1
- 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 +3 -9
- package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +5 -3
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/index.d.ts +1 -0
- package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/project/blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +4 -3
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/agent.d.ts +2 -60
- package/dist/types/src/blueprints/project/functions/agent.d.ts.map +1 -1
- 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 +6 -4
- package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/index.d.ts +3 -132
- package/dist/types/src/blueprints/project/functions/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +30 -17
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/index.d.ts +2 -2
- package/dist/types/src/blueprints/project/index.d.ts.map +1 -1
- 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 +5 -15
- package/dist/types/src/blueprints/testing.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/websearch/blueprint.d.ts.map +1 -1
- 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 +2 -1
- package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/toolkit.d.ts +2 -0
- package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -1
- package/dist/types/src/crud/graph.d.ts +1 -1
- 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 -84
- package/dist/types/src/functions/agent/index.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.d.ts +2 -82
- 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 -2
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/sync/sync.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/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 +32 -7
- package/dist/types/src/types/Chat.d.ts.map +1 -1
- package/dist/types/src/types/McpServer.d.ts +21 -0
- package/dist/types/src/types/McpServer.d.ts.map +1 -0
- package/dist/types/src/types/Memory.d.ts +12 -0
- package/dist/types/src/types/Memory.d.ts.map +1 -0
- package/dist/types/src/types/Plan.d.ts +23 -11
- package/dist/types/src/types/Plan.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/graphql.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -31
- 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 +23 -32
- package/src/blueprints/browser/blueprint.ts +5 -6
- package/src/blueprints/database/blueprint.conversations.json +1 -1
- package/src/blueprints/database/blueprint.test.ts +308 -98
- package/src/blueprints/database/blueprint.ts +37 -10
- package/src/blueprints/database/functions/context-add.ts +15 -26
- package/src/blueprints/database/functions/context-remove.ts +16 -27
- package/src/blueprints/database/functions/definitions.ts +318 -0
- package/src/blueprints/database/functions/index.ts +18 -28
- package/src/blueprints/database/functions/load.ts +11 -23
- package/src/blueprints/database/functions/object-create.ts +28 -25
- package/src/blueprints/database/functions/object-delete.ts +13 -20
- package/src/blueprints/database/functions/object-update.ts +23 -25
- package/src/blueprints/database/functions/query.ts +48 -110
- package/src/blueprints/database/functions/relation-create.ts +25 -38
- package/src/blueprints/database/functions/relation-delete.ts +14 -21
- package/src/blueprints/database/functions/schema-add.ts +19 -31
- package/src/blueprints/database/functions/schema-list.ts +26 -27
- package/src/blueprints/database/functions/tag-add.ts +14 -24
- package/src/blueprints/database/functions/tag-remove.ts +14 -23
- package/src/blueprints/database/index.ts +16 -1
- package/src/blueprints/discord/blueprint.ts +6 -11
- package/src/blueprints/discord/functions/definitions.ts +70 -0
- package/src/blueprints/discord/functions/fetch-messages.test.ts +15 -25
- package/src/blueprints/discord/functions/fetch-messages.ts +98 -152
- package/src/blueprints/discord/functions/index.ts +4 -4
- package/src/blueprints/discord/index.ts +1 -0
- package/src/blueprints/github/functions/definitions.ts +26 -0
- package/src/blueprints/github/functions/fetch-prs.ts +15 -22
- package/src/blueprints/github/functions/index.ts +4 -4
- package/src/blueprints/github/index.ts +2 -0
- package/src/blueprints/index.ts +4 -3
- package/src/blueprints/linear/blueprint.ts +6 -11
- package/src/blueprints/linear/functions/definitions.ts +23 -0
- package/src/blueprints/linear/functions/index.ts +4 -4
- package/src/blueprints/linear/functions/linear.test.ts +7 -7
- package/src/blueprints/linear/functions/sync-issues.ts +31 -39
- package/src/blueprints/linear/index.ts +1 -0
- 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 +5 -9
- package/src/blueprints/planning/functions/definitions.ts +137 -0
- package/src/blueprints/planning/functions/index.ts +4 -4
- package/src/blueprints/planning/functions/update-tasks.ts +35 -158
- package/src/blueprints/planning/index.ts +1 -0
- package/src/blueprints/project/blueprint.conversations.json +1 -0
- package/src/blueprints/project/blueprint.test.ts +246 -111
- package/src/blueprints/project/blueprint.ts +21 -25
- package/src/blueprints/project/functions/add-artifact.ts +19 -30
- package/src/blueprints/project/functions/agent.ts +43 -46
- package/src/blueprints/project/functions/definitions.ts +92 -0
- package/src/blueprints/project/functions/get-context.ts +36 -53
- package/src/blueprints/project/functions/index.ts +9 -10
- package/src/blueprints/project/functions/qualifier.ts +66 -72
- package/src/blueprints/project/index.ts +2 -2
- 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 +7 -23
- package/src/blueprints/websearch/blueprint.conversations.json +1 -0
- package/src/blueprints/websearch/blueprint.test.ts +39 -0
- package/src/blueprints/websearch/blueprint.ts +6 -8
- 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 +2 -1
- package/src/blueprints/websearch/toolkit.ts +6 -1
- package/src/crud/graph.test.ts +10 -12
- package/src/crud/graph.ts +2 -2
- package/src/errors.ts +25 -0
- package/src/functions/agent/definitions.ts +56 -0
- package/src/functions/agent/index.ts +4 -4
- 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 -96
- package/src/functions/index.ts +0 -2
- package/src/sync/sync.ts +23 -12
- package/src/testing/plugins.tsx +10 -3
- package/src/toolkits/WebToolkit.ts +1 -1
- package/src/types/Agent.ts +240 -0
- package/src/types/Chat.ts +24 -10
- package/src/types/McpServer.ts +37 -0
- package/src/types/Memory.ts +24 -0
- package/src/types/Plan.ts +7 -4
- package/src/types/index.ts +3 -1
- package/dist/types/src/blueprints/design/blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/design/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/index.d.ts +0 -2
- package/dist/types/src/blueprints/design/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/markdown/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/functions/create.d.ts +0 -6
- package/dist/types/src/blueprints/markdown/functions/create.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/functions/index.d.ts +0 -30
- package/dist/types/src/blueprints/markdown/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/functions/read.d.ts +0 -14
- package/dist/types/src/blueprints/markdown/functions/read.d.ts.map +0 -1
- package/dist/types/src/blueprints/markdown/functions/update.d.ts +0 -13
- package/dist/types/src/blueprints/markdown/functions/update.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/planning-old/blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/planning-old/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/index.d.ts +0 -29
- package/dist/types/src/blueprints/planning-old/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/read.d.ts +0 -14
- package/dist/types/src/blueprints/planning-old/functions/read.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/task-list.d.ts +0 -74
- package/dist/types/src/blueprints/planning-old/functions/task-list.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/task-list.test.d.ts +0 -2
- package/dist/types/src/blueprints/planning-old/functions/task-list.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/functions/update.d.ts +0 -16
- package/dist/types/src/blueprints/planning-old/functions/update.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning-old/index.d.ts +0 -2
- package/dist/types/src/blueprints/planning-old/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/research/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/functions/document-create.d.ts +0 -10
- package/dist/types/src/blueprints/research/functions/document-create.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/functions/index.d.ts +0 -19
- package/dist/types/src/blueprints/research/functions/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/functions/research.d.ts +0 -14
- package/dist/types/src/blueprints/research/functions/research.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/functions/research.test.d.ts +0 -2
- package/dist/types/src/blueprints/research/functions/research.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/types/ResearchGraph.d.ts +0 -18
- package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/types/index.d.ts +0 -7
- package/dist/types/src/blueprints/research/types/index.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +0 -179
- 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 -179
- 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 -9
- 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/types/Project.d.ts +0 -67
- package/dist/types/src/types/Project.d.ts.map +0 -1
- package/src/blueprints/browser/blueprint.conversations.json +0 -1
- package/src/blueprints/design/blueprint.test.ts +0 -96
- package/src/blueprints/design/blueprint.ts +0 -46
- package/src/blueprints/design/index.ts +0 -5
- package/src/blueprints/markdown/blueprint.ts +0 -38
- package/src/blueprints/markdown/functions/create.ts +0 -29
- package/src/blueprints/markdown/functions/index.ts +0 -13
- package/src/blueprints/markdown/functions/read.ts +0 -32
- package/src/blueprints/markdown/functions/update.ts +0 -32
- package/src/blueprints/markdown/index.ts +0 -6
- package/src/blueprints/planning-old/blueprint.test.ts +0 -122
- package/src/blueprints/planning-old/blueprint.ts +0 -110
- package/src/blueprints/planning-old/functions/index.ts +0 -11
- package/src/blueprints/planning-old/functions/read.ts +0 -34
- package/src/blueprints/planning-old/functions/task-list.test.ts +0 -99
- package/src/blueprints/planning-old/functions/task-list.ts +0 -165
- package/src/blueprints/planning-old/functions/update.ts +0 -52
- package/src/blueprints/planning-old/index.ts +0 -5
- package/src/blueprints/research/blueprint.test.ts +0 -7
- package/src/blueprints/research/blueprint.ts +0 -65
- package/src/blueprints/research/functions/document-create.ts +0 -73
- package/src/blueprints/research/functions/index.ts +0 -11
- package/src/blueprints/research/functions/research-instructions.tpl +0 -106
- package/src/blueprints/research/functions/research.conversations.json +0 -1
- package/src/blueprints/research/functions/research.test.ts +0 -149
- package/src/blueprints/research/functions/research.ts +0 -175
- package/src/blueprints/research/index.ts +0 -6
- package/src/blueprints/research/types/ResearchGraph.ts +0 -49
- package/src/blueprints/research/types/index.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 -11
- package/src/functions/exa/mock.ts +0 -71
- package/src/types/Project.ts +0 -196
- /package/dist/types/src/blueprints/{design → blueprint-manager}/blueprint.test.d.ts +0 -0
- /package/dist/types/src/blueprints/{planning-old → memory}/blueprint.test.d.ts +0 -0
- /package/dist/types/src/blueprints/{research → websearch}/blueprint.test.d.ts +0 -0
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, it } from '@effect/vitest';
|
|
6
|
-
import * as Effect from 'effect/Effect';
|
|
7
|
-
import * as Layer from 'effect/Layer';
|
|
8
|
-
|
|
9
|
-
import { AiService, ConsolePrinter } from '@dxos/ai';
|
|
10
|
-
import { GenericToolkit } from '@dxos/ai';
|
|
11
|
-
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
12
|
-
import { AiConversation, type ContextBinding, GenerationObserver, ToolExecutionServices } from '@dxos/assistant';
|
|
13
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
14
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
15
|
-
import { Database } from '@dxos/echo';
|
|
16
|
-
import { acquireReleaseResource } from '@dxos/effect';
|
|
17
|
-
import { TestHelpers } from '@dxos/effect/testing';
|
|
18
|
-
import { QueueService, TracingService } from '@dxos/functions';
|
|
19
|
-
import { FunctionInvocationServiceLayerTestMocked, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
20
|
-
import { log } from '@dxos/log';
|
|
21
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
22
|
-
import { Text } from '@dxos/schema';
|
|
23
|
-
import { type Message } from '@dxos/types';
|
|
24
|
-
import { trim } from '@dxos/util';
|
|
25
|
-
|
|
26
|
-
import { MarkdownFunctions } from '../markdown';
|
|
27
|
-
|
|
28
|
-
import DesignBlueprint from './blueprint';
|
|
29
|
-
|
|
30
|
-
describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
31
|
-
it.scoped(
|
|
32
|
-
'design blueprint',
|
|
33
|
-
Effect.fn(
|
|
34
|
-
function* ({ expect }) {
|
|
35
|
-
const observer = GenerationObserver.fromPrinter(new ConsolePrinter());
|
|
36
|
-
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
37
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
38
|
-
|
|
39
|
-
const blueprint = DesignBlueprint.make();
|
|
40
|
-
yield* Database.add(blueprint);
|
|
41
|
-
yield* Effect.promise(() =>
|
|
42
|
-
conversation.context.bind({
|
|
43
|
-
blueprints: [Ref.make(blueprint)],
|
|
44
|
-
}),
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const artifact = yield* Database.add(Markdown.make({ content: 'Hello, world!' }));
|
|
48
|
-
let prevContent = artifact.content;
|
|
49
|
-
|
|
50
|
-
{
|
|
51
|
-
const prompt = trim`
|
|
52
|
-
I want to design a new feature for our product.
|
|
53
|
-
|
|
54
|
-
We need to add a user profile system with the following requirements:
|
|
55
|
-
1. Users should be able to create and edit their profiles
|
|
56
|
-
2. Profile should include basic info like name, bio, avatar
|
|
57
|
-
3. Users can control privacy settings for their profile
|
|
58
|
-
4. Profile should show user's activity history
|
|
59
|
-
5. Need to consider data storage and security implications
|
|
60
|
-
|
|
61
|
-
Let's capture the key design decisions in our spec in ${Obj.getDXN(artifact)}
|
|
62
|
-
`;
|
|
63
|
-
|
|
64
|
-
yield* conversation.createRequest({ prompt, observer });
|
|
65
|
-
log.info('spec', { doc: artifact });
|
|
66
|
-
expect(artifact.content).not.toBe(prevContent);
|
|
67
|
-
prevContent = artifact.content;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
{
|
|
71
|
-
const prompt = trim`
|
|
72
|
-
I want this to be built on top of Durable Objects and SQLite database.
|
|
73
|
-
Adjust the spec to reflect this.
|
|
74
|
-
`;
|
|
75
|
-
|
|
76
|
-
yield* conversation.createRequest({ observer, prompt });
|
|
77
|
-
expect(artifact.content).not.toBe(prevContent);
|
|
78
|
-
prevContent = artifact.content;
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
Effect.provide(
|
|
82
|
-
Layer.mergeAll(ToolExecutionServices, AiService.model('@anthropic/claude-3-5-sonnet-20241022')).pipe(
|
|
83
|
-
Layer.provideMerge(TestDatabaseLayer({ types: [Text.Text, Markdown.Document, Blueprint.Blueprint] })),
|
|
84
|
-
Layer.provideMerge(Layer.mergeAll(GenericToolkit.providerEmpty, AiServiceTestingPreset('direct'))),
|
|
85
|
-
Layer.provideMerge(
|
|
86
|
-
FunctionInvocationServiceLayerTestMocked({
|
|
87
|
-
functions: Object.values(MarkdownFunctions),
|
|
88
|
-
}).pipe(Layer.provideMerge(TracingService.layerNoop)),
|
|
89
|
-
),
|
|
90
|
-
),
|
|
91
|
-
),
|
|
92
|
-
TestHelpers.provideTestContext,
|
|
93
|
-
TestHelpers.taggedTest('llm'),
|
|
94
|
-
),
|
|
95
|
-
);
|
|
96
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ToolId } from '@dxos/ai';
|
|
6
|
-
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
7
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
8
|
-
import { Ref } from '@dxos/echo';
|
|
9
|
-
import { Text } from '@dxos/schema';
|
|
10
|
-
import { trim } from '@dxos/util';
|
|
11
|
-
|
|
12
|
-
import { MarkdownFunctions } from '../markdown';
|
|
13
|
-
|
|
14
|
-
const BLUEPRINT_KEY = 'dxos.org/blueprint/design';
|
|
15
|
-
|
|
16
|
-
// TODO(burdon): Should this expose the functions directly or just reference them? How do we manage cross blueprint function dependencies?
|
|
17
|
-
const functions = Object.values(MarkdownFunctions);
|
|
18
|
-
|
|
19
|
-
const instructions = trim`
|
|
20
|
-
You manage a design spec based on the conversation.
|
|
21
|
-
The design spec is a markdown document that is used to record the tasks.
|
|
22
|
-
The design spec document follows a hierarchical structure, with nested markdown bulleted sections.
|
|
23
|
-
Use the appropriate tools to read and write the design spec document.
|
|
24
|
-
Maintain the document so that it can convey all relevant points from the conversation.
|
|
25
|
-
When replying to the user, be terse with your comments about design doc handling.
|
|
26
|
-
Do not announce when you read or write the design spec document.
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
const make = () =>
|
|
30
|
-
Blueprint.make({
|
|
31
|
-
key: BLUEPRINT_KEY,
|
|
32
|
-
name: 'Design Spec',
|
|
33
|
-
description: 'Preserve the conversation in the design spec.',
|
|
34
|
-
instructions: {
|
|
35
|
-
source: Ref.make(Text.make(instructions)),
|
|
36
|
-
},
|
|
37
|
-
tools: functions.map((fn) => ToolId.make(fn.key)),
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
41
|
-
key: BLUEPRINT_KEY,
|
|
42
|
-
functions,
|
|
43
|
-
make,
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export default blueprint;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
6
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import { Ref } from '@dxos/echo';
|
|
8
|
-
import { Text } from '@dxos/schema';
|
|
9
|
-
import { trim } from '@dxos/util';
|
|
10
|
-
|
|
11
|
-
import { MarkdownFunctions } from './functions';
|
|
12
|
-
|
|
13
|
-
const BLUEPRINT_KEY = 'dxos.org/blueprint/markdown';
|
|
14
|
-
|
|
15
|
-
const instructions = trim`
|
|
16
|
-
You read, write & create markdown documents.
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
const functions = Object.values(MarkdownFunctions);
|
|
20
|
-
|
|
21
|
-
const make = () =>
|
|
22
|
-
Blueprint.make({
|
|
23
|
-
key: BLUEPRINT_KEY,
|
|
24
|
-
name: 'Markdown',
|
|
25
|
-
description: 'Work with markdown documents.',
|
|
26
|
-
instructions: {
|
|
27
|
-
source: Ref.make(Text.make(instructions)),
|
|
28
|
-
},
|
|
29
|
-
tools: Blueprint.toolDefinitions({ functions }),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
33
|
-
key: BLUEPRINT_KEY,
|
|
34
|
-
functions,
|
|
35
|
-
make,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default blueprint;
|
|
@@ -1,29 +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, Ref } 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/create',
|
|
14
|
-
name: 'Create markdown document',
|
|
15
|
-
description: 'Creates a new markdown document.',
|
|
16
|
-
inputSchema: Schema.Struct({
|
|
17
|
-
name: Schema.String.annotations({
|
|
18
|
-
description: 'Name of the document.',
|
|
19
|
-
}),
|
|
20
|
-
content: Schema.String.annotations({
|
|
21
|
-
description: 'Content of the document.',
|
|
22
|
-
}),
|
|
23
|
-
}),
|
|
24
|
-
outputSchema: Schema.Void,
|
|
25
|
-
handler: Effect.fn(function* ({ data: { name, content } }) {
|
|
26
|
-
const doc = yield* Database.add(Markdown.make({ name, content }));
|
|
27
|
-
return { document: Ref.make(doc) };
|
|
28
|
-
}),
|
|
29
|
-
});
|
|
@@ -1,32 +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, Ref } 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',
|
|
14
|
-
name: 'Read markdown document',
|
|
15
|
-
description:
|
|
16
|
-
'Read markdown document. Note that result is a snapshot in time, and might have changed since the document was last read.',
|
|
17
|
-
inputSchema: Schema.Struct({
|
|
18
|
-
document: Ref.Ref(Markdown.Document).annotations({
|
|
19
|
-
description: 'The document to read.',
|
|
20
|
-
}),
|
|
21
|
-
}),
|
|
22
|
-
outputSchema: Schema.Struct({
|
|
23
|
-
content: Schema.String,
|
|
24
|
-
}),
|
|
25
|
-
handler: Effect.fn(function* ({ data: { document } }) {
|
|
26
|
-
const { content } = yield* document.pipe(
|
|
27
|
-
Database.load,
|
|
28
|
-
Effect.flatMap((doc) => doc.content.pipe(Database.load)),
|
|
29
|
-
);
|
|
30
|
-
return { content };
|
|
31
|
-
}),
|
|
32
|
-
});
|
|
@@ -1,32 +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, Obj, Ref } 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/update',
|
|
14
|
-
name: 'Update markdown',
|
|
15
|
-
description: 'Updates the entire contents of the markdown document.',
|
|
16
|
-
inputSchema: Schema.Struct({
|
|
17
|
-
doc: Ref.Ref(Markdown.Document).annotations({
|
|
18
|
-
description: 'The ID of the document to write.',
|
|
19
|
-
}),
|
|
20
|
-
content: Schema.String.annotations({
|
|
21
|
-
description: 'New content to write to the document.',
|
|
22
|
-
}),
|
|
23
|
-
}),
|
|
24
|
-
outputSchema: Schema.Void,
|
|
25
|
-
handler: Effect.fn(function* ({ data: { doc, content } }) {
|
|
26
|
-
const document = yield* Database.load(doc);
|
|
27
|
-
const text = yield* Database.load(document.content);
|
|
28
|
-
Obj.change(text, (t) => {
|
|
29
|
-
t.content = content;
|
|
30
|
-
});
|
|
31
|
-
}),
|
|
32
|
-
});
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, it } from '@effect/vitest';
|
|
6
|
-
import * as Effect from 'effect/Effect';
|
|
7
|
-
import * as Layer from 'effect/Layer';
|
|
8
|
-
|
|
9
|
-
import { AiService } from '@dxos/ai';
|
|
10
|
-
import { GenericToolkit } from '@dxos/ai';
|
|
11
|
-
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
12
|
-
import { AiConversation, type ContextBinding, ToolExecutionServices } from '@dxos/assistant';
|
|
13
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
14
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
15
|
-
import { Database } from '@dxos/echo';
|
|
16
|
-
import { acquireReleaseResource } from '@dxos/effect';
|
|
17
|
-
import { TestHelpers } from '@dxos/effect/testing';
|
|
18
|
-
import { QueueService, TracingService } from '@dxos/functions';
|
|
19
|
-
import { FunctionImplementationResolver } from '@dxos/functions-runtime';
|
|
20
|
-
import { FunctionInvocationServiceLayerTestMocked, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
21
|
-
import { log } from '@dxos/log';
|
|
22
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
23
|
-
import { Text } from '@dxos/schema';
|
|
24
|
-
import { type Message } from '@dxos/types';
|
|
25
|
-
import { trim } from '@dxos/util';
|
|
26
|
-
|
|
27
|
-
import { type TestStep, runSteps } from '../testing';
|
|
28
|
-
|
|
29
|
-
import PlanningOldBlueprint from './blueprint';
|
|
30
|
-
import { TaskFunctions } from './functions';
|
|
31
|
-
|
|
32
|
-
describe('Planning Blueprint', { timeout: 120_000 }, () => {
|
|
33
|
-
const blueprint = PlanningOldBlueprint.make();
|
|
34
|
-
it.scoped(
|
|
35
|
-
'planning blueprint',
|
|
36
|
-
Effect.fn(
|
|
37
|
-
function* ({ expect }) {
|
|
38
|
-
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
39
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
40
|
-
|
|
41
|
-
yield* Database.add(blueprint);
|
|
42
|
-
yield* Effect.promise(() =>
|
|
43
|
-
conversation.context.bind({
|
|
44
|
-
blueprints: [Ref.make(blueprint)],
|
|
45
|
-
}),
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
const artifact = yield* Database.add(Markdown.make());
|
|
49
|
-
let prevContent = artifact.content;
|
|
50
|
-
const matchList =
|
|
51
|
-
({ includes = [], excludes = [] }: { includes: RegExp[]; excludes?: RegExp[] }) =>
|
|
52
|
-
async () => {
|
|
53
|
-
const { content } = await artifact.content.load();
|
|
54
|
-
log.info('spec', { doc: artifact.content.target?.content });
|
|
55
|
-
expect(content).not.toBe(prevContent);
|
|
56
|
-
const text = content.toLowerCase();
|
|
57
|
-
for (const include of includes) {
|
|
58
|
-
expect(text.match(include), `does not include: ${include}`).toBeTruthy();
|
|
59
|
-
}
|
|
60
|
-
for (const exclude of excludes) {
|
|
61
|
-
expect(text.match(exclude), `includes: ${exclude}`).toBeFalsy();
|
|
62
|
-
}
|
|
63
|
-
prevContent = artifact.content;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const system = 'You are a helpful assistant.';
|
|
67
|
-
const steps: TestStep[] = [
|
|
68
|
-
{
|
|
69
|
-
system,
|
|
70
|
-
prompt: trim`
|
|
71
|
-
I'm building a shelf.
|
|
72
|
-
Maintain a shopping list here: ${Obj.getDXN(artifact)}
|
|
73
|
-
I need a hammer, nails, and a saw.
|
|
74
|
-
`,
|
|
75
|
-
test: matchList({
|
|
76
|
-
includes: [/- \[.+hammer/, /- \[.+nails/, /- \[.+saw/],
|
|
77
|
-
}),
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
system,
|
|
81
|
-
prompt: trim`
|
|
82
|
-
I will need a board too.
|
|
83
|
-
`,
|
|
84
|
-
test: matchList({
|
|
85
|
-
includes: [/- \[.+board/],
|
|
86
|
-
}),
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
system,
|
|
90
|
-
prompt: trim`
|
|
91
|
-
Actually I'm going to use screws and a screwdriver.
|
|
92
|
-
`,
|
|
93
|
-
test: matchList({
|
|
94
|
-
includes: [/- \[.+screwdriver/, /- \[.+screws/],
|
|
95
|
-
excludes: [/- \[.+hammer/, /- \[.+nails/],
|
|
96
|
-
}),
|
|
97
|
-
},
|
|
98
|
-
];
|
|
99
|
-
|
|
100
|
-
yield* runSteps(conversation, steps);
|
|
101
|
-
},
|
|
102
|
-
Effect.provide(
|
|
103
|
-
Layer.mergeAll(
|
|
104
|
-
TestDatabaseLayer({ types: [Text.Text, Markdown.Document, Blueprint.Blueprint] }),
|
|
105
|
-
ToolExecutionServices,
|
|
106
|
-
AiService.model('@anthropic/claude-3-5-sonnet-20241022'),
|
|
107
|
-
).pipe(
|
|
108
|
-
Layer.provideMerge(
|
|
109
|
-
FunctionInvocationServiceLayerTestMocked({ functions: Object.values(TaskFunctions) }).pipe(
|
|
110
|
-
Layer.provideMerge(TracingService.layerNoop),
|
|
111
|
-
),
|
|
112
|
-
),
|
|
113
|
-
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions: Object.values(TaskFunctions) })),
|
|
114
|
-
Layer.provideMerge(TestDatabaseLayer({ types: [Text.Text, Markdown.Document, Blueprint.Blueprint] })),
|
|
115
|
-
Layer.provideMerge(Layer.mergeAll(GenericToolkit.providerEmpty, AiServiceTestingPreset('direct'))),
|
|
116
|
-
),
|
|
117
|
-
),
|
|
118
|
-
TestHelpers.provideTestContext,
|
|
119
|
-
TestHelpers.taggedTest('llm'),
|
|
120
|
-
),
|
|
121
|
-
);
|
|
122
|
-
});
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ToolId } from '@dxos/ai';
|
|
6
|
-
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
7
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
8
|
-
import { Ref } from '@dxos/echo';
|
|
9
|
-
import { Text } from '@dxos/schema';
|
|
10
|
-
import { trim } from '@dxos/util';
|
|
11
|
-
|
|
12
|
-
import { TaskFunctions } from './functions';
|
|
13
|
-
|
|
14
|
-
const BLUEPRINT_KEY = 'dxos.org/blueprint/planning';
|
|
15
|
-
|
|
16
|
-
const functions = Object.values(TaskFunctions);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Agent prompt instructions for managing hierarchical task lists.
|
|
20
|
-
*/
|
|
21
|
-
const instructions = trim`
|
|
22
|
-
You are a task management agent that maintains hierarchical task lists where each line is a task.
|
|
23
|
-
|
|
24
|
-
## Document Format
|
|
25
|
-
You will receive task lists with line numbers prefixed like:
|
|
26
|
-
|
|
27
|
-
${'```'}
|
|
28
|
-
1. - [ ] First main task
|
|
29
|
-
2. - [ ] Subtask 1: Research phase
|
|
30
|
-
3. - [x] Literature review
|
|
31
|
-
4. - [ ] Stakeholder interviews
|
|
32
|
-
5. - [ ] Subtask 2: Implementation
|
|
33
|
-
6. - [ ] Setup infrastructure
|
|
34
|
-
7. - [ ] Write core functionality
|
|
35
|
-
8. - [ ] Another main task
|
|
36
|
-
${'```'}
|
|
37
|
-
|
|
38
|
-
## Task Hierarchy
|
|
39
|
-
- 0 spaces: Top-level tasks
|
|
40
|
-
- 2 spaces: First-level subtasks
|
|
41
|
-
- 4 spaces: Second-level subtasks
|
|
42
|
-
- 6 spaces: Third-level subtasks (and so on)
|
|
43
|
-
|
|
44
|
-
## Available Operations
|
|
45
|
-
You can modify the task list using these operations:
|
|
46
|
-
|
|
47
|
-
1. **insertTask(lineNumber, text, completed?, indent?)** - Insert a new task
|
|
48
|
-
2. **deleteTask(lineNumber)** - Delete a task
|
|
49
|
-
3. **updateTaskText(lineNumber, text)** - Change task description
|
|
50
|
-
4. **toggleTaskCompletion(lineNumber, completed?)** - Mark task complete/incomplete
|
|
51
|
-
5. **setTaskIndent(lineNumber, indent)** - Change task hierarchy level
|
|
52
|
-
|
|
53
|
-
## Examples
|
|
54
|
-
|
|
55
|
-
### Example 1: Adding a subtask
|
|
56
|
-
**User:** "Add a subtask 'Code review' under the task on line 1"
|
|
57
|
-
**Response:** \`insertTask(2, "Code review", false, 2)\`
|
|
58
|
-
|
|
59
|
-
### Example 2: Marking a task complete
|
|
60
|
-
**User:** "Mark the task on line 3 as complete"
|
|
61
|
-
**Response:** \`toggleTaskCompletion(3, true)\`
|
|
62
|
-
|
|
63
|
-
### Example 3: Updating task text
|
|
64
|
-
**User:** "Change the task on line 5 to 'Backend implementation'"
|
|
65
|
-
**Response:** \`updateTaskText(5, "Backend implementation")\`
|
|
66
|
-
|
|
67
|
-
### Example 4: Creating a task hierarchy
|
|
68
|
-
**User:** "Add a main task 'Testing phase' with two subtasks"
|
|
69
|
-
**Response:**
|
|
70
|
-
\`\`\`
|
|
71
|
-
insertTask(999, "Testing phase", false, 0)
|
|
72
|
-
insertTask(999, "Unit tests", false, 2)
|
|
73
|
-
insertTask(999, "Integration tests", false, 2)
|
|
74
|
-
\`\`\`
|
|
75
|
-
|
|
76
|
-
### Example 5: Reorganizing hierarchy
|
|
77
|
-
**User:** "Move the task on line 4 to be a main task (top level)"
|
|
78
|
-
**Response:** \`setTaskIndent(4, 0)\`
|
|
79
|
-
|
|
80
|
-
### Example 6: Adding nested subtasks
|
|
81
|
-
**User:** "Add a sub-subtask 'Write test cases' under line 6"
|
|
82
|
-
**Response:** \`insertTask(7, "Write test cases", false, 4)\`
|
|
83
|
-
|
|
84
|
-
## Guidelines
|
|
85
|
-
- Always reference line numbers from the numbered document you receive
|
|
86
|
-
- Use line number 999 to append to the end of the document
|
|
87
|
-
- Maintain logical hierarchy (subtasks should be indented under their parent)
|
|
88
|
-
- Use appropriate indentation levels (0, 2, 4, 6, etc. spaces)
|
|
89
|
-
- When creating subtasks, consider the parent task's completion status
|
|
90
|
-
- Be precise with task descriptions and hierarchy levels
|
|
91
|
-
`;
|
|
92
|
-
|
|
93
|
-
const make = () =>
|
|
94
|
-
Blueprint.make({
|
|
95
|
-
key: BLUEPRINT_KEY,
|
|
96
|
-
name: 'Planning',
|
|
97
|
-
description: 'Plans and tracks complex tasks with artifact management.',
|
|
98
|
-
instructions: {
|
|
99
|
-
source: Ref.make(Text.make(instructions)),
|
|
100
|
-
},
|
|
101
|
-
tools: functions.map((fn) => ToolId.make(fn.key)),
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
105
|
-
key: BLUEPRINT_KEY,
|
|
106
|
-
functions,
|
|
107
|
-
make,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export default blueprint;
|
|
@@ -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, Ref } 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: Ref.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
|
-
});
|