@dxos/assistant-toolkit 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
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/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1091 -692
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +43 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1090 -692
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +44 -0
- package/dist/lib/node-esm/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/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/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 -2
- 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/blueprints/websearch/websearch-toolkit.d.ts +1 -0
- package/dist/types/src/blueprints/websearch/websearch-toolkit.d.ts.map +1 -1
- 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/prompt.d.ts +73 -8
- package/dist/types/src/functions/agent/prompt.d.ts.map +1 -1
- package/dist/types/src/functions/discord/fetch-messages.d.ts +1 -1
- package/dist/types/src/functions/discord/index.d.ts +1 -1
- package/dist/types/src/functions/discord/index.d.ts.map +1 -1
- package/dist/types/src/functions/document/index.d.ts +3 -2
- package/dist/types/src/functions/document/index.d.ts.map +1 -1
- package/dist/types/src/functions/document/read.d.ts +1 -1
- package/dist/types/src/functions/document/read.d.ts.map +1 -1
- package/dist/types/src/functions/document/update.d.ts +1 -1
- package/dist/types/src/functions/document/update.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts +126 -125
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/index.d.ts +126 -125
- 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/mock.d.ts +1 -1
- package/dist/types/src/functions/github/fetch-prs.d.ts +1 -1
- package/dist/types/src/functions/github/fetch-prs.d.ts.map +1 -1
- package/dist/types/src/functions/linear/index.d.ts +2 -2
- package/dist/types/src/functions/linear/index.d.ts.map +1 -1
- package/dist/types/src/functions/linear/sync-issues.d.ts +2 -2
- package/dist/types/src/functions/linear/sync-issues.d.ts.map +1 -1
- package/dist/types/src/functions/research/document-create.d.ts +9 -0
- package/dist/types/src/functions/research/document-create.d.ts.map +1 -0
- package/dist/types/src/functions/research/index.d.ts +8 -6
- package/dist/types/src/functions/research/index.d.ts.map +1 -1
- 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 +4 -3
- package/dist/types/src/functions/research/research.d.ts.map +1 -1
- package/dist/types/src/functions/research/types.d.ts +2 -380
- package/dist/types/src/functions/research/types.d.ts.map +1 -1
- package/dist/types/src/functions/tasks/index.d.ts +2 -2
- package/dist/types/src/functions/tasks/index.d.ts.map +1 -1
- package/dist/types/src/functions/tasks/read.d.ts +1 -1
- package/dist/types/src/functions/tasks/read.d.ts.map +1 -1
- package/dist/types/src/functions/tasks/update.d.ts +1 -1
- package/dist/types/src/functions/tasks/update.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/initiative/Initiative.d.ts +84 -0
- package/dist/types/src/initiative/Initiative.d.ts.map +1 -0
- package/dist/types/src/initiative/InitiativeSchema.d.ts +19 -0
- package/dist/types/src/initiative/InitiativeSchema.d.ts.map +1 -0
- package/dist/types/src/initiative/functions/agent.d.ts +37 -0
- package/dist/types/src/initiative/functions/agent.d.ts.map +1 -0
- package/dist/types/src/initiative/functions/getContext.d.ts +17 -0
- package/dist/types/src/initiative/functions/getContext.d.ts.map +1 -0
- package/dist/types/src/initiative/functions/index.d.ts +4 -0
- package/dist/types/src/initiative/functions/index.d.ts.map +1 -0
- package/dist/types/src/{functions/research/create-document.d.ts → initiative/functions/update.d.ts} +3 -3
- package/dist/types/src/initiative/functions/update.d.ts.map +1 -0
- package/dist/types/src/initiative/index.d.ts +1 -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/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 +43 -0
- package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +1 -0
- package/dist/types/src/toolkits/AssistantToolkit.test.d.ts +2 -0
- package/dist/types/src/toolkits/AssistantToolkit.test.d.ts.map +1 -0
- package/dist/types/src/toolkits/SystemToolkit.d.ts +99 -0
- package/dist/types/src/toolkits/SystemToolkit.d.ts.map +1 -0
- package/dist/types/src/toolkits/index.d.ts +3 -0
- package/dist/types/src/toolkits/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -33
- package/src/blueprints/design/design-blueprint.test.ts +17 -20
- package/src/blueprints/design/design-blueprint.ts +4 -6
- package/src/blueprints/design/index.ts +1 -1
- package/src/blueprints/discord/discord-blueprint.ts +4 -6
- package/src/blueprints/discord/index.ts +1 -1
- package/src/blueprints/linear/index.ts +1 -1
- package/src/blueprints/linear/linear-blueprint.ts +4 -6
- package/src/blueprints/planning/index.ts +1 -1
- package/src/blueprints/planning/planning-blueprint.test.ts +17 -20
- package/src/blueprints/planning/planning-blueprint.ts +4 -6
- package/src/blueprints/research/index.ts +1 -1
- package/src/blueprints/research/research-blueprint.ts +25 -19
- package/src/blueprints/testing.ts +2 -2
- package/src/blueprints/websearch/index.ts +2 -1
- package/src/blueprints/websearch/websearch-blueprint.ts +4 -6
- 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/experimental/feed.test.ts +12 -9
- package/src/functions/agent/prompt.ts +39 -22
- package/src/functions/discord/fetch-messages.test.ts +6 -7
- package/src/functions/discord/fetch-messages.ts +11 -10
- package/src/functions/document/index.ts +1 -0
- package/src/functions/document/read.ts +4 -3
- package/src/functions/document/update.ts +7 -4
- package/src/functions/entity-extraction/entity-extraction.conversations.json +6597 -1
- package/src/functions/entity-extraction/entity-extraction.test.ts +16 -23
- package/src/functions/entity-extraction/entity-extraction.ts +51 -31
- 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 -20
- package/src/functions/linear/sync-issues.ts +14 -12
- package/src/functions/research/document-create.ts +76 -0
- package/src/functions/research/index.ts +1 -2
- package/src/functions/research/research-graph.ts +13 -11
- package/src/functions/research/{instructions-research.tpl → research-instructions.tpl} +14 -6
- package/src/functions/research/research.conversations.json +1 -10714
- package/src/functions/research/research.test.ts +92 -161
- package/src/functions/research/research.ts +88 -54
- package/src/functions/research/types.ts +14 -12
- package/src/functions/tasks/read.ts +4 -3
- package/src/functions/tasks/update.ts +4 -3
- package/src/index.ts +2 -1
- package/src/initiative/Initiative.ts +99 -0
- package/src/initiative/InitiativeSchema.ts +37 -0
- package/src/initiative/functions/agent.ts +57 -0
- package/src/initiative/functions/getContext.ts +74 -0
- package/src/initiative/functions/index.ts +7 -0
- package/src/initiative/functions/update.ts +63 -0
- package/src/initiative/index.ts +3 -0
- package/src/initiative/initiative.conversations.json +1 -0
- package/src/initiative/initiative.test.ts +485 -0
- package/src/sync/sync.ts +38 -30
- package/src/testing/index.ts +1 -1
- package/src/{plugins.tsx → testing/plugins.tsx} +15 -15
- package/src/toolkits/AssistantToolkit.conversations.json +1 -0
- package/src/toolkits/AssistantToolkit.test.ts +94 -0
- package/src/toolkits/AssistantToolkit.ts +70 -0
- package/src/toolkits/SystemToolkit.ts +299 -0
- package/src/toolkits/index.ts +6 -0
- 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/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/functions/research/create-document.ts +0 -69
- package/src/functions/research/graph.test.ts +0 -69
- /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/{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.bc674ce",
|
|
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",
|
|
@@ -13,53 +17,65 @@
|
|
|
13
17
|
"types": "./dist/types/src/index.d.ts",
|
|
14
18
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
19
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"./testing": {
|
|
22
|
+
"source": "./src/testing/index.ts",
|
|
23
|
+
"types": "./dist/types/src/testing/index.d.ts",
|
|
24
|
+
"browser": "./dist/lib/browser/testing/index.mjs",
|
|
25
|
+
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
16
26
|
}
|
|
17
27
|
},
|
|
18
28
|
"types": "dist/types/src/index.d.ts",
|
|
19
29
|
"typesVersions": {
|
|
20
|
-
"*": {
|
|
30
|
+
"*": {
|
|
31
|
+
"testing": [
|
|
32
|
+
"./dist/types/src/testing/index.d.ts"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
21
35
|
},
|
|
22
36
|
"files": [
|
|
23
37
|
"dist",
|
|
24
38
|
"src"
|
|
25
39
|
],
|
|
26
40
|
"dependencies": {
|
|
27
|
-
"@effect/ai": "0.
|
|
28
|
-
"@effect/ai-anthropic": "0.
|
|
29
|
-
"@effect/experimental": "0.
|
|
30
|
-
"@effect/platform": "
|
|
31
|
-
"dfx": "^0.
|
|
41
|
+
"@effect/ai": "0.32.1",
|
|
42
|
+
"@effect/ai-anthropic": "0.22.0",
|
|
43
|
+
"@effect/experimental": "0.57.11",
|
|
44
|
+
"@effect/platform": "0.93.6",
|
|
45
|
+
"dfx": "^0.127.0",
|
|
32
46
|
"exa-js": "^1.5.12",
|
|
33
|
-
"@dxos/ai": "0.8.4-main.
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/echo
|
|
40
|
-
"@dxos/echo": "0.8.4-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/log": "0.8.4-main.
|
|
48
|
-
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
47
|
+
"@dxos/ai": "0.8.4-main.bc674ce",
|
|
48
|
+
"@dxos/blueprints": "0.8.4-main.bc674ce",
|
|
49
|
+
"@dxos/app-framework": "0.8.4-main.bc674ce",
|
|
50
|
+
"@dxos/assistant": "0.8.4-main.bc674ce",
|
|
51
|
+
"@dxos/echo-db": "0.8.4-main.bc674ce",
|
|
52
|
+
"@dxos/context": "0.8.4-main.bc674ce",
|
|
53
|
+
"@dxos/echo": "0.8.4-main.bc674ce",
|
|
54
|
+
"@dxos/echo-protocol": "0.8.4-main.bc674ce",
|
|
55
|
+
"@dxos/edge-client": "0.8.4-main.bc674ce",
|
|
56
|
+
"@dxos/effect": "0.8.4-main.bc674ce",
|
|
57
|
+
"@dxos/errors": "0.8.4-main.bc674ce",
|
|
58
|
+
"@dxos/functions": "0.8.4-main.bc674ce",
|
|
59
|
+
"@dxos/functions-runtime": "0.8.4-main.bc674ce",
|
|
60
|
+
"@dxos/invariant": "0.8.4-main.bc674ce",
|
|
61
|
+
"@dxos/log": "0.8.4-main.bc674ce",
|
|
62
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.bc674ce",
|
|
63
|
+
"@dxos/plugin-markdown": "0.8.4-main.bc674ce",
|
|
64
|
+
"@dxos/keys": "0.8.4-main.bc674ce",
|
|
65
|
+
"@dxos/types": "0.8.4-main.bc674ce",
|
|
66
|
+
"@dxos/util": "0.8.4-main.bc674ce",
|
|
67
|
+
"@dxos/schema": "0.8.4-main.bc674ce",
|
|
68
|
+
"@dxos/conductor": "0.8.4-main.bc674ce"
|
|
53
69
|
},
|
|
54
70
|
"devDependencies": {
|
|
55
|
-
"effect": "3.
|
|
56
|
-
"react": "~19.2.
|
|
57
|
-
"react-dom": "~19.2.
|
|
71
|
+
"effect": "3.19.11",
|
|
72
|
+
"react": "~19.2.3",
|
|
73
|
+
"react-dom": "~19.2.3"
|
|
58
74
|
},
|
|
59
75
|
"peerDependencies": {
|
|
60
|
-
"effect": "
|
|
61
|
-
"react": "
|
|
62
|
-
"react-dom": "
|
|
76
|
+
"effect": "3.19.11",
|
|
77
|
+
"react": "~19.2.3",
|
|
78
|
+
"react-dom": "~19.2.3"
|
|
63
79
|
},
|
|
64
80
|
"publishConfig": {
|
|
65
81
|
"access": "public"
|
|
@@ -17,24 +17,21 @@ import {
|
|
|
17
17
|
} from '@dxos/assistant';
|
|
18
18
|
import { Blueprint } from '@dxos/blueprints';
|
|
19
19
|
import { Obj, Ref } from '@dxos/echo';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
QueueService,
|
|
26
|
-
TracingService,
|
|
27
|
-
} from '@dxos/functions';
|
|
28
|
-
import { TestDatabaseLayer } from '@dxos/functions/testing';
|
|
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';
|
|
24
|
+
import { FunctionInvocationServiceLayerTestMocked, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
29
25
|
import { log } from '@dxos/log';
|
|
30
26
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
31
|
-
import {
|
|
27
|
+
import { Text } from '@dxos/schema';
|
|
28
|
+
import { type Message } from '@dxos/types';
|
|
32
29
|
import { trim } from '@dxos/util';
|
|
33
30
|
|
|
34
31
|
import { Document } from '../../functions';
|
|
35
32
|
import { testToolkit } from '../testing';
|
|
36
33
|
|
|
37
|
-
import blueprint from './design-blueprint';
|
|
34
|
+
import { blueprint } from './design-blueprint';
|
|
38
35
|
|
|
39
36
|
describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
40
37
|
it.scoped(
|
|
@@ -42,22 +39,22 @@ describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
|
42
39
|
Effect.fn(
|
|
43
40
|
function* ({ expect }) {
|
|
44
41
|
const observer = GenerationObserver.fromPrinter(new ConsolePrinter());
|
|
45
|
-
const queue = yield* QueueService.createQueue<
|
|
46
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation(queue));
|
|
42
|
+
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
43
|
+
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
47
44
|
|
|
48
|
-
yield*
|
|
45
|
+
yield* Database.Service.add(blueprint);
|
|
49
46
|
yield* Effect.promise(() =>
|
|
50
47
|
conversation.context.bind({
|
|
51
48
|
blueprints: [Ref.make(blueprint)],
|
|
52
49
|
}),
|
|
53
50
|
);
|
|
54
51
|
|
|
55
|
-
const artifact = yield*
|
|
52
|
+
const artifact = yield* Database.Service.add(Markdown.make({ content: 'Hello, world!' }));
|
|
56
53
|
let prevContent = artifact.content;
|
|
57
54
|
|
|
58
55
|
{
|
|
59
56
|
const prompt = trim`
|
|
60
|
-
I want to design a new feature for our product.
|
|
57
|
+
I want to design a new feature for our product.
|
|
61
58
|
|
|
62
59
|
We need to add a user profile system with the following requirements:
|
|
63
60
|
1. Users should be able to create and edit their profiles
|
|
@@ -77,7 +74,7 @@ describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
|
77
74
|
|
|
78
75
|
{
|
|
79
76
|
const prompt = trim`
|
|
80
|
-
I want this to be built on top of Durable Objects and SQLite database.
|
|
77
|
+
I want this to be built on top of Durable Objects and SQLite database.
|
|
81
78
|
Adjust the spec to reflect this.
|
|
82
79
|
`;
|
|
83
80
|
|
|
@@ -92,16 +89,16 @@ describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
|
92
89
|
makeToolExecutionServiceFromFunctions(testToolkit, testToolkit.toLayer({}) as any),
|
|
93
90
|
AiService.model('@anthropic/claude-3-5-sonnet-20241022'),
|
|
94
91
|
).pipe(
|
|
95
|
-
Layer.provideMerge(TestDatabaseLayer({ types: [
|
|
92
|
+
Layer.provideMerge(TestDatabaseLayer({ types: [Text.Text, Markdown.Document, Blueprint.Blueprint] })),
|
|
96
93
|
Layer.provideMerge(AiServiceTestingPreset('direct')),
|
|
97
94
|
Layer.provideMerge(
|
|
98
|
-
|
|
99
|
-
Layer.provideMerge(ComputeEventLogger.layerFromTracing),
|
|
95
|
+
FunctionInvocationServiceLayerTestMocked({ functions: [Document.read, Document.update] }).pipe(
|
|
100
96
|
Layer.provideMerge(TracingService.layerNoop),
|
|
101
97
|
),
|
|
102
98
|
),
|
|
103
99
|
),
|
|
104
100
|
),
|
|
101
|
+
TestHelpers.provideTestContext,
|
|
105
102
|
TestHelpers.taggedTest('llm'),
|
|
106
103
|
),
|
|
107
104
|
);
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
|
+
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
import { Document } from '../../functions';
|
|
@@ -20,14 +20,12 @@ 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.',
|
|
27
27
|
instructions: {
|
|
28
|
-
source: Ref.make(
|
|
28
|
+
source: Ref.make(Text.make(instructions)),
|
|
29
29
|
},
|
|
30
30
|
tools: [Document.read, Document.update].map((fn) => ToolId.make(fn.key)),
|
|
31
31
|
});
|
|
32
|
-
|
|
33
|
-
export default blueprint;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
|
+
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
import { Discord } from '../../functions';
|
|
@@ -21,14 +21,12 @@ 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.',
|
|
28
28
|
instructions: {
|
|
29
|
-
source: Ref.make(
|
|
29
|
+
source: Ref.make(Text.make(instructions)),
|
|
30
30
|
},
|
|
31
31
|
tools: [ToolId.make(Discord.fetch.key)],
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
export default blueprint;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
|
+
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
import { Linear } from '../../functions';
|
|
@@ -22,14 +22,12 @@ 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.',
|
|
29
29
|
instructions: {
|
|
30
|
-
source: Ref.make(
|
|
30
|
+
source: Ref.make(Text.make(instructions)),
|
|
31
31
|
},
|
|
32
32
|
tools: [Linear.sync].map((tool) => ToolId.make(tool.key)),
|
|
33
33
|
});
|
|
34
|
-
|
|
35
|
-
export default blueprint;
|
|
@@ -16,42 +16,39 @@ import {
|
|
|
16
16
|
} from '@dxos/assistant';
|
|
17
17
|
import { Blueprint } from '@dxos/blueprints';
|
|
18
18
|
import { Obj, Ref } from '@dxos/echo';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
QueueService,
|
|
26
|
-
TracingService,
|
|
27
|
-
} from '@dxos/functions';
|
|
28
|
-
import { TestDatabaseLayer } from '@dxos/functions/testing';
|
|
19
|
+
import { Database } from '@dxos/echo';
|
|
20
|
+
import { acquireReleaseResource } from '@dxos/effect';
|
|
21
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
22
|
+
import { QueueService, TracingService } from '@dxos/functions';
|
|
23
|
+
import { FunctionImplementationResolver } from '@dxos/functions-runtime';
|
|
24
|
+
import { FunctionInvocationServiceLayerTestMocked, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
29
25
|
import { log } from '@dxos/log';
|
|
30
26
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
31
|
-
import {
|
|
27
|
+
import { Text } from '@dxos/schema';
|
|
28
|
+
import { type Message } from '@dxos/types';
|
|
32
29
|
import { trim } from '@dxos/util';
|
|
33
30
|
|
|
34
31
|
import { Tasks } from '../../functions';
|
|
35
32
|
import { type TestStep, runSteps, testToolkit } from '../testing';
|
|
36
33
|
|
|
37
|
-
import blueprint from './planning-blueprint';
|
|
34
|
+
import { blueprint } from './planning-blueprint';
|
|
38
35
|
|
|
39
36
|
describe('Planning Blueprint', { timeout: 120_000 }, () => {
|
|
40
37
|
it.scoped(
|
|
41
38
|
'planning blueprint',
|
|
42
39
|
Effect.fn(
|
|
43
40
|
function* ({ expect }) {
|
|
44
|
-
const queue = yield* QueueService.createQueue<
|
|
45
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation(queue));
|
|
41
|
+
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
42
|
+
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
46
43
|
|
|
47
|
-
yield*
|
|
44
|
+
yield* Database.Service.add(blueprint);
|
|
48
45
|
yield* Effect.promise(() =>
|
|
49
46
|
conversation.context.bind({
|
|
50
47
|
blueprints: [Ref.make(blueprint)],
|
|
51
48
|
}),
|
|
52
49
|
);
|
|
53
50
|
|
|
54
|
-
const artifact = yield*
|
|
51
|
+
const artifact = yield* Database.Service.add(Markdown.make());
|
|
55
52
|
let prevContent = artifact.content;
|
|
56
53
|
const matchList =
|
|
57
54
|
({ includes = [], excludes = [] }: { includes: RegExp[]; excludes?: RegExp[] }) =>
|
|
@@ -107,22 +104,22 @@ describe('Planning Blueprint', { timeout: 120_000 }, () => {
|
|
|
107
104
|
},
|
|
108
105
|
Effect.provide(
|
|
109
106
|
Layer.mergeAll(
|
|
110
|
-
TestDatabaseLayer({ types: [
|
|
107
|
+
TestDatabaseLayer({ types: [Text.Text, Markdown.Document, Blueprint.Blueprint] }),
|
|
111
108
|
makeToolResolverFromFunctions([Tasks.read, Tasks.update], testToolkit),
|
|
112
109
|
makeToolExecutionServiceFromFunctions(testToolkit, testToolkit.toLayer({}) as any),
|
|
113
110
|
AiService.model('@anthropic/claude-3-5-sonnet-20241022'),
|
|
114
111
|
).pipe(
|
|
115
112
|
Layer.provideMerge(
|
|
116
|
-
|
|
117
|
-
Layer.provideMerge(ComputeEventLogger.layerFromTracing),
|
|
113
|
+
FunctionInvocationServiceLayerTestMocked({ functions: [Tasks.read, Tasks.update] }).pipe(
|
|
118
114
|
Layer.provideMerge(TracingService.layerNoop),
|
|
119
115
|
),
|
|
120
116
|
),
|
|
121
117
|
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions: [Tasks.read, Tasks.update] })),
|
|
122
|
-
Layer.provideMerge(TestDatabaseLayer({ types: [
|
|
118
|
+
Layer.provideMerge(TestDatabaseLayer({ types: [Text.Text, Markdown.Document, Blueprint.Blueprint] })),
|
|
123
119
|
Layer.provideMerge(AiServiceTestingPreset('direct')),
|
|
124
120
|
),
|
|
125
121
|
),
|
|
122
|
+
TestHelpers.provideTestContext,
|
|
126
123
|
TestHelpers.taggedTest('llm'),
|
|
127
124
|
),
|
|
128
125
|
);
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
|
+
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
import { Tasks } from '../../functions';
|
|
@@ -85,14 +85,12 @@ 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.',
|
|
92
92
|
instructions: {
|
|
93
|
-
source: Ref.make(
|
|
93
|
+
source: Ref.make(Text.make(instructions)),
|
|
94
94
|
},
|
|
95
95
|
tools: [Tasks.read, Tasks.update].map((fn) => ToolId.make(fn.key)),
|
|
96
96
|
});
|
|
97
|
-
|
|
98
|
-
export default blueprint;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
8
|
+
import { Text } from '@dxos/schema';
|
|
9
9
|
import { trim } from '@dxos/util';
|
|
10
10
|
|
|
11
11
|
import { Research } from '../../functions';
|
|
@@ -17,29 +17,35 @@ const instructions = trim`
|
|
|
17
17
|
{{! Research }}
|
|
18
18
|
|
|
19
19
|
You are an analyst that does research tasks using tools that scrape the web and create structured data.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
Structured data extraction is an experimental feature -- only enable it if the user explicitly requests it in the prompt.
|
|
21
|
+
Prefer updating existing notes instead of creating new ones.
|
|
22
|
+
|
|
23
|
+
<strcutured_mode>
|
|
24
|
+
When you are done, reply with the created objects.
|
|
25
|
+
Do not print the data, instead reply with inline references to the created objects.
|
|
26
|
+
Those will be later substituted with the pills representing the created objects.
|
|
27
|
+
Print the rest of the created objects as block references after the main note.
|
|
28
|
+
|
|
29
|
+
<example>
|
|
30
|
+
Based on my research, Google was founded by @dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M and @dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK46K31DDW62PBW9H2ZQ
|
|
31
|
+
|
|
32
|
+
<object><dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M</dxn></object>
|
|
33
|
+
<object><dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK46K31DDW62PBW9H2ZQ</dxn></object>
|
|
34
|
+
<object><dxn>dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK46K31DDW62PBW92333</dxn></object>
|
|
35
|
+
</example>
|
|
36
|
+
</structured_mode>
|
|
37
|
+
|
|
38
|
+
<unstructured_mode>
|
|
39
|
+
Reply normally with the text mode of the result of your research.
|
|
40
|
+
</unstructured_mode>
|
|
33
41
|
`;
|
|
34
42
|
|
|
35
|
-
export const blueprint
|
|
43
|
+
export const blueprint = Blueprint.make({
|
|
36
44
|
key: 'dxos.org/blueprint/research',
|
|
37
45
|
name: 'Research',
|
|
38
46
|
description: 'Researches the web and creates structured data.',
|
|
39
47
|
instructions: {
|
|
40
|
-
source: Ref.make(
|
|
48
|
+
source: Ref.make(Text.make(instructions)),
|
|
41
49
|
},
|
|
42
50
|
tools: [Research.create, Research.research].map((fn) => ToolId.make(fn.key)),
|
|
43
51
|
});
|
|
44
|
-
|
|
45
|
-
export default blueprint;
|
|
@@ -6,10 +6,10 @@ import * as Toolkit from '@effect/ai/Toolkit';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
8
|
import { ConsolePrinter } from '@dxos/ai';
|
|
9
|
-
import { type AiConversation, type
|
|
9
|
+
import { type AiConversation, type AiConversationRunProps, GenerationObserver } from '@dxos/assistant';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
|
|
12
|
-
export type TestStep = Pick<
|
|
12
|
+
export type TestStep = Pick<AiConversationRunProps, 'prompt' | 'system'> & {
|
|
13
13
|
test?: () => Promise<void>;
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -4,17 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import { ToolId } from '@dxos/ai';
|
|
6
6
|
import { Blueprint } from '@dxos/blueprints';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Ref } from '@dxos/echo';
|
|
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.',
|
|
14
14
|
instructions: {
|
|
15
|
-
source: Ref.make(
|
|
15
|
+
source: Ref.make(Text.make()),
|
|
16
16
|
},
|
|
17
17
|
tools: [ToolId.make('AnthropicWebSearch')],
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
export default blueprint;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, it } from '@effect/vitest';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
|
+
|
|
9
|
+
import { AiSession } from '@dxos/assistant';
|
|
10
|
+
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
11
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
12
|
+
import { log } from '@dxos/log';
|
|
13
|
+
import { Project } from '@dxos/types';
|
|
14
|
+
|
|
15
|
+
import { makeGraphWriterHandler, makeGraphWriterToolkit } from './graph';
|
|
16
|
+
|
|
17
|
+
const TestLayer = AssistantTestLayer({});
|
|
18
|
+
|
|
19
|
+
describe('graph', () => {
|
|
20
|
+
// let builder: EchoTestBuilder;
|
|
21
|
+
// test('findRelatedSchema', async () => {
|
|
22
|
+
// const db = await createEchoDatabase();
|
|
23
|
+
// const relatedSchemas = await findRelatedSchema(db, Schema.Struct({}));
|
|
24
|
+
// });
|
|
25
|
+
|
|
26
|
+
const Toolkit = makeGraphWriterToolkit({ schema: [Project.Project] });
|
|
27
|
+
const ToolkitLayer = makeGraphWriterHandler(Toolkit);
|
|
28
|
+
|
|
29
|
+
it.effect.skip(
|
|
30
|
+
'calculator',
|
|
31
|
+
Effect.fn(
|
|
32
|
+
function* (_) {
|
|
33
|
+
const session = new AiSession();
|
|
34
|
+
const toolkit = yield* Toolkit;
|
|
35
|
+
const response = yield* session.run({
|
|
36
|
+
toolkit,
|
|
37
|
+
prompt: 'What is 10 + 20?',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
log.info('response', { response });
|
|
41
|
+
},
|
|
42
|
+
Effect.provide(Layer.mergeAll(TestLayer, ToolkitLayer)),
|
|
43
|
+
TestHelpers.provideTestContext,
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
});
|