@dxos/assistant 0.8.2-main.fbd8ed0 → 0.8.2-staging.4d6ad0f

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 (289) hide show
  1. package/dist/lib/browser/index.mjs +1983 -64
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +1976 -63
  5. package/dist/lib/node/index.cjs.map +4 -4
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/index.mjs +1984 -64
  8. package/dist/lib/node-esm/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/{src/bin → bin}/chat.d.ts.map +1 -1
  11. package/dist/types/src/blueprint/blueprint.d.ts +79 -0
  12. package/dist/types/src/blueprint/blueprint.d.ts.map +1 -0
  13. package/dist/types/src/blueprint/blueprint.test.d.ts +2 -0
  14. package/dist/types/src/blueprint/blueprint.test.d.ts.map +1 -0
  15. package/dist/types/src/blueprint/index.d.ts +4 -0
  16. package/dist/types/src/blueprint/index.d.ts.map +1 -0
  17. package/dist/types/src/blueprint/logger.d.ts +3 -0
  18. package/dist/types/src/blueprint/logger.d.ts.map +1 -0
  19. package/dist/types/src/{ai-service/parser.d.ts → blueprint/machine.d.ts} +46 -68
  20. package/dist/types/src/blueprint/machine.d.ts.map +1 -0
  21. package/dist/types/src/blueprint/test-data.d.ts +3 -0
  22. package/dist/types/src/blueprint/test-data.d.ts.map +1 -0
  23. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +4 -0
  24. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -0
  25. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +2 -0
  26. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +1 -0
  27. package/dist/types/src/extraction/extraction-llm-function/index.d.ts +2 -0
  28. package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +1 -0
  29. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +210 -0
  30. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -0
  31. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +2 -0
  32. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +1 -0
  33. package/dist/types/src/extraction/extraction-ner-function/index.d.ts +3 -0
  34. package/dist/types/src/extraction/extraction-ner-function/index.d.ts.map +1 -0
  35. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts +14 -0
  36. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -0
  37. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.test.d.ts +2 -0
  38. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.test.d.ts.map +1 -0
  39. package/dist/types/src/extraction/extraction.d.ts +242 -0
  40. package/dist/types/src/extraction/extraction.d.ts.map +1 -0
  41. package/dist/types/src/extraction/index.d.ts +5 -0
  42. package/dist/types/src/extraction/index.d.ts.map +1 -0
  43. package/dist/types/src/extraction/quotes.d.ts +15 -0
  44. package/dist/types/src/extraction/quotes.d.ts.map +1 -0
  45. package/dist/types/src/extraction/quotes.test.d.ts +2 -0
  46. package/dist/types/src/extraction/quotes.test.d.ts.map +1 -0
  47. package/dist/types/src/index.d.ts +4 -2
  48. package/dist/types/src/index.d.ts.map +1 -1
  49. package/dist/types/src/research/exa.d.ts +7 -0
  50. package/dist/types/src/research/exa.d.ts.map +1 -0
  51. package/dist/types/src/research/graph.d.ts +39 -0
  52. package/dist/types/src/research/graph.d.ts.map +1 -0
  53. package/dist/types/src/research/graph.test.d.ts +2 -0
  54. package/dist/types/src/research/graph.test.d.ts.map +1 -0
  55. package/dist/types/src/research/index.d.ts +4 -0
  56. package/dist/types/src/research/index.d.ts.map +1 -0
  57. package/dist/types/src/research/research.d.ts +10 -0
  58. package/dist/types/src/research/research.d.ts.map +1 -0
  59. package/dist/types/src/research/research.test.d.ts.map +1 -0
  60. package/dist/types/src/session/index.d.ts +0 -1
  61. package/dist/types/src/session/index.d.ts.map +1 -1
  62. package/dist/types/src/session/session.d.ts +47 -22
  63. package/dist/types/src/session/session.d.ts.map +1 -1
  64. package/dist/types/src/session/version-pin.d.ts +3 -4
  65. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  66. package/dist/types/src/summarization/summarization.test.d.ts +2 -0
  67. package/dist/types/src/summarization/summarization.test.d.ts.map +1 -0
  68. package/dist/types/src/testing/exa-search-1748337321991.d.ts +38 -0
  69. package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +1 -0
  70. package/dist/types/src/testing/exa-search-1748337331526.d.ts +37 -0
  71. package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +1 -0
  72. package/dist/types/src/testing/exa-search-1748337344119.d.ts +58 -0
  73. package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +1 -0
  74. package/dist/types/src/testing/index.d.ts +2 -7
  75. package/dist/types/src/testing/index.d.ts.map +1 -1
  76. package/dist/types/src/types.d.ts +3 -0
  77. package/dist/types/src/types.d.ts.map +1 -0
  78. package/package.json +22 -38
  79. package/src/blueprint/blueprint.test.ts +142 -0
  80. package/src/blueprint/blueprint.ts +95 -0
  81. package/src/blueprint/index.ts +7 -0
  82. package/src/blueprint/logger.ts +66 -0
  83. package/src/blueprint/machine.ts +208 -0
  84. package/src/blueprint/test-data.ts +55 -0
  85. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +95 -0
  86. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +64 -0
  87. package/src/extraction/extraction-llm-function/index.ts +5 -0
  88. package/src/extraction/extraction-llm-function/instructions.tpl +28 -0
  89. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +115 -0
  90. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +54 -0
  91. package/src/extraction/extraction-ner-function/index.ts +6 -0
  92. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +94 -0
  93. package/src/extraction/extraction-ner-function/named-entity-recognition.ts +97 -0
  94. package/src/extraction/extraction.ts +75 -0
  95. package/src/extraction/index.ts +8 -0
  96. package/src/extraction/quotes.test.ts +27 -0
  97. package/src/extraction/quotes.ts +57 -0
  98. package/src/index.ts +4 -4
  99. package/src/research/exa.ts +100 -0
  100. package/src/research/graph.test.ts +15 -0
  101. package/src/research/graph.ts +291 -0
  102. package/src/research/index.ts +7 -0
  103. package/src/research/instructions-research.tpl +97 -0
  104. package/src/research/research.test.ts +189 -0
  105. package/src/research/research.ts +89 -0
  106. package/src/session/index.ts +0 -1
  107. package/src/session/session.test.ts +7 -7
  108. package/src/session/session.ts +46 -19
  109. package/src/session/version-pin.ts +2 -3
  110. package/src/summarization/summarization.test.ts +216 -0
  111. package/src/testing/exa-search-1748337321991.ts +131 -0
  112. package/src/testing/exa-search-1748337331526.ts +144 -0
  113. package/src/testing/exa-search-1748337344119.ts +133 -0
  114. package/src/testing/index.ts +8 -8
  115. package/src/types.ts +8 -0
  116. package/src/typings.d.ts +8 -0
  117. package/dist/lib/browser/chunk-B4HAWUFW.mjs +0 -2786
  118. package/dist/lib/browser/chunk-B4HAWUFW.mjs.map +0 -7
  119. package/dist/lib/browser/testing/index.mjs +0 -658
  120. package/dist/lib/browser/testing/index.mjs.map +0 -7
  121. package/dist/lib/node/chunk-NOB7CIIC.cjs +0 -2791
  122. package/dist/lib/node/chunk-NOB7CIIC.cjs.map +0 -7
  123. package/dist/lib/node/testing/index.cjs +0 -672
  124. package/dist/lib/node/testing/index.cjs.map +0 -7
  125. package/dist/lib/node-esm/chunk-SAWYU3V5.mjs +0 -2788
  126. package/dist/lib/node-esm/chunk-SAWYU3V5.mjs.map +0 -7
  127. package/dist/lib/node-esm/testing/index.mjs +0 -659
  128. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  129. package/dist/types/src/ai-service/client.test.d.ts +0 -2
  130. package/dist/types/src/ai-service/client.test.d.ts.map +0 -1
  131. package/dist/types/src/ai-service/defs.d.ts +0 -9
  132. package/dist/types/src/ai-service/defs.d.ts.map +0 -1
  133. package/dist/types/src/ai-service/edge-client.d.ts +0 -18
  134. package/dist/types/src/ai-service/edge-client.d.ts.map +0 -1
  135. package/dist/types/src/ai-service/index.d.ts +0 -10
  136. package/dist/types/src/ai-service/index.d.ts.map +0 -1
  137. package/dist/types/src/ai-service/message-collector.d.ts +0 -82
  138. package/dist/types/src/ai-service/message-collector.d.ts.map +0 -1
  139. package/dist/types/src/ai-service/ollama-client.d.ts +0 -43
  140. package/dist/types/src/ai-service/ollama-client.d.ts.map +0 -1
  141. package/dist/types/src/ai-service/parser.d.ts.map +0 -1
  142. package/dist/types/src/ai-service/service.d.ts +0 -25
  143. package/dist/types/src/ai-service/service.d.ts.map +0 -1
  144. package/dist/types/src/ai-service/stream.d.ts +0 -40
  145. package/dist/types/src/ai-service/stream.d.ts.map +0 -1
  146. package/dist/types/src/ai-service/stream.test.d.ts +0 -2
  147. package/dist/types/src/ai-service/stream.test.d.ts.map +0 -1
  148. package/dist/types/src/ai-service/testing/index.d.ts +0 -3
  149. package/dist/types/src/ai-service/testing/index.d.ts.map +0 -1
  150. package/dist/types/src/ai-service/testing/mock.d.ts +0 -11
  151. package/dist/types/src/ai-service/testing/mock.d.ts.map +0 -1
  152. package/dist/types/src/ai-service/testing/test-stream.d.ts +0 -7
  153. package/dist/types/src/ai-service/testing/test-stream.d.ts.map +0 -1
  154. package/dist/types/src/ai-service/transform.d.ts +0 -27
  155. package/dist/types/src/ai-service/transform.d.ts.map +0 -1
  156. package/dist/types/src/ai-service/types.d.ts +0 -210
  157. package/dist/types/src/ai-service/types.d.ts.map +0 -1
  158. package/dist/types/src/ai-service/util/index.d.ts +0 -2
  159. package/dist/types/src/ai-service/util/index.d.ts.map +0 -1
  160. package/dist/types/src/ai-service/util/sse.d.ts +0 -39
  161. package/dist/types/src/ai-service/util/sse.d.ts.map +0 -1
  162. package/dist/types/src/experimental/conversation/conversation.d.ts +0 -61
  163. package/dist/types/src/experimental/conversation/conversation.d.ts.map +0 -1
  164. package/dist/types/src/experimental/conversation/conversation.test.d.ts +0 -2
  165. package/dist/types/src/experimental/conversation/conversation.test.d.ts.map +0 -1
  166. package/dist/types/src/experimental/conversation/index.d.ts +0 -2
  167. package/dist/types/src/experimental/conversation/index.d.ts.map +0 -1
  168. package/dist/types/src/experimental/conversation/types.d.ts +0 -78
  169. package/dist/types/src/experimental/conversation/types.d.ts.map +0 -1
  170. package/dist/types/src/experimental/cypher/ast.d.ts +0 -56
  171. package/dist/types/src/experimental/cypher/ast.d.ts.map +0 -1
  172. package/dist/types/src/experimental/cypher/combinators.d.ts +0 -14
  173. package/dist/types/src/experimental/cypher/combinators.d.ts.map +0 -1
  174. package/dist/types/src/experimental/cypher/combinators.test.d.ts +0 -2
  175. package/dist/types/src/experimental/cypher/combinators.test.d.ts.map +0 -1
  176. package/dist/types/src/experimental/cypher/echo-data-source.d.ts +0 -16
  177. package/dist/types/src/experimental/cypher/echo-data-source.d.ts.map +0 -1
  178. package/dist/types/src/experimental/cypher/execution-plan.d.ts +0 -49
  179. package/dist/types/src/experimental/cypher/execution-plan.d.ts.map +0 -1
  180. package/dist/types/src/experimental/cypher/execution-plan.test.d.ts +0 -2
  181. package/dist/types/src/experimental/cypher/execution-plan.test.d.ts.map +0 -1
  182. package/dist/types/src/experimental/cypher/index.d.ts +0 -5
  183. package/dist/types/src/experimental/cypher/index.d.ts.map +0 -1
  184. package/dist/types/src/experimental/cypher/parjs.d.ts +0 -4
  185. package/dist/types/src/experimental/cypher/parjs.d.ts.map +0 -1
  186. package/dist/types/src/experimental/cypher/parser.d.ts +0 -6
  187. package/dist/types/src/experimental/cypher/parser.d.ts.map +0 -1
  188. package/dist/types/src/experimental/cypher/query-executor.d.ts +0 -26
  189. package/dist/types/src/experimental/cypher/query-executor.d.ts.map +0 -1
  190. package/dist/types/src/experimental/cypher/query-executor.test.d.ts +0 -2
  191. package/dist/types/src/experimental/cypher/query-executor.test.d.ts.map +0 -1
  192. package/dist/types/src/experimental/cypher/schema.d.ts +0 -12
  193. package/dist/types/src/experimental/cypher/schema.d.ts.map +0 -1
  194. package/dist/types/src/experimental/cypher/schema.test.d.ts +0 -2
  195. package/dist/types/src/experimental/cypher/schema.test.d.ts.map +0 -1
  196. package/dist/types/src/experimental/index.d.ts +0 -3
  197. package/dist/types/src/experimental/index.d.ts.map +0 -1
  198. package/dist/types/src/experimental/ner/ner.test.d.ts +0 -2
  199. package/dist/types/src/experimental/ner/ner.test.d.ts.map +0 -1
  200. package/dist/types/src/experimental/research/exa.d.ts +0 -6
  201. package/dist/types/src/experimental/research/exa.d.ts.map +0 -1
  202. package/dist/types/src/experimental/research/research.test.d.ts.map +0 -1
  203. package/dist/types/src/session/tools.d.ts +0 -18
  204. package/dist/types/src/session/tools.d.ts.map +0 -1
  205. package/dist/types/src/testing/artifacts.test.d.ts +0 -1
  206. package/dist/types/src/testing/artifacts.test.d.ts.map +0 -1
  207. package/dist/types/src/testing/data.d.ts +0 -2
  208. package/dist/types/src/testing/data.d.ts.map +0 -1
  209. package/dist/types/src/testing/defs.d.ts +0 -5
  210. package/dist/types/src/testing/defs.d.ts.map +0 -1
  211. package/dist/types/src/testing/logger.d.ts +0 -12
  212. package/dist/types/src/testing/logger.d.ts.map +0 -1
  213. package/dist/types/src/testing/object-extraction.test.d.ts +0 -1
  214. package/dist/types/src/testing/object-extraction.test.d.ts.map +0 -1
  215. package/dist/types/src/testing/ollama.d.ts +0 -6
  216. package/dist/types/src/testing/ollama.d.ts.map +0 -1
  217. package/dist/types/src/testing/printer.d.ts +0 -6
  218. package/dist/types/src/testing/printer.d.ts.map +0 -1
  219. package/dist/types/src/testing/query-promts.d.ts +0 -5
  220. package/dist/types/src/testing/query-promts.d.ts.map +0 -1
  221. package/dist/types/src/testing/query.test.d.ts +0 -2
  222. package/dist/types/src/testing/query.test.d.ts.map +0 -1
  223. package/dist/types/src/testing/test-data.d.ts +0 -29
  224. package/dist/types/src/testing/test-data.d.ts.map +0 -1
  225. package/dist/types/src/testing/test-schema.d.ts +0 -52
  226. package/dist/types/src/testing/test-schema.d.ts.map +0 -1
  227. package/dist/types/src/util/index.d.ts +0 -2
  228. package/dist/types/src/util/index.d.ts.map +0 -1
  229. package/dist/types/src/util/trim.d.ts +0 -5
  230. package/dist/types/src/util/trim.d.ts.map +0 -1
  231. package/src/ai-service/client.test.ts +0 -247
  232. package/src/ai-service/defs.ts +0 -39
  233. package/src/ai-service/edge-client.ts +0 -60
  234. package/src/ai-service/index.ts +0 -13
  235. package/src/ai-service/message-collector.ts +0 -84
  236. package/src/ai-service/ollama-client.ts +0 -506
  237. package/src/ai-service/parser.ts +0 -369
  238. package/src/ai-service/service.ts +0 -31
  239. package/src/ai-service/stream.test.ts +0 -125
  240. package/src/ai-service/stream.ts +0 -118
  241. package/src/ai-service/testing/index.ts +0 -6
  242. package/src/ai-service/testing/mock.ts +0 -30
  243. package/src/ai-service/testing/test-stream.ts +0 -93
  244. package/src/ai-service/transform.ts +0 -121
  245. package/src/ai-service/types.ts +0 -112
  246. package/src/ai-service/util/index.ts +0 -5
  247. package/src/ai-service/util/sse.ts +0 -341
  248. package/src/bin/chat.ts +0 -79
  249. package/src/experimental/conversation/conversation.test.ts +0 -73
  250. package/src/experimental/conversation/conversation.ts +0 -142
  251. package/src/experimental/conversation/index.ts +0 -5
  252. package/src/experimental/conversation/types.ts +0 -126
  253. package/src/experimental/cypher/ast.ts +0 -75
  254. package/src/experimental/cypher/combinators.test.ts +0 -137
  255. package/src/experimental/cypher/combinators.ts +0 -148
  256. package/src/experimental/cypher/echo-data-source.ts +0 -105
  257. package/src/experimental/cypher/execution-plan.test.ts +0 -44
  258. package/src/experimental/cypher/execution-plan.ts +0 -208
  259. package/src/experimental/cypher/index.ts +0 -8
  260. package/src/experimental/cypher/parjs-shims.d.ts +0 -10
  261. package/src/experimental/cypher/parjs.ts +0 -10
  262. package/src/experimental/cypher/parser.ts +0 -19
  263. package/src/experimental/cypher/query-executor.test.ts +0 -47
  264. package/src/experimental/cypher/query-executor.ts +0 -145
  265. package/src/experimental/cypher/schema.test.ts +0 -17
  266. package/src/experimental/cypher/schema.ts +0 -86
  267. package/src/experimental/index.ts +0 -6
  268. package/src/experimental/ner/ner.test.ts +0 -163
  269. package/src/experimental/research/exa.ts +0 -38
  270. package/src/experimental/research/instructions.tpl +0 -64
  271. package/src/experimental/research/research.test.ts +0 -263
  272. package/src/session/tools.ts +0 -117
  273. package/src/testing/artifacts.test.ts +0 -182
  274. package/src/testing/data.ts +0 -13
  275. package/src/testing/defs.ts +0 -9
  276. package/src/testing/logger.ts +0 -129
  277. package/src/testing/object-extraction.test.ts +0 -71
  278. package/src/testing/ollama.ts +0 -15
  279. package/src/testing/printer.ts +0 -41
  280. package/src/testing/query-promts.ts +0 -75
  281. package/src/testing/query.test.ts +0 -88
  282. package/src/testing/test-data.ts +0 -379
  283. package/src/testing/test-schema.ts +0 -79
  284. package/src/util/index.ts +0 -5
  285. package/src/util/trim.ts +0 -15
  286. package/vendor/parjs-browser.mjs +0 -4
  287. package/vendor/parjs-default.mjs +0 -8
  288. /package/dist/types/{src/bin → bin}/chat.d.ts +0 -0
  289. /package/dist/types/src/{experimental/research → research}/research.test.d.ts +0 -0
