@dxos/assistant 0.8.4-main.406dc2a → 0.8.4-main.43cb759274

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 (174) 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 +208 -0
  5. package/dist/lib/neutral/extraction/index.mjs.map +7 -0
  6. package/dist/lib/neutral/index.mjs +1820 -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 +1649 -310
  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 +308 -0
  23. package/dist/types/src/request/AiRequest.d.ts.map +1 -0
  24. package/dist/types/src/{session → request}/artifact-diff.d.ts +3 -3
  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 +4 -4
  33. package/dist/types/src/request/version-pin.d.ts.map +1 -0
  34. package/dist/types/src/session/AiContext.d.ts +178 -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 +78 -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 +12 -3
  45. package/dist/types/src/templates/system.d.ts.map +1 -1
  46. package/dist/types/src/util/artifact.d.ts +18 -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 +293 -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 +48 -18
  66. package/src/extraction/index.ts +0 -1
  67. package/src/extraction/quotes.test.ts +2 -2
  68. package/src/extraction/quotes.ts +6 -8
  69. package/src/functions/services.ts +133 -64
  70. package/src/index.ts +2 -5
  71. package/src/request/AiRequest.ts +387 -0
  72. package/src/{session → request}/artifact-diff.ts +3 -3
  73. package/src/{session → request}/format.ts +32 -27
  74. package/src/request/index.ts +8 -0
  75. package/src/{session → request}/observer.ts +6 -3
  76. package/src/{session → request}/version-pin.ts +7 -7
  77. package/src/session/AiContext.test.ts +49 -0
  78. package/src/session/AiContext.ts +420 -0
  79. package/src/session/AiSession.ts +325 -0
  80. package/src/session/index.ts +3 -4
  81. package/src/session/toolkit.ts +27 -28
  82. package/src/templates/{format.tpl → instructions/format.tpl} +1 -4
  83. package/src/templates/{system.tpl → instructions/system.tpl} +50 -2
  84. package/src/templates/system.ts +9 -8
  85. package/src/util/artifact.ts +96 -0
  86. package/src/util/diff.test.ts +74 -0
  87. package/src/{diff.ts → util/diff.ts} +18 -4
  88. package/src/{session → util}/error-handling.ts +3 -2
  89. package/src/util/errors.ts +15 -0
  90. package/src/{execution-graph.test.ts → util/execution-graph.test.ts} +48 -46
  91. package/src/{execution-graph.ts → util/execution-graph.ts} +49 -29
  92. package/src/util/index.ts +10 -0
  93. package/src/util/tracing.ts +57 -0
  94. package/dist/lib/browser/chunk-CWGVG235.mjs +0 -380
  95. package/dist/lib/browser/chunk-CWGVG235.mjs.map +0 -7
  96. package/dist/lib/browser/chunk-UB26N5UF.mjs +0 -89
  97. package/dist/lib/browser/chunk-UB26N5UF.mjs.map +0 -7
  98. package/dist/lib/browser/extraction/index.mjs +0 -272
  99. package/dist/lib/browser/extraction/index.mjs.map +0 -7
  100. package/dist/lib/browser/index.mjs +0 -933
  101. package/dist/lib/browser/index.mjs.map +0 -7
  102. package/dist/lib/browser/meta.json +0 -1
  103. package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs +0 -13
  104. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs +0 -91
  105. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +0 -7
  106. package/dist/lib/node-esm/chunk-OV5PMQPB.mjs +0 -382
  107. package/dist/lib/node-esm/chunk-OV5PMQPB.mjs.map +0 -7
  108. package/dist/lib/node-esm/extraction/index.mjs +0 -273
  109. package/dist/lib/node-esm/extraction/index.mjs.map +0 -7
  110. package/dist/lib/node-esm/index.mjs +0 -934
  111. package/dist/lib/node-esm/index.mjs.map +0 -7
  112. package/dist/lib/node-esm/meta.json +0 -1
  113. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs +0 -14
  114. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs.map +0 -7
  115. package/dist/types/src/conversation/context.d.ts +0 -103
  116. package/dist/types/src/conversation/context.d.ts.map +0 -1
  117. package/dist/types/src/conversation/conversation.d.ts +0 -44
  118. package/dist/types/src/conversation/conversation.d.ts.map +0 -1
  119. package/dist/types/src/conversation/index.d.ts +0 -3
  120. package/dist/types/src/conversation/index.d.ts.map +0 -1
  121. package/dist/types/src/diff.d.ts.map +0 -1
  122. package/dist/types/src/errors.d.ts.map +0 -1
  123. package/dist/types/src/execution-graph.d.ts.map +0 -1
  124. package/dist/types/src/execution-graph.test.d.ts.map +0 -1
  125. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +0 -4
  126. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +0 -1
  127. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +0 -2
  128. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +0 -1
  129. package/dist/types/src/extraction/extraction-llm-function/index.d.ts +0 -2
  130. package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +0 -1
  131. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +0 -341
  132. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +0 -1
  133. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +0 -2
  134. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +0 -1
  135. package/dist/types/src/session/artifact-diff.d.ts.map +0 -1
  136. package/dist/types/src/session/error-handling.d.ts.map +0 -1
  137. package/dist/types/src/session/format.d.ts +0 -184
  138. package/dist/types/src/session/format.d.ts.map +0 -1
  139. package/dist/types/src/session/format.test.d.ts +0 -2
  140. package/dist/types/src/session/format.test.d.ts.map +0 -1
  141. package/dist/types/src/session/observer.d.ts.map +0 -1
  142. package/dist/types/src/session/session.d.ts +0 -51
  143. package/dist/types/src/session/session.d.ts.map +0 -1
  144. package/dist/types/src/session/session.test.d.ts +0 -2
  145. package/dist/types/src/session/session.test.d.ts.map +0 -1
  146. package/dist/types/src/session/version-pin.d.ts.map +0 -1
  147. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  148. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  149. package/dist/types/src/types/artifact.d.ts +0 -16
  150. package/dist/types/src/types/artifact.d.ts.map +0 -1
  151. package/dist/types/src/types/index.d.ts +0 -2
  152. package/dist/types/src/types/index.d.ts.map +0 -1
  153. package/src/conversation/context.ts +0 -186
  154. package/src/conversation/conversation.ts +0 -132
  155. package/src/conversation/index.ts +0 -6
  156. package/src/diff.test.ts +0 -43
  157. package/src/errors.ts +0 -15
  158. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +0 -84
  159. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +0 -72
  160. package/src/extraction/extraction-llm-function/index.ts +0 -5
  161. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +0 -115
  162. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +0 -64
  163. package/src/session/format.test.ts +0 -60
  164. package/src/session/session.conversations.json +0 -1
  165. package/src/session/session.test.ts +0 -149
  166. package/src/session/session.ts +0 -212
  167. package/src/summarization/summarization.test.ts +0 -202
  168. package/src/types/artifact.ts +0 -52
  169. package/src/types/index.ts +0 -5
  170. /package/dist/lib/{browser/named-entity-recognition-QPYHML66.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  171. /package/dist/types/src/{diff.test.d.ts → util/diff.test.d.ts} +0 -0
  172. /package/dist/types/src/{session → util}/error-handling.d.ts +0 -0
  173. /package/dist/types/src/{execution-graph.test.d.ts → util/execution-graph.test.d.ts} +0 -0
  174. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -1,341 +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
- }> | undefined;
27
- jobTitle?: string | undefined;
28
- department?: string | undefined;
29
- notes?: string | undefined;
30
- emails?: {
31
- readonly label?: string | undefined;
32
- readonly value: string;
33
- }[] | undefined;
34
- identities?: {
35
- readonly label?: string | undefined;
36
- readonly value: string;
37
- }[] | undefined;
38
- phoneNumbers?: {
39
- readonly label?: string | undefined;
40
- readonly value: string;
41
- }[] | undefined;
42
- addresses?: {
43
- readonly label?: string | undefined;
44
- readonly value: {
45
- readonly street?: string | undefined;
46
- readonly extended?: string | undefined;
47
- readonly locality?: string | undefined;
48
- readonly region?: string | undefined;
49
- readonly postalCode?: string | undefined;
50
- readonly postOfficeBoxNumber?: string | undefined;
51
- readonly country?: string | undefined;
52
- };
53
- }[] | undefined;
54
- urls?: {
55
- readonly label?: string | undefined;
56
- readonly value: string;
57
- }[] | undefined;
58
- birthday?: string | undefined;
59
- fields?: {
60
- readonly label: string;
61
- readonly value: string;
62
- readonly category?: string | undefined;
63
- }[] | undefined;
64
- }> | undefined;
65
- identityDid?: string | undefined;
66
- identityKey?: string | undefined;
67
- email?: string | undefined;
68
- name?: string | undefined;
69
- role?: "user" | "assistant" | "tool" | undefined;
70
- };
71
- blocks: ({
72
- version: unknown;
73
- _tag: "anchor";
74
- pending?: boolean | undefined;
75
- objectId: string;
76
- } | {
77
- name?: string | undefined;
78
- _tag: "file";
79
- pending?: boolean | undefined;
80
- url: string;
81
- mediaType?: string | undefined;
82
- } | {
83
- id?: string | undefined;
84
- _tag: "image";
85
- pending?: boolean | undefined;
86
- source?: {
87
- mediaType: string;
88
- type: "base64";
89
- data: string;
90
- } | {
91
- url: string;
92
- type: "http";
93
- } | undefined;
94
- } | {
95
- _tag: "json";
96
- pending?: boolean | undefined;
97
- data: string;
98
- disposition?: string | undefined;
99
- } | {
100
- text: string;
101
- _tag: "proposal";
102
- pending?: boolean | undefined;
103
- } | {
104
- _tag: "reasoning";
105
- pending?: boolean | undefined;
106
- reasoningText?: string | undefined;
107
- redactedText?: string | undefined;
108
- signature?: string | undefined;
109
- } | {
110
- reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
111
- _tag: "reference";
112
- pending?: boolean | undefined;
113
- } | {
114
- _tag: "select";
115
- pending?: boolean | undefined;
116
- options: readonly string[];
117
- } | {
118
- _tag: "status";
119
- pending?: boolean | undefined;
120
- statusText: string;
121
- } | {
122
- text: string;
123
- _tag: "suggestion";
124
- pending?: boolean | undefined;
125
- } | {
126
- _tag: "summary";
127
- pending?: boolean | undefined;
128
- mimeType?: string | undefined;
129
- message?: string | undefined;
130
- model?: string | undefined;
131
- usage?: {
132
- readonly inputTokens?: number | undefined;
133
- readonly outputTokens?: number | undefined;
134
- readonly totalTokens?: number | undefined;
135
- } | undefined;
136
- toolCalls?: number | undefined;
137
- errors?: number | undefined;
138
- duration?: number | undefined;
139
- } | {
140
- text: string;
141
- _tag: "text";
142
- pending?: boolean | undefined;
143
- disposition?: string | undefined;
144
- mimeType?: string | undefined;
145
- } | {
146
- _tag: "toolkit";
147
- pending?: boolean | undefined;
148
- } | {
149
- name: string;
150
- _tag: "toolCall";
151
- pending?: boolean | undefined;
152
- toolCallId: string;
153
- input: string;
154
- providerExecuted: boolean;
155
- } | {
156
- name: string;
157
- _tag: "toolResult";
158
- pending?: boolean | undefined;
159
- toolCallId: string;
160
- providerExecuted: boolean;
161
- result?: string | undefined;
162
- error?: string | undefined;
163
- } | {
164
- text: string;
165
- _tag: "transcript";
166
- pending?: boolean | undefined;
167
- started: string;
168
- })[];
169
- properties?: {
170
- [x: string]: any;
171
- } | undefined;
172
- };
173
- readonly objects?: readonly import("@dxos/echo/internal").Expando[] | undefined;
174
- }, {
175
- readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
176
- id: string;
177
- parentMessage?: string | undefined;
178
- created: string;
179
- sender: {
180
- contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
181
- fullName?: string | undefined;
182
- preferredName?: string | undefined;
183
- nickname?: string | undefined;
184
- image?: string | undefined;
185
- organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
186
- id: string;
187
- description?: string | undefined;
188
- name?: string | undefined;
189
- status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
190
- image?: string | undefined;
191
- website?: string | undefined;
192
- }> | undefined;
193
- jobTitle?: string | undefined;
194
- department?: string | undefined;
195
- notes?: string | undefined;
196
- emails?: {
197
- readonly label?: string | undefined;
198
- readonly value: string;
199
- }[] | undefined;
200
- identities?: {
201
- readonly label?: string | undefined;
202
- readonly value: string;
203
- }[] | undefined;
204
- phoneNumbers?: {
205
- readonly label?: string | undefined;
206
- readonly value: string;
207
- }[] | undefined;
208
- addresses?: {
209
- readonly label?: string | undefined;
210
- readonly value: {
211
- readonly street?: string | undefined;
212
- readonly extended?: string | undefined;
213
- readonly locality?: string | undefined;
214
- readonly region?: string | undefined;
215
- readonly postalCode?: string | undefined;
216
- readonly postOfficeBoxNumber?: string | undefined;
217
- readonly country?: string | undefined;
218
- };
219
- }[] | undefined;
220
- urls?: {
221
- readonly label?: string | undefined;
222
- readonly value: string;
223
- }[] | undefined;
224
- birthday?: string | undefined;
225
- fields?: {
226
- readonly label: string;
227
- readonly value: string;
228
- readonly category?: string | undefined;
229
- }[] | undefined;
230
- }> | undefined;
231
- identityDid?: string | undefined;
232
- identityKey?: string | undefined;
233
- email?: string | undefined;
234
- name?: string | undefined;
235
- role?: "user" | "assistant" | "tool" | undefined;
236
- };
237
- blocks: ({
238
- version: unknown;
239
- _tag: "anchor";
240
- pending?: boolean | undefined;
241
- objectId: string;
242
- } | {
243
- name?: string | undefined;
244
- _tag: "file";
245
- pending?: boolean | undefined;
246
- url: string;
247
- mediaType?: string | undefined;
248
- } | {
249
- id?: string | undefined;
250
- _tag: "image";
251
- pending?: boolean | undefined;
252
- source?: {
253
- mediaType: string;
254
- type: "base64";
255
- data: string;
256
- } | {
257
- url: string;
258
- type: "http";
259
- } | undefined;
260
- } | {
261
- _tag: "json";
262
- pending?: boolean | undefined;
263
- data: string;
264
- disposition?: string | undefined;
265
- } | {
266
- text: string;
267
- _tag: "proposal";
268
- pending?: boolean | undefined;
269
- } | {
270
- _tag: "reasoning";
271
- pending?: boolean | undefined;
272
- reasoningText?: string | undefined;
273
- redactedText?: string | undefined;
274
- signature?: string | undefined;
275
- } | {
276
- reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
277
- _tag: "reference";
278
- pending?: boolean | undefined;
279
- } | {
280
- _tag: "select";
281
- pending?: boolean | undefined;
282
- options: readonly string[];
283
- } | {
284
- _tag: "status";
285
- pending?: boolean | undefined;
286
- statusText: string;
287
- } | {
288
- text: string;
289
- _tag: "suggestion";
290
- pending?: boolean | undefined;
291
- } | {
292
- _tag: "summary";
293
- pending?: boolean | undefined;
294
- mimeType?: string | undefined;
295
- message?: string | undefined;
296
- model?: string | undefined;
297
- usage?: {
298
- readonly inputTokens?: number | undefined;
299
- readonly outputTokens?: number | undefined;
300
- readonly totalTokens?: number | undefined;
301
- } | undefined;
302
- toolCalls?: number | undefined;
303
- errors?: number | undefined;
304
- duration?: number | undefined;
305
- } | {
306
- text: string;
307
- _tag: "text";
308
- pending?: boolean | undefined;
309
- disposition?: string | undefined;
310
- mimeType?: string | undefined;
311
- } | {
312
- _tag: "toolkit";
313
- pending?: boolean | undefined;
314
- } | {
315
- name: string;
316
- _tag: "toolCall";
317
- pending?: boolean | undefined;
318
- toolCallId: string;
319
- input: string;
320
- providerExecuted: boolean;
321
- } | {
322
- name: string;
323
- _tag: "toolResult";
324
- pending?: boolean | undefined;
325
- toolCallId: string;
326
- providerExecuted: boolean;
327
- result?: string | undefined;
328
- error?: string | undefined;
329
- } | {
330
- text: string;
331
- _tag: "transcript";
332
- pending?: boolean | undefined;
333
- started: string;
334
- })[];
335
- properties?: {
336
- [x: string]: any;
337
- } | undefined;
338
- };
339
- readonly timeElapsed: number;
340
- }>;
341
- //# 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,184 +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
- }> | 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
- }> | undefined;
66
- identityDid?: string | undefined;
67
- identityKey?: string | undefined;
68
- email?: string | undefined;
69
- name?: string | undefined;
70
- role?: "user" | "assistant" | "tool" | undefined;
71
- };
72
- blocks: ({
73
- version: unknown;
74
- _tag: "anchor";
75
- pending?: boolean | undefined;
76
- objectId: string;
77
- } | {
78
- name?: string | undefined;
79
- _tag: "file";
80
- pending?: boolean | undefined;
81
- url: string;
82
- mediaType?: string | undefined;
83
- } | {
84
- id?: string | undefined;
85
- _tag: "image";
86
- pending?: boolean | undefined;
87
- source?: {
88
- mediaType: string;
89
- type: "base64";
90
- data: string;
91
- } | {
92
- url: string;
93
- type: "http";
94
- } | undefined;
95
- } | {
96
- _tag: "json";
97
- pending?: boolean | undefined;
98
- data: string;
99
- disposition?: string | undefined;
100
- } | {
101
- text: string;
102
- _tag: "proposal";
103
- pending?: boolean | undefined;
104
- } | {
105
- _tag: "reasoning";
106
- pending?: boolean | undefined;
107
- reasoningText?: string | undefined;
108
- redactedText?: string | undefined;
109
- signature?: string | undefined;
110
- } | {
111
- reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
112
- _tag: "reference";
113
- pending?: boolean | undefined;
114
- } | {
115
- _tag: "select";
116
- pending?: boolean | undefined;
117
- options: readonly string[];
118
- } | {
119
- _tag: "status";
120
- pending?: boolean | undefined;
121
- statusText: string;
122
- } | {
123
- text: string;
124
- _tag: "suggestion";
125
- pending?: boolean | undefined;
126
- } | {
127
- _tag: "summary";
128
- pending?: boolean | undefined;
129
- mimeType?: string | undefined;
130
- message?: string | undefined;
131
- model?: string | undefined;
132
- usage?: {
133
- readonly inputTokens?: number | undefined;
134
- readonly outputTokens?: number | undefined;
135
- readonly totalTokens?: number | undefined;
136
- } | undefined;
137
- toolCalls?: number | undefined;
138
- errors?: number | undefined;
139
- duration?: number | undefined;
140
- } | {
141
- text: string;
142
- _tag: "text";
143
- pending?: boolean | undefined;
144
- disposition?: string | undefined;
145
- mimeType?: string | undefined;
146
- } | {
147
- _tag: "toolkit";
148
- pending?: boolean | undefined;
149
- } | {
150
- name: string;
151
- _tag: "toolCall";
152
- pending?: boolean | undefined;
153
- toolCallId: string;
154
- input: string;
155
- providerExecuted: boolean;
156
- } | {
157
- name: string;
158
- _tag: "toolResult";
159
- pending?: boolean | undefined;
160
- toolCallId: string;
161
- providerExecuted: boolean;
162
- result?: string | undefined;
163
- error?: string | undefined;
164
- } | {
165
- text: string;
166
- _tag: "transcript";
167
- pending?: boolean | undefined;
168
- started: string;
169
- })[];
170
- properties?: {
171
- [x: string]: any;
172
- } | undefined;
173
- }>, {
174
- "__#private@#code": "AI_ASSISTANT_ERROR";
175
- "__#private@#context": Record<string, unknown>;
176
- readonly name: "AI_ASSISTANT_ERROR";
177
- readonly message: string;
178
- readonly code: "AI_ASSISTANT_ERROR";
179
- readonly _tag: "AI_ASSISTANT_ERROR";
180
- readonly context: Record<string, unknown>;
181
- stack?: string;
182
- cause?: unknown;
183
- }, never>;
184
- //# 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;IACf,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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}