@taskyon/tyclient 0.5.1 → 0.5.2

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.
@@ -1,8 +1,9 @@
1
1
  import * as json_schema from 'json-schema';
2
2
  import { JSONSchema7 } from 'json-schema';
3
+ import { streamText } from 'ai';
3
4
  import { JSONSchema, FromSchema } from 'json-schema-to-ts';
5
+ import { PartialDeep, ReadonlyDeep } from 'type-fest';
4
6
  import z, { z as z$1 } from 'zod';
5
- import { PartialDeep } from 'type-fest';
6
7
  import { PGliteWorker } from '@electric-sql/pglite/worker';
7
8
  import { LiveNamespace } from '@electric-sql/pglite/live';
8
9
 
@@ -45,6 +46,61 @@ type WithRequired<T, K extends keyof T> = Omit<T, K> & {
45
46
  */
46
47
  type Thunk<T> = () => T;
47
48
 
49
+ declare const TaskContent: z.ZodUnion<readonly [z.ZodObject<{
50
+ type: z.ZodLiteral<"message">;
51
+ data: z.ZodString;
52
+ ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
53
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
54
+ id: z.ZodOptional<z.ZodString>;
55
+ end_index: z.ZodOptional<z.ZodNumber>;
56
+ start_index: z.ZodOptional<z.ZodNumber>;
57
+ title: z.ZodOptional<z.ZodString>;
58
+ url: z.ZodOptional<z.ZodString>;
59
+ content: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$strip>, z.ZodObject<{
61
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
62
+ text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
63
+ content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
64
+ }, z.core.$strip>]>>>;
65
+ }, z.core.$strict>, z.ZodObject<{
66
+ type: z.ZodLiteral<"toolresult">;
67
+ data: z.ZodUnknown;
68
+ }, z.core.$strict>, z.ZodObject<{
69
+ type: z.ZodLiteral<"tooldefinition">;
70
+ data: z.ZodObject<{
71
+ description: z.ZodString;
72
+ longDescription: z.ZodOptional<z.ZodString>;
73
+ name: z.ZodString;
74
+ renderOptions: z.ZodOptional<z.ZodObject<{
75
+ hideChat: z.ZodOptional<z.ZodBoolean>;
76
+ hideLlm: z.ZodOptional<z.ZodBoolean>;
77
+ }, z.core.$strip>>;
78
+ parameters: z.ZodReadonly<z.ZodType<json_schema.JSONSchema7, unknown, z.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
79
+ code: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strip>;
81
+ }, z.core.$strict>, z.ZodObject<{
82
+ type: z.ZodLiteral<"error">;
83
+ data: z.ZodUnknown;
84
+ }, z.core.$strict>, z.ZodObject<{
85
+ type: z.ZodLiteral<"structured">;
86
+ data: z.ZodUnknown;
87
+ }, z.core.$strict>, z.ZodObject<{
88
+ type: z.ZodLiteral<"functioncall">;
89
+ data: z.ZodObject<{
90
+ name: z.ZodString;
91
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown>, z.ZodNull, z.ZodUndefined]>>;
92
+ }, z.core.$strip>;
93
+ }, z.core.$strict>, z.ZodObject<{
94
+ type: z.ZodLiteral<"files">;
95
+ data: z.ZodArray<z.ZodString>;
96
+ }, z.core.$strict>, z.ZodObject<{
97
+ type: z.ZodLiteral<"return">;
98
+ data: z.ZodString;
99
+ }, z.core.$strict>]>;
100
+ type TaskContent = z.infer<typeof TaskContent>;
101
+ type TaskContentType = TaskContent extends {
102
+ type: infer T;
103
+ } ? T : never;
48
104
  declare const TaskNode: z.ZodObject<{
49
105
  role: z.ZodEnum<{
50
106
  function: "function";
@@ -57,20 +113,17 @@ declare const TaskNode: z.ZodObject<{
57
113
  type: z.ZodLiteral<"message">;
58
114
  data: z.ZodString;
59
115
  ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
60
- type: z.ZodLiteral<"url_citation">;
61
- url_citation: z.ZodOptional<z.ZodObject<{
62
- end_index: z.ZodOptional<z.ZodNumber>;
63
- start_index: z.ZodOptional<z.ZodNumber>;
64
- title: z.ZodOptional<z.ZodString>;
65
- url: z.ZodOptional<z.ZodString>;
66
- content: z.ZodOptional<z.ZodString>;
67
- }, z.core.$strip>>;
116
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
117
+ id: z.ZodOptional<z.ZodString>;
118
+ end_index: z.ZodOptional<z.ZodNumber>;
119
+ start_index: z.ZodOptional<z.ZodNumber>;
120
+ title: z.ZodOptional<z.ZodString>;
121
+ url: z.ZodOptional<z.ZodString>;
122
+ content: z.ZodOptional<z.ZodString>;
68
123
  }, z.core.$strip>, z.ZodObject<{
69
- type: z.ZodLiteral<"file">;
70
- content: z.ZodOptional<z.ZodArray<z.ZodObject<{
71
- text: z.ZodString;
72
- type: z.ZodString;
73
- }, z.core.$strip>>>;
124
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
125
+ text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
126
+ content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
74
127
  }, z.core.$strip>]>>>;
75
128
  }, z.core.$strict>, z.ZodObject<{
76
129
  type: z.ZodLiteral<"toolresult">;
@@ -129,20 +182,17 @@ declare const partialTaskDraft: z.ZodObject<{
129
182
  type: z.ZodLiteral<"message">;
130
183
  data: z.ZodString;
131
184
  ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
132
- type: z.ZodLiteral<"url_citation">;
133
- url_citation: z.ZodOptional<z.ZodObject<{
134
- end_index: z.ZodOptional<z.ZodNumber>;
135
- start_index: z.ZodOptional<z.ZodNumber>;
136
- title: z.ZodOptional<z.ZodString>;
137
- url: z.ZodOptional<z.ZodString>;
138
- content: z.ZodOptional<z.ZodString>;
139
- }, z.core.$strip>>;
185
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
186
+ id: z.ZodOptional<z.ZodString>;
187
+ end_index: z.ZodOptional<z.ZodNumber>;
188
+ start_index: z.ZodOptional<z.ZodNumber>;
189
+ title: z.ZodOptional<z.ZodString>;
190
+ url: z.ZodOptional<z.ZodString>;
191
+ content: z.ZodOptional<z.ZodString>;
140
192
  }, z.core.$strip>, z.ZodObject<{
141
- type: z.ZodLiteral<"file">;
142
- content: z.ZodOptional<z.ZodArray<z.ZodObject<{
143
- text: z.ZodString;
144
- type: z.ZodString;
145
- }, z.core.$strip>>>;
193
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
194
+ text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
195
+ content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
146
196
  }, z.core.$strip>]>>>;