@@ -0,0 +1,210 @@
1
+ export declare const extractionNerFn: import("@dxos/functions").FunctionDefinition<{
2
+ readonly message: {
3
+ readonly id: string;
4
+ created: string;
5
+ sender: {
6
+ name?: string | undefined;
7
+ email?: string | undefined;
8
+ role?: "user" | "assistant" | undefined;
9
+ contact?: import("@dxos/echo-schema").Ref<{
10
+ readonly id: string;
11
+ fields?: {
12
+ readonly value: string;
13
+ readonly label: string;
14
+ readonly category?: string | undefined;
15
+ }[] | undefined;
16
+ organization?: import("@dxos/echo-schema").Ref<{
17
+ readonly id: string;
18
+ description?: string | undefined;
19
+ name?: string | undefined;
20
+ status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
21
+ image?: string | undefined;
22
+ website?: string | undefined;
23
+ }> | undefined;
24
+ image?: string | undefined;
25
+ fullName?: string | undefined;
26
+ preferredName?: string | undefined;
27
+ nickname?: string | undefined;
28
+ jobTitle?: string | undefined;
29
+ department?: string | undefined;
30
+ notes?: string | undefined;
31
+ emails?: {
32
+ readonly value: string;
33
+ readonly label?: string | undefined;
34
+ }[] | undefined;
35
+ identities?: {
36
+ readonly value: string;
37
+ readonly label?: string | undefined;
38
+ }[] | undefined;
39
+ phoneNumbers?: {
40
+ readonly value: string;
41
+ readonly label?: string | undefined;
42
+ }[] | undefined;
43
+ addresses?: {
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
+ readonly label?: string | undefined;
54
+ }[] | undefined;
55
+ urls?: {
56
+ readonly value: string;
57
+ readonly label?: string | undefined;
58
+ }[] | undefined;
59
+ birthday?: string | undefined;
60
+ }> | undefined;
61
+ identityDid?: string | undefined;
62
+ identityKey?: string | undefined;
63
+ };
64
+ blocks: ({
65
+ pending?: boolean | undefined;
66
+ type: "text";
67
+ disposition?: string | undefined;
68
+ text: string;
69
+ } | {
70
+ pending?: boolean | undefined;
71
+ type: "json";
72
+ disposition?: string | undefined;
73
+ data: string;
74
+ } | {
75
+ pending?: boolean | undefined;
76
+ id?: string | undefined;
77
+ type: "image";
78
+ source?: {
79
+ type: "base64";
80
+ mediaType: string;
81
+ data: string;
82
+ } | {
83
+ type: "http";
84
+ url: string;
85
+ } | undefined;
86
+ } | {
87
+ pending?: boolean | undefined;
88
+ type: "reference";
89
+ reference: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>;
90
+ } | {
91
+ pending?: boolean | undefined;
92
+ type: "transcription";
93
+ text: string;
94
+ started: string;
95
+ })[];
96
+ properties?: {
97
+ [x: string]: any;
98
+ } | undefined;
99
+ };
100
+ readonly options?: {
101
+ readonly timeout?: number | undefined;
102
+ readonly fallbackToRaw?: boolean | undefined;
103
+ } | undefined;
104
+ readonly objects?: readonly import("@dxos/echo-schema").Expando[] | undefined;
105
+ }, {
106
+ message: Omit<{
107
+ readonly id: string;
108
+ created: string;
109
+ sender: {
110
+ name?: string | undefined;
111
+ email?: string | undefined;
112
+ role?: "user" | "assistant" | undefined;
113
+ contact?: import("@dxos/echo-schema").Ref<{
114
+ readonly id: string;
115
+ fields?: {
116
+ readonly value: string;
117
+ readonly label: string;
118
+ readonly category?: string | undefined;
119
+ }[] | undefined;
120
+ organization?: import("@dxos/echo-schema").Ref<{
121
+ readonly id: string;
122
+ description?: string | undefined;
123
+ name?: string | undefined;
124
+ status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
125
+ image?: string | undefined;
126
+ website?: string | undefined;
127
+ }> | undefined;
128
+ image?: string | undefined;
129
+ fullName?: string | undefined;
130
+ preferredName?: string | undefined;
131
+ nickname?: string | undefined;
132
+ jobTitle?: string | undefined;
133
+ department?: string | undefined;
134
+ notes?: string | undefined;
135
+ emails?: {
136
+ readonly value: string;
137
+ readonly label?: string | undefined;
138
+ }[] | undefined;
139
+ identities?: {
140
+ readonly value: string;
141
+ readonly label?: string | undefined;
142
+ }[] | undefined;
143
+ phoneNumbers?: {
144
+ readonly value: string;
145
+ readonly label?: string | undefined;
146
+ }[] | undefined;
147
+ addresses?: {
148
+ readonly value: {
149
+ readonly street?: string | undefined;
150
+ readonly extended?: string | undefined;
151
+ readonly locality?: string | undefined;
152
+ readonly region?: string | undefined;
153
+ readonly postalCode?: string | undefined;
154
+ readonly postOfficeBoxNumber?: string | undefined;
155
+ readonly country?: string | undefined;
156
+ };
157
+ readonly label?: string | undefined;
158
+ }[] | undefined;
159
+ urls?: {
160
+ readonly value: string;
161
+ readonly label?: string | undefined;
162
+ }[] | undefined;
163
+ birthday?: string | undefined;
164
+ }> | undefined;
165
+ identityDid?: string | undefined;
166
+ identityKey?: string | undefined;
167
+ };
168
+ blocks: ({
169
+ pending?: boolean | undefined;
170
+ type: "text";
171
+ disposition?: string | undefined;
172
+ text: string;
173
+ } | {
174
+ pending?: boolean | undefined;
175
+ type: "json";
176
+ disposition?: string | undefined;
177
+ data: string;
178
+ } | {
179
+ pending?: boolean | undefined;
180
+ id?: string | undefined;
181
+ type: "image";
182
+ source?: {
183
+ type: "base64";
184
+ mediaType: string;
185
+ data: string;
186
+ } | {
187
+ type: "http";
188
+ url: string;
189
+ } | undefined;
190
+ } | {
191
+ pending?: boolean | undefined;
192
+ type: "reference";
193
+ reference: import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>;
194
+ } | {
195
+ pending?: boolean | undefined;
196
+ type: "transcription";
197
+ text: string;
198
+ started: string;
199
+ })[];
200
+ properties?: {
201
+ [x: string]: any;
202
+ } | undefined;
203
+ }, "id"> & {
204
+ id?: string;
205
+ } & {
206
+ id: string;
207
+ };
208
+ timeElapsed: number;
209
+ }>;
210
+ //# sourceMappingURL=extraction-ner-function.d.ts.map
@@ -0,0 +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;;;;;;;;;;;;;qCAsCu2R,CAAC;;;;+BAAgM,CAAC;wBAA8C,CAAC;0BAAgD,CAAC;yBAAkG,CAAC;2BAAiD,CAAC;;;;;;;;;;;kCAAye,CAAC;;;;kCAAoK,CAAC;;;;kCAAsK,CAAC;;;;uCAAkK,CAAC;yCAA+D,CAAC;yCAA+D,CAAC;uCAA6D,CAAC;2CAAiE,CAAC;oDAA0E,CAAC;wCAA8D,CAAC;;kCAA+E,CAAC;;;;kCAA8J,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAAzgE,CAAC;;;;+BAAgM,CAAC;wBAA8C,CAAC;0BAAgD,CAAC;yBAAkG,CAAC;2BAAiD,CAAC;;;;;;;;;;;kCAAye,CAAC;;;;kCAAoK,CAAC;;;;kCAAsK,CAAC;;;;uCAAkK,CAAC;yCAA+D,CAAC;yCAA+D,CAAC;uCAA6D,CAAC;2CAAiE,CAAC;oDAA0E,CAAC;wCAA8D,CAAC;;kCAA+E,CAAC;;;;kCAA8J,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAD14V,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=extraction-ner-function.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction-ner-function.test.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from './extraction-ner-function';
2
+ export * from './named-entity-recognition';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/index.ts"],"names":[],"mappings":"AAIA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type TokenClassificationSingle, type TokenClassificationPipelineType } from '@xenova/transformers';
2
+ /**
3
+ * Named Entity Recognition pipeline.
4
+ * Initializes the pipeline on first call.
5
+ * @returns The singleton promise that resolves to a token classification pipeline.
6
+ */
7
+ export declare const getNer: () => Promise<TokenClassificationPipelineType>;
8
+ /**
9
+ * Extracts entities from text using the named entity recognition pipeline and does simple grouping of tokens.
10
+ */
11
+ export declare const extractFullEntities: (text: string) => Promise<TokenClassificationSingle[]>;
12
+ export declare const createTokenGroups: (tokens: TokenClassificationSingle[]) => TokenClassificationSingle[][];
13
+ export declare const combineNerTokens: (group: TokenClassificationSingle[]) => TokenClassificationSingle;
14
+ //# sourceMappingURL=named-entity-recognition.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=named-entity-recognition.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"named-entity-recognition.test.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/named-entity-recognition.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,242 @@
1
+ import { Schema } from 'effect';
2
+ import { Expando } from '@dxos/echo-schema';
3
+ import { type FunctionDefinition, type FunctionExecutor } from '@dxos/functions';
4
+ export declare const ExtractionInput: Schema.Struct<{
5
+ message: import("@dxos/echo-schema").EchoTypeSchema<Schema.Struct<{
6
+ id: import("@dxos/keys").ObjectIdClass;
7
+ created: import("effect/Schema").SchemaClass<string, string, never>;
8
+ sender: import("effect/Schema").mutable<import("effect/Schema").Struct<{
9
+ contact: import("effect/Schema").optional<import("@dxos/echo-schema").Ref$<{
10
+ readonly id: string;
11
+ fields?: {
12
+ readonly value: string;
13
+ readonly label: string;
14
+ readonly category?: string | undefined;
15
+ }[] | undefined;
16
+ organization?: import("@dxos/echo-schema").Ref<{
17
+ readonly id: string;
18
+ description?: string | undefined;
19
+ name?: string | undefined;
20
+ status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
21
+ image?: string | undefined;
22
+ website?: string | undefined;
23
+ }> | undefined;
24
+ image?: string | undefined;
25
+ fullName?: string | undefined;
26
+ preferredName?: string | undefined;
27
+ nickname?: string | undefined;
28
+ jobTitle?: string | undefined;
29
+ department?: string | undefined;
30
+ notes?: string | undefined;
31
+ emails?: {
32
+ readonly value: string;
33
+ readonly label?: string | undefined;
34
+ }[] | undefined;
35
+ identities?: {
36
+ readonly value: string;
37
+ readonly label?: string | undefined;
38
+ }[] | undefined;
39
+ phoneNumbers?: {
40
+ readonly value: string;
41
+ readonly label?: string | undefined;
42
+ }[] | undefined;
43
+ addresses?: {
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
+ readonly label?: string | undefined;
54
+ }[] | undefined;
55
+ urls?: {
56
+ readonly value: string;
57
+ readonly label?: string | undefined;
58
+ }[] | undefined;
59
+ birthday?: string | undefined;
60
+ }>>;
61
+ identityDid: import("effect/Schema").optional<typeof import("effect/Schema").String>;
62
+ identityKey: import("effect/Schema").optional<typeof import("effect/Schema").String>;
63
+ email: import("effect/Schema").optional<typeof import("effect/Schema").String>;
64
+ name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
65
+ role: import("effect/Schema").optional<import("effect/Schema").Literal<["user", "assistant"]>>;
66
+ }>>;
67
+ 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<{
68
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
69
+ }>, import("effect/Schema").Struct<{
70
+ type: import("effect/Schema").Literal<["text"]>;
71
+ disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
72
+ text: typeof import("effect/Schema").String;
73
+ }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
74
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
75
+ }>, import("effect/Schema").Struct<{
76
+ type: import("effect/Schema").Literal<["json"]>;
77
+ disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
78
+ data: typeof import("effect/Schema").String;
79
+ }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
80
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
81
+ }>, import("effect/Schema").Struct<{
82
+ type: import("effect/Schema").Literal<["image"]>;
83
+ id: import("effect/Schema").optional<typeof import("effect/Schema").String>;
84
+ source: import("effect/Schema").optional<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").Struct<{
85
+ type: import("effect/Schema").Literal<["base64"]>;
86
+ mediaType: typeof import("effect/Schema").String;
87
+ data: typeof import("effect/Schema").String;
88
+ }>>, import("effect/Schema").mutable<import("effect/Schema").Struct<{
89
+ type: import("effect/Schema").Literal<["http"]>;
90
+ url: typeof import("effect/Schema").String;
91
+ }>>]>>;
92
+ }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
93
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
94
+ }>, import("effect/Schema").Struct<{
95
+ type: import("effect/Schema").Literal<["reference"]>;
96
+ reference: import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>;
97
+ }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
98
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
99
+ }>, import("effect/Schema").Struct<{
100
+ type: import("effect/Schema").Literal<["transcription"]>;
101
+ started: typeof import("effect/Schema").String;
102
+ text: typeof import("effect/Schema").String;
103
+ }>>>]>>>;
104
+ properties: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Any>>>;
105
+ }>, {}>;
106
+ objects: Schema.optional<Schema.Array$<Schema.Schema<Expando, Expando, never>>>;
107
+ options: Schema.optional<Schema.Struct<{
108
+ timeout: Schema.optional<typeof Schema.Number>;
109
+ fallbackToRaw: Schema.optional<typeof Schema.Boolean>;
110
+ }>>;
111
+ }>;
112
+ export interface ExtractionInput extends Schema.Schema.Type<typeof ExtractionInput> {
113
+ }
114
+ export declare const ExtractionOutput: Schema.Struct<{
115
+ message: import("@dxos/echo-schema").EchoTypeSchema<Schema.Struct<{
116
+ id: import("@dxos/keys").ObjectIdClass;
117
+ created: import("effect/Schema").SchemaClass<string, string, never>;
118
+ sender: import("effect/Schema").mutable<import("effect/Schema").Struct<{
119
+ contact: import("effect/Schema").optional<import("@dxos/echo-schema").Ref$<{
120
+ readonly id: string;
121
+ fields?: {
122
+ readonly value: string;
123
+ readonly label: string;
124
+ readonly category?: string | undefined;
125
+ }[] | undefined;
126
+ organization?: import("@dxos/echo-schema").Ref<{
127
+ readonly id: string;
128
+ description?: string | undefined;
129
+ name?: string | undefined;
130
+ status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
131
+ image?: string | undefined;
132
+ website?: string | undefined;
133
+ }> | undefined;
134
+ image?: string | undefined;
135
+ fullName?: string | undefined;
136
+ preferredName?: string | undefined;
137
+ nickname?: string | undefined;
138
+ jobTitle?: string | undefined;
139
+ department?: string | undefined;
140
+ notes?: string | undefined;
141
+ emails?: {
142
+ readonly value: string;
143
+ readonly label?: string | undefined;
144
+ }[] | undefined;
145
+ identities?: {
146
+ readonly value: string;
147
+ readonly label?: string | undefined;
148
+ }[] | undefined;
149
+ phoneNumbers?: {
150
+ readonly value: string;
151
+ readonly label?: string | undefined;
152
+ }[] | undefined;
153
+ addresses?: {
154
+ readonly value: {
155
+ readonly street?: string | undefined;
156
+ readonly extended?: string | undefined;
157
+ readonly locality?: string | undefined;
158
+ readonly region?: string | undefined;
159
+ readonly postalCode?: string | undefined;
160
+ readonly postOfficeBoxNumber?: string | undefined;
161
+ readonly country?: string | undefined;
162
+ };
163
+ readonly label?: string | undefined;
164
+ }[] | undefined;
165
+ urls?: {
166
+ readonly value: string;
167
+ readonly label?: string | undefined;
168
+ }[] | undefined;
169
+ birthday?: string | undefined;
170
+ }>>;
171
+ identityDid: import("effect/Schema").optional<typeof import("effect/Schema").String>;
172
+ identityKey: import("effect/Schema").optional<typeof import("effect/Schema").String>;
173
+ email: import("effect/Schema").optional<typeof import("effect/Schema").String>;
174
+ name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
175
+ role: import("effect/Schema").optional<import("effect/Schema").Literal<["user", "assistant"]>>;
176
+ }>>;
177
+ 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<{
178
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
179
+ }>, import("effect/Schema").Struct<{
180
+ type: import("effect/Schema").Literal<["text"]>;
181
+ disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
182
+ text: typeof import("effect/Schema").String;
183
+ }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
184
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
185
+ }>, import("effect/Schema").Struct<{
186
+ type: import("effect/Schema").Literal<["json"]>;
187
+ disposition: import("effect/Schema").optional<typeof import("effect/Schema").String>;
188
+ data: typeof import("effect/Schema").String;
189
+ }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
190
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
191
+ }>, import("effect/Schema").Struct<{
192
+ type: import("effect/Schema").Literal<["image"]>;
193
+ id: import("effect/Schema").optional<typeof import("effect/Schema").String>;
194
+ source: import("effect/Schema").optional<import("effect/Schema").Union<[import("effect/Schema").mutable<import("effect/Schema").Struct<{
195
+ type: import("effect/Schema").Literal<["base64"]>;
196
+ mediaType: typeof import("effect/Schema").String;
197
+ data: typeof import("effect/Schema").String;
198
+ }>>, import("effect/Schema").mutable<import("effect/Schema").Struct<{
199
+ type: import("effect/Schema").Literal<["http"]>;
200
+ url: typeof import("effect/Schema").String;
201
+ }>>]>>;
202
+ }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
203
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
204
+ }>, import("effect/Schema").Struct<{
205
+ type: import("effect/Schema").Literal<["reference"]>;
206
+ reference: import("@dxos/echo-schema").Ref$<import("@dxos/echo-schema").Expando>;
207
+ }>>>, import("effect/Schema").mutable<import("effect/Schema").extend<import("effect/Schema").Struct<{
208
+ pending: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
209
+ }>, import("effect/Schema").Struct<{
210
+ type: import("effect/Schema").Literal<["transcription"]>;
211
+ started: typeof import("effect/Schema").String;
212
+ text: typeof import("effect/Schema").String;
213
+ }>>>]>>>;
214
+ properties: import("effect/Schema").optional<import("effect/Schema").mutable<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Any>>>;
215
+ }>, {}>;
216
+ timeElapsed: typeof Schema.Number;
217
+ }>;
218
+ export interface ExtractionOutput extends Schema.Schema.Type<typeof ExtractionOutput> {
219
+ }
220
+ export type ProcessTranscriptMessageParams = {
221
+ input: ExtractionInput;
222
+ function: FunctionDefinition<ExtractionInput, ExtractionOutput>;
223
+ executor: FunctionExecutor;
224
+ options?: {
225
+ /**
226
+ * Timeout for the entity extraction.
227
+ */
228
+ timeout?: number;
229
+ /**
230
+ * Fallback to raw text if the entity extraction fails.
231
+ * Otherwise the function will throw an error.
232
+ * @default false
233
+ */
234
+ fallbackToRaw?: boolean;
235
+ };
236
+ };
237
+ export type ExtractionFunction = FunctionDefinition<ExtractionInput, ExtractionOutput>;
238
+ /**
239
+ * Extract entities from the transcript message and add them to the message.
240
+ */
241
+ export declare const processTranscriptMessage: (params: ProcessTranscriptMessageParams) => Promise<ExtractionOutput>;
242
+ //# sourceMappingURL=extraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../../../src/extraction/extraction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIjF,eAAO,MAAM,eAAe;;;;;;;sBA+DuiR,CAAC;;;qCAAiI,CAAC;;4BAAmF,CAAC;;+BAA4G,CAAC;wBAA8C,CAAC;0BAAgD,CAAC;yBAAkG,CAAC;2BAAiD,CAAC;;qBAA2E,CAAC;wBAA8C,CAAC;6BAAmD,CAAC;wBAA8C,CAAC;wBAA8C,CAAC;0BAAgD,CAAC;qBAA2C,CAAC;sBAA4C,CAAC;;kCAAkF,CAAC;;0BAAiF,CAAC;;kCAAkF,CAAC;;4BAAmF,CAAC;;kCAAkF,CAAC;;yBAAgF,CAAC;;uCAAiF,CAAC;yCAA+D,CAAC;yCAA+D,CAAC;uCAA6D,CAAC;2CAAiE,CAAC;oDAA0E,CAAC;wCAA8D,CAAC;;kCAA+E,CAAC;;oBAA2E,CAAC;;kCAAkF,CAAC;;wBAA+E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAtD5xV,CAAC;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC;CAAG;AAEtF,eAAO,MAAM,gBAAgB;;;;;;;sBAmDsiR,CAAC;;;qCAAiI,CAAC;;4BAAmF,CAAC;;+BAA4G,CAAC;wBAA8C,CAAC;0BAAgD,CAAC;yBAAkG,CAAC;2BAAiD,CAAC;;qBAA2E,CAAC;wBAA8C,CAAC;6BAAmD,CAAC;wBAA8C,CAAC;wBAA8C,CAAC;0BAAgD,CAAC;qBAA2C,CAAC;sBAA4C,CAAC;;kCAAkF,CAAC;;0BAAiF,CAAC;;kCAAkF,CAAC;;4BAAmF,CAAC;;kCAAkF,CAAC;;yBAAgF,CAAC;;uCAAiF,CAAC;yCAA+D,CAAC;yCAA+D,CAAC;uCAA6D,CAAC;2CAAiE,CAAC;oDAA0E,CAAC;wCAA8D,CAAC;;kCAA+E,CAAC;;oBAA2E,CAAC;;kCAAkF,CAAC;;wBAA+E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAhD5xV,CAAC;AACH,MAAM,WAAW,gBAAiB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAExF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;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,5 @@
1
+ export * from './extraction';
2
+ export * from './extraction-llm-function';
3
+ export * from './extraction-ner-function';
4
+ export * from './quotes';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extraction/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,UAAU,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Schema } from 'effect';
2
+ import { type EchoDatabase } from '@dxos/echo-db';
3
+ export declare const ReferencedQuotes: Schema.Struct<{
4
+ references: Schema.mutable<Schema.Array$<Schema.Struct<{
5
+ id: typeof Schema.String;
6
+ quote: typeof Schema.String;
7
+ }>>>;
8
+ }>;
9
+ export type ReferencedQuotes = Schema.Schema.Type<typeof ReferencedQuotes>;
10
+ export declare const findQuotes: (quotes: string[], db: EchoDatabase) => Promise<ReferencedQuotes>;
11
+ /**
12
+ * Finds and replaces all quotes with DXNs references.
13
+ */
14
+ export declare const insertReferences: (text: string, quotes: ReferencedQuotes) => string;
15
+ //# sourceMappingURL=quotes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../../src/extraction/quotes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAKlD,eAAO,MAAM,gBAAgB;;;;;EAe3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E,eAAO,MAAM,UAAU,GAAU,QAAQ,MAAM,EAAE,EAAE,IAAI,YAAY,KAAG,OAAO,CAAC,gBAAgB,CAS7F,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,QAAQ,gBAAgB,WAYtE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=quotes.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotes.test.d.ts","sourceRoot":"","sources":["../../../../src/extraction/quotes.test.ts"],"names":[],"mappings":""}
@@ -1,4 +1,6 @@
1
- export * from './ai-service';
1
+ export * from './extraction';
2
+ export * from './research';
2
3
  export * from './session';
