@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
package/src/crud/graph.ts
CHANGED
|
@@ -12,6 +12,7 @@ import * as Schema from 'effect/Schema';
|
|
|
12
12
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
13
13
|
|
|
14
14
|
import { Entity, Filter, Obj, Query, Type } from '@dxos/echo';
|
|
15
|
+
import { Database } from '@dxos/echo';
|
|
15
16
|
import {
|
|
16
17
|
ReferenceAnnotationId,
|
|
17
18
|
RelationSourceDXNId,
|
|
@@ -22,10 +23,10 @@ import {
|
|
|
22
23
|
getTypeAnnotation,
|
|
23
24
|
getTypeIdentifierAnnotation,
|
|
24
25
|
} from '@dxos/echo/internal';
|
|
25
|
-
import { type
|
|
26
|
+
import { type Queue } from '@dxos/echo-db';
|
|
26
27
|
import { isEncodedReference } from '@dxos/echo-protocol';
|
|
27
28
|
import { mapAst } from '@dxos/effect';
|
|
28
|
-
import { ContextQueueService
|
|
29
|
+
import { ContextQueueService } from '@dxos/functions';
|
|
29
30
|
import { DXN, ObjectId } from '@dxos/keys';
|
|
30
31
|
import { log } from '@dxos/log';
|
|
31
32
|
import { deepMapValues, isNonNullable, trim } from '@dxos/util';
|
|
@@ -39,7 +40,7 @@ export const Subgraph = Schema.Struct({
|
|
|
39
40
|
export interface Subgraph extends Schema.Schema.Type<typeof Subgraph> {}
|
|
40
41
|
|
|
41
42
|
export type RelatedSchema = {
|
|
42
|
-
schema:
|
|
43
|
+
schema: Type.AnyEntity;
|
|
43
44
|
kind: 'reference' | 'relation';
|
|
44
45
|
};
|
|
45
46
|
|
|
@@ -50,12 +51,9 @@ export type RelatedSchema = {
|
|
|
50
51
|
* @param schema
|
|
51
52
|
* @returns
|
|
52
53
|
*/
|
|
53
|
-
export const findRelatedSchema = async (
|
|
54
|
-
db: EchoDatabase,
|
|
55
|
-
anchor: Schema.Schema.AnyNoContext,
|
|
56
|
-
): Promise<RelatedSchema[]> => {
|
|
54
|
+
export const findRelatedSchema = async (db: Database.Database, anchor: Type.AnyEntity): Promise<RelatedSchema[]> => {
|
|
57
55
|
// TODO(dmaretskyi): Query stored schemas.
|
|
58
|
-
const allSchemas =
|
|
56
|
+
const allSchemas = await db.graph.schemaRegistry.query().run();
|
|
59
57
|
|
|
60
58
|
// TODO(dmaretskyi): Also do references.
|
|
61
59
|
return allSchemas
|
|
@@ -71,8 +69,8 @@ export const findRelatedSchema = async (
|
|
|
71
69
|
})
|
|
72
70
|
.map(
|
|
73
71
|
(schema): RelatedSchema => ({
|
|
74
|
-
schema,
|
|
75
72
|
kind: 'relation',
|
|
73
|
+
schema,
|
|
76
74
|
}),
|
|
77
75
|
);
|
|
78
76
|
};
|
|
@@ -81,7 +79,7 @@ export const findRelatedSchema = async (
|
|
|
81
79
|
* Non-strict DXN comparison.
|
|
82
80
|
* Returns true if the DXN could be resolved to the schema.
|
|
83
81
|
*/
|
|
84
|
-
const isSchemaAddressableByDxn = (schema:
|
|
82
|
+
const isSchemaAddressableByDxn = (schema: Type.AnyEntity, dxn: DXN): boolean => {
|
|
85
83
|
if (getTypeIdentifierAnnotation(schema) === dxn.toString()) {
|
|
86
84
|
return true;
|
|
87
85
|
}
|
|
@@ -108,13 +106,13 @@ export const LocalSearchToolkit = Toolkit.make(
|
|
|
108
106
|
},
|
|
109
107
|
success: Schema.Unknown,
|
|
110
108
|
failure: Schema.Never,
|
|
111
|
-
dependencies: [
|
|
109
|
+
dependencies: [Database.Service],
|
|
112
110
|
}),
|
|
113
111
|
);
|
|
114
112
|
|
|
115
113
|
export const LocalSearchHandler = LocalSearchToolkit.toLayer({
|
|
116
114
|
search_local_search: Effect.fn(function* ({ query }) {
|
|
117
|
-
const
|
|
115
|
+
const objects = yield* Database.runQuery(Query.select(Filter.text(query, { type: 'vector' })));
|
|
118
116
|
const results = [...objects];
|
|
119
117
|
|
|
120
118
|
const option = yield* Effect.serviceOption(ContextQueueService);
|
|
@@ -138,21 +136,21 @@ export const LocalSearchHandler = LocalSearchToolkit.toLayer({
|
|
|
138
136
|
class GraphWriterSchema extends Context.Tag('@dxos/assistant/GraphWriterSchema')<
|
|
139
137
|
GraphWriterSchema,
|
|
140
138
|
{
|
|
141
|
-
schema:
|
|
139
|
+
schema: Type.AnyEntity[];
|
|
142
140
|
}
|
|
143
141
|
>() {}
|
|
144
142
|
|
|
145
143
|
/**
|
|
146
144
|
* Forms typed objects that can be written to the graph database.
|
|
147
145
|
*/
|
|
148
|
-
export const makeGraphWriterToolkit = ({ schema }: { schema:
|
|
146
|
+
export const makeGraphWriterToolkit = ({ schema }: { schema: Type.AnyEntity[] }) => {
|
|
149
147
|
return Toolkit.make(
|
|
150
148
|
Tool.make('graph_writer', {
|
|
151
149
|
description: 'Write to the local graph database',
|
|
152
150
|
parameters: createExtractionSchema(schema).fields,
|
|
153
151
|
success: Schema.Unknown,
|
|
154
152
|
failure: Schema.Never,
|
|
155
|
-
dependencies: [
|
|
153
|
+
dependencies: [Database.Service, ContextQueueService],
|
|
156
154
|
}).annotateContext(Context.make(GraphWriterSchema, { schema })),
|
|
157
155
|
);
|
|
158
156
|
};
|
|
@@ -172,10 +170,10 @@ export const makeGraphWriterHandler = (
|
|
|
172
170
|
|
|
173
171
|
return toolkit.toLayer({
|
|
174
172
|
graph_writer: Effect.fn(function* (input) {
|
|
175
|
-
const { db } = yield*
|
|
173
|
+
const { db } = yield* Database.Service;
|
|
176
174
|
const { queue } = yield* ContextQueueService;
|
|
177
175
|
const data = yield* Effect.promise(() => sanitizeObjects(schema, input as any, db, queue));
|
|
178
|
-
yield* Effect.promise(() => queue.append(data as Obj.
|
|
176
|
+
yield* Effect.promise(() => queue.append(data as Obj.Unknown[]));
|
|
179
177
|
|
|
180
178
|
const dxns = data.map((obj) => Obj.getDXN(obj));
|
|
181
179
|
onAppend?.(dxns);
|
|
@@ -187,7 +185,7 @@ export const makeGraphWriterHandler = (
|
|
|
187
185
|
/**
|
|
188
186
|
* Create a schema for structured data extraction.
|
|
189
187
|
*/
|
|
190
|
-
export const createExtractionSchema = (types:
|
|
188
|
+
export const createExtractionSchema = (types: Type.AnyEntity[]) => {
|
|
191
189
|
return Schema.Struct({
|
|
192
190
|
...Object.fromEntries(
|
|
193
191
|
types.map(preprocessSchema).map((schema, index) => [
|
|
@@ -200,18 +198,18 @@ export const createExtractionSchema = (types: Schema.Schema.AnyNoContext[]) => {
|
|
|
200
198
|
});
|
|
201
199
|
};
|
|
202
200
|
|
|
203
|
-
export const getSanitizedSchemaName = (schema:
|
|
201
|
+
export const getSanitizedSchemaName = (schema: Type.AnyEntity) => {
|
|
204
202
|
return Type.getDXN(schema)!
|
|
205
203
|
.asTypeDXN()!
|
|
206
204
|
.type.replaceAll(/[^a-zA-Z0-9]+/g, '_');
|
|
207
205
|
};
|
|
208
206
|
|
|
209
207
|
export const sanitizeObjects = async (
|
|
210
|
-
types:
|
|
208
|
+
types: Type.AnyEntity[],
|
|
211
209
|
data: Record<string, readonly unknown[]>,
|
|
212
|
-
db:
|
|
210
|
+
db: Database.Database,
|
|
213
211
|
queue?: Queue,
|
|
214
|
-
): Promise<Obj.
|
|
212
|
+
): Promise<Obj.Unknown[]> => {
|
|
215
213
|
const entries = types
|
|
216
214
|
.map(
|
|
217
215
|
(type) =>
|
|
@@ -292,7 +290,7 @@ export const sanitizeObjects = async (
|
|
|
292
290
|
.filter((object) => !existingIds.has(object.data.id)); // TODO(dmaretskyi): This dissallows updating existing objects.
|
|
293
291
|
|
|
294
292
|
// TODO(dmaretskyi): Use ref resolver.
|
|
295
|
-
const
|
|
293
|
+
const dbObjects = await db.query(Query.select(Filter.id(...existingIds))).run();
|
|
296
294
|
const queueObjects = (await queue?.getObjectsById([...existingIds])) ?? [];
|
|
297
295
|
const objects = [...dbObjects, ...queueObjects].filter(isNonNullable);
|
|
298
296
|
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import Prompt from './prompt';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export const prompt: FunctionDefinition.Any = prompt$; // TODO(burdon): Temp fix for TS error.
|
|
11
|
-
}
|
|
7
|
+
export const AgentFunctions = {
|
|
8
|
+
Prompt,
|
|
9
|
+
};
|
|
@@ -5,26 +5,25 @@
|
|
|
5
5
|
import * as Array from 'effect/Array';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import * as Function from 'effect/Function';
|
|
8
|
-
import * as Match from 'effect/Match';
|
|
9
8
|
import * as Option from 'effect/Option';
|
|
10
9
|
import * as Schema from 'effect/Schema';
|
|
11
10
|
|
|
12
11
|
import { AiService, ConsolePrinter, ModelName } from '@dxos/ai';
|
|
13
12
|
import { AiSession, GenerationObserver, createToolkit } from '@dxos/assistant';
|
|
14
13
|
import { Prompt, Template } from '@dxos/blueprints';
|
|
15
|
-
import { Obj, Ref
|
|
16
|
-
import {
|
|
14
|
+
import { Database, Obj, Ref } from '@dxos/echo';
|
|
15
|
+
import { TracingService, defineFunction } from '@dxos/functions';
|
|
17
16
|
import { log } from '@dxos/log';
|
|
18
17
|
|
|
19
18
|
const DEFAULT_MODEL: ModelName = '@anthropic/claude-opus-4-0';
|
|
20
19
|
|
|
21
20
|
export default defineFunction({
|
|
22
|
-
key: 'dxos.
|
|
21
|
+
key: 'org.dxos.function.prompt',
|
|
23
22
|
name: 'Agent',
|
|
24
23
|
description: 'Agentic worker that executes a provided prompt using blueprints and tools.',
|
|
25
24
|
inputSchema: Schema.Struct({
|
|
26
|
-
prompt:
|
|
27
|
-
systemPrompt:
|
|
25
|
+
prompt: Ref.Ref(Prompt.Prompt),
|
|
26
|
+
systemPrompt: Schema.optional(Ref.Ref(Prompt.Prompt)),
|
|
28
27
|
/**
|
|
29
28
|
* @default @anthropic/claude-opus-4-0
|
|
30
29
|
*/
|
|
@@ -45,26 +44,20 @@ export default defineFunction({
|
|
|
45
44
|
// for (const key of Object.keys(data.input)) {
|
|
46
45
|
// const value = data.input[key];
|
|
47
46
|
// if (Ref.isRef(value)) {
|
|
48
|
-
// const object = yield*
|
|
47
|
+
// const object = yield* Database.load(value);
|
|
49
48
|
// input[key] = Obj.toJSON(object);
|
|
50
49
|
// } else {
|
|
51
50
|
// input[key] = JSON.stringify(value);
|
|
52
51
|
// }
|
|
53
52
|
// }
|
|
54
|
-
const input = yield* Match.value(data.input).pipe(
|
|
55
|
-
Match.when(
|
|
56
|
-
(value: any) => Ref.isRef(value),
|
|
57
|
-
Effect.fnUntraced(function* (ref) {
|
|
58
|
-
const object = yield* DatabaseService.load(ref);
|
|
59
|
-
return Obj.toJSON(object as Obj.Any);
|
|
60
|
-
}),
|
|
61
|
-
),
|
|
62
|
-
Match.orElse(() => Effect.succeed(data.input)),
|
|
63
|
-
);
|
|
64
53
|
|
|
65
|
-
yield*
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
const input = yield* Ref.isRef(data.input)
|
|
55
|
+
? Database.load(data.input).pipe(Effect.map(Obj.toJSON))
|
|
56
|
+
: Effect.succeed(data.input);
|
|
57
|
+
|
|
58
|
+
yield* Database.flush({ indexes: true });
|
|
59
|
+
const prompt = yield* Database.load(data.prompt);
|
|
60
|
+
const systemPrompt = data.systemPrompt ? yield* Database.load(data.systemPrompt) : undefined;
|
|
68
61
|
yield* TracingService.emitStatus({ message: `Running ${prompt.id}` });
|
|
69
62
|
|
|
70
63
|
log.info('starting agent', { prompt: prompt.id, input });
|
|
@@ -72,23 +65,24 @@ export default defineFunction({
|
|
|
72
65
|
const blueprints = yield* Function.pipe(
|
|
73
66
|
prompt.blueprints,
|
|
74
67
|
Array.appendAll(systemPrompt?.blueprints ?? []),
|
|
75
|
-
Effect.forEach(
|
|
68
|
+
Effect.forEach(Database.loadOption),
|
|
76
69
|
Effect.map(Array.filter(Option.isSome)),
|
|
77
70
|
Effect.map(Array.map((option) => option.value)),
|
|
78
71
|
);
|
|
72
|
+
const toolkit = yield* createToolkit({ blueprints });
|
|
73
|
+
|
|
79
74
|
const objects = yield* Function.pipe(
|
|
80
75
|
prompt.context,
|
|
81
76
|
Array.appendAll(systemPrompt?.context ?? []),
|
|
82
|
-
Effect.forEach(
|
|
77
|
+
Effect.forEach(Database.loadOption),
|
|
83
78
|
Effect.map(Array.filter(Option.isSome)),
|
|
84
79
|
Effect.map(Array.map((option) => option.value)),
|
|
85
80
|
);
|
|
86
|
-
const toolkit = yield* createToolkit({ blueprints });
|
|
87
81
|
|
|
88
|
-
const promptInstructions = yield*
|
|
82
|
+
const promptInstructions = yield* Database.load(prompt.instructions.source);
|
|
89
83
|
const promptText = Template.process(promptInstructions.content, input);
|
|
90
84
|
|
|
91
|
-
const systemInstructions = systemPrompt ? yield*
|
|
85
|
+
const systemInstructions = systemPrompt ? yield* Database.load(systemPrompt.instructions.source) : undefined;
|
|
92
86
|
const systemText = systemInstructions ? Template.process(systemInstructions.content, {}) : undefined;
|
|
93
87
|
|
|
94
88
|
const session = new AiSession();
|
|
@@ -97,7 +91,7 @@ export default defineFunction({
|
|
|
97
91
|
prompt: promptText,
|
|
98
92
|
system: systemText,
|
|
99
93
|
blueprints,
|
|
100
|
-
objects: objects as Obj.
|
|
94
|
+
objects: objects as Obj.Unknown[],
|
|
101
95
|
toolkit,
|
|
102
96
|
observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'agent' })),
|
|
103
97
|
})
|