@effect-uai/ui 0.0.0-stage → 0.19.0-dev-20261109183959

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 (76) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -2
  3. package/dist/Atoms.d.mts +141 -0
  4. package/dist/Atoms.d.mts.map +1 -0
  5. package/dist/Atoms.mjs +132 -0
  6. package/dist/Atoms.mjs.map +1 -0
  7. package/dist/Client-C9UYN_VK.d.mts +219 -0
  8. package/dist/Client-C9UYN_VK.d.mts.map +1 -0
  9. package/dist/Client.d.mts +2 -0
  10. package/dist/Client.mjs +55 -0
  11. package/dist/Client.mjs.map +1 -0
  12. package/dist/Input-Cz-Kxusm.d.mts +277 -0
  13. package/dist/Input-Cz-Kxusm.d.mts.map +1 -0
  14. package/dist/Input.d.mts +2 -0
  15. package/dist/Input.mjs +127 -0
  16. package/dist/Input.mjs.map +1 -0
  17. package/dist/Projection.d.mts +44 -0
  18. package/dist/Projection.d.mts.map +1 -0
  19. package/dist/Projection.mjs +133 -0
  20. package/dist/Projection.mjs.map +1 -0
  21. package/dist/Run.d.mts +44 -0
  22. package/dist/Run.d.mts.map +1 -0
  23. package/dist/Run.mjs +117 -0
  24. package/dist/Run.mjs.map +1 -0
  25. package/dist/RunEvent.d.mts +1225 -0
  26. package/dist/RunEvent.d.mts.map +1 -0
  27. package/dist/RunEvent.mjs +264 -0
  28. package/dist/RunEvent.mjs.map +1 -0
  29. package/dist/RunView-nHfJwN8t.d.mts +380 -0
  30. package/dist/RunView-nHfJwN8t.d.mts.map +1 -0
  31. package/dist/RunView.d.mts +2 -0
  32. package/dist/RunView.mjs +452 -0
  33. package/dist/RunView.mjs.map +1 -0
  34. package/dist/SseEncoding.d.mts +437 -0
  35. package/dist/SseEncoding.d.mts.map +1 -0
  36. package/dist/SseEncoding.mjs +64 -0
  37. package/dist/SseEncoding.mjs.map +1 -0
  38. package/dist/Thread-CAXsjhpX.d.mts +474 -0
  39. package/dist/Thread-CAXsjhpX.d.mts.map +1 -0
  40. package/dist/Thread.d.mts +2 -0
  41. package/dist/Thread.mjs +225 -0
  42. package/dist/Thread.mjs.map +1 -0
  43. package/dist/Transport.d.mts +96 -0
  44. package/dist/Transport.d.mts.map +1 -0
  45. package/dist/Transport.mjs +82 -0
  46. package/dist/Transport.mjs.map +1 -0
  47. package/dist/UiContract.d.mts +113 -0
  48. package/dist/UiContract.d.mts.map +1 -0
  49. package/dist/UiContract.mjs +229 -0
  50. package/dist/UiContract.mjs.map +1 -0
  51. package/dist/index.d.mts +12 -0
  52. package/dist/index.mjs +12 -0
  53. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  54. package/package.json +99 -3
  55. package/src/Atoms.test.ts +163 -0
  56. package/src/Atoms.ts +355 -0
  57. package/src/Client.test.ts +53 -0
  58. package/src/Client.ts +92 -0
  59. package/src/Input.test.ts +68 -0
  60. package/src/Input.ts +165 -0
  61. package/src/Projection.test.ts +198 -0
  62. package/src/Projection.ts +142 -0
  63. package/src/Run.test.ts +119 -0
  64. package/src/Run.ts +166 -0
  65. package/src/RunEvent.test.ts +84 -0
  66. package/src/RunEvent.ts +374 -0
  67. package/src/RunView.test.ts +98 -0
  68. package/src/RunView.ts +583 -0
  69. package/src/SseEncoding.test.ts +46 -0
  70. package/src/SseEncoding.ts +77 -0
  71. package/src/Thread.test.ts +304 -0
  72. package/src/Thread.ts +286 -0
  73. package/src/Transport.ts +182 -0
  74. package/src/UiContract.test.ts +342 -0
  75. package/src/UiContract.ts +402 -0
  76. package/src/index.ts +11 -0
