@dxos/assistant 0.8.4-main.ae835ea → 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.
Files changed (172) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +2 -1
  3. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  4. package/dist/lib/neutral/extraction/index.mjs +204 -0
  5. package/dist/lib/neutral/extraction/index.mjs.map +7 -0
  6. package/dist/lib/neutral/index.mjs +1755 -0
  7. package/dist/lib/neutral/index.mjs.map +7 -0
  8. package/dist/lib/neutral/meta.json +1 -0
  9. package/dist/types/src/extraction/extraction-ner-function/index.d.ts +0 -1
  10. package/dist/types/src/extraction/extraction-ner-function/index.d.ts.map +1 -1
  11. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  12. package/dist/types/src/extraction/extraction.d.ts +1065 -312
  13. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  14. package/dist/types/src/extraction/index.d.ts +0 -1
  15. package/dist/types/src/extraction/index.d.ts.map +1 -1
  16. package/dist/types/src/extraction/quotes.d.ts +2 -2
  17. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  18. package/dist/types/src/functions/services.d.ts +13 -15
  19. package/dist/types/src/functions/services.d.ts.map +1 -1
  20. package/dist/types/src/index.d.ts +2 -5
  21. package/dist/types/src/index.d.ts.map +1 -1
  22. package/dist/types/src/request/AiRequest.d.ts +104 -0
  23. package/dist/types/src/request/AiRequest.d.ts.map +1 -0
  24. package/dist/types/src/{session → request}/artifact-diff.d.ts +1 -1
  25. package/dist/types/src/request/artifact-diff.d.ts.map +1 -0
  26. package/dist/types/src/request/format.d.ts +15 -0
  27. package/dist/types/src/request/format.d.ts.map +1 -0
  28. package/dist/types/src/request/index.d.ts +4 -0
  29. package/dist/types/src/request/index.d.ts.map +1 -0
  30. package/dist/types/src/{session → request}/observer.d.ts +6 -5
  31. package/dist/types/src/request/observer.d.ts.map +1 -0
  32. package/dist/types/src/{session → request}/version-pin.d.ts +3 -3
  33. package/dist/types/src/request/version-pin.d.ts.map +1 -0
  34. package/dist/types/src/session/AiContext.d.ts +154 -0
  35. package/dist/types/src/session/AiContext.d.ts.map +1 -0
  36. package/dist/types/src/session/AiContext.test.d.ts +2 -0
  37. package/dist/types/src/session/AiContext.test.d.ts.map +1 -0
  38. package/dist/types/src/session/AiSession.d.ts +73 -0
  39. package/dist/types/src/session/AiSession.d.ts.map +1 -0
  40. package/dist/types/src/session/index.d.ts +2 -4
  41. package/dist/types/src/session/index.d.ts.map +1 -1
  42. package/dist/types/src/session/toolkit.d.ts +10 -9
  43. package/dist/types/src/session/toolkit.d.ts.map +1 -1
  44. package/dist/types/src/templates/system.d.ts +1 -2
  45. package/dist/types/src/templates/system.d.ts.map +1 -1
  46. package/dist/types/src/util/artifact.d.ts +27 -0
  47. package/dist/types/src/util/artifact.d.ts.map +1 -0
  48. package/dist/types/src/{diff.d.ts → util/diff.d.ts} +3 -1
  49. package/dist/types/src/util/diff.d.ts.map +1 -0
  50. package/dist/types/src/{diff.test.d.ts.map → util/diff.test.d.ts.map} +1 -1
  51. package/dist/types/src/util/error-handling.d.ts.map +1 -0
  52. package/dist/types/src/{errors.d.ts → util/errors.d.ts} +32 -40
  53. package/dist/types/src/util/errors.d.ts.map +1 -0
  54. package/dist/types/src/{execution-graph.d.ts → util/execution-graph.d.ts} +5 -2
  55. package/dist/types/src/util/execution-graph.d.ts.map +1 -0
  56. package/dist/types/src/util/execution-graph.test.d.ts.map +1 -0
  57. package/dist/types/src/util/index.d.ts +7 -0
  58. package/dist/types/src/util/index.d.ts.map +1 -0
  59. package/dist/types/src/util/tracing.d.ts +233 -0
  60. package/dist/types/src/util/tracing.d.ts.map +1 -0
  61. package/dist/types/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +36 -42
  63. package/src/extraction/extraction-ner-function/index.ts +0 -1
  64. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +10 -5
  65. package/src/extraction/extraction.ts +43 -14
  66. package/src/extraction/index.ts +0 -1
  67. package/src/extraction/quotes.ts +4 -5
  68. package/src/functions/services.ts +119 -63
  69. package/src/index.ts +2 -5
  70. package/src/request/AiRequest.ts +348 -0
  71. package/src/{session → request}/artifact-diff.ts +1 -1
  72. package/src/{session → request}/format.ts +29 -24
  73. package/src/request/index.ts +8 -0
  74. package/src/{session → request}/observer.ts +6 -3
  75. package/src/{session → request}/version-pin.ts +6 -6
  76. package/src/session/AiContext.test.ts +53 -0
  77. package/src/session/AiContext.ts +403 -0
  78. package/src/session/AiSession.ts +324 -0
  79. package/src/session/index.ts +3 -4
  80. package/src/session/toolkit.ts +27 -28
  81. package/src/templates/{format.tpl → instructions/format.tpl} +1 -4
  82. package/src/templates/{system.tpl → instructions/system.tpl} +50 -2
  83. package/src/templates/system.ts +9 -8
  84. package/src/{types → util}/artifact.ts +42 -6
  85. package/src/util/diff.test.ts +74 -0
  86. package/src/{diff.ts → util/diff.ts} +13 -4
  87. package/src/{session → util}/error-handling.ts +3 -2
  88. package/src/util/errors.ts +15 -0
  89. package/src/{execution-graph.test.ts → util/execution-graph.test.ts} +47 -45
  90. package/src/{execution-graph.ts → util/execution-graph.ts} +41 -22
  91. package/src/util/index.ts +10 -0
  92. package/src/util/tracing.ts +57 -0
  93. package/dist/lib/browser/chunk-4VIJTKPM.mjs +0 -354
  94. package/dist/lib/browser/chunk-4VIJTKPM.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-UB26N5UF.mjs +0 -89
  96. package/dist/lib/browser/chunk-UB26N5UF.mjs.map +0 -7
  97. package/dist/lib/browser/extraction/index.mjs +0 -272
  98. package/dist/lib/browser/extraction/index.mjs.map +0 -7
  99. package/dist/lib/browser/index.mjs +0 -900
  100. package/dist/lib/browser/index.mjs.map +0 -7
  101. package/dist/lib/browser/meta.json +0 -1
  102. package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs +0 -13
  103. package/dist/lib/node-esm/chunk-AUUC7II4.mjs +0 -356
  104. package/dist/lib/node-esm/chunk-AUUC7II4.mjs.map +0 -7
  105. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs +0 -91
  106. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +0 -7
  107. package/dist/lib/node-esm/extraction/index.mjs +0 -273
  108. package/dist/lib/node-esm/extraction/index.mjs.map +0 -7
  109. package/dist/lib/node-esm/index.mjs +0 -901
  110. package/dist/lib/node-esm/index.mjs.map +0 -7
  111. package/dist/lib/node-esm/meta.json +0 -1
  112. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs +0 -14
  113. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs.map +0 -7
  114. package/dist/types/src/conversation/context.d.ts +0 -103
  115. package/dist/types/src/conversation/context.d.ts.map +0 -1
  116. package/dist/types/src/conversation/conversation.d.ts +0 -41
  117. package/dist/types/src/conversation/conversation.d.ts.map +0 -1
  118. package/dist/types/src/conversation/index.d.ts +0 -3
  119. package/dist/types/src/conversation/index.d.ts.map +0 -1
  120. package/dist/types/src/diff.d.ts.map +0 -1
  121. package/dist/types/src/errors.d.ts.map +0 -1
  122. package/dist/types/src/execution-graph.d.ts.map +0 -1
  123. package/dist/types/src/execution-graph.test.d.ts.map +0 -1
  124. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +0 -4
  125. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +0 -1
  126. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +0 -2
  127. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +0 -1
  128. package/dist/types/src/extraction/extraction-llm-function/index.d.ts +0 -2
  129. package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +0 -1
  130. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +0 -345
  131. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +0 -1
  132. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +0 -2
  133. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +0 -1
  134. package/dist/types/src/session/artifact-diff.d.ts.map +0 -1
  135. package/dist/types/src/session/error-handling.d.ts.map +0 -1
  136. package/dist/types/src/session/format.d.ts +0 -186
  137. package/dist/types/src/session/format.d.ts.map +0 -1
  138. package/dist/types/src/session/format.test.d.ts +0 -2
  139. package/dist/types/src/session/format.test.d.ts.map +0 -1
  140. package/dist/types/src/session/observer.d.ts.map +0 -1
  141. package/dist/types/src/session/session.d.ts +0 -51
  142. package/dist/types/src/session/session.d.ts.map +0 -1
  143. package/dist/types/src/session/session.test.d.ts +0 -2
  144. package/dist/types/src/session/session.test.d.ts.map +0 -1
  145. package/dist/types/src/session/version-pin.d.ts.map +0 -1
  146. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  147. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  148. package/dist/types/src/types/artifact.d.ts +0 -16
  149. package/dist/types/src/types/artifact.d.ts.map +0 -1
  150. package/dist/types/src/types/index.d.ts +0 -2
  151. package/dist/types/src/types/index.d.ts.map +0 -1
  152. package/src/conversation/context.ts +0 -186
  153. package/src/conversation/conversation.ts +0 -128
  154. package/src/conversation/index.ts +0 -6
  155. package/src/diff.test.ts +0 -43
  156. package/src/errors.ts +0 -15
  157. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +0 -84
  158. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +0 -72
  159. package/src/extraction/extraction-llm-function/index.ts +0 -5
  160. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +0 -115
  161. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +0 -64
  162. package/src/session/format.test.ts +0 -60
  163. package/src/session/session.conversations.json +0 -1
  164. package/src/session/session.test.ts +0 -149
  165. package/src/session/session.ts +0 -213
  166. package/src/summarization/summarization.test.ts +0 -202
  167. package/src/types/index.ts +0 -5
  168. /package/dist/lib/{browser/named-entity-recognition-QPYHML66.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  169. /package/dist/types/src/{diff.test.d.ts → util/diff.test.d.ts} +0 -0
  170. /package/dist/types/src/{session → util}/error-handling.d.ts +0 -0
  171. /package/dist/types/src/{execution-graph.test.d.ts → util/execution-graph.test.d.ts} +0 -0
  172. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -1,345 +0,0 @@
1
- /**
2
- * Named Entity Recognition model
3
- */
4
- export declare const extractionNerFunction: import("@dxos/functions").FunctionDefinition<{
5
- readonly options?: {
6
- readonly timeout?: number | undefined;
7
- readonly fallbackToRaw?: boolean | undefined;
8
- } | undefined;
9
- readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
10
- id: string;
11
- parentMessage?: string | undefined;
12
- created: string;
13
- sender: {
14
- contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
15
- fullName?: string | undefined;
16
- preferredName?: string | undefined;
17
- nickname?: string | undefined;
18
- image?: string | undefined;
19
- organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
20
- id: string;
21
- description?: string | undefined;
22
- name?: string | undefined;
23
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
24
- image?: string | undefined;
25
- website?: string | undefined;
26
- location?: readonly [number, number, (number | undefined)?] | undefined;
27
- }> | undefined;
28
- jobTitle?: string | undefined;
29
- department?: string | undefined;
30
- notes?: string | undefined;
31
- emails?: {
32
- readonly label?: string | undefined;
33
- readonly value: string;
34
- }[] | undefined;
35
- identities?: {
36
- readonly label?: string | undefined;
37
- readonly value: string;
38
- }[] | undefined;
39
- phoneNumbers?: {
40
- readonly label?: string | undefined;
41
- readonly value: string;
42
- }[] | undefined;
43
- addresses?: {
44
- readonly label?: string | undefined;
45
- readonly value: {
46
- readonly street?: string | undefined;
47
- readonly extended?: string | undefined;
48
- readonly locality?: string | undefined;
49
- readonly region?: string | undefined;
50
- readonly postalCode?: string | undefined;
51
- readonly postOfficeBoxNumber?: string | undefined;
52
- readonly country?: string | undefined;
53
- };
54
- }[] | undefined;
55
- urls?: {
56
- readonly label?: string | undefined;
57
- readonly value: string;
58
- }[] | undefined;
59
- birthday?: string | undefined;
60
- fields?: {
61
- readonly label: string;
62
- readonly value: string;
63
- readonly category?: string | undefined;
64
- }[] | undefined;
65
- location?: readonly [number, number, (number | undefined)?] | undefined;
66
- }> | undefined;
67
- identityDid?: string | undefined;
68
- identityKey?: string | undefined;
69
- email?: string | undefined;
70
- name?: string | undefined;
71
- role?: "user" | "assistant" | "tool" | undefined;
72
- };
73
- blocks: ({
74
- version: unknown;
75
- _tag: "anchor";
76
- pending?: boolean | undefined;
77
- objectId: string;
78
- } | {
79
- name?: string | undefined;
80
- _tag: "file";
81
- pending?: boolean | undefined;
82
- url: string;
83
- mediaType?: string | undefined;
84
- } | {
85
- id?: string | undefined;
86
- _tag: "image";
87
- pending?: boolean | undefined;
88
- source?: {
89
- mediaType: string;
90
- type: "base64";
91
- data: string;
92
- } | {
93
- url: string;
94
- type: "http";
95
- } | undefined;
96
- } | {
97
- _tag: "json";
98
- pending?: boolean | undefined;
99
- data: string;
100
- disposition?: string | undefined;
101
- } | {
102
- text: string;
103
- _tag: "proposal";
104
- pending?: boolean | undefined;
105
- } | {
106
- _tag: "reasoning";
107
- pending?: boolean | undefined;
108
- reasoningText?: string | undefined;
109
- redactedText?: string | undefined;
110
- signature?: string | undefined;
111
- } | {
112
- reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
113
- _tag: "reference";
114
- pending?: boolean | undefined;
115
- } | {
116
- _tag: "select";
117
- pending?: boolean | undefined;
118
- options: readonly string[];
119
- } | {
120
- _tag: "status";
121
- pending?: boolean | undefined;
122
- statusText: string;
123
- } | {
124
- text: string;
125
- _tag: "suggestion";
126
- pending?: boolean | undefined;
127
- } | {
128
- _tag: "summary";
129
- pending?: boolean | undefined;
130
- mimeType?: string | undefined;
131
- message?: string | undefined;
132
- model?: string | undefined;
133
- usage?: {
134
- readonly inputTokens?: number | undefined;
135
- readonly outputTokens?: number | undefined;
136
- readonly totalTokens?: number | undefined;
137
- } | undefined;
138
- toolCalls?: number | undefined;
139
- errors?: number | undefined;
140
- duration?: number | undefined;
141
- } | {
142
- text: string;
143
- _tag: "text";
144
- pending?: boolean | undefined;
145
- disposition?: string | undefined;
146
- mimeType?: string | undefined;
147
- } | {
148
- _tag: "toolkit";
149
- pending?: boolean | undefined;
150
- } | {
151
- name: string;
152
- _tag: "toolCall";
153
- pending?: boolean | undefined;
154
- toolCallId: string;
155
- input: string;
156
- providerExecuted: boolean;
157
- } | {
158
- name: string;
159
- _tag: "toolResult";
160
- pending?: boolean | undefined;
161
- toolCallId: string;
162
- providerExecuted: boolean;
163
- result?: string | undefined;
164
- error?: string | undefined;
165
- } | {
166
- text: string;
167
- _tag: "transcript";
168
- pending?: boolean | undefined;
169
- started: string;
170
- })[];
171
- properties?: {
172
- [x: string]: any;
173
- } | undefined;
174
- };
175
- readonly objects?: readonly import("@dxos/echo/internal").Expando[] | undefined;
176
- }, {
177
- readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
178
- id: string;
179
- parentMessage?: string | undefined;
180
- created: string;
181
- sender: {
182
- contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
183
- fullName?: string | undefined;
184
- preferredName?: string | undefined;
185
- nickname?: string | undefined;
186
- image?: string | undefined;
187
- organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
188
- id: string;
189
- description?: string | undefined;
190
- name?: string | undefined;
191
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
192
- image?: string | undefined;
193
- website?: string | undefined;
194
- location?: readonly [number, number, (number | undefined)?] | undefined;
195
- }> | undefined;
196
- jobTitle?: string | undefined;
197
- department?: string | undefined;
198
- notes?: string | undefined;
199
- emails?: {
200
- readonly label?: string | undefined;
201
- readonly value: string;
202
- }[] | undefined;
203
- identities?: {
204
- readonly label?: string | undefined;
205
- readonly value: string;
206
- }[] | undefined;
207
- phoneNumbers?: {
208
- readonly label?: string | undefined;
209
- readonly value: string;
210
- }[] | undefined;
211
- addresses?: {
212
- readonly label?: string | undefined;
213
- readonly value: {
214
- readonly street?: string | undefined;
215
- readonly extended?: string | undefined;
216
- readonly locality?: string | undefined;
217
- readonly region?: string | undefined;
218
- readonly postalCode?: string | undefined;
219
- readonly postOfficeBoxNumber?: string | undefined;
220
- readonly country?: string | undefined;
221
- };
222
- }[] | undefined;
223
- urls?: {
224
- readonly label?: string | undefined;
225
- readonly value: string;
226
- }[] | undefined;
227
- birthday?: string | undefined;
228
- fields?: {
229
- readonly label: string;
230
- readonly value: string;
231
- readonly category?: string | undefined;
232
- }[] | undefined;
233
- location?: readonly [number, number, (number | undefined)?] | undefined;
234
- }> | undefined;
235
- identityDid?: string | undefined;
236
- identityKey?: string | undefined;
237
- email?: string | undefined;
238
- name?: string | undefined;
239
- role?: "user" | "assistant" | "tool" | undefined;
240
- };
241
- blocks: ({
242
- version: unknown;
243
- _tag: "anchor";
244
- pending?: boolean | undefined;
245
- objectId: string;
246
- } | {
247
- name?: string | undefined;
248
- _tag: "file";
249
- pending?: boolean | undefined;
250
- url: string;
251
- mediaType?: string | undefined;
252
- } | {
253
- id?: string | undefined;
254
- _tag: "image";
255
- pending?: boolean | undefined;
256
- source?: {
257
- mediaType: string;
258
- type: "base64";
259
- data: string;
260
- } | {
261
- url: string;
262
- type: "http";
263
- } | undefined;
264
- } | {
265
- _tag: "json";
266
- pending?: boolean | undefined;
267
- data: string;
268
- disposition?: string | undefined;
269
- } | {
270
- text: string;
271
- _tag: "proposal";
272
- pending?: boolean | undefined;
273
- } | {
274
- _tag: "reasoning";
275
- pending?: boolean | undefined;
276
- reasoningText?: string | undefined;
277
- redactedText?: string | undefined;
278
- signature?: string | undefined;
279
- } | {
280
- reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
281
- _tag: "reference";
282
- pending?: boolean | undefined;
283
- } | {
284
- _tag: "select";
285
- pending?: boolean | undefined;
286
- options: readonly string[];
287
- } | {
288
- _tag: "status";
289
- pending?: boolean | undefined;
290
- statusText: string;
291
- } | {
292
- text: string;
293
- _tag: "suggestion";
294
- pending?: boolean | undefined;
295
- } | {
296
- _tag: "summary";
297
- pending?: boolean | undefined;
298
- mimeType?: string | undefined;
299
- message?: string | undefined;
300
- model?: string | undefined;
301
- usage?: {
302
- readonly inputTokens?: number | undefined;
303
- readonly outputTokens?: number | undefined;
304
- readonly totalTokens?: number | undefined;
305
- } | undefined;
306
- toolCalls?: number | undefined;
307
- errors?: number | undefined;
308
- duration?: number | undefined;
309
- } | {
310
- text: string;
311
- _tag: "text";
312
- pending?: boolean | undefined;
313
- disposition?: string | undefined;
314
- mimeType?: string | undefined;
315
- } | {
316
- _tag: "toolkit";
317
- pending?: boolean | undefined;
318
- } | {
319
- name: string;
320
- _tag: "toolCall";
321
- pending?: boolean | undefined;
322
- toolCallId: string;
323
- input: string;
324
- providerExecuted: boolean;
325
- } | {
326
- name: string;
327
- _tag: "toolResult";
328
- pending?: boolean | undefined;
329
- toolCallId: string;
330
- providerExecuted: boolean;
331
- result?: string | undefined;
332
- error?: string | undefined;
333
- } | {
334
- text: string;
335
- _tag: "transcript";
336
- pending?: boolean | undefined;
337
- started: string;
338
- })[];
339
- properties?: {
340
- [x: string]: any;
341
- } | undefined;
342
- };
343
- readonly timeElapsed: number;
344
- }>;
345
- //# sourceMappingURL=extraction-ner-function.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extraction-ner-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.ts"],"names":[],"mappings":"AAiBA;;GAEG;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0ChC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=extraction-ner-function.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extraction-ner-function.test.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifact-diff.d.ts","sourceRoot":"","sources":["../../../../src/session/artifact-diff.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;;AAEnD;;;;;;;GAOG;AAEH,qBAAa,oBAAqB,SAAQ,yBAGvC;CAAG;AAEN,yBAAiB,oBAAoB,CAAC;IACpC,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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-handling.d.ts","sourceRoot":"","sources":["../../../../src/session/error-handling.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAcxC,eAAO,MAAM,UAAU,GAAI,KAAK,OAAO,CAAC,OAAO,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAoB1B,CAAC"}
@@ -1,186 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import { type AiSessionRunParams } from './session';
3
- /**
4
- * Formats the system prompt.
5
- */
6
- export declare const formatSystemPrompt: ({ system, blueprints, objects, }: Pick<AiSessionRunParams<any>, "system" | "blueprints" | "objects">) => Effect.Effect<string, never, never>;
7
- /**
8
- * Formats the user prompt.
9
- */
10
- export declare const formatUserPrompt: ({ prompt, history }: Pick<AiSessionRunParams<any>, "prompt" | "history">) => Effect.Effect<import("@dxos/live-object").Live<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
11
- id: string;
12
- parentMessage?: string | undefined;
13
- created: string;
14
- sender: {
15
- contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
16
- fullName?: string | undefined;
17
- preferredName?: string | undefined;
18
- nickname?: string | undefined;
19
- image?: string | undefined;
20
- organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
21
- id: string;
22
- description?: string | undefined;
23
- name?: string | undefined;
24
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
25
- image?: string | undefined;
26
- website?: string | undefined;
27
- location?: readonly [number, number, (number | undefined)?] | undefined;
28
- }> | undefined;
29
- jobTitle?: string | undefined;
30
- department?: string | undefined;
31
- notes?: string | undefined;
32
- emails?: {
33
- readonly label?: string | undefined;
34
- readonly value: string;
35
- }[] | undefined;
36
- identities?: {
37
- readonly label?: string | undefined;
38
- readonly value: string;
39
- }[] | undefined;
40
- phoneNumbers?: {
41
- readonly label?: string | undefined;
42
- readonly value: string;
43
- }[] | undefined;
44
- addresses?: {
45
- readonly label?: string | undefined;
46
- readonly value: {
47
- readonly street?: string | undefined;
48
- readonly extended?: string | undefined;
49
- readonly locality?: string | undefined;
50
- readonly region?: string | undefined;
51
- readonly postalCode?: string | undefined;
52
- readonly postOfficeBoxNumber?: string | undefined;
53
- readonly country?: string | undefined;
54
- };
55
- }[] | undefined;
56
- urls?: {
57
- readonly label?: string | undefined;
58
- readonly value: string;
59
- }[] | undefined;
60
- birthday?: string | undefined;
61
- fields?: {
62
- readonly label: string;
63
- readonly value: string;
64
- readonly category?: string | undefined;
65
- }[] | undefined;
66
- location?: readonly [number, number, (number | undefined)?] | undefined;
67
- }> | undefined;
68
- identityDid?: string | undefined;
69
- identityKey?: string | undefined;
70
- email?: string | undefined;
71
- name?: string | undefined;
72
- role?: "user" | "assistant" | "tool" | undefined;
73
- };
74
- blocks: ({
75
- version: unknown;
76
- _tag: "anchor";
77
- pending?: boolean | undefined;
78
- objectId: string;
79
- } | {
80
- name?: string | undefined;
81
- _tag: "file";
82
- pending?: boolean | undefined;
83
- url: string;
84
- mediaType?: string | undefined;
85
- } | {
86
- id?: string | undefined;
87
- _tag: "image";
88
- pending?: boolean | undefined;
89
- source?: {
90
- mediaType: string;
91
- type: "base64";
92
- data: string;
93
- } | {
94
- url: string;
95
- type: "http";
96
- } | undefined;
97
- } | {
98
- _tag: "json";
99
- pending?: boolean | undefined;
100
- data: string;
101
- disposition?: string | undefined;
102
- } | {
103
- text: string;
104
- _tag: "proposal";
105
- pending?: boolean | undefined;
106
- } | {
107
- _tag: "reasoning";
108
- pending?: boolean | undefined;
109
- reasoningText?: string | undefined;
110
- redactedText?: string | undefined;
111
- signature?: string | undefined;
112
- } | {
113
- reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
114
- _tag: "reference";
115
- pending?: boolean | undefined;
116
- } | {
117
- _tag: "select";
118
- pending?: boolean | undefined;
119
- options: readonly string[];
120
- } | {
121
- _tag: "status";
122
- pending?: boolean | undefined;
123
- statusText: string;
124
- } | {
125
- text: string;
126
- _tag: "suggestion";
127
- pending?: boolean | undefined;
128
- } | {
129
- _tag: "summary";
130
- pending?: boolean | undefined;
131
- mimeType?: string | undefined;
132
- message?: string | undefined;
133
- model?: string | undefined;
134
- usage?: {
135
- readonly inputTokens?: number | undefined;
136
- readonly outputTokens?: number | undefined;
137
- readonly totalTokens?: number | undefined;
138
- } | undefined;
139
- toolCalls?: number | undefined;
140
- errors?: number | undefined;
141
- duration?: number | undefined;
142
- } | {
143
- text: string;
144
- _tag: "text";
145
- pending?: boolean | undefined;
146
- disposition?: string | undefined;
147
- mimeType?: string | undefined;
148
- } | {
149
- _tag: "toolkit";
150
- pending?: boolean | undefined;
151
- } | {
152
- name: string;
153
- _tag: "toolCall";
154
- pending?: boolean | undefined;
155
- toolCallId: string;
156
- input: string;
157
- providerExecuted: boolean;
158
- } | {
159
- name: string;
160
- _tag: "toolResult";
161
- pending?: boolean | undefined;
162
- toolCallId: string;
163
- providerExecuted: boolean;
164
- result?: string | undefined;
165
- error?: string | undefined;
166
- } | {
167
- text: string;
168
- _tag: "transcript";
169
- pending?: boolean | undefined;
170
- started: string;
171
- })[];
172
- properties?: {
173
- [x: string]: any;
174
- } | undefined;
175
- }>, {
176
- "__#private@#code": "AI_ASSISTANT_ERROR";
177
- "__#private@#context": Record<string, unknown>;
178
- readonly name: "AI_ASSISTANT_ERROR";
179
- readonly message: string;
180
- readonly code: "AI_ASSISTANT_ERROR";
181
- readonly _tag: "AI_ASSISTANT_ERROR";
182
- readonly context: Record<string, unknown>;
183
- stack?: string;
184
- cause?: unknown;
185
- }, never>;
186
- //# sourceMappingURL=format.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/session/format.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAgBxC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD;;GAEG;AAEH,eAAO,MAAM,kBAAkB,GAAI,kCAIhC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC,wCAsCjE,CAAC;AAEL;;GAEG;AAGH,eAAO,MAAM,gBAAgB,GAAI,qBAA0B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoC1G,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=format.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.test.d.ts","sourceRoot":"","sources":["../../../../src/session/format.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../../src/session/observer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,QAAQ,CAAC,sBAAsB;IACzE;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,kBAAkB;6DAO1B,OAAO,CAAC,kBAAkB,CAAC,KAAQ,kBAAkB;;IAUxD;;OAEG;2BACoB,cAAc;EAiBrC,CAAC"}
@@ -1,51 +0,0 @@
1
- import type * as AiError from '@effect/ai/AiError';
2
- import * as LanguageModel from '@effect/ai/LanguageModel';
3
- import type * as Tool from '@effect/ai/Tool';
4
- import type * as Toolkit from '@effect/ai/Toolkit';
5
- import * as Effect from 'effect/Effect';
6
- import type * as Schema from 'effect/Schema';
7
- import { type AiToolNotFoundError, type PromptPreprocessingError, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
8
- import { type Blueprint } from '@dxos/blueprints';
9
- import { Obj } from '@dxos/echo';
10
- import { TracingService } from '@dxos/functions';
11
- import { DataType } from '@dxos/schema';
12
- import { type AiAssistantError } from '../errors';
13
- import { GenerationObserver } from './observer';
14
- export type AiSessionRunError = AiError.AiError | PromptPreprocessingError | AiToolNotFoundError | AiAssistantError;
15
- export type AiSessionRunRequirements = LanguageModel.LanguageModel | ToolExecutionService | ToolResolverService | TracingService;
16
- export type AiSessionRunParams<Tools extends Record<string, Tool.Any>> = {
17
- prompt: string;
18
- system?: string;
19
- history?: DataType.Message[];
20
- objects?: Obj.Any[];
21
- blueprints?: Blueprint.Blueprint[];
22
- toolkit?: Toolkit.WithHandler<Tools>;
23
- observer?: GenerationObserver;
24
- };
25
- export type AiSessionOptions = {};
26
- /**
27
- * Contains message history, tools, current context.
28
- * Current context means the state of the app, time of day, and other contextual information.
29
- * It makes requests to the model, its a state machine.
30
- * It keeps track of the current goal.
31
- * It manages the context window.
32
- * Tracks the success criteria of reaching the goal, exposing metrics (stretch).
33
- * Could be run locally in the app or remotely.
34
- * Could be personal or shared.
35
- */
36
- export declare class AiSession {
37
- private readonly _options;
38
- /** Prevents concurrent execution of session. */
39
- private readonly _semaphore;
40
- /** Message history from queue. */
41
- private _history;
42
- /** Pending messages for this session (incl. the current prompt). */
43
- private _pending;
44
- constructor(_options?: AiSessionOptions);
45
- run: <Tools extends Record<string, Tool.Any>>({ prompt, system: systemTemplate, history, objects, blueprints, toolkit, observer, }: AiSessionRunParams<Tools>) => Effect.Effect<DataType.Message[], AiSessionRunError, AiSessionRunRequirements>;
46
- /**
47
- * @deprecated
48
- */
49
- runStructured<S extends Schema.Schema.AnyNoContext>(_schema: S, _options: AiSessionRunParams<any>): Promise<Schema.Schema.Type<S>>;
50
- }
51
- //# sourceMappingURL=session.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/session/session.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,OAAO,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAG7C,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAGzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,GAAG,wBAAwB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAEpH,MAAM,MAAM,wBAAwB,GAChC,aAAa,CAAC,aAAa,GAC3B,oBAAoB,GACpB,mBAAmB,GACnB,cAAc,CAAC;AAEnB,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI;IACvE,MAAM,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC;;;;;;;;;GASG;AACH,qBAAa,SAAS;IAWR,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAVrC,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA2C;IAEtE,kCAAkC;IAElC,OAAO,CAAC,QAAQ,CAA0B;IAE1C,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAA0B;gBAEb,QAAQ,GAAE,gBAAqB;IAE5D,GAAG,GAAI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,sFAQ5C,kBAAkB,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,wBAAwB,CAAC,CA+FjC;IAE5E;;OAEG;IAEG,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,EACtD,OAAO,EAAE,CAAC,EACV,QAAQ,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAChC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CASlC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=session.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session.test.d.ts","sourceRoot":"","sources":["../../../../src/session/session.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"version-pin.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,aAAa,EAAY,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAKjD,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,aAAa,KAAK,UAAU,CAAC;IAClD,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,YAAY,CAAC,GAAG,CAAC;CAiBpD,CAAC"}
@@ -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,16 +0,0 @@
1
- import * as Schema from 'effect/Schema';
2
- import { type ObjectId } from '@dxos/echo/internal';
3
- import { DXN, type SpaceId } from '@dxos/keys';
4
- /**
5
- * @deprecated
6
- */
7
- export declare const createArtifactElement: (id: ObjectId) => string;
8
- /**
9
- * A model-friendly way to reference an object.
10
- * Supports vairous formats that will be normalized to a DXN.
11
- */
12
- export declare const ArtifactId: Schema.Schema<string> & {
13
- toDXN: (reference: ArtifactId, owningSpaceId?: SpaceId) => DXN;
14
- };
15
- export type ArtifactId = Schema.Schema.Type<typeof ArtifactId>;
16
- //# sourceMappingURL=artifact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../../../src/types/artifact.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAmB,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAGhE;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,IAAI,QAAQ,WAA4B,CAAC;AAE/E;;;GAGG;AAEH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG;IAC/C,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC;CA4BhE,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './artifact';
2
- //# sourceMappingURL=index.d.ts.map