@dxos/assistant-toolkit 0.8.4-main.72ec0f3 → 0.8.4-main.937b3ca
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 +388 -285
- 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 +388 -285
- 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 +10 -10
- 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 +10 -10
- 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/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/read.d.ts.map +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 +100 -99
- package/dist/types/src/functions/entity-extraction/entity-extraction.d.ts.map +1 -1
- package/dist/types/src/functions/entity-extraction/index.d.ts +100 -99
- 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.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.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/read.d.ts.map +1 -1
- package/dist/types/src/functions/tasks/update.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -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/initiative/functions/update.d.ts +7 -0
- 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 +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/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -35
- package/src/blueprints/design/design-blueprint.test.ts +10 -8
- 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/linear/index.ts +1 -1
- package/src/blueprints/linear/linear-blueprint.ts +2 -4
- package/src/blueprints/planning/index.ts +1 -1
- package/src/blueprints/planning/planning-blueprint.test.ts +8 -6
- 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 -2
- package/src/blueprints/websearch/index.ts +2 -1
- package/src/blueprints/websearch/websearch-blueprint.ts +2 -4
- package/src/crud/graph.test.ts +4 -27
- package/src/crud/graph.ts +32 -40
- package/src/experimental/feed.test.ts +1 -1
- package/src/functions/agent/prompt.ts +17 -13
- package/src/functions/discord/fetch-messages.test.ts +1 -1
- package/src/functions/discord/fetch-messages.ts +1 -1
- 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 +7 -6
- package/src/functions/entity-extraction/entity-extraction.ts +46 -28
- package/src/functions/exa/mock.ts +1 -1
- package/src/functions/github/fetch-prs.ts +3 -2
- package/src/functions/linear/linear.test.ts +11 -10
- package/src/functions/linear/sync-issues.ts +7 -5
- package/src/functions/research/document-create.ts +7 -6
- 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 +24 -32
- package/src/functions/research/research.ts +8 -9
- package/src/functions/research/types.ts +1 -1
- package/src/functions/tasks/read.ts +4 -3
- package/src/functions/tasks/update.ts +4 -3
- package/src/index.ts +0 -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 -1
- package/src/toolkits/AssistantToolkit.test.ts +17 -11
- package/src/toolkits/AssistantToolkit.ts +31 -8
- package/src/toolkits/SystemToolkit.ts +100 -32
- 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.937b3ca",
|
|
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,55 +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/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/blueprints": "0.8.4-main.
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/echo": "0.8.4-main.
|
|
40
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
41
|
-
"@dxos/echo-protocol": "0.8.4-main.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/errors": "0.8.4-main.
|
|
45
|
-
"@dxos/functions
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/plugin-markdown": "0.8.4-main.
|
|
51
|
-
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.
|
|
52
|
-
"@dxos/schema": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
47
|
+
"@dxos/app-framework": "0.8.4-main.937b3ca",
|
|
48
|
+
"@dxos/ai": "0.8.4-main.937b3ca",
|
|
49
|
+
"@dxos/assistant": "0.8.4-main.937b3ca",
|
|
50
|
+
"@dxos/blueprints": "0.8.4-main.937b3ca",
|
|
51
|
+
"@dxos/conductor": "0.8.4-main.937b3ca",
|
|
52
|
+
"@dxos/context": "0.8.4-main.937b3ca",
|
|
53
|
+
"@dxos/echo": "0.8.4-main.937b3ca",
|
|
54
|
+
"@dxos/echo-db": "0.8.4-main.937b3ca",
|
|
55
|
+
"@dxos/echo-protocol": "0.8.4-main.937b3ca",
|
|
56
|
+
"@dxos/edge-client": "0.8.4-main.937b3ca",
|
|
57
|
+
"@dxos/effect": "0.8.4-main.937b3ca",
|
|
58
|
+
"@dxos/errors": "0.8.4-main.937b3ca",
|
|
59
|
+
"@dxos/functions": "0.8.4-main.937b3ca",
|
|
60
|
+
"@dxos/keys": "0.8.4-main.937b3ca",
|
|
61
|
+
"@dxos/log": "0.8.4-main.937b3ca",
|
|
62
|
+
"@dxos/functions-runtime": "0.8.4-main.937b3ca",
|
|
63
|
+
"@dxos/invariant": "0.8.4-main.937b3ca",
|
|
64
|
+
"@dxos/plugin-markdown": "0.8.4-main.937b3ca",
|
|
65
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.937b3ca",
|
|
66
|
+
"@dxos/schema": "0.8.4-main.937b3ca",
|
|
67
|
+
"@dxos/util": "0.8.4-main.937b3ca",
|
|
68
|
+
"@dxos/types": "0.8.4-main.937b3ca"
|
|
55
69
|
},
|
|
56
70
|
"devDependencies": {
|
|
57
|
-
"effect": "3.
|
|
58
|
-
"react": "~19.2.
|
|
59
|
-
"react-dom": "~19.2.
|
|
71
|
+
"effect": "3.19.11",
|
|
72
|
+
"react": "~19.2.3",
|
|
73
|
+
"react-dom": "~19.2.3"
|
|
60
74
|
},
|
|
61
75
|
"peerDependencies": {
|
|
62
|
-
"effect": "
|
|
63
|
-
"react": "
|
|
64
|
-
"react-dom": "
|
|
76
|
+
"effect": "3.19.11",
|
|
77
|
+
"react": "~19.2.3",
|
|
78
|
+
"react-dom": "~19.2.3"
|
|
65
79
|
},
|
|
66
80
|
"publishConfig": {
|
|
67
81
|
"access": "public"
|
|
@@ -17,8 +17,10 @@ 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 {
|
|
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';
|
|
@@ -29,7 +31,7 @@ import { trim } from '@dxos/util';
|
|
|
29
31
|
import { Document } from '../../functions';
|
|
30
32
|
import { testToolkit } from '../testing';
|
|
31
33
|
|
|
32
|
-
import blueprint from './design-blueprint';
|
|
34
|
+
import { blueprint } from './design-blueprint';
|
|
33
35
|
|
|
34
36
|
describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
35
37
|
it.scoped(
|
|
@@ -38,21 +40,21 @@ describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
|
38
40
|
function* ({ expect }) {
|
|
39
41
|
const observer = GenerationObserver.fromPrinter(new ConsolePrinter());
|
|
40
42
|
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
41
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation(queue));
|
|
43
|
+
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
42
44
|
|
|
43
|
-
yield*
|
|
45
|
+
yield* Database.Service.add(blueprint);
|
|
44
46
|
yield* Effect.promise(() =>
|
|
45
47
|
conversation.context.bind({
|
|
46
48
|
blueprints: [Ref.make(blueprint)],
|
|
47
49
|
}),
|
|
48
50
|
);
|
|
49
51
|
|
|
50
|
-
const artifact = yield*
|
|
52
|
+
const artifact = yield* Database.Service.add(Markdown.make({ content: 'Hello, world!' }));
|
|
51
53
|
let prevContent = artifact.content;
|
|
52
54
|
|
|
53
55
|
{
|
|
54
56
|
const prompt = trim`
|
|
55
|
-
I want to design a new feature for our product.
|
|
57
|
+
I want to design a new feature for our product.
|
|
56
58
|
|
|
57
59
|
We need to add a user profile system with the following requirements:
|
|
58
60
|
1. Users should be able to create and edit their profiles
|
|
@@ -72,7 +74,7 @@ describe('Design Blueprint', { timeout: 120_000 }, () => {
|
|
|
72
74
|
|
|
73
75
|
{
|
|
74
76
|
const prompt = trim`
|
|
75
|
-
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.
|
|
76
78
|
Adjust the spec to reflect this.
|
|
77
79
|
`;
|
|
78
80
|
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -16,8 +16,10 @@ 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 {
|
|
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';
|
|
21
23
|
import { FunctionImplementationResolver } from '@dxos/functions-runtime';
|
|
22
24
|
import { FunctionInvocationServiceLayerTestMocked, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
|
|
23
25
|
import { log } from '@dxos/log';
|
|
@@ -29,7 +31,7 @@ import { trim } from '@dxos/util';
|
|
|
29
31
|
import { Tasks } from '../../functions';
|
|
30
32
|
import { type TestStep, runSteps, testToolkit } from '../testing';
|
|
31
33
|
|
|
32
|
-
import blueprint from './planning-blueprint';
|
|
34
|
+
import { blueprint } from './planning-blueprint';
|
|
33
35
|
|
|
34
36
|
describe('Planning Blueprint', { timeout: 120_000 }, () => {
|
|
35
37
|
it.scoped(
|
|
@@ -37,16 +39,16 @@ describe('Planning Blueprint', { timeout: 120_000 }, () => {
|
|
|
37
39
|
Effect.fn(
|
|
38
40
|
function* ({ expect }) {
|
|
39
41
|
const queue = yield* QueueService.createQueue<Message.Message | ContextBinding>();
|
|
40
|
-
const conversation = yield* acquireReleaseResource(() => new AiConversation(queue));
|
|
42
|
+
const conversation = yield* acquireReleaseResource(() => new AiConversation({ queue }));
|
|
41
43
|
|
|
42
|
-
yield*
|
|
44
|
+
yield* Database.Service.add(blueprint);
|
|
43
45
|
yield* Effect.promise(() =>
|
|
44
46
|
conversation.context.bind({
|
|
45
47
|
blueprints: [Ref.make(blueprint)],
|
|
46
48
|
}),
|
|
47
49
|
);
|
|
48
50
|
|
|
49
|
-
const artifact = yield*
|
|
51
|
+
const artifact = yield* Database.Service.add(Markdown.make());
|
|
50
52
|
let prevContent = artifact.content;
|
|
51
53
|
const matchList =
|
|
52
54
|
({ includes = [], excludes = [] }: { includes: RegExp[]; excludes?: RegExp[] }) =>
|
|
@@ -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;
|
|
@@ -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,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/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
13
|
import { Project } 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;
|
|
@@ -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
|
});
|