@taskyon/tyclient 0.4.6 → 0.5.1
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.
- package/README.md +57 -0
- package/dist/tyclient.d.mts +2213 -0
- package/dist/tyclient.d.ts +2181 -1026
- package/dist/tyclient.js +746 -0
- package/dist/tyclient.js.map +1 -0
- package/dist/tyclient.mjs +735 -0
- package/dist/tyclient.mjs.map +1 -0
- package/package.json +12 -9
- package/dist/tyclient.es.js +0 -11385
- package/dist/tyclient.umd.js +0 -11389
- package/dist/tyclient.umd.min.js +0 -43
package/dist/tyclient.d.ts
CHANGED
|
@@ -1,1032 +1,233 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as json_schema from 'json-schema';
|
|
2
|
+
import { JSONSchema7 } from 'json-schema';
|
|
3
|
+
import { JSONSchema, FromSchema } from 'json-schema-to-ts';
|
|
4
|
+
import z, { z as z$1 } from 'zod';
|
|
5
|
+
import { PartialDeep } from 'type-fest';
|
|
6
|
+
import { PGliteWorker } from '@electric-sql/pglite/worker';
|
|
7
|
+
import { LiveNamespace } from '@electric-sql/pglite/live';
|
|
3
8
|
|
|
4
|
-
declare const FunctionCall: z.ZodObject<{
|
|
5
|
-
name: z.ZodString;
|
|
6
|
-
arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [
|
|
7
|
-
z.ZodString,
|
|
8
|
-
z.ZodNumber,
|
|
9
|
-
z.ZodBoolean,
|
|
10
|
-
z.ZodRecord<z.ZodString, z.ZodUnknown>,
|
|
11
|
-
z.ZodArray<z.ZodUnknown>,
|
|
12
|
-
z.ZodNull,
|
|
13
|
-
z.ZodUndefined
|
|
14
|
-
]>>;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
declare const InternalTool: z.ZodObject<{
|
|
17
|
-
description: z.ZodString;
|
|
18
|
-
longDescription: z.ZodOptional<z.ZodString>;
|
|
19
|
-
name: z.ZodString;
|
|
20
|
-
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
21
|
-
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
-
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
-
}, z.core.$strip>>;
|
|
24
|
-
parameters: z.ZodReadonly<z.ZodType<import("json-schema").JSONSchema7, unknown, z.core.$ZodTypeInternals<import("json-schema").JSONSchema7, unknown>>>;
|
|
25
|
-
code: z.ZodOptional<z.ZodString>;
|
|
26
|
-
function: z.ZodOptional<z.ZodCustom<(params: any, context: toolContext) => unknown, (params: any, context: toolContext) => unknown>>;
|
|
27
|
-
}, z.core.$strip>;
|
|
28
|
-
declare const TaskNode: z.ZodObject<{
|
|
29
|
-
role: z.ZodEnum<{
|
|
30
|
-
function: "function";
|
|
31
|
-
system: "system";
|
|
32
|
-
user: "user";
|
|
33
|
-
assistant: "assistant";
|
|
34
|
-
}>;
|
|
35
|
-
name: z.ZodOptional<z.ZodString>;
|
|
36
|
-
content: z.ZodUnion<readonly [
|
|
37
|
-
z.ZodObject<{
|
|
38
|
-
type: z.ZodLiteral<"message">;
|
|
39
|
-
data: z.ZodString;
|
|
40
|
-
}, z.core.$strict>,
|
|
41
|
-
z.ZodObject<{
|
|
42
|
-
type: z.ZodLiteral<"toolresult">;
|
|
43
|
-
data: z.ZodUnknown;
|
|
44
|
-
}, z.core.$strict>,
|
|
45
|
-
z.ZodObject<{
|
|
46
|
-
type: z.ZodLiteral<"tooldefinition">;
|
|
47
|
-
data: z.ZodObject<{
|
|
48
|
-
description: z.ZodString;
|
|
49
|
-
longDescription: z.ZodOptional<z.ZodString>;
|
|
50
|
-
name: z.ZodString;
|
|
51
|
-
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
52
|
-
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
-
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
-
}, z.core.$strip>>;
|
|
55
|
-
parameters: z.ZodReadonly<z.ZodType<import("json-schema").JSONSchema7, unknown, z.core.$ZodTypeInternals<import("json-schema").JSONSchema7, unknown>>>;
|
|
56
|
-
code: z.ZodOptional<z.ZodString>;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
}, z.core.$strict>,
|
|
59
|
-
z.ZodObject<{
|
|
60
|
-
type: z.ZodLiteral<"error">;
|
|
61
|
-
data: z.ZodUnknown;
|
|
62
|
-
}, z.core.$strict>,
|
|
63
|
-
z.ZodObject<{
|
|
64
|
-
type: z.ZodLiteral<"structured">;
|
|
65
|
-
data: z.ZodUnknown;
|
|
66
|
-
}, z.core.$strict>,
|
|
67
|
-
z.ZodObject<{
|
|
68
|
-
type: z.ZodLiteral<"functioncall">;
|
|
69
|
-
data: z.ZodObject<{
|
|
70
|
-
name: z.ZodString;
|
|
71
|
-
arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [
|
|
72
|
-
z.ZodString,
|
|
73
|
-
z.ZodNumber,
|
|
74
|
-
z.ZodBoolean,
|
|
75
|
-
z.ZodRecord<z.ZodString, z.ZodUnknown>,
|
|
76
|
-
z.ZodArray<z.ZodUnknown>,
|
|
77
|
-
z.ZodNull,
|
|
78
|
-
z.ZodUndefined
|
|
79
|
-
]>>;
|
|
80
|
-
}, z.core.$strip>;
|
|
81
|
-
}, z.core.$strict>,
|
|
82
|
-
z.ZodObject<{
|
|
83
|
-
type: z.ZodLiteral<"files">;
|
|
84
|
-
data: z.ZodArray<z.ZodString>;
|
|
85
|
-
}, z.core.$strict>,
|
|
86
|
-
z.ZodObject<{
|
|
87
|
-
type: z.ZodLiteral<"return">;
|
|
88
|
-
data: z.ZodString;
|
|
89
|
-
}, z.core.$strict>
|
|
90
|
-
]>;
|
|
91
|
-
label: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
92
|
-
parentID: z.ZodOptional<z.ZodString>;
|
|
93
|
-
priorID: z.ZodOptional<z.ZodString>;
|
|
94
|
-
id: z.ZodString;
|
|
95
|
-
authorId: z.ZodOptional<z.ZodString>;
|
|
96
|
-
created_at: z.ZodOptional<z.ZodNumber>;
|
|
97
|
-
acl: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
|
-
sig: z.ZodOptional<z.ZodString>;
|
|
99
|
-
}, z.core.$strip>;
|
|
100
|
-
declare const TyProfile: z.ZodObject<{
|
|
101
|
-
version: z.ZodLiteral<19>;
|
|
102
|
-
appConfiguration: z.ZodObject<{
|
|
103
|
-
darkTheme: z.ZodUnion<readonly [
|
|
104
|
-
z.ZodLiteral<"auto">,
|
|
105
|
-
z.ZodBoolean
|
|
106
|
-
]>;
|
|
107
|
-
appConfigurationUrl: z.ZodDefault<z.ZodString>;
|
|
108
|
-
gdriveConfigurationFile: z.ZodDefault<z.ZodString>;
|
|
109
|
-
enableGdriveSync: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
110
|
-
expertMode: z.ZodDefault<z.ZodBoolean>;
|
|
111
|
-
showCosts: z.ZodDefault<z.ZodBoolean>;
|
|
112
|
-
gdriveDir: z.ZodDefault<z.ZodString>;
|
|
113
|
-
showLogo: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
114
|
-
welcomeMsg: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
115
|
-
chatSuggestions: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [
|
|
116
|
-
z.ZodObject<{
|
|
117
|
-
url: z.ZodString;
|
|
118
|
-
label: z.ZodString;
|
|
119
|
-
}, z.core.$strip>,
|
|
120
|
-
z.ZodObject<{
|
|
121
|
-
md: z.ZodString;
|
|
122
|
-
label: z.ZodString;
|
|
123
|
-
}, z.core.$strip>
|
|
124
|
-
]>>>>;
|
|
125
|
-
useEnterToSend: z.ZodDefault<z.ZodBoolean>;
|
|
126
|
-
guiMode: z.ZodDefault<z.ZodEnum<{
|
|
127
|
-
default: "default";
|
|
128
|
-
auto: "auto";
|
|
129
|
-
iframe: "iframe";
|
|
130
|
-
minChat: "minChat";
|
|
131
|
-
}>>;
|
|
132
|
-
primaryColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
133
|
-
secondaryColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
134
|
-
}, z.core.$strip>;
|
|
135
|
-
llmSettings: z.ZodObject<{
|
|
136
|
-
userId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
137
|
-
secretPublicKey: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
138
|
-
selectedTaskId: z.ZodOptional<z.ZodString>;
|
|
139
|
-
enableOpenAiTools: z.ZodDefault<z.ZodBoolean>;
|
|
140
|
-
selectedApi: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
141
|
-
llmApis: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
142
|
-
name: z.ZodString;
|
|
143
|
-
baseURL: z.ZodString;
|
|
144
|
-
defaultModel: z.ZodString;
|
|
145
|
-
selectedModel: z.ZodOptional<z.ZodString>;
|
|
146
|
-
models: z.ZodOptional<z.ZodObject<{
|
|
147
|
-
instruction: z.ZodOptional<z.ZodString>;
|
|
148
|
-
chat: z.ZodOptional<z.ZodString>;
|
|
149
|
-
free: z.ZodOptional<z.ZodString>;
|
|
150
|
-
}, z.core.$strip>>;
|
|
151
|
-
streamSupport: z.ZodBoolean;
|
|
152
|
-
defaultHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
153
|
-
routes: z.ZodObject<{
|
|
154
|
-
chatCompletion: z.ZodString;
|
|
155
|
-
models: z.ZodString;
|
|
156
|
-
}, z.core.$strip>;
|
|
157
|
-
}, z.core.$strip>>>;
|
|
158
|
-
siteUrl: z.ZodDefault<z.ZodString>;
|
|
159
|
-
summaryModel: z.ZodDefault<z.ZodString>;
|
|
160
|
-
vectorizationModel: z.ZodDefault<z.ZodString>;
|
|
161
|
-
maxAutonomousTasks: z.ZodDefault<z.ZodNumber>;
|
|
162
|
-
entryNode: z.ZodOptional<z.ZodObject<{
|
|
163
|
-
role: z.ZodNonOptional<z.ZodOptional<z.ZodEnum<{
|
|
164
|
-
function: "function";
|
|
165
|
-
system: "system";
|
|
166
|
-
user: "user";
|
|
167
|
-
assistant: "assistant";
|
|
168
|
-
}>>>;
|
|
169
|
-
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
170
|
-
content: z.ZodNonOptional<z.ZodOptional<z.ZodUnion<readonly [
|
|
171
|
-
z.ZodObject<{
|
|
172
|
-
type: z.ZodLiteral<"message">;
|
|
173
|
-
data: z.ZodString;
|
|
174
|
-
}, z.core.$strict>,
|
|
175
|
-
z.ZodObject<{
|
|
176
|
-
type: z.ZodLiteral<"toolresult">;
|
|
177
|
-
data: z.ZodUnknown;
|
|
178
|
-
}, z.core.$strict>,
|
|
179
|
-
z.ZodObject<{
|
|
180
|
-
type: z.ZodLiteral<"tooldefinition">;
|
|
181
|
-
data: z.ZodObject<{
|
|
182
|
-
description: z.ZodString;
|
|
183
|
-
longDescription: z.ZodOptional<z.ZodString>;
|
|
184
|
-
name: z.ZodString;
|
|
185
|
-
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
186
|
-
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
-
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
-
}, z.core.$strip>>;
|
|
189
|
-
parameters: z.ZodReadonly<z.ZodType<import("json-schema").JSONSchema7, unknown, z.core.$ZodTypeInternals<import("json-schema").JSONSchema7, unknown>>>;
|
|
190
|
-
code: z.ZodOptional<z.ZodString>;
|
|
191
|
-
}, z.core.$strip>;
|
|
192
|
-
}, z.core.$strict>,
|
|
193
|
-
z.ZodObject<{
|
|
194
|
-
type: z.ZodLiteral<"error">;
|
|
195
|
-
data: z.ZodUnknown;
|
|
196
|
-
}, z.core.$strict>,
|
|
197
|
-
z.ZodObject<{
|
|
198
|
-
type: z.ZodLiteral<"structured">;
|
|
199
|
-
data: z.ZodUnknown;
|
|
200
|
-
}, z.core.$strict>,
|
|
201
|
-
z.ZodObject<{
|
|
202
|
-
type: z.ZodLiteral<"functioncall">;
|
|
203
|
-
data: z.ZodObject<{
|
|
204
|
-
name: z.ZodString;
|
|
205
|
-
arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [
|
|
206
|
-
z.ZodString,
|
|
207
|
-
z.ZodNumber,
|
|
208
|
-
z.ZodBoolean,
|
|
209
|
-
z.ZodRecord<z.ZodString, z.ZodUnknown>,
|
|
210
|
-
z.ZodArray<z.ZodUnknown>,
|
|
211
|
-
z.ZodNull,
|
|
212
|
-
z.ZodUndefined
|
|
213
|
-
]>>;
|
|
214
|
-
}, z.core.$strip>;
|
|
215
|
-
}, z.core.$strict>,
|
|
216
|
-
z.ZodObject<{
|
|
217
|
-
type: z.ZodLiteral<"files">;
|
|
218
|
-
data: z.ZodArray<z.ZodString>;
|
|
219
|
-
}, z.core.$strict>,
|
|
220
|
-
z.ZodObject<{
|
|
221
|
-
type: z.ZodLiteral<"return">;
|
|
222
|
-
data: z.ZodString;
|
|
223
|
-
}, z.core.$strict>
|
|
224
|
-
]>>>;
|
|
225
|
-
label: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
226
|
-
parentID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
227
|
-
priorID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
228
|
-
id: z.ZodOptional<z.ZodString>;
|
|
229
|
-
authorId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
230
|
-
created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
231
|
-
acl: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
232
|
-
sig: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
233
|
-
}, z.core.$strip>>;
|
|
234
|
-
enableToolChooser: z.ZodDefault<z.ZodBoolean>;
|
|
235
|
-
useBasePrompt: z.ZodDefault<z.ZodBoolean>;
|
|
236
|
-
tryUsingVisionModels: z.ZodDefault<z.ZodBoolean>;
|
|
237
|
-
taskChatTemplates: z.ZodObject<{
|
|
238
|
-
basePrompt: z.ZodString;
|
|
239
|
-
instruction: z.ZodString;
|
|
240
|
-
toolResult: z.ZodString;
|
|
241
|
-
task: z.ZodString;
|
|
242
|
-
evaluate: z.ZodString;
|
|
243
|
-
schemaReminder: z.ZodString;
|
|
244
|
-
tools: z.ZodString;
|
|
245
|
-
}, z.core.$strip>;
|
|
246
|
-
}, z.core.$strip>;
|
|
247
|
-
toolchainConfig: z.ZodObject<{
|
|
248
|
-
tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
249
|
-
}, z.core.$strip>;
|
|
250
|
-
signatureOrKey: z.ZodOptional<z.ZodString>;
|
|
251
|
-
}, z.core.$strip>;
|
|
252
|
-
declare const partialTaskDraft: z.ZodObject<{
|
|
253
|
-
role: z.ZodNonOptional<z.ZodOptional<z.ZodEnum<{
|
|
254
|
-
function: "function";
|
|
255
|
-
system: "system";
|
|
256
|
-
user: "user";
|
|
257
|
-
assistant: "assistant";
|
|
258
|
-
}>>>;
|
|
259
|
-
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
260
|
-
content: z.ZodNonOptional<z.ZodOptional<z.ZodUnion<readonly [
|
|
261
|
-
z.ZodObject<{
|
|
262
|
-
type: z.ZodLiteral<"message">;
|
|
263
|
-
data: z.ZodString;
|
|
264
|
-
}, z.core.$strict>,
|
|
265
|
-
z.ZodObject<{
|
|
266
|
-
type: z.ZodLiteral<"toolresult">;
|
|
267
|
-
data: z.ZodUnknown;
|
|
268
|
-
}, z.core.$strict>,
|
|
269
|
-
z.ZodObject<{
|
|
270
|
-
type: z.ZodLiteral<"tooldefinition">;
|
|
271
|
-
data: z.ZodObject<{
|
|
272
|
-
description: z.ZodString;
|
|
273
|
-
longDescription: z.ZodOptional<z.ZodString>;
|
|
274
|
-
name: z.ZodString;
|
|
275
|
-
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
276
|
-
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
277
|
-
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
278
|
-
}, z.core.$strip>>;
|
|
279
|
-
parameters: z.ZodReadonly<z.ZodType<import("json-schema").JSONSchema7, unknown, z.core.$ZodTypeInternals<import("json-schema").JSONSchema7, unknown>>>;
|
|
280
|
-
code: z.ZodOptional<z.ZodString>;
|
|
281
|
-
}, z.core.$strip>;
|
|
282
|
-
}, z.core.$strict>,
|
|
283
|
-
z.ZodObject<{
|
|
284
|
-
type: z.ZodLiteral<"error">;
|
|
285
|
-
data: z.ZodUnknown;
|
|
286
|
-
}, z.core.$strict>,
|
|
287
|
-
z.ZodObject<{
|
|
288
|
-
type: z.ZodLiteral<"structured">;
|
|
289
|
-
data: z.ZodUnknown;
|
|
290
|
-
}, z.core.$strict>,
|
|
291
|
-
z.ZodObject<{
|
|
292
|
-
type: z.ZodLiteral<"functioncall">;
|
|
293
|
-
data: z.ZodObject<{
|
|
294
|
-
name: z.ZodString;
|
|
295
|
-
arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [
|
|
296
|
-
z.ZodString,
|
|
297
|
-
z.ZodNumber,
|
|
298
|
-
z.ZodBoolean,
|
|
299
|
-
z.ZodRecord<z.ZodString, z.ZodUnknown>,
|
|
300
|
-
z.ZodArray<z.ZodUnknown>,
|
|
301
|
-
z.ZodNull,
|
|
302
|
-
z.ZodUndefined
|
|
303
|
-
]>>;
|
|
304
|
-
}, z.core.$strip>;
|
|
305
|
-
}, z.core.$strict>,
|
|
306
|
-
z.ZodObject<{
|
|
307
|
-
type: z.ZodLiteral<"files">;
|
|
308
|
-
data: z.ZodArray<z.ZodString>;
|
|
309
|
-
}, z.core.$strict>,
|
|
310
|
-
z.ZodObject<{
|
|
311
|
-
type: z.ZodLiteral<"return">;
|
|
312
|
-
data: z.ZodString;
|
|
313
|
-
}, z.core.$strict>
|
|
314
|
-
]>>>;
|
|
315
|
-
label: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
316
|
-
parentID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
317
|
-
priorID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
318
|
-
id: z.ZodOptional<z.ZodString>;
|
|
319
|
-
authorId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
320
|
-
created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
321
|
-
acl: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
322
|
-
sig: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
323
|
-
}, z.core.$strip>;
|
|
324
|
-
declare const taskResult: z.ZodObject<{
|
|
325
|
-
taskResultMarker: z.ZodDefault<z.ZodLiteral<"*TY_TASKRESULT*">>;
|
|
326
|
-
taskChainList: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
327
|
-
role: z.ZodNonOptional<z.ZodOptional<z.ZodEnum<{
|
|
328
|
-
function: "function";
|
|
329
|
-
system: "system";
|
|
330
|
-
user: "user";
|
|
331
|
-
assistant: "assistant";
|
|
332
|
-
}>>>;
|
|
333
|
-
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
334
|
-
content: z.ZodNonOptional<z.ZodOptional<z.ZodUnion<readonly [
|
|
335
|
-
z.ZodObject<{
|
|
336
|
-
type: z.ZodLiteral<"message">;
|
|
337
|
-
data: z.ZodString;
|
|
338
|
-
}, z.core.$strict>,
|
|
339
|
-
z.ZodObject<{
|
|
340
|
-
type: z.ZodLiteral<"toolresult">;
|
|
341
|
-
data: z.ZodUnknown;
|
|
342
|
-
}, z.core.$strict>,
|
|
343
|
-
z.ZodObject<{
|
|
344
|
-
type: z.ZodLiteral<"tooldefinition">;
|
|
345
|
-
data: z.ZodObject<{
|
|
346
|
-
description: z.ZodString;
|
|
347
|
-
longDescription: z.ZodOptional<z.ZodString>;
|
|
348
|
-
name: z.ZodString;
|
|
349
|
-
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
350
|
-
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
351
|
-
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
352
|
-
}, z.core.$strip>>;
|
|
353
|
-
parameters: z.ZodReadonly<z.ZodType<import("json-schema").JSONSchema7, unknown, z.core.$ZodTypeInternals<import("json-schema").JSONSchema7, unknown>>>;
|
|
354
|
-
code: z.ZodOptional<z.ZodString>;
|
|
355
|
-
}, z.core.$strip>;
|
|
356
|
-
}, z.core.$strict>,
|
|
357
|
-
z.ZodObject<{
|
|
358
|
-
type: z.ZodLiteral<"error">;
|
|
359
|
-
data: z.ZodUnknown;
|
|
360
|
-
}, z.core.$strict>,
|
|
361
|
-
z.ZodObject<{
|
|
362
|
-
type: z.ZodLiteral<"structured">;
|
|
363
|
-
data: z.ZodUnknown;
|
|
364
|
-
}, z.core.$strict>,
|
|
365
|
-
z.ZodObject<{
|
|
366
|
-
type: z.ZodLiteral<"functioncall">;
|
|
367
|
-
data: z.ZodObject<{
|
|
368
|
-
name: z.ZodString;
|
|
369
|
-
arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [
|
|
370
|
-
z.ZodString,
|
|
371
|
-
z.ZodNumber,
|
|
372
|
-
z.ZodBoolean,
|
|
373
|
-
z.ZodRecord<z.ZodString, z.ZodUnknown>,
|
|
374
|
-
z.ZodArray<z.ZodUnknown>,
|
|
375
|
-
z.ZodNull,
|
|
376
|
-
z.ZodUndefined
|
|
377
|
-
]>>;
|
|
378
|
-
}, z.core.$strip>;
|
|
379
|
-
}, z.core.$strict>,
|
|
380
|
-
z.ZodObject<{
|
|
381
|
-
type: z.ZodLiteral<"files">;
|
|
382
|
-
data: z.ZodArray<z.ZodString>;
|
|
383
|
-
}, z.core.$strict>,
|
|
384
|
-
z.ZodObject<{
|
|
385
|
-
type: z.ZodLiteral<"return">;
|
|
386
|
-
data: z.ZodString;
|
|
387
|
-
}, z.core.$strict>
|
|
388
|
-
]>>>;
|
|
389
|
-
label: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
390
|
-
parentID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
391
|
-
priorID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
392
|
-
id: z.ZodOptional<z.ZodString>;
|
|
393
|
-
authorId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
394
|
-
created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
395
|
-
acl: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
396
|
-
sig: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
397
|
-
}, z.core.$strip>>>;
|
|
398
|
-
}, z.core.$strip>;
|
|
399
|
-
export declare function createTool<T, SCHEMA extends Readonly<JSONSchema>, PARAMS = FromSchema<SCHEMA>>(tool: T & {
|
|
400
|
-
parameters: SCHEMA;
|
|
401
|
-
function?: (params: PARAMS, context: toolContext) => unknown;
|
|
402
|
-
} & Omit<InternalTool$1, "function" | "parameters">): T;
|
|
403
|
-
export declare function initializeTaskyon(options: {
|
|
404
|
-
name?: string;
|
|
405
|
-
persist?: boolean;
|
|
406
|
-
tools: ClientTool[];
|
|
407
|
-
configuration: partialTyConfiguration;
|
|
408
|
-
}): Promise<void>;
|
|
409
|
-
export declare function makeTaskResult(tasks: partialTaskDraft | partialTaskDraft[] | partialTaskDraft[][]): taskResult;
|
|
410
|
-
export declare function toolCall(f: FunctionCall): partialTaskDraft & {
|
|
411
|
-
content: {
|
|
412
|
-
type: "functioncall";
|
|
413
|
-
data: FunctionCall;
|
|
414
|
-
};
|
|
415
|
-
};
|
|
416
|
-
/**
|
|
417
|
-
Merges user specified options with default options.
|
|
418
|
-
|
|
419
|
-
@example
|
|
420
|
-
```
|
|
421
|
-
type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
|
|
422
|
-
type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
|
|
423
|
-
type SpecifiedOptions = {leavesOnly: true};
|
|
424
|
-
|
|
425
|
-
type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
|
|
426
|
-
//=> {maxRecursionDepth: 10; leavesOnly: true}
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
@example
|
|
430
|
-
```
|
|
431
|
-
// Complains if default values are not provided for optional options
|
|
432
|
-
|
|
433
|
-
type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
|
|
434
|
-
type DefaultPathsOptions = {maxRecursionDepth: 10};
|
|
435
|
-
type SpecifiedOptions = {};
|
|
436
|
-
|
|
437
|
-
type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
|
|
438
|
-
// ~~~~~~~~~~~~~~~~~~~
|
|
439
|
-
// Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'.
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
@example
|
|
443
|
-
```
|
|
444
|
-
// Complains if an option's default type does not conform to the expected type
|
|
445
|
-
|
|
446
|
-
type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
|
|
447
|
-
type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
|
|
448
|
-
type SpecifiedOptions = {};
|
|
449
|
-
|
|
450
|
-
type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
|
|
451
|
-
// ~~~~~~~~~~~~~~~~~~~
|
|
452
|
-
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
@example
|
|
456
|
-
```
|
|
457
|
-
// Complains if an option's specified type does not conform to the expected type
|
|
458
|
-
|
|
459
|
-
type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
|
|
460
|
-
type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
|
|
461
|
-
type SpecifiedOptions = {leavesOnly: 'yes'};
|
|
462
|
-
|
|
463
|
-
type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
|
|
464
|
-
// ~~~~~~~~~~~~~~~~
|
|
465
|
-
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
466
|
-
```
|
|
467
|
-
*/
|
|
468
|
-
export type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = IfAny<SpecifiedOptions, Defaults, IfNever<SpecifiedOptions, Defaults, Simplify<Merge<Defaults, {
|
|
469
|
-
[Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? Extract<SpecifiedOptions[Key], undefined> extends never ? Key : never : Key]: SpecifiedOptions[Key];
|
|
470
|
-
}> & Required<Options>> // `& Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
|
|
471
|
-
>>;
|
|
472
|
-
/**
|
|
473
|
-
Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
474
|
-
*/
|
|
475
|
-
export type BuiltIns = Primitive | void | Date | RegExp;
|
|
476
|
-
export type ClientTool = WithRequired<InternalTool$1, "function">;
|
|
477
|
-
export type DefaultPartialDeepOptions = {
|
|
478
|
-
recurseIntoArrays: false;
|
|
479
|
-
allowUndefinedInNonTupleArrays: true;
|
|
480
|
-
};
|
|
481
|
-
export type FunctionCall = z.infer<typeof FunctionCall>;
|
|
482
|
-
/**
|
|
483
|
-
An if-else-like type that resolves depending on whether the given type is `any`.
|
|
484
|
-
|
|
485
|
-
@see {@link IsAny}
|
|
486
|
-
|
|
487
|
-
@example
|
|
488
|
-
```
|
|
489
|
-
import type {IfAny} from 'type-fest';
|
|
490
|
-
|
|
491
|
-
type ShouldBeTrue = IfAny<any>;
|
|
492
|
-
//=> true
|
|
493
|
-
|
|
494
|
-
type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>;
|
|
495
|
-
//=> 'bar'
|
|
496
|
-
```
|
|
497
|
-
|
|
498
|
-
@category Type Guard
|
|
499
|
-
@category Utilities
|
|
500
|
-
*/
|
|
501
|
-
export type IfAny<T, TypeIfAny = true, TypeIfNotAny = false> = (IsAny<T> extends true ? TypeIfAny : TypeIfNotAny);
|
|
502
|
-
/**
|
|
503
|
-
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
504
|
-
|
|
505
|
-
@see {@link IsNever}
|
|
506
|
-
|
|
507
|
-
@example
|
|
508
|
-
```
|
|
509
|
-
import type {IfNever} from 'type-fest';
|
|
510
|
-
|
|
511
|
-
type ShouldBeTrue = IfNever<never>;
|
|
512
|
-
//=> true
|
|
513
|
-
|
|
514
|
-
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
515
|
-
//=> 'bar'
|
|
516
|
-
```
|
|
517
|
-
|
|
518
|
-
@category Type Guard
|
|
519
|
-
@category Utilities
|
|
520
|
-
*/
|
|
521
|
-
export type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (IsNever<T> extends true ? TypeIfNever : TypeIfNotNever);
|
|
522
|
-
/**
|
|
523
|
-
Returns a boolean for whether the given type is `any`.
|
|
524
|
-
|
|
525
|
-
@link https://stackoverflow.com/a/49928360/1490091
|
|
526
|
-
|
|
527
|
-
Useful in type utilities, such as disallowing `any`s to be passed to a function.
|
|
528
|
-
|
|
529
|
-
@example
|
|
530
|
-
```
|
|
531
|
-
import type {IsAny} from 'type-fest';
|
|
532
|
-
|
|
533
|
-
const typedObject = {a: 1, b: 2} as const;
|
|
534
|
-
const anyObject: any = {a: 1, b: 2};
|
|
535
|
-
|
|
536
|
-
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
|
|
537
|
-
return obj[key];
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
const typedA = get(typedObject, 'a');
|
|
541
|
-
//=> 1
|
|
542
|
-
|
|
543
|
-
const anyA = get(anyObject, 'a');
|
|
544
|
-
//=> any
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
@category Type Guard
|
|
548
|
-
@category Utilities
|
|
549
|
-
*/
|
|
550
|
-
export type IsAny<T> = 0 extends 1 & NoInfer$1<T> ? true : false;
|
|
551
|
-
/**
|
|
552
|
-
Returns a boolean for whether the given type is `never`.
|
|
553
|
-
|
|
554
|
-
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
555
|
-
@link https://stackoverflow.com/a/53984913/10292952
|
|
556
|
-
@link https://www.zhenghao.io/posts/ts-never
|
|
557
|
-
|
|
558
|
-
Useful in type utilities, such as checking if something does not occur.
|
|
559
|
-
|
|
560
|
-
@example
|
|
561
|
-
```
|
|
562
|
-
import type {IsNever, And} from 'type-fest';
|
|
563
|
-
|
|
564
|
-
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
565
|
-
type AreStringsEqual<A extends string, B extends string> =
|
|
566
|
-
And<
|
|
567
|
-
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
568
|
-
IsNever<Exclude<B, A>> extends true ? true : false
|
|
569
|
-
>;
|
|
570
|
-
|
|
571
|
-
type EndIfEqual<I extends string, O extends string> =
|
|
572
|
-
AreStringsEqual<I, O> extends true
|
|
573
|
-
? never
|
|
574
|
-
: void;
|
|
575
|
-
|
|
576
|
-
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
577
|
-
if (input === output) {
|
|
578
|
-
process.exit(0);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
endIfEqual('abc', 'abc');
|
|
583
|
-
//=> never
|
|
584
|
-
|
|
585
|
-
endIfEqual('abc', '123');
|
|
586
|
-
//=> void
|
|
587
|
-
```
|
|
588
|
-
|
|
589
|
-
@category Type Guard
|
|
590
|
-
@category Utilities
|
|
591
|
-
*/
|
|
592
|
-
export type IsNever<T> = [
|
|
593
|
-
T
|
|
594
|
-
] extends [
|
|
595
|
-
never
|
|
596
|
-
] ? true : false;
|
|
597
|
-
/**
|
|
598
|
-
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
599
|
-
|
|
600
|
-
@example
|
|
601
|
-
```
|
|
602
|
-
import type {Merge} from 'type-fest';
|
|
603
|
-
|
|
604
|
-
interface Foo {
|
|
605
|
-
[x: string]: unknown;
|
|
606
|
-
[x: number]: unknown;
|
|
607
|
-
foo: string;
|
|
608
|
-
bar: symbol;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
type Bar = {
|
|
612
|
-
[x: number]: number;
|
|
613
|
-
[x: symbol]: unknown;
|
|
614
|
-
bar: Date;
|
|
615
|
-
baz: boolean;
|
|
616
|
-
};
|
|
617
|
-
|
|
618
|
-
export type FooBar = Merge<Foo, Bar>;
|
|
619
|
-
// => {
|
|
620
|
-
// [x: string]: unknown;
|
|
621
|
-
// [x: number]: number;
|
|
622
|
-
// [x: symbol]: unknown;
|
|
623
|
-
// foo: string;
|
|
624
|
-
// bar: Date;
|
|
625
|
-
// baz: boolean;
|
|
626
|
-
// }
|
|
627
|
-
```
|
|
628
|
-
|
|
629
|
-
@category Object
|
|
630
|
-
*/
|
|
631
|
-
export type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
632
|
-
/**
|
|
633
|
-
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
634
|
-
|
|
635
|
-
This is the counterpart of `PickIndexSignature`.
|
|
636
|
-
|
|
637
|
-
Use-cases:
|
|
638
|
-
- Remove overly permissive signatures from third-party types.
|
|
639
|
-
|
|
640
|
-
This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
|
|
641
|
-
|
|
642
|
-
It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, unknown>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`.
|
|
643
|
-
|
|
644
|
-
(The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
|
|
645
|
-
|
|
646
|
-
```
|
|
647
|
-
const indexed: Record<string, unknown> = {}; // Allowed
|
|
648
|
-
|
|
649
|
-
const keyed: Record<'foo', unknown> = {}; // Error
|
|
650
|
-
// => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
|
|
651
|
-
```
|
|
652
|
-
|
|
653
|
-
Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
|
|
654
|
-
|
|
655
|
-
```
|
|
656
|
-
type Indexed = {} extends Record<string, unknown>
|
|
657
|
-
? '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
658
|
-
: '❌ `{}` is NOT assignable to `Record<string, unknown>`';
|
|
659
|
-
// => '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
660
|
-
|
|
661
|
-
type Keyed = {} extends Record<'foo' | 'bar', unknown>
|
|
662
|
-
? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`"
|
|
663
|
-
: "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`";
|
|
664
|
-
// => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
|
|
665
|
-
```
|
|
666
|
-
|
|
667
|
-
Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
|
|
668
|
-
|
|
669
|
-
```
|
|
670
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
671
|
-
|
|
672
|
-
type OmitIndexSignature<ObjectType> = {
|
|
673
|
-
[KeyType in keyof ObjectType // Map each key of `ObjectType`...
|
|
674
|
-
]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
|
|
675
|
-
};
|
|
676
|
-
```
|
|
677
|
-
|
|
678
|
-
...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
|
|
679
|
-
|
|
680
|
-
```
|
|
681
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
682
|
-
|
|
683
|
-
type OmitIndexSignature<ObjectType> = {
|
|
684
|
-
[KeyType in keyof ObjectType
|
|
685
|
-
// Is `{}` assignable to `Record<KeyType, unknown>`?
|
|
686
|
-
as {} extends Record<KeyType, unknown>
|
|
687
|
-
? ... // ✅ `{}` is assignable to `Record<KeyType, unknown>`
|
|
688
|
-
: ... // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
|
|
689
|
-
]: ObjectType[KeyType];
|
|
690
|
-
};
|
|
691
|
-
```
|
|
692
|
-
|
|
693
|
-
If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it.
|
|
694
|
-
|
|
695
|
-
@example
|
|
696
|
-
```
|
|
697
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
698
|
-
|
|
699
|
-
interface Example {
|
|
700
|
-
// These index signatures will be removed.
|
|
701
|
-
[x: string]: any
|
|
702
|
-
[x: number]: any
|
|
703
|
-
[x: symbol]: any
|
|
704
|
-
[x: `head-${string}`]: string
|
|
705
|
-
[x: `${string}-tail`]: string
|
|
706
|
-
[x: `head-${string}-tail`]: string
|
|
707
|
-
[x: `${bigint}`]: string
|
|
708
|
-
[x: `embedded-${number}`]: string
|
|
709
|
-
|
|
710
|
-
// These explicitly defined keys will remain.
|
|
711
|
-
foo: 'bar';
|
|
712
|
-
qux?: 'baz';
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
716
|
-
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
717
|
-
```
|
|
718
|
-
|
|
719
|
-
@see PickIndexSignature
|
|
720
|
-
@category Object
|
|
721
|
-
*/
|
|
722
|
-
export type OmitIndexSignature<ObjectType> = {
|
|
723
|
-
[KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType];
|
|
724
|
-
};
|
|
725
9
|
/**
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
This is
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
10
|
+
* Functional Reactive Programming (FRP) Bus
|
|
11
|
+
* A simple implementation of an FRP bus using streams and operators.
|
|
12
|
+
* This is a basic implementation and can be extended with more operators as needed.
|
|
13
|
+
*/
|
|
14
|
+
type Observer<T> = (value: T) => void | Promise<void>;
|
|
15
|
+
type Unsubscribe = () => void;
|
|
16
|
+
interface Stream<T> {
|
|
17
|
+
(observer: Observer<T>): Unsubscribe;
|
|
18
|
+
unsubscribeAll(this: void): void;
|
|
19
|
+
filter(this: void, predicate: (value: T) => boolean): Stream<T>;
|
|
20
|
+
narrow<U extends T>(this: void, predicate: (value: T) => value is U): Stream<U>;
|
|
21
|
+
map<V>(this: void, fn: (value: T) => V): Stream<V>;
|
|
22
|
+
wait(this: void, opts: {
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
}): Promise<T>;
|
|
739
26
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
[Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
|
|
744
|
-
};
|
|
745
|
-
|
|
746
|
-
const update1: UpdateOperation<User> = {
|
|
747
|
-
name: 'Alice'
|
|
748
|
-
};
|
|
749
|
-
|
|
750
|
-
const update2: UpdateOperation<User> = {
|
|
751
|
-
name: 'Bob',
|
|
752
|
-
luckyNumber: REMOVE_FIELD
|
|
753
|
-
};
|
|
754
|
-
```
|
|
755
|
-
|
|
756
|
-
@category Utilities
|
|
757
|
-
*/
|
|
758
|
-
export type OptionalKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
|
|
759
|
-
? (keyof {
|
|
760
|
-
[Key in keyof BaseType as BaseType extends Record<Key, BaseType[Key]> ? never : Key]: never;
|
|
761
|
-
}) & (keyof BaseType) // Intersect with `keyof BaseType` to ensure result of `OptionalKeysOf<BaseType>` is always assignable to `keyof BaseType`
|
|
762
|
-
: never; // Should never happen
|
|
763
|
-
/**
|
|
764
|
-
Create a type from another type with all keys and nested keys set to optional.
|
|
765
|
-
|
|
766
|
-
Use-cases:
|
|
767
|
-
- Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
|
|
768
|
-
- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.
|
|
769
|
-
|
|
770
|
-
@example
|
|
771
|
-
```
|
|
772
|
-
import type {PartialDeep} from 'type-fest';
|
|
773
|
-
|
|
774
|
-
const settings: Settings = {
|
|
775
|
-
textEditor: {
|
|
776
|
-
fontSize: 14,
|
|
777
|
-
fontColor: '#000000',
|
|
778
|
-
fontWeight: 400
|
|
779
|
-
},
|
|
780
|
-
autocomplete: false,
|
|
781
|
-
autosave: true
|
|
27
|
+
type frpBus<T> = {
|
|
28
|
+
stream: Stream<T>;
|
|
29
|
+
emit: <U extends T>(value: U) => void;
|
|
782
30
|
};
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
settings = applySavedSettings({textEditor: {fontWeight: 500}});
|
|
789
|
-
```
|
|
790
|
-
|
|
791
|
-
By default, this does not affect elements in array and tuple types. You can change this by passing `{recurseIntoArrays: true}` as the second type argument:
|
|
792
|
-
|
|
793
|
-
```
|
|
794
|
-
import type {PartialDeep} from 'type-fest';
|
|
795
|
-
|
|
796
|
-
type Settings = {
|
|
797
|
-
languages: string[];
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true}> = {
|
|
801
|
-
languages: [undefined]
|
|
802
|
-
};
|
|
803
|
-
```
|
|
804
|
-
|
|
805
|
-
@see {@link PartialDeepOptions}
|
|
806
|
-
|
|
807
|
-
@category Object
|
|
808
|
-
@category Array
|
|
809
|
-
@category Set
|
|
810
|
-
@category Map
|
|
811
|
-
*/
|
|
812
|
-
export type PartialDeep<T, Options extends PartialDeepOptions = {}> = _PartialDeep<T, ApplyDefaultOptions<PartialDeepOptions, DefaultPartialDeepOptions, Options>>;
|
|
813
|
-
/**
|
|
814
|
-
@see {@link PartialDeep}
|
|
815
|
-
*/
|
|
816
|
-
export type PartialDeepOptions = {
|
|
817
|
-
/**
|
|
818
|
-
Whether to affect the individual elements of arrays and tuples.
|
|
819
|
-
|
|
820
|
-
@default false
|
|
821
|
-
*/
|
|
822
|
-
readonly recurseIntoArrays?: boolean;
|
|
823
|
-
/**
|
|
824
|
-
Allows `undefined` values in non-tuple arrays.
|
|
825
|
-
|
|
826
|
-
- When set to `true`, elements of non-tuple arrays can be `undefined`.
|
|
827
|
-
- When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking.
|
|
828
|
-
|
|
829
|
-
@default true
|
|
830
|
-
|
|
831
|
-
@example
|
|
832
|
-
You can prevent `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}` as the second type argument:
|
|
833
|
-
|
|
834
|
-
```
|
|
835
|
-
import type {PartialDeep} from 'type-fest';
|
|
836
|
-
|
|
837
|
-
type Settings = {
|
|
838
|
-
languages: string[];
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}>;
|
|
842
|
-
|
|
843
|
-
partialSettings.languages = [undefined]; // Error
|
|
844
|
-
partialSettings.languages = []; // Ok
|
|
845
|
-
```
|
|
846
|
-
*/
|
|
847
|
-
readonly allowUndefinedInNonTupleArrays?: boolean;
|
|
848
|
-
};
|
|
849
|
-
/**
|
|
850
|
-
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
|
|
851
|
-
*/
|
|
852
|
-
export type PartialMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & Map<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
|
|
853
|
-
/**
|
|
854
|
-
Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
|
|
855
|
-
*/
|
|
856
|
-
export type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = (ObjectType extends (...arguments_: any) => unknown ? (...arguments_: Parameters<ObjectType>) => ReturnType<ObjectType> : {}) & ({
|
|
857
|
-
[KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options>;
|
|
858
|
-
});
|
|
859
|
-
/**
|
|
860
|
-
Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
|
|
861
|
-
*/
|
|
862
|
-
export type PartialReadonlyMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & ReadonlyMap<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
|
|
863
|
-
/**
|
|
864
|
-
Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
|
|
865
|
-
*/
|
|
866
|
-
export type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptions>> = {} & ReadonlySet<_PartialDeep<T, Options>>;
|
|
867
|
-
/**
|
|
868
|
-
Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
|
|
869
|
-
*/
|
|
870
|
-
export type PartialSetDeep<T, Options extends Required<PartialDeepOptions>> = {} & Set<_PartialDeep<T, Options>>;
|
|
871
|
-
/**
|
|
872
|
-
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
873
|
-
|
|
874
|
-
This is the counterpart of `OmitIndexSignature`.
|
|
875
|
-
|
|
876
|
-
@example
|
|
877
|
-
```
|
|
878
|
-
import type {PickIndexSignature} from 'type-fest';
|
|
879
|
-
|
|
880
|
-
declare const symbolKey: unique symbol;
|
|
881
|
-
|
|
882
|
-
type Example = {
|
|
883
|
-
// These index signatures will remain.
|
|
884
|
-
[x: string]: unknown;
|
|
885
|
-
[x: number]: unknown;
|
|
886
|
-
[x: symbol]: unknown;
|
|
887
|
-
[x: `head-${string}`]: string;
|
|
888
|
-
[x: `${string}-tail`]: string;
|
|
889
|
-
[x: `head-${string}-tail`]: string;
|
|
890
|
-
[x: `${bigint}`]: string;
|
|
891
|
-
[x: `embedded-${number}`]: string;
|
|
892
|
-
|
|
893
|
-
// These explicitly defined keys will be removed.
|
|
894
|
-
['kebab-case-key']: string;
|
|
895
|
-
[symbolKey]: string;
|
|
896
|
-
foo: 'bar';
|
|
897
|
-
qux?: 'baz';
|
|
31
|
+
type Port<Tx, Rx = Tx> = {
|
|
32
|
+
send: frpBus<Tx>['emit'];
|
|
33
|
+
receive: frpBus<Rx>['stream'];
|
|
34
|
+
connect: <Tx, Rx extends oTx, oTx, oRx extends Tx>(this: Port<Tx, Rx>, other: Port<oTx, oRx>) => Unsubscribe;
|
|
898
35
|
};
|
|
899
36
|
|
|
900
|
-
type
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
// [x: `head-${string}`]: string;
|
|
906
|
-
// [x: `${string}-tail`]: string;
|
|
907
|
-
// [x: `head-${string}-tail`]: string;
|
|
908
|
-
// [x: `${bigint}`]: string;
|
|
909
|
-
// [x: `embedded-${number}`]: string;
|
|
910
|
-
// }
|
|
911
|
-
```
|
|
912
|
-
|
|
913
|
-
@see OmitIndexSignature
|
|
914
|
-
@category Object
|
|
915
|
-
*/
|
|
916
|
-
export type PickIndexSignature<ObjectType> = {
|
|
917
|
-
[KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType];
|
|
37
|
+
type Expand<T> = T extends infer U ? {
|
|
38
|
+
[K in keyof U]: U[K];
|
|
39
|
+
} : never;
|
|
40
|
+
type WithRequired<T, K extends keyof T> = Omit<T, K> & {
|
|
41
|
+
[P in K]-?: Exclude<T[P], undefined>;
|
|
918
42
|
};
|
|
919
43
|
/**
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
*/
|
|
924
|
-
export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
925
|
-
/**
|
|
926
|
-
Extract all required keys from the given type.
|
|
927
|
-
|
|
928
|
-
This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...
|
|
929
|
-
|
|
930
|
-
@example
|
|
931
|
-
```
|
|
932
|
-
import type {RequiredKeysOf} from 'type-fest';
|
|
933
|
-
|
|
934
|
-
declare function createValidation<Entity extends object, Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn;
|
|
935
|
-
|
|
936
|
-
interface User {
|
|
937
|
-
name: string;
|
|
938
|
-
surname: string;
|
|
939
|
-
|
|
940
|
-
luckyNumber?: number;
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
const validator1 = createValidation<User>('name', value => value.length < 25);
|
|
944
|
-
const validator2 = createValidation<User>('surname', value => value.length < 25);
|
|
945
|
-
```
|
|
946
|
-
|
|
947
|
-
@category Utilities
|
|
948
|
-
*/
|
|
949
|
-
export type RequiredKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
|
|
950
|
-
? Exclude<keyof BaseType, OptionalKeysOf<BaseType>> : never; // Should never happen
|
|
951
|
-
// Merges two objects without worrying about index signatures.
|
|
952
|
-
export type SimpleMerge<Destination, Source> = {
|
|
953
|
-
[Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key];
|
|
954
|
-
} & Source;
|
|
955
|
-
/**
|
|
956
|
-
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
957
|
-
|
|
958
|
-
@example
|
|
959
|
-
```
|
|
960
|
-
import type {Simplify} from 'type-fest';
|
|
961
|
-
|
|
962
|
-
type PositionProps = {
|
|
963
|
-
top: number;
|
|
964
|
-
left: number;
|
|
965
|
-
};
|
|
44
|
+
* Type representing a thunk: a function that takes no arguments and returns T.
|
|
45
|
+
*/
|
|
46
|
+
type Thunk<T> = () => T;
|
|
966
47
|
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
48
|
+
declare const TaskNode: z.ZodObject<{
|
|
49
|
+
role: z.ZodEnum<{
|
|
50
|
+
function: "function";
|
|
51
|
+
system: "system";
|
|
52
|
+
user: "user";
|
|
53
|
+
assistant: "assistant";
|
|
54
|
+
}>;
|
|
55
|
+
name: z.ZodOptional<z.ZodString>;
|
|
56
|
+
content: z.ZodUnion<readonly [z.ZodObject<{
|
|
57
|
+
type: z.ZodLiteral<"message">;
|
|
58
|
+
data: z.ZodString;
|
|
59
|
+
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>>;
|
|
68
|
+
}, 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>>>;
|
|
74
|
+
}, z.core.$strip>]>>>;
|
|
75
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
76
|
+
type: z.ZodLiteral<"toolresult">;
|
|
77
|
+
data: z.ZodUnknown;
|
|
78
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
79
|
+
type: z.ZodLiteral<"tooldefinition">;
|
|
80
|
+
data: z.ZodObject<{
|
|
81
|
+
description: z.ZodString;
|
|
82
|
+
longDescription: z.ZodOptional<z.ZodString>;
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
parameters: z.ZodReadonly<z.ZodType<json_schema.JSONSchema7, unknown, z.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
89
|
+
code: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
92
|
+
type: z.ZodLiteral<"error">;
|
|
93
|
+
data: z.ZodUnknown;
|
|
94
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
95
|
+
type: z.ZodLiteral<"structured">;
|
|
96
|
+
data: z.ZodUnknown;
|
|
97
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
98
|
+
type: z.ZodLiteral<"functioncall">;
|
|
99
|
+
data: z.ZodObject<{
|
|
100
|
+
name: z.ZodString;
|
|
101
|
+
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]>>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
104
|
+
type: z.ZodLiteral<"files">;
|
|
105
|
+
data: z.ZodArray<z.ZodString>;
|
|
106
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
107
|
+
type: z.ZodLiteral<"return">;
|
|
108
|
+
data: z.ZodString;
|
|
109
|
+
}, z.core.$strict>]>;
|
|
110
|
+
label: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
111
|
+
parentID: z.ZodOptional<z.ZodString>;
|
|
112
|
+
priorID: z.ZodOptional<z.ZodString>;
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
authorId: z.ZodOptional<z.ZodString>;
|
|
115
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
acl: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
sig: z.ZodOptional<z.ZodString>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
type TaskNode = z.infer<typeof TaskNode>;
|
|
120
|
+
declare const partialTaskDraft: z.ZodObject<{
|
|
121
|
+
role: z.ZodNonOptional<z.ZodOptional<z.ZodEnum<{
|
|
122
|
+
function: "function";
|
|
123
|
+
system: "system";
|
|
124
|
+
user: "user";
|
|
125
|
+
assistant: "assistant";
|
|
126
|
+
}>>>;
|
|
127
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
128
|
+
content: z.ZodNonOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
129
|
+
type: z.ZodLiteral<"message">;
|
|
130
|
+
data: z.ZodString;
|
|
131
|
+
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>>;
|
|
140
|
+
}, 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>>>;
|
|
146
|
+
}, z.core.$strip>]>>>;
|
|
147
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
148
|
+
type: z.ZodLiteral<"toolresult">;
|
|
149
|
+
data: z.ZodUnknown;
|
|
150
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
151
|
+
type: z.ZodLiteral<"tooldefinition">;
|
|
152
|
+
data: z.ZodObject<{
|
|
153
|
+
description: z.ZodString;
|
|
154
|
+
longDescription: z.ZodOptional<z.ZodString>;
|
|
155
|
+
name: z.ZodString;
|
|
156
|
+
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
parameters: z.ZodReadonly<z.ZodType<json_schema.JSONSchema7, unknown, z.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
161
|
+
code: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
164
|
+
type: z.ZodLiteral<"error">;
|
|
165
|
+
data: z.ZodUnknown;
|
|
166
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
167
|
+
type: z.ZodLiteral<"structured">;
|
|
168
|
+
data: z.ZodUnknown;
|
|
169
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
170
|
+
type: z.ZodLiteral<"functioncall">;
|
|
171
|
+
data: z.ZodObject<{
|
|
172
|
+
name: z.ZodString;
|
|
173
|
+
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]>>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
176
|
+
type: z.ZodLiteral<"files">;
|
|
177
|
+
data: z.ZodArray<z.ZodString>;
|
|
178
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
179
|
+
type: z.ZodLiteral<"return">;
|
|
180
|
+
data: z.ZodString;
|
|
181
|
+
}, z.core.$strict>]>>>;
|
|
182
|
+
label: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
183
|
+
parentID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
184
|
+
priorID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
185
|
+
id: z.ZodOptional<z.ZodString>;
|
|
186
|
+
authorId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
187
|
+
created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
188
|
+
acl: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
189
|
+
sig: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
type partialTaskDraft = z.infer<typeof partialTaskDraft>;
|
|
192
|
+
type TaskNodeType<K extends TaskNode['content']['type']> = TaskNode extends {
|
|
193
|
+
content: infer C;
|
|
194
|
+
} ? C extends {
|
|
195
|
+
type: K;
|
|
196
|
+
} ? Expand<Omit<TaskNode, 'content'> & {
|
|
197
|
+
content: C;
|
|
198
|
+
}> : never : never;
|
|
199
|
+
type FileMapping = {
|
|
200
|
+
id: string;
|
|
201
|
+
name?: string;
|
|
202
|
+
size?: number;
|
|
203
|
+
opfs?: string;
|
|
204
|
+
openAIFileId?: string;
|
|
205
|
+
type: string;
|
|
206
|
+
data?: string;
|
|
970
207
|
};
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
```
|
|
975
|
-
|
|
976
|
-
Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.
|
|
977
|
-
|
|
978
|
-
If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.
|
|
979
|
-
|
|
980
|
-
@example
|
|
981
|
-
```
|
|
982
|
-
import type {Simplify} from 'type-fest';
|
|
983
|
-
|
|
984
|
-
interface SomeInterface {
|
|
985
|
-
foo: number;
|
|
986
|
-
bar?: string;
|
|
987
|
-
baz: number | undefined;
|
|
208
|
+
interface TaskTreeNode {
|
|
209
|
+
task: TaskNode;
|
|
210
|
+
children: TaskTreeNode[][];
|
|
988
211
|
}
|
|
989
212
|
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
213
|
+
declare const FunctionCall: z.ZodObject<{
|
|
214
|
+
name: z.ZodString;
|
|
215
|
+
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]>>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
type FunctionCall = z.infer<typeof FunctionCall>;
|
|
218
|
+
declare const ToolBase: z.ZodObject<{
|
|
219
|
+
description: z.ZodString;
|
|
220
|
+
longDescription: z.ZodOptional<z.ZodString>;
|
|
221
|
+
name: z.ZodString;
|
|
222
|
+
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
224
|
+
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
225
|
+
}, z.core.$strip>>;
|
|
226
|
+
parameters: z.ZodReadonly<z.ZodType<json_schema.JSONSchema7, unknown, z.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
227
|
+
code: z.ZodOptional<z.ZodString>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
type ToolBase = z.infer<typeof ToolBase>;
|
|
1007
230
|
|
|
1008
|
-
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
1009
|
-
@see SimplifyDeep
|
|
1010
|
-
@category Object
|
|
1011
|
-
*/
|
|
1012
|
-
export type Simplify<T> = {
|
|
1013
|
-
[KeyType in keyof T]: T[KeyType];
|
|
1014
|
-
} & {};
|
|
1015
|
-
export type TaskNode = z.infer<typeof TaskNode>;
|
|
1016
|
-
export type TyProfile = z.infer<typeof TyProfile>;
|
|
1017
|
-
export type WithRequired<T, K extends keyof T> = Omit<T, K> & {
|
|
1018
|
-
[P in K]-?: Exclude<T[P], undefined>;
|
|
1019
|
-
};
|
|
1020
|
-
export type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown)) ? T : IsNever<keyof T> extends true // For functions with no properties
|
|
1021
|
-
? T : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType, Options> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType, Options> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType, Options> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType, Options> : T extends object ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
|
|
1022
|
-
? Options["recurseIntoArrays"] extends true ? ItemType[] extends T // Test for arrays (non-tuples) specifically
|
|
1023
|
-
? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
|
|
1024
|
-
? ReadonlyArray<_PartialDeep<Options["allowUndefinedInNonTupleArrays"] extends false ? ItemType : ItemType | undefined, Options>> : Array<_PartialDeep<Options["allowUndefinedInNonTupleArrays"] extends false ? ItemType : ItemType | undefined, Options>> : PartialObjectDeep<T, Options> // Tuples behave properly
|
|
1025
|
-
: T // If they don't opt into array testing, just use the original type
|
|
1026
|
-
: PartialObjectDeep<T, Options> : unknown;
|
|
1027
|
-
export type partialTaskDraft = z.infer<typeof partialTaskDraft>;
|
|
1028
|
-
export type partialTyConfiguration = PartialDeep<TyProfile>;
|
|
1029
|
-
export type taskResult = z.infer<typeof taskResult>;
|
|
1030
231
|
/**
|
|
1031
232
|
* Represents the context passed to tools within the Taskyon system.
|
|
1032
233
|
*
|
|
@@ -1044,15 +245,1969 @@ export type taskResult = z.infer<typeof taskResult>;
|
|
|
1044
245
|
* @property stopSignal - An AbortSignal that can be used to detect if the tool should stop execution.
|
|
1045
246
|
* @property toolId - The unique identifier for the tool instance.
|
|
1046
247
|
*/
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
248
|
+
type toolContext = {
|
|
249
|
+
taskChain: TaskNode[];
|
|
250
|
+
getSecret: (name: string, askNew: boolean | string, saveNew?: boolean) => Promise<string | null>;
|
|
251
|
+
setSecret: (name: string, value: string) => Promise<void>;
|
|
252
|
+
stopSignal: AbortSignal;
|
|
253
|
+
toolId: string;
|
|
254
|
+
messagePort?: MessagePort;
|
|
1054
255
|
};
|
|
1055
|
-
|
|
1056
|
-
|
|
256
|
+
declare const InternalTool: z.ZodObject<{
|
|
257
|
+
description: z.ZodString;
|
|
258
|
+
longDescription: z.ZodOptional<z.ZodString>;
|
|
259
|
+
name: z.ZodString;
|
|
260
|
+
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
262
|
+
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
263
|
+
}, z.core.$strip>>;
|
|
264
|
+
parameters: z.ZodReadonly<z.ZodType<json_schema.JSONSchema7, unknown, z.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
265
|
+
code: z.ZodOptional<z.ZodString>;
|
|
266
|
+
function: z.ZodOptional<z.ZodCustom<(params: any, context: toolContext) => unknown, (params: any, context: toolContext) => unknown>>;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
type InternalTool = z.infer<typeof InternalTool>;
|
|
269
|
+
type ClientTool = WithRequired<InternalTool, 'function'>;
|
|
270
|
+
declare function createTool<T, SCHEMA extends Readonly<JSONSchema>, PARAMS = FromSchema<SCHEMA>>(tool: T & {
|
|
271
|
+
parameters: SCHEMA;
|
|
272
|
+
function?: (params: PARAMS, context: toolContext) => unknown;
|
|
273
|
+
} & Omit<InternalTool, 'function' | 'parameters'>): T;
|
|
274
|
+
declare function toolCall<T extends FunctionCall['arguments']>(f: {
|
|
275
|
+
arguments: T;
|
|
276
|
+
} & FunctionCall): partialTaskDraft & {
|
|
277
|
+
content: {
|
|
278
|
+
type: 'functioncall';
|
|
279
|
+
data: FunctionCall;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
declare const taskResult: z.ZodObject<{
|
|
283
|
+
taskResultMarker: z.ZodDefault<z.ZodLiteral<"*TY_TASKRESULT*">>;
|
|
284
|
+
taskChainList: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
285
|
+
role: z.ZodNonOptional<z.ZodOptional<z.ZodEnum<{
|
|
286
|
+
function: "function";
|
|
287
|
+
system: "system";
|
|
288
|
+
user: "user";
|
|
289
|
+
assistant: "assistant";
|
|
290
|
+
}>>>;
|
|
291
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
292
|
+
content: z.ZodNonOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
293
|
+
type: z.ZodLiteral<"message">;
|
|
294
|
+
data: z.ZodString;
|
|
295
|
+
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>>;
|
|
304
|
+
}, 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>>>;
|
|
310
|
+
}, z.core.$strip>]>>>;
|
|
311
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
312
|
+
type: z.ZodLiteral<"toolresult">;
|
|
313
|
+
data: z.ZodUnknown;
|
|
314
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
315
|
+
type: z.ZodLiteral<"tooldefinition">;
|
|
316
|
+
data: z.ZodObject<{
|
|
317
|
+
description: z.ZodString;
|
|
318
|
+
longDescription: z.ZodOptional<z.ZodString>;
|
|
319
|
+
name: z.ZodString;
|
|
320
|
+
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
321
|
+
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
322
|
+
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
323
|
+
}, z.core.$strip>>;
|
|
324
|
+
parameters: z.ZodReadonly<z.ZodType<json_schema.JSONSchema7, unknown, z.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
325
|
+
code: z.ZodOptional<z.ZodString>;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
328
|
+
type: z.ZodLiteral<"error">;
|
|
329
|
+
data: z.ZodUnknown;
|
|
330
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
331
|
+
type: z.ZodLiteral<"structured">;
|
|
332
|
+
data: z.ZodUnknown;
|
|
333
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
334
|
+
type: z.ZodLiteral<"functioncall">;
|
|
335
|
+
data: z.ZodObject<{
|
|
336
|
+
name: z.ZodString;
|
|
337
|
+
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]>>;
|
|
338
|
+
}, z.core.$strip>;
|
|
339
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
340
|
+
type: z.ZodLiteral<"files">;
|
|
341
|
+
data: z.ZodArray<z.ZodString>;
|
|
342
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
343
|
+
type: z.ZodLiteral<"return">;
|
|
344
|
+
data: z.ZodString;
|
|
345
|
+
}, z.core.$strict>]>>>;
|
|
346
|
+
label: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
347
|
+
parentID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
348
|
+
priorID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
349
|
+
id: z.ZodOptional<z.ZodString>;
|
|
350
|
+
authorId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
351
|
+
created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
352
|
+
acl: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
353
|
+
sig: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
354
|
+
}, z.core.$strip>>>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
type taskResult = z.infer<typeof taskResult>;
|
|
357
|
+
declare function makeTaskResult(tasks: partialTaskDraft | partialTaskDraft[] | partialTaskDraft[][]): taskResult;
|
|
1057
358
|
|
|
1058
|
-
|
|
359
|
+
type TyPGDB = PGliteWorker & {
|
|
360
|
+
live: LiveNamespace;
|
|
361
|
+
} & {
|
|
362
|
+
name?: string;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
declare function useTyTaskManager(taskyonDb: TyPGDB, vectorizerModel?: string): Promise<{
|
|
366
|
+
getTaskIdChain: (taskId: string, maxFollow?: number, untilTaskID?: string | undefined, onlyFirstChild?: boolean) => Promise<string[]>;
|
|
367
|
+
getTaskChain: (taskId: string) => Promise<TaskNode[]>;
|
|
368
|
+
convertTaskIDs: (taskIds: string[]) => Promise<{
|
|
369
|
+
role: "function" | "system" | "user" | "assistant";
|
|
370
|
+
content: {
|
|
371
|
+
type: "message";
|
|
372
|
+
data: string;
|
|
373
|
+
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;
|
|
382
|
+
} | {
|
|
383
|
+
type: "file";
|
|
384
|
+
content?: {
|
|
385
|
+
text: string;
|
|
386
|
+
type: string;
|
|
387
|
+
}[] | undefined;
|
|
388
|
+
})[] | undefined;
|
|
389
|
+
} | {
|
|
390
|
+
type: "toolresult";
|
|
391
|
+
data: unknown;
|
|
392
|
+
} | {
|
|
393
|
+
type: "tooldefinition";
|
|
394
|
+
data: {
|
|
395
|
+
description: string;
|
|
396
|
+
name: string;
|
|
397
|
+
parameters: Readonly<json_schema.JSONSchema7>;
|
|
398
|
+
longDescription?: string | undefined;
|
|
399
|
+
renderOptions?: {
|
|
400
|
+
hideChat?: boolean | undefined;
|
|
401
|
+
hideLlm?: boolean | undefined;
|
|
402
|
+
} | undefined;
|
|
403
|
+
code?: string | undefined;
|
|
404
|
+
};
|
|
405
|
+
} | {
|
|
406
|
+
type: "error";
|
|
407
|
+
data: unknown;
|
|
408
|
+
} | {
|
|
409
|
+
type: "structured";
|
|
410
|
+
data: unknown;
|
|
411
|
+
} | {
|
|
412
|
+
type: "functioncall";
|
|
413
|
+
data: {
|
|
414
|
+
name: string;
|
|
415
|
+
arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
|
|
416
|
+
};
|
|
417
|
+
} | {
|
|
418
|
+
type: "files";
|
|
419
|
+
data: string[];
|
|
420
|
+
} | {
|
|
421
|
+
type: "return";
|
|
422
|
+
data: string;
|
|
423
|
+
};
|
|
424
|
+
id: string;
|
|
425
|
+
name?: string | undefined;
|
|
426
|
+
label?: string[] | undefined;
|
|
427
|
+
parentID?: string | undefined;
|
|
428
|
+
priorID?: string | undefined;
|
|
429
|
+
authorId?: string | undefined;
|
|
430
|
+
created_at?: number | undefined;
|
|
431
|
+
acl?: string[] | undefined;
|
|
432
|
+
sig?: string | undefined;
|
|
433
|
+
}[]>;
|
|
434
|
+
buildSiblingChain: (taskId: string, maxDepth: number) => Promise<TaskTreeNode[]>;
|
|
435
|
+
buildTaskTreeNode: (taskId: string, maxDepth: number) => Promise<TaskTreeNode>;
|
|
436
|
+
addPartialTask2Tree: (task: partialTaskDraft) => Promise<{
|
|
437
|
+
role: "function" | "system" | "user" | "assistant";
|
|
438
|
+
content: {
|
|
439
|
+
type: "message";
|
|
440
|
+
data: string;
|
|
441
|
+
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;
|
|
450
|
+
} | {
|
|
451
|
+
type: "file";
|
|
452
|
+
content?: {
|
|
453
|
+
text: string;
|
|
454
|
+
type: string;
|
|
455
|
+
}[] | undefined;
|
|
456
|
+
})[] | undefined;
|
|
457
|
+
} | {
|
|
458
|
+
type: "toolresult";
|
|
459
|
+
data: unknown;
|
|
460
|
+
} | {
|
|
461
|
+
type: "tooldefinition";
|
|
462
|
+
data: {
|
|
463
|
+
description: string;
|
|
464
|
+
name: string;
|
|
465
|
+
parameters: Readonly<json_schema.JSONSchema7>;
|
|
466
|
+
longDescription?: string | undefined;
|
|
467
|
+
renderOptions?: {
|
|
468
|
+
hideChat?: boolean | undefined;
|
|
469
|
+
hideLlm?: boolean | undefined;
|
|
470
|
+
} | undefined;
|
|
471
|
+
code?: string | undefined;
|
|
472
|
+
};
|
|
473
|
+
} | {
|
|
474
|
+
type: "error";
|
|
475
|
+
data: unknown;
|
|
476
|
+
} | {
|
|
477
|
+
type: "structured";
|
|
478
|
+
data: unknown;
|
|
479
|
+
} | {
|
|
480
|
+
type: "functioncall";
|
|
481
|
+
data: {
|
|
482
|
+
name: string;
|
|
483
|
+
arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
|
|
484
|
+
};
|
|
485
|
+
} | {
|
|
486
|
+
type: "files";
|
|
487
|
+
data: string[];
|
|
488
|
+
} | {
|
|
489
|
+
type: "return";
|
|
490
|
+
data: string;
|
|
491
|
+
};
|
|
492
|
+
id: string;
|
|
493
|
+
name?: string | undefined;
|
|
494
|
+
label?: string[] | undefined;
|
|
495
|
+
parentID?: string | undefined;
|
|
496
|
+
priorID?: string | undefined;
|
|
497
|
+
authorId?: string | undefined;
|
|
498
|
+
created_at?: number | undefined;
|
|
499
|
+
acl?: string[] | undefined;
|
|
500
|
+
sig?: string | undefined;
|
|
501
|
+
}>;
|
|
502
|
+
addTaskChain: (taskList: partialTaskDraft[], priorID?: string | undefined, parentID?: string | undefined) => Promise<{
|
|
503
|
+
role: "function" | "system" | "user" | "assistant";
|
|
504
|
+
content: {
|
|
505
|
+
type: "message";
|
|
506
|
+
data: string;
|
|
507
|
+
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;
|
|
516
|
+
} | {
|
|
517
|
+
type: "file";
|
|
518
|
+
content?: {
|
|
519
|
+
text: string;
|
|
520
|
+
type: string;
|
|
521
|
+
}[] | undefined;
|
|
522
|
+
})[] | undefined;
|
|
523
|
+
} | {
|
|
524
|
+
type: "toolresult";
|
|
525
|
+
data: unknown;
|
|
526
|
+
} | {
|
|
527
|
+
type: "tooldefinition";
|
|
528
|
+
data: {
|
|
529
|
+
description: string;
|
|
530
|
+
name: string;
|
|
531
|
+
parameters: Readonly<json_schema.JSONSchema7>;
|
|
532
|
+
longDescription?: string | undefined;
|
|
533
|
+
renderOptions?: {
|
|
534
|
+
hideChat?: boolean | undefined;
|
|
535
|
+
hideLlm?: boolean | undefined;
|
|
536
|
+
} | undefined;
|
|
537
|
+
code?: string | undefined;
|
|
538
|
+
};
|
|
539
|
+
} | {
|
|
540
|
+
type: "error";
|
|
541
|
+
data: unknown;
|
|
542
|
+
} | {
|
|
543
|
+
type: "structured";
|
|
544
|
+
data: unknown;
|
|
545
|
+
} | {
|
|
546
|
+
type: "functioncall";
|
|
547
|
+
data: {
|
|
548
|
+
name: string;
|
|
549
|
+
arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
|
|
550
|
+
};
|
|
551
|
+
} | {
|
|
552
|
+
type: "files";
|
|
553
|
+
data: string[];
|
|
554
|
+
} | {
|
|
555
|
+
type: "return";
|
|
556
|
+
data: string;
|
|
557
|
+
};
|
|
558
|
+
id: string;
|
|
559
|
+
name?: string | undefined;
|
|
560
|
+
label?: string[] | undefined;
|
|
561
|
+
parentID?: string | undefined;
|
|
562
|
+
priorID?: string | undefined;
|
|
563
|
+
authorId?: string | undefined;
|
|
564
|
+
created_at?: number | undefined;
|
|
565
|
+
acl?: string[] | undefined;
|
|
566
|
+
sig?: string | undefined;
|
|
567
|
+
}[]>;
|
|
568
|
+
addMdTaskChain: (markdown?: string) => Promise<string | undefined>;
|
|
569
|
+
getMeta: (id: string | number) => Promise<{
|
|
570
|
+
threadMessage?: any;
|
|
571
|
+
promptTokens?: number | undefined;
|
|
572
|
+
resultTokens?: number | undefined;
|
|
573
|
+
taskTokens?: number | undefined;
|
|
574
|
+
name?: string | undefined;
|
|
575
|
+
summary?: string | undefined;
|
|
576
|
+
estimatedTokens?: {
|
|
577
|
+
resultTokens?: number | undefined;
|
|
578
|
+
taskCosts?: number | undefined;
|
|
579
|
+
functionTokens?: number | undefined;
|
|
580
|
+
promptTokens?: number | undefined;
|
|
581
|
+
singlePromptTokens?: number | undefined;
|
|
582
|
+
} | undefined;
|
|
583
|
+
toolStreamArgsContent?: Record<string, string> | undefined;
|
|
584
|
+
streamContent?: string | undefined;
|
|
585
|
+
taskCosts?: number | undefined;
|
|
586
|
+
rawOutput?: unknown;
|
|
587
|
+
error?: unknown;
|
|
588
|
+
taskPrompt?: Record<string, unknown> | undefined;
|
|
589
|
+
tools?: unknown[] | undefined;
|
|
590
|
+
} | null>;
|
|
591
|
+
metaLiveRead: (id: string | number) => Stream<{
|
|
592
|
+
id: string | number;
|
|
593
|
+
data: {
|
|
594
|
+
threadMessage?: any;
|
|
595
|
+
promptTokens?: number | undefined;
|
|
596
|
+
resultTokens?: number | undefined;
|
|
597
|
+
taskTokens?: number | undefined;
|
|
598
|
+
name?: string | undefined;
|
|
599
|
+
summary?: string | undefined;
|
|
600
|
+
estimatedTokens?: {
|
|
601
|
+
resultTokens?: number | undefined;
|
|
602
|
+
taskCosts?: number | undefined;
|
|
603
|
+
functionTokens?: number | undefined;
|
|
604
|
+
promptTokens?: number | undefined;
|
|
605
|
+
singlePromptTokens?: number | undefined;
|
|
606
|
+
} | undefined;
|
|
607
|
+
toolStreamArgsContent?: Record<string, string> | undefined;
|
|
608
|
+
streamContent?: string | undefined;
|
|
609
|
+
taskCosts?: number | undefined;
|
|
610
|
+
rawOutput?: unknown;
|
|
611
|
+
error?: unknown;
|
|
612
|
+
taskPrompt?: Record<string, unknown> | undefined;
|
|
613
|
+
tools?: unknown[] | undefined;
|
|
614
|
+
} | null;
|
|
615
|
+
}>;
|
|
616
|
+
metaUpsert: (id: string | number, data: {
|
|
617
|
+
threadMessage?: any;
|
|
618
|
+
promptTokens?: number | undefined;
|
|
619
|
+
resultTokens?: number | undefined;
|
|
620
|
+
taskTokens?: number | undefined;
|
|
621
|
+
name?: string | undefined;
|
|
622
|
+
summary?: string | undefined;
|
|
623
|
+
estimatedTokens?: {
|
|
624
|
+
resultTokens?: number | undefined;
|
|
625
|
+
taskCosts?: number | undefined;
|
|
626
|
+
functionTokens?: number | undefined;
|
|
627
|
+
promptTokens?: number | undefined;
|
|
628
|
+
singlePromptTokens?: number | undefined;
|
|
629
|
+
} | undefined;
|
|
630
|
+
toolStreamArgsContent?: Record<string, string> | undefined;
|
|
631
|
+
streamContent?: string | undefined;
|
|
632
|
+
taskCosts?: number | undefined;
|
|
633
|
+
rawOutput?: unknown;
|
|
634
|
+
error?: unknown;
|
|
635
|
+
taskPrompt?: Record<string, unknown> | undefined;
|
|
636
|
+
tools?: unknown[] | undefined;
|
|
637
|
+
}, strategy?: "shallow_merge" | "replace" | "deepmerge" | "native_shallow") => Promise<{
|
|
638
|
+
threadMessage?: any;
|
|
639
|
+
promptTokens?: number | undefined;
|
|
640
|
+
resultTokens?: number | undefined;
|
|
641
|
+
taskTokens?: number | undefined;
|
|
642
|
+
name?: string | undefined;
|
|
643
|
+
summary?: string | undefined;
|
|
644
|
+
estimatedTokens?: {
|
|
645
|
+
resultTokens?: number | undefined;
|
|
646
|
+
taskCosts?: number | undefined;
|
|
647
|
+
functionTokens?: number | undefined;
|
|
648
|
+
promptTokens?: number | undefined;
|
|
649
|
+
singlePromptTokens?: number | undefined;
|
|
650
|
+
} | undefined;
|
|
651
|
+
toolStreamArgsContent?: Record<string, string> | undefined;
|
|
652
|
+
streamContent?: string | undefined;
|
|
653
|
+
taskCosts?: number | undefined;
|
|
654
|
+
rawOutput?: unknown;
|
|
655
|
+
error?: unknown;
|
|
656
|
+
taskPrompt?: Record<string, unknown> | undefined;
|
|
657
|
+
tools?: unknown[] | undefined;
|
|
658
|
+
}>;
|
|
659
|
+
addFiles: (newFiles: File[], storage: "memory" | "opfs") => Promise<string[]>;
|
|
660
|
+
searchFiles: (where: {
|
|
661
|
+
id?: string;
|
|
662
|
+
name?: string;
|
|
663
|
+
size?: number;
|
|
664
|
+
opfs?: string;
|
|
665
|
+
openAIFileId?: string;
|
|
666
|
+
type?: string;
|
|
667
|
+
data?: string;
|
|
668
|
+
}, opts?: {
|
|
669
|
+
allowedIDs?: (string | number)[];
|
|
670
|
+
limit?: number;
|
|
671
|
+
offset?: number;
|
|
672
|
+
orderBy?: {
|
|
673
|
+
kind: "id";
|
|
674
|
+
} | {
|
|
675
|
+
kind: "dataKey";
|
|
676
|
+
key: "name" | "type" | "id" | "data" | "size" | "opfs" | "openAIFileId";
|
|
677
|
+
};
|
|
678
|
+
orderDir?: "asc" | "desc";
|
|
679
|
+
} | undefined) => Promise<Record<string, FileMapping>>;
|
|
680
|
+
getFileMappingByUuid: (uuid: string) => Promise<FileMapping | null>;
|
|
681
|
+
getUploadedFile: (id: string) => Promise<File | undefined>;
|
|
682
|
+
getFileByName: (name: string) => Promise<File>;
|
|
683
|
+
addDefaultTools: (defaultTools: InternalTool[]) => void;
|
|
684
|
+
getToolDefinition: (name: string) => Promise<{
|
|
685
|
+
def?: TaskNodeType<"tooldefinition"> | undefined;
|
|
686
|
+
tool?: InternalTool;
|
|
687
|
+
}>;
|
|
688
|
+
getTask: (id: string | number) => Promise<{
|
|
689
|
+
role: "function" | "system" | "user" | "assistant";
|
|
690
|
+
content: {
|
|
691
|
+
type: "message";
|
|
692
|
+
data: string;
|
|
693
|
+
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;
|
|
702
|
+
} | {
|
|
703
|
+
type: "file";
|
|
704
|
+
content?: {
|
|
705
|
+
text: string;
|
|
706
|
+
type: string;
|
|
707
|
+
}[] | undefined;
|
|
708
|
+
})[] | undefined;
|
|
709
|
+
} | {
|
|
710
|
+
type: "toolresult";
|
|
711
|
+
data: unknown;
|
|
712
|
+
} | {
|
|
713
|
+
type: "tooldefinition";
|
|
714
|
+
data: {
|
|
715
|
+
description: string;
|
|
716
|
+
name: string;
|
|
717
|
+
parameters: Readonly<json_schema.JSONSchema7>;
|
|
718
|
+
longDescription?: string | undefined;
|
|
719
|
+
renderOptions?: {
|
|
720
|
+
hideChat?: boolean | undefined;
|
|
721
|
+
hideLlm?: boolean | undefined;
|
|
722
|
+
} | undefined;
|
|
723
|
+
code?: string | undefined;
|
|
724
|
+
};
|
|
725
|
+
} | {
|
|
726
|
+
type: "error";
|
|
727
|
+
data: unknown;
|
|
728
|
+
} | {
|
|
729
|
+
type: "structured";
|
|
730
|
+
data: unknown;
|
|
731
|
+
} | {
|
|
732
|
+
type: "functioncall";
|
|
733
|
+
data: {
|
|
734
|
+
name: string;
|
|
735
|
+
arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
|
|
736
|
+
};
|
|
737
|
+
} | {
|
|
738
|
+
type: "files";
|
|
739
|
+
data: string[];
|
|
740
|
+
} | {
|
|
741
|
+
type: "return";
|
|
742
|
+
data: string;
|
|
743
|
+
};
|
|
744
|
+
id: string;
|
|
745
|
+
name?: string | undefined;
|
|
746
|
+
label?: string[] | undefined;
|
|
747
|
+
parentID?: string | undefined;
|
|
748
|
+
priorID?: string | undefined;
|
|
749
|
+
authorId?: string | undefined;
|
|
750
|
+
created_at?: number | undefined;
|
|
751
|
+
acl?: string[] | undefined;
|
|
752
|
+
sig?: string | undefined;
|
|
753
|
+
} | null>;
|
|
754
|
+
deleteTask: (id: string | number) => Promise<void>;
|
|
755
|
+
searchTasks: (where: PartialDeep<TaskNode>) => Promise<Record<string, TaskNode>>;
|
|
756
|
+
taskStream: Stream<{
|
|
757
|
+
id: string | number;
|
|
758
|
+
data: {
|
|
759
|
+
role: "function" | "system" | "user" | "assistant";
|
|
760
|
+
content: {
|
|
761
|
+
type: "message";
|
|
762
|
+
data: string;
|
|
763
|
+
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;
|
|
772
|
+
} | {
|
|
773
|
+
type: "file";
|
|
774
|
+
content?: {
|
|
775
|
+
text: string;
|
|
776
|
+
type: string;
|
|
777
|
+
}[] | undefined;
|
|
778
|
+
})[] | undefined;
|
|
779
|
+
} | {
|
|
780
|
+
type: "toolresult";
|
|
781
|
+
data: unknown;
|
|
782
|
+
} | {
|
|
783
|
+
type: "tooldefinition";
|
|
784
|
+
data: {
|
|
785
|
+
description: string;
|
|
786
|
+
name: string;
|
|
787
|
+
parameters: Readonly<json_schema.JSONSchema7>;
|
|
788
|
+
longDescription?: string | undefined;
|
|
789
|
+
renderOptions?: {
|
|
790
|
+
hideChat?: boolean | undefined;
|
|
791
|
+
hideLlm?: boolean | undefined;
|
|
792
|
+
} | undefined;
|
|
793
|
+
code?: string | undefined;
|
|
794
|
+
};
|
|
795
|
+
} | {
|
|
796
|
+
type: "error";
|
|
797
|
+
data: unknown;
|
|
798
|
+
} | {
|
|
799
|
+
type: "structured";
|
|
800
|
+
data: unknown;
|
|
801
|
+
} | {
|
|
802
|
+
type: "functioncall";
|
|
803
|
+
data: {
|
|
804
|
+
name: string;
|
|
805
|
+
arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
|
|
806
|
+
};
|
|
807
|
+
} | {
|
|
808
|
+
type: "files";
|
|
809
|
+
data: string[];
|
|
810
|
+
} | {
|
|
811
|
+
type: "return";
|
|
812
|
+
data: string;
|
|
813
|
+
};
|
|
814
|
+
id: string;
|
|
815
|
+
name?: string | undefined;
|
|
816
|
+
label?: string[] | undefined;
|
|
817
|
+
parentID?: string | undefined;
|
|
818
|
+
priorID?: string | undefined;
|
|
819
|
+
authorId?: string | undefined;
|
|
820
|
+
created_at?: number | undefined;
|
|
821
|
+
acl?: string[] | undefined;
|
|
822
|
+
sig?: string | undefined;
|
|
823
|
+
} | null;
|
|
824
|
+
}>;
|
|
825
|
+
updateToolDefinitions: <T extends boolean>(removeFunctionProperty?: T) => Promise<T extends true ? Record<string, ToolBase> : Record<string, ToolBase | InternalTool>>;
|
|
826
|
+
getJsonTaskBackup: () => Promise<string>;
|
|
827
|
+
addTaskBackup: (jsonObjString: string) => Promise<void>;
|
|
828
|
+
deleteAllTasks: () => Promise<void>;
|
|
829
|
+
deleteTaskThread: (leafId: string) => Promise<void>;
|
|
830
|
+
countTasks: () => Promise<number>;
|
|
831
|
+
syncVectorIndexWithTasks: (progressCallback: (done: number, total: number) => void) => Promise<void>;
|
|
832
|
+
resetTaskVectors: () => Promise<void>;
|
|
833
|
+
countVecs: () => Promise<number>;
|
|
834
|
+
filteredVectorSearch: (searchTerm: string, k?: number, taskTemplate?: PartialDeep<TaskNode>) => Promise<{
|
|
835
|
+
taskId: string;
|
|
836
|
+
distance: number;
|
|
837
|
+
}[]>;
|
|
838
|
+
findSiblingLeafTasks: (taskId: string) => Promise<string[]>;
|
|
839
|
+
searchNextSibling: (key: string) => Promise<Set<string>>;
|
|
840
|
+
searchAllDirectChildren: (key: string) => Promise<Set<string>>;
|
|
841
|
+
searchAllChildren: (key: string) => Promise<Set<string>>;
|
|
842
|
+
searchSimilarTasks: (task: Partial<TaskNode>, k?: number) => Promise<{
|
|
843
|
+
taskId: string;
|
|
844
|
+
distance: number;
|
|
845
|
+
}[]>;
|
|
846
|
+
filterSearch: (k?: number, taskTemplate?: PartialDeep<TaskNode>) => Promise<{
|
|
847
|
+
taskId: string;
|
|
848
|
+
distance: 0;
|
|
849
|
+
}[]>;
|
|
850
|
+
loadYamlConversation: (input: File | string) => Promise<string | undefined>;
|
|
851
|
+
}>;
|
|
852
|
+
type TyTaskManager = Awaited<ReturnType<typeof useTyTaskManager>>;
|
|
853
|
+
|
|
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
|
+
declare const llmSettings: z.ZodObject<{
|
|
901
|
+
userId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
902
|
+
allowWebSearch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
903
|
+
secretPublicKey: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
904
|
+
selectedTaskId: z.ZodOptional<z.ZodString>;
|
|
905
|
+
enableOpenAiTools: z.ZodDefault<z.ZodBoolean>;
|
|
906
|
+
selectedApi: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
907
|
+
llmApis: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
908
|
+
name: z.ZodString;
|
|
909
|
+
baseURL: z.ZodString;
|
|
910
|
+
defaultModel: z.ZodString;
|
|
911
|
+
selectedModel: z.ZodOptional<z.ZodString>;
|
|
912
|
+
models: z.ZodOptional<z.ZodObject<{
|
|
913
|
+
instruction: z.ZodOptional<z.ZodString>;
|
|
914
|
+
chat: z.ZodOptional<z.ZodString>;
|
|
915
|
+
free: z.ZodOptional<z.ZodString>;
|
|
916
|
+
}, z.core.$strip>>;
|
|
917
|
+
streamSupport: z.ZodBoolean;
|
|
918
|
+
defaultHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
919
|
+
routes: z.ZodObject<{
|
|
920
|
+
chatCompletion: z.ZodString;
|
|
921
|
+
models: z.ZodString;
|
|
922
|
+
}, z.core.$strip>;
|
|
923
|
+
}, z.core.$strip>>>;
|
|
924
|
+
siteUrl: z.ZodDefault<z.ZodString>;
|
|
925
|
+
summaryModel: z.ZodDefault<z.ZodString>;
|
|
926
|
+
vectorizationModel: z.ZodDefault<z.ZodString>;
|
|
927
|
+
maxAutonomousTasks: z.ZodDefault<z.ZodNumber>;
|
|
928
|
+
entryNode: z.ZodOptional<z.ZodObject<{
|
|
929
|
+
role: z.ZodNonOptional<z.ZodOptional<z.ZodEnum<{
|
|
930
|
+
function: "function";
|
|
931
|
+
system: "system";
|
|
932
|
+
user: "user";
|
|
933
|
+
assistant: "assistant";
|
|
934
|
+
}>>>;
|
|
935
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
936
|
+
content: z.ZodNonOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
937
|
+
type: z.ZodLiteral<"message">;
|
|
938
|
+
data: z.ZodString;
|
|
939
|
+
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>>;
|
|
948
|
+
}, 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>>>;
|
|
954
|
+
}, z.core.$strip>]>>>;
|
|
955
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
956
|
+
type: z.ZodLiteral<"toolresult">;
|
|
957
|
+
data: z.ZodUnknown;
|
|
958
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
959
|
+
type: z.ZodLiteral<"tooldefinition">;
|
|
960
|
+
data: z.ZodObject<{
|
|
961
|
+
description: z.ZodString;
|
|
962
|
+
longDescription: z.ZodOptional<z.ZodString>;
|
|
963
|
+
name: z.ZodString;
|
|
964
|
+
renderOptions: z.ZodOptional<z.ZodObject<{
|
|
965
|
+
hideChat: z.ZodOptional<z.ZodBoolean>;
|
|
966
|
+
hideLlm: z.ZodOptional<z.ZodBoolean>;
|
|
967
|
+
}, z.core.$strip>>;
|
|
968
|
+
parameters: z.ZodReadonly<z.ZodType<json_schema.JSONSchema7, unknown, z.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
969
|
+
code: z.ZodOptional<z.ZodString>;
|
|
970
|
+
}, z.core.$strip>;
|
|
971
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
972
|
+
type: z.ZodLiteral<"error">;
|
|
973
|
+
data: z.ZodUnknown;
|
|
974
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
975
|
+
type: z.ZodLiteral<"structured">;
|
|
976
|
+
data: z.ZodUnknown;
|
|
977
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
978
|
+
type: z.ZodLiteral<"functioncall">;
|
|
979
|
+
data: z.ZodObject<{
|
|
980
|
+
name: z.ZodString;
|
|
981
|
+
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]>>;
|
|
982
|
+
}, z.core.$strip>;
|
|
983
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
984
|
+
type: z.ZodLiteral<"files">;
|
|
985
|
+
data: z.ZodArray<z.ZodString>;
|
|
986
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
987
|
+
type: z.ZodLiteral<"return">;
|
|
988
|
+
data: z.ZodString;
|
|
989
|
+
}, z.core.$strict>]>>>;
|
|
990
|
+
label: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
991
|
+
parentID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
992
|
+
priorID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
993
|
+
id: z.ZodOptional<z.ZodString>;
|
|
994
|
+
authorId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
995
|
+
created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
996
|
+
acl: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
997
|
+
sig: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
998
|
+
}, z.core.$strip>>;
|
|
999
|
+
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
|
+
}, z.core.$strip>;
|
|
1012
|
+
type llmSettings = z.infer<typeof llmSettings>;
|
|
1013
|
+
|
|
1014
|
+
declare function createChatCompletionTool(llmSettings: Thunk<llmSettings>, taskManager: TyTaskManager): Promise<{
|
|
1015
|
+
chatCompletion: {
|
|
1016
|
+
description: string;
|
|
1017
|
+
longDescription: string;
|
|
1018
|
+
name: string;
|
|
1019
|
+
renderOptions: {
|
|
1020
|
+
hideChat: true;
|
|
1021
|
+
hideLlm: true;
|
|
1022
|
+
};
|
|
1023
|
+
parameters: {
|
|
1024
|
+
readonly type: "object";
|
|
1025
|
+
readonly additionalProperties: false;
|
|
1026
|
+
readonly properties: {
|
|
1027
|
+
readonly model: {
|
|
1028
|
+
readonly type: "string";
|
|
1029
|
+
readonly description: "The name of the model to use for the completion. Optional, will choose default model if not provided";
|
|
1030
|
+
};
|
|
1031
|
+
readonly goal: {
|
|
1032
|
+
readonly enum: ["SimpleCompletion", "AnalyzeError", "ChooseTool", "AnalyzeToolResult", "WebSearch"];
|
|
1033
|
+
readonly description: "Optional Parameter to define the goal of the chat completion. If not set, the goal is dynamically inferred from the input.";
|
|
1034
|
+
};
|
|
1035
|
+
readonly llmTools: {
|
|
1036
|
+
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.";
|
|
1038
|
+
};
|
|
1039
|
+
readonly allowedTools: {
|
|
1040
|
+
readonly type: "array";
|
|
1041
|
+
readonly description: "Optional Parameter. We can specify which tools are allowed to be called by the LLM";
|
|
1042
|
+
readonly items: {
|
|
1043
|
+
readonly type: "string";
|
|
1044
|
+
};
|
|
1045
|
+
};
|
|
1046
|
+
readonly prompts: {
|
|
1047
|
+
readonly type: "array";
|
|
1048
|
+
readonly description: "Optional Parameter. We can add a custom prompt to the chatCompletion which doesn't get recorded as a task and therefore disappears during message thread conversion.";
|
|
1049
|
+
readonly items: {
|
|
1050
|
+
readonly type: "string";
|
|
1051
|
+
};
|
|
1052
|
+
};
|
|
1053
|
+
readonly schema: {
|
|
1054
|
+
readonly type: "object";
|
|
1055
|
+
readonly description: "A json schema object which we can use to generate a specific response and parse it.";
|
|
1056
|
+
readonly additionalProperties: true;
|
|
1057
|
+
};
|
|
1058
|
+
readonly reasoning_effort: {
|
|
1059
|
+
readonly enum: ["low", "high", "medium"];
|
|
1060
|
+
readonly description: "How many reasoning tokens should models with reasonin capability use?";
|
|
1061
|
+
};
|
|
1062
|
+
readonly verbosity: {
|
|
1063
|
+
readonly type: "string";
|
|
1064
|
+
readonly enum: ["low", "high", "medium"];
|
|
1065
|
+
readonly description: "how verbose should the reponse be?";
|
|
1066
|
+
};
|
|
1067
|
+
readonly use_multimodal: {
|
|
1068
|
+
readonly type: "boolean";
|
|
1069
|
+
readonly description: "Allow models to use their vision/audio document undestanding capabilities if their are any files in the prompt.";
|
|
1070
|
+
};
|
|
1071
|
+
};
|
|
1072
|
+
};
|
|
1073
|
+
function: (opts: {
|
|
1074
|
+
model?: string;
|
|
1075
|
+
schema?: {
|
|
1076
|
+
[x: string]: unknown;
|
|
1077
|
+
};
|
|
1078
|
+
verbosity?: "high" | "medium" | "low";
|
|
1079
|
+
goal?: "SimpleCompletion" | "AnalyzeError" | "ChooseTool" | "AnalyzeToolResult" | "WebSearch";
|
|
1080
|
+
llmTools?: boolean;
|
|
1081
|
+
allowedTools?: string[];
|
|
1082
|
+
prompts?: string[];
|
|
1083
|
+
reasoning_effort?: "high" | "medium" | "low";
|
|
1084
|
+
use_multimodal?: boolean;
|
|
1085
|
+
}, context: toolContext) => Promise<{
|
|
1086
|
+
taskResultMarker: "*TY_TASKRESULT*";
|
|
1087
|
+
taskChainList: {
|
|
1088
|
+
role: "function" | "system" | "user" | "assistant";
|
|
1089
|
+
content: {
|
|
1090
|
+
type: "message";
|
|
1091
|
+
data: string;
|
|
1092
|
+
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;
|
|
1101
|
+
} | {
|
|
1102
|
+
type: "file";
|
|
1103
|
+
content?: {
|
|
1104
|
+
text: string;
|
|
1105
|
+
type: string;
|
|
1106
|
+
}[] | undefined;
|
|
1107
|
+
})[] | undefined;
|
|
1108
|
+
} | {
|
|
1109
|
+
type: "toolresult";
|
|
1110
|
+
data: unknown;
|
|
1111
|
+
} | {
|
|
1112
|
+
type: "tooldefinition";
|
|
1113
|
+
data: {
|
|
1114
|
+
description: string;
|
|
1115
|
+
name: string;
|
|
1116
|
+
parameters: Readonly<JSONSchema7>;
|
|
1117
|
+
longDescription?: string | undefined;
|
|
1118
|
+
renderOptions?: {
|
|
1119
|
+
hideChat?: boolean | undefined;
|
|
1120
|
+
hideLlm?: boolean | undefined;
|
|
1121
|
+
} | undefined;
|
|
1122
|
+
code?: string | undefined;
|
|
1123
|
+
};
|
|
1124
|
+
} | {
|
|
1125
|
+
type: "error";
|
|
1126
|
+
data: unknown;
|
|
1127
|
+
} | {
|
|
1128
|
+
type: "structured";
|
|
1129
|
+
data: unknown;
|
|
1130
|
+
} | {
|
|
1131
|
+
type: "functioncall";
|
|
1132
|
+
data: {
|
|
1133
|
+
name: string;
|
|
1134
|
+
arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
|
|
1135
|
+
};
|
|
1136
|
+
} | {
|
|
1137
|
+
type: "files";
|
|
1138
|
+
data: string[];
|
|
1139
|
+
} | {
|
|
1140
|
+
type: "return";
|
|
1141
|
+
data: string;
|
|
1142
|
+
};
|
|
1143
|
+
name?: string | undefined;
|
|
1144
|
+
label?: string[] | undefined;
|
|
1145
|
+
parentID?: string | undefined;
|
|
1146
|
+
priorID?: string | undefined;
|
|
1147
|
+
id?: string | undefined;
|
|
1148
|
+
authorId?: string | undefined;
|
|
1149
|
+
created_at?: number | undefined;
|
|
1150
|
+
acl?: string[] | undefined;
|
|
1151
|
+
sig?: string | undefined;
|
|
1152
|
+
}[][];
|
|
1153
|
+
}>;
|
|
1154
|
+
};
|
|
1155
|
+
stream: Stream<{
|
|
1156
|
+
taskId: string;
|
|
1157
|
+
chunk: ChatCompletionChunk | undefined;
|
|
1158
|
+
}>;
|
|
1159
|
+
}>;
|
|
1160
|
+
type chatCompletionParams = FromSchema<Awaited<ReturnType<typeof createChatCompletionTool>>['chatCompletion']['parameters']>;
|
|
1161
|
+
|
|
1162
|
+
declare const TaskyonMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
1163
|
+
type: z$1.ZodLiteral<"addTasks">;
|
|
1164
|
+
data: z$1.ZodType<Uint8Array<ArrayBuffer>>;
|
|
1165
|
+
info: z$1.ZodString;
|
|
1166
|
+
ids: z$1.ZodArray<z$1.ZodString>;
|
|
1167
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1168
|
+
type: z$1.ZodLiteral<"requestTask">;
|
|
1169
|
+
id: z$1.ZodString;
|
|
1170
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1171
|
+
type: z$1.ZodLiteral<"taskCreated">;
|
|
1172
|
+
task: z$1.ZodOptional<z$1.ZodObject<{
|
|
1173
|
+
role: z$1.ZodEnum<{
|
|
1174
|
+
function: "function";
|
|
1175
|
+
system: "system";
|
|
1176
|
+
user: "user";
|
|
1177
|
+
assistant: "assistant";
|
|
1178
|
+
}>;
|
|
1179
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1180
|
+
content: z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1181
|
+
type: z$1.ZodLiteral<"message">;
|
|
1182
|
+
data: z$1.ZodString;
|
|
1183
|
+
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>>;
|
|
1192
|
+
}, 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>>>;
|
|
1198
|
+
}, z$1.core.$strip>]>>>;
|
|
1199
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1200
|
+
type: z$1.ZodLiteral<"toolresult">;
|
|
1201
|
+
data: z$1.ZodUnknown;
|
|
1202
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1203
|
+
type: z$1.ZodLiteral<"tooldefinition">;
|
|
1204
|
+
data: z$1.ZodObject<{
|
|
1205
|
+
description: z$1.ZodString;
|
|
1206
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
1207
|
+
name: z$1.ZodString;
|
|
1208
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
1209
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1210
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1211
|
+
}, z$1.core.$strip>>;
|
|
1212
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
1213
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
1214
|
+
}, z$1.core.$strip>;
|
|
1215
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1216
|
+
type: z$1.ZodLiteral<"error">;
|
|
1217
|
+
data: z$1.ZodUnknown;
|
|
1218
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1219
|
+
type: z$1.ZodLiteral<"structured">;
|
|
1220
|
+
data: z$1.ZodUnknown;
|
|
1221
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1222
|
+
type: z$1.ZodLiteral<"functioncall">;
|
|
1223
|
+
data: z$1.ZodObject<{
|
|
1224
|
+
name: z$1.ZodString;
|
|
1225
|
+
arguments: 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]>>;
|
|
1226
|
+
}, z$1.core.$strip>;
|
|
1227
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1228
|
+
type: z$1.ZodLiteral<"files">;
|
|
1229
|
+
data: z$1.ZodArray<z$1.ZodString>;
|
|
1230
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1231
|
+
type: z$1.ZodLiteral<"return">;
|
|
1232
|
+
data: z$1.ZodString;
|
|
1233
|
+
}, z$1.core.$strict>]>;
|
|
1234
|
+
label: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1235
|
+
parentID: z$1.ZodOptional<z$1.ZodString>;
|
|
1236
|
+
priorID: z$1.ZodOptional<z$1.ZodString>;
|
|
1237
|
+
id: z$1.ZodString;
|
|
1238
|
+
authorId: z$1.ZodOptional<z$1.ZodString>;
|
|
1239
|
+
created_at: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1240
|
+
acl: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1241
|
+
sig: z$1.ZodOptional<z$1.ZodString>;
|
|
1242
|
+
}, z$1.core.$strip>>;
|
|
1243
|
+
ids: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1244
|
+
info: z$1.ZodOptional<z$1.ZodString>;
|
|
1245
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1246
|
+
type: z$1.ZodLiteral<"status">;
|
|
1247
|
+
data: z$1.ZodObject<{
|
|
1248
|
+
type: z$1.ZodLiteral<"newtool">;
|
|
1249
|
+
id: z$1.ZodString;
|
|
1250
|
+
}, z$1.core.$strip>;
|
|
1251
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1252
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1253
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1254
|
+
functionName: z$1.ZodString;
|
|
1255
|
+
type: z$1.ZodLiteral<"functionCall">;
|
|
1256
|
+
arguments: z$1.ZodOptional<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]>>>;
|
|
1257
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1258
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1259
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1260
|
+
functionName: z$1.ZodString;
|
|
1261
|
+
type: z$1.ZodLiteral<"functionResponse">;
|
|
1262
|
+
response: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
1263
|
+
error: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
1264
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1265
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1266
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1267
|
+
type: z$1.ZodLiteral<"task">;
|
|
1268
|
+
task: z$1.ZodObject<{
|
|
1269
|
+
role: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1270
|
+
function: "function";
|
|
1271
|
+
system: "system";
|
|
1272
|
+
user: "user";
|
|
1273
|
+
assistant: "assistant";
|
|
1274
|
+
}>>>;
|
|
1275
|
+
name: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1276
|
+
content: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1277
|
+
type: z$1.ZodLiteral<"message">;
|
|
1278
|
+
data: z$1.ZodString;
|
|
1279
|
+
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>>;
|
|
1288
|
+
}, 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>>>;
|
|
1294
|
+
}, z$1.core.$strip>]>>>;
|
|
1295
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1296
|
+
type: z$1.ZodLiteral<"toolresult">;
|
|
1297
|
+
data: z$1.ZodUnknown;
|
|
1298
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1299
|
+
type: z$1.ZodLiteral<"tooldefinition">;
|
|
1300
|
+
data: z$1.ZodObject<{
|
|
1301
|
+
description: z$1.ZodString;
|
|
1302
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
1303
|
+
name: z$1.ZodString;
|
|
1304
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
1305
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1306
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1307
|
+
}, z$1.core.$strip>>;
|
|
1308
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
1309
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
1310
|
+
}, z$1.core.$strip>;
|
|
1311
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1312
|
+
type: z$1.ZodLiteral<"error">;
|
|
1313
|
+
data: z$1.ZodUnknown;
|
|
1314
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1315
|
+
type: z$1.ZodLiteral<"structured">;
|
|
1316
|
+
data: z$1.ZodUnknown;
|
|
1317
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1318
|
+
type: z$1.ZodLiteral<"functioncall">;
|
|
1319
|
+
data: z$1.ZodObject<{
|
|
1320
|
+
name: z$1.ZodString;
|
|
1321
|
+
arguments: 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]>>;
|
|
1322
|
+
}, z$1.core.$strip>;
|
|
1323
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1324
|
+
type: z$1.ZodLiteral<"files">;
|
|
1325
|
+
data: z$1.ZodArray<z$1.ZodString>;
|
|
1326
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1327
|
+
type: z$1.ZodLiteral<"return">;
|
|
1328
|
+
data: z$1.ZodString;
|
|
1329
|
+
}, z$1.core.$strict>]>>>;
|
|
1330
|
+
label: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
1331
|
+
parentID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1332
|
+
priorID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1333
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1334
|
+
authorId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1335
|
+
created_at: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1336
|
+
acl: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
1337
|
+
sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1338
|
+
}, z$1.core.$strip>;
|
|
1339
|
+
execute: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1340
|
+
show: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1341
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1342
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1343
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1344
|
+
type: z$1.ZodLiteral<"tasks">;
|
|
1345
|
+
execute: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1346
|
+
tasks: z$1.ZodArray<z$1.ZodObject<{
|
|
1347
|
+
role: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1348
|
+
function: "function";
|
|
1349
|
+
system: "system";
|
|
1350
|
+
user: "user";
|
|
1351
|
+
assistant: "assistant";
|
|
1352
|
+
}>>>;
|
|
1353
|
+
name: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1354
|
+
content: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1355
|
+
type: z$1.ZodLiteral<"message">;
|
|
1356
|
+
data: z$1.ZodString;
|
|
1357
|
+
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>>;
|
|
1366
|
+
}, 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>>>;
|
|
1372
|
+
}, z$1.core.$strip>]>>>;
|
|
1373
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1374
|
+
type: z$1.ZodLiteral<"toolresult">;
|
|
1375
|
+
data: z$1.ZodUnknown;
|
|
1376
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1377
|
+
type: z$1.ZodLiteral<"tooldefinition">;
|
|
1378
|
+
data: z$1.ZodObject<{
|
|
1379
|
+
description: z$1.ZodString;
|
|
1380
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
1381
|
+
name: z$1.ZodString;
|
|
1382
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
1383
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1384
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1385
|
+
}, z$1.core.$strip>>;
|
|
1386
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
1387
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
1388
|
+
}, z$1.core.$strip>;
|
|
1389
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1390
|
+
type: z$1.ZodLiteral<"error">;
|
|
1391
|
+
data: z$1.ZodUnknown;
|
|
1392
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1393
|
+
type: z$1.ZodLiteral<"structured">;
|
|
1394
|
+
data: z$1.ZodUnknown;
|
|
1395
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1396
|
+
type: z$1.ZodLiteral<"functioncall">;
|
|
1397
|
+
data: z$1.ZodObject<{
|
|
1398
|
+
name: z$1.ZodString;
|
|
1399
|
+
arguments: 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]>>;
|
|
1400
|
+
}, z$1.core.$strip>;
|
|
1401
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1402
|
+
type: z$1.ZodLiteral<"files">;
|
|
1403
|
+
data: z$1.ZodArray<z$1.ZodString>;
|
|
1404
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1405
|
+
type: z$1.ZodLiteral<"return">;
|
|
1406
|
+
data: z$1.ZodString;
|
|
1407
|
+
}, z$1.core.$strict>]>>>;
|
|
1408
|
+
label: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
1409
|
+
parentID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1410
|
+
priorID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1411
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1412
|
+
authorId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1413
|
+
created_at: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1414
|
+
acl: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
1415
|
+
sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1416
|
+
}, z$1.core.$strip>>;
|
|
1417
|
+
show: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1418
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1419
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1420
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1421
|
+
description: z$1.ZodString;
|
|
1422
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
1423
|
+
name: z$1.ZodString;
|
|
1424
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
1425
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1426
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1427
|
+
}, z$1.core.$strip>>;
|
|
1428
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
1429
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
1430
|
+
type: z$1.ZodLiteral<"functionDescription">;
|
|
1431
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1432
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1433
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1434
|
+
type: z$1.ZodLiteral<"taskyonReady">;
|
|
1435
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1436
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1437
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1438
|
+
type: z$1.ZodLiteral<"file">;
|
|
1439
|
+
id: z$1.ZodString;
|
|
1440
|
+
name: z$1.ZodString;
|
|
1441
|
+
mime: z$1.ZodString;
|
|
1442
|
+
size: z$1.ZodNumber;
|
|
1443
|
+
store: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1444
|
+
memory: "memory";
|
|
1445
|
+
opfs: "opfs";
|
|
1446
|
+
}>>;
|
|
1447
|
+
file: z$1.ZodFile;
|
|
1448
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1449
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1450
|
+
}, z$1.core.$strip>]>;
|
|
1451
|
+
type TaskyonMessage = z$1.infer<typeof TaskyonMessage>;
|
|
1452
|
+
|
|
1453
|
+
type processTasksOpts = {
|
|
1454
|
+
timeoutMs?: number;
|
|
1455
|
+
signal?: AbortSignal;
|
|
1456
|
+
quitCondition?: (t: TaskNode) => boolean;
|
|
1457
|
+
};
|
|
1458
|
+
declare const createChatCompletionTask: (args: chatCompletionParams) => {
|
|
1459
|
+
role: "function" | "system" | "user" | "assistant";
|
|
1460
|
+
content: {
|
|
1461
|
+
type: "message";
|
|
1462
|
+
data: string;
|
|
1463
|
+
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;
|
|
1472
|
+
} | {
|
|
1473
|
+
type: "file";
|
|
1474
|
+
content?: {
|
|
1475
|
+
text: string;
|
|
1476
|
+
type: string;
|
|
1477
|
+
}[] | undefined;
|
|
1478
|
+
})[] | undefined;
|
|
1479
|
+
} | {
|
|
1480
|
+
type: "toolresult";
|
|
1481
|
+
data: unknown;
|
|
1482
|
+
} | {
|
|
1483
|
+
type: "tooldefinition";
|
|
1484
|
+
data: {
|
|
1485
|
+
description: string;
|
|
1486
|
+
name: string;
|
|
1487
|
+
parameters: Readonly<json_schema.JSONSchema7>;
|
|
1488
|
+
longDescription?: string | undefined;
|
|
1489
|
+
renderOptions?: {
|
|
1490
|
+
hideChat?: boolean | undefined;
|
|
1491
|
+
hideLlm?: boolean | undefined;
|
|
1492
|
+
} | undefined;
|
|
1493
|
+
code?: string | undefined;
|
|
1494
|
+
};
|
|
1495
|
+
} | {
|
|
1496
|
+
type: "error";
|
|
1497
|
+
data: unknown;
|
|
1498
|
+
} | {
|
|
1499
|
+
type: "structured";
|
|
1500
|
+
data: unknown;
|
|
1501
|
+
} | {
|
|
1502
|
+
type: "functioncall";
|
|
1503
|
+
data: {
|
|
1504
|
+
name: string;
|
|
1505
|
+
arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
|
|
1506
|
+
};
|
|
1507
|
+
} | {
|
|
1508
|
+
type: "files";
|
|
1509
|
+
data: string[];
|
|
1510
|
+
} | {
|
|
1511
|
+
type: "return";
|
|
1512
|
+
data: string;
|
|
1513
|
+
};
|
|
1514
|
+
name?: string | undefined;
|
|
1515
|
+
label?: string[] | undefined;
|
|
1516
|
+
parentID?: string | undefined;
|
|
1517
|
+
priorID?: string | undefined;
|
|
1518
|
+
id?: string | undefined;
|
|
1519
|
+
authorId?: string | undefined;
|
|
1520
|
+
created_at?: number | undefined;
|
|
1521
|
+
acl?: string[] | undefined;
|
|
1522
|
+
sig?: string | undefined;
|
|
1523
|
+
} & {
|
|
1524
|
+
content: {
|
|
1525
|
+
type: "functioncall";
|
|
1526
|
+
data: FunctionCall;
|
|
1527
|
+
};
|
|
1528
|
+
};
|
|
1529
|
+
declare const processTasks: <T extends {
|
|
1530
|
+
type: string;
|
|
1531
|
+
}>(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?: {
|
|
1539
|
+
end_index?: number | undefined;
|
|
1540
|
+
start_index?: number | undefined;
|
|
1541
|
+
title?: string | undefined;
|
|
1542
|
+
url?: string | undefined;
|
|
1543
|
+
content?: string | undefined;
|
|
1544
|
+
} | undefined;
|
|
1545
|
+
} | {
|
|
1546
|
+
type: "file";
|
|
1547
|
+
content?: {
|
|
1548
|
+
text: string;
|
|
1549
|
+
type: string;
|
|
1550
|
+
}[] | undefined;
|
|
1551
|
+
})[] | undefined;
|
|
1552
|
+
} | {
|
|
1553
|
+
type: "toolresult";
|
|
1554
|
+
data: unknown;
|
|
1555
|
+
} | {
|
|
1556
|
+
type: "tooldefinition";
|
|
1557
|
+
data: {
|
|
1558
|
+
description: string;
|
|
1559
|
+
name: string;
|
|
1560
|
+
parameters: Readonly<json_schema.JSONSchema7>;
|
|
1561
|
+
longDescription?: string | undefined;
|
|
1562
|
+
renderOptions?: {
|
|
1563
|
+
hideChat?: boolean | undefined;
|
|
1564
|
+
hideLlm?: boolean | undefined;
|
|
1565
|
+
} | undefined;
|
|
1566
|
+
code?: string | undefined;
|
|
1567
|
+
};
|
|
1568
|
+
} | {
|
|
1569
|
+
type: "error";
|
|
1570
|
+
data: unknown;
|
|
1571
|
+
} | {
|
|
1572
|
+
type: "structured";
|
|
1573
|
+
data: unknown;
|
|
1574
|
+
} | {
|
|
1575
|
+
type: "functioncall";
|
|
1576
|
+
data: {
|
|
1577
|
+
name: string;
|
|
1578
|
+
arguments: Record<string, string | number | boolean | Record<string, unknown> | unknown[] | null | undefined>;
|
|
1579
|
+
};
|
|
1580
|
+
} | {
|
|
1581
|
+
type: "files";
|
|
1582
|
+
data: string[];
|
|
1583
|
+
} | {
|
|
1584
|
+
type: "return";
|
|
1585
|
+
data: string;
|
|
1586
|
+
};
|
|
1587
|
+
id: string;
|
|
1588
|
+
name?: string | undefined;
|
|
1589
|
+
label?: string[] | undefined;
|
|
1590
|
+
parentID?: string | undefined;
|
|
1591
|
+
priorID?: string | undefined;
|
|
1592
|
+
authorId?: string | undefined;
|
|
1593
|
+
created_at?: number | undefined;
|
|
1594
|
+
acl?: string[] | undefined;
|
|
1595
|
+
sig?: string | undefined;
|
|
1596
|
+
} & {
|
|
1597
|
+
id: string;
|
|
1598
|
+
}>;
|
|
1599
|
+
|
|
1600
|
+
declare const TyProfile: z$1.ZodObject<{
|
|
1601
|
+
version: z$1.ZodLiteral<21>;
|
|
1602
|
+
appConfiguration: z$1.ZodObject<{
|
|
1603
|
+
darkTheme: z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]>;
|
|
1604
|
+
appConfigurationUrl: z$1.ZodDefault<z$1.ZodString>;
|
|
1605
|
+
gdriveConfigurationFile: z$1.ZodDefault<z$1.ZodString>;
|
|
1606
|
+
enableGdriveSync: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
1607
|
+
expertMode: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1608
|
+
showCosts: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1609
|
+
gdriveDir: z$1.ZodDefault<z$1.ZodString>;
|
|
1610
|
+
showLogo: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
1611
|
+
welcomeMsg: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
|
|
1612
|
+
chatSuggestions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1613
|
+
url: z$1.ZodString;
|
|
1614
|
+
label: z$1.ZodString;
|
|
1615
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1616
|
+
md: z$1.ZodString;
|
|
1617
|
+
label: z$1.ZodString;
|
|
1618
|
+
}, z$1.core.$strip>]>>>>;
|
|
1619
|
+
useEnterToSend: z$1.ZodDefault<z$1.ZodEnum<{
|
|
1620
|
+
shift: "shift";
|
|
1621
|
+
auto: "auto";
|
|
1622
|
+
on: "on";
|
|
1623
|
+
off: "off";
|
|
1624
|
+
}>>;
|
|
1625
|
+
guiMode: z$1.ZodDefault<z$1.ZodEnum<{
|
|
1626
|
+
default: "default";
|
|
1627
|
+
auto: "auto";
|
|
1628
|
+
iframe: "iframe";
|
|
1629
|
+
minChat: "minChat";
|
|
1630
|
+
}>>;
|
|
1631
|
+
primaryColor: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
|
|
1632
|
+
secondaryColor: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
|
|
1633
|
+
}, z$1.core.$strip>;
|
|
1634
|
+
llmSettings: z$1.ZodObject<{
|
|
1635
|
+
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
|
+
secretPublicKey: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
1638
|
+
selectedTaskId: z$1.ZodOptional<z$1.ZodString>;
|
|
1639
|
+
enableOpenAiTools: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1640
|
+
selectedApi: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
1641
|
+
llmApis: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
1642
|
+
name: z$1.ZodString;
|
|
1643
|
+
baseURL: z$1.ZodString;
|
|
1644
|
+
defaultModel: z$1.ZodString;
|
|
1645
|
+
selectedModel: z$1.ZodOptional<z$1.ZodString>;
|
|
1646
|
+
models: z$1.ZodOptional<z$1.ZodObject<{
|
|
1647
|
+
instruction: z$1.ZodOptional<z$1.ZodString>;
|
|
1648
|
+
chat: z$1.ZodOptional<z$1.ZodString>;
|
|
1649
|
+
free: z$1.ZodOptional<z$1.ZodString>;
|
|
1650
|
+
}, z$1.core.$strip>>;
|
|
1651
|
+
streamSupport: z$1.ZodBoolean;
|
|
1652
|
+
defaultHeaders: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
1653
|
+
routes: z$1.ZodObject<{
|
|
1654
|
+
chatCompletion: z$1.ZodString;
|
|
1655
|
+
models: z$1.ZodString;
|
|
1656
|
+
}, z$1.core.$strip>;
|
|
1657
|
+
}, z$1.core.$strip>>>;
|
|
1658
|
+
siteUrl: z$1.ZodDefault<z$1.ZodString>;
|
|
1659
|
+
summaryModel: z$1.ZodDefault<z$1.ZodString>;
|
|
1660
|
+
vectorizationModel: z$1.ZodDefault<z$1.ZodString>;
|
|
1661
|
+
maxAutonomousTasks: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1662
|
+
entryNode: z$1.ZodOptional<z$1.ZodObject<{
|
|
1663
|
+
role: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1664
|
+
function: "function";
|
|
1665
|
+
system: "system";
|
|
1666
|
+
user: "user";
|
|
1667
|
+
assistant: "assistant";
|
|
1668
|
+
}>>>;
|
|
1669
|
+
name: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1670
|
+
content: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1671
|
+
type: z$1.ZodLiteral<"message">;
|
|
1672
|
+
data: z$1.ZodString;
|
|
1673
|
+
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>>;
|
|
1682
|
+
}, 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>>>;
|
|
1688
|
+
}, z$1.core.$strip>]>>>;
|
|
1689
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1690
|
+
type: z$1.ZodLiteral<"toolresult">;
|
|
1691
|
+
data: z$1.ZodUnknown;
|
|
1692
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1693
|
+
type: z$1.ZodLiteral<"tooldefinition">;
|
|
1694
|
+
data: z$1.ZodObject<{
|
|
1695
|
+
description: z$1.ZodString;
|
|
1696
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
1697
|
+
name: z$1.ZodString;
|
|
1698
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
1699
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1700
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1701
|
+
}, z$1.core.$strip>>;
|
|
1702
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
1703
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
1704
|
+
}, z$1.core.$strip>;
|
|
1705
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1706
|
+
type: z$1.ZodLiteral<"error">;
|
|
1707
|
+
data: z$1.ZodUnknown;
|
|
1708
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1709
|
+
type: z$1.ZodLiteral<"structured">;
|
|
1710
|
+
data: z$1.ZodUnknown;
|
|
1711
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1712
|
+
type: z$1.ZodLiteral<"functioncall">;
|
|
1713
|
+
data: z$1.ZodObject<{
|
|
1714
|
+
name: z$1.ZodString;
|
|
1715
|
+
arguments: 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]>>;
|
|
1716
|
+
}, z$1.core.$strip>;
|
|
1717
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1718
|
+
type: z$1.ZodLiteral<"files">;
|
|
1719
|
+
data: z$1.ZodArray<z$1.ZodString>;
|
|
1720
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1721
|
+
type: z$1.ZodLiteral<"return">;
|
|
1722
|
+
data: z$1.ZodString;
|
|
1723
|
+
}, z$1.core.$strict>]>>>;
|
|
1724
|
+
label: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
1725
|
+
parentID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1726
|
+
priorID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1727
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1728
|
+
authorId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1729
|
+
created_at: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1730
|
+
acl: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
1731
|
+
sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1732
|
+
}, z$1.core.$strip>>;
|
|
1733
|
+
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
|
+
}, z$1.core.$strip>;
|
|
1749
|
+
signatureOrKey: z$1.ZodOptional<z$1.ZodString>;
|
|
1750
|
+
}, z$1.core.$strip>;
|
|
1751
|
+
type TyProfile = z$1.infer<typeof TyProfile>;
|
|
1752
|
+
|
|
1753
|
+
type partialTyConfiguration = PartialDeep<TyProfile>;
|
|
1754
|
+
declare const TaskyonGuiMessage: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
1755
|
+
type: z$1.ZodLiteral<"addTasks">;
|
|
1756
|
+
data: z$1.ZodType<Uint8Array<ArrayBuffer>>;
|
|
1757
|
+
info: z$1.ZodString;
|
|
1758
|
+
ids: z$1.ZodArray<z$1.ZodString>;
|
|
1759
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1760
|
+
type: z$1.ZodLiteral<"requestTask">;
|
|
1761
|
+
id: z$1.ZodString;
|
|
1762
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1763
|
+
type: z$1.ZodLiteral<"taskCreated">;
|
|
1764
|
+
task: z$1.ZodOptional<z$1.ZodObject<{
|
|
1765
|
+
role: z$1.ZodEnum<{
|
|
1766
|
+
function: "function";
|
|
1767
|
+
system: "system";
|
|
1768
|
+
user: "user";
|
|
1769
|
+
assistant: "assistant";
|
|
1770
|
+
}>;
|
|
1771
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1772
|
+
content: z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1773
|
+
type: z$1.ZodLiteral<"message">;
|
|
1774
|
+
data: z$1.ZodString;
|
|
1775
|
+
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>>;
|
|
1784
|
+
}, 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>>>;
|
|
1790
|
+
}, z$1.core.$strip>]>>>;
|
|
1791
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1792
|
+
type: z$1.ZodLiteral<"toolresult">;
|
|
1793
|
+
data: z$1.ZodUnknown;
|
|
1794
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1795
|
+
type: z$1.ZodLiteral<"tooldefinition">;
|
|
1796
|
+
data: z$1.ZodObject<{
|
|
1797
|
+
description: z$1.ZodString;
|
|
1798
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
1799
|
+
name: z$1.ZodString;
|
|
1800
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
1801
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1802
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1803
|
+
}, z$1.core.$strip>>;
|
|
1804
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
1805
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
1806
|
+
}, z$1.core.$strip>;
|
|
1807
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1808
|
+
type: z$1.ZodLiteral<"error">;
|
|
1809
|
+
data: z$1.ZodUnknown;
|
|
1810
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1811
|
+
type: z$1.ZodLiteral<"structured">;
|
|
1812
|
+
data: z$1.ZodUnknown;
|
|
1813
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1814
|
+
type: z$1.ZodLiteral<"functioncall">;
|
|
1815
|
+
data: z$1.ZodObject<{
|
|
1816
|
+
name: z$1.ZodString;
|
|
1817
|
+
arguments: 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]>>;
|
|
1818
|
+
}, z$1.core.$strip>;
|
|
1819
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1820
|
+
type: z$1.ZodLiteral<"files">;
|
|
1821
|
+
data: z$1.ZodArray<z$1.ZodString>;
|
|
1822
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1823
|
+
type: z$1.ZodLiteral<"return">;
|
|
1824
|
+
data: z$1.ZodString;
|
|
1825
|
+
}, z$1.core.$strict>]>;
|
|
1826
|
+
label: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1827
|
+
parentID: z$1.ZodOptional<z$1.ZodString>;
|
|
1828
|
+
priorID: z$1.ZodOptional<z$1.ZodString>;
|
|
1829
|
+
id: z$1.ZodString;
|
|
1830
|
+
authorId: z$1.ZodOptional<z$1.ZodString>;
|
|
1831
|
+
created_at: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1832
|
+
acl: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1833
|
+
sig: z$1.ZodOptional<z$1.ZodString>;
|
|
1834
|
+
}, z$1.core.$strip>>;
|
|
1835
|
+
ids: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1836
|
+
info: z$1.ZodOptional<z$1.ZodString>;
|
|
1837
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1838
|
+
type: z$1.ZodLiteral<"status">;
|
|
1839
|
+
data: z$1.ZodObject<{
|
|
1840
|
+
type: z$1.ZodLiteral<"newtool">;
|
|
1841
|
+
id: z$1.ZodString;
|
|
1842
|
+
}, z$1.core.$strip>;
|
|
1843
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1844
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1845
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1846
|
+
functionName: z$1.ZodString;
|
|
1847
|
+
type: z$1.ZodLiteral<"functionCall">;
|
|
1848
|
+
arguments: z$1.ZodOptional<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]>>>;
|
|
1849
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1850
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1851
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1852
|
+
functionName: z$1.ZodString;
|
|
1853
|
+
type: z$1.ZodLiteral<"functionResponse">;
|
|
1854
|
+
response: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
1855
|
+
error: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
1856
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1857
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1858
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1859
|
+
type: z$1.ZodLiteral<"task">;
|
|
1860
|
+
task: z$1.ZodObject<{
|
|
1861
|
+
role: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1862
|
+
function: "function";
|
|
1863
|
+
system: "system";
|
|
1864
|
+
user: "user";
|
|
1865
|
+
assistant: "assistant";
|
|
1866
|
+
}>>>;
|
|
1867
|
+
name: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1868
|
+
content: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1869
|
+
type: z$1.ZodLiteral<"message">;
|
|
1870
|
+
data: z$1.ZodString;
|
|
1871
|
+
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>>;
|
|
1880
|
+
}, 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>>>;
|
|
1886
|
+
}, z$1.core.$strip>]>>>;
|
|
1887
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1888
|
+
type: z$1.ZodLiteral<"toolresult">;
|
|
1889
|
+
data: z$1.ZodUnknown;
|
|
1890
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1891
|
+
type: z$1.ZodLiteral<"tooldefinition">;
|
|
1892
|
+
data: z$1.ZodObject<{
|
|
1893
|
+
description: z$1.ZodString;
|
|
1894
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
1895
|
+
name: z$1.ZodString;
|
|
1896
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
1897
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1898
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1899
|
+
}, z$1.core.$strip>>;
|
|
1900
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
1901
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
1902
|
+
}, z$1.core.$strip>;
|
|
1903
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1904
|
+
type: z$1.ZodLiteral<"error">;
|
|
1905
|
+
data: z$1.ZodUnknown;
|
|
1906
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1907
|
+
type: z$1.ZodLiteral<"structured">;
|
|
1908
|
+
data: z$1.ZodUnknown;
|
|
1909
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1910
|
+
type: z$1.ZodLiteral<"functioncall">;
|
|
1911
|
+
data: z$1.ZodObject<{
|
|
1912
|
+
name: z$1.ZodString;
|
|
1913
|
+
arguments: 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]>>;
|
|
1914
|
+
}, z$1.core.$strip>;
|
|
1915
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1916
|
+
type: z$1.ZodLiteral<"files">;
|
|
1917
|
+
data: z$1.ZodArray<z$1.ZodString>;
|
|
1918
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1919
|
+
type: z$1.ZodLiteral<"return">;
|
|
1920
|
+
data: z$1.ZodString;
|
|
1921
|
+
}, z$1.core.$strict>]>>>;
|
|
1922
|
+
label: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
1923
|
+
parentID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1924
|
+
priorID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1925
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
1926
|
+
authorId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1927
|
+
created_at: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1928
|
+
acl: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
1929
|
+
sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1930
|
+
}, z$1.core.$strip>;
|
|
1931
|
+
execute: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1932
|
+
show: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1933
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
1934
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
1935
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
1936
|
+
type: z$1.ZodLiteral<"tasks">;
|
|
1937
|
+
execute: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1938
|
+
tasks: z$1.ZodArray<z$1.ZodObject<{
|
|
1939
|
+
role: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1940
|
+
function: "function";
|
|
1941
|
+
system: "system";
|
|
1942
|
+
user: "user";
|
|
1943
|
+
assistant: "assistant";
|
|
1944
|
+
}>>>;
|
|
1945
|
+
name: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
1946
|
+
content: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
1947
|
+
type: z$1.ZodLiteral<"message">;
|
|
1948
|
+
data: z$1.ZodString;
|
|
1949
|
+
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>>;
|
|
1958
|
+
}, 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>>>;
|
|
1964
|
+
}, z$1.core.$strip>]>>>;
|
|
1965
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1966
|
+
type: z$1.ZodLiteral<"toolresult">;
|
|
1967
|
+
data: z$1.ZodUnknown;
|
|
1968
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1969
|
+
type: z$1.ZodLiteral<"tooldefinition">;
|
|
1970
|
+
data: z$1.ZodObject<{
|
|
1971
|
+
description: z$1.ZodString;
|
|
1972
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
1973
|
+
name: z$1.ZodString;
|
|
1974
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
1975
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1976
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1977
|
+
}, z$1.core.$strip>>;
|
|
1978
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
1979
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
1980
|
+
}, z$1.core.$strip>;
|
|
1981
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1982
|
+
type: z$1.ZodLiteral<"error">;
|
|
1983
|
+
data: z$1.ZodUnknown;
|
|
1984
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1985
|
+
type: z$1.ZodLiteral<"structured">;
|
|
1986
|
+
data: z$1.ZodUnknown;
|
|
1987
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1988
|
+
type: z$1.ZodLiteral<"functioncall">;
|
|
1989
|
+
data: z$1.ZodObject<{
|
|
1990
|
+
name: z$1.ZodString;
|
|
1991
|
+
arguments: 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]>>;
|
|
1992
|
+
}, z$1.core.$strip>;
|
|
1993
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1994
|
+
type: z$1.ZodLiteral<"files">;
|
|
1995
|
+
data: z$1.ZodArray<z$1.ZodString>;
|
|
1996
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
1997
|
+
type: z$1.ZodLiteral<"return">;
|
|
1998
|
+
data: z$1.ZodString;
|
|
1999
|
+
}, z$1.core.$strict>]>>>;
|
|
2000
|
+
label: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
2001
|
+
parentID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2002
|
+
priorID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2003
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
2004
|
+
authorId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2005
|
+
created_at: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
2006
|
+
acl: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
2007
|
+
sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2008
|
+
}, z$1.core.$strip>>;
|
|
2009
|
+
show: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
2010
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
2011
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
2012
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2013
|
+
description: z$1.ZodString;
|
|
2014
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
2015
|
+
name: z$1.ZodString;
|
|
2016
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
2017
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2018
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2019
|
+
}, z$1.core.$strip>>;
|
|
2020
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
2021
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
2022
|
+
type: z$1.ZodLiteral<"functionDescription">;
|
|
2023
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
2024
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
2025
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2026
|
+
type: z$1.ZodLiteral<"taskyonReady">;
|
|
2027
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
2028
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
2029
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2030
|
+
type: z$1.ZodLiteral<"file">;
|
|
2031
|
+
id: z$1.ZodString;
|
|
2032
|
+
name: z$1.ZodString;
|
|
2033
|
+
mime: z$1.ZodString;
|
|
2034
|
+
size: z$1.ZodNumber;
|
|
2035
|
+
store: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2036
|
+
memory: "memory";
|
|
2037
|
+
opfs: "opfs";
|
|
2038
|
+
}>>;
|
|
2039
|
+
file: z$1.ZodFile;
|
|
2040
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
2041
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
2042
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2043
|
+
type: z$1.ZodLiteral<"configurationMessage">;
|
|
2044
|
+
persist: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2045
|
+
conf: z$1.ZodUnion<readonly [z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodObject<{
|
|
2046
|
+
version: z$1.ZodLiteral<21>;
|
|
2047
|
+
appConfiguration: z$1.ZodObject<{
|
|
2048
|
+
darkTheme: z$1.ZodUnion<readonly [z$1.ZodLiteral<"auto">, z$1.ZodBoolean]>;
|
|
2049
|
+
appConfigurationUrl: z$1.ZodDefault<z$1.ZodString>;
|
|
2050
|
+
gdriveConfigurationFile: z$1.ZodDefault<z$1.ZodString>;
|
|
2051
|
+
enableGdriveSync: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
2052
|
+
expertMode: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
2053
|
+
showCosts: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
2054
|
+
gdriveDir: z$1.ZodDefault<z$1.ZodString>;
|
|
2055
|
+
showLogo: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
2056
|
+
welcomeMsg: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
|
|
2057
|
+
chatSuggestions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
2058
|
+
url: z$1.ZodString;
|
|
2059
|
+
label: z$1.ZodString;
|
|
2060
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
2061
|
+
md: z$1.ZodString;
|
|
2062
|
+
label: z$1.ZodString;
|
|
2063
|
+
}, z$1.core.$strip>]>>>>;
|
|
2064
|
+
useEnterToSend: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2065
|
+
shift: "shift";
|
|
2066
|
+
auto: "auto";
|
|
2067
|
+
on: "on";
|
|
2068
|
+
off: "off";
|
|
2069
|
+
}>>;
|
|
2070
|
+
guiMode: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2071
|
+
default: "default";
|
|
2072
|
+
auto: "auto";
|
|
2073
|
+
iframe: "iframe";
|
|
2074
|
+
minChat: "minChat";
|
|
2075
|
+
}>>;
|
|
2076
|
+
primaryColor: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
|
|
2077
|
+
secondaryColor: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
|
|
2078
|
+
}, z$1.core.$strip>;
|
|
2079
|
+
llmSettings: z$1.ZodObject<{
|
|
2080
|
+
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
|
+
secretPublicKey: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
2083
|
+
selectedTaskId: z$1.ZodOptional<z$1.ZodString>;
|
|
2084
|
+
enableOpenAiTools: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
2085
|
+
selectedApi: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>>;
|
|
2086
|
+
llmApis: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
2087
|
+
name: z$1.ZodString;
|
|
2088
|
+
baseURL: z$1.ZodString;
|
|
2089
|
+
defaultModel: z$1.ZodString;
|
|
2090
|
+
selectedModel: z$1.ZodOptional<z$1.ZodString>;
|
|
2091
|
+
models: z$1.ZodOptional<z$1.ZodObject<{
|
|
2092
|
+
instruction: z$1.ZodOptional<z$1.ZodString>;
|
|
2093
|
+
chat: z$1.ZodOptional<z$1.ZodString>;
|
|
2094
|
+
free: z$1.ZodOptional<z$1.ZodString>;
|
|
2095
|
+
}, z$1.core.$strip>>;
|
|
2096
|
+
streamSupport: z$1.ZodBoolean;
|
|
2097
|
+
defaultHeaders: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
2098
|
+
routes: z$1.ZodObject<{
|
|
2099
|
+
chatCompletion: z$1.ZodString;
|
|
2100
|
+
models: z$1.ZodString;
|
|
2101
|
+
}, z$1.core.$strip>;
|
|
2102
|
+
}, z$1.core.$strip>>>;
|
|
2103
|
+
siteUrl: z$1.ZodDefault<z$1.ZodString>;
|
|
2104
|
+
summaryModel: z$1.ZodDefault<z$1.ZodString>;
|
|
2105
|
+
vectorizationModel: z$1.ZodDefault<z$1.ZodString>;
|
|
2106
|
+
maxAutonomousTasks: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2107
|
+
entryNode: z$1.ZodOptional<z$1.ZodObject<{
|
|
2108
|
+
role: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodEnum<{
|
|
2109
|
+
function: "function";
|
|
2110
|
+
system: "system";
|
|
2111
|
+
user: "user";
|
|
2112
|
+
assistant: "assistant";
|
|
2113
|
+
}>>>;
|
|
2114
|
+
name: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2115
|
+
content: z$1.ZodNonOptional<z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
2116
|
+
type: z$1.ZodLiteral<"message">;
|
|
2117
|
+
data: z$1.ZodString;
|
|
2118
|
+
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>>;
|
|
2127
|
+
}, 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>>>;
|
|
2133
|
+
}, z$1.core.$strip>]>>>;
|
|
2134
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
2135
|
+
type: z$1.ZodLiteral<"toolresult">;
|
|
2136
|
+
data: z$1.ZodUnknown;
|
|
2137
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
2138
|
+
type: z$1.ZodLiteral<"tooldefinition">;
|
|
2139
|
+
data: z$1.ZodObject<{
|
|
2140
|
+
description: z$1.ZodString;
|
|
2141
|
+
longDescription: z$1.ZodOptional<z$1.ZodString>;
|
|
2142
|
+
name: z$1.ZodString;
|
|
2143
|
+
renderOptions: z$1.ZodOptional<z$1.ZodObject<{
|
|
2144
|
+
hideChat: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2145
|
+
hideLlm: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2146
|
+
}, z$1.core.$strip>>;
|
|
2147
|
+
parameters: z$1.ZodReadonly<z$1.ZodType<json_schema.JSONSchema7, unknown, z$1.core.$ZodTypeInternals<json_schema.JSONSchema7, unknown>>>;
|
|
2148
|
+
code: z$1.ZodOptional<z$1.ZodString>;
|
|
2149
|
+
}, z$1.core.$strip>;
|
|
2150
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
2151
|
+
type: z$1.ZodLiteral<"error">;
|
|
2152
|
+
data: z$1.ZodUnknown;
|
|
2153
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
2154
|
+
type: z$1.ZodLiteral<"structured">;
|
|
2155
|
+
data: z$1.ZodUnknown;
|
|
2156
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
2157
|
+
type: z$1.ZodLiteral<"functioncall">;
|
|
2158
|
+
data: z$1.ZodObject<{
|
|
2159
|
+
name: z$1.ZodString;
|
|
2160
|
+
arguments: 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]>>;
|
|
2161
|
+
}, z$1.core.$strip>;
|
|
2162
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
2163
|
+
type: z$1.ZodLiteral<"files">;
|
|
2164
|
+
data: z$1.ZodArray<z$1.ZodString>;
|
|
2165
|
+
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
2166
|
+
type: z$1.ZodLiteral<"return">;
|
|
2167
|
+
data: z$1.ZodString;
|
|
2168
|
+
}, z$1.core.$strict>]>>>;
|
|
2169
|
+
label: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
2170
|
+
parentID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2171
|
+
priorID: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2172
|
+
id: z$1.ZodOptional<z$1.ZodString>;
|
|
2173
|
+
authorId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2174
|
+
created_at: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
2175
|
+
acl: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>>;
|
|
2176
|
+
sig: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
|
|
2177
|
+
}, z$1.core.$strip>>;
|
|
2178
|
+
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
|
+
}, z$1.core.$strip>;
|
|
2194
|
+
signatureOrKey: z$1.ZodOptional<z$1.ZodString>;
|
|
2195
|
+
}, z$1.core.$strip>]>;
|
|
2196
|
+
origin: z$1.ZodOptional<z$1.ZodString>;
|
|
2197
|
+
peerId: z$1.ZodOptional<z$1.ZodString>;
|
|
2198
|
+
}, z$1.core.$strip>]>;
|
|
2199
|
+
type TaskyonGuiMessage = z$1.infer<typeof TaskyonGuiMessage>;
|
|
2200
|
+
|
|
2201
|
+
interface TyClient {
|
|
2202
|
+
processTasks: ReturnType<typeof processTasks>;
|
|
2203
|
+
port: Port<TaskyonGuiMessage, TaskyonGuiMessage>;
|
|
2204
|
+
sendFile: (file: File) => Promise<string>;
|
|
2205
|
+
}
|
|
2206
|
+
declare function initializeTaskyon(options: {
|
|
2207
|
+
name?: string;
|
|
2208
|
+
persist?: boolean;
|
|
2209
|
+
tools: ClientTool[];
|
|
2210
|
+
configuration: partialTyConfiguration;
|
|
2211
|
+
}): Promise<TyClient>;
|
|
2212
|
+
|
|
2213
|
+
export { type ClientTool, TaskyonGuiMessage, TaskyonMessage, type TyClient, createChatCompletionTask, createTool, initializeTaskyon, makeTaskResult, partialTaskDraft, type partialTyConfiguration, processTasks, toolCall };
|