@dxos/assistant 0.8.4-main.b97322e → 0.8.4-main.bc2380dfbc
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/LICENSE +102 -5
- package/README.md +2 -1
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/extraction/index.mjs +204 -0
- package/dist/lib/neutral/extraction/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1755 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/types/src/extraction/extraction-ner-function/index.d.ts +0 -1
- package/dist/types/src/extraction/extraction-ner-function/index.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction.d.ts +1066 -273
- package/dist/types/src/extraction/extraction.d.ts.map +1 -1
- package/dist/types/src/extraction/index.d.ts +0 -1
- package/dist/types/src/extraction/index.d.ts.map +1 -1
- package/dist/types/src/extraction/quotes.d.ts +3 -3
- package/dist/types/src/extraction/quotes.d.ts.map +1 -1
- package/dist/types/src/functions/services.d.ts +15 -4
- package/dist/types/src/functions/services.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/request/AiRequest.d.ts +104 -0
- package/dist/types/src/request/AiRequest.d.ts.map +1 -0
- package/dist/types/src/request/artifact-diff.d.ts +27 -0
- package/dist/types/src/request/artifact-diff.d.ts.map +1 -0
- package/dist/types/src/request/format.d.ts +15 -0
- package/dist/types/src/request/format.d.ts.map +1 -0
- package/dist/types/src/request/index.d.ts +4 -0
- package/dist/types/src/request/index.d.ts.map +1 -0
- package/dist/types/src/request/observer.d.ts +23 -0
- package/dist/types/src/request/observer.d.ts.map +1 -0
- package/dist/types/src/{session → request}/version-pin.d.ts +4 -4
- package/dist/types/src/request/version-pin.d.ts.map +1 -0
- package/dist/types/src/session/AiContext.d.ts +154 -0
- package/dist/types/src/session/AiContext.d.ts.map +1 -0
- package/dist/types/src/session/AiContext.test.d.ts +2 -0
- package/dist/types/src/session/AiContext.test.d.ts.map +1 -0
- package/dist/types/src/session/AiSession.d.ts +73 -0
- package/dist/types/src/session/AiSession.d.ts.map +1 -0
- package/dist/types/src/session/index.d.ts +3 -2
- package/dist/types/src/session/index.d.ts.map +1 -1
- package/dist/types/src/session/toolkit.d.ts +16 -0
- package/dist/types/src/session/toolkit.d.ts.map +1 -0
- package/dist/types/src/templates/index.d.ts +1 -1
- package/dist/types/src/templates/system.d.ts +17 -0
- package/dist/types/src/templates/system.d.ts.map +1 -0
- package/dist/types/src/util/artifact.d.ts +27 -0
- package/dist/types/src/util/artifact.d.ts.map +1 -0
- package/dist/types/src/util/diff.d.ts +17 -0
- package/dist/types/src/util/diff.d.ts.map +1 -0
- package/dist/types/src/util/diff.test.d.ts +2 -0
- package/dist/types/src/util/diff.test.d.ts.map +1 -0
- package/dist/types/src/util/error-handling.d.ts +4 -0
- package/dist/types/src/util/error-handling.d.ts.map +1 -0
- package/dist/types/src/util/errors.d.ts +67 -0
- package/dist/types/src/util/errors.d.ts.map +1 -0
- package/dist/types/src/util/execution-graph.d.ts +85 -0
- package/dist/types/src/util/execution-graph.d.ts.map +1 -0
- package/dist/types/src/util/execution-graph.test.d.ts +2 -0
- package/dist/types/src/util/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +7 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/tracing.d.ts +233 -0
- package/dist/types/src/util/tracing.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +42 -36
- package/src/extraction/extraction-ner-function/index.ts +0 -1
- package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
- package/src/extraction/extraction-ner-function/named-entity-recognition.ts +2 -0
- package/src/extraction/extraction.ts +44 -15
- package/src/extraction/index.ts +0 -1
- package/src/extraction/quotes.test.ts +3 -3
- package/src/extraction/quotes.ts +6 -7
- package/src/functions/services.ts +173 -98
- package/src/index.ts +2 -5
- package/src/request/AiRequest.ts +348 -0
- package/src/request/artifact-diff.ts +41 -0
- package/src/request/format.ts +147 -0
- package/src/request/index.ts +8 -0
- package/src/request/observer.ts +62 -0
- package/src/{session → request}/version-pin.ts +8 -8
- package/src/session/AiContext.test.ts +53 -0
- package/src/session/AiContext.ts +403 -0
- package/src/session/AiSession.ts +324 -0
- package/src/session/index.ts +4 -2
- package/src/session/toolkit.ts +47 -0
- package/src/templates/index.ts +1 -1
- package/src/templates/instructions/format.tpl +57 -0
- package/src/templates/instructions/system.tpl +96 -0
- package/src/templates/system.ts +42 -0
- package/src/typings.d.ts +5 -0
- package/src/util/artifact.ts +88 -0
- package/src/util/diff.test.ts +74 -0
- package/src/util/diff.ts +93 -0
- package/src/util/error-handling.ts +42 -0
- package/src/util/errors.ts +15 -0
- package/src/util/execution-graph.test.ts +740 -0
- package/src/util/execution-graph.ts +519 -0
- package/src/util/index.ts +10 -0
- package/src/util/tracing.ts +57 -0
- package/dist/lib/browser/index.mjs +0 -1831
- 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 -1833
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/types/bin/chat.d.ts +0 -2
- package/dist/types/bin/chat.d.ts.map +0 -1
- package/dist/types/src/context/binder.d.ts +0 -34
- package/dist/types/src/context/binder.d.ts.map +0 -1
- package/dist/types/src/context/binding.d.ts +0 -56
- package/dist/types/src/context/binding.d.ts.map +0 -1
- package/dist/types/src/context/index.d.ts +0 -3
- package/dist/types/src/context/index.d.ts.map +0 -1
- package/dist/types/src/conversation/conversation.d.ts +0 -38
- package/dist/types/src/conversation/conversation.d.ts.map +0 -1
- package/dist/types/src/conversation/index.d.ts +0 -2
- package/dist/types/src/conversation/index.d.ts.map +0 -1
- package/dist/types/src/errors.d.ts +0 -38
- package/dist/types/src/errors.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +0 -4
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +0 -2
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts +0 -2
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +0 -302
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +0 -2
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +0 -1
- package/dist/types/src/research/exa.d.ts +0 -12
- package/dist/types/src/research/exa.d.ts.map +0 -1
- package/dist/types/src/research/graph.d.ts +0 -51
- package/dist/types/src/research/graph.d.ts.map +0 -1
- package/dist/types/src/research/graph.test.d.ts +0 -2
- package/dist/types/src/research/graph.test.d.ts.map +0 -1
- package/dist/types/src/research/index.d.ts +0 -4
- package/dist/types/src/research/index.d.ts.map +0 -1
- package/dist/types/src/research/research.d.ts +0 -10
- package/dist/types/src/research/research.d.ts.map +0 -1
- package/dist/types/src/research/research.test.d.ts +0 -2
- package/dist/types/src/research/research.test.d.ts.map +0 -1
- package/dist/types/src/session/session.d.ts +0 -260
- package/dist/types/src/session/session.d.ts.map +0 -1
- package/dist/types/src/session/session.test.d.ts +0 -2
- package/dist/types/src/session/session.test.d.ts.map +0 -1
- package/dist/types/src/session/version-pin.d.ts.map +0 -1
- package/dist/types/src/session/version-pin.test.d.ts +0 -2
- package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
- package/dist/types/src/summarization/summarization.test.d.ts +0 -2
- package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
- package/dist/types/src/templates/prompt.d.ts +0 -30
- package/dist/types/src/templates/prompt.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337321991.d.ts +0 -38
- package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337331526.d.ts +0 -37
- package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337344119.d.ts +0 -58
- package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -3
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -13
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/context/binder.ts +0 -103
- package/src/context/binding.ts +0 -32
- package/src/context/index.ts +0 -6
- package/src/conversation/conversation.ts +0 -96
- package/src/conversation/index.ts +0 -5
- package/src/errors.ts +0 -10
- package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +0 -83
- package/src/extraction/extraction-llm-function/extraction-llm-function.ts +0 -70
- package/src/extraction/extraction-llm-function/index.ts +0 -5
- package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +0 -115
- package/src/extraction/extraction-ner-function/extraction-ner-function.ts +0 -57
- package/src/research/exa.ts +0 -97
- package/src/research/graph.test.ts +0 -64
- package/src/research/graph.ts +0 -369
- package/src/research/index.ts +0 -7
- package/src/research/instructions-research.tpl +0 -98
- package/src/research/research.test.ts +0 -190
- package/src/research/research.ts +0 -87
- package/src/session/__snapshots__/session.test.ts.snap +0 -32
- package/src/session/session.test.ts +0 -310
- package/src/session/session.ts +0 -336
- package/src/session/version-pin.test.ts +0 -7
- package/src/summarization/summarization.test.ts +0 -208
- package/src/templates/assistant.tpl +0 -111
- package/src/templates/prompt.ts +0 -45
- package/src/testing/exa-search-1748337321991.ts +0 -131
- package/src/testing/exa-search-1748337331526.ts +0 -144
- package/src/testing/exa-search-1748337344119.ts +0 -133
- package/src/testing/index.ts +0 -11
- package/src/typedefs.d.ts +0 -8
- package/src/types.ts +0 -47
- /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../../../src/extraction/extraction.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../../../src/extraction/extraction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAIjC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS1B,CAAC;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC;CAAG;AAEtF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG3B,CAAC;AACH,MAAM,WAAW,gBAAiB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAExF,MAAM,MAAM,6BAA6B,G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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAQhC,CAAC;AAEH;;GAEG;AAEH,eAAO,MAAM,wBAAwB,WAAkB,6BAA6B,KAAG,OAAO,CAAC,gBAAgB,CAqB9G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extraction/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extraction/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,UAAU,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { type Database } from '@dxos/echo';
|
|
3
3
|
export declare const ReferencedQuotes: Schema.Struct<{
|
|
4
4
|
references: Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
5
5
|
id: typeof Schema.String;
|
|
@@ -7,7 +7,7 @@ export declare const ReferencedQuotes: Schema.Struct<{
|
|
|
7
7
|
}>>>;
|
|
8
8
|
}>;
|
|
9
9
|
export type ReferencedQuotes = Schema.Schema.Type<typeof ReferencedQuotes>;
|
|
10
|
-
export declare const findQuotes: (quotes: string[], db:
|
|
10
|
+
export declare const findQuotes: (quotes: string[], db: Database.Database) => Promise<ReferencedQuotes>;
|
|
11
11
|
/**
|
|
12
12
|
* Finds and replaces all quotes with DXNs references.
|
|
13
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../../src/extraction/quotes.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../../src/extraction/quotes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAK1D,eAAO,MAAM,gBAAgB;;;;;EAe3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E,eAAO,MAAM,UAAU,WAAkB,MAAM,EAAE,MAAM,QAAQ,CAAC,QAAQ,KAAG,OAAO,CAAC,gBAAgB,CASlG,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,gBAAgB,SAAU,MAAM,UAAU,gBAAgB,WAYtE,CAAC"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Tool from '@effect/ai/Tool';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import * as Option from 'effect/Option';
|
|
2
5
|
import { ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
+
import { OpaqueToolkit } from '@dxos/ai';
|
|
7
|
+
import { Operation, OperationRegistry } from '@dxos/compute';
|
|
8
|
+
export declare const makeToolResolverFromOperations: <R = never>({ toolkit: extraToolkit, }?: {
|
|
9
|
+
toolkit?: OpaqueToolkit.OpaqueToolkit<never, never, R>;
|
|
10
|
+
}) => Layer.Layer<ToolResolverService, never, OpaqueToolkit.OpaqueToolkitProvider | OperationRegistry.Service | R>;
|
|
11
|
+
export declare const makeToolExecutionService: <E, R>(opts: {
|
|
12
|
+
invoke: (tool: Tool.Any, input: unknown) => Effect.Effect<unknown>;
|
|
13
|
+
}) => Layer.Layer<ToolExecutionService, never, OpaqueToolkit.OpaqueToolkitProvider>;
|
|
14
|
+
export declare const makeToolExecutionServiceFromOperationInvoker: () => Layer.Layer<ToolExecutionService, never, Operation.Service | OpaqueToolkit.OpaqueToolkitProvider>;
|
|
15
|
+
export declare const ToolExecutionServices: Layer.Layer<ToolExecutionService | ToolResolverService, never, OpaqueToolkit.OpaqueToolkitProvider | Operation.Service | OperationRegistry.Service>;
|
|
16
|
+
export declare const getOperationFromTool: (tool: Tool.Any) => Option.Option<Operation.Definition.Any>;
|
|
6
17
|
//# sourceMappingURL=services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/functions/services.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/functions/services.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAuB,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAO7D,eAAO,MAAM,8BAA8B,GAAI,CAAC,GAAG,KAAK,+BAErD;IAAE,OAAO,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;CAAE,KAAQ,KAAK,CAAC,KAAK,CAC9E,mBAAmB,EACnB,KAAK,EACL,aAAa,CAAC,qBAAqB,GAAG,iBAAiB,CAAC,OAAO,GAAG,CAAC,CA6BpE,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,CAAC,EAAE,CAAC,QAAQ;IACnD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;CACpE,KAAG,KAAK,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,EAAE,aAAa,CAAC,qBAAqB,CAkC7E,CAAC;AAEJ,eAAO,MAAM,4CAA4C,QAAO,KAAK,CAAC,KAAK,CACzE,oBAAoB,EACpB,KAAK,EACL,SAAS,CAAC,OAAO,GAAG,aAAa,CAAC,qBAAqB,CAgBxD,CAAC;AAEF,eAAO,MAAM,qBAAqB,qJAGjC,CAAC;AAOF,eAAO,MAAM,oBAAoB,SAAU,IAAI,CAAC,GAAG,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAE3F,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
export * from './context';
|
|
2
|
-
export * from './conversation';
|
|
3
|
-
export * from './extraction';
|
|
4
1
|
export * from './functions';
|
|
5
|
-
export * from './
|
|
2
|
+
export * from './request';
|
|
6
3
|
export * from './session';
|
|
7
4
|
export * from './templates';
|
|
8
|
-
export * from './
|
|
5
|
+
export * from './util';
|
|
9
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type * as AiError from '@effect/ai/AiError';
|
|
2
|
+
import * as LanguageModel from '@effect/ai/LanguageModel';
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
import { type AiToolNotFoundError, type OpaqueToolkit, type PromptPreprocessingError, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
|
|
5
|
+
import { type Blueprint, Trace, Operation, OperationRegistry } from '@dxos/compute';
|
|
6
|
+
import { Database, Obj } from '@dxos/echo';
|
|
7
|
+
import { ContentBlock, Message } from '@dxos/types';
|
|
8
|
+
import { type AiAssistantError } from '../util';
|
|
9
|
+
import { GenerationObserver } from './observer';
|
|
10
|
+
export type RunError = AiError.AiError | PromptPreprocessingError | AiToolNotFoundError | AiAssistantError;
|
|
11
|
+
export type RunRequirements = LanguageModel.LanguageModel | ToolExecutionService | ToolResolverService | Database.Service | Operation.Service | OperationRegistry.Service | Trace.TraceService;
|
|
12
|
+
export type Options = {
|
|
13
|
+
/**
|
|
14
|
+
* Summarize before executing the prompt if the existing history exceeds this threshold.
|
|
15
|
+
*/
|
|
16
|
+
summarizationThreshold?: number;
|
|
17
|
+
observer?: GenerationObserver;
|
|
18
|
+
/**
|
|
19
|
+
* Callback for when a message is received from the user, model, or tool.
|
|
20
|
+
* This is useful for streaming the output to a queue.
|
|
21
|
+
*/
|
|
22
|
+
onOutput?: (message: Message.Message) => Effect.Effect<void, never, never>;
|
|
23
|
+
};
|
|
24
|
+
export type RunProps<R = never> = {
|
|
25
|
+
prompt: string | ContentBlock.Any[];
|
|
26
|
+
system?: string;
|
|
27
|
+
history?: Message.Message[];
|
|
28
|
+
objects?: Obj.Unknown[];
|
|
29
|
+
blueprints?: readonly Blueprint.Blueprint[];
|
|
30
|
+
toolkit?: OpaqueToolkit.OpaqueToolkit<R>;
|
|
31
|
+
};
|
|
32
|
+
export type BeginProps = {
|
|
33
|
+
prompt: string | ContentBlock.Any[];
|
|
34
|
+
system?: string;
|
|
35
|
+
history?: Message.Message[];
|
|
36
|
+
objects?: Obj.Unknown[];
|
|
37
|
+
blueprints?: readonly Blueprint.Blueprint[];
|
|
38
|
+
};
|
|
39
|
+
export type TurnProps<R = never> = {
|
|
40
|
+
system: string;
|
|
41
|
+
toolkit?: OpaqueToolkit.OpaqueToolkit<R>;
|
|
42
|
+
};
|
|
43
|
+
export type TurnResult = {
|
|
44
|
+
messages: Message.Message[];
|
|
45
|
+
done: boolean;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Contains message history, tools, current context.
|
|
49
|
+
* Current context means the state of the app, time of day, and other contextual information.
|
|
50
|
+
* It makes requests to the model, its a state machine.
|
|
51
|
+
* It keeps track of the current goal.
|
|
52
|
+
* It manages the context window.
|
|
53
|
+
* Tracks the success criteria of reaching the goal, exposing metrics (stretch).
|
|
54
|
+
* Could be run locally in the app or remotely.
|
|
55
|
+
* Could be personal or shared.
|
|
56
|
+
*/
|
|
57
|
+
export declare class Request {
|
|
58
|
+
private readonly _options;
|
|
59
|
+
/** Prevents concurrent execution of session. */
|
|
60
|
+
private readonly _semaphore;
|
|
61
|
+
private readonly _observer;
|
|
62
|
+
private readonly _onOutput;
|
|
63
|
+
/** Message history from queue. */
|
|
64
|
+
private _history;
|
|
65
|
+
/** Pending messages for this session (incl. the current prompt). */
|
|
66
|
+
private _pending;
|
|
67
|
+
private _started;
|
|
68
|
+
private _ended;
|
|
69
|
+
private _toolCalls;
|
|
70
|
+
constructor(_options?: Options);
|
|
71
|
+
get duration(): number;
|
|
72
|
+
get toolCalls(): number;
|
|
73
|
+
get pending(): readonly Message.Message[];
|
|
74
|
+
private _submitMessage;
|
|
75
|
+
getToolCalls: () => {
|
|
76
|
+
block: {
|
|
77
|
+
readonly _tag: "toolCall";
|
|
78
|
+
readonly pending?: boolean | undefined;
|
|
79
|
+
readonly toolCallId: string;
|
|
80
|
+
readonly name: string;
|
|
81
|
+
readonly input: string;
|
|
82
|
+
readonly providerExecuted: boolean;
|
|
83
|
+
};
|
|
84
|
+
message: Message.Message;
|
|
85
|
+
}[];
|
|
86
|
+
/**
|
|
87
|
+
* Initialize a session: set up history, perform summarization if needed, and submit the user prompt.
|
|
88
|
+
* Must be called before `runTurn()`.
|
|
89
|
+
*/
|
|
90
|
+
begin: ({ prompt, system, history, blueprints, objects, }: BeginProps) => Effect.Effect<void, RunError, RunRequirements>;
|
|
91
|
+
/**
|
|
92
|
+
* Execute a single turn: one LLM generation followed by tool execution.
|
|
93
|
+
* The toolkit and system prompt can be updated between turns to reflect context changes (e.g. dynamically enabled blueprints).
|
|
94
|
+
*/
|
|
95
|
+
runAgentTurn: <const R = never>({ system, toolkit: opaqueToolkit, }: TurnProps<R>) => Effect.Effect<TurnResult, RunError, RunRequirements | R>;
|
|
96
|
+
runTools: <const R = never>({ toolkit: opaqueToolkit, }: {
|
|
97
|
+
toolkit?: OpaqueToolkit.OpaqueToolkit<R>;
|
|
98
|
+
}) => Effect.Effect<void, RunError, RunRequirements | R>;
|
|
99
|
+
/**
|
|
100
|
+
* Run a full conversation turn loop. Equivalent to calling `begin()` then `runTurn()` in a loop.
|
|
101
|
+
*/
|
|
102
|
+
run: <const R = never>({ prompt, system: systemTemplate, history, objects, blueprints, toolkit, }: RunProps<R>) => Effect.Effect<Message.Message[], RunError, RunRequirements | R>;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=AiRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiRequest.d.ts","sourceRoot":"","sources":["../../../../src/request/AiRequest.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,OAAO,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAG1D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAIL,KAAK,mBAAmB,EAExB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAEzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE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AE9C;;;OAGG;IACH,YAAY,GAAI,KAAK,CAAC,CAAC,GAAG,KAAK,uCAG5B,SAAS,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,eAAe,GAAG,CAAC,CAAC,CA2ErB;IAErD,QAAQ,GAAI,KAAK,CAAC,CAAC,GAAG,KAAK,+BAExB;QACD,OAAO,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;KAC1C,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,GAAG,CAAC,CAAC,CAoBL;IAEjD;;OAEG;IACH,GAAG,GAAI,KAAK,CAAC,CAAC,GAAG,KAAK,8EAOnB,QAAQ,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,eAAe,GAAG,CAAC,CAAC,CAgBJ;CAC7E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import { type ObjectVersion } from '@dxos/echo-db';
|
|
3
|
+
import { type ObjectId } from '@dxos/keys';
|
|
4
|
+
declare const ArtifactDiffResolver_base: Context.TagClass<ArtifactDiffResolver, "@dxos/assistant/ArtifactDiffResolver", ArtifactDiffResolver.Service>;
|
|
5
|
+
/**
|
|
6
|
+
* Resolves artifact ids to their versions.
|
|
7
|
+
* Used to give the model a sense of the changes to the artifacts made by users during the conversation.
|
|
8
|
+
* The artifacts versions are pinned in the history, and whenever the artifact changes in-between assistant's steps,
|
|
9
|
+
* a diff is inserted into the conversation.
|
|
10
|
+
*
|
|
11
|
+
* Can be optionally provided to the session run call.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ArtifactDiffResolver extends ArtifactDiffResolver_base {
|
|
14
|
+
}
|
|
15
|
+
export declare namespace ArtifactDiffResolver {
|
|
16
|
+
type Service = {
|
|
17
|
+
resolve: (artifacts: {
|
|
18
|
+
id: ObjectId;
|
|
19
|
+
lastVersion: ObjectVersion;
|
|
20
|
+
}[]) => Promise<Map<ObjectId, {
|
|
21
|
+
version: ObjectVersion;
|
|
22
|
+
diff?: string;
|
|
23
|
+
}>>;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=artifact-diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-diff.d.ts","sourceRoot":"","sources":["../../../../src/request/artifact-diff.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAE3C;;;;;;;GAOG;AAEH,qBAAa,oBAAqB,SAAQ,yBAGvC;CAAG;AAEN,yBAAiB,oBAAoB,CAAC,CAAC;IACrC,KAAY,OAAO,GAAG;QACpB,OAAO,EAAE,CACP,SAAS,EAAE;YACT,EAAE,EAAE,QAAQ,CAAC;YACb,WAAW,EAAE,aAAa,CAAC;SAC5B,EAAE,KACA,OAAO,CACV,GAAG,CACD,QAAQ,EACR;YACE,OAAO,EAAE,aAAa,CAAC;YACvB,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CACF,CACF,CAAC;KACH,CAAC;CACH"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { type FunctionNotFoundError, type Operation, type OperationRegistry } from '@dxos/compute';
|
|
3
|
+
import { type Database } from '@dxos/echo';
|
|
4
|
+
import { type ObjectNotFoundError } from '@dxos/echo/Err';
|
|
5
|
+
import { Message } from '@dxos/types';
|
|
6
|
+
import type * as AiRequest from './AiRequest';
|
|
7
|
+
/**
|
|
8
|
+
* Formats the system prompt.
|
|
9
|
+
*/
|
|
10
|
+
export declare const formatSystemPrompt: ({ system, blueprints, objects, }: Pick<AiRequest.RunProps, 'system' | 'blueprints' | 'objects'>) => Effect.Effect<string, FunctionNotFoundError | ObjectNotFoundError, Database.Service | OperationRegistry.Service | Operation.Service>;
|
|
11
|
+
/**
|
|
12
|
+
* Formats the user prompt.
|
|
13
|
+
*/
|
|
14
|
+
export declare const formatUserPrompt: ({ prompt, history, }: Pick<AiRequest.RunProps, 'prompt' | 'history'>) => Effect.Effect<Message.Message, AiRequest.RunError>;
|
|
15
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/request/format.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAY,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,KAAK,QAAQ,EAAO,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAqB,OAAO,EAAE,MAAM,aAAa,CAAC;AAIzD,OAAO,KAAK,KAAK,SAAS,MAAM,aAAa,CAAC;AAG9C;;GAEG;AAEH,eAAO,MAAM,kBAAkB,qCAI5B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC,KAAG,MAAM,CAAC,MAAM,CAC9E,MAAM,EACN,qBAAqB,GAAG,mBAAmB,EAC3C,QAAQ,CAAC,OAAO,GAAG,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAuClB,CAAC;AAEjD;;GAEG;AAGH,eAAO,MAAM,gBAAgB,yBAG1B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,CAoCvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/request/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAE3B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as Tool from '@effect/ai/Tool';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import { type AiParser, type ConsolePrinter } from '@dxos/ai';
|
|
4
|
+
import { type Message } from '@dxos/types';
|
|
5
|
+
/**
|
|
6
|
+
* Live observer of the generation process.
|
|
7
|
+
*/
|
|
8
|
+
export interface GenerationObserver<Tools extends Record<string, Tool.Any> = any> extends AiParser.ParseResponseCallbacks<Tools> {
|
|
9
|
+
/**
|
|
10
|
+
* Complete messages fired during the session, both from the model and from the user.
|
|
11
|
+
* This message will contain all message blocks emitted through the `onBlock` callback.
|
|
12
|
+
*/
|
|
13
|
+
onMessage: (message: Message.Message) => Effect.Effect<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare const GenerationObserver: Readonly<{
|
|
16
|
+
make: ({ onBegin, onPart, onBlock, onEnd, onMessage, }?: Partial<GenerationObserver>) => GenerationObserver;
|
|
17
|
+
noop: () => GenerationObserver<any>;
|
|
18
|
+
/**
|
|
19
|
+
* Debug printer to be used in unit-tests and browser devtools.
|
|
20
|
+
*/
|
|
21
|
+
fromPrinter: (printer: ConsolePrinter) => GenerationObserver<any>;
|
|
22
|
+
}>;
|
|
23
|
+
//# sourceMappingURL=observer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../../src/request/observer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,kBAAkB,CACjC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAC5C,SAAQ,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC;IAC9C;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC9D;AAED,eAAO,MAAM,kBAAkB;6DAO1B,OAAO,CAAC,kBAAkB,CAAC,KAAQ,kBAAkB;;IAUxD;;OAEG;2BACoB,cAAc;EAiBrC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { type Obj } from '@dxos/echo';
|
|
2
3
|
import { type ObjectVersion } from '@dxos/echo-db';
|
|
3
|
-
import { type
|
|
4
|
-
import { type ContentBlock } from '@dxos/schema';
|
|
4
|
+
import { type ContentBlock } from '@dxos/types';
|
|
5
5
|
declare const VersionPinSchema: Schema.Struct<{
|
|
6
6
|
objectId: import("@dxos/keys").ObjectIdClass;
|
|
7
7
|
version: Schema.Schema<ObjectVersion, ObjectVersion, never>;
|
|
@@ -14,7 +14,7 @@ export interface VersionPin extends Schema.Schema.Type<typeof VersionPinSchema>
|
|
|
14
14
|
}
|
|
15
15
|
export declare const VersionPin: typeof VersionPinSchema & {
|
|
16
16
|
DISPOSITION: 'version-pin';
|
|
17
|
-
fromObject: (object:
|
|
17
|
+
fromObject: (object: Obj.Unknown) => VersionPin;
|
|
18
18
|
createBlock: (pin: VersionPin) => ContentBlock.Any;
|
|
19
19
|
};
|
|
20
20
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-pin.d.ts","sourceRoot":"","sources":["../../../../src/request/version-pin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,QAAA,MAAM,gBAAgB;;;EAKpB,CAAC;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAElF,eAAO,MAAM,UAAU,EAAE,OAAO,gBAAgB,GAAG;IACjD,WAAW,EAAE,aAAa,CAAC;IAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,UAAU,CAAC;IAChD,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,YAAY,CAAC,GAAG,CAAC;CAiBpD,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Atom, Registry } from '@effect-atom/atom-react';
|
|
2
|
+
import * as Context from 'effect/Context';
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
import * as Runtime from 'effect/Runtime';
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import { Blueprint } from '@dxos/compute';
|
|
7
|
+
import { Resource } from '@dxos/context';
|
|
8
|
+
import { DXN, Feed, Obj, Ref, Type } from '@dxos/echo';
|
|
9
|
+
import { ComplexSet } from '@dxos/util';
|
|
10
|
+
/**
|
|
11
|
+
* Thread message that binds or unbinds contextual objects to a conversation.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Binding: Type.Obj<{
|
|
14
|
+
readonly blueprints: {
|
|
15
|
+
readonly added: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly description?: string | undefined;
|
|
18
|
+
readonly instructions: {
|
|
19
|
+
readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
20
|
+
readonly name?: string | undefined;
|
|
21
|
+
readonly content: string;
|
|
22
|
+
}>;
|
|
23
|
+
readonly inputs?: readonly {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly kind: "operation" | "value";
|
|
26
|
+
readonly default?: any;
|
|
27
|
+
readonly operation?: string | undefined;
|
|
28
|
+
}[] | undefined;
|
|
29
|
+
};
|
|
30
|
+
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
31
|
+
readonly agentCanEnable?: boolean | undefined;
|
|
32
|
+
readonly mcpServers?: readonly {
|
|
33
|
+
readonly name?: string | undefined;
|
|
34
|
+
readonly url: string;
|
|
35
|
+
readonly protocol: "http" | "sse";
|
|
36
|
+
readonly apiKey?: string | undefined;
|
|
37
|
+
}[] | undefined;
|
|
38
|
+
}>[];
|
|
39
|
+
readonly removed: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly description?: string | undefined;
|
|
42
|
+
readonly instructions: {
|
|
43
|
+
readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
44
|
+
readonly name?: string | undefined;
|
|
45
|
+
readonly content: string;
|
|
46
|
+
}>;
|
|
47
|
+
readonly inputs?: readonly {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly kind: "operation" | "value";
|
|
50
|
+
readonly default?: any;
|
|
51
|
+
readonly operation?: string | undefined;
|
|
52
|
+
}[] | undefined;
|
|
53
|
+
};
|
|
54
|
+
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
55
|
+
readonly agentCanEnable?: boolean | undefined;
|
|
56
|
+
readonly mcpServers?: readonly {
|
|
57
|
+
readonly name?: string | undefined;
|
|
58
|
+
readonly url: string;
|
|
59
|
+
readonly protocol: "http" | "sse";
|
|
60
|
+
readonly apiKey?: string | undefined;
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
}>[];
|
|
63
|
+
};
|
|
64
|
+
readonly objects: {
|
|
65
|
+
readonly added: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
|
|
66
|
+
readonly removed: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
|
|
67
|
+
};
|
|
68
|
+
}, Schema.Struct.Fields>;
|
|
69
|
+
export interface Binding extends Schema.Schema.Type<typeof Binding> {
|
|
70
|
+
}
|
|
71
|
+
export type BindingProps = Partial<{
|
|
72
|
+
blueprints: Ref.Ref<Blueprint.Blueprint>[];
|
|
73
|
+
objects: Ref.Ref<Obj.Unknown>[];
|
|
74
|
+
}>;
|
|
75
|
+
export declare class Bindings {
|
|
76
|
+
readonly blueprints: ComplexSet<Ref.Ref<Blueprint.Blueprint>>;
|
|
77
|
+
readonly objects: ComplexSet<Ref.Ref<Obj.Unknown>>;
|
|
78
|
+
toJSON(): {
|
|
79
|
+
blueprints: DXN.String[];
|
|
80
|
+
objects: DXN.String[];
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export type BinderOptions = {
|
|
84
|
+
feed: Feed.Feed;
|
|
85
|
+
runtime: Runtime.Runtime<Feed.FeedService>;
|
|
86
|
+
registry?: Registry.Registry;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Manages bindings of blueprints and objects to a conversation.
|
|
90
|
+
*/
|
|
91
|
+
export declare class Binder extends Resource {
|
|
92
|
+
#private;
|
|
93
|
+
private readonly _blueprints;
|
|
94
|
+
private readonly _objects;
|
|
95
|
+
private readonly _registry;
|
|
96
|
+
private readonly _feed;
|
|
97
|
+
private readonly _runtime;
|
|
98
|
+
constructor(options: BinderOptions);
|
|
99
|
+
/**
|
|
100
|
+
* Returns the blueprints atom for subscription.
|
|
101
|
+
*/
|
|
102
|
+
get blueprints(): Atom.Atom<Blueprint.Blueprint[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Returns the objects atom for subscription.
|
|
105
|
+
*/
|
|
106
|
+
get objects(): Atom.Atom<Obj.Unknown[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Gets the current blueprints value.
|
|
109
|
+
*/
|
|
110
|
+
getBlueprints(): Blueprint.Blueprint[];
|
|
111
|
+
/**
|
|
112
|
+
* Gets the current objects value.
|
|
113
|
+
*/
|
|
114
|
+
getObjects(): Obj.Unknown[];
|
|
115
|
+
/**
|
|
116
|
+
* Subscribe to changes in blueprints.
|
|
117
|
+
*/
|
|
118
|
+
subscribeBlueprints(cb: (blueprints: Blueprint.Blueprint[]) => void): () => void;
|
|
119
|
+
/**
|
|
120
|
+
* Subscribe to changes in objects.
|
|
121
|
+
*/
|
|
122
|
+
subscribeObjects(cb: (objects: Obj.Unknown[]) => void): () => void;
|
|
123
|
+
protected _open(): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Re-reads bindings from the feed to pick up changes made by other processes.
|
|
126
|
+
*/
|
|
127
|
+
sync(): Promise<void>;
|
|
128
|
+
private _updateBindings;
|
|
129
|
+
protected _close(): Promise<void>;
|
|
130
|
+
bind({ blueprints, objects }: BindingProps): Promise<void>;
|
|
131
|
+
unbind({ blueprints, objects }: BindingProps): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Process bindings to filter duplicates and determine next state.
|
|
134
|
+
*/
|
|
135
|
+
private _processBindings;
|
|
136
|
+
/**
|
|
137
|
+
* Reduce results into sets of blueprints and objects.
|
|
138
|
+
*/
|
|
139
|
+
private _reduce;
|
|
140
|
+
/**
|
|
141
|
+
* Merge resolved items into the current set, adding only items not already present (by DXN).
|
|
142
|
+
*/
|
|
143
|
+
private _mergeInto;
|
|
144
|
+
private _resolve;
|
|
145
|
+
}
|
|
146
|
+
declare const Service_base: Context.TagClass<Service, "@dxos/assistant/AiContextService", {
|
|
147
|
+
binder: Binder;
|
|
148
|
+
}>;
|
|
149
|
+
export declare class Service extends Service_base {
|
|
150
|
+
static bindContext: ({ blueprints, objects }: BindingProps) => Effect.Effect<void, never, Service>;
|
|
151
|
+
static findObjects: <T extends Type.AnyEntity>(type: T) => Effect.Effect<Schema.Schema.Type<T>[], never, Service>;
|
|
152
|
+
}
|
|
153
|
+
export {};
|
|
154
|
+
//# sourceMappingURL=AiContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiContext.d.ts","sourceRoot":"","sources":["../../../../src/session/AiContext.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAA2B,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGhF,OAAO,EAAE,UAAU,EAAiB,MAAM,YAAY,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAenB,CAAC;AAEF,MAAM,WAAW,OAAQ,SAAQ,MAAM,CAAC,MAAM,CAAC,IAA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":""}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type Registry } from '@effect-atom/atom-react';
|
|
2
|
+
import * as Context from 'effect/Context';
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
import * as Layer from 'effect/Layer';
|
|
5
|
+
import * as Runtime from 'effect/Runtime';
|
|
6
|
+
import { type OpaqueToolkit, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
|
|
7
|
+
import { type OperationRegistry, McpServer, Operation } from '@dxos/compute';
|
|
8
|
+
import { Resource } from '@dxos/context';
|
|
9
|
+
import { Database, Feed } from '@dxos/echo';
|
|
10
|
+
import { Message, type ContentBlock } from '@dxos/types';
|
|
11
|
+
import { AiRequest, type GenerationObserver } from '../request';
|
|
12
|
+
import * as AiContext from './AiContext';
|
|
13
|
+
export type RunProps<R = never> = {
|
|
14
|
+
prompt: string | ContentBlock.Any[];
|
|
15
|
+
system?: string;
|
|
16
|
+
observer?: GenerationObserver;
|
|
17
|
+
toolkit?: OpaqueToolkit.OpaqueToolkit<R>;
|
|
18
|
+
/**
|
|
19
|
+
* Space-level MCP servers to connect alongside blueprint-defined ones.
|
|
20
|
+
*/
|
|
21
|
+
mcpServers?: readonly McpServer.McpServer[];
|
|
22
|
+
};
|
|
23
|
+
export type Options = {
|
|
24
|
+
feed: Feed.Feed;
|
|
25
|
+
runtime: Runtime.Runtime<Feed.FeedService>;
|
|
26
|
+
registry?: Registry.Registry;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Durable conversation state (initiated by users and agents) backed by a Feed.
|
|
30
|
+
* Executes tools based on AI responses and supports cancellation of in-progress requests.
|
|
31
|
+
*/
|
|
32
|
+
export declare class Session extends Resource {
|
|
33
|
+
/**
|
|
34
|
+
* Blueprints and objects bound to the session.
|
|
35
|
+
*/
|
|
36
|
+
private readonly _binder;
|
|
37
|
+
private readonly _feed;
|
|
38
|
+
private readonly _runtime;
|
|
39
|
+
constructor(options: Options);
|
|
40
|
+
protected _open(): Promise<void>;
|
|
41
|
+
get feed(): Feed.Feed;
|
|
42
|
+
get context(): AiContext.Binder;
|
|
43
|
+
getHistory(): Promise<Message.Message[]>;
|
|
44
|
+
getTools(): Effect.Effect<Record<string, import('@effect/ai/Tool').Any>, never, ToolExecutionService | ToolResolverService>;
|
|
45
|
+
/**
|
|
46
|
+
* Not provided by default, since users might want to override them.
|
|
47
|
+
*/
|
|
48
|
+
makeToolExecutionServices(): Layer.Layer<ToolExecutionService | ToolResolverService, never, OpaqueToolkit.OpaqueToolkitProvider | Operation.Service | OperationRegistry.Service>;
|
|
49
|
+
/**
|
|
50
|
+
* Creates a new cancelable request effect.
|
|
51
|
+
*/
|
|
52
|
+
createRequest<R = never>(params: RunProps<R>): Effect.Effect<Message.Message[], AiRequest.RunError, AiRequest.RunRequirements | R>;
|
|
53
|
+
}
|
|
54
|
+
declare const Service_base: Context.TagClass<Service, "@dxos/assistant/AiSessionService", Session>;
|
|
55
|
+
/**
|
|
56
|
+
* Gives access to the ai session.
|
|
57
|
+
*/
|
|
58
|
+
export declare class Service extends Service_base {
|
|
59
|
+
/**
|
|
60
|
+
* Create a new session layer from options.
|
|
61
|
+
*/
|
|
62
|
+
static layer: (options: Options) => Layer.Layer<Service | AiContext.Service>;
|
|
63
|
+
/**
|
|
64
|
+
* Create a new session with a new feed.
|
|
65
|
+
*/
|
|
66
|
+
static layerNewFeed: (options?: Omit<Options, 'feed' | 'runtime'>) => Layer.Layer<Service | AiContext.Service, never, Database.Service | Feed.FeedService>;
|
|
67
|
+
/**
|
|
68
|
+
* Run a prompt in the current session.
|
|
69
|
+
*/
|
|
70
|
+
static run: <R = never>(params: RunProps<R>) => Effect.Effect<Message.Message[], AiRequest.RunError, AiRequest.RunRequirements | Service | R>;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=AiSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiSession.d.ts","sourceRoot":"","sources":["../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aACP,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC,KAC1C,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,CAOnF;IAEJ;;OAEG;IACH,MAAM,CAAC,GAAG,GAAI,CAAC,GAAG,KAAK,UACb,QAAQ,CAAC,CAAC,CAAC,KAClB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,eAAe,GAAG,OAAO,GAAG,CAAC,CAAC,CAI3F;CACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAE1B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { type AiToolNotFoundError, OpaqueToolkit, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
3
|
+
import { type Blueprint } from '@dxos/compute';
|
|
4
|
+
export type CreateToolkitProps = {
|
|
5
|
+
toolkit?: OpaqueToolkit.Any;
|
|
6
|
+
blueprints?: readonly Blueprint.Blueprint[];
|
|
7
|
+
/**
|
|
8
|
+
* Self-contained with handlers toolkits.
|
|
9
|
+
*/
|
|
10
|
+
opaqueToolkits?: readonly OpaqueToolkit.Any[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Build a combined toolkit from the blueprint tools and the provided toolkit.
|
|
14
|
+
*/
|
|
15
|
+
export declare const createToolkit: ({ toolkit: toolkitProp, blueprints, opaqueToolkits, }: CreateToolkitProps) => Effect.Effect<OpaqueToolkit.OpaqueToolkit, AiToolNotFoundError, ToolResolverService | ToolExecutionService>;
|
|
16
|
+
//# sourceMappingURL=toolkit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/toolkit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,mBAAmB,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC9G,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,SAAS,CAAC,SAAS,EAAE,CAAC;IAC5C;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,aAAa,CAAC,GAAG,EAAE,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,0DAIvB,kBAAkB,KAAG,MAAM,CAAC,MAAM,CACnC,aAAa,CAAC,aAAa,EAC3B,mBAAmB,EACnB,mBAAmB,GAAG,oBAAoB,CAeuE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './system';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|