@dxos/assistant-toolkit 0.8.4-main.e8ec1fe → 0.8.4-main.fcc0d83b33
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-XDFUXRY5.mjs +30 -0
- package/dist/lib/neutral/add-artifact-XDFUXRY5.mjs.map +7 -0
- package/dist/lib/neutral/agent-6OHUAIA2.mjs +65 -0
- package/dist/lib/neutral/agent-6OHUAIA2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4T3LJGXI.mjs +76 -0
- package/dist/lib/neutral/chunk-4T3LJGXI.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-EJAQUAKM.mjs +73 -0
- package/dist/lib/neutral/chunk-EJAQUAKM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GSG4JGIY.mjs +100 -0
- package/dist/lib/neutral/chunk-GSG4JGIY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JN4GARRQ.mjs +53 -0
- package/dist/lib/neutral/chunk-JN4GARRQ.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-P5LAPHCG.mjs +140 -0
- package/dist/lib/neutral/chunk-P5LAPHCG.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SVI25Z2Y.mjs +293 -0
- package/dist/lib/neutral/chunk-SVI25Z2Y.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VSDP6SRY.mjs +74 -0
- package/dist/lib/neutral/chunk-VSDP6SRY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WIV7ZVRS.mjs +109 -0
- package/dist/lib/neutral/chunk-WIV7ZVRS.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-YSYNXOZA.mjs +68 -0
- package/dist/lib/neutral/chunk-YSYNXOZA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-YXOVSRFU.mjs +70 -0
- package/dist/lib/neutral/chunk-YXOVSRFU.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-MPAMKQ3T.mjs +36 -0
- package/dist/lib/neutral/create-project-MPAMKQ3T.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-LELPQHY5.mjs +48 -0
- package/dist/lib/neutral/enable-blueprints-LELPQHY5.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-OS74FP76.mjs +140 -0
- package/dist/lib/neutral/fetch-messages-OS74FP76.mjs.map +7 -0
- package/dist/lib/neutral/get-context-JRTOOA5O.mjs +35 -0
- package/dist/lib/neutral/get-context-JRTOOA5O.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +906 -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-JAU3A7AX.mjs +23 -0
- package/dist/lib/neutral/project-JAU3A7AX.mjs.map +7 -0
- package/dist/lib/neutral/project-rules-FLUQQRPB.mjs +78 -0
- package/dist/lib/neutral/project-rules-FLUQQRPB.mjs.map +7 -0
- package/dist/lib/neutral/prompt-4UMXX6QU.mjs +169 -0
- package/dist/lib/neutral/prompt-4UMXX6QU.mjs.map +7 -0
- package/dist/lib/neutral/qualifier-7BUCOEKK.mjs +88 -0
- package/dist/lib/neutral/qualifier-7BUCOEKK.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-Z576ABT5.mjs +17 -0
- package/dist/lib/neutral/query-blueprints-Z576ABT5.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-Q7HRRKGR.mjs +39 -0
- package/dist/lib/neutral/schema-list-Q7HRRKGR.mjs.map +7 -0
- package/dist/lib/neutral/sync-issues-A2RJNPEF.mjs +167 -0
- package/dist/lib/neutral/sync-issues-A2RJNPEF.mjs.map +7 -0
- package/dist/lib/neutral/sync-triggers-NV4JCRN5.mjs +137 -0
- package/dist/lib/neutral/sync-triggers-NV4JCRN5.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-K7A5SHBZ.mjs +17 -0
- package/dist/lib/neutral/update-blueprints-K7A5SHBZ.mjs.map +7 -0
- package/dist/lib/neutral/update-tasks-UGGHWXT5.mjs +46 -0
- package/dist/lib/neutral/update-tasks-UGGHWXT5.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 +60 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/definitions.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts +36 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/enable-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts +4 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts +27 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/query-blueprints.d.ts.map +1 -0
- package/dist/types/src/blueprints/blueprint-manager/functions/update-blueprints.d.ts +5 -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 +16 -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 +4 -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 +8 -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 +9 -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 +7 -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 +11 -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 +52 -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 +97 -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 +14 -11
- 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 +61 -0
- package/dist/types/src/functions/agent/definitions.d.ts.map +1 -0
- package/dist/types/src/functions/agent/index.d.ts +3 -4
- package/dist/types/src/functions/agent/index.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.d.ts +2 -7
- 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 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/sync/sync.d.ts +3 -3
- package/dist/types/src/sync/sync.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/plugins.d.ts +19 -0
- package/dist/types/src/testing/plugins.d.ts.map +1 -0
- package/dist/types/src/toolkits/WebToolkit.d.ts +38 -0
- package/dist/types/src/toolkits/WebToolkit.d.ts.map +1 -0
- package/dist/types/src/toolkits/index.d.ts +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 +44 -40
- package/src/blueprints/automation/blueprint.ts +107 -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 +199 -0
- package/src/blueprints/blueprint-manager/blueprint.ts +49 -0
- package/src/blueprints/blueprint-manager/functions/definitions.ts +58 -0
- package/src/blueprints/blueprint-manager/functions/enable-blueprints.ts +44 -0
- package/src/blueprints/blueprint-manager/functions/index.ts +13 -0
- package/src/blueprints/blueprint-manager/functions/query-blueprints.ts +19 -0
- package/src/blueprints/blueprint-manager/functions/update-blueprints.ts +19 -0
- package/src/blueprints/blueprint-manager/index.ts +6 -0
- package/src/blueprints/browser/blueprint.test.ts +62 -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 +532 -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 +34 -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 +71 -0
- package/src/blueprints/discord/functions/fetch-messages.test.ts +45 -0
- package/src/blueprints/discord/functions/fetch-messages.ts +199 -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 +27 -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 +24 -0
- package/src/blueprints/linear/functions/index.ts +9 -0
- package/src/blueprints/linear/functions/linear.test.ts +59 -0
- package/src/{functions/linear → blueprints/linear/functions}/sync-issues.ts +40 -46
- 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/blueprints/project/blueprint.test.ts +715 -0
- 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 +33 -0
- package/src/blueprints/project-wizard/functions/definitions.ts +64 -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 +159 -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 -4
- package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +6 -1
- package/src/crud/graph.test.ts +13 -38
- package/src/crud/graph.ts +33 -41
- package/src/errors.ts +25 -0
- package/src/functions/READ_THIS.md +5 -0
- package/src/functions/agent/definitions.ts +53 -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 +83 -0
- package/src/functions/agent/prompt.ts +211 -102
- package/src/functions/index.ts +0 -6
- package/src/index.ts +2 -2
- package/src/sync/sync.ts +52 -33
- package/src/testing/index.ts +2 -1
- package/src/testing/plugins.tsx +79 -0
- package/src/toolkits/WebToolkit.ts +33 -0
- package/src/toolkits/index.ts +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 -2777
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/node-esm/index.mjs +0 -2778
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/types/src/blueprints/design/design-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/design/design-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/design-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/design/design-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/design/index.d.ts +0 -3
- package/dist/types/src/blueprints/design/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +0 -18
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/planning/planning-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/index.d.ts +0 -3
- package/dist/types/src/blueprints/research/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/research-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/research/research-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/research/research-blueprint.test.d.ts +0 -2
- package/dist/types/src/blueprints/research/research-blueprint.test.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/websearch/websearch-toolkit.d.ts.map +0 -1
- package/dist/types/src/experimental/feed.test.d.ts +0 -2
- package/dist/types/src/experimental/feed.test.d.ts.map +0 -1
- package/dist/types/src/functions/discord/fetch-messages.d.ts.map +0 -1
- package/dist/types/src/functions/discord/fetch-messages.test.d.ts.map +0 -1
- package/dist/types/src/functions/discord/index.d.ts +0 -12
- package/dist/types/src/functions/discord/index.d.ts.map +0 -1
- package/dist/types/src/functions/document/index.d.ts +0 -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 -173
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.test.d.ts +0 -2
- package/dist/types/src/functions/entity-extraction/entity-extraction.test.d.ts.map +0 -1
- package/dist/types/src/functions/entity-extraction/index.d.ts +0 -174
- package/dist/types/src/functions/entity-extraction/index.d.ts.map +0 -1
- package/dist/types/src/functions/exa/exa.d.ts +0 -5
- package/dist/types/src/functions/exa/exa.d.ts.map +0 -1
- package/dist/types/src/functions/exa/index.d.ts +0 -3
- package/dist/types/src/functions/exa/index.d.ts.map +0 -1
- package/dist/types/src/functions/exa/mock.d.ts +0 -5
- package/dist/types/src/functions/exa/mock.d.ts.map +0 -1
- package/dist/types/src/functions/github/fetch-prs.d.ts +0 -6
- package/dist/types/src/functions/github/fetch-prs.d.ts.map +0 -1
- package/dist/types/src/functions/linear/index.d.ts +0 -9
- package/dist/types/src/functions/linear/index.d.ts.map +0 -1
- package/dist/types/src/functions/linear/linear.test.d.ts.map +0 -1
- package/dist/types/src/functions/linear/sync-issues.d.ts +0 -12
- package/dist/types/src/functions/linear/sync-issues.d.ts.map +0 -1
- package/dist/types/src/functions/research/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 -18
- 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/plugins.d.ts +0 -19
- package/dist/types/src/plugins.d.ts.map +0 -1
- package/dist/types/src/testing/data/exa-search-1748337321991.d.ts +0 -38
- package/dist/types/src/testing/data/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/testing/data/exa-search-1748337331526.d.ts +0 -37
- package/dist/types/src/testing/data/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/testing/data/exa-search-1748337344119.d.ts +0 -58
- package/dist/types/src/testing/data/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/testing/data/index.d.ts +0 -3
- package/dist/types/src/testing/data/index.d.ts.map +0 -1
- package/dist/types/src/toolkits/AssistantToolkit.d.ts +0 -17
- 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 -67
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +0 -1
- package/src/blueprints/design/design-blueprint.test.ts +0 -103
- package/src/blueprints/design/design-blueprint.ts +0 -33
- package/src/blueprints/design/index.ts +0 -7
- package/src/blueprints/discord/discord-blueprint.ts +0 -34
- package/src/blueprints/linear/linear-blueprint.ts +0 -35
- package/src/blueprints/planning/planning-blueprint.test.ts +0 -124
- package/src/blueprints/planning/planning-blueprint.ts +0 -98
- package/src/blueprints/research/index.ts +0 -7
- package/src/blueprints/research/research-blueprint.test.ts +0 -7
- package/src/blueprints/research/research-blueprint.ts +0 -53
- package/src/blueprints/websearch/websearch-blueprint.ts +0 -20
- 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 -29
- package/src/functions/document/update.ts +0 -30
- package/src/functions/entity-extraction/entity-extraction.conversations.json +0 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +0 -92
- package/src/functions/entity-extraction/entity-extraction.ts +0 -165
- package/src/functions/entity-extraction/index.ts +0 -9
- package/src/functions/exa/exa.ts +0 -37
- package/src/functions/exa/index.ts +0 -6
- package/src/functions/exa/mock.ts +0 -71
- package/src/functions/github/fetch-prs.ts +0 -30
- package/src/functions/linear/index.ts +0 -9
- package/src/functions/linear/linear.test.ts +0 -83
- package/src/functions/research/document-create.ts +0 -75
- package/src/functions/research/index.ts +0 -14
- package/src/functions/research/research-graph.ts +0 -47
- 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 -179
- package/src/functions/research/research.ts +0 -190
- package/src/functions/research/types.ts +0 -26
- package/src/functions/tasks/index.ts +0 -11
- package/src/functions/tasks/read.ts +0 -34
- package/src/functions/tasks/task-list.test.ts +0 -99
- package/src/functions/tasks/task-list.ts +0 -165
- package/src/functions/tasks/update.ts +0 -52
- package/src/plugins.tsx +0 -68
- package/src/testing/data/exa-search-1748337321991.ts +0 -131
- package/src/testing/data/exa-search-1748337331526.ts +0 -144
- package/src/testing/data/exa-search-1748337344119.ts +0 -133
- package/src/testing/data/index.ts +0 -11
- package/src/toolkits/AssistantToolkit.conversations.json +0 -1
- package/src/toolkits/AssistantToolkit.test.ts +0 -88
- package/src/toolkits/AssistantToolkit.ts +0 -47
- package/src/toolkits/SystemToolkit.ts +0 -231
- /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,53 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ToolId } from '@dxos/ai';
|
|
6
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import { Text } from '@dxos/schema';
|
|
9
|
-
import { trim } from '@dxos/util';
|
|
10
|
-
|
|
11
|
-
import { Research } from '../../functions';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Agent prompt instructions for managing hierarchical task lists.
|
|
15
|
-
*/
|
|
16
|
-
const instructions = trim`
|
|
17
|
-
{{! Research }}
|
|
18
|
-
|
|
19
|
-
You are an analyst that does research tasks using tools that scrape the web and create structured data.
|
|
20
|
-
Structured data extraction is an experimental feature -- only enable it if the user explicitly requests it in the prompt.
|
|
21
|
-
Prefer updating existing notes instead of creating new ones.
|
|
22
|
-
|
|
23
|
-
<strcutured_mode>
|
|
24
|
-
When you are done, reply with the created objects.
|
|
25
|
-
Do not print the data, instead reply with inline references to the created objects.
|
|
26
|
-
Those will be later substituted with the pills representing the created objects.
|
|
27
|
-
Print the rest of the created objects as block references after the main note.
|
|
28
|
-
|
|
29
|
-
<example>
|
|
30
|
-
Based on my research, Google was founded by @dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M and @dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK46K31DDW62PBW9H2ZQ
|
|
31
|
-
|
|
32
|
-
<object><dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M</dxn></object>
|
|
33
|
-
<object><dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK46K31DDW62PBW9H2ZQ</dxn></object>
|
|
34
|
-
<object><dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK46K31DDW62PBW92333</dxn></object>
|
|
35
|
-
</example>
|
|
36
|
-
</structured_mode>
|
|
37
|
-
|
|
38
|
-
<unstructured_mode>
|
|
39
|
-
Reply normally with the text mode of the result of your research.
|
|
40
|
-
</unstructured_mode>
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
export const blueprint: Blueprint.Blueprint = Obj.make(Blueprint.Blueprint, {
|
|
44
|
-
key: 'dxos.org/blueprint/research',
|
|
45
|
-
name: 'Research',
|
|
46
|
-
description: 'Researches the web and creates structured data.',
|
|
47
|
-
instructions: {
|
|
48
|
-
source: Ref.make(Text.make(instructions)),
|
|
49
|
-
},
|
|
50
|
-
tools: [Research.create, Research.research].map((fn) => ToolId.make(fn.key)),
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
export default blueprint;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ToolId } from '@dxos/ai';
|
|
6
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
-
import { Text } from '@dxos/schema';
|
|
9
|
-
|
|
10
|
-
const blueprint: Blueprint.Blueprint = Obj.make(Blueprint.Blueprint, {
|
|
11
|
-
key: 'dxos.org/blueprint/web-search',
|
|
12
|
-
name: 'Web Search',
|
|
13
|
-
description: 'Search the web.',
|
|
14
|
-
instructions: {
|
|
15
|
-
source: Ref.make(Text.make()),
|
|
16
|
-
},
|
|
17
|
-
tools: [ToolId.make('AnthropicWebSearch')],
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export default blueprint;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Toolkit from '@effect/ai/Toolkit';
|
|
6
|
-
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
-
import { describe, it } from '@effect/vitest';
|
|
8
|
-
import * as Config from 'effect/Config';
|
|
9
|
-
import * as Effect from 'effect/Effect';
|
|
10
|
-
import * as Layer from 'effect/Layer';
|
|
11
|
-
import * as Redacted from 'effect/Redacted';
|
|
12
|
-
|
|
13
|
-
import { AiService } from '@dxos/ai';
|
|
14
|
-
import { AiServiceTestingPreset, EXA_API_KEY } from '@dxos/ai/testing';
|
|
15
|
-
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
16
|
-
import { TestHelpers } from '@dxos/effect';
|
|
17
|
-
import { CredentialsService, FunctionInvocationService } from '@dxos/functions';
|
|
18
|
-
import { TracingServiceExt } from '@dxos/functions-runtime';
|
|
19
|
-
import {
|
|
20
|
-
FunctionInvocationServiceLayerTestMocked,
|
|
21
|
-
TestDatabaseLayer,
|
|
22
|
-
testStoragePath,
|
|
23
|
-
} from '@dxos/functions-runtime/testing';
|
|
24
|
-
|
|
25
|
-
import { Discord, Linear } from '../functions';
|
|
26
|
-
|
|
27
|
-
const TestLayer = Layer.mergeAll(
|
|
28
|
-
AiService.model('@anthropic/claude-opus-4-0'),
|
|
29
|
-
makeToolResolverFromFunctions([], Toolkit.make()),
|
|
30
|
-
makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
|
|
31
|
-
).pipe(
|
|
32
|
-
Layer.provideMerge(
|
|
33
|
-
Layer.mergeAll(
|
|
34
|
-
AiServiceTestingPreset('direct'),
|
|
35
|
-
TestDatabaseLayer({
|
|
36
|
-
indexing: { vector: true },
|
|
37
|
-
types: [],
|
|
38
|
-
storagePath: testStoragePath({ name: 'feed-test' }),
|
|
39
|
-
}),
|
|
40
|
-
CredentialsService.layerConfig([
|
|
41
|
-
{ service: 'exa.ai', apiKey: Config.succeed(Redacted.make(EXA_API_KEY)) },
|
|
42
|
-
{ service: 'discord.com', apiKey: Config.redacted('DISCORD_TOKEN') },
|
|
43
|
-
{ service: 'linear.app', apiKey: Config.redacted('LINEAR_API_KEY') },
|
|
44
|
-
]),
|
|
45
|
-
FunctionInvocationServiceLayerTestMocked({ functions: [Linear.sync, Discord.fetch] }).pipe(
|
|
46
|
-
Layer.provideMerge(TracingServiceExt.layerLogInfo()),
|
|
47
|
-
),
|
|
48
|
-
FetchHttpClient.layer,
|
|
49
|
-
),
|
|
50
|
-
),
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
describe('Feed', { timeout: 600_000 }, () => {
|
|
54
|
-
it.effect(
|
|
55
|
-
'fetch discord messages',
|
|
56
|
-
Effect.fnUntraced(
|
|
57
|
-
function* (_) {
|
|
58
|
-
// const messages = yield* LocalFunctionExecutionService.invokeFunction(fetchDiscordMessages, {
|
|
59
|
-
// serverId: '837138313172353095',
|
|
60
|
-
// // channelId: '1404487604761526423',
|
|
61
|
-
// after: Date.now() / 1000 - 128 * 3600,
|
|
62
|
-
// });
|
|
63
|
-
// for (const message of messages) {
|
|
64
|
-
// console.log(message.sender.name, message.blocks.find((block) => block._tag === 'text')?.text);
|
|
65
|
-
// }
|
|
66
|
-
// console.log(`Fetched ${messages.length} messages`);
|
|
67
|
-
|
|
68
|
-
// const result = yield* AiSession.run({
|
|
69
|
-
// history: [
|
|
70
|
-
// Obj.make(Message.Message, {
|
|
71
|
-
// created: new Date().toISOString(),
|
|
72
|
-
// sender: { role: 'user' },
|
|
73
|
-
// blocks: messages
|
|
74
|
-
// .map(
|
|
75
|
-
// (message) =>
|
|
76
|
-
// ({
|
|
77
|
-
// _tag: 'text',
|
|
78
|
-
// text: message.sender.name + ': ' + message.blocks.find((block) => block._tag === 'text')?.text,
|
|
79
|
-
// }) as const,
|
|
80
|
-
// )
|
|
81
|
-
// .filter((block) => block._tag === 'text' && block.text.trim().length > 0),
|
|
82
|
-
// }),
|
|
83
|
-
// ],
|
|
84
|
-
// prompt: 'Summarize the messages.',
|
|
85
|
-
// system: 'Summarize the messages.',
|
|
86
|
-
// }).pipe(Effect.provide(AiService.model('@anthropic/claude-3-5-haiku-latest')));
|
|
87
|
-
// console.log(result);
|
|
88
|
-
|
|
89
|
-
const linearIssues = yield* FunctionInvocationService.invokeFunction(Linear.sync, {
|
|
90
|
-
team: '1127c63a-6f77-4725-9229-50f6cd47321c',
|
|
91
|
-
});
|
|
92
|
-
console.log(linearIssues);
|
|
93
|
-
|
|
94
|
-
// const result = yield* AiSession.run({
|
|
95
|
-
// history: [
|
|
96
|
-
// Obj.make(Message.Message, {
|
|
97
|
-
// created: new Date().toISOString(),
|
|
98
|
-
// sender: { role: 'user' },
|
|
99
|
-
// blocks: [{ _tag: 'text', text: JSON.stringify(linearIssues) }],
|
|
100
|
-
// }),
|
|
101
|
-
// ],
|
|
102
|
-
// prompt: 'Summarize the whats new.',
|
|
103
|
-
// system: 'Summarize the whats new. Reference specific people by name.',
|
|
104
|
-
// }).pipe(Effect.provide(AiService.model('@anthropic/claude-sonnet-4-0')));
|
|
105
|
-
// console.log(result.at(-1)?.blocks.find((block) => block._tag === 'text')?.text);
|
|
106
|
-
},
|
|
107
|
-
Effect.provide(TestLayer),
|
|
108
|
-
TestHelpers.taggedTest('llm'),
|
|
109
|
-
),
|
|
110
|
-
);
|
|
111
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Toolkit from '@effect/ai/Toolkit';
|
|
6
|
-
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
-
import { describe, it } from '@effect/vitest';
|
|
8
|
-
import * as Config from 'effect/Config';
|
|
9
|
-
import * as Effect from 'effect/Effect';
|
|
10
|
-
import * as Layer from 'effect/Layer';
|
|
11
|
-
|
|
12
|
-
import { AiService } from '@dxos/ai';
|
|
13
|
-
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
14
|
-
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
15
|
-
import { TestHelpers } from '@dxos/effect';
|
|
16
|
-
import { CredentialsService, FunctionInvocationService, TracingService } from '@dxos/functions';
|
|
17
|
-
import { FunctionInvocationServiceLayerTestMocked, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
18
|
-
|
|
19
|
-
import { default as fetchMessages } from './fetch-messages';
|
|
20
|
-
|
|
21
|
-
const TestLayer = Layer.mergeAll(
|
|
22
|
-
AiService.model('@anthropic/claude-opus-4-0'),
|
|
23
|
-
makeToolResolverFromFunctions([], Toolkit.make()),
|
|
24
|
-
makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
|
|
25
|
-
).pipe(
|
|
26
|
-
Layer.provideMerge(
|
|
27
|
-
Layer.mergeAll(
|
|
28
|
-
AiServiceTestingPreset('direct'),
|
|
29
|
-
TestDatabaseLayer({}),
|
|
30
|
-
CredentialsService.layerConfig([{ service: 'discord.com', apiKey: Config.redacted('DISCORD_TOKEN') }]),
|
|
31
|
-
FetchHttpClient.layer,
|
|
32
|
-
FunctionInvocationServiceLayerTestMocked({ functions: [fetchMessages] }).pipe(
|
|
33
|
-
Layer.provideMerge(TracingService.layerNoop),
|
|
34
|
-
),
|
|
35
|
-
),
|
|
36
|
-
),
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
const DXOS_SERVER_ID = '837138313172353095';
|
|
40
|
-
|
|
41
|
-
describe('Feed', { timeout: 600_000 }, () => {
|
|
42
|
-
it.effect(
|
|
43
|
-
'fetch discord messages',
|
|
44
|
-
Effect.fnUntraced(
|
|
45
|
-
function* (_) {
|
|
46
|
-
const messages = yield* FunctionInvocationService.invokeFunction(fetchMessages, {
|
|
47
|
-
serverId: DXOS_SERVER_ID,
|
|
48
|
-
// channelId: '1404487604761526423',
|
|
49
|
-
last: '7d',
|
|
50
|
-
});
|
|
51
|
-
console.log(messages);
|
|
52
|
-
},
|
|
53
|
-
Effect.provide(TestLayer),
|
|
54
|
-
TestHelpers.provideTestContext,
|
|
55
|
-
TestHelpers.taggedTest('sync'),
|
|
56
|
-
),
|
|
57
|
-
);
|
|
58
|
-
});
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
6
|
-
import { DiscordConfig, DiscordREST, DiscordRESTMemoryLive } from 'dfx';
|
|
7
|
-
import type {
|
|
8
|
-
GuildChannelResponse,
|
|
9
|
-
MessageResponse,
|
|
10
|
-
PrivateChannelResponse,
|
|
11
|
-
PrivateGroupChannelResponse,
|
|
12
|
-
ThreadResponse,
|
|
13
|
-
} from 'dfx/types';
|
|
14
|
-
import * as Array from 'effect/Array';
|
|
15
|
-
import * as Effect from 'effect/Effect';
|
|
16
|
-
import * as Function from 'effect/Function';
|
|
17
|
-
import * as Layer from 'effect/Layer';
|
|
18
|
-
import * as Option from 'effect/Option';
|
|
19
|
-
import * as Schema from 'effect/Schema';
|
|
20
|
-
|
|
21
|
-
import { Obj } from '@dxos/echo';
|
|
22
|
-
import { CredentialsService, TracingService, defineFunction } from '@dxos/functions';
|
|
23
|
-
import { log } from '@dxos/log';
|
|
24
|
-
import { Message } from '@dxos/types';
|
|
25
|
-
|
|
26
|
-
// TODO(dmaretskyi): Extract.
|
|
27
|
-
const TimeRange = class extends Schema.String.pipe(Schema.pattern(/\d+(s|m|h|d)/)).annotations({
|
|
28
|
-
description: 'Time range. 1d - 1 day, 2h - 2 hours, 30m - 30 minutes, 15s - 15 seconds.',
|
|
29
|
-
examples: ['1d', '2h', '30m', '15s'],
|
|
30
|
-
}) {
|
|
31
|
-
static toSeconds(timeRange: Schema.Schema.Type<typeof TimeRange>) {
|
|
32
|
-
const match = timeRange.match(/(\d+)(s|m|h|d)/);
|
|
33
|
-
if (!match) {
|
|
34
|
-
throw new Error(`Invalid time range: ${timeRange}`);
|
|
35
|
-
}
|
|
36
|
-
const [_, amount, unit] = match;
|
|
37
|
-
switch (unit) {
|
|
38
|
-
case 's':
|
|
39
|
-
return Number(amount);
|
|
40
|
-
case 'm':
|
|
41
|
-
return Number(amount) * 60;
|
|
42
|
-
case 'h':
|
|
43
|
-
return Number(amount) * 60 * 60;
|
|
44
|
-
case 'd':
|
|
45
|
-
return Number(amount) * 24 * 60 * 60;
|
|
46
|
-
default:
|
|
47
|
-
throw new Error(`Invalid time range unit: ${unit}`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
type TimeRange = Schema.Schema.Type<typeof TimeRange>;
|
|
52
|
-
|
|
53
|
-
const DiscordConfigFromCredential = Layer.unwrapEffect(
|
|
54
|
-
Effect.gen(function* () {
|
|
55
|
-
return DiscordConfig.layer({
|
|
56
|
-
token: yield* CredentialsService.getApiKey({ service: 'discord.com' }),
|
|
57
|
-
rest: {
|
|
58
|
-
baseUrl: 'https://api-proxy.dxos.workers.dev/discord.com/api/v10',
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
}),
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
type DiscordChannel = GuildChannelResponse | PrivateChannelResponse | PrivateGroupChannelResponse | ThreadResponse;
|
|
65
|
-
|
|
66
|
-
const DEFAULT_AFTER = 1704067200; // 2024-01-01
|
|
67
|
-
const DEFAULT_LIMIT = 500;
|
|
68
|
-
const DEFAULT_IGNORE_USERNAMES = ['GitHub', 'Needle'];
|
|
69
|
-
|
|
70
|
-
// TODO(dmaretskyi): Align with standard thread type.
|
|
71
|
-
type Thread = {
|
|
72
|
-
discordChannelId: string;
|
|
73
|
-
name?: string;
|
|
74
|
-
messages: Message.Message[];
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export default defineFunction({
|
|
78
|
-
key: 'dxos.org/function/fetch-discord-messages',
|
|
79
|
-
name: 'Sync Discord messages',
|
|
80
|
-
inputSchema: Schema.Struct({
|
|
81
|
-
serverId: Schema.String.annotations({
|
|
82
|
-
description: 'The ID of the server to fetch messages from.',
|
|
83
|
-
}),
|
|
84
|
-
channelId: Schema.optional(Schema.String).annotations({
|
|
85
|
-
description:
|
|
86
|
-
'The ID of the channel to fetch messages from. Will crawl all channels from the server if not specified.',
|
|
87
|
-
}),
|
|
88
|
-
after: Schema.optional(Schema.Number).annotations({
|
|
89
|
-
description:
|
|
90
|
-
'Fetch messages that were sent after a given date. Unix timestamp in seconds. Exclusive with `last`.',
|
|
91
|
-
}),
|
|
92
|
-
last: TimeRange.annotations({
|
|
93
|
-
description:
|
|
94
|
-
'Time range to fetch most recent messages. Specifies the range in the past, from now. "1d" would fetch messages from the last 24 hours.',
|
|
95
|
-
}),
|
|
96
|
-
limit: Schema.optional(Schema.Number).annotations({
|
|
97
|
-
description: 'The maximum number of messages to fetch.',
|
|
98
|
-
}),
|
|
99
|
-
pageSize: Schema.optional(Schema.Number).annotations({
|
|
100
|
-
description: 'The number of messages to fetch per page.',
|
|
101
|
-
}),
|
|
102
|
-
ignoreUsernames: Schema.optional(Schema.Array(Schema.String)).annotations({
|
|
103
|
-
description: 'Exclude messages from these usernames.',
|
|
104
|
-
}),
|
|
105
|
-
}),
|
|
106
|
-
handler: Effect.fnUntraced(
|
|
107
|
-
function* ({
|
|
108
|
-
data: {
|
|
109
|
-
serverId,
|
|
110
|
-
channelId,
|
|
111
|
-
after,
|
|
112
|
-
last,
|
|
113
|
-
pageSize = 100,
|
|
114
|
-
limit = DEFAULT_LIMIT,
|
|
115
|
-
ignoreUsernames = DEFAULT_IGNORE_USERNAMES,
|
|
116
|
-
},
|
|
117
|
-
}) {
|
|
118
|
-
if (!after && !last) {
|
|
119
|
-
throw new Error('cannot specify both `after` and `last`');
|
|
120
|
-
}
|
|
121
|
-
const afterTs = last ? Date.now() / 1000 - TimeRange.toSeconds(last) : (after ?? DEFAULT_AFTER);
|
|
122
|
-
|
|
123
|
-
const rest = yield* DiscordREST;
|
|
124
|
-
|
|
125
|
-
let channels: DiscordChannel[] = [];
|
|
126
|
-
channels.push(...(yield* rest.listGuildChannels(serverId)));
|
|
127
|
-
const { threads: guildThreads } = yield* rest.getActiveGuildThreads(serverId);
|
|
128
|
-
channels.push(...guildThreads);
|
|
129
|
-
if (channelId) {
|
|
130
|
-
channels = channels.filter((channel) => channel.id === channelId);
|
|
131
|
-
}
|
|
132
|
-
if (channels.length === 0) {
|
|
133
|
-
throw new Error('no channels found');
|
|
134
|
-
}
|
|
135
|
-
for (const channel of channels) {
|
|
136
|
-
console.log(channel.id, 'name' in channel ? channel.name : undefined);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
yield* TracingService.emitStatus({ message: `Will fetch from channels: ${channels.length}` });
|
|
140
|
-
|
|
141
|
-
const threads = yield* Effect.forEach(
|
|
142
|
-
channels,
|
|
143
|
-
Effect.fnUntraced(function* (channel) {
|
|
144
|
-
const allMessages: Message.Message[] = [];
|
|
145
|
-
|
|
146
|
-
let lastMessage: Option.Option<Message.Message> = Option.none();
|
|
147
|
-
while (true) {
|
|
148
|
-
const { id: lastId = undefined } = Function.pipe(
|
|
149
|
-
lastMessage,
|
|
150
|
-
Option.map(Obj.getKeys('discord.com')),
|
|
151
|
-
Option.flatMap(Option.fromIterable),
|
|
152
|
-
Option.getOrElse(() => ({ id: undefined })),
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
const options = {
|
|
156
|
-
after: !lastId ? `${generateSnowflake(afterTs)}` : lastId,
|
|
157
|
-
limit: pageSize,
|
|
158
|
-
};
|
|
159
|
-
log.info('fetching messages', {
|
|
160
|
-
lastId,
|
|
161
|
-
afterTs,
|
|
162
|
-
afterSnowflake: options.after,
|
|
163
|
-
after: parseSnowflake(options.after),
|
|
164
|
-
limit: options.limit,
|
|
165
|
-
});
|
|
166
|
-
const messages = yield* rest.listMessages(channel.id, options).pipe(
|
|
167
|
-
Effect.map(Array.map(makeMessage)),
|
|
168
|
-
Effect.map(Array.reverse),
|
|
169
|
-
Effect.catchTag('ErrorResponse', (err) =>
|
|
170
|
-
err.cause.code === 50001 ? Effect.succeed([]) : Effect.fail(err),
|
|
171
|
-
),
|
|
172
|
-
);
|
|
173
|
-
if (messages.length > 0) {
|
|
174
|
-
lastMessage = Option.fromNullable(messages.at(-1));
|
|
175
|
-
allMessages.push(...messages);
|
|
176
|
-
} else {
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
yield* TracingService.emitStatus({ message: `Fetched messages: ${allMessages.length}` });
|
|
180
|
-
if (allMessages.length >= limit) {
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return {
|
|
186
|
-
discordChannelId: channel.id,
|
|
187
|
-
name: 'name' in channel ? (channel.name ?? undefined) : undefined,
|
|
188
|
-
messages: allMessages
|
|
189
|
-
.filter((message) => !message.sender.name || !ignoreUsernames.includes(message.sender.name))
|
|
190
|
-
.filter((message) =>
|
|
191
|
-
message.blocks.some((block: any) => block._tag === 'text' && block.text.trim().length > 0),
|
|
192
|
-
),
|
|
193
|
-
} satisfies Thread;
|
|
194
|
-
}),
|
|
195
|
-
{ concurrency: 10 },
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
return threads
|
|
199
|
-
.filter((thread) => thread.messages.length > 0)
|
|
200
|
-
.map(serializeThread)
|
|
201
|
-
.join('\n');
|
|
202
|
-
},
|
|
203
|
-
Effect.provide(
|
|
204
|
-
DiscordRESTMemoryLive.pipe(Layer.provideMerge(DiscordConfigFromCredential)).pipe(
|
|
205
|
-
Layer.provide(FetchHttpClient.layer),
|
|
206
|
-
),
|
|
207
|
-
),
|
|
208
|
-
Effect.orDie,
|
|
209
|
-
),
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* @param unixTimestamp in seconds
|
|
214
|
-
*/
|
|
215
|
-
const generateSnowflake = (unixTimestamp: number): bigint => {
|
|
216
|
-
const discordEpoch = 1420070400000n; // Discord Epoch (ms)
|
|
217
|
-
return (BigInt(unixTimestamp * 1000) - discordEpoch) << 22n;
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
const parseSnowflake = (snowflake: string): Date => {
|
|
221
|
-
const discordEpoch = 1420070400000n; // Discord Epoch (ms)
|
|
222
|
-
return new Date(Number((BigInt(snowflake) >> 22n) + discordEpoch));
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
// TODO(burdon): Move to @dxos/types.
|
|
226
|
-
const makeMessage = (message: MessageResponse): Message.Message =>
|
|
227
|
-
Obj.make(Message.Message, {
|
|
228
|
-
[Obj.Meta]: {
|
|
229
|
-
keys: [
|
|
230
|
-
{ id: message.id, source: 'discord.com' },
|
|
231
|
-
{ id: message.channel_id, source: 'discord.com/thread' },
|
|
232
|
-
],
|
|
233
|
-
},
|
|
234
|
-
sender: { name: message.author.username },
|
|
235
|
-
created: message.timestamp,
|
|
236
|
-
blocks: [{ _tag: 'text', text: message.content }],
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Standard JSON serialization is to verbose for large amounts of data.
|
|
241
|
-
*/
|
|
242
|
-
const serializeThread = (thread: Thread): string => {
|
|
243
|
-
return `<thread id=${thread.discordChannelId} name=${thread.name ?? ''}>\n${thread.messages
|
|
244
|
-
.map(
|
|
245
|
-
(message) =>
|
|
246
|
-
` ${message.sender.name}: ${message.blocks
|
|
247
|
-
.filter((block: any) => block._tag === 'text')
|
|
248
|
-
.map((block: any) => block.text)
|
|
249
|
-
.join(' ')}`,
|
|
250
|
-
)
|
|
251
|
-
.join('\n')}\n</thread>`;
|
|
252
|
-
};
|
|
@@ -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 { ArtifactId } from '@dxos/assistant';
|
|
9
|
-
import { DatabaseService, 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: 'Read markdown document.',
|
|
16
|
-
inputSchema: Schema.Struct({
|
|
17
|
-
id: ArtifactId.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: { id } }) {
|
|
25
|
-
const doc = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Markdown.Document);
|
|
26
|
-
const { content } = yield* DatabaseService.load(doc.content);
|
|
27
|
-
return { content };
|
|
28
|
-
}),
|
|
29
|
-
});
|
|
@@ -1,30 +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 { DatabaseService, 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
|
-
id: ArtifactId.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: { id, content } }) {
|
|
26
|
-
const doc = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Markdown.Document);
|
|
27
|
-
const text = yield* DatabaseService.load(doc.content);
|
|
28
|
-
text.content = content;
|
|
29
|
-
}),
|
|
30
|
-
});
|