@dxos/assistant 0.8.4-main.ae835ea → 0.8.4-main.bc2380dfbc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +2 -1
  3. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  4. package/dist/lib/neutral/extraction/index.mjs +204 -0
  5. package/dist/lib/neutral/extraction/index.mjs.map +7 -0
  6. package/dist/lib/neutral/index.mjs +1755 -0
  7. package/dist/lib/neutral/index.mjs.map +7 -0
  8. package/dist/lib/neutral/meta.json +1 -0
  9. package/dist/types/src/extraction/extraction-ner-function/index.d.ts +0 -1
  10. package/dist/types/src/extraction/extraction-ner-function/index.d.ts.map +1 -1
  11. package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
  12. package/dist/types/src/extraction/extraction.d.ts +1065 -312
  13. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  14. package/dist/types/src/extraction/index.d.ts +0 -1
  15. package/dist/types/src/extraction/index.d.ts.map +1 -1
  16. package/dist/types/src/extraction/quotes.d.ts +2 -2
  17. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  18. package/dist/types/src/functions/services.d.ts +13 -15
  19. package/dist/types/src/functions/services.d.ts.map +1 -1
  20. package/dist/types/src/index.d.ts +2 -5
  21. package/dist/types/src/index.d.ts.map +1 -1
  22. package/dist/types/src/request/AiRequest.d.ts +104 -0
  23. package/dist/types/src/request/AiRequest.d.ts.map +1 -0
  24. package/dist/types/src/{session → request}/artifact-diff.d.ts +1 -1
  25. package/dist/types/src/request/artifact-diff.d.ts.map +1 -0
  26. package/dist/types/src/request/format.d.ts +15 -0
  27. package/dist/types/src/request/format.d.ts.map +1 -0
  28. package/dist/types/src/request/index.d.ts +4 -0
  29. package/dist/types/src/request/index.d.ts.map +1 -0
  30. package/dist/types/src/{session → request}/observer.d.ts +6 -5
  31. package/dist/types/src/request/observer.d.ts.map +1 -0
  32. package/dist/types/src/{session → request}/version-pin.d.ts +3 -3
  33. package/dist/types/src/request/version-pin.d.ts.map +1 -0
  34. package/dist/types/src/session/AiContext.d.ts +154 -0
  35. package/dist/types/src/session/AiContext.d.ts.map +1 -0
  36. package/dist/types/src/session/AiContext.test.d.ts +2 -0
  37. package/dist/types/src/session/AiContext.test.d.ts.map +1 -0
  38. package/dist/types/src/session/AiSession.d.ts +73 -0
  39. package/dist/types/src/session/AiSession.d.ts.map +1 -0
  40. package/dist/types/src/session/index.d.ts +2 -4
  41. package/dist/types/src/session/index.d.ts.map +1 -1
  42. package/dist/types/src/session/toolkit.d.ts +10 -9
  43. package/dist/types/src/session/toolkit.d.ts.map +1 -1
  44. package/dist/types/src/templates/system.d.ts +1 -2
  45. package/dist/types/src/templates/system.d.ts.map +1 -1
  46. package/dist/types/src/util/artifact.d.ts +27 -0
  47. package/dist/types/src/util/artifact.d.ts.map +1 -0
  48. package/dist/types/src/{diff.d.ts → util/diff.d.ts} +3 -1
  49. package/dist/types/src/util/diff.d.ts.map +1 -0
  50. package/dist/types/src/{diff.test.d.ts.map → util/diff.test.d.ts.map} +1 -1
  51. package/dist/types/src/util/error-handling.d.ts.map +1 -0
  52. package/dist/types/src/{errors.d.ts → util/errors.d.ts} +32 -40
  53. package/dist/types/src/util/errors.d.ts.map +1 -0
  54. package/dist/types/src/{execution-graph.d.ts → util/execution-graph.d.ts} +5 -2
  55. package/dist/types/src/util/execution-graph.d.ts.map +1 -0
  56. package/dist/types/src/util/execution-graph.test.d.ts.map +1 -0
  57. package/dist/types/src/util/index.d.ts +7 -0
  58. package/dist/types/src/util/index.d.ts.map +1 -0
  59. package/dist/types/src/util/tracing.d.ts +233 -0
  60. package/dist/types/src/util/tracing.d.ts.map +1 -0
  61. package/dist/types/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +36 -42
  63. package/src/extraction/extraction-ner-function/index.ts +0 -1
  64. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +10 -5
  65. package/src/extraction/extraction.ts +43 -14
  66. package/src/extraction/index.ts +0 -1
  67. package/src/extraction/quotes.ts +4 -5
  68. package/src/functions/services.ts +119 -63
  69. package/src/index.ts +2 -5
  70. package/src/request/AiRequest.ts +348 -0
  71. package/src/{session → request}/artifact-diff.ts +1 -1
  72. package/src/{session → request}/format.ts +29 -24
  73. package/src/request/index.ts +8 -0
  74. package/src/{session → request}/observer.ts +6 -3
  75. package/src/{session → request}/version-pin.ts +6 -6
  76. package/src/session/AiContext.test.ts +53 -0
  77. package/src/session/AiContext.ts +403 -0
  78. package/src/session/AiSession.ts +324 -0
  79. package/src/session/index.ts +3 -4
  80. package/src/session/toolkit.ts +27 -28
  81. package/src/templates/{format.tpl → instructions/format.tpl} +1 -4
  82. package/src/templates/{system.tpl → instructions/system.tpl} +50 -2
  83. package/src/templates/system.ts +9 -8
  84. package/src/{types → util}/artifact.ts +42 -6
  85. package/src/util/diff.test.ts +74 -0
  86. package/src/{diff.ts → util/diff.ts} +13 -4
  87. package/src/{session → util}/error-handling.ts +3 -2
  88. package/src/util/errors.ts +15 -0
  89. package/src/{execution-graph.test.ts → util/execution-graph.test.ts} +47 -45
  90. package/src/{execution-graph.ts → util/execution-graph.ts} +41 -22
  91. package/src/util/index.ts +10 -0
  92. package/src/util/tracing.ts +57 -0
  93. package/dist/lib/browser/chunk-4VIJTKPM.mjs +0 -354
  94. package/dist/lib/browser/chunk-4VIJTKPM.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-UB26N5UF.mjs +0 -89
  96. package/dist/lib/browser/chunk-UB26N5UF.mjs.map +0 -7
  97. package/dist/lib/browser/extraction/index.mjs +0 -272
  98. package/dist/lib/browser/extraction/index.mjs.map +0 -7
  99. package/dist/lib/browser/index.mjs +0 -900
  100. package/dist/lib/browser/index.mjs.map +0 -7
  101. package/dist/lib/browser/meta.json +0 -1
  102. package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs +0 -13
  103. package/dist/lib/node-esm/chunk-AUUC7II4.mjs +0 -356
  104. package/dist/lib/node-esm/chunk-AUUC7II4.mjs.map +0 -7
  105. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs +0 -91
  106. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +0 -7
  107. package/dist/lib/node-esm/extraction/index.mjs +0 -273
  108. package/dist/lib/node-esm/extraction/index.mjs.map +0 -7
  109. package/dist/lib/node-esm/index.mjs +0 -901
  110. package/dist/lib/node-esm/index.mjs.map +0 -7
  111. package/dist/lib/node-esm/meta.json +0 -1
  112. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs +0 -14
  113. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs.map +0 -7
  114. package/dist/types/src/conversation/context.d.ts +0 -103
  115. package/dist/types/src/conversation/context.d.ts.map +0 -1
  116. package/dist/types/src/conversation/conversation.d.ts +0 -41
  117. package/dist/types/src/conversation/conversation.d.ts.map +0 -1
  118. package/dist/types/src/conversation/index.d.ts +0 -3
  119. package/dist/types/src/conversation/index.d.ts.map +0 -1
  120. package/dist/types/src/diff.d.ts.map +0 -1
  121. package/dist/types/src/errors.d.ts.map +0 -1
  122. package/dist/types/src/execution-graph.d.ts.map +0 -1
  123. package/dist/types/src/execution-graph.test.d.ts.map +0 -1
  124. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +0 -4
  125. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +0 -1
  126. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +0 -2
  127. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +0 -1
  128. package/dist/types/src/extraction/extraction-llm-function/index.d.ts +0 -2
  129. package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +0 -1
  130. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +0 -345
  131. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +0 -1
  132. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +0 -2
  133. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +0 -1
  134. package/dist/types/src/session/artifact-diff.d.ts.map +0 -1
  135. package/dist/types/src/session/error-handling.d.ts.map +0 -1
  136. package/dist/types/src/session/format.d.ts +0 -186
  137. package/dist/types/src/session/format.d.ts.map +0 -1
  138. package/dist/types/src/session/format.test.d.ts +0 -2
  139. package/dist/types/src/session/format.test.d.ts.map +0 -1
  140. package/dist/types/src/session/observer.d.ts.map +0 -1
  141. package/dist/types/src/session/session.d.ts +0 -51
  142. package/dist/types/src/session/session.d.ts.map +0 -1
  143. package/dist/types/src/session/session.test.d.ts +0 -2
  144. package/dist/types/src/session/session.test.d.ts.map +0 -1
  145. package/dist/types/src/session/version-pin.d.ts.map +0 -1
  146. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  147. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  148. package/dist/types/src/types/artifact.d.ts +0 -16
  149. package/dist/types/src/types/artifact.d.ts.map +0 -1
  150. package/dist/types/src/types/index.d.ts +0 -2
  151. package/dist/types/src/types/index.d.ts.map +0 -1
  152. package/src/conversation/context.ts +0 -186
  153. package/src/conversation/conversation.ts +0 -128
  154. package/src/conversation/index.ts +0 -6
  155. package/src/diff.test.ts +0 -43
  156. package/src/errors.ts +0 -15
  157. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +0 -84
  158. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +0 -72
  159. package/src/extraction/extraction-llm-function/index.ts +0 -5
  160. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +0 -115
  161. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +0 -64
  162. package/src/session/format.test.ts +0 -60
  163. package/src/session/session.conversations.json +0 -1
  164. package/src/session/session.test.ts +0 -149
  165. package/src/session/session.ts +0 -213
  166. package/src/summarization/summarization.test.ts +0 -202
  167. package/src/types/index.ts +0 -5
  168. /package/dist/lib/{browser/named-entity-recognition-QPYHML66.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  169. /package/dist/types/src/{diff.test.d.ts → util/diff.test.d.ts} +0 -0
  170. /package/dist/types/src/{session → util}/error-handling.d.ts +0 -0
  171. /package/dist/types/src/{execution-graph.test.d.ts → util/execution-graph.test.d.ts} +0 -0
  172. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/toolkit.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,mBAAmB,EAAE,oBAAoB,EAAE,KAAK,MAAM,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC5G,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC;CACpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,iDAIxE,aAAa,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,MAAM,CACrC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,EACxB,mBAAmB,EACnB,mBAAmB,GAAG,oBAAoB,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAkBlE,CAAC"}
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,5 +1,5 @@
1
1
  import { type ModelCapabilities } from '@dxos/ai';
2
- import { Template } from '@dxos/blueprints';
2
+ import { Template } from '@dxos/compute';
3
3
  /**
4
4
  * System template variables.
5
5
  */
@@ -12,7 +12,6 @@ export type SystemPromptOptions = ModelCapabilities & {
12
12
  */
13
13
  export declare const createSystemPrompt: (options?: Partial<SystemPromptOptions>) => string;
14
14
  export declare const templates: {
15
- /** Editable system prompt.*/
16
15
  system: Template.Template;
17
16
  };
18
17
  //# sourceMappingURL=system.d.ts.map
@@ -1 +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,kBAAkB,CAAC;AAK5C;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAS,OAAO,CAAC,mBAAmB,CAAM,WAM1E,CAAC;AAEJ,eAAO,MAAM,SAAS;IACpB,6BAA6B;;CAQ9B,CAAC"}
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,27 @@
1
+ import type * as Effect from 'effect/Effect';
2
+ import * as Schema from 'effect/Schema';
3
+ import { Database, type Err, Obj, Ref, type Type } from '@dxos/echo';
4
+ import { DXN, type ObjectId, type SpaceId } from '@dxos/keys';
5
+ /**
6
+ * @deprecated
7
+ */
8
+ export declare const createArtifactElement: (id: ObjectId) => string;
9
+ /**
10
+ * A model-friendly way to reference an object.
11
+ * Supports vairous formats that will be normalized to a DXN.
12
+ *
13
+ * @deprecated Use `Ref.Ref(XXX)` instead.
14
+ */
15
+ export declare const ArtifactId: Schema.Schema<string> & {
16
+ toDXN: (reference: ArtifactId, owningSpaceId?: SpaceId) => DXN;
17
+ resolve: <S extends Type.AnyEntity>(schema: S, ref: ArtifactId) => Effect.Effect<Schema.Schema.Type<S>, Err.ObjectNotFoundError, Database.Service>;
18
+ };
19
+ export type ArtifactId = Schema.Schema.Type<typeof ArtifactId>;
20
+ /**
21
+ * Schema that decodes ECHO reference object from an LLM-friendly input.
22
+ */
23
+ export declare const RefFromLLM: Schema.transform<Schema.Schema<string, string, never> & {
24
+ toDXN: (reference: ArtifactId, owningSpaceId?: SpaceId) => DXN;
25
+ resolve: <S extends Type.AnyEntity>(schema: S, ref: ArtifactId) => Effect.Effect<Schema.Schema.Type<S>, Err.ObjectNotFoundError, Database.Service>;
26
+ }, Ref.RefSchema<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
27
+ //# sourceMappingURL=artifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../../../src/util/artifact.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,EAAE,GAAG,EAAmB,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAG/E;;GAEG;AACH,eAAO,MAAM,qBAAqB,OAAQ,QAAQ,WAA4B,CAAC;AAE/E;;;;;GAKG;AAEH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG;IAC/C,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC;IAC/D,OAAO,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,EAChC,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,UAAU,KACZ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CA6CtF,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,UAAU;WAxDd,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,GAAG;aACrD,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,EAChC,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,UAAU,KACZ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,OAAO,CAAC;oHA0DpF,CAAC"}
@@ -11,5 +11,7 @@ export declare const computeDiffsWithCursors: <T>(accessor: DocAccessor<T>, diff
11
11
  cursor: string;
12
12
  text: string;
13
13
  }[];
14
- export declare const applyDiffs: <T>(accessor: DocAccessor<T>, diffs: readonly string[]) => string;
14
+ export declare const applyDiffs: <T>(accessor: DocAccessor<T>, diffs: readonly string[], { errorOnNotFound }?: {
15
+ errorOnNotFound?: boolean;
16
+ }) => string;
15
17
  //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../../src/util/diff.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAc3D,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,UAAW,SAAS,MAAM,EAAE,KAAG,IAAI,EA0B1D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,CAAC,YAAY,WAAW,CAAC,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE;;;GAU5F,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,YAChB,WAAW,CAAC,CAAC,CAAC,SACjB,SAAS,MAAM,EAAE,wBACK;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,KACzD,MAoBF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"diff.test.d.ts","sourceRoot":"","sources":["../../../src/diff.test.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"diff.test.d.ts","sourceRoot":"","sources":["../../../../src/util/diff.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handling.d.ts","sourceRoot":"","sources":["../../../../src/util/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,CAqB1B,CAAC"}
@@ -1,31 +1,27 @@
1
1
  import { BaseError } from '@dxos/errors';
2
2
  declare const AiModelError_base: {
3
3
  new (options?: import("@dxos/errors").BaseErrorOptions): {
4
- "__#private@#code": "AI_MODEL_ERROR";
5
- "__#private@#context": Record<string, unknown>;
6
- readonly name: "AI_MODEL_ERROR";
7
- readonly message: string;
8
- readonly code: "AI_MODEL_ERROR";
9
- readonly _tag: "AI_MODEL_ERROR";
10
- readonly context: Record<string, unknown>;
11
- stack?: string;
12
4
  cause?: unknown;
5
+ stack?: string;
6
+ name: "AiModelError";
7
+ context: Record<string, unknown>;
8
+ readonly message: string;
9
+ readonly _tag: "AiModelError";
13
10
  };
14
- code: "AI_MODEL_ERROR";
11
+ isError(error: unknown): error is Error;
12
+ name: "AiModelError";
15
13
  is(error: unknown): error is BaseError;
16
- wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause">): (error: unknown) => {
17
- "__#private@#code": "AI_MODEL_ERROR";
18
- "__#private@#context": Record<string, unknown>;
19
- readonly name: "AI_MODEL_ERROR";
20
- readonly message: string;
21
- readonly code: "AI_MODEL_ERROR";
22
- readonly _tag: "AI_MODEL_ERROR";
23
- readonly context: Record<string, unknown>;
24
- stack?: string;
14
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
15
+ ifTypeDiffers?: boolean;
16
+ }): (error: unknown) => {
25
17
  cause?: unknown;
18
+ stack?: string;
19
+ name: "AiModelError";
20
+ context: Record<string, unknown>;
21
+ readonly message: string;
22
+ readonly _tag: "AiModelError";
26
23
  };
27
- extend<Code extends string = string>(code: Code, message?: string): any;
28
- isError(error: unknown): error is Error;
24
+ extend<Name extends string = string>(name: Name, message?: string): any;
29
25
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
30
26
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
31
27
  stackTraceLimit: number;
@@ -37,31 +33,27 @@ export declare class AiModelError extends AiModelError_base {
37
33
  }
38
34
  declare const AiAssistantError_base: {
39
35
  new (options?: import("@dxos/errors").BaseErrorOptions): {
40
- "__#private@#code": "AI_ASSISTANT_ERROR";
41
- "__#private@#context": Record<string, unknown>;
42
- readonly name: "AI_ASSISTANT_ERROR";
43
- readonly message: string;
44
- readonly code: "AI_ASSISTANT_ERROR";
45
- readonly _tag: "AI_ASSISTANT_ERROR";
46
- readonly context: Record<string, unknown>;
47
- stack?: string;
48
36
  cause?: unknown;
37
+ stack?: string;
38
+ name: "AiAssistantError";
39
+ context: Record<string, unknown>;
40
+ readonly message: string;
41
+ readonly _tag: "AiAssistantError";
49
42
  };
50
- code: "AI_ASSISTANT_ERROR";
43
+ isError(error: unknown): error is Error;
44
+ name: "AiAssistantError";
51
45
  is(error: unknown): error is BaseError;
52
- wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause">): (error: unknown) => {
53
- "__#private@#code": "AI_ASSISTANT_ERROR";
54
- "__#private@#context": Record<string, unknown>;
55
- readonly name: "AI_ASSISTANT_ERROR";
56
- readonly message: string;
57
- readonly code: "AI_ASSISTANT_ERROR";
58
- readonly _tag: "AI_ASSISTANT_ERROR";
59
- readonly context: Record<string, unknown>;
60
- stack?: string;
46
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
47
+ ifTypeDiffers?: boolean;
48
+ }): (error: unknown) => {
61
49
  cause?: unknown;
50
+ stack?: string;
51
+ name: "AiAssistantError";
52
+ context: Record<string, unknown>;
53
+ readonly message: string;
54
+ readonly _tag: "AiAssistantError";
62
55
  };