147
197
  }, z.core.$strict>, z.ZodObject<{
148
198
  type: z.ZodLiteral<"toolresult">;
@@ -267,7 +317,9 @@ declare const InternalTool: z.ZodObject<{
267
317
  }, z.core.$strip>;
268
318
  type InternalTool = z.infer<typeof InternalTool>;
269
319
  type ClientTool = WithRequired<InternalTool, 'function'>;
270
- declare function createTool<T, SCHEMA extends Readonly<JSONSchema>, PARAMS = FromSchema<SCHEMA>>(tool: T & {
320
+ declare function createTool<T, SCHEMA extends Readonly<JSONSchema>, PARAMS = FromSchema<SCHEMA, {
321
+ keepDefaultedPropertiesOptional: true;
322
+ }>>(tool: T & {
271
323
  parameters: SCHEMA;
272
324
  function?: (params: PARAMS, context: toolContext) => unknown;
273
325
  } & Omit<InternalTool, 'function' | 'parameters'>): T;
@@ -293,20 +345,17 @@ declare const taskResult: z.ZodObject<{
293
345
  type: z.ZodLiteral<"message">;
294
346
  data: z.ZodString;
295
347
  ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
296
- type: z.ZodLiteral<"url_citation">;
297
- url_citation: z.ZodOptional<z.ZodObject<{
298
- end_index: z.ZodOptional<z.ZodNumber>;
299
- start_index: z.ZodOptional<z.ZodNumber>;
300
- title: z.ZodOptional<z.ZodString>;
301
- url: z.ZodOptional<z.ZodString>;
302
- content: z.ZodOptional<z.ZodString>;
303
- }, z.core.$strip>>;
348
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
349
+ id: z.ZodOptional<z.ZodString>;
350
+ end_index: z.ZodOptional<z.ZodNumber>;
351
+ start_index: z.ZodOptional<z.ZodNumber>;
352
+ title: z.ZodOptional<z.ZodString>;
353
+ url: z.ZodOptional<z.ZodString>;
354
+ content: z.ZodOptional<z.ZodString>;
304
355
  }, z.core.$strip>, z.ZodObject<{
305
- type: z.ZodLiteral<"file">;
306
- content: z.ZodOptional<z.ZodArray<z.ZodObject<{
307
- text: z.ZodString;
308
- type: z.ZodString;
309
- }, z.core.$strip>>>;
356
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
357
+ text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
358
+ content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
310
359
  }, z.core.$strip>]>>>;
311
360
  }, z.core.$strict>, z.ZodObject<{
312
361
  type: z.ZodLiteral<"toolresult">;
@@ -371,20 +420,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
371
420
  type: "message";
372
421
  data: string;
373
422
  ann?: ({
374
- type: "url_citation";
375
- url_citation?: {
376
- end_index?: number | undefined;
377
- start_index?: number | undefined;
378
- title?: string | undefined;
379
- url?: string | undefined;
380
- content?: string | undefined;
381
- } | undefined;
423
+ type: "url";
424
+ id?: string | undefined;
425
+ end_index?: number | undefined;
426
+ start_index?: number | undefined;
427
+ title?: string | undefined;
428
+ url?: string | undefined;
429
+ content?: string | undefined;
382
430
  } | {
383
- type: "file";
384
- content?: {
385
- text: string;
386
- type: string;
387
- }[] | undefined;
431
+ type: "document";
432
+ text?: string | undefined;
433
+ content?: string | undefined;
388
434
  })[] | undefined;
389
435
  } | {
390
436
  type: "toolresult";
@@ -439,20 +485,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
439
485
  type: "message";
440
486
  data: string;
441
487
  ann?: ({
442
- type: "url_citation";
443
- url_citation?: {
444
- end_index?: number | undefined;
445
- start_index?: number | undefined;
446
- title?: string | undefined;
447
- url?: string | undefined;
448
- content?: string | undefined;
449
- } | undefined;
488
+ type: "url";
489
+ id?: string | undefined;
490
+ end_index?: number | undefined;
491
+ start_index?: number | undefined;
492
+ title?: string | undefined;
493
+ url?: string | undefined;
494
+ content?: string | undefined;
450
495
  } | {
451
- type: "file";
452
- content?: {
453
- text: string;
454
- type: string;
455
- }[] | undefined;
496
+ type: "document";
497
+ text?: string | undefined;
498
+ content?: string | undefined;
456
499
  })[] | undefined;
457
500
  } | {
458
501
  type: "toolresult";
@@ -505,20 +548,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
505
548
  type: "message";
506
549
  data: string;
507
550
  ann?: ({
508
- type: "url_citation";
509
- url_citation?: {
510
- end_index?: number | undefined;
511
- start_index?: number | undefined;
512
- title?: string | undefined;
513
- url?: string | undefined;
514
- content?: string | undefined;
515
- } | undefined;
551
+ type: "url";
552
+ id?: string | undefined;
553
+ end_index?: number | undefined;
554
+ start_index?: number | undefined;
555
+ title?: string | undefined;
556
+ url?: string | undefined;
557
+ content?: string | undefined;
516
558
  } | {
517
- type: "file";
518
- content?: {
519
- text: string;
520
- type: string;
521
- }[] | undefined;
559
+ type: "document";
560
+ text?: string | undefined;
561
+ content?: string | undefined;
522
562
  })[] | undefined;
523
563
  } | {
524
564
  type: "toolresult";
@@ -573,6 +613,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
573
613
  taskTokens?: number | undefined;
574
614
  name?: string | undefined;
575
615
  summary?: string | undefined;
616
+ reasoning?: string | undefined;
576
617
  estimatedTokens?: {
577
618
  resultTokens?: number | undefined;
578
619
  taskCosts?: number | undefined;
@@ -585,7 +626,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
585
626
  taskCosts?: number | undefined;
586
627
  rawOutput?: unknown;
587
628
  error?: unknown;
588
- taskPrompt?: Record<string, unknown> | undefined;
629
+ taskPrompt?: Record<string, unknown>[] | undefined;
589
630
  tools?: unknown[] | undefined;
590
631
  } | null>;
591
632
  metaLiveRead: (id: string | number) => Stream<{
@@ -597,6 +638,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
597
638
  taskTokens?: number | undefined;
598
639
  name?: string | undefined;
599
640
  summary?: string | undefined;
641
+ reasoning?: string | undefined;
600
642
  estimatedTokens?: {
601
643
  resultTokens?: number | undefined;
602
644
  taskCosts?: number | undefined;
@@ -609,7 +651,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
609
651
  taskCosts?: number | undefined;
610
652
  rawOutput?: unknown;
611
653
  error?: unknown;
612
- taskPrompt?: Record<string, unknown> | undefined;
654
+ taskPrompt?: Record<string, unknown>[] | undefined;
613
655
  tools?: unknown[] | undefined;
614
656
  } | null;
615
657
  }>;
@@ -620,6 +662,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
620
662
  taskTokens?: number | undefined;
621
663
  name?: string | undefined;
622
664
  summary?: string | undefined;
665
+ reasoning?: string | undefined;
623
666
  estimatedTokens?: {
624
667
  resultTokens?: number | undefined;
625
668
  taskCosts?: number | undefined;
@@ -632,7 +675,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
632
675
  taskCosts?: number | undefined;
633
676
  rawOutput?: unknown;
634
677
  error?: unknown;
635
- taskPrompt?: Record<string, unknown> | undefined;
678
+ taskPrompt?: Record<string, unknown>[] | undefined;
636
679
  tools?: unknown[] | undefined;
637
680
  }, strategy?: "shallow_merge" | "replace" | "deepmerge" | "native_shallow") => Promise<{
638
681
  threadMessage?: any;
@@ -641,6 +684,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
641
684
  taskTokens?: number | undefined;
642
685
  name?: string | undefined;
643
686
  summary?: string | undefined;
687
+ reasoning?: string | undefined;
644
688
  estimatedTokens?: {
645
689
  resultTokens?: number | undefined;
646
690
  taskCosts?: number | undefined;
@@ -653,7 +697,7 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
653
697
  taskCosts?: number | undefined;
654
698
  rawOutput?: unknown;
655
699
  error?: unknown;
656
- taskPrompt?: Record<string, unknown> | undefined;
700
+ taskPrompt?: Record<string, unknown>[] | undefined;
657
701
  tools?: unknown[] | undefined;
658
702
  }>;
659
703
  addFiles: (newFiles: File[], storage: "memory" | "opfs") => Promise<string[]>;
@@ -691,20 +735,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
691
735
  type: "message";
692
736
  data: string;
693
737
  ann?: ({
694
- type: "url_citation";
695
- url_citation?: {
696
- end_index?: number | undefined;
697
- start_index?: number | undefined;
698
- title?: string | undefined;
699
- url?: string | undefined;
700
- content?: string | undefined;
701
- } | undefined;
738
+ type: "url";
739
+ id?: string | undefined;
740
+ end_index?: number | undefined;
741
+ start_index?: number | undefined;
742
+ title?: string | undefined;
743
+ url?: string | undefined;
744
+ content?: string | undefined;
702
745
  } | {
703
- type: "file";
704
- content?: {
705
- text: string;
706
- type: string;
707
- }[] | undefined;
746
+ type: "document";
747
+ text?: string | undefined;
748
+ content?: string | undefined;
708
749
  })[] | undefined;
709
750
  } | {
710
751
  type: "toolresult";
@@ -761,20 +802,17 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
761
802
  type: "message";
762
803
  data: string;
763
804
  ann?: ({
764
- type: "url_citation";
765
- url_citation?: {
766
- end_index?: number | undefined;
767
- start_index?: number | undefined;
768
- title?: string | undefined;
769
- url?: string | undefined;
770
- content?: string | undefined;
771
- } | undefined;
805
+ type: "url";
806
+ id?: string | undefined;
807
+ end_index?: number | undefined;
808
+ start_index?: number | undefined;
809
+ title?: string | undefined;
810
+ url?: string | undefined;
811
+ content?: string | undefined;
772
812
  } | {
773
- type: "file";
774
- content?: {
775
- text: string;
776
- type: string;
777
- }[] | undefined;
813
+ type: "document";
814
+ text?: string | undefined;
815
+ content?: string | undefined;
778
816
  })[] | undefined;
779
817
  } | {
780
818
  type: "toolresult";
@@ -851,58 +889,10 @@ declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string):
851
889
  }>;
