@dxos/assistant 0.8.4-main.b97322e → 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.
Files changed (189) hide show
  1. package/dist/lib/browser/chunk-7CDDG6LL.mjs +578 -0
  2. package/dist/lib/browser/chunk-7CDDG6LL.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  4. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  5. package/dist/lib/browser/extraction/index.mjs +225 -0
  6. package/dist/lib/browser/extraction/index.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +723 -1704
  8. package/dist/lib/browser/index.mjs.map +4 -4
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/testing/index.mjs +32 -0
  11. package/dist/lib/browser/testing/index.mjs.map +7 -0
  12. package/dist/lib/node-esm/chunk-CC7ER6Q3.mjs +579 -0
  13. package/dist/lib/node-esm/chunk-CC7ER6Q3.mjs.map +7 -0
  14. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  15. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  16. package/dist/lib/node-esm/extraction/index.mjs +226 -0
  17. package/dist/lib/node-esm/extraction/index.mjs.map +7 -0
  18. package/dist/lib/node-esm/index.mjs +723 -1705
  19. package/dist/lib/node-esm/index.mjs.map +4 -4
  20. package/dist/lib/node-esm/meta.json +1 -1
  21. package/dist/lib/node-esm/testing/index.mjs +33 -0
  22. package/dist/lib/node-esm/testing/index.mjs.map +7 -0
  23. package/dist/types/src/conversation/context.d.ts +129 -0
  24. package/dist/types/src/conversation/context.d.ts.map +1 -0
  25. package/dist/types/src/conversation/context.test.d.ts +2 -0
  26. package/dist/types/src/conversation/context.test.d.ts.map +1 -0
  27. package/dist/types/src/conversation/conversation.d.ts +29 -26
  28. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  29. package/dist/types/src/conversation/conversation.test.d.ts +2 -0
  30. package/dist/types/src/conversation/conversation.test.d.ts.map +1 -0
  31. package/dist/types/src/conversation/index.d.ts +1 -0
  32. package/dist/types/src/conversation/index.d.ts.map +1 -1
  33. package/dist/types/src/diff.d.ts +15 -0
  34. package/dist/types/src/diff.d.ts.map +1 -0
  35. package/dist/types/src/diff.test.d.ts +2 -0
  36. package/dist/types/src/diff.test.d.ts.map +1 -0
  37. package/dist/types/src/errors.d.ts +47 -18
  38. package/dist/types/src/errors.d.ts.map +1 -1
  39. package/dist/types/src/execution-graph.d.ts +85 -0
  40. package/dist/types/src/execution-graph.d.ts.map +1 -0
  41. package/dist/types/src/execution-graph.test.d.ts +2 -0
  42. package/dist/types/src/execution-graph.test.d.ts.map +1 -0
  43. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +1 -1
  44. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
  45. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +258 -213
  46. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  47. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  48. package/dist/types/src/extraction/extraction.d.ts +345 -270
  49. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  50. package/dist/types/src/extraction/quotes.d.ts +3 -3
  51. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  52. package/dist/types/src/functions/services.d.ts +18 -4
  53. package/dist/types/src/functions/services.d.ts.map +1 -1
  54. package/dist/types/src/functions.test.d.ts +2 -0
  55. package/dist/types/src/functions.test.d.ts.map +1 -0
  56. package/dist/types/src/index.d.ts +3 -3
  57. package/dist/types/src/index.d.ts.map +1 -1
  58. package/dist/types/src/session/GenericToolkit.d.ts +85 -0
  59. package/dist/types/src/session/GenericToolkit.d.ts.map +1 -0
  60. package/dist/types/src/session/artifact-diff.d.ts +27 -0
  61. package/dist/types/src/session/artifact-diff.d.ts.map +1 -0
  62. package/dist/types/src/session/error-handling.d.ts +4 -0
  63. package/dist/types/src/session/error-handling.d.ts.map +1 -0
  64. package/dist/types/src/session/format.d.ts +12 -0
  65. package/dist/types/src/session/format.d.ts.map +1 -0
  66. package/dist/types/src/session/format.test.d.ts +2 -0
  67. package/dist/types/src/session/format.test.d.ts.map +1 -0
  68. package/dist/types/src/session/index.d.ts +4 -0
  69. package/dist/types/src/session/index.d.ts.map +1 -1
  70. package/dist/types/src/session/observer.d.ts +23 -0
  71. package/dist/types/src/session/observer.d.ts.map +1 -0
  72. package/dist/types/src/session/session.d.ts +33 -237
  73. package/dist/types/src/session/session.d.ts.map +1 -1
  74. package/dist/types/src/session/toolkit.d.ts +14 -0
  75. package/dist/types/src/session/toolkit.d.ts.map +1 -0
  76. package/dist/types/src/session/version-pin.d.ts +4 -4
  77. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  78. package/dist/types/src/templates/index.d.ts +1 -1
  79. package/dist/types/src/templates/system.d.ts +18 -0
  80. package/dist/types/src/templates/system.d.ts.map +1 -0
  81. package/dist/types/src/testing/index.d.ts +1 -2
  82. package/dist/types/src/testing/index.d.ts.map +1 -1
  83. package/dist/types/src/testing/layer.d.ts +21 -0
  84. package/dist/types/src/testing/layer.d.ts.map +1 -0
  85. package/dist/types/src/types/artifact.d.ts +28 -0
  86. package/dist/types/src/types/artifact.d.ts.map +1 -0
  87. package/dist/types/src/types/index.d.ts +2 -0
  88. package/dist/types/src/types/index.d.ts.map +1 -0
  89. package/dist/types/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +56 -33
  91. package/src/conversation/context.test.ts +46 -0
  92. package/src/conversation/context.ts +303 -0
  93. package/src/conversation/conversation.test.ts +65 -0
  94. package/src/conversation/conversation.ts +93 -64
  95. package/src/conversation/index.ts +1 -0
  96. package/src/diff.test.ts +43 -0
  97. package/src/diff.ts +84 -0
  98. package/src/errors.ts +6 -1
  99. package/src/execution-graph.test.ts +740 -0
  100. package/src/execution-graph.ts +509 -0
  101. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +10 -9
  102. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +48 -56
  103. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +22 -21
  104. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +42 -43
  105. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
  106. package/src/extraction/extraction-ner-function/named-entity-recognition.ts +2 -0
  107. package/src/extraction/extraction.ts +10 -9
  108. package/src/extraction/quotes.test.ts +3 -3
  109. package/src/extraction/quotes.ts +6 -7
  110. package/src/functions/services.ts +138 -97
  111. package/src/functions.conversations.json +1 -0
  112. package/src/functions.test.ts +74 -0
  113. package/src/index.ts +3 -3
  114. package/src/session/GenericToolkit.ts +131 -0
  115. package/src/session/artifact-diff.ts +41 -0
  116. package/src/session/error-handling.ts +41 -0
  117. package/src/session/format.test.ts +124 -0
  118. package/src/session/format.ts +143 -0
  119. package/src/session/index.ts +5 -0
  120. package/src/session/observer.ts +61 -0
  121. package/src/session/session.conversations.json +1 -0
  122. package/src/session/session.test.ts +34 -201
  123. package/src/session/session.ts +146 -248
  124. package/src/session/toolkit.ts +39 -0
  125. package/src/session/version-pin.ts +8 -8
  126. package/src/templates/index.ts +1 -1
  127. package/src/templates/instructions/format.tpl +61 -0
  128. package/src/templates/instructions/system.tpl +48 -0
  129. package/src/templates/system.ts +41 -0
  130. package/src/testing/index.ts +2 -8
  131. package/src/testing/layer.ts +78 -0
  132. package/src/types/artifact.ts +82 -0
  133. package/src/types/index.ts +5 -0
  134. package/src/typings.d.ts +5 -0
  135. package/dist/types/bin/chat.d.ts +0 -2
  136. package/dist/types/bin/chat.d.ts.map +0 -1
  137. package/dist/types/src/context/binder.d.ts +0 -34
  138. package/dist/types/src/context/binder.d.ts.map +0 -1
  139. package/dist/types/src/context/binding.d.ts +0 -56
  140. package/dist/types/src/context/binding.d.ts.map +0 -1
  141. package/dist/types/src/context/index.d.ts +0 -3
  142. package/dist/types/src/context/index.d.ts.map +0 -1
  143. package/dist/types/src/research/exa.d.ts +0 -12
  144. package/dist/types/src/research/exa.d.ts.map +0 -1
  145. package/dist/types/src/research/graph.d.ts +0 -51
  146. package/dist/types/src/research/graph.d.ts.map +0 -1
  147. package/dist/types/src/research/graph.test.d.ts +0 -2
  148. package/dist/types/src/research/graph.test.d.ts.map +0 -1
  149. package/dist/types/src/research/index.d.ts +0 -4
  150. package/dist/types/src/research/index.d.ts.map +0 -1
  151. package/dist/types/src/research/research.d.ts +0 -10
  152. package/dist/types/src/research/research.d.ts.map +0 -1
  153. package/dist/types/src/research/research.test.d.ts +0 -2
  154. package/dist/types/src/research/research.test.d.ts.map +0 -1
  155. package/dist/types/src/session/version-pin.test.d.ts +0 -2
  156. package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
  157. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  158. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  159. package/dist/types/src/templates/prompt.d.ts +0 -30
  160. package/dist/types/src/templates/prompt.d.ts.map +0 -1
  161. package/dist/types/src/testing/exa-search-1748337321991.d.ts +0 -38
  162. package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +0 -1
  163. package/dist/types/src/testing/exa-search-1748337331526.d.ts +0 -37
  164. package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +0 -1
  165. package/dist/types/src/testing/exa-search-1748337344119.d.ts +0 -58
  166. package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +0 -1
  167. package/dist/types/src/types.d.ts +0 -13
  168. package/dist/types/src/types.d.ts.map +0 -1
  169. package/src/context/binder.ts +0 -103
  170. package/src/context/binding.ts +0 -32
  171. package/src/context/index.ts +0 -6
  172. package/src/research/exa.ts +0 -97
  173. package/src/research/graph.test.ts +0 -64
  174. package/src/research/graph.ts +0 -369
  175. package/src/research/index.ts +0 -7
  176. package/src/research/instructions-research.tpl +0 -98
  177. package/src/research/research.test.ts +0 -190
  178. package/src/research/research.ts +0 -87
  179. package/src/session/__snapshots__/session.test.ts.snap +0 -32
  180. package/src/session/version-pin.test.ts +0 -7
  181. package/src/summarization/summarization.test.ts +0 -208
  182. package/src/templates/assistant.tpl +0 -111
  183. package/src/templates/prompt.ts +0 -45
  184. package/src/testing/exa-search-1748337321991.ts +0 -131
  185. package/src/testing/exa-search-1748337331526.ts +0 -144
  186. package/src/testing/exa-search-1748337344119.ts +0 -133
  187. package/src/typedefs.d.ts +0 -8
  188. package/src/types.ts +0 -47
  189. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -0,0 +1,41 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import defaultsDeep from 'lodash.defaultsdeep';
