@dxos/assistant-toolkit 0.8.4-main.ae835ea → 0.8.4-main.c85a9c8dae
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/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/index.mjs +2989 -1842
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/testing/index.mjs +81 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -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 +6 -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 +6 -0
- package/dist/types/src/blueprints/database/functions/context-remove.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/index.d.ts +57 -0
- package/dist/types/src/blueprints/database/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/database/functions/load.d.ts +6 -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 +6 -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 +6 -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 +9 -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 +9 -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 +9 -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 +6 -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 +7 -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 +5 -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 +7 -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 +7 -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/design/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/design/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/design/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/design/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/design/index.d.ts +1 -2
- package/dist/types/src/blueprints/design/index.d.ts.map +1 -1
- 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/{functions/discord → blueprints/discord/functions}/fetch-messages.d.ts +1 -1
- 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/{functions/discord → blueprints/discord/functions}/index.d.ts +4 -4
- package/dist/types/src/blueprints/discord/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/discord/index.d.ts +1 -2
- package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
- package/dist/types/src/{functions/github → blueprints/github/functions}/fetch-prs.d.ts +1 -1
- package/dist/types/src/blueprints/github/functions/fetch-prs.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/functions/index.d.ts +7 -0
- package/dist/types/src/blueprints/github/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/github/index.d.ts +1 -0
- package/dist/types/src/blueprints/github/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +10 -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/index.d.ts +9 -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/{functions/linear → blueprints/linear/functions}/sync-issues.d.ts +2 -2
- package/dist/types/src/blueprints/linear/functions/sync-issues.d.ts.map +1 -0
- package/dist/types/src/blueprints/linear/index.d.ts +1 -2
- package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/markdown/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/markdown/blueprint.d.ts.map +1 -0
- package/dist/types/src/{functions/research/create-document.d.ts → blueprints/markdown/functions/create.d.ts} +2 -3
- package/dist/types/src/blueprints/markdown/functions/create.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/functions/index.d.ts +30 -0
- package/dist/types/src/blueprints/markdown/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/functions/read.d.ts +14 -0
- package/dist/types/src/blueprints/markdown/functions/read.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/functions/update.d.ts +13 -0
- package/dist/types/src/blueprints/markdown/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/markdown/index.d.ts +3 -0
- package/dist/types/src/blueprints/markdown/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/index.d.ts +10 -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 +9 -0
- package/dist/types/src/blueprints/planning/functions/update-tasks.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/index.d.ts +1 -2
- package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning-old/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/planning-old/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/planning-old/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/index.d.ts +29 -0
- package/dist/types/src/blueprints/planning-old/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/read.d.ts +14 -0
- package/dist/types/src/blueprints/planning-old/functions/read.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/task-list.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/task-list.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/functions/update.d.ts +16 -0
- package/dist/types/src/blueprints/planning-old/functions/update.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning-old/index.d.ts +2 -0
- package/dist/types/src/blueprints/planning-old/index.d.ts.map +1 -0
- 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 +7 -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 +62 -0
- package/dist/types/src/blueprints/project/functions/agent.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/get-context.d.ts +13 -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 +133 -0
- package/dist/types/src/blueprints/project/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/project/functions/qualifier.d.ts +60 -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/research/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/research/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprints/research/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/functions/document-create.d.ts +10 -0
- package/dist/types/src/blueprints/research/functions/document-create.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/functions/index.d.ts +19 -0
- package/dist/types/src/blueprints/research/functions/index.d.ts.map +1 -0
- package/dist/types/src/{functions/research → blueprints/research/functions}/research.d.ts +4 -3
- package/dist/types/src/blueprints/research/functions/research.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/functions/research.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/index.d.ts +2 -2
- package/dist/types/src/blueprints/research/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts +18 -0
- package/dist/types/src/blueprints/research/types/ResearchGraph.d.ts.map +1 -0
- package/dist/types/src/blueprints/research/types/index.d.ts +7 -0
- package/dist/types/src/blueprints/research/types/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/testing.d.ts +18 -4
- 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/index.d.ts +2 -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} +2 -1
- package/dist/types/src/blueprints/websearch/toolkit.d.ts.map +1 -0
- package/dist/types/src/{functions/research → crud}/graph.d.ts +14 -11
- package/dist/types/src/crud/graph.d.ts.map +1 -0
- package/dist/types/src/crud/graph.test.d.ts.map +1 -0
- package/dist/types/src/crud/index.d.ts +2 -0
- package/dist/types/src/crud/index.d.ts.map +1 -0
- package/dist/types/src/functions/agent/index.d.ts +84 -4
- package/dist/types/src/functions/agent/index.d.ts.map +1 -1
- package/dist/types/src/functions/agent/prompt.d.ts +81 -8
- package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +142 -136
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/index.d.ts +144 -139
- package/dist/types/src/functions/entity-extraction/index.d.ts.map +1 -1
- package/dist/types/src/functions/exa/data/exa-search-1748337321991.d.ts.map +1 -0
- package/dist/types/src/functions/exa/data/exa-search-1748337331526.d.ts.map +1 -0
- package/dist/types/src/functions/exa/data/exa-search-1748337344119.d.ts.map +1 -0
- package/dist/types/src/functions/exa/data/index.d.ts.map +1 -0
- package/dist/types/src/functions/exa/exa.d.ts +1 -1
- package/dist/types/src/functions/exa/index.d.ts +8 -2
- package/dist/types/src/functions/exa/index.d.ts.map +1 -1
- package/dist/types/src/functions/exa/mock.d.ts +1 -1
- package/dist/types/src/functions/index.d.ts +1 -5
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -1
- 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 +2 -0
- package/dist/types/src/toolkits/index.d.ts.map +1 -0
- package/dist/types/src/types/Chat.d.ts +31 -0
- package/dist/types/src/types/Chat.d.ts.map +1 -0
- package/dist/types/src/types/Plan.d.ts +77 -0
- package/dist/types/src/types/Plan.d.ts.map +1 -0
- package/dist/types/src/types/Project.d.ts +67 -0
- package/dist/types/src/types/Project.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -38
- package/src/blueprints/browser/blueprint.conversations.json +1 -0
- package/src/blueprints/browser/blueprint.test.ts +70 -0
- package/src/blueprints/browser/blueprint.ts +41 -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 +321 -0
- package/src/blueprints/database/blueprint.ts +39 -0
- package/src/blueprints/database/functions/context-add.ts +35 -0
- package/src/blueprints/database/functions/context-remove.ts +35 -0
- package/src/blueprints/database/functions/index.ts +33 -0
- package/src/blueprints/database/functions/load.ts +31 -0
- package/src/blueprints/database/functions/object-create.ts +35 -0
- package/src/blueprints/database/functions/object-delete.ts +27 -0
- package/src/blueprints/database/functions/object-update.ts +32 -0
- package/src/blueprints/database/functions/query.ts +126 -0
- package/src/blueprints/database/functions/relation-create.ts +47 -0
- package/src/blueprints/database/functions/relation-delete.ts +28 -0
- package/src/blueprints/database/functions/schema-add.ts +40 -0
- package/src/blueprints/database/functions/schema-list.ts +34 -0
- package/src/blueprints/database/functions/tag-add.ts +31 -0
- package/src/blueprints/database/functions/tag-remove.ts +30 -0
- package/src/blueprints/database/index.ts +6 -0
- package/src/blueprints/design/{design-blueprint.test.ts → blueprint.test.ts} +25 -37
- package/src/blueprints/design/blueprint.ts +46 -0
- package/src/blueprints/design/index.ts +1 -3
- package/src/blueprints/discord/blueprint.ts +46 -0
- package/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.ts +10 -14
- package/src/{functions/discord → blueprints/discord/functions}/fetch-messages.ts +11 -10
- package/src/blueprints/discord/functions/index.ts +9 -0
- package/src/blueprints/discord/index.ts +1 -3
- package/src/{functions/github → blueprints/github/functions}/fetch-prs.ts +3 -2
- package/src/blueprints/github/functions/index.ts +9 -0
- package/src/blueprints/github/index.ts +3 -0
- package/src/blueprints/index.ts +10 -6
- package/src/blueprints/linear/blueprint.ts +47 -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 +17 -15
- package/src/blueprints/linear/index.ts +1 -3
- package/src/blueprints/markdown/blueprint.ts +38 -0
- package/src/blueprints/markdown/functions/create.ts +29 -0
- package/src/blueprints/markdown/functions/index.ts +13 -0
- package/src/blueprints/markdown/functions/read.ts +32 -0
- package/src/{functions/document → blueprints/markdown/functions}/update.ts +9 -7
- package/src/blueprints/markdown/index.ts +6 -0
- package/src/blueprints/planning/blueprint.ts +28 -0
- package/src/blueprints/planning/functions/index.ts +9 -0
- package/src/blueprints/planning/functions/update-tasks.ts +168 -0
- package/src/blueprints/planning/index.ts +2 -4
- package/src/blueprints/{planning/planning-blueprint.test.ts → planning-old/blueprint.test.ts} +25 -32
- package/src/blueprints/{planning/planning-blueprint.ts → planning-old/blueprint.ts} +24 -12
- package/src/blueprints/planning-old/functions/index.ts +11 -0
- package/src/{functions/tasks → blueprints/planning-old/functions}/read.ts +6 -6
- package/src/{functions/tasks → blueprints/planning-old/functions}/update.ts +6 -6
- package/src/blueprints/planning-old/index.ts +5 -0
- package/src/blueprints/project/blueprint.test.ts +579 -0
- package/src/blueprints/project/blueprint.ts +68 -0
- package/src/blueprints/project/functions/add-artifact.ts +41 -0
- package/src/blueprints/project/functions/agent.ts +72 -0
- package/src/blueprints/project/functions/get-context.ts +63 -0
- package/src/blueprints/project/functions/index.ts +15 -0
- package/src/blueprints/project/functions/qualifier.ts +96 -0
- package/src/blueprints/project/index.ts +6 -0
- package/src/blueprints/research/blueprint.ts +65 -0
- package/src/blueprints/research/functions/document-create.ts +73 -0
- package/src/blueprints/research/functions/index.ts +11 -0
- package/src/{functions/research/instructions-research.tpl → blueprints/research/functions/research-instructions.tpl} +14 -6
- package/src/blueprints/research/functions/research.conversations.json +1 -0
- package/src/blueprints/research/functions/research.test.ts +149 -0
- package/src/blueprints/research/functions/research.ts +175 -0
- package/src/blueprints/research/index.ts +2 -3
- package/src/blueprints/research/types/ResearchGraph.ts +49 -0
- package/src/blueprints/research/types/index.ts +32 -0
- package/src/blueprints/testing.ts +36 -5
- package/src/blueprints/websearch/blueprint.ts +32 -0
- package/src/blueprints/websearch/index.ts +2 -4
- package/src/crud/graph.test.ts +46 -0
- package/src/{functions/research → crud}/graph.ts +32 -40
- package/src/crud/index.ts +5 -0
- package/src/functions/READ_THIS.md +5 -0
- package/src/functions/agent/index.ts +4 -6
- package/src/functions/agent/prompt.ts +32 -25
- package/src/functions/entity-extraction/entity-extraction.conversations.json +1 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +17 -43
- package/src/functions/entity-extraction/entity-extraction.ts +54 -36
- package/src/functions/entity-extraction/index.ts +4 -4
- package/src/functions/exa/exa.ts +2 -2
- package/src/functions/exa/index.ts +7 -2
- package/src/functions/exa/mock.ts +1 -1
- package/src/functions/index.ts +1 -5
- package/src/index.ts +3 -1
- package/src/sync/sync.ts +38 -30
- package/src/testing/index.ts +2 -1
- package/src/testing/plugins.tsx +72 -0
- package/src/toolkits/WebToolkit.ts +33 -0
- package/src/toolkits/index.ts +5 -0
- package/src/types/Chat.ts +49 -0
- package/src/types/Plan.ts +107 -0
- package/src/types/Project.ts +196 -0
- package/src/types/index.ts +7 -0
- 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 -2483
- 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/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/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.map +0 -1
- package/dist/types/src/functions/document/index.d.ts +0 -12
- 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/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.map +0 -1
- package/dist/types/src/functions/research/create-document.d.ts.map +0 -1
- package/dist/types/src/functions/research/graph.d.ts.map +0 -1
- package/dist/types/src/functions/research/graph.test.d.ts.map +0 -1
- package/dist/types/src/functions/research/index.d.ts +0 -19
- 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.map +0 -1
- package/dist/types/src/functions/research/research.test.d.ts.map +0 -1
- package/dist/types/src/functions/research/types.d.ts +0 -384
- 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.map +0 -1
- 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.map +0 -1
- 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.map +0 -1
- package/dist/types/src/testing/data/index.d.ts.map +0 -1
- package/src/blueprints/design/design-blueprint.ts +0 -33
- package/src/blueprints/discord/discord-blueprint.ts +0 -34
- package/src/blueprints/linear/linear-blueprint.ts +0 -35
- package/src/blueprints/research/research-blueprint.ts +0 -45
- package/src/blueprints/websearch/websearch-blueprint.ts +0 -20
- package/src/experimental/feed.test.ts +0 -108
- package/src/functions/discord/index.ts +0 -9
- package/src/functions/document/index.ts +0 -11
- package/src/functions/document/read.ts +0 -29
- package/src/functions/linear/index.ts +0 -9
- package/src/functions/linear/linear.test.ts +0 -86
- package/src/functions/research/create-document.ts +0 -69
- package/src/functions/research/graph.test.ts +0 -69
- package/src/functions/research/index.ts +0 -15
- package/src/functions/research/research-graph.ts +0 -47
- package/src/functions/research/research.conversations.json +0 -10714
- package/src/functions/research/research.test.ts +0 -240
- package/src/functions/research/research.ts +0 -155
- package/src/functions/research/types.ts +0 -24
- package/src/functions/tasks/index.ts +0 -11
- package/src/plugins.tsx +0 -68
- /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
- /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.d.ts +0 -0
- /package/dist/types/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.d.ts +0 -0
- /package/dist/types/src/{functions/research → blueprints/research/functions}/research.test.d.ts +0 -0
- /package/dist/types/src/{functions/research → crud}/graph.test.d.ts +0 -0
- /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337321991.d.ts +0 -0
- /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337331526.d.ts +0 -0
- /package/dist/types/src/{testing → functions/exa}/data/exa-search-1748337344119.d.ts +0 -0
- /package/dist/types/src/{testing → functions/exa}/data/index.d.ts +0 -0
- /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.test.ts +0 -0
- /package/src/{functions/tasks → blueprints/planning-old/functions}/task-list.ts +0 -0
- /package/src/blueprints/research/{research-blueprint.test.ts → blueprint.test.ts} +0 -0
- /package/src/blueprints/websearch/{websearch-toolkit.ts → toolkit.ts} +0 -0
- /package/src/{testing → functions/exa}/data/exa-search-1748337321991.ts +0 -0
- /package/src/{testing → functions/exa}/data/exa-search-1748337331526.ts +0 -0
- /package/src/{testing → functions/exa}/data/exa-search-1748337344119.ts +0 -0
- /package/src/{testing → functions/exa}/data/index.ts +0 -0
|
@@ -1,45 +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 { DataType } 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
|
-
The result of the research is a set of structured entities forming an interconnected graph.
|
|
21
|
-
When you are done, reply with the created objects.
|
|
22
|
-
Do not print the data, instead reply with inline references to the created objects.
|
|
23
|
-
Those will be later substituted with the pills representing the created objects.
|
|
24
|
-
Print the rest of the created objects as block references after the main note.
|
|
25
|
-
|
|
26
|
-
<example>
|
|
27
|
-
Based on my research, Google was founded by @dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M and @dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK46K31DDW62PBW9H2ZQ
|
|
28
|
-
|
|
29
|
-
<object><dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M</dxn></object>
|
|
30
|
-
<object><dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK46K31DDW62PBW9H2ZQ</dxn></object>
|
|
31
|
-
<object><dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK46K31DDW62PBW92333</dxn></object>
|
|
32
|
-
</example>
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
export const blueprint: Blueprint.Blueprint = Obj.make(Blueprint.Blueprint, {
|
|
36
|
-
key: 'dxos.org/blueprint/research',
|
|
37
|
-
name: 'Research',
|
|
38
|
-
description: 'Researches the web and creates structured data.',
|
|
39
|
-
instructions: {
|
|
40
|
-
source: Ref.make(DataType.makeText(instructions)),
|
|
41
|
-
},
|
|
42
|
-
tools: [Research.create, Research.research].map((fn) => ToolId.make(fn.key)),
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
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 { DataType } 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(DataType.makeText('')), // No instructions required.
|
|
16
|
-
},
|
|
17
|
-
tools: [ToolId.make('AnthropicWebSearch')],
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export default blueprint;
|
|
@@ -1,108 +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 { ComputeEventLogger, CredentialsService, FunctionInvocationService, TracingService } from '@dxos/functions';
|
|
18
|
-
import { TestDatabaseLayer, testStoragePath } from '@dxos/functions/testing';
|
|
19
|
-
|
|
20
|
-
import { Discord, Linear } from '../functions';
|
|
21
|
-
|
|
22
|
-
const TestLayer = Layer.mergeAll(
|
|
23
|
-
AiService.model('@anthropic/claude-opus-4-0'),
|
|
24
|
-
makeToolResolverFromFunctions([], Toolkit.make()),
|
|
25
|
-
makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
|
|
26
|
-
ComputeEventLogger.layerFromTracing,
|
|
27
|
-
).pipe(
|
|
28
|
-
Layer.provideMerge(
|
|
29
|
-
Layer.mergeAll(
|
|
30
|
-
AiServiceTestingPreset('direct'),
|
|
31
|
-
TestDatabaseLayer({
|
|
32
|
-
indexing: { vector: true },
|
|
33
|
-
types: [],
|
|
34
|
-
storagePath: testStoragePath({ name: 'feed-test' }),
|
|
35
|
-
}),
|
|
36
|
-
CredentialsService.layerConfig([
|
|
37
|
-
{ service: 'exa.ai', apiKey: Config.succeed(Redacted.make(EXA_API_KEY)) },
|
|
38
|
-
{ service: 'discord.com', apiKey: Config.redacted('DISCORD_TOKEN') },
|
|
39
|
-
{ service: 'linear.app', apiKey: Config.redacted('LINEAR_API_KEY') },
|
|
40
|
-
]),
|
|
41
|
-
FunctionInvocationService.layerTestMocked({ functions: [Linear.sync, Discord.fetch] }).pipe(
|
|
42
|
-
Layer.provideMerge(ComputeEventLogger.layerFromTracing),
|
|
43
|
-
Layer.provideMerge(TracingService.layerLogInfo()),
|
|
44
|
-
),
|
|
45
|
-
FetchHttpClient.layer,
|
|
46
|
-
),
|
|
47
|
-
),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
describe('Feed', { timeout: 600_000 }, () => {
|
|
51
|
-
it.effect(
|
|
52
|
-
'fetch discord messages',
|
|
53
|
-
Effect.fnUntraced(
|
|
54
|
-
function* (_) {
|
|
55
|
-
// const messages = yield* LocalFunctionExecutionService.invokeFunction(fetchDiscordMessages, {
|
|
56
|
-
// serverId: '837138313172353095',
|
|
57
|
-
// // channelId: '1404487604761526423',
|
|
58
|
-
// after: Date.now() / 1000 - 128 * 3600,
|
|
59
|
-
// });
|
|
60
|
-
// for (const message of messages) {
|
|
61
|
-
// console.log(message.sender.name, message.blocks.find((block) => block._tag === 'text')?.text);
|
|
62
|
-
// }
|
|
63
|
-
// console.log(`Fetched ${messages.length} messages`);
|
|
64
|
-
|
|
65
|
-
// const result = yield* AiSession.run({
|
|
66
|
-
// history: [
|
|
67
|
-
// Obj.make(DataType.Message, {
|
|
68
|
-
// created: new Date().toISOString(),
|
|
69
|
-
// sender: { role: 'user' },
|
|
70
|
-
// blocks: messages
|
|
71
|
-
// .map(
|
|
72
|
-
// (message) =>
|
|
73
|
-
// ({
|
|
74
|
-
// _tag: 'text',
|
|
75
|
-
// text: message.sender.name + ': ' + message.blocks.find((block) => block._tag === 'text')?.text,
|
|
76
|
-
// }) as const,
|
|
77
|
-
// )
|
|
78
|
-
// .filter((block) => block._tag === 'text' && block.text.trim().length > 0),
|
|
79
|
-
// }),
|
|
80
|
-
// ],
|
|
81
|
-
// prompt: 'Summarize the messages.',
|
|
82
|
-
// system: 'Summarize the messages.',
|
|
83
|
-
// }).pipe(Effect.provide(AiService.model('@anthropic/claude-3-5-haiku-latest')));
|
|
84
|
-
// console.log(result);
|
|
85
|
-
|
|
86
|
-
const linearIssues = yield* FunctionInvocationService.invokeFunction(Linear.sync, {
|
|
87
|
-
team: '1127c63a-6f77-4725-9229-50f6cd47321c',
|
|
88
|
-
});
|
|
89
|
-
console.log(linearIssues);
|
|
90
|
-
|
|
91
|
-
// const result = yield* AiSession.run({
|
|
92
|
-
// history: [
|
|
93
|
-
// Obj.make(DataType.Message, {
|
|
94
|
-
// created: new Date().toISOString(),
|
|
95
|
-
// sender: { role: 'user' },
|
|
96
|
-
// blocks: [{ _tag: 'text', text: JSON.stringify(linearIssues) }],
|
|
97
|
-
// }),
|
|
98
|
-
// ],
|
|
99
|
-
// prompt: 'Summarize the whats new.',
|
|
100
|
-
// system: 'Summarize the whats new. Reference specific people by name.',
|
|
101
|
-
// }).pipe(Effect.provide(AiService.model('@anthropic/claude-sonnet-4-0')));
|
|
102
|
-
// console.log(result.at(-1)?.blocks.find((block) => block._tag === 'text')?.text);
|
|
103
|
-
},
|
|
104
|
-
Effect.provide(TestLayer),
|
|
105
|
-
TestHelpers.taggedTest('llm'),
|
|
106
|
-
),
|
|
107
|
-
);
|
|
108
|
-
});
|
|
@@ -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,86 +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 { Obj, Query } from '@dxos/echo';
|
|
16
|
-
import { TestHelpers } from '@dxos/effect';
|
|
17
|
-
import {
|
|
18
|
-
ComputeEventLogger,
|
|
19
|
-
CredentialsService,
|
|
20
|
-
DatabaseService,
|
|
21
|
-
FunctionInvocationService,
|
|
22
|
-
TracingService,
|
|
23
|
-
} from '@dxos/functions';
|
|
24
|
-
import { TestDatabaseLayer, testStoragePath } from '@dxos/functions/testing';
|
|
25
|
-
import { DataType } from '@dxos/schema';
|
|
26
|
-
|
|
27
|
-
import { LINEAR_ID_KEY, default as fetchLinearIssues } from './sync-issues';
|
|
28
|
-
|
|
29
|
-
const TestLayer = Layer.mergeAll(
|
|
30
|
-
AiService.model('@anthropic/claude-opus-4-0'),
|
|
31
|
-
makeToolResolverFromFunctions([], Toolkit.make()),
|
|
32
|
-
makeToolExecutionServiceFromFunctions(Toolkit.make() as any, Layer.empty as any),
|
|
33
|
-
ComputeEventLogger.layerFromTracing,
|
|
34
|
-
).pipe(
|
|
35
|
-
Layer.provideMerge(
|
|
36
|
-
Layer.mergeAll(
|
|
37
|
-
AiServiceTestingPreset('direct'),
|
|
38
|
-
TestDatabaseLayer({
|
|
39
|
-
// indexing: { vector: true },
|
|
40
|
-
types: [DataType.Task, DataType.Person, DataType.Project],
|
|
41
|
-
storagePath: testStoragePath({ name: 'feed-test-13' }),
|
|
42
|
-
}),
|
|
43
|
-
CredentialsService.layerConfig([{ service: 'linear.app', apiKey: Config.redacted('LINEAR_API_KEY') }]),
|
|
44
|
-
FunctionInvocationService.layerTestMocked({ functions: [fetchLinearIssues] }).pipe(
|
|
45
|
-
Layer.provideMerge(ComputeEventLogger.layerFromTracing),
|
|
46
|
-
Layer.provideMerge(TracingService.layerLogInfo()),
|
|
47
|
-
),
|
|
48
|
-
FetchHttpClient.layer,
|
|
49
|
-
),
|
|
50
|
-
),
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
describe('Linear', { timeout: 600_000 }, () => {
|
|
54
|
-
it.effect(
|
|
55
|
-
'sync',
|
|
56
|
-
Effect.fnUntraced(
|
|
57
|
-
function* (_) {
|
|
58
|
-
yield* DatabaseService.flush({ indexes: true });
|
|
59
|
-
|
|
60
|
-
yield* FunctionInvocationService.invokeFunction(fetchLinearIssues, {
|
|
61
|
-
team: '1127c63a-6f77-4725-9229-50f6cd47321c',
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const { objects: persons } = yield* DatabaseService.runQuery(Query.type(DataType.Person));
|
|
65
|
-
console.log('people', {
|
|
66
|
-
count: persons.length,
|
|
67
|
-
people: persons.map((_) => `(${_.id}) ${Obj.getLabel(_)} [${Obj.getKeys(_, LINEAR_ID_KEY)[0]?.id}]`),
|
|
68
|
-
});
|
|
69
|
-
const { objects: projects } = yield* DatabaseService.runQuery(Query.type(DataType.Project));
|
|
70
|
-
console.log('projects', {
|
|
71
|
-
count: projects.length,
|
|
72
|
-
projects: projects.map((_) => `(${_.id}) ${Obj.getLabel(_)} [${Obj.getKeys(_, LINEAR_ID_KEY)[0]?.id}]`),
|
|
73
|
-
});
|
|
74
|
-
const { objects: tasks } = yield* DatabaseService.runQuery(Query.type(DataType.Task));
|
|
75
|
-
console.log('tasks', {
|
|
76
|
-
count: tasks.length,
|
|
77
|
-
tasks: tasks.map((_) => `(${_.id}) ${Obj.getLabel(_)} [${Obj.getKeys(_, LINEAR_ID_KEY)[0]?.id}]`),
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
yield* DatabaseService.flush({ indexes: true });
|
|
81
|
-
},
|
|
82
|
-
Effect.provide(TestLayer),
|
|
83
|
-
TestHelpers.taggedTest('sync'),
|
|
84
|
-
),
|
|
85
|
-
);
|
|
86
|
-
});
|
|
@@ -1,69 +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 { Relation } from '@dxos/echo';
|
|
9
|
-
import { DatabaseService, TracingService, defineFunction } from '@dxos/functions';
|
|
10
|
-
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { DXN, ObjectId } from '@dxos/keys';
|
|
12
|
-
import { log } from '@dxos/log';
|
|
13
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
14
|
-
import { DataType } from '@dxos/schema';
|
|
15
|
-
import { trim } from '@dxos/util';
|
|
16
|
-
|
|
17
|
-
export default defineFunction({
|
|
18
|
-
key: 'dxos.org/function/research/create-document',
|
|
19
|
-
name: 'Create research document',
|
|
20
|
-
description: 'Creates a note summarizing the research.',
|
|
21
|
-
inputSchema: Schema.Struct({
|
|
22
|
-
name: Schema.String.annotations({
|
|
23
|
-
description: 'Name of the note.',
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
content: Schema.String.annotations({
|
|
27
|
-
description: trim`
|
|
28
|
-
Content of the note.
|
|
29
|
-
Supports (and are prefered) references to research objects using @ syntax and <object> tags (refer to research blueprint instructions).
|
|
30
|
-
`,
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
// TODO(dmaretskyi): Use a specialized type for this (e.g., ArtifactId renamed as RefFromLLM).
|
|
34
|
-
target: Schema.String.annotations({
|
|
35
|
-
description: trim`
|
|
36
|
-
Id of the object (organization, contact, etc.) for which the research was performed.
|
|
37
|
-
This must be a ulid.
|
|
38
|
-
`,
|
|
39
|
-
}),
|
|
40
|
-
}),
|
|
41
|
-
outputSchema: Schema.Struct({}), // TODO(burdon): Schema.Void?
|
|
42
|
-
handler: Effect.fnUntraced(function* ({ data: { target, name, content } }) {
|
|
43
|
-
log.info('Creating research document', { target, name, content });
|
|
44
|
-
|
|
45
|
-
yield* DatabaseService.flush({ indexes: true });
|
|
46
|
-
yield* TracingService.emitStatus({ message: 'Creating research document...' });
|
|
47
|
-
invariant(ObjectId.isValid(target));
|
|
48
|
-
|
|
49
|
-
const targetObj = yield* DatabaseService.resolve(DXN.fromLocalObjectId(target));
|
|
50
|
-
|
|
51
|
-
const doc = yield* DatabaseService.add(
|
|
52
|
-
Markdown.makeDocument({
|
|
53
|
-
name,
|
|
54
|
-
content,
|
|
55
|
-
}),
|
|
56
|
-
);
|
|
57
|
-
yield* DatabaseService.add(
|
|
58
|
-
Relation.make(DataType.HasSubject, {
|
|
59
|
-
[Relation.Source]: doc,
|
|
60
|
-
[Relation.Target]: targetObj as any,
|
|
61
|
-
completedAt: new Date().toISOString(),
|
|
62
|
-
}),
|
|
63
|
-
);
|
|
64
|
-
yield* DatabaseService.flush({ indexes: true });
|
|
65
|
-
|
|
66
|
-
log.info('Created research document', { target, name, content });
|
|
67
|
-
return {};
|
|
68
|
-
}),
|
|
69
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
|
|
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 Function from 'effect/Function';
|
|
11
|
-
import * as Layer from 'effect/Layer';
|
|
12
|
-
|
|
13
|
-
import { AiService, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
14
|
-
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
15
|
-
import { tapHttpErrors } from '@dxos/ai/testing';
|
|
16
|
-
import { AiSession } from '@dxos/assistant';
|
|
17
|
-
import { TestHelpers } from '@dxos/effect';
|
|
18
|
-
import { DatabaseService, TracingService } from '@dxos/functions';
|
|
19
|
-
import { log } from '@dxos/log';
|
|
20
|
-
import { DataType } from '@dxos/schema';
|
|
21
|
-
|
|
22
|
-
import { makeGraphWriterHandler, makeGraphWriterToolkit } from './graph';
|
|
23
|
-
|
|
24
|
-
// import { type EchoTestBuilder } from '@dxos/echo-db/testing';
|
|
25
|
-
|
|
26
|
-
const TestLayer = Function.pipe(
|
|
27
|
-
AiService.model('@anthropic/claude-3-5-sonnet-20241022'),
|
|
28
|
-
Layer.provideMerge(DatabaseService.notAvailable),
|
|
29
|
-
Layer.provideMerge(ToolResolverService.layerEmpty),
|
|
30
|
-
Layer.provideMerge(ToolExecutionService.layerEmpty),
|
|
31
|
-
Layer.provide(AiServiceRouter.AiServiceRouter),
|
|
32
|
-
Layer.provide(
|
|
33
|
-
AnthropicClient.layerConfig({
|
|
34
|
-
apiKey: Config.redacted('ANTHROPIC_API_KEY'),
|
|
35
|
-
transformClient: tapHttpErrors,
|
|
36
|
-
}),
|
|
37
|
-
),
|
|
38
|
-
Layer.provide(FetchHttpClient.layer),
|
|
39
|
-
Layer.provideMerge(TracingService.layerNoop),
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
describe('graph', () => {
|
|
43
|
-
// let builder: EchoTestBuilder;
|
|
44
|
-
// test('findRelatedSchema', async () => {
|
|
45
|
-
// const db = await createEchoDatabase();
|
|
46
|
-
// const relatedSchemas = await findRelatedSchema(db, Schema.Struct({}));
|
|
47
|
-
// });
|
|
48
|
-
|
|
49
|
-
const Toolkit = makeGraphWriterToolkit({ schema: [DataType.Project] });
|
|
50
|
-
const ToolkitLayer = makeGraphWriterHandler(Toolkit);
|
|
51
|
-
|
|
52
|
-
it.effect.skip(
|
|
53
|
-
'calculator',
|
|
54
|
-
Effect.fn(
|
|
55
|
-
function* (_) {
|
|
56
|
-
const session = new AiSession();
|
|
57
|
-
const toolkit = yield* Toolkit;
|
|
58
|
-
const response = yield* session.run({
|
|
59
|
-
toolkit,
|
|
60
|
-
prompt: 'What is 10 + 20?',
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
log.info('response', { response });
|
|
64
|
-
},
|
|
65
|
-
Effect.provide(Layer.mergeAll(TestLayer, ToolkitLayer)),
|
|
66
|
-
TestHelpers.runIf(process.env.ANTHROPIC_API_KEY),
|
|
67
|
-
),
|
|
68
|
-
);
|
|
69
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { default as create$ } from './create-document';
|
|
6
|
-
import { default as research$ } from './research';
|
|
7
|
-
|
|
8
|
-
export * from './graph';
|
|
9
|
-
export * from './research-graph';
|
|
10
|
-
export * from './types';
|
|
11
|
-
|
|
12
|
-
export namespace Research {
|
|
13
|
-
export const create = create$;
|
|
14
|
-
export const research = research$;
|
|
15
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Layer from 'effect/Layer';
|
|
7
|
-
import * as Schema from 'effect/Schema';
|
|
8
|
-
|
|
9
|
-
import { Obj, Query, Ref, Type } from '@dxos/echo';
|
|
10
|
-
import { Queue } from '@dxos/echo-db';
|
|
11
|
-
import { ContextQueueService, DatabaseService, QueueService } from '@dxos/functions';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Container for a set of ephemeral research results.
|
|
15
|
-
*/
|
|
16
|
-
export const ResearchGraph = Schema.Struct({
|
|
17
|
-
queue: Type.Ref(Queue),
|
|
18
|
-
}).pipe(
|
|
19
|
-
Type.Obj({
|
|
20
|
-
typename: 'dxos.org/type/ResearchGraph',
|
|
21
|
-
version: '0.1.0',
|
|
22
|
-
}),
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
export interface ResearchGraph extends Schema.Schema.Type<typeof ResearchGraph> {}
|
|
26
|
-
|
|
27
|
-
export const queryResearchGraph: () => Effect.Effect<ResearchGraph | undefined, never, DatabaseService> = Effect.fn(
|
|
28
|
-
'queryResearchGraph',
|
|
29
|
-
)(function* () {
|
|
30
|
-
const { objects } = yield* DatabaseService.runQuery(Query.type(ResearchGraph));
|
|
31
|
-
return objects.at(0);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const createResearchGraph: () => Effect.Effect<ResearchGraph, never, DatabaseService | QueueService> = Effect.fn(
|
|
35
|
-
'createResearchGraph',
|
|
36
|
-
)(function* () {
|
|
37
|
-
const queue = yield* QueueService.createQueue();
|
|
38
|
-
return yield* DatabaseService.add(Obj.make(ResearchGraph, { queue: Ref.fromDXN(queue.dxn) }));
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
export const contextQueueLayerFromResearchGraph = Layer.unwrapEffect(
|
|
42
|
-
Effect.gen(function* () {
|
|
43
|
-
const researchGraph = (yield* queryResearchGraph()) ?? (yield* createResearchGraph());
|
|
44
|
-
const researchQueue = yield* DatabaseService.load(researchGraph.queue);
|
|
45
|
-
return ContextQueueService.layer(researchQueue);
|
|
46
|
-
}),
|
|
47
|
-
);
|