@dxos/assistant 0.8.4-main.f9ba587 → 0.8.4-main.fcc0d83b33

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 (197) hide show
  1. package/README.md +1 -0
  2. package/dist/lib/neutral/extraction/index.mjs +202 -0
  3. package/dist/lib/neutral/extraction/index.mjs.map +7 -0
  4. package/dist/lib/neutral/index.mjs +1693 -0
  5. package/dist/lib/neutral/index.mjs.map +7 -0
  6. package/dist/lib/neutral/meta.json +1 -0
  7. package/dist/types/src/conversation/context.d.ts +152 -0
  8. package/dist/types/src/conversation/context.d.ts.map +1 -0
  9. package/dist/types/src/conversation/context.test.d.ts +2 -0
  10. package/dist/types/src/conversation/context.test.d.ts.map +1 -0
  11. package/dist/types/src/conversation/index.d.ts +2 -1
  12. package/dist/types/src/conversation/index.d.ts.map +1 -1
  13. package/dist/types/src/conversation/session.d.ts +78 -0
  14. package/dist/types/src/conversation/session.d.ts.map +1 -0
  15. package/dist/types/src/diff.d.ts +17 -0
  16. package/dist/types/src/diff.d.ts.map +1 -0
  17. package/dist/types/src/diff.test.d.ts +2 -0
  18. package/dist/types/src/diff.test.d.ts.map +1 -0
  19. package/dist/types/src/errors.d.ts +67 -0
  20. package/dist/types/src/errors.d.ts.map +1 -0
  21. package/dist/types/src/execution-graph.d.ts +85 -0
  22. package/dist/types/src/execution-graph.d.ts.map +1 -0
  23. package/dist/types/src/execution-graph.test.d.ts +2 -0
  24. package/dist/types/src/execution-graph.test.d.ts.map +1 -0
  25. package/dist/types/src/extraction/extraction-ner-function/index.d.ts +0 -1
  26. package/dist/types/src/extraction/extraction-ner-function/index.d.ts.map +1 -1
  27. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts +1 -1
  28. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  29. package/dist/types/src/extraction/extraction.d.ts +1066 -215
  30. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  31. package/dist/types/src/extraction/index.d.ts +0 -1
  32. package/dist/types/src/extraction/index.d.ts.map +1 -1
  33. package/dist/types/src/extraction/quotes.d.ts +3 -3
  34. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  35. package/dist/types/src/functions/index.d.ts +2 -0
  36. package/dist/types/src/functions/index.d.ts.map +1 -0
  37. package/dist/types/src/functions/services.d.ts +17 -0
  38. package/dist/types/src/functions/services.d.ts.map +1 -0
  39. package/dist/types/src/index.d.ts +6 -5
  40. package/dist/types/src/index.d.ts.map +1 -1
  41. package/dist/types/src/session/artifact-diff.d.ts +27 -0
  42. package/dist/types/src/session/artifact-diff.d.ts.map +1 -0
  43. package/dist/types/src/session/error-handling.d.ts +4 -0
  44. package/dist/types/src/session/error-handling.d.ts.map +1 -0
  45. package/dist/types/src/session/format.d.ts +16 -0
  46. package/dist/types/src/session/format.d.ts.map +1 -0
  47. package/dist/types/src/session/index.d.ts +5 -1
  48. package/dist/types/src/session/index.d.ts.map +1 -1
  49. package/dist/types/src/session/observer.d.ts +23 -0
  50. package/dist/types/src/session/observer.d.ts.map +1 -0
  51. package/dist/types/src/session/request.d.ts +106 -0
  52. package/dist/types/src/session/request.d.ts.map +1 -0
  53. package/dist/types/src/session/toolkit.d.ts +16 -0
  54. package/dist/types/src/session/toolkit.d.ts.map +1 -0
  55. package/dist/types/src/session/version-pin.d.ts +5 -5
  56. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  57. package/dist/types/src/templates/index.d.ts +2 -0
  58. package/dist/types/src/templates/index.d.ts.map +1 -0
  59. package/dist/types/src/templates/system.d.ts +17 -0
  60. package/dist/types/src/templates/system.d.ts.map +1 -0
  61. package/dist/types/src/tracing.d.ts +223 -0
  62. package/dist/types/src/tracing.d.ts.map +1 -0
  63. package/dist/types/src/types/artifact.d.ts +28 -0
  64. package/dist/types/src/types/artifact.d.ts.map +1 -0
  65. package/dist/types/src/types/index.d.ts +2 -0
  66. package/dist/types/src/types/index.d.ts.map +1 -0
  67. package/dist/types/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +42 -29
  69. package/src/conversation/context.test.ts +52 -0
  70. package/src/conversation/context.ts +403 -0
  71. package/src/conversation/index.ts +2 -1
  72. package/src/conversation/session.ts +300 -0
  73. package/src/diff.test.ts +74 -0
  74. package/src/diff.ts +93 -0
  75. package/src/errors.ts +15 -0
  76. package/src/execution-graph.test.ts +740 -0
  77. package/src/execution-graph.ts +519 -0
  78. package/src/extraction/extraction-ner-function/index.ts +0 -1
  79. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
  80. package/src/extraction/extraction-ner-function/named-entity-recognition.ts +3 -1
  81. package/src/extraction/extraction.ts +44 -15
  82. package/src/extraction/index.ts +0 -1
  83. package/src/extraction/quotes.test.ts +3 -3
  84. package/src/extraction/quotes.ts +6 -7
  85. package/src/functions/index.ts +5 -0
  86. package/src/functions/services.ts +214 -0
  87. package/src/functions.conversations.json +1 -0
  88. package/src/index.ts +6 -5
  89. package/src/session/artifact-diff.ts +41 -0
  90. package/src/session/error-handling.ts +41 -0
  91. package/src/session/format.ts +149 -0
  92. package/src/session/index.ts +5 -1
  93. package/src/session/observer.ts +62 -0
  94. package/src/session/request.conversations.json +1 -0
  95. package/src/session/request.ts +344 -0
  96. package/src/session/toolkit.ts +47 -0
  97. package/src/session/version-pin.ts +12 -12
  98. package/src/templates/index.ts +5 -0
  99. package/src/templates/instructions/format.tpl +57 -0
  100. package/src/templates/instructions/system.tpl +85 -0
  101. package/src/templates/system.ts +42 -0
  102. package/src/tracing.ts +43 -0
  103. package/src/types/artifact.ts +89 -0
  104. package/src/types/index.ts +5 -0
  105. package/src/typings.d.ts +5 -0
  106. package/dist/lib/browser/index.mjs +0 -2019
  107. package/dist/lib/browser/index.mjs.map +0 -7
  108. package/dist/lib/browser/meta.json +0 -1
  109. package/dist/lib/node-esm/index.mjs +0 -2021
  110. package/dist/lib/node-esm/index.mjs.map +0 -7
  111. package/dist/lib/node-esm/meta.json +0 -1
  112. package/dist/types/bin/chat.d.ts +0 -2
  113. package/dist/types/bin/chat.d.ts.map +0 -1
  114. package/dist/types/src/blueprint/blueprint.d.ts +0 -41
  115. package/dist/types/src/blueprint/blueprint.d.ts.map +0 -1
  116. package/dist/types/src/blueprint/index.d.ts +0 -3
  117. package/dist/types/src/blueprint/index.d.ts.map +0 -1
  118. package/dist/types/src/blueprint/registry.d.ts +0 -7
  119. package/dist/types/src/blueprint/registry.d.ts.map +0 -1
  120. package/dist/types/src/context/binder.d.ts +0 -34
  121. package/dist/types/src/context/binder.d.ts.map +0 -1
  122. package/dist/types/src/context/binding.d.ts +0 -38
  123. package/dist/types/src/context/binding.d.ts.map +0 -1
  124. package/dist/types/src/context/index.d.ts +0 -3
  125. package/dist/types/src/context/index.d.ts.map +0 -1
  126. package/dist/types/src/conversation/conversation.d.ts +0 -44
  127. package/dist/types/src/conversation/conversation.d.ts.map +0 -1
  128. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +0 -4
  129. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +0 -1
  130. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +0 -2
  131. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +0 -1
  132. package/dist/types/src/extraction/extraction-llm-function/index.d.ts +0 -2
  133. package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +0 -1
  134. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +0 -208
  135. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +0 -1
  136. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +0 -2
  137. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +0 -1
  138. package/dist/types/src/research/exa.d.ts +0 -7
  139. package/dist/types/src/research/exa.d.ts.map +0 -1
  140. package/dist/types/src/research/graph.d.ts +0 -41
  141. package/dist/types/src/research/graph.d.ts.map +0 -1
  142. package/dist/types/src/research/graph.test.d.ts +0 -2
  143. package/dist/types/src/research/graph.test.d.ts.map +0 -1
  144. package/dist/types/src/research/index.d.ts +0 -4
  145. package/dist/types/src/research/index.d.ts.map +0 -1
  146. package/dist/types/src/research/research.d.ts +0 -10
  147. package/dist/types/src/research/research.d.ts.map +0 -1
  148. package/dist/types/src/research/research.test.d.ts +0 -2
  149. package/dist/types/src/research/research.test.d.ts.map +0 -1
  150. package/dist/types/src/session/session.d.ts +0 -283
  151. package/dist/types/src/session/session.d.ts.map +0 -1
  152. package/dist/types/src/session/session.test.d.ts +0 -2
  153. package/dist/types/src/session/session.test.d.ts.map +0 -1
  154. package/dist/types/src/session/version-pin.test.d.ts +0 -2
  155. package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
  156. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  157. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  158. package/dist/types/src/testing/exa-search-1748337321991.d.ts +0 -38
  159. package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +0 -1
  160. package/dist/types/src/testing/exa-search-1748337331526.d.ts +0 -37
  161. package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +0 -1
  162. package/dist/types/src/testing/exa-search-1748337344119.d.ts +0 -58
  163. package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +0 -1
  164. package/dist/types/src/testing/index.d.ts +0 -3
  165. package/dist/types/src/testing/index.d.ts.map +0 -1
  166. package/dist/types/src/types.d.ts +0 -3
  167. package/dist/types/src/types.d.ts.map +0 -1
  168. package/src/blueprint/blueprint.ts +0 -75
  169. package/src/blueprint/index.ts +0 -6
  170. package/src/blueprint/registry.ts +0 -15
  171. package/src/context/binder.ts +0 -101
  172. package/src/context/binding.ts +0 -31
  173. package/src/context/index.ts +0 -6
  174. package/src/conversation/conversation.ts +0 -103
  175. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +0 -95
  176. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +0 -66
  177. package/src/extraction/extraction-llm-function/index.ts +0 -5
  178. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +0 -115
  179. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +0 -54
  180. package/src/research/exa.ts +0 -100
  181. package/src/research/graph.test.ts +0 -15
  182. package/src/research/graph.ts +0 -337
  183. package/src/research/index.ts +0 -7
  184. package/src/research/instructions-research.tpl +0 -97
  185. package/src/research/research.test.ts +0 -190
  186. package/src/research/research.ts +0 -90
  187. package/src/session/session.test.ts +0 -275
  188. package/src/session/session.ts +0 -582
  189. package/src/session/version-pin.test.ts +0 -26
  190. package/src/summarization/summarization.test.ts +0 -221
  191. package/src/testing/exa-search-1748337321991.ts +0 -131
  192. package/src/testing/exa-search-1748337331526.ts +0 -144
  193. package/src/testing/exa-search-1748337344119.ts +0 -133
  194. package/src/testing/index.ts +0 -11
  195. package/src/typedefs.d.ts +0 -8
  196. package/src/types.ts +0 -8
  197. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -1 +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;;;;;;;;;;;+BA+Dq4iB,CAAC;;wBAA8E,CAAC;0BAAgD,CAAC;yBAAkG,CAAC;2BAAiD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAtDrrjB,CAAC;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,e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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAQtC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAQhC,CAAC;AAEH;;GAEG;AAEH,eAAO,MAAM,wBAAwB,WAAkB,6BAA6B,KAAG,OAAO,CAAC,gBAAgB,CAqB9G,CAAC"}