852
890
  type TyTaskManager = Awaited<ReturnType<typeof useTyTaskManager>>;
853
891
 
854
- type ChatCompletionChunk = {
855
- id: string;
856
- object: 'chat.completion.chunk';
857
- created: number;
858
- model: string;
859
- system_fingerprint?: string;
860
- provider?: string;
861
- choices: Array<{
862
- index: number;
863
- delta: {
864
- role?: 'system' | 'user' | 'assistant' | 'tool' | 'developer';
865
- content?: string | null;
866
- refusal?: string | null;
867
- tool_calls?: Array<{
868
- index: number;
869
- id?: string;
870
- type?: 'function';
871
- function?: {
872
- name?: string;
873
- arguments?: string;
874
- };
875
- }>;
876
- reasoning?: string;
877
- reasoning_details?: Array<{
878
- type: string;
879
- text: string;
880
- format?: string;
881
- index?: number;
882
- }>;
883
- annotations?: Array<{
884
- type: 'url_citation';
885
- url_citation: {
886
- end_index?: number;
887
- start_index?: number;
888
- title: string;
889
- url: string;
890
- content: string;
891
- };
892
- }>;
893
- };
894
- finish_reason?: 'stop' | 'length' | 'content_filter' | 'tool_calls' | 'function_call' | null;
895
- native_finish_reason?: string | null;
896
- logprobs?: unknown;
897
- }>;
898
- };
899
-
900
892
  declare const llmSettings: z.ZodObject<{
901
893
  userId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
902
- allowWebSearch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
903
894
  secretPublicKey: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
904
895
  selectedTaskId: z.ZodOptional<z.ZodString>;
905
- enableOpenAiTools: z.ZodDefault<z.ZodBoolean>;
906
896
  selectedApi: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
907
897
  llmApis: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
908
898
  name: z.ZodString;
@@ -937,20 +927,17 @@ declare const llmSettings: z.ZodObject<{
937
927
  type: z.ZodLiteral<"message">;
938
928
  data: z.ZodString;
939
929
  ann: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
940
- type: z.ZodLiteral<"url_citation">;
941
- url_citation: z.ZodOptional<z.ZodObject<{
942
- end_index: z.ZodOptional<z.ZodNumber>;
943
- start_index: z.ZodOptional<z.ZodNumber>;
944
- title: z.ZodOptional<z.ZodString>;
945
- url: z.ZodOptional<z.ZodString>;
946
- content: z.ZodOptional<z.ZodString>;
947
- }, z.core.$strip>>;
930
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"url">>>;
931
+ id: z.ZodOptional<z.ZodString>;
932
+ end_index: z.ZodOptional<z.ZodNumber>;
933
+ start_index: z.ZodOptional<z.ZodNumber>;
934
+ title: z.ZodOptional<z.ZodString>;
935
+ url: z.ZodOptional<z.ZodString>;
936
+ content: z.ZodOptional<z.ZodString>;
948
937
  }, z.core.$strip>, z.ZodObject<{
949
- type: z.ZodLiteral<"file">;
950
- content: z.ZodOptional<z.ZodArray<z.ZodObject<{
951
- text: z.ZodString;
952
- type: z.ZodString;
953
- }, z.core.$strip>>>;
938
+ type: z.ZodNonOptional<z.ZodOptional<z.ZodLiteral<"document">>>;
939
+ text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
940
+ content: z.ZodOptional<z.ZodOptional<z.ZodString>>;
954
941
  }, z.core.$strip>]>>>;
955
942
  }, z.core.$strict>, z.ZodObject<{
956
943
  type: z.ZodLiteral<"toolresult">;
@@ -997,21 +984,16 @@ declare const llmSettings: z.ZodObject<{
997
984
  sig: z.ZodOptional<z.ZodOptional<z.ZodString>>;
998
985
  }, z.core.$strip>>;
999
986
  enableToolChooser: z.ZodDefault<z.ZodBoolean>;
1000
- useBasePrompt: z.ZodDefault<z.ZodBoolean>;
1001
- tryUsingVisionModels: z.ZodDefault<z.ZodBoolean>;
1002
- taskChatTemplates: z.ZodObject<{
1003
- basePrompt: z.ZodString;
1004
- instruction: z.ZodString;
1005
- toolResult: z.ZodString;
1006
- task: z.ZodString;
1007
- evaluate: z.ZodString;
1008
- schemaReminder: z.ZodString;
1009
- tools: z.ZodString;
1010
- }, z.core.$strip>;
1011
987
  }, z.core.$strip>;
1012
988
  type llmSettings = z.infer<typeof llmSettings>;
1013
989
 