6
+
7
+ import { type ModelCapabilities } from '@dxos/ai';
8
+ import { Template } from '@dxos/blueprints';
9
+
10
+ import FORMAT from './instructions/format.tpl?raw';
11
+ import SYSTEM from './instructions/system.tpl?raw';
12
+
13
+ /**
14
+ * System template variables.
15
+ */
16
+ export type SystemPromptOptions = ModelCapabilities & {
17
+ DATETIME: string;
18
+ };
19
+
20
+ /**
21
+ * Base system prompt.
22
+ * NOTE: This contains protocol instructions that can not be dynamically edited.
23
+ */
24
+ export const createSystemPrompt = (options: Partial<SystemPromptOptions> = {}) =>
25
+ Template.process<SystemPromptOptions>(
26
+ FORMAT,
27
+ defaultsDeep(options, {
28
+ DATETIME: new Date().toISOString(),
29
+ }),
30
+ );
31
+
32
+ export const templates = {
33
+ /** Editable system prompt.*/
34
+ system: Template.make({
35
+ /**
36
+ * NOTE: We are forbidden from accessing randomness at model level in cloudflare, so we have to have pre-generated ids.
37
+ */
38
+ id: '01K2J2FZWH39F55CS7B26GP1Q3',
39
+ source: SYSTEM,
40
+ }),
41
+ };
@@ -1,11 +1,5 @@
1
1
  //
