@dxos/assistant 0.8.4-main.5ea62a8 → 0.8.4-main.72ec0f3

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 (117) hide show
  1. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/browser/extraction/index.mjs +121 -164
  3. package/dist/lib/browser/extraction/index.mjs.map +4 -4
  4. package/dist/lib/browser/index.mjs +978 -157
  5. package/dist/lib/browser/index.mjs.map +4 -4
  6. package/dist/lib/browser/meta.json +1 -1
  7. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  8. package/dist/lib/node-esm/extraction/index.mjs +121 -164
  9. package/dist/lib/node-esm/extraction/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/index.mjs +978 -157
  11. package/dist/lib/node-esm/index.mjs.map +4 -4
  12. package/dist/lib/node-esm/meta.json +1 -1
  13. package/dist/types/src/conversation/context.d.ts +14 -7
  14. package/dist/types/src/conversation/context.d.ts.map +1 -1
  15. package/dist/types/src/conversation/conversation.d.ts +11 -12
  16. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  17. package/dist/types/src/diff.d.ts.map +1 -1
  18. package/dist/types/src/errors.d.ts +38 -42
  19. package/dist/types/src/errors.d.ts.map +1 -1
  20. package/dist/types/src/execution-graph.d.ts +85 -0
  21. package/dist/types/src/execution-graph.d.ts.map +1 -0
  22. package/dist/types/src/execution-graph.test.d.ts +2 -0
  23. package/dist/types/src/execution-graph.test.d.ts.map +1 -0
  24. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +1 -1
  25. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
  26. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +64 -53
  27. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +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 +24 -13
  30. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  31. package/dist/types/src/extraction/quotes.d.ts +1 -1
  32. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  33. package/dist/types/src/functions/services.d.ts +18 -5
  34. package/dist/types/src/functions/services.d.ts.map +1 -1
  35. package/dist/types/src/index.d.ts +2 -1
  36. package/dist/types/src/index.d.ts.map +1 -1
  37. package/dist/types/src/session/GenericToolkit.d.ts +84 -0
  38. package/dist/types/src/session/GenericToolkit.d.ts.map +1 -0
  39. package/dist/types/src/session/artifact-diff.d.ts +2 -2
  40. package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
  41. package/dist/types/src/session/error-handling.d.ts +2 -2
  42. package/dist/types/src/session/error-handling.d.ts.map +1 -1
  43. package/dist/types/src/session/format.d.ts +4 -174
  44. package/dist/types/src/session/format.d.ts.map +1 -1
  45. package/dist/types/src/session/index.d.ts +1 -0
  46. package/dist/types/src/session/index.d.ts.map +1 -1
  47. package/dist/types/src/session/observer.d.ts +3 -3
  48. package/dist/types/src/session/observer.d.ts.map +1 -1
  49. package/dist/types/src/session/session.d.ts +15 -11
  50. package/dist/types/src/session/session.d.ts.map +1 -1
  51. package/dist/types/src/session/toolkit.d.ts +7 -6
  52. package/dist/types/src/session/toolkit.d.ts.map +1 -1
  53. package/dist/types/src/session/version-pin.d.ts +3 -3
  54. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  55. package/dist/types/src/types/artifact.d.ts +20 -0
  56. package/dist/types/src/types/artifact.d.ts.map +1 -0
  57. package/dist/types/src/types/index.d.ts +2 -0
  58. package/dist/types/src/types/index.d.ts.map +1 -0
  59. package/dist/types/tsconfig.tsbuildinfo +1 -1
  60. package/package.json +29 -32
  61. package/src/conversation/context.ts +49 -17
  62. package/src/conversation/conversation.ts +30 -25
  63. package/src/diff.test.ts +3 -3
  64. package/src/diff.ts +7 -0
  65. package/src/errors.ts +4 -4
  66. package/src/execution-graph.test.ts +740 -0
  67. package/src/execution-graph.ts +509 -0
  68. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +9 -9
  69. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +47 -55
  70. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +16 -16
  71. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +42 -43
  72. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
  73. package/src/extraction/extraction-ner-function/named-entity-recognition.ts +2 -0
  74. package/src/extraction/extraction.ts +7 -6
  75. package/src/extraction/quotes.test.ts +2 -2
  76. package/src/extraction/quotes.ts +3 -3
  77. package/src/functions/services.ts +93 -50
  78. package/src/index.ts +2 -1
  79. package/src/session/GenericToolkit.ts +130 -0
  80. package/src/session/artifact-diff.ts +2 -2
  81. package/src/session/error-handling.ts +11 -6
  82. package/src/session/format.test.ts +5 -4
  83. package/src/session/format.ts +19 -14
  84. package/src/session/index.ts +2 -0
  85. package/src/session/observer.ts +4 -3
  86. package/src/session/session.conversations.json +1 -0
  87. package/src/session/session.test.ts +51 -210
  88. package/src/session/session.ts +41 -29
  89. package/src/session/toolkit.ts +19 -13
  90. package/src/session/version-pin.ts +4 -5
  91. package/src/templates/{format.tpl → instructions/format.tpl} +4 -2
  92. package/src/templates/{system.tpl → instructions/system.tpl} +10 -12
  93. package/src/templates/system.ts +2 -2
  94. package/src/{types.ts → types/artifact.ts} +22 -3
  95. package/src/types/index.ts +5 -0
  96. package/dist/lib/browser/chunk-6WRGDEMH.mjs +0 -89
  97. package/dist/lib/browser/chunk-6WRGDEMH.mjs.map +0 -7
  98. package/dist/lib/browser/chunk-N4O3C3T5.mjs +0 -396
  99. package/dist/lib/browser/chunk-N4O3C3T5.mjs.map +0 -7
  100. package/dist/lib/browser/named-entity-recognition-O46UTCLR.mjs +0 -13
  101. package/dist/lib/node-esm/chunk-3UU5V4FS.mjs +0 -91
  102. package/dist/lib/node-esm/chunk-3UU5V4FS.mjs.map +0 -7
  103. package/dist/lib/node-esm/chunk-QVJ7EAM2.mjs +0 -398
  104. package/dist/lib/node-esm/chunk-QVJ7EAM2.mjs.map +0 -7
  105. package/dist/lib/node-esm/named-entity-recognition-W4VMRCH6.mjs +0 -14
  106. package/dist/types/src/session/version-pin.test.d.ts +0 -2
  107. package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
  108. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  109. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  110. package/dist/types/src/types.d.ts +0 -16
  111. package/dist/types/src/types.d.ts.map +0 -1
  112. package/src/session/__snapshots__/session.test.ts.snap +0 -32
  113. package/src/session/version-pin.test.ts +0 -7
  114. package/src/summarization/summarization.test.ts +0 -197
  115. /package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  116. /package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
  117. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