1014
- declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskManager: TyTaskManager): Promise<{
990
+ type streamOptsType = Parameters<typeof streamText>[0];
991
+ type streamChunk = Parameters<Required<streamOptsType>['onChunk']>[0]['chunk'];
992
+ type chunkStreamType = {
993
+ taskId: string;
994
+ chunk: streamChunk;
995
+ };
996
+ declare function createChatCompletionTool(llmSettings: Thunk<ReadonlyDeep<llmSettings>>, taskManager: TyTaskManager): {
1015
997
  chatCompletion: {
1016
998
  description: string;
1017
999
  longDescription: string;
@@ -1034,7 +1016,9 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
1034
1016
  };
1035
1017
  readonly llmTools: {
1036
1018
  readonly type: "boolean";
1037
- readonly description: "Optional Parameter. If set to true, we will use a openai compatible tool api. If undefined, it will be treated as false.";
1019
+ readonly title: "Use LLM Native Tools";
1020
+ readonly description: "Optional Parameter. If set to true, we will use native tool apis offered by llm providers to generate tool calls in json format. If undefined, it will be treated as false.";
1021
+ readonly default: false;
1038
1022
  };
1039
1023
  readonly allowedTools: {
1040
1024
  readonly type: "array";
@@ -1056,8 +1040,15 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
1056
1040
  readonly additionalProperties: true;
1057
1041
  };
1058
1042
  readonly reasoning_effort: {
1059
- readonly enum: ["low", "high", "medium"];
1060
- readonly description: "How many reasoning tokens should models with reasonin capability use?";
1043
+ readonly enum: ["low", "high", "medium", "none"];
1044
+ readonly description: "How many reasoning tokens should models with reasoning capability use?";
1045
+ readonly title: "Reasoning Effort";
1046
+ };
1047
+ readonly max_results: {
1048
+ readonly type: "integer";
1049
+ readonly description: "[Optional] In case of a WebSearch, how many results should be retrieved at max?";
1050
+ readonly title: "Max Results";
1051
+ readonly default: 5;
1061
1052
  };
1062
1053
  readonly verbosity: {
1063
1054
  readonly type: "string";
@@ -1066,7 +1057,68 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
1066
1057
  };
1067
1058
  readonly use_multimodal: {
1068
1059
  readonly type: "boolean";
1069
- readonly description: "Allow models to use their vision/audio document undestanding capabilities if their are any files in the prompt.";
1060
+ readonly title: "Use Vision";
1061
+ readonly description: "Allow models to use their vision/audio & document undestanding capabilities if their are any files in the prompt.";
1062
+ };
1063
+ readonly use_baseprompt: {
1064
+ readonly type: "boolean";
1065
+ readonly title: "Fancy Output";
1066
+ readonly description: "Enable or disable the base prompt chat completion which makes output more fancy or enables customized behaviour.";
1067
+ };
1068
+ readonly context_size: {
1069
+ readonly type: "integer";
1070
+ readonly description: "[Optional] How many of the peceding tasks are going to be used for the chatCompletion?";
1071
+ };
1072
+ readonly prompt_templates: {
1073
+ readonly required: ["basePrompt", "instruction", "toolResult", "task", "evaluate", "schemaReminder", "tools"];
1074
+ readonly type: "object";
1075
+ readonly description: "These are the definitions of the prompts which are used in chats for different purposes.";
1076
+ readonly properties: {
1077
+ readonly basePrompt: {
1078
+ readonly type: "string";
1079
+ readonly description: "The base prompt. This should be used e.g. to set the behaviour of the AI. used as a \"system\" prompt.";
1080
+ };
1081
+ readonly instruction: {
1082
+ readonly type: "string";
1083
+ readonly description: "This prompt is used to make the AI follow instructions";
1084
+ };
1085
+ readonly toolResult: {
1086
+ readonly type: "string";
1087
+ readonly description: "This prompt is used to make the AI display tool results in a certain structured way.";
1088
+ };
1089
+ readonly task: {
1090
+ readonly type: "string";
1091
+ readonly description: "This prompt is used to explain to the AI what to do with a specific task.";
1092
+ };
1093
+ readonly evaluate: {
1094
+ readonly type: "string";
1095
+ readonly description: "This prompt is used to evaluate errors";
1096
+ };
1097
+ readonly schemaReminder: {
1098
+ readonly type: "string";
1099
+ readonly description: "This prompt is used to enforce a specific schema as a response...";
1100
+ };
1101
+ readonly tools: {
1102
+ readonly type: "string";
1103
+ readonly description: "This prompt is used to give the AI a list of tools.";
1104
+ };
1105
+ };
1106
+ };
1107
+ readonly timeouts: {
1108
+ readonly type: "object";
1109
+ readonly description: "[Optional] We can specify different timeouts for the chat completion.";
1110
+ readonly properties: {
1111
+ readonly totalMs: {
1112
+ readonly type: "integer";
1113
+ readonly description: "Total timeout in milliseconds for the entire chat completion process.";
1114
+ readonly default: number;
1115
+ };
1116
+ readonly stepMs: {
1117
+ readonly type: "integer";
1118
+ readonly description: "Timeout in milliseconds for each individual step when interacting with agents.";
1119
+ readonly default: number;
1120
+ };
1121
+ };
1070
1122
  };
1071
1123
  };
1072
1124
  };
@@ -1076,12 +1128,30 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
1076
1128
  [x: string]: unknown;
1077
1129
  };
1078
1130
  verbosity?: "high" | "medium" | "low";
1131
+ max_results?: number;
1079
1132
  goal?: "SimpleCompletion" | "AnalyzeError" | "ChooseTool" | "AnalyzeToolResult" | "WebSearch";
1080
1133
  llmTools?: boolean;
1081
1134
  allowedTools?: string[];
1082
1135
  prompts?: string[];
1083
- reasoning_effort?: "high" | "medium" | "low";
1136
+ reasoning_effort?: "none" | "high" | "medium" | "low";
1084
1137
  use_multimodal?: boolean;
1138
+ use_baseprompt?: boolean;
1139
+ context_size?: number;
1140
+ prompt_templates?: {
1141
+ [x: string]: unknown;
1142
+ task: string;
1143
+ instruction: string;
1144
+ tools: string;
1145
+ basePrompt: string;
1146
+ toolResult: string;
1147
+ evaluate: string;
1148
+ schemaReminder: string;
1149
+ };
1150
+ timeouts?: {
1151
+ [x: string]: unknown;
1152
+ totalMs?: number;
1153
+ stepMs?: number;
1154
+ };
1085
1155
  }, context: toolContext) => Promise<{
1086
1156
  taskResultMarker: "*TY_TASKRESULT*";
1087
1157
  taskChainList: {
@@ -1090,20 +1160,17 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
1090
1160
  type: "message";
1091
1161
  data: string;
1092
1162
  ann?: ({
1093
- type: "url_citation";
1094
- url_citation?: {
1095
- end_index?: number | undefined;
1096
- start_index?: number | undefined;
1097
- title?: string | undefined;
1098
- url?: string | undefined;
1099
- content?: string | undefined;
1100
- } | undefined;
1163
+ type: "url";
1164
+ id?: string | undefined;
1165
+ end_index?: number | undefined;
1166
+ start_index?: number | undefined;
1167
+ title?: string | undefined;
1168
+ url?: string | undefined;
1169
+ content?: string | undefined;
1101
1170
  } | {
1102
- type: "file";
1103
- content?: {
1104
- text: string;
1105
- type: string;
1106
- }[] | undefined;
1171
+ type: "document";
1172
+ text?: string | undefined;
1173
+ content?: string | undefined;
1107
1174
  })[] | undefined;
1108
1175
  } | {
1109
1176
  type: "toolresult";
@@ -1152,12 +1219,12 @@ declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskM
1152
1219
  }[][];
1153
1220
  }>;
