@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
|
@@ -21,7 +21,7 @@ import * as Schema from 'effect/Schema';
|
|
|
21
21
|
import { Obj } from '@dxos/echo';
|
|
22
22
|
import { CredentialsService, TracingService, defineFunction } from '@dxos/functions';
|
|
23
23
|
import { log } from '@dxos/log';
|
|
24
|
-
import {
|
|
24
|
+
import { Message } from '@dxos/types';
|
|
25
25
|
|
|
26
26
|
// TODO(dmaretskyi): Extract.
|
|
27
27
|
const TimeRange = class extends Schema.String.pipe(Schema.pattern(/\d+(s|m|h|d)/)).annotations({
|
|
@@ -71,7 +71,7 @@ const DEFAULT_IGNORE_USERNAMES = ['GitHub', 'Needle'];
|
|
|
71
71
|
type Thread = {
|
|
72
72
|
discordChannelId: string;
|
|
73
73
|
name?: string;
|
|
74
|
-
messages:
|
|
74
|
+
messages: Message.Message[];
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
export default defineFunction({
|
|
@@ -133,7 +133,7 @@ export default defineFunction({
|
|
|
133
133
|
throw new Error('no channels found');
|
|
134
134
|
}
|
|
135
135
|
for (const channel of channels) {
|
|
136
|
-
|
|
136
|
+
log.info('channel', { id: channel.id, name: 'name' in channel ? channel.name : undefined });
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
yield* TracingService.emitStatus({ message: `Will fetch from channels: ${channels.length}` });
|
|
@@ -141,9 +141,9 @@ export default defineFunction({
|
|
|
141
141
|
const threads = yield* Effect.forEach(
|
|
142
142
|
channels,
|
|
143
143
|
Effect.fnUntraced(function* (channel) {
|
|
144
|
-
const allMessages:
|
|
144
|
+
const allMessages: Message.Message[] = [];
|
|
145
145
|
|
|
146
|
-
let lastMessage: Option.Option<
|
|
146
|
+
let lastMessage: Option.Option<Message.Message> = Option.none();
|
|
147
147
|
while (true) {
|
|
148
148
|
const { id: lastId = undefined } = Function.pipe(
|
|
149
149
|
lastMessage,
|
|
@@ -188,7 +188,7 @@ export default defineFunction({
|
|
|
188
188
|
messages: allMessages
|
|
189
189
|
.filter((message) => !message.sender.name || !ignoreUsernames.includes(message.sender.name))
|
|
190
190
|
.filter((message) =>
|
|
191
|
-
message.blocks.some((block) => block._tag === 'text' && block.text.trim().length > 0),
|
|
191
|
+
message.blocks.some((block: any) => block._tag === 'text' && block.text.trim().length > 0),
|
|
192
192
|
),
|
|
193
193
|
} satisfies Thread;
|
|
194
194
|
}),
|
|
@@ -222,8 +222,9 @@ const parseSnowflake = (snowflake: string): Date => {
|
|
|
222
222
|
return new Date(Number((BigInt(snowflake) >> 22n) + discordEpoch));
|
|
223
223
|
};
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
// TODO(burdon): Move to @dxos/types.
|
|
226
|
+
const makeMessage = (message: MessageResponse): Message.Message =>
|
|
227
|
+
Obj.make(Message.Message, {
|
|
227
228
|
[Obj.Meta]: {
|
|
228
229
|
keys: [
|
|
229
230
|
{ id: message.id, source: 'discord.com' },
|
|
@@ -243,8 +244,8 @@ const serializeThread = (thread: Thread): string => {
|
|
|
243
244
|
.map(
|
|
244
245
|
(message) =>
|
|
245
246
|
` ${message.sender.name}: ${message.blocks
|
|
246
|
-
.filter((block) => block._tag === 'text')
|
|
247
|
-
.map((block) => block.text)
|
|
247
|
+
.filter((block: any) => block._tag === 'text')
|
|
248
|
+
.map((block: any) => block.text)
|
|
248
249
|
.join(' ')}`,
|
|
249
250
|
)
|
|
250
251
|
.join('\n')}\n</thread>`;
|
|
@@ -6,7 +6,7 @@ import * as HttpClient from '@effect/platform/HttpClient';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import * as Schema from 'effect/Schema';
|
|
8
8
|
|
|
9
|
-
import { defineFunction, withAuthorization } from '@dxos/functions';
|
|
9
|
+
import { CredentialsService, defineFunction, withAuthorization } from '@dxos/functions';
|
|
10
10
|
|
|
11
11
|
export default defineFunction({
|
|
12
12
|
key: 'dxos.org/function/github/fetch-prs',
|
|
@@ -21,7 +21,8 @@ export default defineFunction({
|
|
|
21
21
|
}),
|
|
22
22
|
}),
|
|
23
23
|
handler: Effect.fnUntraced(function* ({ data }) {
|
|
24
|
-
const
|
|
24
|
+
const credential = yield* CredentialsService.getCredential({ service: 'github.com' });
|
|
25
|
+
const client = yield* HttpClient.HttpClient.pipe(Effect.map(withAuthorization(credential.apiKey!)));
|
|
25
26
|
|
|
26
27
|
const response = yield* client.get(`https://api.github.com/repos/${data.owner}/${data.repo}/pulls`);
|
|
27
28
|
const json: any = yield* response.json;
|
package/src/blueprints/index.ts
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
5
|
+
export * from './design';
|
|
6
|
+
export * from './discord';
|
|
7
|
+
export * from './project';
|
|
8
|
+
export * from './linear';
|
|
9
|
+
export * from './markdown';
|
|
10
|
+
export * from './planning';
|
|
11
|
+
export * from './research';
|
|
12
|
+
export * from './websearch';
|
|
13
|
+
export * from './browser';
|
|
14
|
+
export * from './database';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { ToolId } from '@dxos/ai';
|
|
6
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
7
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
8
|
+
import { Ref } from '@dxos/echo';
|
|
9
|
+
import { Text } from '@dxos/schema';
|
|
10
|
+
import { trim } from '@dxos/util';
|
|
11
|
+
|
|
12
|
+
import { LinearFunctions } from './functions';
|
|
13
|
+
|
|
14
|
+
const BLUEPRINT_KEY = 'dxos.org/blueprint/linear';
|
|
15
|
+
|
|
16
|
+
const functions = Object.values(LinearFunctions);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Agent prompt instructions for managing hierarchical task lists.
|
|
20
|
+
*/
|
|
21
|
+
const instructions = trim`
|
|
22
|
+
You are able to sync Linear workspaces.
|
|
23
|
+
Sometimes sync does not complete in one go and you need to call the function again.
|
|
24
|
+
|
|
25
|
+
Known workspaces:
|
|
26
|
+
|
|
27
|
+
DXOS teamId: 1127c63a-6f77-4725-9229-50f6cd47321c
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const make = () =>
|
|
31
|
+
Blueprint.make({
|
|
32
|
+
key: BLUEPRINT_KEY,
|
|
33
|
+
name: 'Linear',
|
|
34
|
+
description: 'Syncs Linear workspaces.',
|
|
35
|
+
instructions: {
|
|
36
|
+
source: Ref.make(Text.make(instructions)),
|
|
37
|
+
},
|
|
38
|
+
tools: functions.map((tool) => ToolId.make(tool.key)),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
42
|
+
key: BLUEPRINT_KEY,
|
|
43
|
+
functions,
|
|
44
|
+
make,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default blueprint;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
9
|
+
import { Obj, Query } from '@dxos/echo';
|
|
10
|
+
import { Database } from '@dxos/echo';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
|
+
import { FunctionInvocationService } from '@dxos/functions';
|
|
13
|
+
import { Person, Pipeline, Task } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { LINEAR_ID_KEY, default as fetchLinearIssues } from './sync-issues';
|
|
16
|
+
|
|
17
|
+
const TestLayer = AssistantTestLayer({
|
|
18
|
+
functions: [fetchLinearIssues],
|
|
19
|
+
types: [Task.Task, Person.Person, Pipeline.Pipeline],
|
|
20
|
+
credentials: [{ service: 'linear.app', apiKey: process.env.LINEAR_API_KEY }],
|
|
21
|
+
tracing: 'pretty',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe.skip('Linear', { timeout: 600_000 }, () => {
|
|
25
|
+
it.effect(
|
|
26
|
+
'sync',
|
|
27
|
+
Effect.fnUntraced(
|
|
28
|
+
function* (_) {
|
|
29
|
+
yield* Database.flush({ indexes: true });
|
|
30
|
+
|
|
31
|
+
yield* FunctionInvocationService.invokeFunction(fetchLinearIssues, {
|
|
32
|
+
team: '1127c63a-6f77-4725-9229-50f6cd47321c',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const persons = yield* Database.runQuery(Query.type(Person.Person));
|
|
36
|
+
console.log('people', {
|
|
37
|
+
count: persons.length,
|
|
38
|
+
people: persons.map((_) => `(${_.id}) ${Obj.getLabel(_)} [${Obj.getKeys(_, LINEAR_ID_KEY)[0]?.id}]`),
|
|
39
|
+
});
|
|
40
|
+
const projects = yield* Database.runQuery(Query.type(Pipeline.Pipeline));
|
|
41
|
+
console.log('projects', {
|
|
42
|
+
count: projects.length,
|
|
43
|
+
projects: projects.map((_) => `(${_.id}) ${Obj.getLabel(_)} [${Obj.getKeys(_, LINEAR_ID_KEY)[0]?.id}]`),
|
|
44
|
+
});
|
|
45
|
+
const tasks = yield* Database.runQuery(Query.type(Task.Task));
|
|
46
|
+
console.log('tasks', {
|
|
47
|
+
count: tasks.length,
|
|
48
|
+
tasks: tasks.map((_) => `(${_.id}) ${Obj.getLabel(_)} [${Obj.getKeys(_, LINEAR_ID_KEY)[0]?.id}]`),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
yield* Database.flush({ indexes: true });
|
|
52
|
+
},
|
|
53
|
+
Effect.provide(TestLayer),
|
|
54
|
+
TestHelpers.taggedTest('sync'),
|
|
55
|
+
TestHelpers.provideTestContext,
|
|
56
|
+
),
|
|
57
|
+
);
|
|
58
|
+
});
|
|
@@ -10,12 +10,13 @@ import * as Function from 'effect/Function';
|
|
|
10
10
|
import * as Schema from 'effect/Schema';
|
|
11
11
|
|
|
12
12
|
import { Filter, Obj, Query, Ref, type Type } from '@dxos/echo';
|
|
13
|
-
import {
|
|
13
|
+
import { Database } from '@dxos/echo';
|
|
14
|
+
import { CredentialsService, defineFunction, withAuthorization } from '@dxos/functions';
|
|
14
15
|
import { log } from '@dxos/log';
|
|
15
|
-
import {
|
|
16
|
+
import { Person, Pipeline, Task } from '@dxos/types';
|
|
16
17
|
|
|
17
|
-
import { syncObjects } from '
|
|
18
|
-
import { graphqlRequestBody } from '
|
|
18
|
+
import { syncObjects } from '../../../sync';
|
|
19
|
+
import { graphqlRequestBody } from '../../../util';
|
|
19
20
|
|
|
20
21
|
const queryIssues = `
|
|
21
22
|
query Issues($teamId: String!, $after: DateTimeOrDuration!) {
|
|
@@ -35,7 +36,7 @@ query Issues($teamId: String!, $after: DateTimeOrDuration!) {
|
|
|
35
36
|
updatedAt
|
|
36
37
|
description
|
|
37
38
|
assignee { id, name }
|
|
38
|
-
state {
|
|
39
|
+
state {
|
|
39
40
|
name
|
|
40
41
|
}
|
|
41
42
|
project {
|
|
@@ -84,10 +85,11 @@ export default defineFunction({
|
|
|
84
85
|
}),
|
|
85
86
|
}),
|
|
86
87
|
handler: Effect.fnUntraced(function* ({ data }) {
|
|
87
|
-
const
|
|
88
|
+
const credential = yield* CredentialsService.getCredential({ service: 'linear.app' });
|
|
89
|
+
const client = yield* HttpClient.HttpClient.pipe(Effect.map(withAuthorization(credential.apiKey!)));
|
|
88
90
|
|
|
89
91
|
// Get the timestamp that was previosly synced.
|
|
90
|
-
const after = yield* getLatestUpdateTimestamp(data.team,
|
|
92
|
+
const after = yield* getLatestUpdateTimestamp(data.team, Task.Task);
|
|
91
93
|
log.info('will fetch', { after });
|
|
92
94
|
|
|
93
95
|
// Fetch the issues that have changed since the last sync.
|
|
@@ -113,9 +115,9 @@ export default defineFunction({
|
|
|
113
115
|
|
|
114
116
|
const getLatestUpdateTimestamp: (
|
|
115
117
|
teamId: string,
|
|
116
|
-
dataType: Type.
|
|
117
|
-
) => Effect.Effect<string, never,
|
|
118
|
-
const
|
|
118
|
+
dataType: Type.AnyObj,
|
|
119
|
+
) => Effect.Effect<string, never, Database.Service> = Effect.fnUntraced(function* (teamId, dataType) {
|
|
120
|
+
const existingTasks = yield* Database.runQuery(
|
|
119
121
|
Query.type(dataType).select(Filter.foreignKeys(dataType, [{ source: LINEAR_TEAM_ID_KEY, id: teamId }])),
|
|
120
122
|
);
|
|
121
123
|
return Function.pipe(
|
|
@@ -126,8 +128,8 @@ const getLatestUpdateTimestamp: (
|
|
|
126
128
|
);
|
|
127
129
|
});
|
|
128
130
|
|
|
129
|
-
const mapLinearPerson = (person: LinearPerson, { teamId }: { teamId: string }):
|
|
130
|
-
Obj.make(
|
|
131
|
+
const mapLinearPerson = (person: LinearPerson, { teamId }: { teamId: string }): Person.Person =>
|
|
132
|
+
Obj.make(Person.Person, {
|
|
131
133
|
[Obj.Meta]: {
|
|
132
134
|
keys: [
|
|
133
135
|
{
|
|
@@ -143,8 +145,8 @@ const mapLinearPerson = (person: LinearPerson, { teamId }: { teamId: string }):
|
|
|
143
145
|
nickname: person.name,
|
|
144
146
|
});
|
|
145
147
|
|
|
146
|
-
const mapLinearIssue = (issue: LinearIssue, { teamId }: { teamId: string }):
|
|
147
|
-
Obj.make(
|
|
148
|
+
const mapLinearIssue = (issue: LinearIssue, { teamId }: { teamId: string }): Task.Task =>
|
|
149
|
+
Obj.make(Task.Task, {
|
|
148
150
|
[Obj.Meta]: {
|
|
149
151
|
keys: [
|
|
150
152
|
{
|
|
@@ -170,7 +172,7 @@ const mapLinearIssue = (issue: LinearIssue, { teamId }: { teamId: string }): Dat
|
|
|
170
172
|
project: !issue.project
|
|
171
173
|
? undefined
|
|
172
174
|
: Ref.make(
|
|
173
|
-
|
|
175
|
+
Pipeline.make({
|
|
174
176
|
[Obj.Meta]: {
|
|
175
177
|
keys: [
|
|
176
178
|
{
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
6
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
|
+
import { Text } from '@dxos/schema';
|
|
9
|
+
import { trim } from '@dxos/util';
|
|
10
|
+
|
|
11
|
+
import { MarkdownFunctions } from './functions';
|
|
12
|
+
|
|
13
|
+
const BLUEPRINT_KEY = 'dxos.org/blueprint/markdown';
|
|
14
|
+
|
|
15
|
+
const instructions = trim`
|
|
16
|
+
You read, write & create markdown documents.
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
const functions = Object.values(MarkdownFunctions);
|
|
20
|
+
|
|
21
|
+
const make = () =>
|
|
22
|
+
Blueprint.make({
|
|
23
|
+
key: BLUEPRINT_KEY,
|
|
24
|
+
name: 'Markdown',
|
|
25
|
+
description: 'Work with markdown documents.',
|
|
26
|
+
instructions: {
|
|
27
|
+
source: Ref.make(Text.make(instructions)),
|
|
28
|
+
},
|
|
29
|
+
tools: Blueprint.toolDefinitions({ functions }),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
33
|
+
key: BLUEPRINT_KEY,
|
|
34
|
+
functions,
|
|
35
|
+
make,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default blueprint;
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { Database, Ref } from '@dxos/echo';
|
|
9
|
+
import { defineFunction } from '@dxos/functions';
|
|
10
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
+
|
|
12
|
+
export default defineFunction({
|
|
13
|
+
key: 'dxos.org/function/markdown/create',
|
|
14
|
+
name: 'Create markdown document',
|
|
15
|
+
description: 'Creates a new markdown document.',
|
|
16
|
+
inputSchema: Schema.Struct({
|
|
17
|
+
name: Schema.String.annotations({
|
|
18
|
+
description: 'Name of the document.',
|
|
19
|
+
}),
|
|
20
|
+
content: Schema.String.annotations({
|
|
21
|
+
description: 'Content of the document.',
|
|
22
|
+
}),
|
|
23
|
+
}),
|
|
24
|
+
outputSchema: Schema.Void,
|
|
25
|
+
handler: Effect.fn(function* ({ data: { name, content } }) {
|
|
26
|
+
const doc = yield* Database.add(Markdown.make({ name, content }));
|
|
27
|
+
return { document: Ref.make(doc) };
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { Database, Ref } from '@dxos/echo';
|
|
9
|
+
import { 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:
|
|
16
|
+
'Read markdown document. Note that result is a snapshot in time, and might have changed since the document was last read.',
|
|
17
|
+
inputSchema: Schema.Struct({
|
|
18
|
+
document: Ref.Ref(Markdown.Document).annotations({
|
|
19
|
+
description: 'The document to read.',
|
|
20
|
+
}),
|
|
21
|
+
}),
|
|
22
|
+
outputSchema: Schema.Struct({
|
|
23
|
+
content: Schema.String,
|
|
24
|
+
}),
|
|
25
|
+
handler: Effect.fn(function* ({ data: { document } }) {
|
|
26
|
+
const { content } = yield* document.pipe(
|
|
27
|
+
Database.load,
|
|
28
|
+
Effect.flatMap((doc) => doc.content.pipe(Database.load)),
|
|
29
|
+
);
|
|
30
|
+
return { content };
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import * as Schema from 'effect/Schema';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Database, Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { defineFunction } from '@dxos/functions';
|
|
10
10
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
11
|
|
|
12
12
|
export default defineFunction({
|
|
@@ -14,7 +14,7 @@ export default defineFunction({
|
|
|
14
14
|
name: 'Update markdown',
|
|
15
15
|
description: 'Updates the entire contents of the markdown document.',
|
|
16
16
|
inputSchema: Schema.Struct({
|
|
17
|
-
|
|
17
|
+
doc: Ref.Ref(Markdown.Document).annotations({
|
|
18
18
|
description: 'The ID of the document to write.',
|
|
19
19
|
}),
|
|
20
20
|
content: Schema.String.annotations({
|
|
@@ -22,9 +22,11 @@ export default defineFunction({
|
|
|
22
22
|
}),
|
|
23
23
|
}),
|
|
24
24
|
outputSchema: Schema.Void,
|
|
25
|
-
handler: Effect.fn(function* ({ data: {
|
|
26
|
-
const
|
|
27
|
-
const text = yield*
|
|
28
|
-
text
|
|
25
|
+
handler: Effect.fn(function* ({ data: { doc, content } }) {
|
|
26
|
+
const document = yield* Database.load(doc);
|
|
27
|
+
const text = yield* Database.load(document.content);
|
|
28
|
+
Obj.change(text, (t) => {
|
|
29
|
+
t.content = content;
|
|
30
|
+
});
|
|
29
31
|
}),
|
|
30
32
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
6
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
+
|
|
8
|
+
import { PlanningFunctions } from './functions';
|
|
9
|
+
|
|
10
|
+
const BLUEPRINT_KEY = 'dxos.org/blueprint/planning';
|
|
11
|
+
|
|
12
|
+
const functions = Object.values(PlanningFunctions);
|
|
13
|
+
|
|
14
|
+
const make = () =>
|
|
15
|
+
Blueprint.make({
|
|
16
|
+
key: BLUEPRINT_KEY,
|
|
17
|
+
name: 'Planning',
|
|
18
|
+
description: 'Plans and tracks complex tasks with artifact management.',
|
|
19
|
+
tools: Blueprint.toolDefinitions({ functions: [PlanningFunctions.UpdateTasks] }),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
23
|
+
key: BLUEPRINT_KEY,
|
|
24
|
+
functions,
|
|
25
|
+
make,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default blueprint;
|