@@ -1,32 +1,30 @@
1
- export declare const extractionNerFn: import("@dxos/functions").FunctionDefinition<{
2
- readonly objects?: readonly import("@dxos/echo-schema").Expando[] | undefined;
1
+ /**
2
+ * Named Entity Recognition model
3
+ */
4
+ export declare const extractionNerFunction: import("@dxos/functions").FunctionDefinition<{
3
5
  readonly options?: {
4
6
  readonly timeout?: number | undefined;
5
7
  readonly fallbackToRaw?: boolean | undefined;
6
8
  } | undefined;
7
- readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
9
+ readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
8
10
  id: string;
9
11
  parentMessage?: string | undefined;
10
12
  created: string;
11
13
  sender: {
12
14
  name?: string | undefined;
13
- contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
14
- fields?: {
15
- readonly value: string;
16
- readonly category?: string | undefined;
17
- readonly label: string;
18
- }[] | undefined;
15
+ contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
19
16
  image?: string | undefined;
20
17
  fullName?: string | undefined;
21
18
  preferredName?: string | undefined;
22
19
  nickname?: string | undefined;
23
- organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
20
+ organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
21
+ description?: string | undefined;
24
22
  id: string;
25
23
  name?: string | undefined;
26
- description?: string | undefined;
27
24
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
28
25
  image?: string | undefined;
29
26
  website?: string | undefined;
27
+ location?: readonly [number, number, (number | undefined)?] | undefined;
30
28
  }> | undefined;
31
29
  jobTitle?: string | undefined;
32
30
  department?: string | undefined;
@@ -60,11 +58,17 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
60
58
  readonly label?: string | undefined;
61
59
  }[] | undefined;
62
60
  birthday?: string | undefined;
61
+ fields?: {
62
+ readonly value: string;
63
+ readonly label: string;
64
+ readonly category?: string | undefined;
65
+ }[] | undefined;
66
+ location?: readonly [number, number, (number | undefined)?] | undefined;
63
67
  }> | undefined;
64
68
  identityDid?: string | undefined;
65
69
  identityKey?: string | undefined;
66
70
  email?: string | undefined;
67
- role?: "user" | "assistant" | undefined;
71
+ role?: "user" | "assistant" | "tool" | undefined;
68
72
  };