1154
1221
  };
1155
- stream: Stream<{
1156
- taskId: string;
1157
- chunk: ChatCompletionChunk | undefined;
1158
- }>;
1222
+ stream: Stream<chunkStreamType>;
1223
+ };
1224
+ type ChatCompletionTool = Awaited<ReturnType<typeof createChatCompletionTool>>['chatCompletion'];
1225
+ type chatCompletionParams = FromSchema<ChatCompletionTool['parameters'], {
1226
+ keepDefaultedPropertiesOptional: true;
1159
1227
  }>;
1160
- type chatCompletionParams = FromSchema<Awaited<ReturnType<typeof createChatCompletionTool>>['chatCompletion']['parameters']>;
1161
1228
 
1162
1229
  declare const TaskyonMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1163
1230
  type: z$1.ZodLiteral<"addTasks">;
@@ -1181,20 +1248,17 @@ declare const TaskyonMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1181
1248
  type: z$1.ZodLiteral<"message">;
1182
1249
  data: z$1.ZodString;
1183
1250
  ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
1184
- type: z$1.ZodLiteral<"url_citation">;
1185
- url_citation: z$1.ZodOptional<z$1.ZodObject<{
1186
- end_index: z$1.ZodOptional<z$1.ZodNumber>;
1187
- start_index: z$1.ZodOptional<z$1.ZodNumber>;
1188
- title: z$1.ZodOptional<z$1.ZodString>;
1189
- url: z$1.ZodOptional<z$1.ZodString>;
1190
- content: z$1.ZodOptional<z$1.ZodString>;
1191
- }, z$1.core.$strip>>;
1251
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
1252
+ id: z$1.ZodOptional<z$1.ZodString>;
1253
+ end_index: z$1.ZodOptional<z$1.ZodNumber>;
1254
+ start_index: z$1.ZodOptional<z$1.ZodNumber>;
1255
+ title: z$1.ZodOptional<z$1.ZodString>;
1256
+ url: z$1.ZodOptional<z$1.ZodString>;
1257
+ content: z$1.ZodOptional<z$1.ZodString>;
1192
1258
  }, z$1.core.$strip>, z$1.ZodObject<{
1193
- type: z$1.ZodLiteral<"file">;
1194
- content: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1195
- text: z$1.ZodString;
1196
- type: z$1.ZodString;
1197
- }, z$1.core.$strip>>>;
1259
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
1260
+ text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1261
+ content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1198
1262
  }, z$1.core.$strip>]>>>;
1199
1263
  }, z$1.core.$strict>, z$1.ZodObject<{
1200
1264
  type: z$1.ZodLiteral<"toolresult">;
@@ -1277,20 +1341,17 @@ declare const TaskyonMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1277
1341
  type: z$1.ZodLiteral<"message">;
1278
1342
  data: z$1.ZodString;
1279
1343
  ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
1280
- type: z$1.ZodLiteral<"url_citation">;
1281
- url_citation: z$1.ZodOptional<z$1.ZodObject<{
1282
- end_index: z$1.ZodOptional<z$1.ZodNumber>;
1283
- start_index: z$1.ZodOptional<z$1.ZodNumber>;
1284
- title: z$1.ZodOptional<z$1.ZodString>;
1285
- url: z$1.ZodOptional<z$1.ZodString>;
1286
- content: z$1.ZodOptional<z$1.ZodString>;
1287
- }, z$1.core.$strip>>;
1344
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
1345
+ id: z$1.ZodOptional<z$1.ZodString>;
1346
+ end_index: z$1.ZodOptional<z$1.ZodNumber>;
1347
+ start_index: z$1.ZodOptional<z$1.ZodNumber>;
1348
+ title: z$1.ZodOptional<z$1.ZodString>;
1349
+ url: z$1.ZodOptional<z$1.ZodString>;
1350
+ content: z$1.ZodOptional<z$1.ZodString>;
1288
1351
  }, z$1.core.$strip>, z$1.ZodObject<{
1289
- type: z$1.ZodLiteral<"file">;
1290
- content: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1291
- text: z$1.ZodString;
1292
- type: z$1.ZodString;
1293
- }, z$1.core.$strip>>>;
1352
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
1353
+ text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1354
+ content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1294
1355
  }, z$1.core.$strip>]>>>;
1295
1356
  }, z$1.core.$strict>, z$1.ZodObject<{
1296
1357
  type: z$1.ZodLiteral<"toolresult">;
@@ -1355,20 +1416,17 @@ declare const TaskyonMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1355
1416
  type: z$1.ZodLiteral<"message">;
1356
1417
  data: z$1.ZodString;
1357
1418
  ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
1358
- type: z$1.ZodLiteral<"url_citation">;
1359
- url_citation: z$1.ZodOptional<z$1.ZodObject<{
1360
- end_index: z$1.ZodOptional<z$1.ZodNumber>;
1361
- start_index: z$1.ZodOptional<z$1.ZodNumber>;
1362
- title: z$1.ZodOptional<z$1.ZodString>;
1363
- url: z$1.ZodOptional<z$1.ZodString>;
1364
- content: z$1.ZodOptional<z$1.ZodString>;
1365
- }, z$1.core.$strip>>;
1419
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
1420
+ id: z$1.ZodOptional<z$1.ZodString>;
1421
+ end_index: z$1.ZodOptional<z$1.ZodNumber>;
1422
+ start_index: z$1.ZodOptional<z$1.ZodNumber>;
1423
+ title: z$1.ZodOptional<z$1.ZodString>;
1424
+ url: z$1.ZodOptional<z$1.ZodString>;
1425
+ content: z$1.ZodOptional<z$1.ZodString>;
1366
1426
  }, z$1.core.$strip>, z$1.ZodObject<{
1367
- type: z$1.ZodLiteral<"file">;
1368
- content: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1369
- text: z$1.ZodString;
1370
- type: z$1.ZodString;
1371
- }, z$1.core.$strip>>>;
1427
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
1428
+ text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1429
+ content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1372
1430
  }, z$1.core.$strip>]>>>;
