@dxos/assistant 0.8.4-main.84f28bd → 0.8.4-main.c1de068

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 (82) hide show
  1. package/dist/lib/browser/index.mjs +623 -811
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +623 -811
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/context/binder.d.ts +4 -4
  8. package/dist/types/src/context/binder.d.ts.map +1 -1
  9. package/dist/types/src/context/binding.d.ts +24 -6
  10. package/dist/types/src/context/binding.d.ts.map +1 -1
  11. package/dist/types/src/conversation/conversation.d.ts +12 -18
  12. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  13. package/dist/types/src/errors.d.ts +38 -0
  14. package/dist/types/src/errors.d.ts.map +1 -0
  15. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
  16. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +127 -33
  17. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  18. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts +1 -1
  19. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  20. package/dist/types/src/extraction/extraction.d.ts +100 -42
  21. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  22. package/dist/types/src/functions/index.d.ts +2 -0
  23. package/dist/types/src/functions/index.d.ts.map +1 -0
  24. package/dist/types/src/functions/services.d.ts +6 -0
  25. package/dist/types/src/functions/services.d.ts.map +1 -0
  26. package/dist/types/src/index.d.ts +2 -2
  27. package/dist/types/src/index.d.ts.map +1 -1
  28. package/dist/types/src/research/exa.d.ts +10 -5
  29. package/dist/types/src/research/exa.d.ts.map +1 -1
  30. package/dist/types/src/research/graph.d.ts +18 -8
  31. package/dist/types/src/research/graph.d.ts.map +1 -1
  32. package/dist/types/src/research/research.d.ts +1 -1
  33. package/dist/types/src/research/research.d.ts.map +1 -1
  34. package/dist/types/src/session/session.d.ts +170 -193
  35. package/dist/types/src/session/session.d.ts.map +1 -1
  36. package/dist/types/src/session/version-pin.d.ts +2 -2
  37. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  38. package/dist/types/src/templates/index.d.ts +2 -0
  39. package/dist/types/src/templates/index.d.ts.map +1 -0
  40. package/dist/types/src/templates/prompt.d.ts +30 -0
  41. package/dist/types/src/templates/prompt.d.ts.map +1 -0
  42. package/dist/types/src/types.d.ts +10 -0
  43. package/dist/types/src/types.d.ts.map +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +29 -21
  46. package/src/context/binder.ts +6 -4
  47. package/src/context/binding.ts +4 -3
  48. package/src/conversation/conversation.ts +54 -61
  49. package/src/errors.ts +10 -0
  50. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +6 -18
  51. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +18 -14
  52. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +6 -3
  53. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +2 -2
  54. package/src/extraction/extraction-ner-function/named-entity-recognition.ts +1 -1
  55. package/src/functions/index.ts +5 -0
  56. package/src/functions/services.ts +139 -0
  57. package/src/index.ts +2 -2
  58. package/src/research/exa.ts +56 -59
  59. package/src/research/graph.test.ts +50 -1
  60. package/src/research/graph.ts +85 -53
  61. package/src/research/instructions-research.tpl +1 -0
  62. package/src/research/research.test.ts +27 -27
  63. package/src/research/research.ts +50 -53
  64. package/src/session/__snapshots__/session.test.ts.snap +32 -0
  65. package/src/session/session.test.ts +90 -55
  66. package/src/session/session.ts +215 -461
  67. package/src/session/version-pin.test.ts +2 -21
  68. package/src/session/version-pin.ts +5 -5
  69. package/src/summarization/summarization.test.ts +75 -88
  70. package/src/templates/assistant.tpl +111 -0
  71. package/src/templates/index.ts +5 -0
  72. package/src/templates/prompt.ts +45 -0
  73. package/src/types.ts +40 -1
  74. package/dist/types/src/blueprint/blueprint.d.ts +0 -41
  75. package/dist/types/src/blueprint/blueprint.d.ts.map +0 -1
  76. package/dist/types/src/blueprint/index.d.ts +0 -3
  77. package/dist/types/src/blueprint/index.d.ts.map +0 -1
  78. package/dist/types/src/blueprint/registry.d.ts +0 -7
  79. package/dist/types/src/blueprint/registry.d.ts.map +0 -1
  80. package/src/blueprint/blueprint.ts +0 -75
  81. package/src/blueprint/index.ts +0 -6
  82. package/src/blueprint/registry.ts +0 -15