69
73
  blocks: ({
70
74
  version: unknown;
@@ -72,23 +76,23 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
72
76
  pending?: boolean | undefined;
73
77
  objectId: string;
74
78
  } | {
75
- name?: string | undefined;
76
79
  _tag: "file";
77
- url: string;
78
80
  pending?: boolean | undefined;
81
+ url: string;
82
+ name?: string | undefined;
79
83
  mediaType?: string | undefined;
80
84
  } | {
81
85
  id?: string | undefined;
86
+ _tag: "image";
87
+ pending?: boolean | undefined;
82
88
  source?: {
83
- type: "base64";
84
89
  mediaType: string;
90
+ type: "base64";
85
91
  data: string;
86
92
  } | {
87
- type: "http";
88
93
  url: string;
94
+ type: "http";
89
95
  } | undefined;
90
- _tag: "image";
91
- pending?: boolean | undefined;
92
96
  } | {
93
97
  _tag: "json";
94
98
  pending?: boolean | undefined;
@@ -100,13 +104,13 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
100
104
  pending?: boolean | undefined;
101
105
  } | {
102
106
  _tag: "reasoning";
107
+ pending?: boolean | undefined;
103
108
  reasoningText?: string | undefined;
104
- signature?: string | undefined;
105
109
  redactedText?: string | undefined;
106
- pending?: boolean | undefined;
110
+ signature?: string | undefined;
107
111
  } | {
112
+ reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
108
113
  _tag: "reference";
109
- reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
110
114
  pending?: boolean | undefined;
111
115
  } | {
112
116
  _tag: "select";
@@ -122,15 +126,15 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
122
126
  pending?: boolean | undefined;
123
127
  } | {
124
128
  _tag: "summary";
129
+ pending?: boolean | undefined;
130
+ mimeType?: string | undefined;
131
+ message?: string | undefined;
125
132
  model?: string | undefined;
126
133
  usage?: {
127
134
  readonly inputTokens?: number | undefined;
128
135
  readonly outputTokens?: number | undefined;
129
136
  readonly totalTokens?: number | undefined;
130
137
  } | undefined;
131
- pending?: boolean | undefined;
132
- mimeType?: string | undefined;
133
- message?: string | undefined;
134
138
  toolCalls?: number | undefined;
135
139
  errors?: number | undefined;
136
140
  duration?: number | undefined;
@@ -144,18 +148,20 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
144
148
  _tag: "toolkit";
145
149
  pending?: boolean | undefined;
146
150
  } | {
147
- name: string;
148
151
  _tag: "toolCall";
149
152
  pending?: boolean | undefined;
153
+ name: string;
150
154
  toolCallId: string;
151
155
  input: string;
156
+ providerExecuted: boolean;
152
157
  } | {
153
- name: string;
154
158
  _tag: "toolResult";
155
- error?: string | undefined;
156
159
  pending?: boolean | undefined;
160
+ name: string;
157
161
  toolCallId: string;
162
+ providerExecuted: boolean;
158
163
  result?: string | undefined;
164
+ error?: string | undefined;
159
165
  } | {
160
166
  text: string;
161
167
  _tag: "transcript";
@@ -166,30 +172,27 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
166
172
  [x: string]: any;
167
173
  } | undefined;
168
174
  };
175
+ readonly objects?: readonly import("@dxos/echo/internal").Expando[] | undefined;
169
176
  }, {
170
- readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
177
+ readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
171
178
  id: string;
172
179
  parentMessage?: string | undefined;
173
180
  created: string;
174
181
  sender: {
175
182
  name?: string | undefined;
176
- contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
177
- fields?: {
178
- readonly value: string;
179
- readonly category?: string | undefined;
180
- readonly label: string;
181
- }[] | undefined;
183
+ contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
182
184
  image?: string | undefined;
183
185
  fullName?: string | undefined;
184
186
  preferredName?: string | undefined;
185
187
  nickname?: string | undefined;
186
- organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
188
+ organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
189
+ description?: string | undefined;
187
190
  id: string;
188
191
  name?: string | undefined;
189
- description?: string | undefined;
190
192
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
191
193
  image?: string | undefined;
192
194
  website?: string | undefined;
195
+ location?: readonly [number, number, (number | undefined)?] | undefined;
193
196
  }> | undefined;
194
197
  jobTitle?: string | undefined;
195
198
  department?: string | undefined;
@@ -223,11 +226,17 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
223
226
  readonly label?: string | undefined;
224
227
  }[] | undefined;
225
228
  birthday?: string | undefined;
229
+ fields?: {
230
+ readonly value: string;
231
+ readonly label: string;
232
+ readonly category?: string | undefined;
233
+ }[] | undefined;
234
+ location?: readonly [number, number, (number | undefined)?] | undefined;
226
235
  }> | undefined;
227
236
  identityDid?: string | undefined;
228
237
  identityKey?: string | undefined;
229
238
  email?: string | undefined;
230
- role?: "user" | "assistant" | undefined;
239
+ role?: "user" | "assistant" | "tool" | undefined;
231
240
  };