1373
1431
  }, z$1.core.$strict>, z$1.ZodObject<{
1374
1432
  type: z$1.ZodLiteral<"toolresult">;
@@ -1453,7 +1511,7 @@ type TaskyonMessage = z$1.infer<typeof TaskyonMessage>;
1453
1511
  type processTasksOpts = {
1454
1512
  timeoutMs?: number;
1455
1513
  signal?: AbortSignal;
1456
- quitCondition?: (t: TaskNode) => boolean;
1514
+ show?: boolean;
1457
1515
  };
1458
1516
  declare const createChatCompletionTask: (args: chatCompletionParams) => {
1459
1517
  role: "function" | "system" | "user" | "assistant";
@@ -1461,20 +1519,17 @@ declare const createChatCompletionTask: (args: chatCompletionParams) => {
1461
1519
  type: "message";
1462
1520
  data: string;
1463
1521
  ann?: ({
1464
- type: "url_citation";
1465
- url_citation?: {
1466
- end_index?: number | undefined;
1467
- start_index?: number | undefined;
1468
- title?: string | undefined;
1469
- url?: string | undefined;
1470
- content?: string | undefined;
1471
- } | undefined;
1522
+ type: "url";
1523
+ id?: string | undefined;
1524
+ end_index?: number | undefined;
1525
+ start_index?: number | undefined;
1526
+ title?: string | undefined;
1527
+ url?: string | undefined;
1528
+ content?: string | undefined;
1472
1529
  } | {
1473
- type: "file";
1474
- content?: {
1475
- text: string;
1476
- type: string;
1477
- }[] | undefined;
1530
+ type: "document";
1531
+ text?: string | undefined;
1532
+ content?: string | undefined;
1478
1533
  })[] | undefined;
1479
1534
  } | {
1480
1535
  type: "toolresult";
@@ -1526,28 +1581,95 @@ declare const createChatCompletionTask: (args: chatCompletionParams) => {
1526
1581
  data: FunctionCall;
1527
1582
  };
1528
1583
  };
1529
- declare const processTasks: <T extends {
1584
+ declare const sendTasks: <T extends {
1530
1585
  type: string;
1531
1586
  }>(tyPort: Port<T | TaskyonMessage>) => (taskList: partialTaskDraft[][], opts: processTasksOpts) => Promise<{
1532
- role: "function" | "system" | "user" | "assistant";
1533
- content: {
1534
- type: "message";
1535
- data: string;
1536
- ann?: ({
1537
- type: "url_citation";
1538
- url_citation?: {
1587
+ initialIds: string[];
1588
+ subTaskStream: Stream<{
1589
+ role: "function" | "system" | "user" | "assistant";
1590
+ content: {
1591
+ type: "message";
1592
+ data: string;
1593
+ ann?: ({
1594
+ type: "url";
1595
+ id?: string | undefined;
1539
1596
  end_index?: number | undefined;
1540
1597
  start_index?: number | undefined;
1541
1598
  title?: string | undefined;
1542
1599
  url?: string | undefined;
1543
1600
  content?: string | undefined;
1544
- } | undefined;
1601
+ } | {
1602
+ type: "document";
1603
+ text?: string | undefined;
1604
+ content?: string | undefined;
1605
+ })[] | undefined;
1606
+ } | {
1607
+ type: "toolresult";
1608
+ data: unknown;
1609
+ } | {
1610
+ type: "tooldefinition";
1611
+ data: {
1612
+ description: string;
1613
+ name: string;
1614
+ parameters: Readonly<json_schema.JSONSchema7>;
1615
+ longDescription?: string | undefined;
1616
+ renderOptions?: {
1617
+ hideChat?: boolean | undefined;
1618
+ hideLlm?: boolean | undefined;
1619
+ } | undefined;
1620
+ code?: string | undefined;
1621
+ };
1622
+ } | {
1623
+ type: "error";
1624
+ data: unknown;
1625
+ } | {
1626
+ type: "structured";
1627
+ data: unknown;
1628
+ } | {
1629
+ type: "functioncall";
1630
+ data: {
1631
+ name: string;
1632
+ arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
1633
+ };
1634
+ } | {
1635
+ type: "files";
1636
+ data: string[];
1637
+ } | {
1638
+ type: "return";
1639
+ data: string;
1640
+ };
1641
+ id: string;
1642
+ name?: string | undefined;
1643
+ label?: string[] | undefined;
1644
+ parentID?: string | undefined;
1645
+ priorID?: string | undefined;
1646
+ authorId?: string | undefined;
1647
+ created_at?: number | undefined;
1648
+ acl?: string[] | undefined;
1649
+ sig?: string | undefined;
1650
+ } & {
1651
+ id: string;
1652
+ }>;
1653
+ }>;
1654
+ declare const processTasks: <T extends {
1655
+ type: string;
1656
+ }>(tyPort: Port<T | TaskyonMessage>) => (taskList: partialTaskDraft[][], quitCondition: ((t: TaskNode) => boolean) | TaskContentType | TaskContentType[], opts: processTasksOpts) => Promise<{
1657
+ role: "function" | "system" | "user" | "assistant";
1658
+ content: {
1659
+ type: "message";
1660
+ data: string;
1661
+ ann?: ({
1662
+ type: "url";
1663
+ id?: string | undefined;
1664
+ end_index?: number | undefined;
1665
+ start_index?: number | undefined;
1666
+ title?: string | undefined;
1667
+ url?: string | undefined;
1668
+ content?: string | undefined;
1545
1669
  } | {
1546
- type: "file";
1547
- content?: {
1548
- text: string;
1549
- type: string;
1550
- }[] | undefined;
1670
+ type: "document";
1671
+ text?: string | undefined;
1672
+ content?: string | undefined;
1551
1673
  })[] | undefined;
1552
1674
  } | {
1553
1675
  type: "toolresult";
@@ -1598,9 +1720,9 @@ declare const processTasks: <T extends {
1598
1720
  }>;
1599
1721
 
1600
1722
  declare const TyProfile: z$1.ZodObject<{
1601
- version: z$1.ZodLiteral<21>;
1723
+ version: z$1.ZodLiteral<23>;
1602
1724
  appConfiguration: z$1.ZodObject<{
1603
- darkTheme: z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]>;
1725
+ darkTheme: z$1.ZodDefault<z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]>>;
1604
1726
  appConfigurationUrl: z$1.ZodDefault<z$1.ZodString>;
1605
1727
  gdriveConfigurationFile: z$1.ZodDefault<z$1.ZodString>;
1606
1728
  enableGdriveSync: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
@@ -1622,6 +1744,7 @@ declare const TyProfile: z$1.ZodObject<{
1622
1744
  on: "on";
1623
1745
  off: "off";
1624
1746
  }>>;
1747
+ webSearchButton: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
1625
1748
  guiMode: z$1.ZodDefault<z$1.ZodEnum<{
1626
1749
  default: "default";
1627
1750
  auto: "auto";
@@ -1633,10 +1756,8 @@ declare const TyProfile: z$1.ZodObject<{
1633
1756
  }, z$1.core.$strip>;
1634
1757
  llmSettings: z$1.ZodObject<{
1635
1758
  userId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
1636
- allowWebSearch: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
1637
1759
  secretPublicKey: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
1638
1760
  selectedTaskId: z$1.ZodOptional<z$1.ZodString>;
1639
- enableOpenAiTools: z$1.ZodDefault<z$1.ZodBoolean>;
1640
1761
  selectedApi: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
1641
1762
  llmApis: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
1642
1763
  name: z$1.ZodString;
@@ -1671,20 +1792,17 @@ declare const TyProfile: z$1.ZodObject<{
1671
1792
  type: z$1.ZodLiteral<"message">;
1672
1793
  data: z$1.ZodString;
1673
1794
  ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
1674
- type: z$1.ZodLiteral<"url_citation">;
1675
- url_citation: z$1.ZodOptional<z$1.ZodObject<{
1676
- end_index: z$1.ZodOptional<z$1.ZodNumber>;
1677
- start_index: z$1.ZodOptional<z$1.ZodNumber>;
1678
- title: z$1.ZodOptional<z$1.ZodString>;
1679
- url: z$1.ZodOptional<z$1.ZodString>;
1680
- content: z$1.ZodOptional<z$1.ZodString>;
1681
- }, z$1.core.$strip>>;
1795
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
1796
+ id: z$1.ZodOptional<z$1.ZodString>;
1797
+ end_index: z$1.ZodOptional<z$1.ZodNumber>;
1798
+ start_index: z$1.ZodOptional<z$1.ZodNumber>;
1799
+ title: z$1.ZodOptional<z$1.ZodString>;
1800
+ url: z$1.ZodOptional<z$1.ZodString>;
1801
+ content: z$1.ZodOptional<z$1.ZodString>;
1682
1802
  }, z$1.core.$strip>, z$1.ZodObject<{
1683
- type: z$1.ZodLiteral<"file">;
1684
- content: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1685
- text: z$1.ZodString;
1686
- type: z$1.ZodString;
1687
- }, z$1.core.$strip>>>;
1803
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
1804
+ text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1805
+ content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1688
1806
  }, z$1.core.$strip>]>>>;
1689
1807
  }, z$1.core.$strict>, z$1.ZodObject<{
1690
1808
  type: z$1.ZodLiteral<"toolresult">;
@@ -1731,21 +1849,8 @@ declare const TyProfile: z$1.ZodObject<{
1731
1849
  sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1732
1850
  }, z$1.core.$strip>>;
1733
1851
  enableToolChooser: z$1.ZodDefault<z$1.ZodBoolean>;
1734
- useBasePrompt: z$1.ZodDefault<z$1.ZodBoolean>;
1735
- tryUsingVisionModels: z$1.ZodDefault<z$1.ZodBoolean>;
1736
- taskChatTemplates: z$1.ZodObject<{
1737
- basePrompt: z$1.ZodString;
1738
- instruction: z$1.ZodString;
1739
- toolResult: z$1.ZodString;
1740
- task: z$1.ZodString;
1741
- evaluate: z$1.ZodString;
1742
- schemaReminder: z$1.ZodString;
1743
- tools: z$1.ZodString;
1744
- }, z$1.core.$strip>;
1745
- }, z$1.core.$strip>;
1746
- toolchainConfig: z$1.ZodObject<{
1747
- tools: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodJSONSchema>>;
1748
1852
  }, z$1.core.$strip>;
1853
+ toolchainConfig: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber, z$1.ZodBoolean, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodArray<z$1.ZodUnknown>, z$1.ZodNull, z$1.ZodUndefined]>>>>;
1749
1854
  signatureOrKey: z$1.ZodOptional<z$1.ZodString>;
1750
1855
  }, z$1.core.$strip>;
1751
1856
  type TyProfile = z$1.infer<typeof TyProfile>;
@@ -1773,20 +1878,17 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1773
1878
  type: z$1.ZodLiteral<"message">;
1774
1879
  data: z$1.ZodString;
1775
1880
  ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
1776
- type: z$1.ZodLiteral<"url_citation">;
1777
- url_citation: z$1.ZodOptional<z$1.ZodObject<{
1778
- end_index: z$1.ZodOptional<z$1.ZodNumber>;
1779
- start_index: z$1.ZodOptional<z$1.ZodNumber>;
1780
- title: z$1.ZodOptional<z$1.ZodString>;
1781
- url: z$1.ZodOptional<z$1.ZodString>;
1782
- content: z$1.ZodOptional<z$1.ZodString>;
1783
- }, z$1.core.$strip>>;
1881
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
1882
+ id: z$1.ZodOptional<z$1.ZodString>;
1883
+ end_index: z$1.ZodOptional<z$1.ZodNumber>;
1884
+ start_index: z$1.ZodOptional<z$1.ZodNumber>;
1885
+ title: z$1.ZodOptional<z$1.ZodString>;
1886
+ url: z$1.ZodOptional<z$1.ZodString>;
1887
+ content: z$1.ZodOptional<z$1.ZodString>;
1784
1888
  }, z$1.core.$strip>, z$1.ZodObject<{
1785
- type: z$1.ZodLiteral<"file">;
1786
- content: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1787
- text: z$1.ZodString;
1788
- type: z$1.ZodString;
1789
- }, z$1.core.$strip>>>;
1889
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
1890
+ text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1891
+ content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1790
1892
  }, z$1.core.$strip>]>>>;
1791
1893
  }, z$1.core.$strict>, z$1.ZodObject<{
1792
1894
  type: z$1.ZodLiteral<"toolresult">;
@@ -1869,20 +1971,17 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1869
1971
  type: z$1.ZodLiteral<"message">;
1870
1972
  data: z$1.ZodString;
1871
1973
  ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
1872
- type: z$1.ZodLiteral<"url_citation">;
1873
- url_citation: z$1.ZodOptional<z$1.ZodObject<{
1874
- end_index: z$1.ZodOptional<z$1.ZodNumber>;
1875
- start_index: z$1.ZodOptional<z$1.ZodNumber>;
1876
- title: z$1.ZodOptional<z$1.ZodString>;
1877
- url: z$1.ZodOptional<z$1.ZodString>;
1878
- content: z$1.ZodOptional<z$1.ZodString>;
1879
- }, z$1.core.$strip>>;
1974
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
1975
+ id: z$1.ZodOptional<z$1.ZodString>;
1976
+ end_index: z$1.ZodOptional<z$1.ZodNumber>;
1977
+ start_index: z$1.ZodOptional<z$1.ZodNumber>;
1978
+ title: z$1.ZodOptional<z$1.ZodString>;
1979
+ url: z$1.ZodOptional<z$1.ZodString>;
1980
+ content: z$1.ZodOptional<z$1.ZodString>;
1880
1981
  }, z$1.core.$strip>, z$1.ZodObject<{
1881
- type: z$1.ZodLiteral<"file">;
1882
- content: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1883
- text: z$1.ZodString;
1884
- type: z$1.ZodString;
1885
- }, z$1.core.$strip>>>;
1982
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
1983
+ text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1984
+ content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1886
1985
  }, z$1.core.$strip>]>>>;