@@ -1 +1 @@
1
- {"version":3,"file":"extraction-ner-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqC1B,CAAC"}
1
+ {"version":3,"file":"extraction-ner-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqC1B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type TokenClassificationSingle, type TokenClassificationPipelineType } from '@xenova/transformers';
1
+ import { type TokenClassificationPipelineType, type TokenClassificationSingle } from '@xenova/transformers';
2
2
  /**
3
3
  * Named Entity Recognition pipeline.
4
4
  * Initializes the pipeline on first call.
@@ -1 +1 @@
1
- {"version":3,"file":"named-entity-recognition.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/named-entity-recognition.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,yBAAyB,EAE9B,KAAK,+BAA+B,EACrC,MAAM,sBAAsB,CAAC;AAK9B;;;;GAIG;AACH,eAAO,MAAM,MAAM,gDAQlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,yBAAyB,EAAE,CAM3F,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,yBAAyB,EAAE,KAAG,yBAAyB,EAAE,EAmClG,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,yBAAyB,EAAE,KAAG,yBAmBrE,CAAC"}
1
+ {"version":3,"file":"named-entity-recognition.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/named-entity-recognition.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAE/B,MAAM,sBAAsB,CAAC;AAK9B;;;;GAIG;AACH,eAAO,MAAM,MAAM,gDAQlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,yBAAyB,EAAE,CAM3F,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,yBAAyB,EAAE,KAAG,yBAAyB,EAAE,EAmClG,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,yBAAyB,EAAE,KAAG,yBAmBrE,CAAC"}
@@ -12,9 +12,9 @@ export declare const ExtractionInput: Schema.Struct<{
12
12
  nickname: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
13
13
  image: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
14
14
  organization: import("effect/Schema").optional<import("effect/Schema").Schema<import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
15
- description?: string | undefined;
16
15
  id: string;
17
16
  name?: string | undefined;
17
+ description?: string | undefined;
18
18
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
19
19
  image?: string | undefined;
20
20
  website?: string | undefined;
@@ -63,22 +63,17 @@ export declare const ExtractionInput: Schema.Struct<{
63
63
  name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
64
64
  role: import("effect/Schema").optional<import("effect/Schema").Literal<["user", "assistant"]>>;
65
65
  }>>;
66
- blocks: import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
66
+ blocks: import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"anchor", {
67
67
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
68
- }>, import("effect/Schema").Struct<{
69
- type: import("effect/Schema").Literal<["text"]>;
70
- disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
71
- text: typeof import("effect/Schema").String;
72
- }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
68
+ objectId: import("@dxos/keys").ObjectIdClass;
69
+ version: typeof import("effect/Schema").Unknown;
70
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"file", {
73
71
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
74
- }>, import("effect/Schema").Struct<{
75
- type: import("effect/Schema").Literal<["json"]>;
76
- disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
77
- data: typeof import("effect/Schema").String;
78
- }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
72
+ url: typeof import("effect/Schema").String;
73
+ name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
74
+ mediaType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
75
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"image", {
79
76
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
80
- }>, import("effect/Schema").Struct<{
81
- type: import("effect/Schema").Literal<["image"]>;
82
77
  id: import("effect/Schema").optional<typeof import("effect/Schema").String>;
83
78
  source: import("effect/Schema").optional<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").Struct<{
84
79
  type: import("effect/Schema").Literal<["base64"]>;
@@ -88,21 +83,55 @@ export declare const ExtractionInput: Schema.Struct<{
88
83
  type: import("effect/Schema").Literal<["http"]>;
89
84
  url: typeof import("effect/Schema").String;
90
85
  }>>]>>;
91
- }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
86
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"json", {
87
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
88
+ disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
89
+ data: typeof import("effect/Schema").String;
90
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"proposal", {
91
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
92
+ text: typeof import("effect/Schema").String;
93
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"reasoning", {
94
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
95
+ reasoningText: import("effect/Schema").optional<typeof import("effect/Schema").String>;
96
+ redactedText: import("effect/Schema").optional<typeof import("effect/Schema").String>;
97
+ signature: import("effect/Schema").optional<typeof import("effect/Schema").String>;
98
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"reference", {
92
99
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
93
- }>, import("effect/Schema").Struct<{
94
- type: import("effect/Schema").Literal<["reference"]>;
95
100
  reference: import("@dxos/echo/Type").ref<import("effect/Schema").Schema<import("@dxos/echo/Type").Expando, {
96
101
  [x: string]: any;
97
102
  id: string;
98
103
  }, never>>;
99
- }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
104
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"select", {
105
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
106
+ options: import("effect/Schema").Array$<typeof import("effect/Schema").String>;
107
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"status", {
108
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
109
+ statusText: typeof import("effect/Schema").String;
110
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"suggest", {
111
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
112
+ text: typeof import("effect/Schema").String;
113
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"text", {
114
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
115
+ mimeType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
116
+ text: typeof import("effect/Schema").String;
117
+ disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
118
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"toolCall", {
119
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
120
+ toolCallId: typeof import("effect/Schema").String;
121
+ name: typeof import("effect/Schema").String;
122
+ input: typeof import("effect/Schema").Unknown;
123
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"toolList", {
124
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
125
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"toolResult", {
126
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
127
+ toolCallId: typeof import("effect/Schema").String;
128
+ name: typeof import("effect/Schema").String;
129
+ result: typeof import("effect/Schema").Unknown;
130
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"transcript", {
100
131
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
101
- }>, import("effect/Schema").Struct<{
102
- type: import("effect/Schema").Literal<["transcription"]>;
103
132
  started: typeof import("effect/Schema").String;
104
133
  text: typeof import("effect/Schema").String;
105
- }>>>]>>>;
134
+ }>>]>>>;
106
135
  properties: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Any>>>;
107
136
  }>>;
108
137
  objects: Schema.optional<Schema.Array$<Schema.Schema<Expando, Expando, never>>>;
@@ -124,9 +153,9 @@ export declare const ExtractionOutput: Schema.Struct<{
124
153
  nickname: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
125
154
  image: import("effect/Schema").optional<import("effect/Schema").SchemaClass<string, string, never>>;
126
155
  organization: import("effect/Schema").optional<import("effect/Schema").Schema<import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
127
- description?: string | undefined;
128
156
  id: string;
129
157
  name?: string | undefined;
158
+ description?: string | undefined;
130
159
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
131
160
  image?: string | undefined;
132
161
  website?: string | undefined;
@@ -175,22 +204,17 @@ export declare const ExtractionOutput: Schema.Struct<{
175
204
  name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
176
205
  role: import("effect/Schema").optional<import("effect/Schema").Literal<["user", "assistant"]>>;
177
206
  }>>;
178
- blocks: import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
207
+ blocks: import("effect/Schema").mutable<import("effect/Schema").Array$<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"anchor", {
179
208
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
180
- }>, import("effect/Schema").Struct<{
181
- type: import("effect/Schema").Literal<["text"]>;
182
- disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
183
- text: typeof import("effect/Schema").String;
184
- }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
209
+ objectId: import("@dxos/keys").ObjectIdClass;
210
+ version: typeof import("effect/Schema").Unknown;
211
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"file", {
185
212
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
186
- }>, import("effect/Schema").Struct<{
187
- type: import("effect/Schema").Literal<["json"]>;
188
- disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
189
- data: typeof import("effect/Schema").String;
190
- }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
213
+ url: typeof import("effect/Schema").String;
214
+ name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
215
+ mediaType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
216
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"image", {
191
217
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
192
- }>, import("effect/Schema").Struct<{
193
- type: import("effect/Schema").Literal<["image"]>;
194
218
  id: import("effect/Schema").optional<typeof import("effect/Schema").String>;
195
219
  source: import("effect/Schema").optional<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").Struct<{
196
220
  type: import("effect/Schema").Literal<["base64"]>;
@@ -200,21 +224,55 @@ export declare const ExtractionOutput: Schema.Struct<{
200
224
  type: import("effect/Schema").Literal<["http"]>;
201
225
  url: typeof import("effect/Schema").String;
202
226
  }>>]>>;
203
- }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
227
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"json", {
228
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
229
+ disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
230
+ data: typeof import("effect/Schema").String;
231
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"proposal", {
232
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
233
+ text: typeof import("effect/Schema").String;
234
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"reasoning", {
235
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
236
+ reasoningText: import("effect/Schema").optional<typeof import("effect/Schema").String>;
237
+ redactedText: import("effect/Schema").optional<typeof import("effect/Schema").String>;
238
+ signature: import("effect/Schema").optional<typeof import("effect/Schema").String>;
239
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"reference", {
204
240
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
205
- }>, import("effect/Schema").Struct<{
206
- type: import("effect/Schema").Literal<["reference"]>;
207
241
  reference: import("@dxos/echo/Type").ref<import("effect/Schema").Schema<import("@dxos/echo/Type").Expando, {
208
242
  [x: string]: any;
209
243
  id: string;
210
244
  }, never>>;
211
- }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
245
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"select", {
246
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
247
+ options: import("effect/Schema").Array$<typeof import("effect/Schema").String>;
248
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"status", {
249
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
250
+ statusText: typeof import("effect/Schema").String;
251
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"suggest", {
252
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
253
+ text: typeof import("effect/Schema").String;
254
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"text", {
255
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
256
+ mimeType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
257
+ text: typeof import("effect/Schema").String;
258
+ disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
259
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"toolCall", {
260
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
261
+ toolCallId: typeof import("effect/Schema").String;
262
+ name: typeof import("effect/Schema").String;
263
+ input: typeof import("effect/Schema").Unknown;
264
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"toolList", {
265
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
266
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"toolResult", {
267
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
268
+ toolCallId: typeof import("effect/Schema").String;
269
+ name: typeof import("effect/Schema").String;
270
+ result: typeof import("effect/Schema").Unknown;
271
+ }>>, import("effect/Schema").mutable<import("effect/Schema").TaggedStruct<"transcript", {
212
272
  pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
213
- }>, import("effect/Schema").Struct<{
214
- type: import("effect/Schema").Literal<["transcription"]>;
215
273
  started: typeof import("effect/Schema").String;
216
274
  text: typeof import("effect/Schema").String;
217
- }>>>]>>>;
275
+ }>>]>>>;
218
276
  properties: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Any>>>;
219
277
  }>>;
220
278
  timeElapsed: typeof Schema.Number;
@@ -1 +1 @@
1
- {"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../../../src/extraction/extraction.ts"],"names":[],"mappings":"AAIA,OA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C;IAChE,QAAQ,EAAE,gBAAgB,CAAC;IAE3B,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;AAEvF;;GAEG;AAEH,eAAO,MAAM,wBAAwB,GAAU,QAAQ,8BAA8B,KAAG,OAAO,CAAC,gBAAgB,CAkB/G,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './services';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Layer } from 'effect';
2
+ import { ToolExecutionService, ToolResolverService } from '@dxos/ai';
3
+ import { type FunctionDefinition } from '@dxos/functions';
4
+ export declare const makeToolResolverFromFunctions: (functions: FunctionDefinition<any, any>[]) => Layer.Layer<ToolResolverService>;
5
+ export declare const makeToolExecutionServiceFromFunctions: (functions: FunctionDefinition<any, any>[]) => Layer.Layer<ToolExecutionService>;
6
+ //# sourceMappingURL=services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/functions/services.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmB,KAAK,EAAoC,MAAM,QAAQ,CAAC;AAElF,OAAO,EAAuB,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE1F,OAAO,EAAuC,KAAK,kBAAkB,EAAiB,MAAM,iBAAiB,CAAC;AAG9G,eAAO,MAAM,6BAA6B,GACxC,WAAW,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,KACxC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAWjC,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAChD,WAAW,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,KACxC,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAkBlC,CAAC"}
@@ -1,9 +1,9 @@
1
- export * from './blueprint';
2
1
  export * from './context';
3
2
  export * from './conversation';
4
3
  export * from './extraction';
4
+ export * from './functions';
5
5
  export * from './research';
6
6
  export * from './session';
7
+ export * from './templates';
7
8
  export * from './types';
8
- export * from './conversation';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -1,7 +1,12 @@
1
- type CreateExaToolOptions = {
2
- apiKey: string;
3
- };
4
- export declare const createExaTool: ({ apiKey }: CreateExaToolOptions) => import("@dxos/ai").ExecutableTool;
5
- export declare const createMockExaTool: () => import("@dxos/ai").ExecutableTool;
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>;
6
11
  export {};
7
12
  //# sourceMappingURL=exa.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exa.d.ts","sourceRoot":"","sources":["../../../../src/research/exa.ts"],"names":[],"mappings":"AAYA,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,YAAY,oBAAoB,sCAuB7D,CAAC;AAEF,eAAO,MAAM,iBAAiB,yCAkC7B,CAAC"}
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,7 +1,8 @@
1
+ import { AiTool, AiToolkit } from '@effect/ai';
1
2
  import { Schema } from 'effect';
2
- import type { Obj } from '@dxos/echo';
3
3
  import { type EchoDatabase, type Queue } from '@dxos/echo-db';
4
4
  import { type BaseObject } from '@dxos/echo-schema';
5
+ import { DatabaseService } from '@dxos/functions';
5
6
  export declare const Subgraph: Schema.Struct<{
6
7
  /** Objects and relations. */
7
8
  objects: Schema.Array$<typeof Schema.Any>;
@@ -20,10 +21,24 @@ export type RelatedSchema = {
20
21
  * @returns
21
22
  */
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>>;
23
27
  /**
24
28
  * Perform vector search in the local database.
25
29
  */
26
- export declare const createLocalSearchTool: (db: EchoDatabase, queue?: Queue) => import("@dxos/ai").ExecutableTool;
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>;
27
42
  /**
28
43
  * Create a schema for structured data extraction.
29
44
  */
@@ -32,10 +47,5 @@ export declare const createExtractionSchema: (types: Schema.Schema.AnyNoContext[
32
47
  }>;
33
48
  export declare const getSanitizedSchemaName: (schema: Schema.Schema.AnyNoContext) => string;
34
49
  export declare const sanitizeObjects: (types: Schema.Schema.AnyNoContext[], data: Record<string, readonly unknown[]>, db: EchoDatabase, queue?: Queue) => Promise<BaseObject[]>;
35
- export declare const createGraphWriterTool: ({ db, queue, schema, onDone, }: {
36
- db: EchoDatabase;
37
- queue?: Queue;
38
- schema: Schema.Schema.AnyNoContext[];
39
- onDone?: (data: Obj.Any[]) => Promise<any>;
40
- }) => import("@dxos/ai").ExecutableTool;
50
+ export {};
41
51
  //# sourceMappingURL=graph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../src/research/graph.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAA+B,MAAM,QAAQ,CAAC;AAG7D,OAAO,KAAK,EAAE,GAAG,EAAY,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAUL,KAAK,UAAU,EAKhB,MAAM,mBAAmB,CAAC;AAO3B,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;AACH,eAAO,MAAM,qBAAqB,GAAI,IAAI,YAAY,EAAE,QAAQ,KAAK,sCAyBpE,CAAC;AAEF;;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,MA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AEH,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"}
@@ -5,6 +5,6 @@ export declare const researchFn: import("@dxos/functions").FunctionDefinition<{
5
5
  readonly query: string;
6
6
  readonly mockSearch?: boolean | undefined;
7
7
  }, {
8
- result: any;
8
+ readonly result: unknown;
9
9
  }>;
10
10
  //# sourceMappingURL=research.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../../../../src/research/research.ts"],"names":[],"mappings":"AAkBA;;GAEG;AAEH,eAAO,MAAM,UAAU;;;;YAuDC,GAAG;EAYzB,CAAC"}
1
+ {"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../../../../src/research/research.ts"],"names":[],"mappings":"AAqBA;;GAEG;AAEH,eAAO,MAAM,UAAU;;;;;EA6DrB,CAAC"}