232
241
  blocks: ({
233
242
  version: unknown;
@@ -235,23 +244,23 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
235
244
  pending?: boolean | undefined;
236
245
  objectId: string;
237
246
  } | {
238
- name?: string | undefined;
239
247
  _tag: "file";
240
- url: string;
241
248
  pending?: boolean | undefined;
249
+ url: string;
250
+ name?: string | undefined;
242
251
  mediaType?: string | undefined;
243
252
  } | {
244
253
  id?: string | undefined;
254
+ _tag: "image";
255
+ pending?: boolean | undefined;
245
256
  source?: {
246
- type: "base64";
247
257
  mediaType: string;
258
+ type: "base64";
248
259
  data: string;
249
260
  } | {
250
- type: "http";
251
261
  url: string;
262
+ type: "http";
252
263
  } | undefined;
253
- _tag: "image";
254
- pending?: boolean | undefined;
255
264
  } | {
256
265
  _tag: "json";
257
266
  pending?: boolean | undefined;
@@ -263,13 +272,13 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
263
272
  pending?: boolean | undefined;
264
273
  } | {
265
274
  _tag: "reasoning";
275
+ pending?: boolean | undefined;
266
276
  reasoningText?: string | undefined;
267
- signature?: string | undefined;
268
277
  redactedText?: string | undefined;
269
- pending?: boolean | undefined;
278
+ signature?: string | undefined;
270
279
  } | {
280
+ reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
271
281
  _tag: "reference";
272
- reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
273
282
  pending?: boolean | undefined;
274
283
  } | {
275
284
  _tag: "select";
@@ -285,15 +294,15 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
285
294
  pending?: boolean | undefined;
286
295
  } | {
287
296
  _tag: "summary";
297
+ pending?: boolean | undefined;
298
+ mimeType?: string | undefined;
299
+ message?: string | undefined;
288
300
  model?: string | undefined;
289
301
  usage?: {
290
302
  readonly inputTokens?: number | undefined;
291
303
  readonly outputTokens?: number | undefined;
292
304
  readonly totalTokens?: number | undefined;
293
305
  } | undefined;
294
- pending?: boolean | undefined;
295
- mimeType?: string | undefined;
296
- message?: string | undefined;
297
306
  toolCalls?: number | undefined;
298
307
  errors?: number | undefined;
299
308
  duration?: number | undefined;
@@ -307,18 +316,20 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
307
316
  _tag: "toolkit";
308
317
  pending?: boolean | undefined;
309
318
  } | {
310
- name: string;
311
319
  _tag: "toolCall";
312
320
  pending?: boolean | undefined;
321
+ name: string;
313
322
  toolCallId: string;
314
323
  input: string;
324
+ providerExecuted: boolean;
315
325
  } | {
316
- name: string;
317
326
  _tag: "toolResult";
318
- error?: string | undefined;
319
327
  pending?: boolean | undefined;
328
+ name: string;
320
329
  toolCallId: string;
330
+ providerExecuted: boolean;
321
331
  result?: string | undefined;
332
+ error?: string | undefined;
322
333
  } | {
323
334
  text: string;
324
335
  _tag: "transcript";
@@ -330,5 +341,5 @@ export declare const extractionNerFn: import("@dxos/functions").FunctionDefiniti
330
341
  } | undefined;
331
342
  };
332
343
  readonly timeElapsed: number;
333
- }>;
344
+ }, import("@dxos/functions").FunctionServices>;
334
345
  //# sourceMappingURL=extraction-ner-function.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extraction-ner-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsC1B,CAAC"}