1887
1986
  }, z$1.core.$strict>, z$1.ZodObject<{
1888
1987
  type: z$1.ZodLiteral<"toolresult">;
@@ -1947,20 +2046,17 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1947
2046
  type: z$1.ZodLiteral<"message">;
1948
2047
  data: z$1.ZodString;
1949
2048
  ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
1950
- type: z$1.ZodLiteral<"url_citation">;
1951
- url_citation: z$1.ZodOptional<z$1.ZodObject<{
1952
- end_index: z$1.ZodOptional<z$1.ZodNumber>;
1953
- start_index: z$1.ZodOptional<z$1.ZodNumber>;
1954
- title: z$1.ZodOptional<z$1.ZodString>;
1955
- url: z$1.ZodOptional<z$1.ZodString>;
1956
- content: z$1.ZodOptional<z$1.ZodString>;
1957
- }, z$1.core.$strip>>;
2049
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
2050
+ id: z$1.ZodOptional<z$1.ZodString>;
2051
+ end_index: z$1.ZodOptional<z$1.ZodNumber>;
2052
+ start_index: z$1.ZodOptional<z$1.ZodNumber>;
2053
+ title: z$1.ZodOptional<z$1.ZodString>;
2054
+ url: z$1.ZodOptional<z$1.ZodString>;
2055
+ content: z$1.ZodOptional<z$1.ZodString>;
1958
2056
  }, z$1.core.$strip>, z$1.ZodObject<{
1959
- type: z$1.ZodLiteral<"file">;
1960
- content: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1961
- text: z$1.ZodString;
1962
- type: z$1.ZodString;
1963
- }, z$1.core.$strip>>>;
2057
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
2058
+ text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
2059
+ content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1964
2060
  }, z$1.core.$strip>]>>>;
