@dxos/assistant-toolkit 0.8.4-main.66e292d → 0.8.4-main.6fa680abb7
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 +3478 -2472
- 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/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 +3 -3
- 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/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 +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/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 +1 -1
- 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/document/update.d.ts → blueprints/markdown/functions/create.d.ts} +2 -2
- 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/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/delete.d.ts +8 -0
- package/dist/types/src/blueprints/memory/functions/delete.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/index.d.ts +17 -0
- package/dist/types/src/blueprints/memory/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/memory/functions/query.d.ts +6 -0
- package/dist/types/src/blueprints/memory/functions/query.d.ts.map +1 -0
- package/dist/types/src/{functions/document/read.d.ts → blueprints/memory/functions/save.d.ts} +3 -4
- 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/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/{functions/research → blueprints/research/functions}/document-create.d.ts +2 -1
- package/dist/types/src/blueprints/research/functions/document-create.d.ts.map +1 -0
- package/dist/types/src/{functions/research → blueprints/research/functions}/index.d.ts +6 -8
- 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 +1 -1
- 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} +1 -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/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 +79 -4
- package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +136 -129
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/index.d.ts +138 -132
- 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/index.d.ts +8 -2
- package/dist/types/src/functions/exa/index.d.ts.map +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 +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/Chat.d.ts +31 -0
- package/dist/types/src/types/Chat.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 +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 +5 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -40
- 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} +19 -26
- package/src/blueprints/design/{design-blueprint.ts → blueprint.ts} +24 -11
- 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 +5 -8
- package/src/{functions/discord → blueprints/discord/functions}/fetch-messages.ts +2 -2
- 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 +4 -3
- package/src/blueprints/github/functions/index.ts +9 -0
- package/src/blueprints/github/index.ts +3 -0
- package/src/blueprints/index.ts +11 -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 +13 -11
- 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 +10 -8
- package/src/blueprints/markdown/index.ts +6 -0
- package/src/blueprints/memory/blueprint.conversations.json +1 -0
- package/src/blueprints/memory/blueprint.test.ts +135 -0
- package/src/blueprints/memory/blueprint.ts +44 -0
- package/src/blueprints/memory/functions/delete.ts +25 -0
- package/src/blueprints/memory/functions/index.ts +13 -0
- package/src/blueprints/memory/functions/query.ts +49 -0
- package/src/blueprints/memory/functions/save.ts +32 -0
- package/src/blueprints/memory/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} +17 -19
- package/src/blueprints/{planning/planning-blueprint.ts → planning-old/blueprint.ts} +23 -11
- package/src/blueprints/planning-old/functions/index.ts +11 -0
- package/src/{functions/tasks → blueprints/planning-old/functions}/read.ts +7 -7
- package/src/{functions/tasks → blueprints/planning-old/functions}/update.ts +7 -7
- 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/{research-blueprint.ts → blueprint.ts} +24 -12
- package/src/{functions/research → blueprints/research/functions}/document-create.ts +10 -12
- package/src/blueprints/research/functions/index.ts +11 -0
- package/src/{functions/research → blueprints/research/functions}/research-instructions.tpl +5 -5
- package/src/blueprints/research/functions/research.conversations.json +1 -0
- package/src/{functions/research → blueprints/research/functions}/research.test.ts +40 -70
- package/src/{functions/research → blueprints/research/functions}/research.ts +19 -34
- package/src/blueprints/research/index.ts +2 -3
- package/src/blueprints/research/types/ResearchGraph.ts +49 -0
- package/src/{functions/research/types.ts → blueprints/research/types/index.ts} +12 -6
- 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 +6 -29
- package/src/crud/graph.ts +21 -23
- package/src/functions/READ_THIS.md +5 -0
- package/src/functions/agent/index.ts +4 -6
- package/src/functions/agent/prompt.ts +20 -26
- package/src/functions/entity-extraction/entity-extraction.conversations.json +1 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +13 -31
- package/src/functions/entity-extraction/entity-extraction.ts +44 -27
- 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 +2 -2
- package/src/functions/index.ts +1 -5
- package/src/index.ts +2 -2
- package/src/sync/sync.ts +38 -30
- package/src/testing/index.ts +2 -1
- package/src/{plugins.tsx → testing/plugins.tsx} +27 -23
- package/src/toolkits/WebToolkit.ts +33 -0
- package/src/toolkits/index.ts +1 -2
- package/src/types/Chat.ts +51 -0
- package/src/types/Memory.ts +23 -0
- package/src/types/Plan.ts +110 -0
- package/src/types/Project.ts +198 -0
- package/src/types/index.ts +8 -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 -2779
- 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 -19
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +0 -19
- 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 -13
- package/dist/types/src/functions/document/index.d.ts.map +0 -1
- package/dist/types/src/functions/document/read.d.ts.map +0 -1
- 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/document-create.d.ts.map +0 -1
- 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 -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.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/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/discord/discord-blueprint.ts +0 -34
- package/src/blueprints/linear/linear-blueprint.ts +0 -35
- package/src/blueprints/websearch/websearch-blueprint.ts +0 -20
- package/src/experimental/feed.test.ts +0 -111
- 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/linear/index.ts +0 -9
- package/src/functions/linear/linear.test.ts +0 -83
- package/src/functions/research/index.ts +0 -14
- package/src/functions/research/research-graph.ts +0 -49
- package/src/functions/research/research.conversations.json +0 -1
- package/src/functions/tasks/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.d.ts +0 -0
- /package/dist/types/src/{functions/discord → blueprints/discord/functions}/fetch-messages.test.d.ts +0 -0
- /package/dist/types/src/{functions/github → blueprints/github/functions}/fetch-prs.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/{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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
6
|
+
import { Blueprint, Template } from '@dxos/blueprints';
|
|
7
|
+
import { trim } from '@dxos/util';
|
|
8
|
+
|
|
9
|
+
import { ProjectFunctions } from './functions';
|
|
10
|
+
|
|
11
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.project';
|
|
12
|
+
|
|
13
|
+
const functions = [ProjectFunctions.AddArtifact];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Creates the Project blueprint. This is a function to avoid circular dependency issues.
|
|
17
|
+
*/
|
|
18
|
+
const make = () =>
|
|
19
|
+
Blueprint.make({
|
|
20
|
+
key: BLUEPRINT_KEY,
|
|
21
|
+
name: 'Project blueprint',
|
|
22
|
+
instructions: Template.make({
|
|
23
|
+
source: trim`
|
|
24
|
+
You work on an project. Each project has a spec - the goal of the project.
|
|
25
|
+
The project plan shows the current progress of the project.
|
|
26
|
+
Project has an number of associated artifacts you can read/write.
|
|
27
|
+
Spec and plan are also artifacts.
|
|
28
|
+
You can edit them if necessary.
|
|
29
|
+
|
|
30
|
+
IMPORTANT: When create a new artifact, always add it to the project using the add-artifact function.
|
|
31
|
+
|
|
32
|
+
{{#with project}}
|
|
33
|
+
<project id="{{id}}" name="{{name}}">
|
|
34
|
+
<spec>
|
|
35
|
+
{{spec}}
|
|
36
|
+
</spec>
|
|
37
|
+
<plan>
|
|
38
|
+
{{plan}}
|
|
39
|
+
</plan>
|
|
40
|
+
|
|
41
|
+
<artifacts>
|
|
42
|
+
{{#each artifacts}}
|
|
43
|
+
<artifact type="{{type}}" dxn="{{dxn}}">
|
|
44
|
+
{{name}}
|
|
45
|
+
</artifact>
|
|
46
|
+
{{/each}}
|
|
47
|
+
</artifacts>
|
|
48
|
+
</project>
|
|
49
|
+
{{/with}}
|
|
50
|
+
`,
|
|
51
|
+
inputs: [
|
|
52
|
+
{
|
|
53
|
+
name: 'project',
|
|
54
|
+
kind: 'function',
|
|
55
|
+
function: 'org.dxos.function.project.get-context',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
}),
|
|
59
|
+
tools: Blueprint.toolDefinitions({ functions }),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
63
|
+
key: BLUEPRINT_KEY,
|
|
64
|
+
functions,
|
|
65
|
+
make,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default blueprint;
|
|
@@ -0,0 +1,41 @@
|
|
|
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 { AiContextService } from '@dxos/assistant';
|
|
9
|
+
import { Database, Obj, Ref } from '@dxos/echo';
|
|
10
|
+
import { defineFunction } from '@dxos/functions';
|
|
11
|
+
|
|
12
|
+
import { Project } from '../../../types';
|
|
13
|
+
|
|
14
|
+
export default defineFunction({
|
|
15
|
+
key: 'org.dxos.function.project.add-artifact',
|
|
16
|
+
name: 'Add artifact',
|
|
17
|
+
description: 'Adds a new artifact.',
|
|
18
|
+
inputSchema: Schema.Struct({
|
|
19
|
+
name: Schema.String.annotations({
|
|
20
|
+
description: 'The name of the artifact to add.',
|
|
21
|
+
}),
|
|
22
|
+
artifact: Ref.Ref(Obj.Unknown).annotations({
|
|
23
|
+
description: 'The artifact to add. Do NOT guess or try to generate the ID.',
|
|
24
|
+
}),
|
|
25
|
+
}),
|
|
26
|
+
services: [AiContextService],
|
|
27
|
+
handler: Effect.fnUntraced(function* ({ data }) {
|
|
28
|
+
if (!(yield* Database.load(data.artifact))) {
|
|
29
|
+
throw new Error('Artifact not found.');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const project = yield* Project.getFromChatContext;
|
|
33
|
+
|
|
34
|
+
Obj.change(project, (project) => {
|
|
35
|
+
project.artifacts.push({
|
|
36
|
+
name: data.name,
|
|
37
|
+
data: data.artifact,
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}, AiContextService.fixFunctionHandlerType),
|
|
41
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
|
+
|
|
8
|
+
import { AiService } from '@dxos/ai';
|
|
9
|
+
import { AiContextService, AiConversation, type ContextBinding } from '@dxos/assistant';
|
|
10
|
+
import { Database, Obj, Ref } from '@dxos/echo';
|
|
11
|
+
import { type Queue } from '@dxos/echo-db';
|
|
12
|
+
import { acquireReleaseResource } from '@dxos/effect';
|
|
13
|
+
import { TriggerEvent, defineFunction } from '@dxos/functions';
|
|
14
|
+
import { invariant } from '@dxos/invariant';
|
|
15
|
+
import { type Message } from '@dxos/types';
|
|
16
|
+
|
|
17
|
+
import { Project } from '../../../types';
|
|
18
|
+
|
|
19
|
+
export default defineFunction({
|
|
20
|
+
key: 'org.dxos.function.project.agent',
|
|
21
|
+
name: 'Project Agent',
|
|
22
|
+
description: 'Agentic worker that drives the project autonomously.',
|
|
23
|
+
inputSchema: Schema.Struct({
|
|
24
|
+
project: Schema.suspend(() => Ref.Ref(Project.Project)),
|
|
25
|
+
prompt: Schema.optional(Schema.String),
|
|
26
|
+
event: Schema.optional(TriggerEvent.TriggerEvent),
|
|
27
|
+
}),
|
|
28
|
+
outputSchema: Schema.Void,
|
|
29
|
+
services: [AiContextService],
|
|
30
|
+
handler: Effect.fnUntraced(
|
|
31
|
+
function* ({ data }) {
|
|
32
|
+
const project = yield* Database.load(data.project);
|
|
33
|
+
invariant(Obj.instanceOf(Project.Project, project));
|
|
34
|
+
invariant(project.chat, 'Project has no chat.');
|
|
35
|
+
|
|
36
|
+
const chatQueue = yield* project.chat.pipe(
|
|
37
|
+
Database.load,
|
|
38
|
+
Effect.flatMap((chat) => Database.load(chat.queue)),
|
|
39
|
+
);
|
|
40
|
+
invariant(chatQueue, 'Project chat queue not found.');
|
|
41
|
+
const conversation = yield* acquireReleaseResource(
|
|
42
|
+
() => new AiConversation({ queue: chatQueue as Queue<Message.Message | ContextBinding> }),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const iniativesInContext = conversation.context.getObjects().filter(Obj.instanceOf(Project.Project));
|
|
46
|
+
if (iniativesInContext.length !== 1) {
|
|
47
|
+
throw new Error('There should be exactly one project in context. Got: ' + iniativesInContext.length);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!data.prompt && !data.event) {
|
|
51
|
+
throw new Error('Either prompt or event must be provided.');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let input = '';
|
|
55
|
+
if (data.prompt) {
|
|
56
|
+
input += `${data.prompt}\n\n`;
|
|
57
|
+
}
|
|
58
|
+
if (data.event) {
|
|
59
|
+
input += `<event>\n${JSON.stringify(data.event, null, 2)}\n</event>\n\n`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
yield* conversation
|
|
63
|
+
.createRequest({
|
|
64
|
+
prompt: input,
|
|
65
|
+
})
|
|
66
|
+
.pipe(Effect.retry({ times: 2 }));
|
|
67
|
+
},
|
|
68
|
+
Effect.scoped,
|
|
69
|
+
Effect.provide(AiService.model('@anthropic/claude-sonnet-4-5')),
|
|
70
|
+
AiContextService.fixFunctionHandlerType,
|
|
71
|
+
) as any,
|
|
72
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
|
+
|
|
8
|
+
import { AiContextService } from '@dxos/assistant';
|
|
9
|
+
import { Database, Obj } from '@dxos/echo';
|
|
10
|
+
import { defineFunction } from '@dxos/functions';
|
|
11
|
+
|
|
12
|
+
import { Plan, Project } from '../../../types';
|
|
13
|
+
|
|
14
|
+
export default defineFunction({
|
|
15
|
+
key: 'org.dxos.function.project.get-context',
|
|
16
|
+
name: 'Get Project Context',
|
|
17
|
+
description: 'Get the context of an project.',
|
|
18
|
+
inputSchema: Schema.Struct({}),
|
|
19
|
+
outputSchema: Schema.Struct({
|
|
20
|
+
id: Schema.String,
|
|
21
|
+
name: Schema.String,
|
|
22
|
+
spec: Schema.String,
|
|
23
|
+
plan: Schema.String,
|
|
24
|
+
artifacts: Schema.Array(
|
|
25
|
+
Schema.Struct({
|
|
26
|
+
name: Schema.String,
|
|
27
|
+
type: Schema.optional(Schema.String),
|
|
28
|
+
dxn: Schema.optional(Schema.String),
|
|
29
|
+
}),
|
|
30
|
+
),
|
|
31
|
+
}),
|
|
32
|
+
services: [AiContextService],
|
|
33
|
+
handler: Effect.fnUntraced(function* ({ data: _data }) {
|
|
34
|
+
const project = yield* Project.getFromChatContext;
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
id: project.id,
|
|
38
|
+
name: project.name,
|
|
39
|
+
spec: yield* project.spec.pipe(Database.load).pipe(
|
|
40
|
+
Effect.map((_) => _.content),
|
|
41
|
+
Effect.catchTag('ObjectNotFoundError', () => Effect.succeed('No spec found.')),
|
|
42
|
+
),
|
|
43
|
+
plan: yield* (
|
|
44
|
+
project.plan?.pipe(Database.load).pipe(
|
|
45
|
+
Effect.map(Plan.formatPlan),
|
|
46
|
+
Effect.catchTag('ObjectNotFoundError', () => Effect.succeed('No plan found.')),
|
|
47
|
+
) ?? Effect.succeed('No plan found.')
|
|
48
|
+
),
|
|
49
|
+
artifacts: yield* Effect.forEach(project.artifacts, (artifact) =>
|
|
50
|
+
Effect.gen(function* () {
|
|
51
|
+
return {
|
|
52
|
+
name: artifact.name,
|
|
53
|
+
type: yield* Database.load(artifact.data).pipe(
|
|
54
|
+
Effect.map(Obj.getTypename),
|
|
55
|
+
Effect.catchTag('ObjectNotFoundError', () => Effect.succeed('Artifact not found.')),
|
|
56
|
+
),
|
|
57
|
+
dxn: artifact.data.dxn.toString(),
|
|
58
|
+
};
|
|
59
|
+
}),
|
|
60
|
+
),
|
|
61
|
+
};
|
|
62
|
+
}, AiContextService.fixFunctionHandlerType),
|
|
63
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { default as AddArtifact } from './add-artifact';
|
|
6
|
+
import { default as Agent } from './agent';
|
|
7
|
+
import { default as GetContext } from './get-context';
|
|
8
|
+
import { default as Qualifier } from './qualifier';
|
|
9
|
+
|
|
10
|
+
export const ProjectFunctions = {
|
|
11
|
+
AddArtifact,
|
|
12
|
+
Agent,
|
|
13
|
+
GetContext,
|
|
14
|
+
Qualifier,
|
|
15
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as LanguageModel from '@effect/ai/LanguageModel';
|
|
6
|
+
import * as Prompt from '@effect/ai/Prompt';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Schema from 'effect/Schema';
|
|
9
|
+
|
|
10
|
+
import { AiService } from '@dxos/ai';
|
|
11
|
+
import { Database, Obj, Ref } from '@dxos/echo';
|
|
12
|
+
import { TriggerEvent, defineFunction } from '@dxos/functions';
|
|
13
|
+
import { invariant } from '@dxos/invariant';
|
|
14
|
+
import { trim } from '@dxos/util';
|
|
15
|
+
|
|
16
|
+
import { Plan, Project } from '../../../types';
|
|
17
|
+
|
|
18
|
+
export default defineFunction({
|
|
19
|
+
key: 'org.dxos.function.project.qualifier',
|
|
20
|
+
name: 'Project Qualifier',
|
|
21
|
+
description:
|
|
22
|
+
'Qualifier that determines if the event is relevant to the project. Puts the data into the input queue of the project.',
|
|
23
|
+
inputSchema: Schema.Struct({
|
|
24
|
+
project: Schema.suspend(() => Ref.Ref(Project.Project)),
|
|
25
|
+
event: TriggerEvent.TriggerEvent,
|
|
26
|
+
}),
|
|
27
|
+
outputSchema: Schema.Void,
|
|
28
|
+
services: [],
|
|
29
|
+
handler: Effect.fnUntraced(
|
|
30
|
+
function* ({ data }) {
|
|
31
|
+
const project = yield* Database.load(data.project);
|
|
32
|
+
invariant(Obj.instanceOf(Project.Project, project));
|
|
33
|
+
invariant(project.chat, 'Project has no chat.');
|
|
34
|
+
|
|
35
|
+
const { id, name, queue } = project;
|
|
36
|
+
if (!queue) {
|
|
37
|
+
throw new Error('Project has no queue.');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const plan = yield* Database.load(project.plan);
|
|
41
|
+
const spec = yield* Database.load(project.spec);
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
value: { isRelevant },
|
|
45
|
+
} = yield* LanguageModel.generateObject({
|
|
46
|
+
schema: Schema.Struct({
|
|
47
|
+
isRelevant: Schema.Boolean,
|
|
48
|
+
}),
|
|
49
|
+
prompt: Prompt.fromMessages([
|
|
50
|
+
Prompt.systemMessage({
|
|
51
|
+
content: trim`
|
|
52
|
+
You are a qualifying agent that determines if the event is relevant to the project.
|
|
53
|
+
Respond with true if the event is relevant to the project, false otherwise.
|
|
54
|
+
If you are not sure, return true.
|
|
55
|
+
The qualified events will be forwarded to the larger agent that will process them.
|
|
56
|
+
<project id="${id}" name="${name}">
|
|
57
|
+
<spec>
|
|
58
|
+
${spec.content}
|
|
59
|
+
</spec>
|
|
60
|
+
<plan>
|
|
61
|
+
${Plan.formatPlan(plan)}
|
|
62
|
+
</plan>
|
|
63
|
+
</project>
|
|
64
|
+
`,
|
|
65
|
+
}),
|
|
66
|
+
Prompt.userMessage({
|
|
67
|
+
content: [
|
|
68
|
+
Prompt.makePart('text', {
|
|
69
|
+
text: trim`
|
|
70
|
+
<event>
|
|
71
|
+
${JSON.stringify(data.event, null, 2)}
|
|
72
|
+
</event>
|
|
73
|
+
`,
|
|
74
|
+
}),
|
|
75
|
+
],
|
|
76
|
+
}),
|
|
77
|
+
]),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
if (isRelevant) {
|
|
81
|
+
const queueTarget = yield* Database.load(queue);
|
|
82
|
+
if ('queue' in data.event && data.event.item) {
|
|
83
|
+
const obj = data.event.item;
|
|
84
|
+
yield* Effect.promise(() => queueTarget.append([obj]));
|
|
85
|
+
} else if ('subject' in data.event && Ref.isRef(data.event.subject)) {
|
|
86
|
+
const obj = yield* Database.load(data.event.subject);
|
|
87
|
+
yield* Effect.promise(() => queueTarget.append([obj]));
|
|
88
|
+
} else {
|
|
89
|
+
throw new Error('Invalid event.');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
Effect.scoped,
|
|
94
|
+
Effect.provide(AiService.model('@anthropic/claude-sonnet-4-5')),
|
|
95
|
+
),
|
|
96
|
+
});
|
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
6
7
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
8
|
+
import { Ref } from '@dxos/echo';
|
|
8
9
|
import { Text } from '@dxos/schema';
|
|
9
10
|
import { trim } from '@dxos/util';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
+
import { ResearchFunctions } from './functions';
|
|
13
|
+
|
|
14
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.research';
|
|
15
|
+
|
|
16
|
+
const functions = Object.values(ResearchFunctions);
|
|
12
17
|
|
|
13
18
|
/**
|
|
14
19
|
* Agent prompt instructions for managing hierarchical task lists.
|
|
@@ -20,7 +25,7 @@ const instructions = trim`
|
|
|
20
25
|
Structured data extraction is an experimental feature -- only enable it if the user explicitly requests it in the prompt.
|
|
21
26
|
Prefer updating existing notes instead of creating new ones.
|
|
22
27
|
|
|
23
|
-
<
|
|
28
|
+
<structured_mode>
|
|
24
29
|
When you are done, reply with the created objects.
|
|
25
30
|
Do not print the data, instead reply with inline references to the created objects.
|
|
26
31
|
Those will be later substituted with the pills representing the created objects.
|
|
@@ -40,14 +45,21 @@ const instructions = trim`
|
|
|
40
45
|
</unstructured_mode>
|
|
41
46
|
`;
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
const make = () =>
|
|
49
|
+
Blueprint.make({
|
|
50
|
+
key: BLUEPRINT_KEY,
|
|
51
|
+
name: 'Research',
|
|
52
|
+
description: 'Researches the web and creates structured data.',
|
|
53
|
+
instructions: {
|
|
54
|
+
source: Ref.make(Text.make(instructions)),
|
|
55
|
+
},
|
|
56
|
+
tools: functions.map((fn) => ToolId.make(fn.key)),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
60
|
+
key: BLUEPRINT_KEY,
|
|
61
|
+
functions,
|
|
62
|
+
make,
|
|
63
|
+
};
|
|
52
64
|
|
|
53
65
|
export default blueprint;
|
|
@@ -5,20 +5,19 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import * as Schema from 'effect/Schema';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { DatabaseService, TracingService, defineFunction } from '@dxos/functions';
|
|
8
|
+
import { Database, Obj, Ref, Relation } from '@dxos/echo';
|
|
9
|
+
import { TracingService, defineFunction } from '@dxos/functions';
|
|
11
10
|
import { log } from '@dxos/log';
|
|
12
11
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
13
12
|
import { HasSubject } from '@dxos/types';
|
|
14
13
|
import { trim } from '@dxos/util';
|
|
15
14
|
|
|
16
15
|
export default defineFunction({
|
|
17
|
-
key: 'dxos.
|
|
16
|
+
key: 'org.dxos.function.research.document-create',
|
|
18
17
|
name: 'Create research document',
|
|
19
18
|
description: 'Creates a note summarizing the research.',
|
|
20
19
|
inputSchema: Schema.Struct({
|
|
21
|
-
subject:
|
|
20
|
+
subject: Ref.Ref(Obj.Unknown).annotations({
|
|
22
21
|
description: trim`
|
|
23
22
|
ID of the object (organization, contact, etc.) for which the research was performed.
|
|
24
23
|
`,
|
|
@@ -34,7 +33,7 @@ export default defineFunction({
|
|
|
34
33
|
}),
|
|
35
34
|
}),
|
|
36
35
|
outputSchema: Schema.Struct({
|
|
37
|
-
document:
|
|
36
|
+
document: Schema.String.annotations({
|
|
38
37
|
description: 'DXN of the created document.',
|
|
39
38
|
}),
|
|
40
39
|
}),
|
|
@@ -42,14 +41,13 @@ export default defineFunction({
|
|
|
42
41
|
log.info('Creating research document', { subject, name, content });
|
|
43
42
|
|
|
44
43
|
// TODO(burdon): Auto flush before and after calling function?
|
|
45
|
-
yield*
|
|
44
|
+
yield* Database.flush({ indexes: true });
|
|
46
45
|
yield* TracingService.emitStatus({ message: 'Creating research document...' });
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
const target = (yield* DatabaseService.resolve(ArtifactId.toDXN(subject))) as Obj.Any;
|
|
47
|
+
const target = yield* Database.load(subject);
|
|
50
48
|
|
|
51
49
|
// Create document.
|
|
52
|
-
const object = yield*
|
|
50
|
+
const object = yield* Database.add(
|
|
53
51
|
Markdown.make({
|
|
54
52
|
name,
|
|
55
53
|
content,
|
|
@@ -57,7 +55,7 @@ export default defineFunction({
|
|
|
57
55
|
);
|
|
58
56
|
|
|
59
57
|
// Create relation.
|
|
60
|
-
yield*
|
|
58
|
+
yield* Database.add(
|
|
61
59
|
Relation.make(HasSubject.HasSubject, {
|
|
62
60
|
[Relation.Source]: object,
|
|
63
61
|
[Relation.Target]: target,
|
|
@@ -65,7 +63,7 @@ export default defineFunction({
|
|
|
65
63
|
}),
|
|
66
64
|
);
|
|
67
65
|
|
|
68
|
-
yield*
|
|
66
|
+
yield* Database.flush({ indexes: true });
|
|
69
67
|
log.info('Created research document', { subject, object });
|
|
70
68
|
|
|
71
69
|
return {
|
|
@@ -92,11 +92,11 @@ The following objects are already in the database, I will not submit them again,
|
|
|
92
92
|
|
|
93
93
|
I will use the following schema to construct new objects:
|
|
94
94
|
|
|
95
|
-
- type:dxos.
|
|
96
|
-
- type:dxos.
|
|
97
|
-
- type:dxos.
|
|
98
|
-
- dxn:type:dxos.
|
|
99
|
-
- dxn:type:dxos.
|
|
95
|
+
- type:org.dxos.type.organization for Alphabet Inc.
|
|
96
|
+
- type:org.dxos.type.person for Ivan Zhao
|
|
97
|
+
- type:org.dxos.type.person for Simon Last
|
|
98
|
+
- dxn:type:org.dxos.relation.employer for Ivan's employer
|
|
99
|
+
- dxn:type:org.dxos.relation.employer for Simon's employer
|
|
100
100
|
|
|
101
101
|
<status>Formatting results</status>
|
|
102
102
|
|