3
- export * from './experimental';
4
+ export * from './types';
5
+ export * from './blueprint';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAG1B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,7 @@
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;
6
+ export {};
7
+ //# sourceMappingURL=exa.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,39 @@
1
+ import { Schema } from 'effect';
2
+ import { type EchoDatabase } from '@dxos/echo-db';
3
+ import { type AnyEchoObject, type BaseObject } from '@dxos/echo-schema';
4
+ export declare const Subgraph: Schema.Struct<{
5
+ /** Objects and relations. */
6
+ objects: Schema.Array$<typeof Schema.Any>;
7
+ }>;
8
+ export interface Subgraph extends Schema.Schema.Type<typeof Subgraph> {
9
+ }
10
+ export type RelatedSchema = {
11
+ schema: Schema.Schema.AnyNoContext;
12
+ kind: 'reference' | 'relation';
13
+ };
14
+ /**
15
+ * Find all schemas that are related to the given schema.
16
+ *
17
+ * @param db
18
+ * @param schema
19
+ * @returns
20
+ */
21
+ export declare const findRelatedSchema: (db: EchoDatabase, anchor: Schema.Schema.AnyNoContext) => Promise<RelatedSchema[]>;
22
+ /**
23
+ * Perform vector search in the local database.
24
+ */
25
+ export declare const createLocalSearchTool: (db: EchoDatabase) => import("@dxos/ai").ExecutableTool;
26
+ /**
27
+ * Create a schema for structured data extraction.
28
+ */
29
+ export declare const createExtractionSchema: (types: Schema.Schema.AnyNoContext[]) => Schema.Struct<{
30
+ [k: string]: Schema.optional<Schema.Array$<Schema.Schema.AnyNoContext>>;
31
+ }>;
32
+ export declare const getSanitizedSchemaName: (schema: Schema.Schema.AnyNoContext) => string;
33
+ export declare const sanitizeObjects: (types: Schema.Schema.AnyNoContext[], data: Record<string, readonly unknown[]>, db: EchoDatabase) => Promise<BaseObject[]>;
34
+ export declare const createGraphWriterTool: ({ db, schemaTypes, onDone, }: {
35
+ db: EchoDatabase;
36
+ schemaTypes: Schema.Schema.AnyNoContext[];
37
+ onDone?: (data: AnyEchoObject[]) => Promise<any>;
38
+ }) => import("@dxos/ai").ExecutableTool;
39
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +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,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAKL,KAAK,aAAa,EAUlB,KAAK,UAAU,EAChB,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,sCAkBrD,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,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC,EACxC,IAAI,YAAY,KACf,OAAO,CAAC,UAAU,EAAE,CAsFtB,CAAC;AA2CF,eAAO,MAAM,qBAAqB,GAAI,8BAInC;IACD,EAAE,EAAE,YAAY,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;IAC1C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAClD,sCAUA,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=graph.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.test.d.ts","sourceRoot":"","sources":["../../../../src/research/graph.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export * from './exa';
2
+ export * from './research';
3
+ export * from './graph';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/research/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}