@dxos/assistant-toolkit 0.8.4-main.2c6827d → 0.8.4-main.3eb6e50203
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 +1410 -480
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/testing/index.mjs +44 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/types/src/blueprints/design/design-blueprint.d.ts +17 -3
- package/dist/types/src/blueprints/design/design-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/design/index.d.ts +1 -1
- package/dist/types/src/blueprints/design/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts +13 -13
- package/dist/types/src/blueprints/discord/discord-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/discord/index.d.ts +1 -1
- package/dist/types/src/blueprints/discord/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +1 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/index.d.ts +1 -1
- package/dist/types/src/blueprints/linear/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts +13 -13
- package/dist/types/src/blueprints/linear/linear-blueprint.d.ts.map +1 -1
- 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/markdown/markdown-blueprint.d.ts +18 -0
- package/dist/types/src/blueprints/markdown/markdown-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/planning/index.d.ts +1 -1
- package/dist/types/src/blueprints/planning/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts +17 -3
- package/dist/types/src/blueprints/planning/planning-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/research/index.d.ts +1 -1
- package/dist/types/src/blueprints/research/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/research/research-blueprint.d.ts +17 -3
- package/dist/types/src/blueprints/research/research-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/testing.d.ts +2 -4
- package/dist/types/src/blueprints/testing.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/index.d.ts +1 -1
- package/dist/types/src/blueprints/websearch/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts +17 -3
- package/dist/types/src/blueprints/websearch/websearch-blueprint.d.ts.map +1 -1
- package/dist/types/src/chat/Chat.d.ts +31 -0
- package/dist/types/src/chat/Chat.d.ts.map +1 -0
- package/dist/types/src/chat/index.d.ts +2 -0
- package/dist/types/src/chat/index.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/prompt.d.ts +71 -4
- package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
- package/dist/types/src/functions/document/create.d.ts +6 -0
- package/dist/types/src/functions/document/create.d.ts.map +1 -0
- package/dist/types/src/functions/document/index.d.ts +20 -3
- package/dist/types/src/functions/document/index.d.ts.map +1 -1
- package/dist/types/src/functions/document/read.d.ts +8 -1
- package/dist/types/src/functions/document/read.d.ts.map +1 -1
- package/dist/types/src/functions/document/update.d.ts +8 -1
- package/dist/types/src/functions/document/update.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +125 -124
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/index.d.ts +125 -124
- 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/github/fetch-prs.d.ts.map +1 -1
- package/dist/types/src/functions/linear/index.d.ts +1 -1
- package/dist/types/src/functions/linear/sync-issues.d.ts +1 -1
- package/dist/types/src/functions/linear/sync-issues.d.ts.map +1 -1
- package/dist/types/src/functions/research/document-create.d.ts +1 -1
- package/dist/types/src/functions/research/document-create.d.ts.map +1 -1
- package/dist/types/src/functions/research/index.d.ts +2 -2
- package/dist/types/src/functions/research/research-graph.d.ts +9 -8
- package/dist/types/src/functions/research/research-graph.d.ts.map +1 -1
- package/dist/types/src/functions/research/research.d.ts +1 -1
- package/dist/types/src/functions/research/research.d.ts.map +1 -1
- package/dist/types/src/functions/research/types.d.ts +1 -1
- package/dist/types/src/functions/research/types.d.ts.map +1 -1
- package/dist/types/src/functions/tasks/index.d.ts +16 -2
- package/dist/types/src/functions/tasks/index.d.ts.map +1 -1
- package/dist/types/src/functions/tasks/read.d.ts +8 -1
- package/dist/types/src/functions/tasks/read.d.ts.map +1 -1
- package/dist/types/src/functions/tasks/update.d.ts +8 -1
- package/dist/types/src/functions/tasks/update.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +4 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/initiative/Initiative.d.ts +41 -0
- package/dist/types/src/initiative/Initiative.d.ts.map +1 -0
- package/dist/types/src/initiative/blueprint.d.ts +153 -0
- package/dist/types/src/initiative/blueprint.d.ts.map +1 -0
- package/dist/types/src/initiative/functions/addArtifact.d.ts +6 -0
- package/dist/types/src/initiative/functions/addArtifact.d.ts.map +1 -0
- package/dist/types/src/initiative/functions/agent.d.ts +62 -0
- package/dist/types/src/initiative/functions/agent.d.ts.map +1 -0
- package/dist/types/src/initiative/functions/getContext.d.ts +13 -0
- package/dist/types/src/initiative/functions/getContext.d.ts.map +1 -0
- package/dist/types/src/initiative/functions/index.d.ts +5 -0
- package/dist/types/src/initiative/functions/index.d.ts.map +1 -0
- package/dist/types/src/initiative/functions/qualifier.d.ts +60 -0
- package/dist/types/src/initiative/functions/qualifier.d.ts.map +1 -0
- package/dist/types/src/initiative/index.d.ts +6 -0
- package/dist/types/src/initiative/index.d.ts.map +1 -0
- package/dist/types/src/initiative/initiative.test.d.ts +2 -0
- package/dist/types/src/initiative/initiative.test.d.ts.map +1 -0
- package/dist/types/src/initiative/plan.d.ts +77 -0
- package/dist/types/src/initiative/plan.d.ts.map +1 -0
- package/dist/types/src/initiative/util.d.ts +29 -0
- package/dist/types/src/initiative/util.d.ts.map +1 -0
- package/dist/types/src/planning/blueprint.d.ts +18 -0
- package/dist/types/src/planning/blueprint.d.ts.map +1 -0
- package/dist/types/src/planning/functions/index.d.ts +2 -0
- package/dist/types/src/planning/functions/index.d.ts.map +1 -0
- package/dist/types/src/planning/functions/update-tasks.d.ts +9 -0
- package/dist/types/src/planning/functions/update-tasks.d.ts.map +1 -0
- package/dist/types/src/planning/index.d.ts +3 -0
- package/dist/types/src/planning/index.d.ts.map +1 -0
- 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 +1 -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/AssistantToolkit.d.ts +31 -5
- package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +1 -1
- package/dist/types/src/toolkits/SystemToolkit.d.ts +42 -10
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +1 -1
- 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 -0
- package/dist/types/src/toolkits/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -40
- package/src/blueprints/design/design-blueprint.test.ts +14 -17
- package/src/blueprints/design/design-blueprint.ts +2 -4
- package/src/blueprints/design/index.ts +1 -1
- package/src/blueprints/discord/discord-blueprint.ts +2 -4
- package/src/blueprints/discord/index.ts +1 -1
- package/src/blueprints/index.ts +1 -0
- package/src/blueprints/linear/index.ts +1 -1
- package/src/blueprints/linear/linear-blueprint.ts +2 -4
- package/src/blueprints/markdown/index.ts +7 -0
- package/src/blueprints/markdown/markdown-blueprint.ts +24 -0
- package/src/blueprints/planning/index.ts +1 -1
- package/src/blueprints/planning/planning-blueprint.test.ts +12 -16
- package/src/blueprints/planning/planning-blueprint.ts +2 -4
- package/src/blueprints/research/index.ts +1 -1
- package/src/blueprints/research/research-blueprint.ts +2 -4
- package/src/blueprints/testing.ts +2 -6
- package/src/blueprints/websearch/index.ts +2 -1
- package/src/blueprints/websearch/websearch-blueprint.ts +2 -4
- package/src/chat/Chat.ts +45 -0
- package/src/chat/index.ts +5 -0
- package/src/crud/graph.test.ts +6 -29
- package/src/crud/graph.ts +32 -40
- package/src/experimental/feed.test.ts +4 -9
- package/src/functions/agent/prompt.ts +15 -13
- package/src/functions/discord/fetch-messages.test.ts +4 -8
- package/src/functions/discord/fetch-messages.ts +1 -1
- package/src/functions/document/create.ts +29 -0
- package/src/functions/document/index.ts +2 -1
- package/src/functions/document/read.ts +11 -8
- package/src/functions/document/update.ts +9 -7
- package/src/functions/entity-extraction/entity-extraction.conversations.json +1 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +11 -29
- package/src/functions/entity-extraction/entity-extraction.ts +41 -24
- package/src/functions/exa/mock.ts +1 -1
- package/src/functions/github/fetch-prs.ts +3 -2
- package/src/functions/linear/linear.test.ts +18 -43
- package/src/functions/linear/sync-issues.ts +9 -7
- package/src/functions/research/document-create.ts +9 -11
- package/src/functions/research/research-graph.ts +13 -11
- package/src/functions/research/research.conversations.json +1 -1
- package/src/functions/research/research.test.ts +29 -64
- package/src/functions/research/research.ts +15 -23
- package/src/functions/research/types.ts +3 -3
- package/src/functions/tasks/read.ts +6 -6
- package/src/functions/tasks/update.ts +6 -6
- package/src/index.ts +4 -2
- package/src/initiative/Initiative.ts +61 -0
- package/src/initiative/blueprint.ts +60 -0
- package/src/initiative/functions/addArtifact.ts +41 -0
- package/src/initiative/functions/agent.ts +77 -0
- package/src/initiative/functions/getContext.ts +62 -0
- package/src/initiative/functions/index.ts +8 -0
- package/src/initiative/functions/qualifier.ts +98 -0
- package/src/initiative/index.ts +9 -0
- package/src/initiative/initiative.test.ts +584 -0
- package/src/initiative/plan.ts +107 -0
- package/src/initiative/util.ts +137 -0
- package/src/planning/blueprint.ts +14 -0
- package/src/planning/functions/index.ts +5 -0
- package/src/planning/functions/update-tasks.ts +168 -0
- package/src/planning/index.ts +6 -0
- package/src/sync/sync.ts +38 -30
- package/src/testing/index.ts +1 -1
- package/src/{plugins.tsx → testing/plugins.tsx} +14 -13
- package/src/toolkits/AssistantToolkit.conversations.json +1 -1
- package/src/toolkits/AssistantToolkit.test.ts +27 -43
- package/src/toolkits/AssistantToolkit.ts +31 -8
- package/src/toolkits/SystemToolkit.ts +100 -32
- package/src/toolkits/WebToolkit.ts +34 -0
- package/src/toolkits/index.ts +1 -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/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/{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/{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/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/assistant-toolkit",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.3eb6e50203",
|
|
4
4
|
"description": "Assistant toolkit, definitions, and utilities.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"type": "module",
|
|
@@ -11,57 +15,58 @@
|
|
|
11
15
|
".": {
|
|
12
16
|
"source": "./src/index.ts",
|
|
13
17
|
"types": "./dist/types/src/index.d.ts",
|
|
14
|
-
"
|
|
15
|
-
|
|
18
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
19
|
+
},
|
|
20
|
+
"./testing": {
|
|
21
|
+
"source": "./src/testing/index.ts",
|
|
22
|
+
"types": "./dist/types/src/testing/index.d.ts",
|
|
23
|
+
"default": "./dist/lib/neutral/testing/index.mjs"
|
|
16
24
|
}
|
|
17
25
|
},
|
|
18
|
-
"types": "dist/types/src/index.d.ts",
|
|
19
|
-
"typesVersions": {
|
|
20
|
-
"*": {}
|
|
21
|
-
},
|
|
22
26
|
"files": [
|
|
23
27
|
"dist",
|
|
24
28
|
"src"
|
|
25
29
|
],
|
|
26
30
|
"dependencies": {
|
|
27
|
-
"@effect/ai": "0.
|
|
28
|
-
"@effect/ai-anthropic": "0.
|
|
29
|
-
"@effect/experimental": "0.
|
|
30
|
-
"@effect/platform": "
|
|
31
|
-
"dfx": "^0.
|
|
31
|
+
"@effect/ai": "0.33.2",
|
|
32
|
+
"@effect/ai-anthropic": "0.23.0",
|
|
33
|
+
"@effect/experimental": "0.58.0",
|
|
34
|
+
"@effect/platform": "0.94.4",
|
|
35
|
+
"dfx": "^0.127.0",
|
|
32
36
|
"exa-js": "^1.5.12",
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/echo-
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/effect": "0.8.4-main.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/functions": "0.8.4-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/keys": "0.8.4-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
37
|
+
"@dxos/ai": "0.8.4-main.3eb6e50203",
|
|
38
|
+
"@dxos/app-framework": "0.8.4-main.3eb6e50203",
|
|
39
|
+
"@dxos/blueprints": "0.8.4-main.3eb6e50203",
|
|
40
|
+
"@dxos/context": "0.8.4-main.3eb6e50203",
|
|
41
|
+
"@dxos/echo": "0.8.4-main.3eb6e50203",
|
|
42
|
+
"@dxos/conductor": "0.8.4-main.3eb6e50203",
|
|
43
|
+
"@dxos/client-protocol": "0.8.4-main.3eb6e50203",
|
|
44
|
+
"@dxos/echo-db": "0.8.4-main.3eb6e50203",
|
|
45
|
+
"@dxos/echo-protocol": "0.8.4-main.3eb6e50203",
|
|
46
|
+
"@dxos/edge-client": "0.8.4-main.3eb6e50203",
|
|
47
|
+
"@dxos/effect": "0.8.4-main.3eb6e50203",
|
|
48
|
+
"@dxos/errors": "0.8.4-main.3eb6e50203",
|
|
49
|
+
"@dxos/functions": "0.8.4-main.3eb6e50203",
|
|
50
|
+
"@dxos/functions-runtime": "0.8.4-main.3eb6e50203",
|
|
51
|
+
"@dxos/assistant": "0.8.4-main.3eb6e50203",
|
|
52
|
+
"@dxos/keys": "0.8.4-main.3eb6e50203",
|
|
53
|
+
"@dxos/log": "0.8.4-main.3eb6e50203",
|
|
54
|
+
"@dxos/invariant": "0.8.4-main.3eb6e50203",
|
|
55
|
+
"@dxos/schema": "0.8.4-main.3eb6e50203",
|
|
56
|
+
"@dxos/types": "0.8.4-main.3eb6e50203",
|
|
57
|
+
"@dxos/util": "0.8.4-main.3eb6e50203",
|
|
58
|
+
"@dxos/plugin-markdown": "0.8.4-main.3eb6e50203",
|
|
59
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.3eb6e50203"
|
|
55
60
|
},
|
|
56
61
|
"devDependencies": {
|
|
57
|
-
"effect": "3.
|
|
58
|
-
"react": "~19.2.
|
|
59
|
-
"react-dom": "~19.2.
|
|
62
|
+
"effect": "3.19.16",
|
|
63
|
+
"react": "~19.2.3",
|
|
64
|
+
"react-dom": "~19.2.3"
|
|
60
65
|
},
|
|
61
66
|
"peerDependencies": {
|
|
62
|
-
"effect": "
|
|
63
|
-
"react": "
|
|
64
|
-
"react-dom": "
|
|
67
|
+
"effect": "3.19.16",
|
|
68
|
+
"react": "~19.2.3",
|
|
69
|
+
"react-dom": "~19.2.3"
|
|
65
70
|
},
|
|
66
71
|
"publishConfig": {
|
|
67
72
|
"access": "public"
|
|
@@ -12,13 +12,15 @@ import {
|
|
|
12
12
|
AiConversation,
|
|
13
13
|
type ContextBinding,
|
|
14
14
|
GenerationObserver,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
GenericToolkit,
|
|
16
|
+
ToolExecutionServices,
|
|
17
17
|
} from '@dxos/assistant';
|
|
18
18
|
import { Blueprint } from '@dxos/blueprints';
|
|
19
19
|
import { Obj, Ref } from '@dxos/echo';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { Database } from '@dxos/echo';
|
|
21
|
+
import { acquireReleaseResource } from '@dxos/effect';
|
|
22
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
23
|
+
import { QueueService, TracingService } from '@dxos/functions';
|
|
22
24
|
import { FunctionInvocationServiceLayerTestMocked, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
23
25
|
import { log } from '@dxos/log';
|
|
24
26
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
@@ -27,9 +29,8 @@ import { type Message } from '@dxos/types';
|
|
|
27
29
|
import { trim } from '@dxos/util';
|
|
28
30
|
|
|
29
31
|
import { Document } from '../../functions';
|
|
30
|
-
import { testToolkit } from '../testing';
|
|
31
32
|
|
|
32
|
-
import blueprint from './design-blueprint';
|
|
33
|
+
import { blueprint } from './design-blueprint';
|
|
33
34
|
|
|
34
35
|
describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
35
36
|
it.scoped(
|
|
@@ -38,21 +39,21 @@ describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
|
38
39
|
function* ({ expect }) {
|
|
39
40
|
const observer = GenerationObserver.fromPrinter(new ConsolePrinter());
|
|
40
41
|
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
41
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation(queue));
|
|
42
|
+
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
42
43
|
|
|
43
|
-
yield*
|
|
44
|
+
yield* Database.add(blueprint);
|
|
44
45
|
yield* Effect.promise(() =>
|
|
45
46
|
conversation.context.bind({
|
|
46
47
|
blueprints: [Ref.make(blueprint)],
|
|
47
48
|
}),
|
|
48
49
|
);
|
|
49
50
|
|
|
50
|
-
const artifact = yield*
|
|
51
|
+
const artifact = yield* Database.add(Markdown.make({ content: 'Hello, world!' }));
|
|
51
52
|
let prevContent = artifact.content;
|
|
52
53
|
|
|
53
54
|
{
|
|
54
55
|
const prompt = trim`
|
|
55
|
-
I want to design a new feature for our product.
|
|
56
|
+
I want to design a new feature for our product.
|
|
56
57
|
|
|
57
58
|
We need to add a user profile system with the following requirements:
|
|
58
59
|
1. Users should be able to create and edit their profiles
|
|
@@ -72,7 +73,7 @@ describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
|
72
73
|
|
|
73
74
|
{
|
|
74
75
|
const prompt = trim`
|
|
75
|
-
I want this to be built on top of Durable Objects and SQLite database.
|
|
76
|
+
I want this to be built on top of Durable Objects and SQLite database.
|
|
76
77
|
Adjust the spec to reflect this.
|
|
77
78
|
`;
|
|
78
79
|
|
|
@@ -82,13 +83,9 @@ describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
|
82
83
|
}
|
|
83
84
|
},
|
|
84
85
|
Effect.provide(
|
|
85
|
-
Layer.mergeAll(
|
|
86
|
-
makeToolResolverFromFunctions([Document.read, Document.update], testToolkit),
|
|
87
|
-
makeToolExecutionServiceFromFunctions(testToolkit, testToolkit.toLayer({}) as any),
|
|
88
|
-
AiService.model('@anthropic/claude-3-5-sonnet-20241022'),
|
|
89
|
-
).pipe(
|
|
86
|
+
Layer.mergeAll(ToolExecutionServices, AiService.model('@anthropic/claude-3-5-sonnet-20241022')).pipe(
|
|
90
87
|
Layer.provideMerge(TestDatabaseLayer({ types: [Text.Text, Markdown.Document, Blueprint.Blueprint] })),
|
|
91
|
-
Layer.provideMerge(AiServiceTestingPreset('direct')),
|
|
88
|
+
Layer.provideMerge(Layer.mergeAll(GenericToolkit.providerEmpty, AiServiceTestingPreset('direct'))),
|
|
92
89
|
Layer.provideMerge(
|
|
93
90
|
FunctionInvocationServiceLayerTestMocked({ functions: [Document.read, Document.update] }).pipe(
|
|
94
91
|
Layer.provideMerge(TracingService.layerNoop),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
8
|
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ const instructions = trim`
|
|
|
20
20
|
Do not announce when you read or write the design spec document.
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
|
-
const blueprint
|
|
23
|
+
export const blueprint = Blueprint.make({
|
|
24
24
|
key: 'dxos.org/blueprint/design',
|
|
25
25
|
name: 'Design Spec',
|
|
26
26
|
description: 'Preserve the conversation in the design spec.',
|
|
@@ -29,5 +29,3 @@ const blueprint: Blueprint.Blueprint = Obj.make(Blueprint.Blueprint, {
|
|
|
29
29
|
},
|
|
30
30
|
tools: [Document.read, Document.update].map((fn) => ToolId.make(fn.key)),
|
|
31
31
|
});
|
|
32
|
-
|
|
33
|
-
export default blueprint;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
8
|
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ const instructions = trim`
|
|
|
21
21
|
DXOS serverId: 837138313172353095
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
|
-
export const blueprint =
|
|
24
|
+
export const blueprint = Blueprint.make({
|
|
25
25
|
key: 'dxos.org/blueprint/discord',
|
|
26
26
|
name: 'Discord',
|
|
27
27
|
description: 'Discord integration.',
|
|
@@ -30,5 +30,3 @@ export const blueprint = Obj.make(Blueprint.Blueprint, {
|
|
|
30
30
|
},
|
|
31
31
|
tools: [ToolId.make(Discord.fetch.key)],
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
export default blueprint;
|
package/src/blueprints/index.ts
CHANGED
|
@@ -8,3 +8,4 @@ export { default as LinearBlueprint } from './linear';
|
|
|
8
8
|
export { default as PlanningBlueprint } from './planning';
|
|
9
9
|
export { default as ResearchBlueprint } from './research';
|
|
10
10
|
export { default as WebSearchBlueprint, WebSearchToolkit } from './websearch';
|
|
11
|
+
export { default as MarkdownBlueprint } from './markdown';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
8
|
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
@@ -22,7 +22,7 @@ const instructions = trim`
|
|
|
22
22
|
DXOS teamId: 1127c63a-6f77-4725-9229-50f6cd47321c
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
|
-
export const blueprint =
|
|
25
|
+
export const blueprint = Blueprint.make({
|
|
26
26
|
key: 'dxos.org/blueprint/linear',
|
|
27
27
|
name: 'Linear',
|
|
28
28
|
description: 'Syncs Linear workspaces.',
|
|
@@ -31,5 +31,3 @@ export const blueprint = Obj.make(Blueprint.Blueprint, {
|
|
|
31
31
|
},
|
|
32
32
|
tools: [Linear.sync].map((tool) => ToolId.make(tool.key)),
|
|
33
33
|
});
|
|
34
|
-
|
|
35
|
-
export default blueprint;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
6
|
+
import { Ref } from '@dxos/echo';
|
|
7
|
+
import { Text } from '@dxos/schema';
|
|
8
|
+
import { trim } from '@dxos/util';
|
|
9
|
+
|
|
10
|
+
import { Document } from '../../functions';
|
|
11
|
+
|
|
12
|
+
const instructions = trim`
|
|
13
|
+
You read, write & create markdown documents.
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export const blueprint = Blueprint.make({
|
|
17
|
+
key: 'dxos.org/blueprint/markdown',
|
|
18
|
+
name: 'Markdown',
|
|
19
|
+
description: 'Work with markdown documents.',
|
|
20
|
+
instructions: {
|
|
21
|
+
source: Ref.make(Text.make(instructions)),
|
|
22
|
+
},
|
|
23
|
+
tools: Blueprint.toolDefinitions({ functions: [Document.read, Document.update, Document.create] }),
|
|
24
|
+
});
|
|
@@ -8,16 +8,13 @@ import * as Layer from 'effect/Layer';
|
|
|
8
8
|
|
|
9
9
|
import { AiService } from '@dxos/ai';
|
|
10
10
|
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
11
|
-
import {
|
|
12
|
-
AiConversation,
|
|
13
|
-
type ContextBinding,
|
|
14
|
-
makeToolExecutionServiceFromFunctions,
|
|
15
|
-
makeToolResolverFromFunctions,
|
|
16
|
-
} from '@dxos/assistant';
|
|
11
|
+
import { AiConversation, type ContextBinding, GenericToolkit, ToolExecutionServices } from '@dxos/assistant';
|
|
17
12
|
import { Blueprint } from '@dxos/blueprints';
|
|
18
13
|
import { Obj, Ref } from '@dxos/echo';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
14
|
+
import { Database } from '@dxos/echo';
|
|
15
|
+
import { acquireReleaseResource } from '@dxos/effect';
|
|
16
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
17
|
+
import { QueueService, TracingService } from '@dxos/functions';
|
|
21
18
|
import { FunctionImplementationResolver } from '@dxos/functions-runtime';
|
|
22
19
|
import { FunctionInvocationServiceLayerTestMocked, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
23
20
|
import { log } from '@dxos/log';
|
|
@@ -27,9 +24,9 @@ import { type Message } from '@dxos/types';
|
|
|
27
24
|
import { trim } from '@dxos/util';
|
|
28
25
|
|
|
29
26
|
import { Tasks } from '../../functions';
|
|
30
|
-
import { type TestStep, runSteps
|
|
27
|
+
import { type TestStep, runSteps } from '../testing';
|
|
31
28
|
|
|
32
|
-
import blueprint from './planning-blueprint';
|
|
29
|
+
import { blueprint } from './planning-blueprint';
|
|
33
30
|
|
|
34
31
|
describe('Planning Blueprint', { timeout: 120_000 }, () => {
|
|
35
32
|
it.scoped(
|
|
@@ -37,16 +34,16 @@ describe('Planning Blueprint', { timeout: 120_000 }, () => {
|
|
|
37
34
|
Effect.fn(
|
|
38
35
|
function* ({ expect }) {
|
|
39
36
|
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
40
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation(queue));
|
|
37
|
+
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
41
38
|
|
|
42
|
-
yield*
|
|
39
|
+
yield* Database.add(blueprint);
|
|
43
40
|
yield* Effect.promise(() =>
|
|
44
41
|
conversation.context.bind({
|
|
45
42
|
blueprints: [Ref.make(blueprint)],
|
|
46
43
|
}),
|
|
47
44
|
);
|
|
48
45
|
|
|
49
|
-
const artifact = yield*
|
|
46
|
+
const artifact = yield* Database.add(Markdown.make());
|
|
50
47
|
let prevContent = artifact.content;
|
|
51
48
|
const matchList =
|
|
52
49
|
({ includes = [], excludes = [] }: { includes: RegExp[]; excludes?: RegExp[] }) =>
|
|
@@ -103,8 +100,7 @@ describe('Planning Blueprint', { timeout: 120_000 }, () => {
|
|
|
103
100
|
Effect.provide(
|
|
104
101
|
Layer.mergeAll(
|
|
105
102
|
TestDatabaseLayer({ types: [Text.Text, Markdown.Document, Blueprint.Blueprint] }),
|
|
106
|
-
|
|
107
|
-
makeToolExecutionServiceFromFunctions(testToolkit, testToolkit.toLayer({}) as any),
|
|
103
|
+
ToolExecutionServices,
|
|
108
104
|
AiService.model('@anthropic/claude-3-5-sonnet-20241022'),
|
|
109
105
|
).pipe(
|
|
110
106
|
Layer.provideMerge(
|
|
@@ -114,7 +110,7 @@ describe('Planning Blueprint', { timeout: 120_000 }, () => {
|
|
|
114
110
|
),
|
|
115
111
|
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions: [Tasks.read, Tasks.update] })),
|
|
116
112
|
Layer.provideMerge(TestDatabaseLayer({ types: [Text.Text, Markdown.Document, Blueprint.Blueprint] })),
|
|
117
|
-
Layer.provideMerge(AiServiceTestingPreset('direct')),
|
|
113
|
+
Layer.provideMerge(Layer.mergeAll(GenericToolkit.providerEmpty, AiServiceTestingPreset('direct'))),
|
|
118
114
|
),
|
|
119
115
|
),
|
|
120
116
|
TestHelpers.provideTestContext,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
8
|
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
@@ -85,7 +85,7 @@ const instructions = trim`
|
|
|
85
85
|
- Be precise with task descriptions and hierarchy levels
|
|
86
86
|
`;
|
|
87
87
|
|
|
88
|
-
export const blueprint
|
|
88
|
+
export const blueprint = Blueprint.make({
|
|
89
89
|
key: 'dxos.org/blueprint/planning',
|
|
90
90
|
name: 'Planning',
|
|
91
91
|
description: 'Plans and tracks complex tasks with artifact management.',
|
|
@@ -94,5 +94,3 @@ export const blueprint: Blueprint.Blueprint = Obj.make(Blueprint.Blueprint, {
|
|
|
94
94
|
},
|
|
95
95
|
tools: [Tasks.read, Tasks.update].map((fn) => ToolId.make(fn.key)),
|
|
96
96
|
});
|
|
97
|
-
|
|
98
|
-
export default blueprint;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
8
|
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
@@ -40,7 +40,7 @@ const instructions = trim`
|
|
|
40
40
|
</unstructured_mode>
|
|
41
41
|
`;
|
|
42
42
|
|
|
43
|
-
export const blueprint
|
|
43
|
+
export const blueprint = Blueprint.make({
|
|
44
44
|
key: 'dxos.org/blueprint/research',
|
|
45
45
|
name: 'Research',
|
|
46
46
|
description: 'Researches the web and creates structured data.',
|
|
@@ -49,5 +49,3 @@ export const blueprint: Blueprint.Blueprint = Obj.make(Blueprint.Blueprint, {
|
|
|
49
49
|
},
|
|
50
50
|
tools: [Research.create, Research.research].map((fn) => ToolId.make(fn.key)),
|
|
51
51
|
});
|
|
52
|
-
|
|
53
|
-
export default blueprint;
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Toolkit from '@effect/ai/Toolkit';
|
|
6
5
|
import * as Effect from 'effect/Effect';
|
|
7
6
|
|
|
8
7
|
import { ConsolePrinter } from '@dxos/ai';
|
|
9
|
-
import { type AiConversation, type
|
|
8
|
+
import { type AiConversation, type AiConversationRunProps, GenerationObserver } from '@dxos/assistant';
|
|
10
9
|
import { log } from '@dxos/log';
|
|
11
10
|
|
|
12
|
-
export type TestStep = Pick<
|
|
11
|
+
export type TestStep = Pick<AiConversationRunProps, 'prompt' | 'system'> & {
|
|
13
12
|
test?: () => Promise<void>;
|
|
14
13
|
};
|
|
15
14
|
|
|
@@ -29,6 +28,3 @@ export const runSteps = Effect.fn(function* (conversation: AiConversation, steps
|
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
});
|
|
32
|
-
|
|
33
|
-
// TODO(wittjosiah): Don't cast.
|
|
34
|
-
export const testToolkit = Toolkit.empty as Toolkit.Toolkit<any>;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
8
|
import { Text } from '@dxos/schema';
|
|
9
9
|
|
|
10
|
-
const blueprint
|
|
10
|
+
export const blueprint = Blueprint.make({
|
|
11
11
|
key: 'dxos.org/blueprint/web-search',
|
|
12
12
|
name: 'Web Search',
|
|
13
13
|
description: 'Search the web.',
|
|
@@ -16,5 +16,3 @@ const blueprint: Blueprint.Blueprint = Obj.make(Blueprint.Blueprint, {
|
|
|
16
16
|
},
|
|
17
17
|
tools: [ToolId.make('AnthropicWebSearch')],
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
export default blueprint;
|
package/src/chat/Chat.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { Obj, Type } from '@dxos/echo';
|
|
8
|
+
import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
|
|
9
|
+
import { Queue } from '@dxos/echo-db';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* AI chat.
|
|
13
|
+
*/
|
|
14
|
+
export const Chat = Schema.Struct({
|
|
15
|
+
name: Schema.String.pipe(Schema.optional),
|
|
16
|
+
queue: Type.Ref(Queue).pipe(FormInputAnnotation.set(false)),
|
|
17
|
+
// TODO(dmaretskyi): Eventually this and the message queue will be the same.
|
|
18
|
+
traceQueue: Type.Ref(Queue).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
19
|
+
}).pipe(
|
|
20
|
+
Type.object({
|
|
21
|
+
typename: 'dxos.org/type/assistant/Chat',
|
|
22
|
+
version: '0.2.0',
|
|
23
|
+
}),
|
|
24
|
+
LabelAnnotation.set(['name']),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export interface Chat extends Schema.Schema.Type<typeof Chat> {}
|
|
28
|
+
|
|
29
|
+
export const make = (props: Obj.MakeProps<typeof Chat>) => Obj.make(Chat, props);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Relation between a Chat and companion objects (e.g., artifacts).
|
|
33
|
+
*/
|
|
34
|
+
export const CompanionTo = Schema.Struct({
|
|
35
|
+
id: Obj.ID,
|
|
36
|
+
}).pipe(
|
|
37
|
+
Type.relation({
|
|
38
|
+
typename: 'dxos.org/relation/assistant/CompanionTo',
|
|
39
|
+
version: '0.1.0',
|
|
40
|
+
source: Chat,
|
|
41
|
+
target: Type.Obj,
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export interface CompanionTo extends Schema.Schema.Type<typeof CompanionTo> {}
|
package/src/crud/graph.test.ts
CHANGED
|
@@ -2,42 +2,19 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
|
|
6
|
-
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
5
|
import { describe, it } from '@effect/vitest';
|
|
8
|
-
import * as Config from 'effect/Config';
|
|
9
6
|
import * as Effect from 'effect/Effect';
|
|
10
|
-
import * as Function from 'effect/Function';
|
|
11
7
|
import * as Layer from 'effect/Layer';
|
|
12
8
|
|
|
13
|
-
import { AiService, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
14
|
-
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
15
|
-
import { tapHttpErrors } from '@dxos/ai/testing';
|
|
16
9
|
import { AiSession } from '@dxos/assistant';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
10
|
+
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
19
12
|
import { log } from '@dxos/log';
|
|
20
|
-
import {
|
|
13
|
+
import { Pipeline } from '@dxos/types';
|
|
21
14
|
|
|
22
15
|
import { makeGraphWriterHandler, makeGraphWriterToolkit } from './graph';
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const TestLayer = Function.pipe(
|
|
27
|
-
AiService.model('@anthropic/claude-3-5-sonnet-20241022'),
|
|
28
|
-
Layer.provideMerge(DatabaseService.notAvailable),
|
|
29
|
-
Layer.provideMerge(ToolResolverService.layerEmpty),
|
|
30
|
-
Layer.provideMerge(ToolExecutionService.layerEmpty),
|
|
31
|
-
Layer.provide(AiServiceRouter.AiServiceRouter),
|
|
32
|
-
Layer.provide(
|
|
33
|
-
AnthropicClient.layerConfig({
|
|
34
|
-
apiKey: Config.redacted('ANTHROPIC_API_KEY'),
|
|
35
|
-
transformClient: tapHttpErrors,
|
|
36
|
-
}),
|
|
37
|
-
),
|
|
38
|
-
Layer.provide(FetchHttpClient.layer),
|
|
39
|
-
Layer.provideMerge(TracingService.layerNoop),
|
|
40
|
-
);
|
|
17
|
+
const TestLayer = AssistantTestLayer({});
|
|
41
18
|
|
|
42
19
|
describe('graph', () => {
|
|
43
20
|
// let builder: EchoTestBuilder;
|
|
@@ -46,7 +23,7 @@ describe('graph', () => {
|
|
|
46
23
|
// const relatedSchemas = await findRelatedSchema(db, Schema.Struct({}));
|
|
47
24
|
// });
|
|
48
25
|
|
|
49
|
-
const Toolkit = makeGraphWriterToolkit({ schema: [
|
|
26
|
+
const Toolkit = makeGraphWriterToolkit({ schema: [Pipeline.Pipeline] });
|
|
50
27
|
const ToolkitLayer = makeGraphWriterHandler(Toolkit);
|
|
51
28
|
|
|
52
29
|
it.effect.skip(
|
|
@@ -63,7 +40,7 @@ describe('graph', () => {
|
|
|
63
40
|
log.info('response', { response });
|
|
64
41
|
},
|
|
65
42
|
Effect.provide(Layer.mergeAll(TestLayer, ToolkitLayer)),
|
|
66
|
-
TestHelpers.
|
|
43
|
+
TestHelpers.provideTestContext,
|
|
67
44
|
),
|
|
68
45
|
);
|
|
69
46
|
});
|