@@ -0,0 +1,474 @@
1
+ import { Envelope, InputId, Payloads, StreamId, Untyped } from "./RunEvent.mjs";
2
+ import { p as UserMessage } from "./Input-Cz-Kxusm.mjs";
3
+ import { h as ToolUpdate, l as RunView } from "./RunView-nHfJwN8t.mjs";
4
+ import { Option, Schema } from "effect";
5
+ declare namespace Thread_d_exports {
6
+ export { AssistantEntry, Config, Entry, Fold, Message, PresetInput, State, Thread, UserContent, UserEntry, ended, hasInput, initial, make, preset, presetFor, step, submitted, truncateAfter };
7
+ }
8
+ type UserEntry<U> = {
9
+ readonly role: "user";
10
+ readonly id: InputId;
11
+ readonly value: U;
12
+ };
13
+ type AssistantEntry<A> = {
14
+ readonly role: "assistant";
15
+ readonly id: string;
16
+ readonly value: A;
17
+ };
18
+ type Entry<U, A> = UserEntry<U> | AssistantEntry<A>;
19
+ /** `P` types the active run's payloads (see `UiContract`). */
20
+ type State<U, A, P extends Payloads = Untyped> = {
21
+ readonly messages: ReadonlyArray<Entry<U, A>>;
22
+ /** The run still streaming, if any. */
23
+ readonly active: RunView<P> | null;
24
+ /**
25
+ * Inputs waiting for their own run (sent during a run, or echoed by a
26
+ * server that queues). They join `messages` when a `run-started` lists them.
27
+ */
28
+ readonly pending: ReadonlyArray<UserEntry<U>>;
29
+ /** The stream `lastSeq` counts in; a frame from another stream starts a new count. */
30
+ readonly streamId: StreamId | null;
31
+ /** Highest applied `seq` across runs, so a settled run's frames stay deduplicated. */
32
+ readonly lastSeq: number;
33
+ };
34
+ /**
35
+ * The state as a Schema, for persisting or sending it. `view` is the active
36
+ * run's schema: `RunView.RunView` (default) or a contract's `RunView`.
37
+ */
38
+ declare const State: <U, A, V>(user: Schema.Codec<U, unknown, never, never>, assistant: Schema.Codec<A, unknown, never, never>, view: Schema.Codec<V, unknown, never, never>) => Schema.Struct<{
39
+ readonly messages: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
40
+ readonly role: Schema.Literal<"user">;
41
+ readonly id: Schema.brand<Schema.String, "InputId">;
42
+ readonly value: Schema.Codec<U, unknown, never, never>;
43
+ }>, Schema.Struct<{
44
+ readonly role: Schema.Literal<"assistant">;
45
+ readonly id: Schema.String;
46
+ readonly value: Schema.Codec<A, unknown, never, never>;
47
+ }>]>>;
48
+ readonly active: Schema.NullOr<Schema.Codec<V, unknown, never, never>>;
49
+ readonly pending: Schema.$Array<Schema.Struct<{
50
+ readonly role: Schema.Literal<"user">;
51
+ readonly id: Schema.brand<Schema.String, "InputId">;
52
+ readonly value: Schema.Codec<U, unknown, never, never>;
53
+ }>>;
54
+ readonly streamId: Schema.NullOr<Schema.brand<Schema.String, "StreamId">>;
55
+ readonly lastSeq: Schema.Number;
56
+ }>;
57
+ type Config<I, U, A, P extends Payloads = Untyped> = {
58
+ /** The user entry for an input; `None` for inputs without one (approvals). */
59
+ readonly toUser: (input: I) => Option.Option<U>;
60
+ /** The assistant entry a finished run settles into. */
61
+ readonly settle: (run: RunView<P>) => A;
62
+ /** Decodes an `input-accepted` echo into an input; without it, echoes are ignored. */
63
+ readonly decodeInput?: (value: unknown) => Option.Option<I>;
64
+ /**
65
+ * Applies a tool event to a settled entry that holds the call (`None` if it
66
+ * doesn't). An approved call's result arrives in the next run; with this,
67
+ * it updates the card it was asked from. Without it, it lands in the new run.
68
+ */
69
+ readonly updateTool?: (entry: A, event: ToolUpdate<P>) => Option.Option<A>;
70
+ };
71
+ type Fold<I, U, A, P extends Payloads = Untyped> = {
72
+ readonly initial: State<U, A, P>;
73
+ readonly step: (state: State<U, A, P>, envelope: Envelope<P>) => State<U, A, P>;
74
+ /** Optimistic: show the input before the server answers. */
75
+ readonly submitted: (state: State<U, A, P>, input: I) => State<U, A, P>;
76
+ /** Settle the active run when its stream ends without a terminal. */
77
+ readonly ended: (state: State<U, A, P>, reason: "stopped" | "disconnected") => State<U, A, P>;
78
+ };
79
+ /** Whether the state already shows the input `id` (settled or pending). */
80
+ declare const hasInput: <U, A, P extends Payloads>(state: State<U, A, P>, id: InputId) => boolean;
81
+ /** Drop everything after the entry `id` (regenerate, edit). */
82
+ declare const truncateAfter: <U, A, P extends Payloads>(state: State<U, A, P>, id: string) => State<U, A, P>;
83
+ declare function make<I extends {
84
+ readonly id: InputId;
85
+ }, U, A, P extends Payloads = Untyped>(config: Config<I, U, A, P>): Fold<I, U, A, P>;
86
+ /** A user entry's value in the preset: the messages the input carried. */
87
+ declare const UserContent: Schema.Struct<{
88
+ readonly messages: Schema.$Array<Schema.Struct<{
89
+ readonly type: Schema.Literal<"message">;
90
+ readonly role: Schema.Literal<"user">;
91
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
92
+ readonly type: Schema.Literal<"input_text">;
93
+ readonly text: Schema.String;
94
+ }>, Schema.Struct<{
95
+ readonly type: Schema.Literal<"input_image">;
96
+ readonly source: Schema.Codec<import("@effect-uai/core/Image").ImageSource, import("@effect-uai/core/Image").ImageSource, never, never>;
97
+ }>]>>;
98
+ }>>;
99
+ }>;
100
+ type UserContent = typeof UserContent.Type;
101
+ declare const Thread: Schema.Struct<{
102
+ readonly messages: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
103
+ readonly role: Schema.Literal<"user">;
104
+ readonly id: Schema.brand<Schema.String, "InputId">;
105
+ readonly value: Schema.Codec<{
106
+ readonly messages: readonly {
107
+ readonly type: "message";
108
+ readonly role: "user";
109
+ readonly content: readonly ({
110
+ readonly type: "input_text";
111
+ readonly text: string;
112
+ } | {
113
+ readonly type: "input_image";
114
+ readonly source: import("@effect-uai/core/Image").ImageSource;
115
+ })[];
116
+ }[];
117
+ }, unknown, never, never>;
118
+ }>, Schema.Struct<{
119
+ readonly role: Schema.Literal<"assistant">;
120
+ readonly id: Schema.String;
121
+ readonly value: Schema.Codec<{
122
+ readonly runId?: string & import("effect/Brand").Brand<"RunId">;
123
+ readonly name?: string;
124
+ readonly inputs: readonly (string & import("effect/Brand").Brand<"InputId">)[];
125
+ readonly status: "completed" | "failed" | "idle" | "interrupted" | "stopped" | "streaming" | "submitted";
126
+ readonly blocks: readonly ({
127
+ readonly type: "output_text";
128
+ readonly text: string;
129
+ readonly annotations?: readonly ({
130
+ readonly type: "url_citation";
131
+ readonly url: string;
132
+ readonly title: string;
133
+ readonly start_index?: number | undefined;
134
+ readonly end_index?: number | undefined;
135
+ readonly cited_text?: string | undefined;
136
+ readonly marker?: number | undefined;
137
+ } | {
138
+ readonly type: "file_citation";
139
+ readonly file_id: string;
140
+ readonly index: number;
141
+ } | {
142
+ readonly type: "container_file_citation";
143
+ readonly container_id: string;
144
+ readonly file_id: string;
145
+ readonly start_index: number;
146
+ readonly end_index: number;
147
+ } | {
148
+ readonly type: "file_path";
149
+ readonly file_id: string;
150
+ readonly index: number;
151
+ })[] | undefined;
152
+ readonly id: string;
153
+ } | {
154
+ readonly type: "refusal";
155
+ readonly text: string;
156
+ readonly id: string;
157
+ } | {
158
+ readonly type: "output_image";
159
+ readonly source: import("@effect-uai/core/Image").ImageSource;
160
+ readonly id: string;
161
+ readonly partialIndex?: number;
162
+ } | {
163
+ readonly type: "reasoning";
164
+ readonly id: string;
165
+ readonly text: string;
166
+ } | {
167
+ readonly type: "tool";
168
+ readonly id: string;
169
+ readonly name: string;
170
+ readonly status: "awaiting-approval" | "done" | "failed" | "input-streaming" | "ready" | "running";
171
+ readonly input?: Schema.Json;
172
+ readonly argsText?: string;
173
+ readonly partial?: Schema.Json;
174
+ readonly outcome?: {
175
+ readonly _tag: "Success";
176
+ readonly value: Schema.Json;
177
+ } | {
178
+ readonly _tag: "Failure";
179
+ readonly error: Schema.Json;
180
+ };
181
+ } | {
182
+ readonly type: "object";
183
+ readonly id: string;
184
+ readonly name: string;
185
+ readonly status: "done" | "failed" | "streaming";
186
+ readonly partial?: Schema.Json;
187
+ readonly value?: Schema.Json;
188
+ readonly issues?: readonly Schema.Json[];
189
+ } | {
190
+ readonly type: "object";
191
+ readonly id: string;
192
+ readonly status: "done" | "failed" | "streaming";
193
+ readonly partial?: Schema.Json;
194
+ readonly value?: Schema.Json;
195
+ readonly issues?: readonly Schema.Json[];
196
+ } | {
197
+ readonly type: "data";
198
+ readonly id: string;
199
+ readonly name: string;
200
+ readonly value: Schema.Json;
201
+ })[];
202
+ readonly interrupts: readonly {
203
+ readonly callId: string;
204
+ readonly reason: "approval";
205
+ readonly name: string;
206
+ readonly input: Schema.Json;
207
+ }[];
208
+ readonly live: {
209
+ readonly [x: string]: Schema.Json;
210
+ };
211
+ readonly usage?: {
212
+ readonly input_tokens?: number | undefined;
213
+ readonly output_tokens?: number | undefined;
214
+ readonly total_tokens?: number | undefined;
215
+ readonly input_tokens_details?: {
216
+ readonly cached_tokens?: number | undefined;
217
+ readonly cache_write_tokens?: number | undefined;
218
+ } | undefined;
219
+ readonly output_tokens_details?: {
220
+ readonly reasoning_tokens?: number | undefined;
221
+ } | undefined;
222
+ };
223
+ readonly metadata?: Schema.Json;
224
+ readonly error?: {
225
+ readonly reason: string;
226
+ readonly message?: string;
227
+ };
228
+ readonly lastSeq: number;
229
+ readonly stepStart: number;
230
+ readonly nextBlock: number;
231
+ }, unknown, never, never>;
232
+ }>]>>;
233
+ readonly active: Schema.NullOr<Schema.Codec<{
234
+ readonly runId?: string & import("effect/Brand").Brand<"RunId">;
235
+ readonly name?: string;
236
+ readonly inputs: readonly (string & import("effect/Brand").Brand<"InputId">)[];
237
+ readonly status: "completed" | "failed" | "idle" | "interrupted" | "stopped" | "streaming" | "submitted";
238
+ readonly blocks: readonly ({
239
+ readonly type: "output_text";
240
+ readonly text: string;
241
+ readonly annotations?: readonly ({
242
+ readonly type: "url_citation";
243
+ readonly url: string;
244
+ readonly title: string;
245
+ readonly start_index?: number | undefined;
246
+ readonly end_index?: number | undefined;
247
+ readonly cited_text?: string | undefined;
248
+ readonly marker?: number | undefined;
249
+ } | {
250
+ readonly type: "file_citation";
251
+ readonly file_id: string;
252
+ readonly index: number;
253
+ } | {
254
+ readonly type: "container_file_citation";
255
+ readonly container_id: string;
256
+ readonly file_id: string;
257
+ readonly start_index: number;
258
+ readonly end_index: number;
259
+ } | {
260
+ readonly type: "file_path";
261
+ readonly file_id: string;
262
+ readonly index: number;
263
+ })[] | undefined;
264
+ readonly id: string;
265
+ } | {
266
+ readonly type: "refusal";
267
+ readonly text: string;
268
+ readonly id: string;
269
+ } | {
270
+ readonly type: "output_image";
271
+ readonly source: import("@effect-uai/core/Image").ImageSource;
272
+ readonly id: string;
273
+ readonly partialIndex?: number;
274
+ } | {
275
+ readonly type: "reasoning";
276
+ readonly id: string;
277
+ readonly text: string;
278
+ } | {
279
+ readonly type: "tool";
280
+ readonly id: string;
281
+ readonly name: string;
282
+ readonly status: "awaiting-approval" | "done" | "failed" | "input-streaming" | "ready" | "running";
283
+ readonly input?: Schema.Json;
284
+ readonly argsText?: string;
285
+ readonly partial?: Schema.Json;
286
+ readonly outcome?: {
287
+ readonly _tag: "Success";
288
+ readonly value: Schema.Json;
289
+ } | {
290
+ readonly _tag: "Failure";
291
+ readonly error: Schema.Json;
292
+ };
293
+ } | {
294
+ readonly type: "object";
295
+ readonly id: string;
296
+ readonly name: string;
297
+ readonly status: "done" | "failed" | "streaming";
298
+ readonly partial?: Schema.Json;
299
+ readonly value?: Schema.Json;
300
+ readonly issues?: readonly Schema.Json[];
301
+ } | {
302
+ readonly type: "object";
303
+ readonly id: string;
304
+ readonly status: "done" | "failed" | "streaming";
305
+ readonly partial?: Schema.Json;
306
+ readonly value?: Schema.Json;
307
+ readonly issues?: readonly Schema.Json[];
308
+ } | {
309
+ readonly type: "data";
310
+ readonly id: string;
311
+ readonly name: string;
312
+ readonly value: Schema.Json;
313
+ })[];
314
+ readonly interrupts: readonly {
315
+ readonly callId: string;
316
+ readonly reason: "approval";
317
+ readonly name: string;
318
+ readonly input: Schema.Json;
319
+ }[];
320
+ readonly live: {
321
+ readonly [x: string]: Schema.Json;
322
+ };
323
+ readonly usage?: {
324
+ readonly input_tokens?: number | undefined;
325
+ readonly output_tokens?: number | undefined;
326
+ readonly total_tokens?: number | undefined;
327
+ readonly input_tokens_details?: {
328
+ readonly cached_tokens?: number | undefined;
329
+ readonly cache_write_tokens?: number | undefined;
330
+ } | undefined;
331
+ readonly output_tokens_details?: {
332
+ readonly reasoning_tokens?: number | undefined;
333
+ } | undefined;
334
+ };
335
+ readonly metadata?: Schema.Json;
336
+ readonly error?: {
337
+ readonly reason: string;
338
+ readonly message?: string;
339
+ };
340
+ readonly lastSeq: number;
341
+ readonly stepStart: number;
342
+ readonly nextBlock: number;
343
+ }, unknown, never, never>>;
344
+ readonly pending: Schema.$Array<Schema.Struct<{
345
+ readonly role: Schema.Literal<"user">;
346
+ readonly id: Schema.brand<Schema.String, "InputId">;
347
+ readonly value: Schema.Codec<{
348
+ readonly messages: readonly {
349
+ readonly type: "message";
350
+ readonly role: "user";
351
+ readonly content: readonly ({
352
+ readonly type: "input_text";
353
+ readonly text: string;
354
+ } | {
355
+ readonly type: "input_image";
356
+ readonly source: import("@effect-uai/core/Image").ImageSource;
357
+ })[];
358
+ }[];
359
+ }, unknown, never, never>;
360
+ }>>;
361
+ readonly streamId: Schema.NullOr<Schema.brand<Schema.String, "StreamId">>;
362
+ readonly lastSeq: Schema.Number;
363
+ }>;
364
+ /** The preset's state; with a contract's `P`, runs carry decoded payloads. */
365
+ type Thread<P extends Payloads = Untyped> = State<UserContent, RunView<P>, P>;
366
+ type Message<P extends Payloads = Untyped> = Entry<UserContent, RunView<P>>;
367
+ /** Inputs the preset understands: any with an id; those with messages get a user entry. */
368
+ type PresetInput = {
369
+ readonly id: InputId;
370
+ readonly messages?: ReadonlyArray<UserMessage>;
371
+ };
372
+ /** The preset's fold for a contract's `P` (`UiContract` and `Atoms` use it). */
373
+ declare const presetFor: <P extends Payloads = Untyped>() => Fold<PresetInput, UserContent, RunView<P>, P>;
374
+ declare const preset: Fold<PresetInput, {
375
+ readonly messages: readonly {
376
+ readonly type: "message";
377
+ readonly role: "user";
378
+ readonly content: readonly ({
379
+ readonly type: "input_text";
380
+ readonly text: string;
381
+ } | {
382
+ readonly type: "input_image";
383
+ readonly source: import("@effect-uai/core/Image").ImageSource;
384
+ })[];
385
+ }[];
386
+ }, RunView<Untyped>, Untyped>;
387
+ declare const initial: State<{
388
+ readonly messages: readonly {
389
+ readonly type: "message";
390
+ readonly role: "user";
391
+ readonly content: readonly ({
392
+ readonly type: "input_text";
393
+ readonly text: string;
394
+ } | {
395
+ readonly type: "input_image";
396
+ readonly source: import("@effect-uai/core/Image").ImageSource;
397
+ })[];
398
+ }[];
399
+ }, RunView<Untyped>, Untyped>, step: (state: State<{
400
+ readonly messages: readonly {
401
+ readonly type: "message";
402
+ readonly role: "user";
403
+ readonly content: readonly ({
404
+ readonly type: "input_text";
405
+ readonly text: string;
406
+ } | {
407
+ readonly type: "input_image";
408
+ readonly source: import("@effect-uai/core/Image").ImageSource;
409
+ })[];
410
+ }[];
411
+ }, RunView<Untyped>, Untyped>, envelope: Envelope<Untyped>) => State<{
412
+ readonly messages: readonly {
413
+ readonly type: "message";
414
+ readonly role: "user";
415
+ readonly content: readonly ({
416
+ readonly type: "input_text";
417
+ readonly text: string;
418
+ } | {
419
+ readonly type: "input_image";
420
+ readonly source: import("@effect-uai/core/Image").ImageSource;
421
+ })[];
422
+ }[];
423
+ }, RunView<Untyped>, Untyped>, submitted: (state: State<{
424
+ readonly messages: readonly {
425
+ readonly type: "message";
426
+ readonly role: "user";
427
+ readonly content: readonly ({
428
+ readonly type: "input_text";
429
+ readonly text: string;
430
+ } | {
431
+ readonly type: "input_image";
432
+ readonly source: import("@effect-uai/core/Image").ImageSource;
433
+ })[];
434
+ }[];
435
+ }, RunView<Untyped>, Untyped>, input: PresetInput) => State<{
436
+ readonly messages: readonly {
437
+ readonly type: "message";
438
+ readonly role: "user";
439
+ readonly content: readonly ({
440
+ readonly type: "input_text";
441
+ readonly text: string;
442
+ } | {
443
+ readonly type: "input_image";
444
+ readonly source: import("@effect-uai/core/Image").ImageSource;
445
+ })[];
446
+ }[];
447
+ }, RunView<Untyped>, Untyped>, ended: (state: State<{
448
+ readonly messages: readonly {
449
+ readonly type: "message";
450
+ readonly role: "user";
451
+ readonly content: readonly ({
452
+ readonly type: "input_text";
453
+ readonly text: string;
454
+ } | {
455
+ readonly type: "input_image";
456
+ readonly source: import("@effect-uai/core/Image").ImageSource;
457
+ })[];
458
+ }[];
459
+ }, RunView<Untyped>, Untyped>, reason: "stopped" | "disconnected") => State<{
460
+ readonly messages: readonly {
461
+ readonly type: "message";
462
+ readonly role: "user";
463
+ readonly content: readonly ({
464
+ readonly type: "input_text";
465
+ readonly text: string;
466
+ } | {
467
+ readonly type: "input_image";
468
+ readonly source: import("@effect-uai/core/Image").ImageSource;
469
+ })[];
470
+ }[];
471
+ }, RunView<Untyped>, Untyped>;
472
+ //#endregion
473
+ export { presetFor as _, Message as a, truncateAfter as b, Thread as c, UserEntry as d, ended as f, preset as g, make as h, Fold as i, Thread_d_exports as l, initial as m, Config as n, PresetInput as o, hasInput as p, Entry as r, State as s, AssistantEntry as t, UserContent as u, step as v, submitted as y };
474
+ //# sourceMappingURL=Thread-CAXsjhpX.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Thread-CAXsjhpX.d.mts","names":[],"sources":["../src/Thread.ts"],"mappings":";;;;;;;KAuBY,UAAU;WAAgB;WAAuB,IAAI;WAAkB,OAAO;;KAC9E,eAAe;WAChB;WACA;WACA,OAAO;;KAEN,MAAM,GAAG,KAAK,UAAU,KAAK,eAAe;;KAG5C,MAAM,GAAG,GAAG,UAAU,WAAW;WAClC,UAAU,cAAc,MAAM,GAAG;;WAEjC,QAAQ,QAAgB;;;;;WAKxB,SAAS,cAAc,UAAU;;WAEjC,UAAU;;WAEV;;;;;;cAOE,QAAS,GAAG,GAAG,GAAC,MACrB,OAAO,MAAM,2BAAyB,WACjC,OAAO,MAAM,2BAAyB,MAC3C,OAAO,MAAM,8BAAyB,OAAA;;;;;;;;;;;;;;;;;;;KAiBlC,OAAO,GAAG,GAAG,GAAG,UAAU,WAAW;;WAEtC,SAAS,OAAO,MAAM,OAAO,OAAO;;WAEpC,SAAS,KAAK,QAAgB,OAAO;;WAErC,eAAe,mBAAmB,OAAO,OAAO;;;;;;WAMhD,cAAc,OAAO,GAAG,OAAO,WAAmB,OAAO,OAAO,OAAO;;KAGtE,KAAK,GAAG,GAAG,GAAG,UAAU,WAAW;WACpC,SAAS,MAAM,GAAG,GAAG;WACrB,OAAO,OAAO,MAAM,GAAG,GAAG,IAAI,UAAU,SAAS,OAAO,MAAM,GAAG,GAAG;;WAEpE,YAAY,OAAO,MAAM,GAAG,GAAG,IAAI,OAAO,MAAM,MAAM,GAAG,GAAG;;WAE5D,QAAQ,OAAO,MAAM,GAAG,GAAG,IAAI,uCAAuC,MAAM,GAAG,GAAG;;;cAIhF,WAAY,GAAG,GAAG,UAAU,UAAQ,OAAS,MAAM,GAAG,GAAG,IAAE,IAAM;;cAKjE,gBAAiB,GAAG,GAAG,UAAU,UAAQ,OAC7C,MAAM,GAAG,GAAG,IAAE,eAEpB,MAAM,GAAG,GAAG;iBAQC,KAAK;WAAqB,IAAI;GAAW,GAAG,GAAG,UAAU,WAAW,SAClF,QAAQ,OAAO,GAAG,GAAG,GAAG,KACvB,KAAK,GAAG,GAAG,GAAG;;cA4IJ,aAAW,OAAA;;;;;;;;;;;;;KACZ,qBAAqB,YAAY;cAEhC,QAAM,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEP,OAAO,UAAU,WAAW,WAAW,MAAM,aAAa,QAAgB,IAAI;KAC9E,QAAQ,UAAU,WAAW,WAAW,MAAM,aAAa,QAAgB;;KAG3E;WACD,IAAI;WACJ,WAAW,cAAc;;;cAIvB,YAAa,UAAU,WAAW,cAAY,KACzD,aACA,aACA,QAAgB,IAChB;cAUW,QAAM,KAAA;;;;;;;;;;;;GAAc,QAAA,UAAA;cAElB,SAAO;;;;;;;;;;;;GAAE,QAAA,UAAA,UAAA,OAAI,OAAA;;;;;;;;;;;;;;;;;;;;;;;;GAAE,QAAA,UAAA,UAAA,YAAS,OAAA;;;;;;;;;;;;;;;;;;;;;;;;GAAE,QAAA,UAAA,UAAA,QAAK,OAAA;;;;;;;;;;;;GAjMI,QAAA,UAAA,UAAA,uCAA0B;;;;;;;;;;;;GAiMnB,QAAA,UAAA"}
@@ -0,0 +1,2 @@
1
+ import { _ as presetFor, a as Message, b as truncateAfter, c as Thread, d as UserEntry, f as ended, g as preset, h as make, i as Fold, m as initial, n as Config, o as PresetInput, p as hasInput, r as Entry, s as State, t as AssistantEntry, u as UserContent, v as step, y as submitted } from "./Thread-CAXsjhpX.mjs";
2
+ export { AssistantEntry, Config, Entry, Fold, Message, PresetInput, State, Thread, UserContent, UserEntry, ended, hasInput, initial, make, preset, presetFor, step, submitted, truncateAfter };