1
+ {"version":3,"file":"extraction-ner-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.ts"],"names":[],"mappings":"AAQA;;GAEG;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CA2ChC,CAAC"}
@@ -1 +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,+BAA+B,EACpC,KAAK,yBAAyB,EAE/B,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"}
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,+BAA+B,EACpC,KAAK,yBAAyB,EAE/B,MAAM,sBAAsB,CAAC;AAM9B;;;;GAIG;AACH,eAAO,MAAM,MAAM,gDASlB,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"}
@@ -1,24 +1,26 @@
1
- import { Schema } from 'effect';
2
- import { Expando } from '@dxos/echo-schema';
3
- import { type FunctionDefinition, type FunctionExecutor } from '@dxos/functions';
1
+ import * as Schema from 'effect/Schema';
2
+ import { Expando } from '@dxos/echo/internal';
3
+ import { type FunctionDefinition } from '@dxos/functions';
4
+ import { type FunctionExecutor } from '@dxos/functions-runtime';
4
5
  export declare const ExtractionInput: Schema.Struct<{
5
6
  message: import("@dxos/echo/Type").obj<Schema.Struct<{
6
7
  id: import("@dxos/keys").ObjectIdClass;
7
8
  parentMessage: Schema.optional<import("@dxos/keys").ObjectIdClass>;
8
9
  created: Schema.SchemaClass<string, string, never>;
9
10
  sender: Schema.mutable<Schema.Struct<{
10
- contact: Schema.optional<import("@dxos/echo/Type").ref<import("@dxos/echo/Type").obj<Schema.Struct<{
11
+ contact: Schema.optional<import("@dxos/echo/Type").ref<import("@dxos/echo/Type").obj<Schema.extend<Schema.Struct<{
11
12
  fullName: Schema.optional<Schema.SchemaClass<string, string, never>>;
12
13
  preferredName: Schema.optional<Schema.SchemaClass<string, string, never>>;
13
14
  nickname: Schema.optional<Schema.SchemaClass<string, string, never>>;
14
15
  image: Schema.optional<Schema.SchemaClass<string, string, never>>;
15
- organization: Schema.optional<Schema.Schema<import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
16
+ organization: Schema.optional<Schema.Schema<import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
17
+ description?: string | undefined;
16
18
  id: string;
17
19
  name?: string | undefined;
18
- description?: string | undefined;
19
20
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
20
21
  image?: string | undefined;
21
22
  website?: string | undefined;
23
+ location?: readonly [number, number, (number | undefined)?] | undefined;
22
24
  }>, import("@dxos/echo-protocol").EncodedReference, never>>;
23
25
  jobTitle: Schema.optional<Schema.SchemaClass<string, string, never>>;
24
26
  department: Schema.optional<Schema.SchemaClass<string, string, never>>;
@@ -57,12 +59,14 @@ export declare const ExtractionInput: Schema.Struct<{
57
59
  label: typeof Schema.String;
58
60
  value: typeof Schema.String;
59
61
  }>>>>;
60
- }>>>>;
62
+ }>, Schema.Struct<{
63
+ location: Schema.optional<Schema.Tuple<[Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.Element<typeof Schema.Number, "?">]>>;
64
+ }>>>>>;
61
65
  identityDid: Schema.optional<typeof Schema.String>;
62
66
  identityKey: Schema.optional<typeof Schema.String>;
63
67
  email: Schema.optional<typeof Schema.String>;
64
68
  name: Schema.optional<typeof Schema.String>;
65
- role: Schema.optional<Schema.Literal<["user", "assistant"]>>;
69
+ role: Schema.optional<Schema.Literal<["user", "assistant", "tool"]>>;
66
70
  }>>;
67
71
  blocks: Schema.mutable<Schema.Array$<Schema.Union<[Schema.mutable<Schema.TaggedStruct<"anchor", {
68
72
  pending: Schema.optional<typeof Schema.Boolean>;
@@ -136,12 +140,14 @@ export declare const ExtractionInput: Schema.Struct<{
136
140
  toolCallId: typeof Schema.String;
137
141
  name: typeof Schema.String;
138
142
  input: typeof Schema.String;
143
+ providerExecuted: typeof Schema.Boolean;
139
144
  }>>, Schema.mutable<Schema.TaggedStruct<"toolResult", {
140
145
  pending: Schema.optional<typeof Schema.Boolean>;
141
146
  toolCallId: typeof Schema.String;
142
147
  name: typeof Schema.String;
143
148
  result: Schema.optional<typeof Schema.String>;
144
149
  error: Schema.optional<typeof Schema.String>;
150
+ providerExecuted: typeof Schema.Boolean;
145
151
  }>>, Schema.mutable<Schema.TaggedStruct<"transcript", {
146
152
  pending: Schema.optional<typeof Schema.Boolean>;
147
153
  started: typeof Schema.String;
@@ -163,18 +169,19 @@ export declare const ExtractionOutput: Schema.Struct<{
163
169
  parentMessage: Schema.optional<import("@dxos/keys").ObjectIdClass>;
164
170
  created: Schema.SchemaClass<string, string, never>;
165
171
  sender: Schema.mutable<Schema.Struct<{
166
- contact: Schema.optional<import("@dxos/echo/Type").ref<import("@dxos/echo/Type").obj<Schema.Struct<{
172
+ contact: Schema.optional<import("@dxos/echo/Type").ref<import("@dxos/echo/Type").obj<Schema.extend<Schema.Struct<{
167
173
  fullName: Schema.optional<Schema.SchemaClass<string, string, never>>;
168
174
  preferredName: Schema.optional<Schema.SchemaClass<string, string, never>>;
169
175
  nickname: Schema.optional<Schema.SchemaClass<string, string, never>>;
170
176
  image: Schema.optional<Schema.SchemaClass<string, string, never>>;
171
- organization: Schema.optional<Schema.Schema<import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
177
+ organization: Schema.optional<Schema.Schema<import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
178
+ description?: string | undefined;
172
179
  id: string;
173
180
  name?: string | undefined;
174
- description?: string | undefined;
175
181
  status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
176
182
  image?: string | undefined;
177
183
  website?: string | undefined;
184
+ location?: readonly [number, number, (number | undefined)?] | undefined;
178
185
  }>, import("@dxos/echo-protocol").EncodedReference, never>>;
179
186
  jobTitle: Schema.optional<Schema.SchemaClass<string, string, never>>;
180
187
  department: Schema.optional<Schema.SchemaClass<string, string, never>>;
@@ -213,12 +220,14 @@ export declare const ExtractionOutput: Schema.Struct<{
213
220
  label: typeof Schema.String;
214
221
  value: typeof Schema.String;
215
222
  }>>>>;
216
- }>>>>;
223
+ }>, Schema.Struct<{
224
+ location: Schema.optional<Schema.Tuple<[Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.filter<Schema.transform<Schema.SchemaClass<number, number, never>, Schema.filter<Schema.SchemaClass<number, number, never>>>>, Schema.Element<typeof Schema.Number, "?">]>>;
225
+ }>>>>>;
217
226
  identityDid: Schema.optional<typeof Schema.String>;
218
227
  identityKey: Schema.optional<typeof Schema.String>;
219
228
  email: Schema.optional<typeof Schema.String>;
220
229
  name: Schema.optional<typeof Schema.String>;
221
- role: Schema.optional<Schema.Literal<["user", "assistant"]>>;
230
+ role: Schema.optional<Schema.Literal<["user", "assistant", "tool"]>>;
222
231
  }>>;
223
232
  blocks: Schema.mutable<Schema.Array$<Schema.Union<[Schema.mutable<Schema.TaggedStruct<"anchor", {
224
233
  pending: Schema.optional<typeof Schema.Boolean>;
@@ -292,12 +301,14 @@ export declare const ExtractionOutput: Schema.Struct<{
292
301
  toolCallId: typeof Schema.String;
293
302
  name: typeof Schema.String;
294
303
  input: typeof Schema.String;
304
+ providerExecuted: typeof Schema.Boolean;
295
305
  }>>, Schema.mutable<Schema.TaggedStruct<"toolResult", {
296
306
  pending: Schema.optional<typeof Schema.Boolean>;
297
307
  toolCallId: typeof Schema.String;
298
308
  name: typeof Schema.String;
299
309
  result: Schema.optional<typeof Schema.String>;
300
310
  error: Schema.optional<typeof Schema.String>;
311
+ providerExecuted: typeof Schema.Boolean;
301
312
  }>>, Schema.mutable<Schema.TaggedStruct<"transcript", {
302
313
  pending: Schema.optional<typeof Schema.Boolean>;
303
314
  started: typeof Schema.String;
@@ -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;;;;;;;;;;;;;wBA+D+jb,CAAC;+BAAiD,CAAC;0BAA4C,CAAC;yBAA8F,CAAC;2BAA6C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAtDt0b,CAAC;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC;CAAG;AAEtF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;wBAmD8jb,CAAC;+BAAiD,CAAC;0BAA4C,CAAC;yBAA8F,CAAC;2BAA6C,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAvBf,CAAC;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC;CAAG;AAEtF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;+BAQL,CAAC;;wBACG,CAAC;0BAIT,CAAC;yBAKc,CAAA;2BACd,CAAA;4BACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAjBf,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"}
@@ -1,4 +1,4 @@
1
- import { Schema } from 'effect';
1
+ import * as Schema from 'effect/Schema';
2
2
  import { type EchoDatabase } from '@dxos/echo-db';
3
3
  export declare const ReferencedQuotes: Schema.Struct<{
4
4
  references: Schema.mutable<Schema.Array$<Schema.Struct<{
@@ -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;AAIxC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,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,7 +1,20 @@
1
- import { AiTool, type AiToolkit } from '@effect/ai';
2
- import { Layer } from 'effect';
1
+ import * as Tool from '@effect/ai/Tool';
2
+ import type * as Toolkit from '@effect/ai/Toolkit';
3
+ import * as Layer from 'effect/Layer';
3
4
  import { ToolExecutionService, ToolResolverService } from '@dxos/ai';
4
- import { type FunctionDefinition, LocalFunctionExecutionService } from '@dxos/functions';
5
- export declare const makeToolResolverFromFunctions: (functions: FunctionDefinition<any, any>[], toolkit: AiToolkit.Any) => Layer.Layer<ToolResolverService>;
6
- export declare const makeToolExecutionServiceFromFunctions: (functions: FunctionDefinition<any, any>[], toolkit: AiToolkit.AiToolkit<AiTool.Any>, handlersLayer: Layer.Layer<AiTool.ToHandler<AiTool.AiTool<any>>, never, never>) => Layer.Layer<ToolExecutionService, never, LocalFunctionExecutionService>;
5
+ import { DatabaseService } from '@dxos/echo-db';
6
+ import { FunctionDefinition, FunctionInvocationService } from '@dxos/functions';
7
+ /**
8
+ * Constructs a `ToolResolverService` whose `resolve(id)` looks up tools in the following order:
9
+ * 1. Toolkit: return an existing tool from the provided `toolkit` if one is present under `id`.
10
+ * 2. Functions in DB: query `FunctionType` by `key=id`; if found, deserialize and project to a tool
11
+ * (propagating any `deployedFunctionId` discovered in the object's metadata).
12
+ * 3. Functions passed in: fall back to a matching `FunctionDefinition` from the `functions` array.
13
+ *
14
+ * If none of the above yield a match, the effect fails with `AiToolNotFoundError`.
15
+ *
16
+ * Requires `DatabaseService` in the environment.
17
+ */
18
+ export declare const makeToolResolverFromFunctions: (functions: FunctionDefinition.Any[], toolkit: Toolkit.Toolkit<any>) => Layer.Layer<ToolResolverService, never, DatabaseService>;
19
+ export declare const makeToolExecutionServiceFromFunctions: (toolkit: Toolkit.Toolkit<any>, handlersLayer: Layer.Layer<Tool.Handler<any>, never, never>) => Layer.Layer<ToolExecutionService, never, FunctionInvocationService>;
7
20
  //# sourceMappingURL=services.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/functions/services.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EA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C,KAC5B,KAAK,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,EAAE,eAAe,CA8BzD,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAChD,SAAS,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAC7B,eAAe,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAC1D,KAAK,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,EAAE,yBAAyB,CAoCpE,CAAC"}
@@ -1,8 +1,9 @@
1
1
  export * from './conversation';
2
2
  export * from './diff';
3
+ export * from './errors';
4
+ export * from './execution-graph';
3
5
  export * from './functions';
4
6
  export * from './session';
5
7
  export * from './templates';
6
8
  export * from './types';
7
- export * from './errors';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,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"}
@@ -0,0 +1,84 @@
1
+ import type * as Tool from '@effect/ai/Tool';
2
+ import * as Toolkit from '@effect/ai/Toolkit';
3
+ import * as Effect from 'effect/Effect';
4
+ import * as Layer from 'effect/Layer';
5
+ import * as Pipeable from 'effect/Pipeable';
6
+ import type * as Schema from 'effect/Schema';
7
+ import type * as SchemaAST from 'effect/SchemaAST';
8
+ /**
9
+ * Unique identifier for generic toolkit instances.
10
+ */
11
+ export declare const TypeId = "~@dxos/assistant/GenericToolkit";
12
+ /**
13
+ * Type-level representation of the generic toolkit identifier.
14
+ */
15
+ export type TypeId = typeof TypeId;
16
+ /**
17
+ * Type-safe way to define toolkits where we don't know specific types of tools,
18
+ * and we want to bundle definition and handlers together.
19
+ *
20
+ * Usefull for plugin-based systems, where tools are dynamically added.
21
+ *
22
+ * @param TR requirements type to the tool invocation.
23
+ * @param E failure type to the handlers layer.
24
+ * @param R requirements type to the handlers layer.
25
+ */
26
+ export interface GenericToolkit<TR = never, E = never, R = never> extends Pipeable.Pipeable {
27
+ readonly [TypeId]: TypeId;
28
+ /**
29
+ * Toolkit definition.
30
+ */
31
+ readonly toolkit: Toolkit.Toolkit<GenericTools<TR>>;
32
+ /**
33
+ * Handlers layer.
34
+ */
35
+ readonly layer: Layer.Layer<unknown, E, R>;
36
+ /**
37
+ * Handlers effect.
38
+ */
39
+ readonly handlers: Effect.Effect<Toolkit.WithHandler<GenericTools<TR>>, E, R>;
40
+ }
41
+ /**
42
+ * Generic constraint.
43
+ *
44
+ * NOTE: Only use in place of `T extends PortableToolkit.Any`. Not suitable for standalone use.
45
+ */
46
+ export interface Any {
47
+ readonly [TypeId]: TypeId;
48
+ readonly toolkit: Toolkit.Toolkit<any>;
49
+ readonly layer: Layer.Layer<unknown, any, any>;
50
+ }
51
+ export type InvocationRequirements<T extends Any> = T extends GenericToolkit<infer TR, infer _E, infer _R> ? TR : never;
52
+ export type Failure<T extends Any> = T extends GenericToolkit<infer _TR, infer E, infer _R> ? E : never;
53
+ export type Requirements<T extends Any> = T extends GenericToolkit<infer _TR, infer _E, infer R> ? R : never;
54
+ /**
55
+ * Creates a portable toolkit from toolkit definition and handlers layer.
56
+ */
57
+ export declare const make: <Tools extends Record<string, Tool.Any>, E, R>(toolkit: Toolkit.Toolkit<Tools>, layer: Layer.Layer<Tool.HandlersFor<Tools>, E, R>) => GenericToolkit<E, R>;
58
+ /**
59
+ * Merges multiple portable toolkits into a single portable toolkit.
60
+ */
61
+ export declare const merge: <const Toolkits extends ReadonlyArray<Any>>(
62
+ /**
63
+ * The toolkits to merge together.
64
+ */
65
+ ...toolkits: Toolkits) => GenericToolkit<InvocationRequirements<Toolkits[number]>, Failure<Toolkits[number]>, Requirements<Toolkits[number]>>;
66
+ /**
67
+ * Generic tools type where we cannot statically enumerate individual tools.
68
+ */
69
+ export type GenericTools<R = never> = Record<string, Tool.Tool<string, {
70
+ readonly parameters: AnyStructSchemaNoContext;
71
+ readonly success: Schema.Schema.AnyNoContext;
72
+ readonly failure: typeof Schema.Never;
73
+ }, R>>;
74
+ export interface AnyStructSchemaNoContext extends Pipeable.Pipeable {
75
+ readonly [Schema.TypeId]: any;
76
+ readonly make: any;
77
+ readonly Type: any;
78
+ readonly Encoded: any;
79
+ readonly Context: never;
80
+ readonly ast: SchemaAST.AST;
81
+ readonly fields: Schema.Struct.Fields;
82
+ readonly annotations: any;
83
+ }
84
+ //# sourceMappingURL=GenericToolkit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericToolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/GenericToolkit.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,MAAM,oCAAoC,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG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AQ,CAAC,IAAI,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC;CAC3B"}
@@ -1,6 +1,6 @@
1
- import { Context } from 'effect';
1
+ import * as Context from 'effect/Context';
2
+ import { type ObjectId } from '@dxos/echo/internal';
2
3
  import { type ObjectVersion } from '@dxos/echo-db';
3
- import { type ObjectId } from '@dxos/echo-schema';
4
4
  declare const ArtifactDiffResolver_base: Context.TagClass<ArtifactDiffResolver, "@dxos/assistant/ArtifactDiffResolver", ArtifactDiffResolver.Service>;
5
5
  /**
6
6
  * Resolves artifact ids to their versions.
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-diff.d.ts","sourceRoot":"","sources":["../../../../src/session/artifact-diff.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;;AAElD;;;;;;;GAOG;AAEH,qBAAa,oBAAqB,SAAQ,yBAGvC;CAAG;AAEN,yBAAiB,oBAAoB,CAAC;IACpC,KAAY,OAAO,GAAG;QACpB,OAAO,EAAE,CACP,SAAS,EAAE;YACT,EAAE,EAAE,QAAQ,CAAC;YACb,WAAW,EAAE,aAAa,CAAC;SAC5B,EAAE,KACA,OAAO,CACV,GAAG,CACD,QAAQ,EACR;YACE,OAAO,EAAE,aAAa,CAAC;YACvB,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CACF,CACF,CAAC;KACH,CAAC;CACH"}
1
+ {"version":3,"file":"artifact-diff.d.ts","sourceRoot":"","sources":["../../../../src/session/artifact-diff.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;;AAEnD;;;;;;;GAOG;AAEH,qBAAa,oBAAqB,SAAQ,yBAGvC;CAAG;AAEN,yBAAiB,oBAAoB,CAAC;IACpC,KAAY,OAAO,GAAG;QACpB,OAAO,EAAE,CACP,SAAS,EAAE;YACT,EAAE,EAAE,QAAQ,CAAC;YACb,WAAW,EAAE,aAAa,CAAC;SAC5B,EAAE,KACA,OAAO,CACV,GAAG,CACD,QAAQ,EACR;YACE,OAAO,EAAE,aAAa,CAAC;YACvB,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CACF,CACF,CAAC;KACH,CAAC;CACH"}
@@ -1,4 +1,4 @@
1
- import { AiError } from '@effect/ai';
2
- import { Effect } from 'effect';
1
+ import * as AiError from '@effect/ai/AiError';
2
+ import * as Effect from 'effect/Effect';
3
3
  export declare const mapAiError: (err: AiError.AiError) => Effect.Effect<AiError.AiError>;
4
4
  //# sourceMappingURL=error-handling.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-handling.d.ts","sourceRoot":"","sources":["../../../../src/session/error-handling.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAYxC,eAAO,MAAM,UAAU,GAAI,KAAK,OAAO,CAAC,OAAO,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAiB1B,CAAC"}
1
+ {"version":3,"file":"error-handling.d.ts","sourceRoot":"","sources":["../../../../src/session/error-handling.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAcxC,eAAO,MAAM,UAAU,GAAI,KAAK,OAAO,CAAC,OAAO,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAoB1B,CAAC"}