@dxos/assistant-toolkit 0.8.4-main.9735255 → 0.8.4-main.abd8ff62ef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/neutral/add-artifact-BA5WQRDU.mjs +30 -0
- package/dist/lib/neutral/add-artifact-BA5WQRDU.mjs.map +7 -0
- package/dist/lib/neutral/agent-M2EW5M36.mjs +65 -0
- package/dist/lib/neutral/agent-M2EW5M36.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CLHVRIYF.mjs +293 -0
- package/dist/lib/neutral/chunk-CLHVRIYF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CVUA23QI.mjs +332 -0
- package/dist/lib/neutral/chunk-CVUA23QI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-D5MG5OKX.mjs +75 -0
- package/dist/lib/neutral/chunk-D5MG5OKX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-E2XRNXWP.mjs +100 -0
- package/dist/lib/neutral/chunk-E2XRNXWP.mjs.map +7 -0
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs +73 -0
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J37DYY7A.mjs +51 -0
- package/dist/lib/neutral/chunk-J37DYY7A.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JCYLFOFK.mjs +70 -0
- package/dist/lib/neutral/chunk-JCYLFOFK.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KGU725LW.mjs +29 -0
- package/dist/lib/neutral/chunk-KGU725LW.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KY2TIPJ5.mjs +108 -0
- package/dist/lib/neutral/chunk-KY2TIPJ5.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MMTKJBB5.mjs +140 -0
- package/dist/lib/neutral/chunk-MMTKJBB5.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NR3GTWRC.mjs +53 -0
- package/dist/lib/neutral/chunk-NR3GTWRC.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TO5IX24K.mjs +67 -0
- package/dist/lib/neutral/chunk-TO5IX24K.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs +25 -0
- package/dist/lib/neutral/chunk-WLR3BGO4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs +73 -0
- package/dist/lib/neutral/chunk-ZFXLTBZG.mjs.map +7 -0
- package/dist/lib/neutral/context-add-IIDPRRVB.mjs +22 -0
- package/dist/lib/neutral/context-add-IIDPRRVB.mjs.map +7 -0
- package/dist/lib/neutral/context-remove-RDYV4PD4.mjs +22 -0
- package/dist/lib/neutral/context-remove-RDYV4PD4.mjs.map +7 -0
- package/dist/lib/neutral/create-project-GLDEAWTT.mjs +35 -0
- package/dist/lib/neutral/create-project-GLDEAWTT.mjs.map +7 -0
- package/dist/lib/neutral/delete-J3PMWP7Z.mjs +19 -0
- package/dist/lib/neutral/delete-J3PMWP7Z.mjs.map +7 -0
- package/dist/lib/neutral/enable-blueprints-LBDZH2CY.mjs +47 -0
- package/dist/lib/neutral/enable-blueprints-LBDZH2CY.mjs.map +7 -0
- package/dist/lib/neutral/fetch-KHMHV7JR.mjs +16 -0
- package/dist/lib/neutral/fetch-KHMHV7JR.mjs.map +7 -0
- package/dist/lib/neutral/fetch-messages-PWGUG5G3.mjs +139 -0
- package/dist/lib/neutral/fetch-messages-PWGUG5G3.mjs.map +7 -0
- package/dist/lib/neutral/get-context-B55SX5Y4.mjs +35 -0
- package/dist/lib/neutral/get-context-B55SX5Y4.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +904 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/load-LI7HHVD6.mjs +17 -0
- package/dist/lib/neutral/load-LI7HHVD6.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/object-create-52Z7YKIA.mjs +35 -0
- package/dist/lib/neutral/object-create-52Z7YKIA.mjs.map +7 -0
- package/dist/lib/neutral/object-delete-I266YAXI.mjs +18 -0
- package/dist/lib/neutral/object-delete-I266YAXI.mjs.map +7 -0
- package/dist/lib/neutral/object-update-HY4GI7LA.mjs +28 -0
- package/dist/lib/neutral/object-update-HY4GI7LA.mjs.map +7 -0
- package/dist/lib/neutral/project-2YBPW5N7.mjs +23 -0
- package/dist/lib/neutral/project-rules-XUBEPDP6.mjs +78 -0
- package/dist/lib/neutral/project-rules-XUBEPDP6.mjs.map +7 -0
- package/dist/lib/neutral/prompt-2WZQERT4.mjs +167 -0
- package/dist/lib/neutral/prompt-2WZQERT4.mjs.map +7 -0
- package/dist/lib/neutral/qualifier-2AC2ICOB.mjs +88 -0
- package/dist/lib/neutral/qualifier-2AC2ICOB.mjs.map +7 -0
- package/dist/lib/neutral/query-B3NOYFCK.mjs +70 -0
- package/dist/lib/neutral/query-B3NOYFCK.mjs.map +7 -0
- package/dist/lib/neutral/query-U56GNEV6.mjs +32 -0
- package/dist/lib/neutral/query-U56GNEV6.mjs.map +7 -0
- package/dist/lib/neutral/query-blueprints-KXADGHSA.mjs +16 -0
- package/dist/lib/neutral/query-blueprints-KXADGHSA.mjs.map +7 -0
- package/dist/lib/neutral/relation-create-Z3NGW4VU.mjs +34 -0
- package/dist/lib/neutral/relation-create-Z3NGW4VU.mjs.map +7 -0
- package/dist/lib/neutral/relation-delete-LXY7W2YO.mjs +18 -0
- package/dist/lib/neutral/relation-delete-LXY7W2YO.mjs.map +7 -0
- package/dist/lib/neutral/save-GWAPLT3Z.mjs +23 -0
- package/dist/lib/neutral/save-GWAPLT3Z.mjs.map +7 -0
- package/dist/lib/neutral/schema-add-4TXJO2V7.mjs +24 -0
- package/dist/lib/neutral/schema-add-4TXJO2V7.mjs.map +7 -0
- package/dist/lib/neutral/schema-list-PJS5AFZ3.mjs +38 -0
- package/dist/lib/neutral/schema-list-PJS5AFZ3.mjs.map +7 -0
- package/dist/lib/neutral/sync-issues-LOLHZNFL.mjs +167 -0
- package/dist/lib/neutral/sync-issues-LOLHZNFL.mjs.map +7 -0
- package/dist/lib/neutral/sync-triggers-EYJM4QWR.mjs +136 -0
- package/dist/lib/neutral/sync-triggers-EYJM4QWR.mjs.map +7 -0
- package/dist/lib/neutral/tag-add-5NOHUTIE.mjs +19 -0
- package/dist/lib/neutral/tag-add-5NOHUTIE.mjs.map +7 -0
- package/dist/lib/neutral/tag-remove-QTKYDJAW.mjs +19 -0
- package/dist/lib/neutral/tag-remove-QTKYDJAW.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +76 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/update-blueprints-N2AK2VUR.mjs +16 -0
- package/dist/lib/neutral/update-blueprints-N2AK2VUR.mjs.map +7 -0
- package/dist/lib/neutral/update-tasks-ML2FCYU5.mjs +46 -0
- package/dist/lib/neutral/update-tasks-ML2FCYU5.mjs.map +7 -0
- package/dist/types/src/blueprints/automation/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/automation/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/automation/index.d.ts +2 -0
- package/dist/types/src/blueprints/automation/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/blueprint-manager/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts +59 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts +35 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts +26 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts +3 -0
- package/dist/types/src/blueprints/blueprint-manager/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/browser/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/browser/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/browser/index.d.ts +2 -0
- package/dist/types/src/blueprints/browser/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/database/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/database/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/context-add.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/context-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/definitions.d.ts +59 -0
- package/dist/types/src/blueprints/database/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/load.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/load.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/object-create.d.ts +8 -0
- package/dist/types/src/blueprints/database/functions/object-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/object-delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/object-update.d.ts +10 -0
- package/dist/types/src/blueprints/database/functions/object-update.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/query.d.ts +13 -0
- package/dist/types/src/blueprints/database/functions/query.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts +10 -0
- package/dist/types/src/blueprints/database/functions/relation-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/relation-delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts +9 -0
- package/dist/types/src/blueprints/database/functions/schema-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts +7 -0
- package/dist/types/src/blueprints/database/functions/schema-list.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts +8 -0
- package/dist/types/src/blueprints/database/functions/tag-add.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts +8 -0
- package/dist/types/src/blueprints/database/functions/tag-remove.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/index.d.ts +3 -0
- package/dist/types/src/blueprints/database/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/discord/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/functions/definitions.d.ts +15 -0
- package/dist/types/src/blueprints/discord/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.d.ts +3 -2
- package/dist/types/src/blueprints/discord/functions/fetch-messages.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/functions/fetch-messages.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/index.d.ts +2 -2
- package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/github/functions/definitions.d.ts +7 -0
- package/dist/types/src/blueprints/github/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts +8 -0
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/index.d.ts +2 -0
- package/dist/types/src/blueprints/github/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +11 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/linear/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts +6 -0
- package/dist/types/src/blueprints/linear/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/linear/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/linear.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts +10 -0
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/index.d.ts +2 -2
- package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/memory/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/memory/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/memory/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts +17 -0
- package/dist/types/src/blueprints/memory/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/delete.d.ts +10 -0
- package/dist/types/src/blueprints/memory/functions/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/memory/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/query.d.ts +8 -0
- package/dist/types/src/blueprints/memory/functions/query.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/save.d.ts +8 -0
- package/dist/types/src/blueprints/memory/functions/save.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/index.d.ts +3 -0
- package/dist/types/src/blueprints/memory/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/planning/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts +11 -0
- package/dist/types/src/blueprints/planning/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/planning/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts +11 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/index.d.ts +2 -2
- package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/project/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/project/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/project/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts +8 -0
- package/dist/types/src/blueprints/project/functions/add-artifact.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/agent.d.ts +4 -0
- package/dist/types/src/blueprints/project/functions/agent.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/definitions.d.ts +158 -0
- package/dist/types/src/blueprints/project/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/get-context.d.ts +15 -0
- package/dist/types/src/blueprints/project/functions/get-context.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/project/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +73 -0
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/index.d.ts +3 -0
- package/dist/types/src/blueprints/project/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/project-wizard/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts +51 -0
- package/dist/types/src/blueprints/project-wizard/functions/create-project.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts +96 -0
- package/dist/types/src/blueprints/project-wizard/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/project-wizard/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts +4 -0
- package/dist/types/src/blueprints/project-wizard/functions/project-rules.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts +48 -0
- package/dist/types/src/blueprints/project-wizard/functions/sync-triggers.d.ts.map +1 -0
- package/dist/types/src/blueprints/project-wizard/index.d.ts +3 -0
- package/dist/types/src/blueprints/project-wizard/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/testing.d.ts +9 -5
- package/dist/types/src/blueprints/testing.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/websearch/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/websearch/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/functions/definitions.d.ts +5 -0
- package/dist/types/src/blueprints/websearch/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/functions/fetch.d.ts +6 -0
- package/dist/types/src/blueprints/websearch/functions/fetch.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/websearch/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/websearch/index.d.ts +3 -3
- package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/{websearch-toolkit.d.ts → toolkit.d.ts} +3 -1
- package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
- package/dist/types/src/crud/graph.d.ts +7 -7
- package/dist/types/src/crud/graph.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +41 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/functions/agent/definitions.d.ts +60 -0
- package/dist/types/src/functions/agent/definitions.d.ts.map +1 -0
- package/dist/types/src/functions/agent/index.d.ts +3 -4
- package/dist/types/src/functions/agent/index.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.d.ts +2 -74
- package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.test.d.ts +2 -0
- package/dist/types/src/functions/agent/prompt.test.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +0 -6
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/sync/sync.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/plugins.d.ts.map +1 -1
- package/dist/types/src/toolkits/WebToolkit.d.ts +38 -0
- package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -0
- package/dist/types/src/toolkits/index.d.ts +1 -2
- package/dist/types/src/toolkits/index.d.ts.map +1 -1
- package/dist/types/src/types/Agent.d.ts +77 -0
- package/dist/types/src/types/Agent.d.ts.map +1 -0
- package/dist/types/src/types/Chat.d.ts +56 -0
- package/dist/types/src/types/Chat.d.ts.map +1 -0
- package/dist/types/src/types/McpServer.d.ts +18 -0
- package/dist/types/src/types/McpServer.d.ts.map +1 -0
- package/dist/types/src/types/Memory.d.ts +12 -0
- package/dist/types/src/types/Memory.d.ts.map +1 -0
- package/dist/types/src/types/Plan.d.ts +89 -0
- package/dist/types/src/types/Plan.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +6 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/util/graphql.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -43
- package/src/blueprints/automation/blueprint.ts +105 -0
- package/src/blueprints/automation/index.ts +5 -0
- package/src/blueprints/blueprint-manager/blueprint.conversations.json +1 -0
- package/src/blueprints/blueprint-manager/blueprint.test.ts +198 -0
- package/src/blueprints/blueprint-manager/blueprint.ts +49 -0
- package/src/blueprints/blueprint-manager/functions/definitions.ts +57 -0
- package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +43 -0
- package/src/blueprints/blueprint-manager/functions/index.ts +13 -0
- package/src/blueprints/blueprint-manager/functions/query-blueprints.ts +18 -0
- package/src/blueprints/blueprint-manager/functions/update-blueprints.ts +18 -0
- package/src/blueprints/blueprint-manager/index.ts +6 -0
- package/src/blueprints/browser/blueprint.test.ts +61 -0
- package/src/blueprints/browser/blueprint.ts +40 -0
- package/src/blueprints/browser/index.ts +5 -0
- package/src/blueprints/database/blueprint.conversations.json +1 -0
- package/src/blueprints/database/blueprint.test.ts +531 -0
- package/src/blueprints/database/blueprint.ts +66 -0
- package/src/blueprints/database/functions/context-add.ts +24 -0
- package/src/blueprints/database/functions/context-remove.ts +24 -0
- package/src/blueprints/database/functions/definitions.ts +318 -0
- package/src/blueprints/database/functions/index.ts +23 -0
- package/src/blueprints/database/functions/load.ts +19 -0
- package/src/blueprints/database/functions/object-create.ts +38 -0
- package/src/blueprints/database/functions/object-delete.ts +20 -0
- package/src/blueprints/database/functions/object-update.ts +30 -0
- package/src/blueprints/database/functions/query.ts +64 -0
- package/src/blueprints/database/functions/relation-create.ts +34 -0
- package/src/blueprints/database/functions/relation-delete.ts +21 -0
- package/src/blueprints/database/functions/schema-add.ts +28 -0
- package/src/blueprints/database/functions/schema-list.ts +33 -0
- package/src/blueprints/database/functions/tag-add.ts +21 -0
- package/src/blueprints/database/functions/tag-remove.ts +21 -0
- package/src/blueprints/database/index.ts +21 -0
- package/src/blueprints/discord/blueprint.ts +41 -0
- package/src/blueprints/discord/functions/definitions.ts +70 -0
- package/src/blueprints/discord/functions/fetch-messages.test.ts +45 -0
- package/src/blueprints/discord/functions/fetch-messages.ts +198 -0
- package/src/blueprints/discord/functions/index.ts +9 -0
- package/src/blueprints/discord/index.ts +2 -3
- package/src/blueprints/github/functions/definitions.ts +26 -0
- package/src/blueprints/github/functions/fetch-prs.ts +24 -0
- package/src/blueprints/github/functions/index.ts +9 -0
- package/src/blueprints/github/index.ts +5 -0
- package/src/blueprints/index.ts +11 -6
- package/src/blueprints/linear/blueprint.ts +42 -0
- package/src/blueprints/linear/functions/definitions.ts +23 -0
- package/src/blueprints/linear/functions/index.ts +9 -0
- package/src/blueprints/linear/functions/linear.test.ts +58 -0
- package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +37 -45
- package/src/blueprints/linear/index.ts +2 -3
- package/src/blueprints/memory/blueprint.conversations.json +1 -0
- package/src/blueprints/memory/blueprint.test.ts +139 -0
- package/src/blueprints/memory/blueprint.ts +41 -0
- package/src/blueprints/memory/functions/definitions.ts +68 -0
- package/src/blueprints/memory/functions/delete.ts +20 -0
- package/src/blueprints/memory/functions/index.ts +13 -0
- package/src/blueprints/memory/functions/query.ts +32 -0
- package/src/blueprints/memory/functions/save.ts +20 -0
- package/src/blueprints/memory/index.ts +6 -0
- package/src/blueprints/planning/blueprint.ts +24 -0
- package/src/blueprints/planning/functions/definitions.ts +137 -0
- package/src/blueprints/planning/functions/index.ts +9 -0
- package/src/blueprints/planning/functions/update-tasks.ts +45 -0
- package/src/blueprints/planning/index.ts +3 -4
- package/src/blueprints/project/blueprint.conversations.json +1 -0
- package/src/{initiative/initiative.test.ts → blueprints/project/blueprint.test.ts} +279 -50
- package/src/blueprints/project/blueprint.ts +64 -0
- package/src/blueprints/project/functions/add-artifact.ts +30 -0
- package/src/blueprints/project/functions/agent.ts +69 -0
- package/src/blueprints/project/functions/definitions.ts +92 -0
- package/src/blueprints/project/functions/get-context.ts +46 -0
- package/src/blueprints/project/functions/index.ts +14 -0
- package/src/blueprints/project/functions/qualifier.ts +90 -0
- package/src/blueprints/project/index.ts +6 -0
- package/src/blueprints/project-wizard/blueprint.ts +52 -0
- package/src/blueprints/project-wizard/functions/create-project.ts +32 -0
- package/src/blueprints/project-wizard/functions/definitions.ts +63 -0
- package/src/blueprints/project-wizard/functions/index.ts +13 -0
- package/src/blueprints/project-wizard/functions/project-rules.ts +77 -0
- package/src/blueprints/project-wizard/functions/sync-triggers.ts +158 -0
- package/src/blueprints/project-wizard/index.ts +6 -0
- package/src/blueprints/testing.ts +23 -8
- package/src/blueprints/websearch/blueprint.conversations.json +1 -0
- package/src/blueprints/websearch/blueprint.test.ts +39 -0
- package/src/blueprints/websearch/blueprint.ts +30 -0
- package/src/blueprints/websearch/functions/definitions.ts +25 -0
- package/src/blueprints/websearch/functions/fetch.ts +18 -0
- package/src/blueprints/websearch/functions/index.ts +9 -0
- package/src/blueprints/websearch/index.ts +3 -5
- package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +6 -1
- package/src/crud/graph.test.ts +12 -14
- package/src/crud/graph.ts +11 -11
- package/src/errors.ts +25 -0
- package/src/functions/READ_THIS.md +5 -0
- package/src/functions/agent/definitions.ts +51 -0
- package/src/functions/agent/index.ts +3 -5
- package/src/functions/agent/prompt.conversations.json +1 -0
- package/src/functions/agent/prompt.test.ts +81 -0
- package/src/functions/agent/prompt.ts +209 -106
- package/src/functions/index.ts +0 -6
- package/src/index.ts +2 -1
- package/src/sync/sync.ts +25 -14
- package/src/testing/index.ts +1 -0
- package/src/testing/plugins.tsx +30 -19
- package/src/toolkits/WebToolkit.ts +33 -0
- package/src/toolkits/index.ts +1 -2
- package/src/types/Agent.ts +239 -0
- package/src/types/Chat.ts +63 -0
- package/src/types/McpServer.ts +37 -0
- package/src/types/Memory.ts +24 -0
- package/src/types/Plan.ts +110 -0
- package/src/types/index.ts +9 -0
- package/dist/lib/browser/index.mjs +0 -2880
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/testing/index.mjs +0 -43
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/index.mjs +0 -2881
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/testing/index.mjs +0 -44
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/blueprints/design/design-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/design/design-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/design-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/design/design-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/index.d.ts +0 -3
- package/dist/types/src/blueprints/design/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/index.d.ts +0 -3
- package/dist/types/src/blueprints/research/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/research-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/research/research-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/research-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/research/research-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/websearch-toolkit.d.ts.map +0 -1
- package/dist/types/src/experimental/feed.test.d.ts +0 -2
- package/dist/types/src/experimental/feed.test.d.ts.map +0 -1
- package/dist/types/src/functions/discord/fetch-messages.d.ts.map +0 -1
- package/dist/types/src/functions/discord/fetch-messages.test.d.ts.map +0 -1
- package/dist/types/src/functions/discord/index.d.ts +0 -12
- package/dist/types/src/functions/discord/index.d.ts.map +0 -1
- package/dist/types/src/functions/document/index.d.ts +0 -13
- package/dist/types/src/functions/document/index.d.ts.map +0 -1
- package/dist/types/src/functions/document/read.d.ts +0 -7
- package/dist/types/src/functions/document/read.d.ts.map +0 -1
- package/dist/types/src/functions/document/update.d.ts +0 -6
- package/dist/types/src/functions/document/update.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +0 -174
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.test.d.ts +0 -2
- package/dist/types/src/functions/entity-extraction/entity-extraction.test.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/index.d.ts +0 -175
- package/dist/types/src/functions/entity-extraction/index.d.ts.map +0 -1
- package/dist/types/src/functions/exa/data/exa-search-1748337321991.d.ts +0 -38
- package/dist/types/src/functions/exa/data/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/functions/exa/data/exa-search-1748337331526.d.ts +0 -37
- package/dist/types/src/functions/exa/data/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/functions/exa/data/exa-search-1748337344119.d.ts +0 -58
- package/dist/types/src/functions/exa/data/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/functions/exa/data/index.d.ts +0 -3
- package/dist/types/src/functions/exa/data/index.d.ts.map +0 -1
- package/dist/types/src/functions/exa/exa.d.ts +0 -5
- package/dist/types/src/functions/exa/exa.d.ts.map +0 -1
- package/dist/types/src/functions/exa/index.d.ts +0 -3
- package/dist/types/src/functions/exa/index.d.ts.map +0 -1
- package/dist/types/src/functions/exa/mock.d.ts +0 -5
- package/dist/types/src/functions/exa/mock.d.ts.map +0 -1
- package/dist/types/src/functions/github/fetch-prs.d.ts +0 -6
- package/dist/types/src/functions/github/fetch-prs.d.ts.map +0 -1
- package/dist/types/src/functions/linear/index.d.ts +0 -9
- package/dist/types/src/functions/linear/index.d.ts.map +0 -1
- package/dist/types/src/functions/linear/linear.test.d.ts.map +0 -1
- package/dist/types/src/functions/linear/sync-issues.d.ts +0 -12
- package/dist/types/src/functions/linear/sync-issues.d.ts.map +0 -1
- package/dist/types/src/functions/research/document-create.d.ts +0 -9
- package/dist/types/src/functions/research/document-create.d.ts.map +0 -1
- package/dist/types/src/functions/research/index.d.ts +0 -21
- package/dist/types/src/functions/research/index.d.ts.map +0 -1
- package/dist/types/src/functions/research/research-graph.d.ts +0 -19
- package/dist/types/src/functions/research/research-graph.d.ts.map +0 -1
- package/dist/types/src/functions/research/research.d.ts +0 -14
- package/dist/types/src/functions/research/research.d.ts.map +0 -1
- package/dist/types/src/functions/research/research.test.d.ts +0 -2
- package/dist/types/src/functions/research/research.test.d.ts.map +0 -1
- package/dist/types/src/functions/research/types.d.ts +0 -6
- package/dist/types/src/functions/research/types.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/index.d.ts +0 -15
- package/dist/types/src/functions/tasks/index.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/read.d.ts +0 -7
- package/dist/types/src/functions/tasks/read.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/task-list.d.ts +0 -74
- package/dist/types/src/functions/tasks/task-list.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/task-list.test.d.ts +0 -2
- package/dist/types/src/functions/tasks/task-list.test.d.ts.map +0 -1
- package/dist/types/src/functions/tasks/update.d.ts +0 -9
- package/dist/types/src/functions/tasks/update.d.ts.map +0 -1
- package/dist/types/src/initiative/Initiative.d.ts +0 -84
- package/dist/types/src/initiative/Initiative.d.ts.map +0 -1
- package/dist/types/src/initiative/InitiativeSchema.d.ts +0 -19
- package/dist/types/src/initiative/InitiativeSchema.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/agent.d.ts +0 -37
- package/dist/types/src/initiative/functions/agent.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/getContext.d.ts +0 -17
- package/dist/types/src/initiative/functions/getContext.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/index.d.ts +0 -4
- package/dist/types/src/initiative/functions/index.d.ts.map +0 -1
- package/dist/types/src/initiative/functions/update.d.ts +0 -7
- package/dist/types/src/initiative/functions/update.d.ts.map +0 -1
- package/dist/types/src/initiative/index.d.ts +0 -1
- package/dist/types/src/initiative/index.d.ts.map +0 -1
- package/dist/types/src/initiative/initiative.test.d.ts +0 -2
- package/dist/types/src/initiative/initiative.test.d.ts.map +0 -1
- package/dist/types/src/toolkits/AssistantToolkit.d.ts +0 -43
- package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +0 -1
- package/dist/types/src/toolkits/AssistantToolkit.test.d.ts +0 -2
- package/dist/types/src/toolkits/AssistantToolkit.test.d.ts.map +0 -1
- package/dist/types/src/toolkits/SystemToolkit.d.ts +0 -99
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +0 -1
- package/src/blueprints/design/design-blueprint.test.ts +0 -105
- package/src/blueprints/design/design-blueprint.ts +0 -31
- package/src/blueprints/design/index.ts +0 -7
- package/src/blueprints/discord/discord-blueprint.ts +0 -32
- package/src/blueprints/linear/linear-blueprint.ts +0 -33
- package/src/blueprints/planning/planning-blueprint.test.ts +0 -126
- package/src/blueprints/planning/planning-blueprint.ts +0 -96
- package/src/blueprints/research/index.ts +0 -7
- package/src/blueprints/research/research-blueprint.test.ts +0 -7
- package/src/blueprints/research/research-blueprint.ts +0 -51
- package/src/blueprints/websearch/websearch-blueprint.ts +0 -18
- package/src/experimental/feed.test.ts +0 -111
- package/src/functions/discord/fetch-messages.test.ts +0 -58
- package/src/functions/discord/fetch-messages.ts +0 -252
- package/src/functions/discord/index.ts +0 -9
- package/src/functions/document/index.ts +0 -12
- package/src/functions/document/read.ts +0 -30
- package/src/functions/document/update.ts +0 -33
- package/src/functions/entity-extraction/entity-extraction.conversations.json +0 -6597
- package/src/functions/entity-extraction/entity-extraction.test.ts +0 -93
- package/src/functions/entity-extraction/entity-extraction.ts +0 -183
- package/src/functions/entity-extraction/index.ts +0 -9
- package/src/functions/exa/data/exa-search-1748337321991.ts +0 -131
- package/src/functions/exa/data/exa-search-1748337331526.ts +0 -144
- package/src/functions/exa/data/exa-search-1748337344119.ts +0 -133
- package/src/functions/exa/data/index.ts +0 -11
- package/src/functions/exa/exa.ts +0 -37
- package/src/functions/exa/index.ts +0 -6
- package/src/functions/exa/mock.ts +0 -71
- package/src/functions/github/fetch-prs.ts +0 -31
- package/src/functions/linear/index.ts +0 -9
- package/src/functions/linear/linear.test.ts +0 -84
- package/src/functions/research/document-create.ts +0 -76
- package/src/functions/research/index.ts +0 -14
- package/src/functions/research/research-graph.ts +0 -49
- package/src/functions/research/research-instructions.tpl +0 -106
- package/src/functions/research/research.conversations.json +0 -1
- package/src/functions/research/research.test.ts +0 -171
- package/src/functions/research/research.ts +0 -189
- package/src/functions/research/types.ts +0 -26
- package/src/functions/tasks/index.ts +0 -11
- package/src/functions/tasks/read.ts +0 -35
- package/src/functions/tasks/task-list.test.ts +0 -99
- package/src/functions/tasks/task-list.ts +0 -165
- package/src/functions/tasks/update.ts +0 -53
- package/src/initiative/Initiative.ts +0 -99
- package/src/initiative/InitiativeSchema.ts +0 -37
- package/src/initiative/functions/agent.ts +0 -57
- package/src/initiative/functions/getContext.ts +0 -74
- package/src/initiative/functions/index.ts +0 -7
- package/src/initiative/functions/update.ts +0 -63
- package/src/initiative/index.ts +0 -3
- package/src/initiative/initiative.conversations.json +0 -1
- package/src/toolkits/AssistantToolkit.conversations.json +0 -1
- package/src/toolkits/AssistantToolkit.test.ts +0 -94
- package/src/toolkits/AssistantToolkit.ts +0 -70
- package/src/toolkits/SystemToolkit.ts +0 -299
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/project-2YBPW5N7.mjs.map} +0 -0
- /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.d.ts +0 -0
- /package/dist/types/src/{functions/linear → blueprints/linear/functions}/linear.test.d.ts +0 -0
|
@@ -1,171 +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
|
-
import * as Layer from 'effect/Layer';
|
|
10
|
-
|
|
11
|
-
import { AiService, ConsolePrinter } from '@dxos/ai';
|
|
12
|
-
import { MemoizedAiService, TestAiService } from '@dxos/ai/testing';
|
|
13
|
-
import {
|
|
14
|
-
AiConversation,
|
|
15
|
-
type ContextBinding,
|
|
16
|
-
GenerationObserver,
|
|
17
|
-
makeToolExecutionServiceFromFunctions,
|
|
18
|
-
makeToolResolverFromFunctions,
|
|
19
|
-
} from '@dxos/assistant';
|
|
20
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
21
|
-
import { Database, Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
22
|
-
import { acquireReleaseResource } from '@dxos/effect';
|
|
23
|
-
import { TestHelpers } from '@dxos/effect/testing';
|
|
24
|
-
import { CredentialsService, FunctionInvocationService, QueueService, TracingService } from '@dxos/functions';
|
|
25
|
-
import { FunctionInvocationServiceLayerTest, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
26
|
-
import { invariant } from '@dxos/invariant';
|
|
27
|
-
import { ObjectId } from '@dxos/keys';
|
|
28
|
-
import { MarkdownBlueprint } from '@dxos/plugin-markdown/blueprints';
|
|
29
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
30
|
-
import { HasSubject, type Message, Organization } from '@dxos/types';
|
|
31
|
-
|
|
32
|
-
import { ResearchBlueprint } from '../../blueprints';
|
|
33
|
-
import { testToolkit } from '../../blueprints/testing';
|
|
34
|
-
|
|
35
|
-
import { default as createDocument } from './document-create';
|
|
36
|
-
import { default as research } from './research';
|
|
37
|
-
import { ResearchGraph, queryResearchGraph } from './research-graph';
|
|
38
|
-
import { ResearchDataTypes } from './types';
|
|
39
|
-
|
|
40
|
-
ObjectId.dangerouslyDisableRandomness();
|
|
41
|
-
|
|
42
|
-
const TestLayer = Layer.mergeAll(
|
|
43
|
-
AiService.model('@anthropic/claude-opus-4-0'),
|
|
44
|
-
makeToolResolverFromFunctions([research, createDocument, ...MarkdownBlueprint.functions], testToolkit),
|
|
45
|
-
makeToolExecutionServiceFromFunctions(testToolkit, testToolkit.toLayer({}) as any),
|
|
46
|
-
).pipe(
|
|
47
|
-
Layer.provideMerge(
|
|
48
|
-
FunctionInvocationServiceLayerTest({
|
|
49
|
-
functions: [research, createDocument, ...MarkdownBlueprint.functions],
|
|
50
|
-
}),
|
|
51
|
-
),
|
|
52
|
-
Layer.provideMerge(
|
|
53
|
-
Layer.mergeAll(
|
|
54
|
-
TestAiService(),
|
|
55
|
-
TestDatabaseLayer({
|
|
56
|
-
spaceKey: 'fixed',
|
|
57
|
-
indexing: { vector: true },
|
|
58
|
-
types: [...ResearchDataTypes, ResearchGraph, Blueprint.Blueprint, Markdown.Document, HasSubject.HasSubject],
|
|
59
|
-
}),
|
|
60
|
-
CredentialsService.configuredLayer([]),
|
|
61
|
-
TracingService.layerNoop,
|
|
62
|
-
),
|
|
63
|
-
),
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
describe('Research', () => {
|
|
67
|
-
it.effect(
|
|
68
|
-
'call a function to generate a research report',
|
|
69
|
-
Effect.fnUntraced(
|
|
70
|
-
function* (_) {
|
|
71
|
-
yield* Database.Service.add(
|
|
72
|
-
Obj.make(Organization.Organization, {
|
|
73
|
-
name: 'BlueYard',
|
|
74
|
-
website: 'https://blueyard.com',
|
|
75
|
-
}),
|
|
76
|
-
);
|
|
77
|
-
yield* Database.Service.flush({ indexes: true });
|
|
78
|
-
const result = yield* FunctionInvocationService.invokeFunction(research, {
|
|
79
|
-
query: 'Founders and portfolio of BlueYard.',
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
console.log(inspect(result, { depth: null, colors: true }));
|
|
83
|
-
console.log(JSON.stringify(result, null, 2));
|
|
84
|
-
|
|
85
|
-
yield* Database.Service.flush({ indexes: true });
|
|
86
|
-
const researchGraph = yield* queryResearchGraph();
|
|
87
|
-
if (researchGraph) {
|
|
88
|
-
const data = yield* Database.Service.load(researchGraph.queue).pipe(
|
|
89
|
-
Effect.flatMap((queue) => Effect.promise(() => queue.queryObjects())),
|
|
90
|
-
);
|
|
91
|
-
console.log(inspect(data, { depth: null, colors: true }));
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
Effect.provide(TestLayer),
|
|
95
|
-
TestHelpers.provideTestContext,
|
|
96
|
-
),
|
|
97
|
-
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
it.scoped(
|
|
101
|
-
'create and update research report',
|
|
102
|
-
Effect.fnUntraced(
|
|
103
|
-
function* (_) {
|
|
104
|
-
const organization = yield* Database.Service.add(
|
|
105
|
-
Obj.make(Organization.Organization, {
|
|
106
|
-
name: 'BlueYard',
|
|
107
|
-
website: 'https://blueyard.com',
|
|
108
|
-
}),
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
112
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
113
|
-
|
|
114
|
-
yield* Database.Service.flush({ indexes: true });
|
|
115
|
-
const researchBlueprint = yield* Database.Service.add(Obj.clone(ResearchBlueprint));
|
|
116
|
-
const markdownBlueprint = yield* Database.Service.add(Obj.clone(MarkdownBlueprint.make()));
|
|
117
|
-
yield* Effect.promise(() =>
|
|
118
|
-
conversation.context.bind({
|
|
119
|
-
blueprints: [Ref.make(researchBlueprint), Ref.make(markdownBlueprint)],
|
|
120
|
-
objects: [Ref.make(organization)],
|
|
121
|
-
}),
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
const observer = GenerationObserver.fromPrinter(new ConsolePrinter());
|
|
125
|
-
|
|
126
|
-
yield* conversation.createRequest({
|
|
127
|
-
observer,
|
|
128
|
-
prompt: `Create a research summary about ${organization.name}.`,
|
|
129
|
-
});
|
|
130
|
-
{
|
|
131
|
-
const docs = yield* Database.Service.runQuery(
|
|
132
|
-
Query.select(Filter.id(organization.id)).targetOf(HasSubject.HasSubject).source(),
|
|
133
|
-
);
|
|
134
|
-
if (docs.length !== 1) {
|
|
135
|
-
throw new Error(`Expected 1 research document; got ${docs.length}: ${docs.map((_) => _.name)}`);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const doc = docs[0];
|
|
139
|
-
invariant(Obj.instanceOf(Markdown.Document, doc));
|
|
140
|
-
console.log({
|
|
141
|
-
name: doc.name,
|
|
142
|
-
content: yield* Database.Service.load(doc.content).pipe(Effect.map((_) => _.content)),
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
yield* conversation.createRequest({
|
|
147
|
-
observer,
|
|
148
|
-
prompt: 'Add a section about their portfolio.',
|
|
149
|
-
});
|
|
150
|
-
{
|
|
151
|
-
const docs = yield* Database.Service.runQuery(
|
|
152
|
-
Query.select(Filter.id(organization.id)).targetOf(HasSubject.HasSubject).source(),
|
|
153
|
-
);
|
|
154
|
-
if (docs.length !== 1) {
|
|
155
|
-
throw new Error(`Expected 1 research document; got ${docs.length}: ${docs.map((_) => _.name)}`);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const doc = docs[0];
|
|
159
|
-
invariant(Obj.instanceOf(Markdown.Document, doc));
|
|
160
|
-
console.log({
|
|
161
|
-
name: doc.name,
|
|
162
|
-
content: yield* Database.Service.load(doc.content).pipe(Effect.map((_) => _.content)),
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
Effect.provide(TestLayer),
|
|
167
|
-
TestHelpers.provideTestContext,
|
|
168
|
-
),
|
|
169
|
-
MemoizedAiService.isGenerationEnabled() ? 240_000 : 30_000,
|
|
170
|
-
);
|
|
171
|
-
});
|
|
@@ -1,189 +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 {
|
|
17
|
-
AiSession,
|
|
18
|
-
GenerationObserver,
|
|
19
|
-
createToolkit,
|
|
20
|
-
makeToolExecutionServiceFromFunctions,
|
|
21
|
-
makeToolResolverFromFunctions,
|
|
22
|
-
} from '@dxos/assistant';
|
|
23
|
-
import { Template } from '@dxos/blueprints';
|
|
24
|
-
import { type DXN, Entity, Obj } from '@dxos/echo';
|
|
25
|
-
import { Database } from '@dxos/echo';
|
|
26
|
-
import { TracingService, defineFunction } from '@dxos/functions';
|
|
27
|
-
import { FunctionInvocationServiceLayerTestMocked } from '@dxos/functions-runtime/testing';
|
|
28
|
-
import { type Message, Person } from '@dxos/types';
|
|
29
|
-
import { trim } from '@dxos/util';
|
|
30
|
-
|
|
31
|
-
import { LocalSearchHandler, LocalSearchToolkit, makeGraphWriterHandler, makeGraphWriterToolkit } from '../../crud';
|
|
32
|
-
import { exaFunction, exaMockFunction } from '../exa';
|
|
33
|
-
|
|
34
|
-
import { contextQueueLayerFromResearchGraph } from './research-graph';
|
|
35
|
-
import PROMPT from './research-instructions.tpl?raw';
|
|
36
|
-
import { ResearchDataTypes } from './types';
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Exec external service and return the results as a Subgraph.
|
|
40
|
-
*/
|
|
41
|
-
export default defineFunction({
|
|
42
|
-
key: 'dxos.org/function/research',
|
|
43
|
-
name: 'Research',
|
|
44
|
-
description: trim`
|
|
45
|
-
Search the web to research information about the given subject.
|
|
46
|
-
Inserts structured data into the research graph.
|
|
47
|
-
Creates a research summary and returns the objects created.
|
|
48
|
-
`,
|
|
49
|
-
inputSchema: Schema.Struct({
|
|
50
|
-
query: Schema.String.annotations({
|
|
51
|
-
description: trim`
|
|
52
|
-
The search query.
|
|
53
|
-
If doing research on an object then load it first and pass it as JSON.
|
|
54
|
-
`,
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
instructions: Schema.optional(Schema.String).annotations({
|
|
58
|
-
description: trim`
|
|
59
|
-
The instructions for the research agent.
|
|
60
|
-
`,
|
|
61
|
-
}),
|
|
62
|
-
|
|
63
|
-
// TOOD(burdon): Move to context.
|
|
64
|
-
mockSearch: Schema.optional(Schema.Boolean).annotations({
|
|
65
|
-
description: 'Whether to use the mock search tool.',
|
|
66
|
-
default: false,
|
|
67
|
-
}),
|
|
68
|
-
|
|
69
|
-
entityExtraction: Schema.optional(Schema.Boolean).annotations({
|
|
70
|
-
description: trim`
|
|
71
|
-
Whether to extract structured entities from the research.
|
|
72
|
-
Experimental feature only enable if user explicitly requests it.
|
|
73
|
-
`,
|
|
74
|
-
default: false,
|
|
75
|
-
}),
|
|
76
|
-
}),
|
|
77
|
-
outputSchema: Schema.Struct({
|
|
78
|
-
document: Schema.optional(Schema.String).annotations({
|
|
79
|
-
description: 'The generated research document.',
|
|
80
|
-
}),
|
|
81
|
-
objects: Schema.Array(Schema.Unknown).annotations({
|
|
82
|
-
description: 'Structured objects created during the research process.',
|
|
83
|
-
}),
|
|
84
|
-
}),
|
|
85
|
-
handler: Effect.fnUntraced(
|
|
86
|
-
function* ({ data: { query, instructions, mockSearch = false, entityExtraction = false } }) {
|
|
87
|
-
if (mockSearch) {
|
|
88
|
-
const mockPerson = yield* Database.Service.add(
|
|
89
|
-
Obj.make(Person.Person, {
|
|
90
|
-
preferredName: 'John Doe',
|
|
91
|
-
emails: [{ value: 'john.doe@example.com' }],
|
|
92
|
-
phoneNumbers: [{ value: '123-456-7890' }],
|
|
93
|
-
}),
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
document: trim`
|
|
98
|
-
The research ran in test-mode and was mocked. Proceed as usual.
|
|
99
|
-
We reference John Doe to test reference: ${Obj.getDXN(mockPerson)}
|
|
100
|
-
`,
|
|
101
|
-
objects: [Obj.toJSON(mockPerson)],
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
yield* Database.Service.flush({ indexes: true });
|
|
106
|
-
yield* TracingService.emitStatus({ message: 'Starting research...' });
|
|
107
|
-
|
|
108
|
-
const NativeWebSearch = Toolkit.make(AnthropicTool.WebSearch_20250305({}));
|
|
109
|
-
|
|
110
|
-
let toolkit: Toolkit.Any = NativeWebSearch;
|
|
111
|
-
let handlers: Layer.Layer<any, any> = Layer.empty as any;
|
|
112
|
-
|
|
113
|
-
const objectDXNs: DXN[] = [];
|
|
114
|
-
if (entityExtraction) {
|
|
115
|
-
const GraphWriterToolkit = makeGraphWriterToolkit({ schema: ResearchDataTypes });
|
|
116
|
-
const GraphWriterHandler = makeGraphWriterHandler(GraphWriterToolkit, {
|
|
117
|
-
onAppend: (dxns) => objectDXNs.push(...dxns),
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
toolkit = Toolkit.merge(toolkit, LocalSearchToolkit, GraphWriterToolkit);
|
|
121
|
-
handlers = Layer.mergeAll(handlers, LocalSearchHandler, GraphWriterHandler).pipe(
|
|
122
|
-
Layer.provide(contextQueueLayerFromResearchGraph),
|
|
123
|
-
) as any;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const finishedToolkit = yield* createToolkit({ toolkit }).pipe(Effect.provide(handlers));
|
|
127
|
-
|
|
128
|
-
const session = new AiSession();
|
|
129
|
-
const result = yield* session.run({
|
|
130
|
-
prompt: query,
|
|
131
|
-
system: join(
|
|
132
|
-
Template.process(PROMPT, { entityExtraction }),
|
|
133
|
-
instructions && `<instructions>${instructions}</instructions>`,
|
|
134
|
-
),
|
|
135
|
-
toolkit: finishedToolkit,
|
|
136
|
-
observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'research' })),
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
const objects = yield* Effect.forEach(objectDXNs, (dxn) => Database.Service.resolve(dxn)).pipe(
|
|
140
|
-
Effect.map(Array.map((obj) => Entity.toJSON(obj))),
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
return {
|
|
144
|
-
document: extractLastTextBlock(result),
|
|
145
|
-
objects,
|
|
146
|
-
};
|
|
147
|
-
},
|
|
148
|
-
Effect.provide(
|
|
149
|
-
Layer.mergeAll(
|
|
150
|
-
AiService.model('@anthropic/claude-sonnet-4-0'),
|
|
151
|
-
// TODO(dmaretskyi): Extract.
|
|
152
|
-
makeToolResolverFromFunctions([exaFunction, exaMockFunction], Toolkit.make()),
|
|
153
|
-
makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
|
|
154
|
-
).pipe(
|
|
155
|
-
Layer.provide(
|
|
156
|
-
// TODO(dmaretskyi): This should be provided by environment.
|
|
157
|
-
Layer.mergeAll(FunctionInvocationServiceLayerTestMocked({ functions: [exaFunction, exaMockFunction] })),
|
|
158
|
-
),
|
|
159
|
-
),
|
|
160
|
-
),
|
|
161
|
-
),
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
// TODO(burdon): Factor out.
|
|
165
|
-
const join = (...strings: (string | undefined)[]) => strings.filter(Boolean).join('\n\n');
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Extracts the last text block from the result.
|
|
169
|
-
* Skips citations.
|
|
170
|
-
*/
|
|
171
|
-
// TODO(burdon): Factor out.
|
|
172
|
-
const extractLastTextBlock = (result: Message.Message[]) => {
|
|
173
|
-
return Function.pipe(
|
|
174
|
-
result,
|
|
175
|
-
Array.last,
|
|
176
|
-
Option.map(
|
|
177
|
-
Function.flow(
|
|
178
|
-
(_: Message.Message) => _.blocks,
|
|
179
|
-
Array.reverse,
|
|
180
|
-
Array.dropWhile((_: any) => _._tag === 'summary'),
|
|
181
|
-
Array.takeWhile((_: any) => _._tag === 'text'),
|
|
182
|
-
Array.reverse,
|
|
183
|
-
Array.map((_: any) => _.text),
|
|
184
|
-
Array.reduce('', String.concat),
|
|
185
|
-
),
|
|
186
|
-
),
|
|
187
|
-
Option.getOrElse(() => ''),
|
|
188
|
-
);
|
|
189
|
-
};
|
|
@@ -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, Project, 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
|
-
Project.Project,
|
|
24
|
-
HasRelationship.HasRelationship,
|
|
25
|
-
HasConnection.HasConnection,
|
|
26
|
-
];
|
|
@@ -1,35 +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 { ArtifactId } from '@dxos/assistant';
|
|
9
|
-
import { Database } from '@dxos/echo';
|
|
10
|
-
import { defineFunction } from '@dxos/functions';
|
|
11
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
12
|
-
|
|
13
|
-
export default defineFunction({
|
|
14
|
-
key: 'dxos.org/function/markdown/read-tasks',
|
|
15
|
-
name: 'Read',
|
|
16
|
-
description: 'Read markdown tasks.',
|
|
17
|
-
inputSchema: Schema.Struct({
|
|
18
|
-
id: ArtifactId.annotations({
|
|
19
|
-
description: 'The ID of the document to read.',
|
|
20
|
-
}),
|
|
21
|
-
}),
|
|
22
|
-
outputSchema: Schema.Struct({
|
|
23
|
-
content: Schema.String,
|
|
24
|
-
}),
|
|
25
|
-
handler: Effect.fn(function* ({ data: { id } }) {
|
|
26
|
-
const doc = yield* Database.Service.resolve(ArtifactId.toDXN(id), Markdown.Document);
|
|
27
|
-
|
|
28
|
-
// Return content with line numbers prefixed.
|
|
29
|
-
const { content } = yield* Database.Service.load(doc.content);
|
|
30
|
-
const lines = content.split('\n');
|
|
31
|
-
const len = String(lines.length).length;
|
|
32
|
-
const numbered = lines.map((line, i) => `${String(i + 1).padStart(len, ' ')}. ${line}`).join('\n');
|
|
33
|
-
return { content: numbered };
|
|
34
|
-
}),
|
|
35
|
-
});
|
|
@@ -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 };
|