1965
2061
  }, z$1.core.$strict>, z$1.ZodObject<{
1966
2062
  type: z$1.ZodLiteral<"toolresult">;
@@ -2043,9 +2139,9 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2043
2139
  type: z$1.ZodLiteral<"configurationMessage">;
2044
2140
  persist: z$1.ZodOptional<z$1.ZodBoolean>;
2045
2141
  conf: z$1.ZodUnion<readonly [z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodObject<{
2046
- version: z$1.ZodLiteral<21>;
2142
+ version: z$1.ZodLiteral<23>;
2047
2143
  appConfiguration: z$1.ZodObject<{
2048
- darkTheme: z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]>;
2144
+ darkTheme: z$1.ZodDefault<z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]>>;
2049
2145
  appConfigurationUrl: z$1.ZodDefault<z$1.ZodString>;
2050
2146
  gdriveConfigurationFile: z$1.ZodDefault<z$1.ZodString>;
2051
2147
  enableGdriveSync: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
@@ -2067,6 +2163,7 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2067
2163
  on: "on";
2068
2164
  off: "off";
2069
2165
  }>>;
2166
+ webSearchButton: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
2070
2167
  guiMode: z$1.ZodDefault<z$1.ZodEnum<{
2071
2168
  default: "default";
2072
2169
  auto: "auto";
@@ -2078,10 +2175,8 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2078
2175
  }, z$1.core.$strip>;
2079
2176
  llmSettings: z$1.ZodObject<{
2080
2177
  userId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
2081
- allowWebSearch: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
2082
2178
  secretPublicKey: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
2083
2179
  selectedTaskId: z$1.ZodOptional<z$1.ZodString>;
2084
- enableOpenAiTools: z$1.ZodDefault<z$1.ZodBoolean>;
2085
2180
  selectedApi: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
2086
2181
  llmApis: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
2087
2182
  name: z$1.ZodString;
@@ -2116,20 +2211,17 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2116
2211
  type: z$1.ZodLiteral<"message">;
2117
2212
  data: z$1.ZodString;
2118
2213
  ann: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
2119
- type: z$1.ZodLiteral<"url_citation">;
2120
- url_citation: z$1.ZodOptional<z$1.ZodObject<{
2121
- end_index: z$1.ZodOptional<z$1.ZodNumber>;
2122
- start_index: z$1.ZodOptional<z$1.ZodNumber>;
2123
- title: z$1.ZodOptional<z$1.ZodString>;
2124
- url: z$1.ZodOptional<z$1.ZodString>;
2125
- content: z$1.ZodOptional<z$1.ZodString>;
2126
- }, z$1.core.$strip>>;
2214
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"url">>>;
2215
+ id: z$1.ZodOptional<z$1.ZodString>;
2216
+ end_index: z$1.ZodOptional<z$1.ZodNumber>;
2217
+ start_index: z$1.ZodOptional<z$1.ZodNumber>;
2218
+ title: z$1.ZodOptional<z$1.ZodString>;
2219
+ url: z$1.ZodOptional<z$1.ZodString>;
2220
+ content: z$1.ZodOptional<z$1.ZodString>;
2127
2221
  }, z$1.core.$strip>, z$1.ZodObject<{
2128
- type: z$1.ZodLiteral<"file">;
2129
- content: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2130
- text: z$1.ZodString;
2131
- type: z$1.ZodString;
2132
- }, z$1.core.$strip>>>;
2222
+ type: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodLiteral<"document">>>;
2223
+ text: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
2224
+ content: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
2133
2225
  }, z$1.core.$strip>]>>>;
2134
2226
  }, z$1.core.$strict>, z$1.ZodObject<{
2135
2227
  type: z$1.ZodLiteral<"toolresult">;
@@ -2176,21 +2268,8 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2176
2268
  sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
2177
2269
  }, z$1.core.$strip>>;
2178
2270
  enableToolChooser: z$1.ZodDefault<z$1.ZodBoolean>;
2179
- useBasePrompt: z$1.ZodDefault<z$1.ZodBoolean>;
2180
- tryUsingVisionModels: z$1.ZodDefault<z$1.ZodBoolean>;
2181
- taskChatTemplates: z$1.ZodObject<{
2182
- basePrompt: z$1.ZodString;
2183
- instruction: z$1.ZodString;
2184
- toolResult: z$1.ZodString;
2185
- task: z$1.ZodString;
2186
- evaluate: z$1.ZodString;
2187
- schemaReminder: z$1.ZodString;
2188
- tools: z$1.ZodString;
2189
- }, z$1.core.$strip>;
2190
- }, z$1.core.$strip>;
2191
- toolchainConfig: z$1.ZodObject<{
2192
- tools: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodJSONSchema>>;
2193
2271
  }, z$1.core.$strip>;
2272
+ toolchainConfig: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNumber, z$1.ZodBoolean, z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodArray<z$1.ZodUnknown>, z$1.ZodNull, z$1.ZodUndefined]>>>>;
2194
2273
  signatureOrKey: z$1.ZodOptional<z$1.ZodString>;
2195
2274
  }, z$1.core.$strip>]>;
2196
2275
  origin: z$1.ZodOptional<z$1.ZodString>;
@@ -2199,15 +2278,23 @@ declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2199
2278
  type TaskyonGuiMessage = z$1.infer<typeof TaskyonGuiMessage>;
2200
2279
 
2201
2280
  interface TyClient {
2202
- processTasks: ReturnType<typeof processTasks>;
2281
+ sendTasks: ReturnType<typeof sendTasks>;
2282
+ waitForTaskResult: ReturnType<typeof processTasks>;
2203
2283
  port: Port<TaskyonGuiMessage, TaskyonGuiMessage>;
2204
2284
  sendFile: (file: File) => Promise<string>;
2285
+ reconfigure: (options: {
2286
+ name?: string;
2287
+ persist?: boolean;
2288
+ tools: ClientTool[];
2289
+ configuration: partialTyConfiguration;
2290
+ }) => void;
2205
2291
  }
2206
2292
  declare function initializeTaskyon(options: {
2207
2293
  name?: string;
2208
2294
  persist?: boolean;
2209
2295
  tools: ClientTool[];
2210
2296
  configuration: partialTyConfiguration;
2297
+ iframeId?: string;
2211
2298
  }): Promise<TyClient>;
2212
2299
 
2213
2300
  export { type ClientTool, TaskyonGuiMessage, TaskyonMessage, type TyClient, createChatCompletionTask, createTool, initializeTaskyon, makeTaskResult, partialTaskDraft, type partialTyConfiguration, processTasks, toolCall };