63
- extend<Code extends string = string>(code: Code, message?: string): any;
64
- isError(error: unknown): error is Error;
56
+ extend<Name extends string = string>(name: Name, message?: string): any;
65
57
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
66
58
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
67
59
  stackTraceLimit: number;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/util/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC;;GAEG;AACH,qBAAa,YAAa,SAAQ,iBAAkD;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvF;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,qBAA0D;CAAG"}
@@ -1,5 +1,6 @@
1
- import { Obj } from '@dxos/echo';
1
+ import { type Entity } from '@dxos/echo';
2
2
  import { LogLevel } from '@dxos/log';
3
+ import { ContentBlock } from '@dxos/types';
3
4
  /**
4
5
  * Mercurial-style Commit.
5
6
  */
@@ -17,16 +18,18 @@ export type Commit = {
17
18
  * Models the execution graph based on a stream of events.
18
19
  */
19
20
  export declare class ExecutionGraph {
21
+ private readonly _skipBlocks;
20
22
  private _commits;
21
23
  private _branchNames;
22
24
  private _lastBlockId;
23
25
  private _toolCallCommitIds;
24
26
  private _lastCommitByBranch;
25
27
  private _pendingToolResults;
28
+ constructor(_skipBlocks?: ContentBlock.Any['_tag'][]);
26
29
  /**
27
30
  * Adds events to the graph.
28
31
  */
29
- addEvents(events: Obj.Any[]): void;
32
+ addEvents(events: Entity.Unknown[]): void;
30
33
  /**
31
34
  * Processes a message event and creates commits for its blocks.
32
35
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-graph.d.ts","sourceRoot":"","sources":["../../../../src/util/execution-graph.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,YAAY,CAAC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAW,MAAM,aAAa,CAAC;AAKpD;;GAEG;AAEH,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAqBF;;GAEG;AACH,qBAAa,cAAc;IAWb,OAAO,CAAC,QAAQ,CAAC,WAAW;IATxC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,YAAY,CAAqB;IAGzC,OAAO,CAAC,kBAAkB,CAA6B;IACvD,OAAO,CAAC,mBAAmB,CAA6B;IACxD,OAAO,CAAC,mBAAmB,CAA6B;IAExD,YAA6B,WAAW,GAAE,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAgB,EAAI;IAEtF;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,QASjC;IAED;;OAEG;IACH,OAAO,CAAC,eAAe;IAsBvB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyB3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAyB5B;;OAEG;IACH,QAAQ,CAAC,WAAW,UAAQ,GAAG;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAQvE;IAED;;OAEG;IACH,OAAO,CAAC,eAAe;IAqBvB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAyBjC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAsBnC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAK3B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-graph.test.d.ts","sourceRoot":"","sources":["../../../../src/util/execution-graph.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export * from './artifact';
2
+ export * from './diff';
3
+ export * from './error-handling';
4
+ export * from './errors';
5
+ export * from './execution-graph';
6
+ export * from './tracing';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,233 @@
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
+ /**
224
+ * Emitted when an MCP server connection fails for a request turn.
225
+ * Ephemeral so that misconfigured/unreachable servers don't pollute the durable feed,
226
+ * but can still be surfaced to the user via the live ephemeral event stream.
227
+ */
228
+ export declare const McpServerError: Trace.EventType<{
229
+ readonly url: string;
230
+ readonly protocol: "http" | "sse";
231
+ readonly message: string;
232
+ }>;
233
+ //# sourceMappingURL=tracing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/util/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;AAEH;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;EAOzB,CAAC"}