2
- // Copyright 2025 DXOS.org
2
+ // Copyright 2026 DXOS.org
3
3
  //
4
4
 
5
- import type { SearchResponse } from 'exa-js';
6
-
7
- import Search1 from './exa-search-1748337321991';
8
- import Search2 from './exa-search-1748337331526';
9
- import Search3 from './exa-search-1748337344119';
10
-
11
- export const SEARCH_RESULTS: SearchResponse<any>[] = [Search1, Search2, Search3];
5
+ export * from './layer';
@@ -0,0 +1,78 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Layer from 'effect/Layer';
6
+ import * as Match from 'effect/Match';
7
+
8
+ import { AiService, type ModelName } from '@dxos/ai';
9
+ import { TestAiService } from '@dxos/ai/testing';
10
+ import type { Type } from '@dxos/echo';
11
+ import { CredentialsService, type FunctionDefinition, type ServiceCredential, TracingService } from '@dxos/functions';
12
+ import { TracingServiceExt, TriggerDispatcher, TriggerStateStore } from '@dxos/functions-runtime';
13
+ import { FunctionInvocationServiceLayerTest, TestDatabaseLayer } from '@dxos/functions-runtime/testing';
14
+
15
+ import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '../functions';
16
+ import { GenericToolkit } from '../session';
17
+
18
+ interface TestLayerOptions {
19
+ aiServicePreset?: 'direct' | 'edge-local' | 'edge-remote';
20
+ model?: ModelName;
21
+ functions?: FunctionDefinition.Any[];
22
+ toolkits?: GenericToolkit.GenericToolkit[];
23
+ types?: Type.Entity.Any[];
24
+ credentials?: ServiceCredential[];
25
+ /*
26
+ * Tracing configuration.
27
+ * @default 'noop'
28
+ */
29
+ tracing?: 'noop' | 'console' | 'pretty';
30
+ }
31
+
32
+ export const AssistantTestLayer = ({
33
+ aiServicePreset = 'direct',
34
+ model = '@anthropic/claude-opus-4-0',
35
+ functions = [],
36
+ toolkits = [],
37
+ types = [],
38
+ credentials = [],
39
+ tracing = 'noop',
40
+ }: TestLayerOptions) =>
41
+ Layer.mergeAll(
42
+ AiService.model(model),
43
+ makeToolResolverFromFunctions(functions, GenericToolkit.merge(...toolkits).toolkit as any),
44
+ makeToolExecutionServiceFromFunctions(
45
+ GenericToolkit.merge(...toolkits).toolkit as any,
46
+ GenericToolkit.merge(...toolkits).layer as any,
47
+ ),
48
+ ).pipe(
49
+ Layer.provideMerge(
50
+ FunctionInvocationServiceLayerTest({
51
+ functions,
52
+ }),
53
+ ),
54
+ Layer.provideMerge(
55
+ Layer.mergeAll(
56
+ TestAiService({ preset: aiServicePreset }),
57
+ TestDatabaseLayer({
58
+ spaceKey: 'fixed',
59
+ types,
60
+ }),
61
+ CredentialsService.configuredLayer(credentials),
62
+ Match.value(tracing).pipe(
63
+ Match.when('noop', () => TracingService.layerNoop),
64
+ Match.when('console', () => TracingServiceExt.layerLogInfo()),
65
+ Match.when('pretty', () => TracingServiceExt.layerConsolePrettyPrint()),
66
+ Match.exhaustive,
67
+ ),
68
+ ),
69
+ ),
70
+ );
71
+
72
+ interface TestLayerWithTriggersOptions extends TestLayerOptions {}
73
+
74
+ export const AssistantTestLayerWithTriggers = (options: TestLayerWithTriggersOptions) =>
75
+ Layer.mergeAll(
76
+ AssistantTestLayer(options),
77
+ TriggerDispatcher.layer({ timeControl: 'manual', startingTime: new Date('2025-09-05T15:01:00.000Z') }),
78
+ ).pipe(Layer.provideMerge(TriggerStateStore.layerMemory));
@@ -0,0 +1,82 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import type * as Effect from 'effect/Effect';
6
+ import * as Schema from 'effect/Schema';
7
+
8
+ import { type Err, Type } from '@dxos/echo';
9
+ import { Database } from '@dxos/echo';
10
+ import { EncodedReference } from '@dxos/echo-protocol';
11
+ import { DXN, LOCAL_SPACE_TAG, type ObjectId, type SpaceId } from '@dxos/keys';
12
+ import { trim } from '@dxos/util';
13
+
14
+ /**
15
+ * @deprecated
16
+ */
17
+ export const createArtifactElement = (id: ObjectId) => `<artifact id=${id} />`;
18
+
19
+ /**
20
+ * A model-friendly way to reference an object.
21
+ * Supports vairous formats that will be normalized to a DXN.
22
+ *
23
+ * @deprecated Use `RefFromLLM` instead.
24
+ */
25
+ // TODO(burdon): Rename RefFromLLM? -- yes -dm
26
+ export const ArtifactId: Schema.Schema<string> & {
27
+ toDXN: (reference: ArtifactId, owningSpaceId?: SpaceId) => DXN;
28
+ resolve: <S extends Type.Entity.Any>(
29
+ schema: S,
30
+ ref: ArtifactId,
31
+ ) => Effect.Effect<Schema.Schema.Type<S>, Err.ObjectNotFoundError, Database.Service>;
32
+ } = class extends Schema.String.annotations({
33
+ // TODO(dmaretskyi): This section gets overriden.
34
+ description: trim`
35
+ The ID of the referenced object. Formats accepted:
36
+ - DXN (dxn:echo:@:XXXXX). DXNs can be prepended with an @ symbol for compatibility with in-text references.
37
+ - space ID, object ID tuple (spaceID:objectID)
38
+ - Only object ID that is assumed to be in the current space (XXXXX)
39
+ `,
40
+ examples: ['dxn:echo:@:XXXXX', '@dxn:echo:@:XXXXX', 'spaceID:objectID', 'XXXXX'],
41
+ }) {
42
+ static toDXN(reference: ArtifactId, owningSpaceId?: SpaceId): DXN {
43
+ // Allow @dxn: prefix for compatibility with in-text references.
44
+ if (reference.startsWith('@dxn:')) {
45
+ return DXN.parse(reference.slice(1));
46
+ } else if (reference.startsWith('dxn:')) {
47
+ return DXN.parse(reference);
48
+ } else if (/^[A-Z0-9]+:[A-Z0-9]+$/.test(reference)) {
49
+ const [spaceId, objectId] = reference.split(':');
50
+ // This is a workaround because the current Filter API doesn't work with fully qualified Echo DXNs.
51
+ // We check if the space ID is the same as the owning space and then use LOCAL_SPACE_TAG for local references.
52
+ // TODO(dmaretskyi): Fix this in the Echo and Filter API to properly handle fully qualified DXNs.
53
+ return new DXN(DXN.kind.ECHO, [spaceId === owningSpaceId ? LOCAL_SPACE_TAG : spaceId, objectId]);
54
+ } else if (/^[A-Z0-9]+$/.test(reference)) {
55
+ return DXN.fromLocalObjectId(reference);
56
+ } else {
57
+ throw new Error(`Unable to parse object reference: ${reference}`);
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Resolves an artifact ID to an object.
63
+ */
64
+ static resolve<S extends Type.Entity.Any>(
65
+ schema: S,
66
+ ref: ArtifactId,
67
+ ): Effect.Effect<Schema.Schema.Type<S>, Err.ObjectNotFoundError, Database.Service> {
68
+ const dxn = ArtifactId.toDXN(ref);
69
+ return Database.Service.resolve(dxn, schema);
70
+ }
71
+ };
72
+
73
+ export type ArtifactId = Schema.Schema.Type<typeof ArtifactId>;
74
+
75
+ /**
76
+ * Schema that decodes ECHO reference object from an LLM-friendly input.
77
+ */
78
+ export const RefFromLLM = Schema.transform(ArtifactId, Type.Ref(Type.Obj), {
79
+ decode: (fromA, fromI) => EncodedReference.fromDXN(ArtifactId.toDXN(fromA)),
80
+ encode: (toI, toA) => EncodedReference.toDXN(toI).toString(),
81
+ strict: false,
82
+ });
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './artifact';
package/src/typings.d.ts CHANGED
@@ -2,6 +2,11 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ declare module '*?raw' {
6
+ const content: string;
7
+ export default content;
8
+ }
9
+
5
10
  declare module '*.tpl?raw' {
6
11
  const content: string;
7
12
  export default content;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=chat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../bin/chat.ts"],"names":[],"mappings":""}
@@ -1,34 +0,0 @@
1
- import { type ReadonlySignal } from '@preact/signals-core';
2
- import { type Blueprint } from '@dxos/blueprints';
3
- import { type Type, type Ref } from '@dxos/echo';
4
- import { type Queue } from '@dxos/echo-db';
5
- import { ComplexSet } from '@dxos/util';
6
- /**
7
- * Manages bindings of blueprints and objects to a conversation.
8
- */
9
- export declare class ContextBinder {
10
- private readonly _queue;
11
- constructor(_queue: Queue);
12
- /**
13
- * Reactive query of all bindings.
14
- */
15
- readonly bindings: ReadonlySignal<Bindings>;
16
- readonly blueprints: ReadonlySignal<Ref.Ref<Blueprint.Blueprint>[]>;
17
- readonly objects: ReadonlySignal<Ref.Ref<Type.Expando>[]>;
18
- /**
19
- * Asynchronous query of all bindings.
20
- */
21
- query(): Promise<Bindings>;
22
- bind(props: BindingProps): Promise<void>;
23
- unbind(props: BindingProps): Promise<void>;
24
- private _reduce;
25
- }
26
- export type BindingProps = Partial<{
27
- blueprints: Ref.Ref<Blueprint.Blueprint>[];
28
- objects: Ref.Ref<Type.Expando>[];
29
- }>;
30
- export declare class Bindings {
31
- blueprints: ComplexSet<Ref.Ref<Blueprint.Blueprint>>;
32
- objects: ComplexSet<Ref.Ref<Type.Expando>>;
33
- }
34
- //# sourceMappingURL=binder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"binder.d.ts","sourceRoot":"","sources":["../../../../src/context/binder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGrE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAO,KAAK,IAAI,EAAE,KAAK,GAAG,EAAiB,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC;;GAEG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,KAAK;IAE1C;;OAEG;IAEH,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAqD;IAGhG,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAEhE;IACH,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAoD;IAE7G;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;IAM1B,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBxC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBhD,OAAO,CAAC,OAAO;CAahB;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;IACjC,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;IAC3C,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;CAClC,CAAC,CAAC;AAEH,qBAAa,QAAQ;IACnB,UAAU,2CAA6E;IACvF,OAAO,oCAAsE;CAC9E"}
@@ -1,56 +0,0 @@
1
- import { Schema } from 'effect';
2
- import { Type } from '@dxos/echo';
3
- /**
4
- * Thread message that binds or unbinds contextual objects to a conversation.
5
- */
6
- export declare const ContextBinding: Type.obj<Schema.Struct<{
7
- blueprints: Schema.Struct<{
8
- added: Schema.Array$<Type.ref<Type.obj<Schema.Struct<{
9
- key: Schema.SchemaClass<string, string, never>;
10
- name: Schema.SchemaClass<string, string, never>;
11
- description: Schema.optional<typeof Schema.String>;
12
- instructions: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
13
- name?: string | undefined;
14
- source: import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
15
- content: string;
16
- }>;
17
- inputs?: {
18
- name: string;
19
- kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
20
- default?: any;
21
- }[] | undefined;
22
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
23
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
24
- }>>>>;
25
- removed: Schema.Array$<Type.ref<Type.obj<Schema.Struct<{
26
- key: Schema.SchemaClass<string, string, never>;
27
- name: Schema.SchemaClass<string, string, never>;
28
- description: Schema.optional<typeof Schema.String>;
29
- instructions: Schema.SchemaClass<import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
30
- name?: string | undefined;
31
- source: import("@dxos/echo-schema").Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
32
- content: string;
33
- }>;
34
- inputs?: {
35
- name: string;
36
- kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
37
- default?: any;
38
- }[] | undefined;
39
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
40
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
41
- }>>>>;
42
- }>;
43
- objects: Schema.Struct<{
44
- added: Schema.Array$<Type.ref<Schema.Schema<Type.Expando, {
45
- [x: string]: any;
46
- id: string;
47
- }, never>>>;
48
- removed: Schema.Array$<Type.ref<Schema.Schema<Type.Expando, {
49
- [x: string]: any;
50
- id: string;
51
- }, never>>>;
52
- }>;
53
- }>>;
54
- export interface ContextBinding extends Schema.Schema.Type<typeof ContextBinding> {
55
- }
56
- //# sourceMappingURL=binding.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../../../../src/context/binding.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC;;GAEG;AAEH,eAAO,MAAM,cAAc;;;;;;;oBAmB6O,CAAC;;;;sBAA4L,CAAC;;wBAA8C,CAAC;2BAAoI,CAAC;;;;;;;;;;oBAAlX,CAAC;;;;sBAA4L,CAAC;;wBAA8C,CAAC;2BAAoI,CAAC;;;;;;;;;;;;;;;;GAHznB,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC;CAAG"}
@@ -1,3 +0,0 @@
1
- export * from './binder';
2
- export * from './binding';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/context/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -1,12 +0,0 @@
1
- import { AiTool, AiToolkit } from '@effect/ai';
2
- import { Schema } from 'effect';
3
- import { CredentialsService } from '@dxos/functions';
4
- declare const ExaToolkit_base: AiToolkit.AiToolkit<AiTool.AiTool<"exa_search", Schema.Struct<{
5
- query: Schema.SchemaClass<string, string, never>;
6
- }>, typeof Schema.Unknown, typeof Schema.Never, CredentialsService>>;
7
- export declare class ExaToolkit extends ExaToolkit_base {
8
- }
9
- export declare const LiveExaHandler: import("effect/Layer").Layer<AiTool.Handler<"exa_search">, never, never>;
10
- export declare const MockExaHandler: import("effect/Layer").Layer<AiTool.Handler<"exa_search">, never, never>;
11
- export {};
12
- //# sourceMappingURL=exa.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exa.d.ts","sourceRoot":"","sources":["../../../../src/research/exa.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;;;;AAKrD,qBAAa,UAAW,SAAQ,eAS/B;CAAG;AAEJ,eAAO,MAAM,cAAc,0EAmBzB,CAAC;AAEH,eAAO,MAAM,cAAc,0EA2BzB,CAAC"}
@@ -1,51 +0,0 @@
1
- import { AiTool, AiToolkit } from '@effect/ai';
2
- import { Schema } from 'effect';
3
- import { type EchoDatabase, type Queue } from '@dxos/echo-db';
4
- import { type BaseObject } from '@dxos/echo-schema';
5
- import { DatabaseService } from '@dxos/functions';
6
- export declare const Subgraph: Schema.Struct<{
7
- /** Objects and relations. */
8
- objects: Schema.Array$<typeof Schema.Any>;
9
- }>;
10
- export interface Subgraph extends Schema.Schema.Type<typeof Subgraph> {
11
- }
12
- export type RelatedSchema = {
13
- schema: Schema.Schema.AnyNoContext;
14
- kind: 'reference' | 'relation';
15
- };
16
- /**
17
- * Find all schemas that are related to the given schema.
18
- *
19
- * @param db
20
- * @param schema
21
- * @returns
22
- */
23
- export declare const findRelatedSchema: (db: EchoDatabase, anchor: Schema.Schema.AnyNoContext) => Promise<RelatedSchema[]>;
24
- declare const LocalSearchToolkit_base: AiToolkit.AiToolkit<AiTool.AiTool<"search_local_search", Schema.Struct<{
25
- query: Schema.SchemaClass<string, string, never>;
26
- }>, typeof Schema.Unknown, typeof Schema.Never, DatabaseService>>;
27
- /**
28
- * Perform vector search in the local database.
29
- */
30
- export declare class LocalSearchToolkit extends LocalSearchToolkit_base {
31
- }
32
- export declare const LocalSearchHandler: import("effect/Layer").Layer<AiTool.Handler<"search_local_search">, never, never>;
33
- /**
34
- * Forms typed objects that can be written to the graph database.
35
- */
36
- export declare const makeGraphWriterToolkit: ({ schema }: {
37
- schema: Schema.Schema.AnyNoContext[];
38
- }) => AiToolkit.AiToolkit<AiTool.AiTool<"graph_writer", Schema.Struct<Readonly<{
39
- [k: string]: Schema.optional<Schema.Array$<Schema.Schema.AnyNoContext>>;
40
- }>>, typeof Schema.Unknown, typeof Schema.Never, DatabaseService>>;
41
- export declare const makeGraphWriterHandler: (toolkit: ReturnType<typeof makeGraphWriterToolkit>) => import("effect/Layer").Layer<AiTool.Handler<"graph_writer">, never, never>;
42
- /**
43
- * Create a schema for structured data extraction.
44
- */
45
- export declare const createExtractionSchema: (types: Schema.Schema.AnyNoContext[]) => Schema.Struct<{
46
- [k: string]: Schema.optional<Schema.Array$<Schema.Schema.AnyNoContext>>;
47
- }>;
48
- export declare const getSanitizedSchemaName: (schema: Schema.Schema.AnyNoContext) => string;
49
- export declare const sanitizeObjects: (types: Schema.Schema.AnyNoContext[], data: Record<string, readonly unknown[]>, db: EchoDatabase, queue?: Queue) => Promise<BaseObject[]>;
50
- export {};
51
- //# sourceMappingURL=graph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../src/research/graph.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAqC,MAAM,EAAa,MAAM,QAAQ,CAAC;AAI9E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAcL,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAuB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMvE,eAAO,MAAM,QAAQ;IACnB,6BAA6B;;EAE7B,CAAC;AACH,MAAM,WAAW,QAAS,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC;CAAG;AAExE,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC;CAChC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,IAAI,YAAY,EAChB,QAAQ,MAAM,CAAC,MAAM,CAAC,YAAY,KACjC,OAAO,CAAC,aAAa,EAAE,CAsBzB,CAAC;;;;AAmBF;;GAEG;AAEH,qBAAa,kBAAmB,SAAQ,uBAWvC;CAAG;AAEJ,eAAO,MAAM,kBAAkB,mFAkB7B,CAAC;AAUH;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,YAAY;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,CAAA;CAAE;;kEAW1F,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,UAAU,CAAC,OAAO,sBAAsB,CAAC,+EAexF,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE;;EAWzE,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,CAAC,MAAM,CAAC,YAAY,WAIxE,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,EACnC,MAAM,MAAM,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC,EACxC,IAAI,YAAY,EAChB,QAAQ,KAAK,KACZ,OAAO,CAAC,UAAU,EAAE,CAyHtB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=graph.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph.test.d.ts","sourceRoot":"","sources":["../../../../src/research/graph.test.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export * from './exa';
2
- export * from './research';
3
- export * from './graph';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/research/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Exec external service and return the results as a Subgraph.
3
- */
4
- export declare const researchFn: import("@dxos/functions").FunctionDefinition<{
5
- readonly query: string;
6
- readonly mockSearch?: boolean | undefined;
7
- }, {
8
- readonly result: unknown;
9
- }>;
10
- //# sourceMappingURL=research.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../../../../src/research/research.ts"],"names":[],"mappings":"AAqBA;;GAEG;AAEH,eAAO,MAAM,UAAU;;;;;EA6DrB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=research.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"research.test.d.ts","sourceRoot":"","sources":["../../../../src/research/research.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=version-pin.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version-pin.test.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=summarization.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"summarization.test.d.ts","sourceRoot":"","sources":["../../../../src/summarization/summarization.test.ts"],"names":[],"mappings":""}
@@ -1,30 +0,0 @@
1
- import { type AssociatedArtifact } from '@dxos/blueprints';
2
- /**
3
- * Type for assistant prompt variables.
4
- */
5
- export type AssistantPromptOptions = {
6
- /**
7
- * Instructions for each artifact.
8
- */
9
- artifacts?: string[];
10
- /**
11
- * Associated artifact to include in the prompt.
12
- * @deprecated
13
- */
14
- artifact?: AssociatedArtifact;
15
- /**
16
- * Whether to include suggestions in the prompt.
17
- */
18
- suggestions?: boolean;
19
- /**
20
- * Additional instructions to include in the prompt.
21
- */
22
- instructions?: string;
23
- /**
24
- * Emit chain-of-thought inside <cot> tag.
25
- * Should be `false` for models with built-in reasoning: Claude, deepseek, o1.
26
- */
27
- cot?: boolean;
28
- };
29
- export declare const createSystemPrompt: (options: AssistantPromptOptions) => string;
30
- //# sourceMappingURL=prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/templates/prompt.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAY,MAAM,kBAAkB,CAAC;AAIrE;;GAEG;AAEH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IAEH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAE9B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,SAAS,sBAAsB,WAEjE,CAAC"}
@@ -1,38 +0,0 @@
1
- declare const _default: {
2
- requestId: string;
3
- autopromptString: string;
4
- autoDate: string;
5
- resolvedSearchType: string;
6
- results: ({
7
- id: string;
8
- title: string;
9
- url: string;
10
- publishedDate: string;
11
- author: string;
12
- score: number;
13
- text: string;
14
- image?: undefined;
15
- favicon?: undefined;
16
- } | {
17
- id: string;
18
- title: string;
19
- url: string;
20
- publishedDate: string;
21
- author: string;
22
- score: number;
23
- text: string;
24
- image: string;
25
- favicon: string;
26
- })[];
27
- costDollars: {
28
- total: number;
29
- search: {
30
- neural: number;
31
- };
32
- contents: {
33
- text: number;
34
- };
35
- };
36
- };
37
- export default _default;
38
- //# sourceMappingURL=exa-search-1748337321991.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exa-search-1748337321991.d.ts","sourceRoot":"","sources":["../../../../src/testing/exa-search-1748337321991.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBA8HE"}
@@ -1,37 +0,0 @@
1
- declare const _default: {
2
- requestId: string;
3
- autopromptString: string;
4
- resolvedSearchType: string;
5
- results: ({
6
- id: string;
7
- title: string;
8
- url: string;
9
- publishedDate: string;
10
- author: string;
11
- score: number;
12
- text: string;
13
- image: string;
14
- favicon: string;
15
- } | {
16
- id: string;
17
- title: string;
18
- url: string;
19
- publishedDate: string;
20
- author: string;
21
- text: string;
22
- image: string;
23
- favicon: string;
24
- score?: undefined;
25
- })[];
26
- costDollars: {
27
- total: number;
28
- search: {
29
- neural: number;
30
- };
31
- contents: {
32
- text: number;
33
- };
34
- };
35
- };
36
- export default _default;
37
- //# sourceMappingURL=exa-search-1748337331526.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exa-search-1748337331526.d.ts","sourceRoot":"","sources":["../../../../src/testing/exa-search-1748337331526.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBA2IE"}