@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
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
|
-
|
|
8
|
-
import { Relation } from '@dxos/echo';
|
|
9
|
-
import { DatabaseService, TracingService, defineFunction } from '@dxos/functions';
|
|
10
|
-
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { DXN, ObjectId } from '@dxos/keys';
|
|
12
|
-
import { log } from '@dxos/log';
|
|
13
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
14
|
-
import { DataType } from '@dxos/schema';
|
|
15
|
-
import { trim } from '@dxos/util';
|
|
16
|
-
|
|
17
|
-
export default defineFunction({
|
|
18
|
-
key: 'dxos.org/function/research/create-document',
|
|
19
|
-
name: 'Create research document',
|
|
20
|
-
description: 'Creates a note summarizing the research.',
|
|
21
|
-
inputSchema: Schema.Struct({
|
|
22
|
-
name: Schema.String.annotations({
|
|
23
|
-
description: 'Name of the note.',
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
content: Schema.String.annotations({
|
|
27
|
-
description: trim`
|
|
28
|
-
Content of the note.
|
|
29
|
-
Supports (and are prefered) references to research objects using @ syntax and <object> tags (refer to research blueprint instructions).
|
|
30
|
-
`,
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
// TODO(dmaretskyi): Use a specialized type for this (e.g., ArtifactId renamed as RefFromLLM).
|
|
34
|
-
target: Schema.String.annotations({
|
|
35
|
-
description: trim`
|
|
36
|
-
Id of the object (organization, contact, etc.) for which the research was performed.
|
|
37
|
-
This must be a ulid.
|
|
38
|
-
`,
|
|
39
|
-
}),
|
|
40
|
-
}),
|
|
41
|
-
outputSchema: Schema.Struct({}), // TODO(burdon): Schema.Void?
|
|
42
|
-
handler: Effect.fnUntraced(function* ({ data: { target, name, content } }) {
|
|
43
|
-
log.info('Creating research document', { target, name, content });
|
|
44
|
-
|
|
45
|
-
yield* DatabaseService.flush({ indexes: true });
|
|
46
|
-
yield* TracingService.emitStatus({ message: 'Creating research document...' });
|
|
47
|
-
invariant(ObjectId.isValid(target));
|
|
48
|
-
|
|
49
|
-
const targetObj = yield* DatabaseService.resolve(DXN.fromLocalObjectId(target));
|
|
50
|
-
|
|
51
|
-
const doc = yield* DatabaseService.add(
|
|
52
|
-
Markdown.makeDocument({
|
|
53
|
-
name,
|
|
54
|
-
content,
|
|
55
|
-
}),
|
|
56
|
-
);
|
|
57
|
-
yield* DatabaseService.add(
|
|
58
|
-
Relation.make(DataType.HasSubject, {
|
|
59
|
-
[Relation.Source]: doc,
|
|
60
|
-
[Relation.Target]: targetObj as any,
|
|
61
|
-
completedAt: new Date().toISOString(),
|
|
62
|
-
}),
|
|
63
|
-
);
|
|
64
|
-
yield* DatabaseService.flush({ indexes: true });
|
|
65
|
-
|
|
66
|
-
log.info('Created research document', { target, name, content });
|
|
67
|
-
return {};
|
|
68
|
-
}),
|
|
69
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
|
|
6
|
-
import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
|
|
7
|
-
import { describe, it } from '@effect/vitest';
|
|
8
|
-
import * as Config from 'effect/Config';
|
|
9
|
-
import * as Effect from 'effect/Effect';
|
|
10
|
-
import * as Function from 'effect/Function';
|
|
11
|
-
import * as Layer from 'effect/Layer';
|
|
12
|
-
|
|
13
|
-
import { AiService, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
14
|
-
import * as AiServiceRouter from '@dxos/ai/AiServiceRouter';
|
|
15
|
-
import { tapHttpErrors } from '@dxos/ai/testing';
|
|
16
|
-
import { AiSession } from '@dxos/assistant';
|
|
17
|
-
import { TestHelpers } from '@dxos/effect';
|
|
18
|
-
import { DatabaseService, TracingService } from '@dxos/functions';
|
|
19
|
-
import { log } from '@dxos/log';
|
|
20
|
-
import { DataType } from '@dxos/schema';
|
|
21
|
-
|
|
22
|
-
import { makeGraphWriterHandler, makeGraphWriterToolkit } from './graph';
|
|
23
|
-
|
|
24
|
-
// import { type EchoTestBuilder } from '@dxos/echo-db/testing';
|
|
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
|
-
);
|
|
41
|
-
|
|
42
|
-
describe('graph', () => {
|
|
43
|
-
// let builder: EchoTestBuilder;
|
|
44
|
-
// test('findRelatedSchema', async () => {
|
|
45
|
-
// const db = await createEchoDatabase();
|
|
46
|
-
// const relatedSchemas = await findRelatedSchema(db, Schema.Struct({}));
|
|
47
|
-
// });
|
|
48
|
-
|
|
49
|
-
const Toolkit = makeGraphWriterToolkit({ schema: [DataType.Project] });
|
|
50
|
-
const ToolkitLayer = makeGraphWriterHandler(Toolkit);
|
|
51
|
-
|
|
52
|
-
it.effect.skip(
|
|
53
|
-
'calculator',
|
|
54
|
-
Effect.fn(
|
|
55
|
-
function* (_) {
|
|
56
|
-
const session = new AiSession();
|
|
57
|
-
const toolkit = yield* Toolkit;
|
|
58
|
-
const response = yield* session.run({
|
|
59
|
-
toolkit,
|
|
60
|
-
prompt: 'What is 10 + 20?',
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
log.info('response', { response });
|
|
64
|
-
},
|
|
65
|
-
Effect.provide(Layer.mergeAll(TestLayer, ToolkitLayer)),
|
|
66
|
-
TestHelpers.runIf(process.env.ANTHROPIC_API_KEY),
|
|
67
|
-
),
|
|
68
|
-
);
|
|
69
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|