@@ -1,5 +1,4 @@
1
1
  export * from './extraction';
2
- export * from './extraction-llm-function';
3
2
  export * from './extraction-ner-function';
4
3
  export * from './quotes';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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,UAAU,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Schema } from 'effect';
2
- import { type EchoDatabase } from '@dxos/echo-db';
1
+ import * as Schema from 'effect/Schema';
2
+ import { type Database } from '@dxos/echo';
3
3
  export declare const ReferencedQuotes: Schema.Struct<{
4
4
  references: Schema.mutable<Schema.Array$<Schema.Struct<{
5
5
  id: typeof Schema.String;
@@ -7,7 +7,7 @@ export declare const ReferencedQuotes: Schema.Struct<{
7
7
  }>>>;
8
8
  }>;
9
9
  export type ReferencedQuotes = Schema.Schema.Type<typeof ReferencedQuotes>;
10
- export declare const findQuotes: (quotes: string[], db: EchoDatabase) => Promise<ReferencedQuotes>;
10
+ export declare const findQuotes: (quotes: string[], db: Database.Database) => Promise<ReferencedQuotes>;
11
11
  /**
12
12
  * Finds and replaces all quotes with DXNs references.
13
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../../src/extraction/quotes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,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"}
1
+ {"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../../src/extraction/quotes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAK1D,eAAO,MAAM,gBAAgB;;;;;EAe3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E,eAAO,MAAM,UAAU,WAAkB,MAAM,EAAE,MAAM,QAAQ,CAAC,QAAQ,KAAG,OAAO,CAAC,gBAAgB,CASlG,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,gBAAgB,SAAU,MAAM,UAAU,gBAAgB,WAYtE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './services';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,17 @@
1
+ import * as Tool from '@effect/ai/Tool';
2
+ import * as Effect from 'effect/Effect';
3
+ import * as Layer from 'effect/Layer';
4
+ import * as Option from 'effect/Option';
5
+ import { ToolExecutionService, ToolResolverService } from '@dxos/ai';
6
+ import { OpaqueToolkit } from '@dxos/ai';
7
+ import { Operation, OperationRegistry } from '@dxos/compute';
8
+ export declare const makeToolResolverFromOperations: <R = never>({ toolkit: extraToolkit, }?: {
9
+ toolkit?: OpaqueToolkit.OpaqueToolkit<never, never, R>;
10
+ }) => Layer.Layer<ToolResolverService, never, OpaqueToolkit.OpaqueToolkitProvider | OperationRegistry.Service | R>;
11
+ export declare const makeToolExecutionService: <E, R>(opts: {
12
+ invoke: (tool: Tool.Any, input: unknown) => Effect.Effect<unknown>;
13
+ }) => Layer.Layer<ToolExecutionService, never, OpaqueToolkit.OpaqueToolkitProvider>;
14
+ export declare const makeToolExecutionServiceFromOperationInvoker: () => Layer.Layer<ToolExecutionService, never, Operation.Service | OpaqueToolkit.OpaqueToolkitProvider>;
15
+ export declare const ToolExecutionServices: Layer.Layer<ToolExecutionService | ToolResolverService, never, OpaqueToolkit.OpaqueToolkitProvider | Operation.Service | OperationRegistry.Service>;
16
+ export declare const getOperationFromTool: (tool: Tool.Any) => Option.Option<Operation.Definition.Any>;
17
+ //# sourceMappingURL=services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/functions/services.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAuB,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAO7D,eAAO,MAAM,8BAA8B,GAAI,CAAC,GAAG,KAAK,+BAErD;IAAE,OAAO,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;CAAE,KAAQ,KAAK,CAAC,KAAK,CAC9E,mBAAmB,EACnB,KAAK,EACL,aAAa,CAAC,qBAAqB,GAAG,iBAAiB,CAAC,OAAO,GAAG,CAAC,CA6BpE,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,CAAC,EAAE,CAAC,QAAQ;IACnD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;CACpE,KAAG,KAAK,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,EAAE,aAAa,CAAC,qBAAqB,CAkC7E,CAAC;AAEJ,eAAO,MAAM,4CAA4C,QAAO,KAAK,CAAC,KAAK,CACzE,oBAAoB,EACpB,KAAK,EACL,SAAS,CAAC,OAAO,GAAG,aAAa,CAAC,qBAAqB,CAgBxD,CAAC;AAEF,eAAO,MAAM,qBAAqB,qJAGjC,CAAC;AAOF,eAAO,MAAM,oBAAoB,SAAU,IAAI,CAAC,GAAG,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAE3F,CAAC"}
@@ -1,9 +1,10 @@
1
- export * from './blueprint';
2
- export * from './context';
3
1
  export * from './conversation';
4
- export * from './extraction';
5
- export * from './research';
2
+ export * from './diff';
3
+ export * from './errors';
4
+ export * from './execution-graph';
5
+ export * from './functions';
6
6
  export * from './session';
7
+ export * from './templates';
7
8
  export * from './types';
8
- export * from './conversation';
9
+ export * from './tracing';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,27 @@
1
+ import * as Context from 'effect/Context';
2
+ import { type ObjectVersion } from '@dxos/echo-db';
3
+ import { type ObjectId } from '@dxos/keys';
4
+ declare const ArtifactDiffResolver_base: Context.TagClass<ArtifactDiffResolver, "@dxos/assistant/ArtifactDiffResolver", ArtifactDiffResolver.Service>;
5
+ /**
6
+ * Resolves artifact ids to their versions.
7
+ * Used to give the model a sense of the changes to the artifacts made by users during the conversation.
8
+ * The artifacts versions are pinned in the history, and whenever the artifact changes in-between assistant's steps,
9
+ * a diff is inserted into the conversation.
10
+ *
11
+ * Can be optionally provided to the session run call.
12
+ */
13
+ export declare class ArtifactDiffResolver extends ArtifactDiffResolver_base {
14
+ }
15
+ export declare namespace ArtifactDiffResolver {
16
+ type Service = {
17
+ resolve: (artifacts: {
18
+ id: ObjectId;
19
+ lastVersion: ObjectVersion;
20
+ }[]) => Promise<Map<ObjectId, {
21
+ version: ObjectVersion;
22
+ diff?: string;
23
+ }>>;
24
+ };
25
+ }
26
+ export {};
27
+ //# sourceMappingURL=artifact-diff.d.ts.map
@@ -0,0 +1 @@
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,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAE3C;;;;;;;GAOG;AAEH,qBAAa,oBAAqB,SAAQ,yBAGvC;CAAG;AAEN,yBAAiB,oBAAoB,CAAC,CAAC;IACrC,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"}
@@ -0,0 +1,4 @@
1
+ import * as AiError from '@effect/ai/AiError';
2
+ import * as Effect from 'effect/Effect';
3
+ export declare const mapAiError: (err: AiError.AiError) => Effect.Effect<AiError.AiError>;
4
+ //# sourceMappingURL=error-handling.d.ts.map
@@ -0,0 +1 @@
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,QAAS,OAAO,CAAC,OAAO,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAoB1B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { type FunctionNotFoundError } from '@dxos/compute';
3
+ import { type Operation, type OperationRegistry } from '@dxos/compute';
4
+ import { type Database } from '@dxos/echo';
5
+ import type { ObjectNotFoundError } from '@dxos/echo/Err';
6
+ import { Message } from '@dxos/types';
7
+ import { type AiRequestRunError, type AiRequestRunProps } from './request';
8
+ /**
9
+ * Formats the system prompt.
10
+ */
11
+ export declare const formatSystemPrompt: ({ system, blueprints, objects, }: Pick<AiRequestRunProps, 'system' | 'blueprints' | 'objects'>) => Effect.Effect<string, FunctionNotFoundError | ObjectNotFoundError, Database.Service | OperationRegistry.Service | Operation.Service>;
12
+ /**
13
+ * Formats the user prompt.
14
+ */
15
+ export declare const formatUserPrompt: ({ prompt, history, }: Pick<AiRequestRunProps, 'prompt' | 'history'>) => Effect.Effect<Message.Message, AiRequestRunError>;
16
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/session/format.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,KAAK,QAAQ,EAAO,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAqB,OAAO,EAAE,MAAM,aAAa,CAAC;AAKzD,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE3E;;GAEG;AAEH,eAAO,MAAM,kBAAkB,qCAI5B,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC,KAAG,MAAM,CAAC,MAAM,CAC7E,MAAM,EACN,qBAAqB,GAAG,mBAAmB,EAC3C,QAAQ,CAAC,OAAO,GAAG,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAuClB,CAAC;AAEjD;;GAEG;AAGH,eAAO,MAAM,gBAAgB,yBAG1B,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,SAAS,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAoCrD,CAAC"}
@@ -1,3 +1,7 @@
1
- export * from './session';
1
+ export * from './artifact-diff';
2
+ export * from './observer';
3
+ export * from './request';
4
+ export * from './toolkit';
2
5
  export * from './version-pin';
6
+ export * from './format';
3
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type * as Tool from '@effect/ai/Tool';
2
+ import * as Effect from 'effect/Effect';
3
+ import { type AiParser, type ConsolePrinter } from '@dxos/ai';
4
+ import { type Message } from '@dxos/types';
5
+ /**
6
+ * Live observer of the generation process.
7
+ */
8
+ export interface GenerationObserver<Tools extends Record<string, Tool.Any> = any> extends AiParser.ParseResponseCallbacks<Tools> {
9
+ /**
10
+ * Complete messages fired during the session, both from the model and from the user.
11
+ * This message will contain all message blocks emitted through the `onBlock` callback.
12
+ */
13
+ onMessage: (message: Message.Message) => Effect.Effect<void>;
14
+ }
15
+ export declare const GenerationObserver: Readonly<{
16
+ make: ({ onBegin, onPart, onBlock, onEnd, onMessage, }?: Partial<GenerationObserver>) => GenerationObserver;
17
+ noop: () => GenerationObserver<any>;
18
+ /**
19
+ * Debug printer to be used in unit-tests and browser devtools.
20
+ */
21
+ fromPrinter: (printer: ConsolePrinter) => GenerationObserver<any>;
22
+ }>;
23
+ //# sourceMappingURL=observer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../../src/session/observer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,kBAAkB,CACjC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAC5C,SAAQ,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC;IAC9C;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC9D;AAED,eAAO,MAAM,kBAAkB;6DAO1B,OAAO,CAAC,kBAAkB,CAAC,KAAQ,kBAAkB;;IAUxD;;OAEG;2BACoB,cAAc;EAiBrC,CAAC"}
@@ -0,0 +1,106 @@
1
+ import type * as AiError from '@effect/ai/AiError';
2
+ import * as LanguageModel from '@effect/ai/LanguageModel';
3
+ import * as Effect from 'effect/Effect';
4
+ import { type AiToolNotFoundError, type OpaqueToolkit, type PromptPreprocessingError, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
5
+ import { type Blueprint } from '@dxos/compute';
6
+ import { Trace } from '@dxos/compute';
7
+ import { Operation, OperationRegistry } from '@dxos/compute';
8
+ import { Database, Obj } from '@dxos/echo';
9
+ import { ContentBlock, Message } from '@dxos/types';
10
+ import { type AiAssistantError } from '../errors';
11
+ import { GenerationObserver } from './observer';
12
+ export type AiRequestRunError = AiError.AiError | PromptPreprocessingError | AiToolNotFoundError | AiAssistantError;
13
+ export type AiRequestRunRequirements = LanguageModel.LanguageModel | ToolExecutionService | ToolResolverService | Database.Service | Operation.Service | OperationRegistry.Service | Trace.TraceService;
14
+ export type AiRequestOptions = {
15
+ /**
16
+ * Summarize before executing the prompt if the existing history exceeds this threshold.
17
+ */
18
+ summarizationThreshold?: number;
19
+ observer?: GenerationObserver;
20
+ /**
21
+ * Callback for when a message is received from the user, model, or tool.
22
+ * This is useful for streaming the output to a queue.
23
+ */
24
+ onOutput?: (message: Message.Message) => Effect.Effect<void, never, never>;
25
+ };
26
+ export type AiRequestRunProps<R = never> = {
27
+ prompt: string | ContentBlock.Any[];
28
+ system?: string;
29
+ history?: Message.Message[];
30
+ objects?: Obj.Unknown[];
31
+ blueprints?: readonly Blueprint.Blueprint[];
32
+ toolkit?: OpaqueToolkit.OpaqueToolkit<R>;
33
+ };
34
+ export type AiRequestBeginProps = {
35
+ prompt: string | ContentBlock.Any[];
36
+ system?: string;
37
+ history?: Message.Message[];
38
+ objects?: Obj.Unknown[];
39
+ blueprints?: readonly Blueprint.Blueprint[];
40
+ };
41
+ export type AiRequestTurnProps<R = never> = {
42
+ system: string;
43
+ toolkit?: OpaqueToolkit.OpaqueToolkit<R>;
44
+ };
45
+ export type AiRequestTurnResult = {
46
+ messages: Message.Message[];
47
+ done: boolean;
48
+ };
49
+ /**
50
+ * Contains message history, tools, current context.
51
+ * Current context means the state of the app, time of day, and other contextual information.
52
+ * It makes requests to the model, its a state machine.
53
+ * It keeps track of the current goal.
54
+ * It manages the context window.
55
+ * Tracks the success criteria of reaching the goal, exposing metrics (stretch).
56
+ * Could be run locally in the app or remotely.
57
+ * Could be personal or shared.
58
+ */
59
+ export declare class AiRequest {
60
+ private readonly _options;
61
+ /** Prevents concurrent execution of session. */
62
+ private readonly _semaphore;
63
+ private readonly _observer;
64
+ private readonly _onOutput;
65
+ /** Message history from queue. */
66
+ private _history;
67
+ /** Pending messages for this session (incl. the current prompt). */
68
+ private _pending;
69
+ private _started;
70
+ private _ended;
71
+ private _toolCalls;
72
+ constructor(_options?: AiRequestOptions);
73
+ get duration(): number;
74
+ get toolCalls(): number;
75
+ get pending(): readonly Message.Message[];
76
+ private _submitMessage;
77
+ getToolCalls: () => {
78
+ block: {
79
+ readonly _tag: "toolCall";
80
+ readonly pending?: boolean | undefined;
81
+ readonly toolCallId: string;
82
+ readonly name: string;
83
+ readonly input: string;
84
+ readonly providerExecuted: boolean;
85
+ };
86
+ message: Message.Message;
87
+ }[];
88
+ /**
89
+ * Initialize a session: set up history, perform summarization if needed, and submit the user prompt.
90
+ * Must be called before `runTurn()`.
91
+ */
92
+ begin: ({ prompt, system, history, blueprints, objects, }: AiRequestBeginProps) => Effect.Effect<void, AiRequestRunError, AiRequestRunRequirements>;
93
+ /**
94
+ * Execute a single turn: one LLM generation followed by tool execution.
95
+ * The toolkit and system prompt can be updated between turns to reflect context changes (e.g. dynamically enabled blueprints).
96
+ */
97
+ runAgentTurn: <const R = never>({ system, toolkit: opaqueToolkit, }: AiRequestTurnProps<R>) => Effect.Effect<AiRequestTurnResult, AiRequestRunError, AiRequestRunRequirements | R>;
98
+ runTools: <const R = never>({ toolkit: opaqueToolkit, }: {
99
+ toolkit?: OpaqueToolkit.OpaqueToolkit<R>;
100
+ }) => Effect.Effect<void, AiRequestRunError, AiRequestRunRequirements | R>;
101
+ /**
102
+ * Run a full conversation turn loop. Equivalent to calling `begin()` then `runTurn()` in a loop.
103
+ */
104
+ run: <const R = never>({ prompt, system: systemTemplate, history, objects, blueprints, toolkit, }: AiRequestRunProps<R>) => Effect.Effect<Message.Message[], AiRequestRunError, AiRequestRunRequirements | R>;
105
+ }
106
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../src/session/request.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,OAAO,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAG1D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAIL,KAAK,mBAAmB,EAExB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAEzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,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,QAAQ,CAAC,OAAO,G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C,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,wBAAwB,GAAG,CAAC,CAAC,CAoBvB;IAEjD;;OAEG;IACH,GAAG,GAAI,KAAK,CAAC,CAAC,GAAG,KAAK,8EAOnB,iBAAiB,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,wBAAwB,GAAG,CAAC,CAAC,CAgB/B;CAC7E"}
@@ -0,0 +1,16 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { type AiToolNotFoundError, OpaqueToolkit, ToolExecutionService, ToolResolverService } from '@dxos/ai';
3
+ import { type Blueprint } from '@dxos/compute';
4
+ export type CreateToolkitProps = {
5
+ toolkit?: OpaqueToolkit.Any;
6
+ blueprints?: readonly Blueprint.Blueprint[];
7
+ /**
8
+ * Self-contained with handlers toolkits.
9
+ */
10
+ opaqueToolkits?: readonly OpaqueToolkit.Any[];
11
+ };
12
+ /**
13
+ * Build a combined toolkit from the blueprint tools and the provided toolkit.
14
+ */
15
+ export declare const createToolkit: ({ toolkit: toolkitProp, blueprints, opaqueToolkits, }: CreateToolkitProps) => Effect.Effect<OpaqueToolkit.OpaqueToolkit, AiToolNotFoundError, ToolResolverService | ToolExecutionService>;
16
+ //# sourceMappingURL=toolkit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/toolkit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,mBAAmB,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC9G,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,SAAS,CAAC,SAAS,EAAE,CAAC;IAC5C;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,aAAa,CAAC,GAAG,EAAE,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,0DAIvB,kBAAkB,KAAG,MAAM,CAAC,MAAM,CACnC,aAAa,CAAC,aAAa,EAC3B,mBAAmB,EACnB,mBAAmB,GAAG,oBAAoB,CAeuE,CAAC"}
@@ -1,7 +1,7 @@
1
- import { Schema } from 'effect';
2
- import { type MessageContentBlock } from '@dxos/ai';
1
+ import * as Schema from 'effect/Schema';
2
+ import { type Obj } from '@dxos/echo';
3
3
  import { type ObjectVersion } from '@dxos/echo-db';
4
- import { type BaseEchoObject } from '@dxos/echo-schema';
4
+ import { type ContentBlock } from '@dxos/types';
5
5
  declare const VersionPinSchema: Schema.Struct<{
6
6
  objectId: import("@dxos/keys").ObjectIdClass;
7
7
  version: Schema.Schema<ObjectVersion, ObjectVersion, never>;
@@ -14,8 +14,8 @@ export interface VersionPin extends Schema.Schema.Type<typeof VersionPinSchema>
14
14
  }
15
15
  export declare const VersionPin: typeof VersionPinSchema & {
16
16
  DISPOSITION: 'version-pin';
17
- fromObject: (object: BaseEchoObject) => VersionPin;
18
- createBlock: (pin: VersionPin) => MessageContentBlock;
17
+ fromObject: (object: Obj.Unknown) => VersionPin;
18
+ createBlock: (pin: VersionPin) => ContentBlock.Any;
19
19
  };
20
20
  export {};
21
21
  //# sourceMappingURL=version-pin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version-pin.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKlE,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,cAAc,KAAK,UAAU,CAAC;IACnD,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,mBAAmB,CAAC;CAiBvD,CAAC"}
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,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,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,GAAG,CAAC,OAAO,KAAK,UAAU,CAAC;IAChD,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,YAAY,CAAC,GAAG,CAAC;CAiBpD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './system';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type ModelCapabilities } from '@dxos/ai';
2
+ import { Template } from '@dxos/compute';
3
+ /**
4
+ * System template variables.
5
+ */
6
+ export type SystemPromptOptions = ModelCapabilities & {
7
+ DATETIME: string;
8
+ };
9
+ /**
10
+ * Base system prompt.
11
+ * NOTE: This contains protocol instructions that can not be dynamically edited.
12
+ */
13
+ export declare const createSystemPrompt: (options?: Partial<SystemPromptOptions>) => string;
14
+ export declare const templates: {
15
+ system: Template.Template;
16
+ };
17
+ //# sourceMappingURL=system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/templates/system.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKzC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,aAAa,OAAO,CAAC,mBAAmB,CAAC,WAMrE,CAAC;AAOJ,eAAO,MAAM,SAAS;IACpB,MAAM;CAIP,CAAC"}
@@ -0,0 +1,223 @@
1
+ import { Trace } from '@dxos/compute';
2
+ import { Obj } from '@dxos/echo';
3
+ /**
4
+ * Partial content block emitted.
5
+ */
6
+ export declare const PartialBlock: Trace.EventType<{
7
+ readonly messageId: string;
8
+ readonly role: "assistant" | "tool" | "user";
9
+ readonly block: {
10
+ readonly _tag: "anchor";
11
+ readonly pending?: boolean | undefined;
12
+ readonly objectId: string;
13
+ readonly version: unknown;
14
+ } | {
15
+ readonly _tag: "file";
16
+ readonly pending?: boolean | undefined;
17
+ readonly url: string;
18
+ readonly name?: string | undefined;
19
+ readonly mediaType?: string | undefined;
20
+ } | {
21
+ readonly _tag: "image";
22
+ readonly pending?: boolean | undefined;
23
+ readonly id?: string | undefined;
24
+ readonly source?: {
25
+ readonly type: "base64";
26
+ readonly mediaType: string;
27
+ readonly data: string;
28
+ } | {
29
+ readonly type: "http";
30
+ readonly url: string;
31
+ } | undefined;
32
+ } | {
33
+ readonly _tag: "json";
34
+ readonly pending?: boolean | undefined;
35
+ readonly disposition?: "cot" | "synthetic" | "user" | "version-pin" | undefined;
36
+ readonly data: string;
37
+ } | {
38
+ readonly _tag: "proposal";
39
+ readonly pending?: boolean | undefined;
40
+ readonly text: string;
41
+ } | {
42
+ readonly _tag: "reasoning";
43
+ readonly pending?: boolean | undefined;
44
+ readonly reasoningText?: string | undefined;
45
+ readonly redactedText?: string | undefined;
46
+ readonly signature?: string | undefined;
47
+ } | {
48
+ readonly _tag: "reference";
49
+ readonly pending?: boolean | undefined;
50
+ readonly reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
51
+ } | {
52
+ readonly _tag: "select";
53
+ readonly pending?: boolean | undefined;
54
+ readonly options: string[];
55
+ } | {
56
+ readonly _tag: "stats";
57
+ readonly pending?: boolean | undefined;
58
+ readonly mimeType?: string | undefined;
59
+ readonly message?: string | undefined;
60
+ readonly model?: string | undefined;
61
+ readonly usage?: {
62
+ readonly inputTokens?: number | undefined;
63
+ readonly outputTokens?: number | undefined;
64
+ readonly totalTokens?: number | undefined;
65
+ } | undefined;
66
+ readonly toolCalls?: number | undefined;
67
+ readonly errors?: number | undefined;
68
+ readonly duration?: number | undefined;
69
+ } | {
70
+ readonly _tag: "status";
71
+ readonly pending?: boolean | undefined;
72
+ readonly statusText: string;
73
+ } | {
74
+ readonly _tag: "suggestion";
75
+ readonly pending?: boolean | undefined;
76
+ readonly text: string;
77
+ } | {
78
+ readonly _tag: "summary";
79
+ readonly pending?: boolean | undefined;
80
+ readonly content: string;
81
+ } | {
82
+ readonly _tag: "text";
83
+ readonly pending?: boolean | undefined;
84
+ readonly mimeType?: string | undefined;
85
+ readonly text: string;
86
+ readonly disposition?: "cot" | "synthetic" | "user" | "version-pin" | undefined;
87
+ } | {
88
+ readonly _tag: "toolCall";
89
+ readonly pending?: boolean | undefined;
90
+ readonly toolCallId: string;
91
+ readonly name: string;
92
+ readonly input: string;
93
+ readonly providerExecuted: boolean;
94
+ } | {
95
+ readonly _tag: "toolResult";
96
+ readonly pending?: boolean | undefined;
97
+ readonly toolCallId: string;
98
+ readonly name: string;
99
+ readonly result?: string | undefined;
100
+ readonly error?: string | undefined;
101
+ readonly providerExecuted: boolean;
102
+ } | {
103
+ readonly _tag: "toolkit";
104
+ readonly pending?: boolean | undefined;
105
+ } | {
106
+ readonly _tag: "transcript";
107
+ readonly pending?: boolean | undefined;
108
+ readonly started: string;
109
+ readonly text: string;
110
+ };
111
+ }>;
112
+ /**
113
+ * Complete content block emitted.
114
+ */
115
+ export declare const CompleteBlock: Trace.EventType<{
116
+ readonly messageId: string;
117
+ readonly role: "assistant" | "tool" | "user";
118
+ readonly block: {
119
+ readonly _tag: "anchor";
120
+ readonly pending?: boolean | undefined;
121
+ readonly objectId: string;
122
+ readonly version: unknown;
123
+ } | {
124
+ readonly _tag: "file";
125
+ readonly pending?: boolean | undefined;
126
+ readonly url: string;
127
+ readonly name?: string | undefined;
128
+ readonly mediaType?: string | undefined;
129
+ } | {
130
+ readonly _tag: "image";
131
+ readonly pending?: boolean | undefined;
132
+ readonly id?: string | undefined;
133
+ readonly source?: {
134
+ readonly type: "base64";
135
+ readonly mediaType: string;
136
+ readonly data: string;
137
+ } | {
138
+ readonly type: "http";
139
+ readonly url: string;
140
+ } | undefined;
141
+ } | {
142
+ readonly _tag: "json";
143
+ readonly pending?: boolean | undefined;
144
+ readonly disposition?: "cot" | "synthetic" | "user" | "version-pin" | undefined;
145
+ readonly data: string;
146
+ } | {
147
+ readonly _tag: "proposal";
148
+ readonly pending?: boolean | undefined;
149
+ readonly text: string;
150
+ } | {
151
+ readonly _tag: "reasoning";
152
+ readonly pending?: boolean | undefined;
153
+ readonly reasoningText?: string | undefined;
154
+ readonly redactedText?: string | undefined;
155
+ readonly signature?: string | undefined;
156
+ } | {
157
+ readonly _tag: "reference";
158
+ readonly pending?: boolean | undefined;
159
+ readonly reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
160
+ } | {
161
+ readonly _tag: "select";
162
+ readonly pending?: boolean | undefined;
163
+ readonly options: string[];
164
+ } | {
165
+ readonly _tag: "stats";
166
+ readonly pending?: boolean | undefined;
167
+ readonly mimeType?: string | undefined;
168
+ readonly message?: string | undefined;
169
+ readonly model?: string | undefined;
170
+ readonly usage?: {
171
+ readonly inputTokens?: number | undefined;
172
+ readonly outputTokens?: number | undefined;
173
+ readonly totalTokens?: number | undefined;
174
+ } | undefined;
175
+ readonly toolCalls?: number | undefined;
176
+ readonly errors?: number | undefined;
177
+ readonly duration?: number | undefined;
178
+ } | {
179
+ readonly _tag: "status";
180
+ readonly pending?: boolean | undefined;
181
+ readonly statusText: string;
182
+ } | {
183
+ readonly _tag: "suggestion";
184
+ readonly pending?: boolean | undefined;
185
+ readonly text: string;
186
+ } | {
187
+ readonly _tag: "summary";
188
+ readonly pending?: boolean | undefined;
189
+ readonly content: string;
190
+ } | {
191
+ readonly _tag: "text";
192
+ readonly pending?: boolean | undefined;
193
+ readonly mimeType?: string | undefined;
194
+ readonly text: string;
195
+ readonly disposition?: "cot" | "synthetic" | "user" | "version-pin" | undefined;
196
+ } | {
197
+ readonly _tag: "toolCall";
198
+ readonly pending?: boolean | undefined;
199
+ readonly toolCallId: string;
200
+ readonly name: string;
201
+ readonly input: string;
202
+ readonly providerExecuted: boolean;
203
+ } | {
204
+ readonly _tag: "toolResult";
205
+ readonly pending?: boolean | undefined;
206
+ readonly toolCallId: string;
207
+ readonly name: string;
208
+ readonly result?: string | undefined;
209
+ readonly error?: string | undefined;
210
+ readonly providerExecuted: boolean;
211
+ } | {
212
+ readonly _tag: "toolkit";
213
+ readonly pending?: boolean | undefined;
214
+ } | {
215
+ readonly _tag: "transcript";
216
+ readonly pending?: boolean | undefined;
217
+ readonly started: string;
218
+ readonly text: string;
219
+ };
220
+ }>;
221
+ export declare const AgentRequestBegin: Trace.EventType<{}>;
222
+ export declare const AgentRequestEnd: Trace.EventType<{}>;
223
+ //# sourceMappingURL=tracing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../src/tracing.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOxB,CAAC;AAEH,eAAO,MAAM,iBAAiB,qBAG5B,CAAC;AAEH,eAAO,MAAM,eAAe,qBAG1B,CAAC"}