@to11ai/sdk 0.6.0 → 0.8.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/dist/client.d.ts +1 -1
- package/dist/gateway.cjs +130 -0
- package/dist/gateway.d.ts +154 -1
- package/dist/gateway.js +130 -0
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/types.gen.d.ts +75 -23
- package/dist/generated/zod.gen.d.ts +230 -40
- package/dist/prompts/cache.d.ts +1 -1
- package/dist/prompts/resource.cjs +14 -3
- package/dist/prompts/resource.d.ts +1 -1
- package/dist/prompts/resource.js +14 -3
- package/dist/prompts/types.d.ts +44 -10
- package/package.json +1 -1
- package/src/client.ts +1 -0
- package/src/gateway.ts +297 -0
- package/src/generated/index.ts +1 -1
- package/src/generated/types.gen.ts +81 -23
- package/src/generated/zod.gen.ts +118 -31
- package/src/prompts/cache.ts +4 -1
- package/src/prompts/resource.ts +20 -1
- package/src/prompts/types.ts +57 -10
|
@@ -233,6 +233,7 @@ export type PromptRelease = {
|
|
|
233
233
|
};
|
|
234
234
|
export type PromptVersion = {
|
|
235
235
|
changelog: string | null;
|
|
236
|
+
contextSchema: unknown;
|
|
236
237
|
createdAt: string;
|
|
237
238
|
createdByDisplayName: string | null;
|
|
238
239
|
createdByImage: string | null;
|
|
@@ -245,18 +246,30 @@ export type PromptVersion = {
|
|
|
245
246
|
variablesSchema: unknown;
|
|
246
247
|
version: number;
|
|
247
248
|
};
|
|
249
|
+
export type RenderedAssistantMessage = {
|
|
250
|
+
content?: string | null;
|
|
251
|
+
role: 'assistant';
|
|
252
|
+
toolCalls?: Array<ResolvedToolCall> | null;
|
|
253
|
+
};
|
|
254
|
+
export type RenderedChatMessage = RenderedTextMessage | RenderedAssistantMessage | RenderedToolMessage;
|
|
248
255
|
export type RenderedChatPrompt = {
|
|
249
256
|
format: 'chat';
|
|
250
|
-
messages: Array<
|
|
251
|
-
content: string;
|
|
252
|
-
role: 'system' | 'user' | 'assistant' | 'developer' | 'tool';
|
|
253
|
-
}>;
|
|
257
|
+
messages: Array<RenderedChatMessage>;
|
|
254
258
|
};
|
|
255
259
|
export type RenderedPrompt = RenderedTextPrompt | RenderedChatPrompt;
|
|
260
|
+
export type RenderedTextMessage = {
|
|
261
|
+
content: string;
|
|
262
|
+
role: 'system' | 'user' | 'developer';
|
|
263
|
+
};
|
|
256
264
|
export type RenderedTextPrompt = {
|
|
257
265
|
format: 'text';
|
|
258
266
|
text: string;
|
|
259
267
|
};
|
|
268
|
+
export type RenderedToolMessage = {
|
|
269
|
+
content: string;
|
|
270
|
+
role: 'tool';
|
|
271
|
+
toolCallId: string;
|
|
272
|
+
};
|
|
260
273
|
export type ResolvedPrompt = {
|
|
261
274
|
blockRenderRecord?: {
|
|
262
275
|
[key: string]: 'rendered' | 'dimmed';
|
|
@@ -267,10 +280,28 @@ export type ResolvedPrompt = {
|
|
|
267
280
|
releaseId: string;
|
|
268
281
|
rendered: RenderedPrompt;
|
|
269
282
|
subjectHash?: string | null;
|
|
283
|
+
toolChoice?: 'auto' | 'none' | 'required' | {
|
|
284
|
+
name: string;
|
|
285
|
+
} | null;
|
|
286
|
+
tools?: Array<ResolvedToolDefinition> | null;
|
|
270
287
|
variantName?: string | null;
|
|
271
288
|
version: number;
|
|
272
289
|
versionId: string;
|
|
273
290
|
};
|
|
291
|
+
export type ResolvedToolCall = {
|
|
292
|
+
arguments: {
|
|
293
|
+
[key: string]: unknown;
|
|
294
|
+
};
|
|
295
|
+
id: string;
|
|
296
|
+
name: string;
|
|
297
|
+
};
|
|
298
|
+
export type ResolvedToolDefinition = {
|
|
299
|
+
description?: string | null;
|
|
300
|
+
name: string;
|
|
301
|
+
parameters: {
|
|
302
|
+
[key: string]: unknown;
|
|
303
|
+
};
|
|
304
|
+
};
|
|
274
305
|
export type RuleModelBinding = {
|
|
275
306
|
modelId: string;
|
|
276
307
|
provider: RuleProviderRef;
|
|
@@ -9343,7 +9374,7 @@ export type ProjectAuditListProjectAuditEventsResponses = {
|
|
|
9343
9374
|
providerSlug: string | null;
|
|
9344
9375
|
reason: string | null;
|
|
9345
9376
|
resourceId: string;
|
|
9346
|
-
resourceType: 'provider' | 'credential' | 'prompt' | 'rule' | 'env';
|
|
9377
|
+
resourceType: 'provider' | 'credential' | 'prompt' | 'rule' | 'env' | 'role' | 'api_key' | 'project' | 'organization' | 'organization_invitation' | 'workspace' | 'data_center' | 'cost_rate';
|
|
9347
9378
|
scheduledAt: string | null;
|
|
9348
9379
|
scheduledBy: string | null;
|
|
9349
9380
|
}>;
|
|
@@ -9388,7 +9419,7 @@ export type ProjectAuditExportExportProjectAuditEventsData = {
|
|
|
9388
9419
|
provider_id?: string | null;
|
|
9389
9420
|
credential_id?: string | null;
|
|
9390
9421
|
actor_id?: string | null;
|
|
9391
|
-
resource_type?: 'provider' | 'credential' | 'prompt' | 'rule' | 'env' | null;
|
|
9422
|
+
resource_type?: 'provider' | 'credential' | 'prompt' | 'rule' | 'env' | 'role' | 'api_key' | 'project' | 'organization' | 'organization_invitation' | 'workspace' | 'data_center' | 'cost_rate' | null;
|
|
9392
9423
|
event_type?: string | null;
|
|
9393
9424
|
since?: string | null;
|
|
9394
9425
|
until?: string | null;
|
|
@@ -14547,6 +14578,15 @@ export type PromptsCreatePromptVersionData = {
|
|
|
14547
14578
|
allowBlockRemovals?: Array<string> | null;
|
|
14548
14579
|
baseVersionId?: string | null;
|
|
14549
14580
|
changelog?: string | null;
|
|
14581
|
+
contextSchema?: {
|
|
14582
|
+
properties?: {
|
|
14583
|
+
[key: string]: {
|
|
14584
|
+
enum?: Array<string> | null;
|
|
14585
|
+
type?: 'string' | 'number' | 'boolean' | 'enum' | null;
|
|
14586
|
+
};
|
|
14587
|
+
} | null;
|
|
14588
|
+
required?: Array<string> | null;
|
|
14589
|
+
} | null;
|
|
14550
14590
|
format: 'text' | 'chat';
|
|
14551
14591
|
modelConfig?: unknown | null;
|
|
14552
14592
|
templateJson: unknown;
|
|
@@ -14713,12 +14753,14 @@ export type PromptsGetPromptVersionDiffResponses = {
|
|
|
14713
14753
|
name: string;
|
|
14714
14754
|
op: 'add';
|
|
14715
14755
|
role: 'system' | 'user' | 'assistant' | 'developer' | 'tool';
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14756
|
+
toolCallId?: string | null;
|
|
14757
|
+
toolCalls?: Array<{
|
|
14758
|
+
arguments: {
|
|
14719
14759
|
[key: string]: unknown;
|
|
14720
14760
|
};
|
|
14721
|
-
|
|
14761
|
+
id: string;
|
|
14762
|
+
name: string;
|
|
14763
|
+
}> | null;
|
|
14722
14764
|
} | {
|
|
14723
14765
|
condition: {
|
|
14724
14766
|
kind: string;
|
|
@@ -14727,12 +14769,14 @@ export type PromptsGetPromptVersionDiffResponses = {
|
|
|
14727
14769
|
name: string;
|
|
14728
14770
|
op: 'remove';
|
|
14729
14771
|
role: 'system' | 'user' | 'assistant' | 'developer' | 'tool';
|
|
14730
|
-
|
|
14731
|
-
|
|
14732
|
-
|
|
14772
|
+
toolCallId?: string | null;
|
|
14773
|
+
toolCalls?: Array<{
|
|
14774
|
+
arguments: {
|
|
14733
14775
|
[key: string]: unknown;
|
|
14734
14776
|
};
|
|
14735
|
-
|
|
14777
|
+
id: string;
|
|
14778
|
+
name: string;
|
|
14779
|
+
}> | null;
|
|
14736
14780
|
} | {
|
|
14737
14781
|
after: string;
|
|
14738
14782
|
before: string;
|
|
@@ -14758,20 +14802,27 @@ export type PromptsGetPromptVersionDiffResponses = {
|
|
|
14758
14802
|
name: string;
|
|
14759
14803
|
op: 'edit_required';
|
|
14760
14804
|
} | {
|
|
14761
|
-
after:
|
|
14762
|
-
|
|
14763
|
-
|
|
14805
|
+
after: string;
|
|
14806
|
+
before: string;
|
|
14807
|
+
name: string;
|
|
14808
|
+
op: 'edit_tool_call_id';
|
|
14809
|
+
} | {
|
|
14810
|
+
after: Array<{
|
|
14811
|
+
arguments: {
|
|
14764
14812
|
[key: string]: unknown;
|
|
14765
14813
|
};
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14814
|
+
id: string;
|
|
14815
|
+
name: string;
|
|
14816
|
+
}>;
|
|
14817
|
+
before: Array<{
|
|
14818
|
+
arguments: {
|
|
14770
14819
|
[key: string]: unknown;
|
|
14771
14820
|
};
|
|
14772
|
-
|
|
14821
|
+
id: string;
|
|
14822
|
+
name: string;
|
|
14823
|
+
}>;
|
|
14773
14824
|
name: string;
|
|
14774
|
-
op: '
|
|
14825
|
+
op: 'edit_tool_calls';
|
|
14775
14826
|
} | {
|
|
14776
14827
|
fromIndex: number;
|
|
14777
14828
|
name: string;
|
|
@@ -15218,6 +15269,7 @@ export type PromptsResolvePromptData = {
|
|
|
15218
15269
|
context?: {
|
|
15219
15270
|
[key: string]: string | number | boolean;
|
|
15220
15271
|
} | null;
|
|
15272
|
+
developerRole?: 'user' | 'developer' | 'system' | null;
|
|
15221
15273
|
labels: Array<string>;
|
|
15222
15274
|
slug: string;
|
|
15223
15275
|
subject?: string | null;
|
|
@@ -301,6 +301,7 @@ export declare const zPromptRelease: z.ZodObject<{
|
|
|
301
301
|
}, z.core.$strip>;
|
|
302
302
|
export declare const zPromptVersion: z.ZodObject<{
|
|
303
303
|
changelog: z.ZodNullable<z.ZodString>;
|
|
304
|
+
contextSchema: z.ZodUnknown;
|
|
304
305
|
createdAt: z.ZodISODateTime;
|
|
305
306
|
createdByDisplayName: z.ZodNullable<z.ZodString>;
|
|
306
307
|
createdByImage: z.ZodNullable<z.ZodString>;
|
|
@@ -316,26 +317,95 @@ export declare const zPromptVersion: z.ZodObject<{
|
|
|
316
317
|
variablesSchema: z.ZodUnknown;
|
|
317
318
|
version: z.ZodInt;
|
|
318
319
|
}, z.core.$strip>;
|
|
320
|
+
export declare const zRenderedTextMessage: z.ZodObject<{
|
|
321
|
+
content: z.ZodString;
|
|
322
|
+
role: z.ZodEnum<{
|
|
323
|
+
user: "user";
|
|
324
|
+
system: "system";
|
|
325
|
+
developer: "developer";
|
|
326
|
+
}>;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
export declare const zRenderedTextPrompt: z.ZodObject<{
|
|
329
|
+
format: z.ZodEnum<{
|
|
330
|
+
text: "text";
|
|
331
|
+
}>;
|
|
332
|
+
text: z.ZodString;
|
|
333
|
+
}, z.core.$strip>;
|
|
334
|
+
export declare const zRenderedToolMessage: z.ZodObject<{
|
|
335
|
+
content: z.ZodString;
|
|
336
|
+
role: z.ZodEnum<{
|
|
337
|
+
tool: "tool";
|
|
338
|
+
}>;
|
|
339
|
+
toolCallId: z.ZodString;
|
|
340
|
+
}, z.core.$strip>;
|
|
341
|
+
export declare const zResolvedToolCall: z.ZodObject<{
|
|
342
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
343
|
+
id: z.ZodString;
|
|
344
|
+
name: z.ZodString;
|
|
345
|
+
}, z.core.$strip>;
|
|
346
|
+
export declare const zRenderedAssistantMessage: z.ZodObject<{
|
|
347
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
348
|
+
role: z.ZodEnum<{
|
|
349
|
+
assistant: "assistant";
|
|
350
|
+
}>;
|
|
351
|
+
toolCalls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
352
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
353
|
+
id: z.ZodString;
|
|
354
|
+
name: z.ZodString;
|
|
355
|
+
}, z.core.$strip>>>>;
|
|
356
|
+
}, z.core.$strip>;
|
|
357
|
+
export declare const zRenderedChatMessage: z.ZodUnion<readonly [z.ZodObject<{
|
|
358
|
+
content: z.ZodString;
|
|
359
|
+
role: z.ZodEnum<{
|
|
360
|
+
user: "user";
|
|
361
|
+
system: "system";
|
|
362
|
+
developer: "developer";
|
|
363
|
+
}>;
|
|
364
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
365
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
366
|
+
role: z.ZodEnum<{
|
|
367
|
+
assistant: "assistant";
|
|
368
|
+
}>;
|
|
369
|
+
toolCalls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
370
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
371
|
+
id: z.ZodString;
|
|
372
|
+
name: z.ZodString;
|
|
373
|
+
}, z.core.$strip>>>>;
|
|
374
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
375
|
+
content: z.ZodString;
|
|
376
|
+
role: z.ZodEnum<{
|
|
377
|
+
tool: "tool";
|
|
378
|
+
}>;
|
|
379
|
+
toolCallId: z.ZodString;
|
|
380
|
+
}, z.core.$strip>]>;
|
|
319
381
|
export declare const zRenderedChatPrompt: z.ZodObject<{
|
|
320
382
|
format: z.ZodEnum<{
|
|
321
383
|
chat: "chat";
|
|
322
384
|
}>;
|
|
323
|
-
messages: z.ZodArray<z.ZodObject<{
|
|
385
|
+
messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
324
386
|
content: z.ZodString;
|
|
325
387
|
role: z.ZodEnum<{
|
|
326
388
|
user: "user";
|
|
327
389
|
system: "system";
|
|
328
|
-
assistant: "assistant";
|
|
329
390
|
developer: "developer";
|
|
391
|
+
}>;
|
|
392
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
393
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
394
|
+
role: z.ZodEnum<{
|
|
395
|
+
assistant: "assistant";
|
|
396
|
+
}>;
|
|
397
|
+
toolCalls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
398
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
399
|
+
id: z.ZodString;
|
|
400
|
+
name: z.ZodString;
|
|
401
|
+
}, z.core.$strip>>>>;
|
|
402
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
403
|
+
content: z.ZodString;
|
|
404
|
+
role: z.ZodEnum<{
|
|
330
405
|
tool: "tool";
|
|
331
406
|
}>;
|
|
332
|
-
|
|
333
|
-
}, z.core.$strip
|
|
334
|
-
export declare const zRenderedTextPrompt: z.ZodObject<{
|
|
335
|
-
format: z.ZodEnum<{
|
|
336
|
-
text: "text";
|
|
337
|
-
}>;
|
|
338
|
-
text: z.ZodString;
|
|
407
|
+
toolCallId: z.ZodString;
|
|
408
|
+
}, z.core.$strip>]>>;
|
|
339
409
|
}, z.core.$strip>;
|
|
340
410
|
export declare const zRenderedPrompt: z.ZodUnion<readonly [z.ZodObject<{
|
|
341
411
|
format: z.ZodEnum<{
|
|
@@ -346,17 +416,36 @@ export declare const zRenderedPrompt: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
346
416
|
format: z.ZodEnum<{
|
|
347
417
|
chat: "chat";
|
|
348
418
|
}>;
|
|
349
|
-
messages: z.ZodArray<z.ZodObject<{
|
|
419
|
+
messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
350
420
|
content: z.ZodString;
|
|
351
421
|
role: z.ZodEnum<{
|
|
352
422
|
user: "user";
|
|
353
423
|
system: "system";
|
|
354
|
-
assistant: "assistant";
|
|
355
424
|
developer: "developer";
|
|
425
|
+
}>;
|
|
426
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
427
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
428
|
+
role: z.ZodEnum<{
|
|
429
|
+
assistant: "assistant";
|
|
430
|
+
}>;
|
|
431
|
+
toolCalls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
432
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
433
|
+
id: z.ZodString;
|
|
434
|
+
name: z.ZodString;
|
|
435
|
+
}, z.core.$strip>>>>;
|
|
436
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
437
|
+
content: z.ZodString;
|
|
438
|
+
role: z.ZodEnum<{
|
|
356
439
|
tool: "tool";
|
|
357
440
|
}>;
|
|
358
|
-
|
|
441
|
+
toolCallId: z.ZodString;
|
|
442
|
+
}, z.core.$strip>]>>;
|
|
359
443
|
}, z.core.$strip>]>;
|
|
444
|
+
export declare const zResolvedToolDefinition: z.ZodObject<{
|
|
445
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
446
|
+
name: z.ZodString;
|
|
447
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
448
|
+
}, z.core.$strip>;
|
|
360
449
|
export declare const zResolvedPrompt: z.ZodObject<{
|
|
361
450
|
blockRenderRecord: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
362
451
|
rendered: "rendered";
|
|
@@ -375,18 +464,44 @@ export declare const zResolvedPrompt: z.ZodObject<{
|
|
|
375
464
|
format: z.ZodEnum<{
|
|
376
465
|
chat: "chat";
|
|
377
466
|
}>;
|
|
378
|
-
messages: z.ZodArray<z.ZodObject<{
|
|
467
|
+
messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
379
468
|
content: z.ZodString;
|
|
380
469
|
role: z.ZodEnum<{
|
|
381
470
|
user: "user";
|
|
382
471
|
system: "system";
|
|
383
|
-
assistant: "assistant";
|
|
384
472
|
developer: "developer";
|
|
473
|
+
}>;
|
|
474
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
475
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
476
|
+
role: z.ZodEnum<{
|
|
477
|
+
assistant: "assistant";
|
|
478
|
+
}>;
|
|
479
|
+
toolCalls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
480
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
481
|
+
id: z.ZodString;
|
|
482
|
+
name: z.ZodString;
|
|
483
|
+
}, z.core.$strip>>>>;
|
|
484
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
485
|
+
content: z.ZodString;
|
|
486
|
+
role: z.ZodEnum<{
|
|
385
487
|
tool: "tool";
|
|
386
488
|
}>;
|
|
387
|
-
|
|
489
|
+
toolCallId: z.ZodString;
|
|
490
|
+
}, z.core.$strip>]>>;
|
|
388
491
|
}, z.core.$strip>]>;
|
|
389
492
|
subjectHash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
493
|
+
toolChoice: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
|
|
494
|
+
auto: "auto";
|
|
495
|
+
none: "none";
|
|
496
|
+
required: "required";
|
|
497
|
+
}>, z.ZodObject<{
|
|
498
|
+
name: z.ZodString;
|
|
499
|
+
}, z.core.$strip>]>>>;
|
|
500
|
+
tools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
501
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
502
|
+
name: z.ZodString;
|
|
503
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
504
|
+
}, z.core.$strip>>>>;
|
|
390
505
|
variantName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
391
506
|
version: z.ZodNumber;
|
|
392
507
|
versionId: z.ZodString;
|
|
@@ -5206,11 +5321,19 @@ export declare const zProjectAuditListProjectAuditEventsResponse: z.ZodObject<{
|
|
|
5206
5321
|
reason: z.ZodNullable<z.ZodString>;
|
|
5207
5322
|
resourceId: z.ZodString;
|
|
5208
5323
|
resourceType: z.ZodEnum<{
|
|
5324
|
+
api_key: "api_key";
|
|
5325
|
+
role: "role";
|
|
5209
5326
|
provider: "provider";
|
|
5327
|
+
workspace: "workspace";
|
|
5328
|
+
project: "project";
|
|
5210
5329
|
credential: "credential";
|
|
5330
|
+
organization: "organization";
|
|
5211
5331
|
prompt: "prompt";
|
|
5212
5332
|
rule: "rule";
|
|
5213
5333
|
env: "env";
|
|
5334
|
+
organization_invitation: "organization_invitation";
|
|
5335
|
+
data_center: "data_center";
|
|
5336
|
+
cost_rate: "cost_rate";
|
|
5214
5337
|
}>;
|
|
5215
5338
|
scheduledAt: z.ZodNullable<z.ZodString>;
|
|
5216
5339
|
scheduledBy: z.ZodNullable<z.ZodString>;
|
|
@@ -5254,11 +5377,19 @@ export declare const zProjectAuditExportExportProjectAuditEventsQuery: z.ZodObje
|
|
|
5254
5377
|
credential_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5255
5378
|
actor_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5256
5379
|
resource_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
5380
|
+
api_key: "api_key";
|
|
5381
|
+
role: "role";
|
|
5257
5382
|
provider: "provider";
|
|
5383
|
+
workspace: "workspace";
|
|
5384
|
+
project: "project";
|
|
5258
5385
|
credential: "credential";
|
|
5386
|
+
organization: "organization";
|
|
5259
5387
|
prompt: "prompt";
|
|
5260
5388
|
rule: "rule";
|
|
5261
5389
|
env: "env";
|
|
5390
|
+
organization_invitation: "organization_invitation";
|
|
5391
|
+
data_center: "data_center";
|
|
5392
|
+
cost_rate: "cost_rate";
|
|
5262
5393
|
}>>>;
|
|
5263
5394
|
event_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5264
5395
|
since: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -8255,6 +8386,7 @@ export declare const zPromptsListPromptVersionsResponse: z.ZodObject<{
|
|
|
8255
8386
|
code: z.ZodNumber;
|
|
8256
8387
|
data: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
8257
8388
|
changelog: z.ZodNullable<z.ZodString>;
|
|
8389
|
+
contextSchema: z.ZodUnknown;
|
|
8258
8390
|
createdAt: z.ZodISODateTime;
|
|
8259
8391
|
createdByDisplayName: z.ZodNullable<z.ZodString>;
|
|
8260
8392
|
createdByImage: z.ZodNullable<z.ZodString>;
|
|
@@ -8296,6 +8428,18 @@ export declare const zPromptsCreatePromptVersionBody: z.ZodObject<{
|
|
|
8296
8428
|
allowBlockRemovals: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
8297
8429
|
baseVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8298
8430
|
changelog: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8431
|
+
contextSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
8432
|
+
properties: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
8433
|
+
enum: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
8434
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
8435
|
+
string: "string";
|
|
8436
|
+
number: "number";
|
|
8437
|
+
boolean: "boolean";
|
|
8438
|
+
enum: "enum";
|
|
8439
|
+
}>>>;
|
|
8440
|
+
}, z.core.$strip>>>>;
|
|
8441
|
+
required: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
8442
|
+
}, z.core.$strip>>>;
|
|
8299
8443
|
format: z.ZodEnum<{
|
|
8300
8444
|
text: "text";
|
|
8301
8445
|
chat: "chat";
|
|
@@ -8315,6 +8459,7 @@ export declare const zPromptsCreatePromptVersionResponse: z.ZodObject<{
|
|
|
8315
8459
|
code: z.ZodNumber;
|
|
8316
8460
|
data: z.ZodNullable<z.ZodObject<{
|
|
8317
8461
|
changelog: z.ZodNullable<z.ZodString>;
|
|
8462
|
+
contextSchema: z.ZodUnknown;
|
|
8318
8463
|
createdAt: z.ZodISODateTime;
|
|
8319
8464
|
createdByDisplayName: z.ZodNullable<z.ZodString>;
|
|
8320
8465
|
createdByImage: z.ZodNullable<z.ZodString>;
|
|
@@ -8378,14 +8523,16 @@ export declare const zPromptsGetPromptVersionDiffResponse: z.ZodObject<{
|
|
|
8378
8523
|
role: z.ZodEnum<{
|
|
8379
8524
|
user: "user";
|
|
8380
8525
|
system: "system";
|
|
8381
|
-
assistant: "assistant";
|
|
8382
8526
|
developer: "developer";
|
|
8383
8527
|
tool: "tool";
|
|
8528
|
+
assistant: "assistant";
|
|
8384
8529
|
}>;
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8530
|
+
toolCallId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8531
|
+
toolCalls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
8532
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8533
|
+
id: z.ZodString;
|
|
8534
|
+
name: z.ZodString;
|
|
8535
|
+
}, z.core.$strip>>>>;
|
|
8389
8536
|
}, z.core.$strip>, z.ZodObject<{
|
|
8390
8537
|
condition: z.ZodObject<{
|
|
8391
8538
|
kind: z.ZodString;
|
|
@@ -8398,14 +8545,16 @@ export declare const zPromptsGetPromptVersionDiffResponse: z.ZodObject<{
|
|
|
8398
8545
|
role: z.ZodEnum<{
|
|
8399
8546
|
user: "user";
|
|
8400
8547
|
system: "system";
|
|
8401
|
-
assistant: "assistant";
|
|
8402
8548
|
developer: "developer";
|
|
8403
8549
|
tool: "tool";
|
|
8550
|
+
assistant: "assistant";
|
|
8404
8551
|
}>;
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8552
|
+
toolCallId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8553
|
+
toolCalls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
8554
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8555
|
+
id: z.ZodString;
|
|
8556
|
+
name: z.ZodString;
|
|
8557
|
+
}, z.core.$strip>>>>;
|
|
8409
8558
|
}, z.core.$strip>, z.ZodObject<{
|
|
8410
8559
|
after: z.ZodString;
|
|
8411
8560
|
before: z.ZodString;
|
|
@@ -8428,16 +8577,16 @@ export declare const zPromptsGetPromptVersionDiffResponse: z.ZodObject<{
|
|
|
8428
8577
|
after: z.ZodEnum<{
|
|
8429
8578
|
user: "user";
|
|
8430
8579
|
system: "system";
|
|
8431
|
-
assistant: "assistant";
|
|
8432
8580
|
developer: "developer";
|
|
8433
8581
|
tool: "tool";
|
|
8582
|
+
assistant: "assistant";
|
|
8434
8583
|
}>;
|
|
8435
8584
|
before: z.ZodEnum<{
|
|
8436
8585
|
user: "user";
|
|
8437
8586
|
system: "system";
|
|
8438
|
-
assistant: "assistant";
|
|
8439
8587
|
developer: "developer";
|
|
8440
8588
|
tool: "tool";
|
|
8589
|
+
assistant: "assistant";
|
|
8441
8590
|
}>;
|
|
8442
8591
|
name: z.ZodString;
|
|
8443
8592
|
op: z.ZodEnum<{
|
|
@@ -8451,17 +8600,26 @@ export declare const zPromptsGetPromptVersionDiffResponse: z.ZodObject<{
|
|
|
8451
8600
|
edit_required: "edit_required";
|
|
8452
8601
|
}>;
|
|
8453
8602
|
}, z.core.$strip>, z.ZodObject<{
|
|
8454
|
-
after: z.
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8603
|
+
after: z.ZodString;
|
|
8604
|
+
before: z.ZodString;
|
|
8605
|
+
name: z.ZodString;
|
|
8606
|
+
op: z.ZodEnum<{
|
|
8607
|
+
edit_tool_call_id: "edit_tool_call_id";
|
|
8608
|
+
}>;
|
|
8609
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8610
|
+
after: z.ZodArray<z.ZodObject<{
|
|
8611
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8612
|
+
id: z.ZodString;
|
|
8613
|
+
name: z.ZodString;
|
|
8614
|
+
}, z.core.$strip>>;
|
|
8615
|
+
before: z.ZodArray<z.ZodObject<{
|
|
8616
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8617
|
+
id: z.ZodString;
|
|
8618
|
+
name: z.ZodString;
|
|
8619
|
+
}, z.core.$strip>>;
|
|
8462
8620
|
name: z.ZodString;
|
|
8463
8621
|
op: z.ZodEnum<{
|
|
8464
|
-
|
|
8622
|
+
edit_tool_calls: "edit_tool_calls";
|
|
8465
8623
|
}>;
|
|
8466
8624
|
}, z.core.$strip>, z.ZodObject<{
|
|
8467
8625
|
fromIndex: z.ZodNumber;
|
|
@@ -8506,6 +8664,7 @@ export declare const zPromptsGetPromptVersionResponse: z.ZodObject<{
|
|
|
8506
8664
|
code: z.ZodNumber;
|
|
8507
8665
|
data: z.ZodNullable<z.ZodObject<{
|
|
8508
8666
|
changelog: z.ZodNullable<z.ZodString>;
|
|
8667
|
+
contextSchema: z.ZodUnknown;
|
|
8509
8668
|
createdAt: z.ZodISODateTime;
|
|
8510
8669
|
createdByDisplayName: z.ZodNullable<z.ZodString>;
|
|
8511
8670
|
createdByImage: z.ZodNullable<z.ZodString>;
|
|
@@ -8718,6 +8877,11 @@ export declare const zPromptsWithdrawPromptReviewResponse: z.ZodObject<{
|
|
|
8718
8877
|
}, z.core.$strip>;
|
|
8719
8878
|
export declare const zPromptsResolvePromptBody: z.ZodObject<{
|
|
8720
8879
|
context: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
|
|
8880
|
+
developerRole: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
8881
|
+
user: "user";
|
|
8882
|
+
system: "system";
|
|
8883
|
+
developer: "developer";
|
|
8884
|
+
}>>>;
|
|
8721
8885
|
labels: z.ZodArray<z.ZodString>;
|
|
8722
8886
|
slug: z.ZodString;
|
|
8723
8887
|
subject: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -8749,18 +8913,44 @@ export declare const zPromptsResolvePromptResponse: z.ZodObject<{
|
|
|
8749
8913
|
format: z.ZodEnum<{
|
|
8750
8914
|
chat: "chat";
|
|
8751
8915
|
}>;
|
|
8752
|
-
messages: z.ZodArray<z.ZodObject<{
|
|
8916
|
+
messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
8753
8917
|
content: z.ZodString;
|
|
8754
8918
|
role: z.ZodEnum<{
|
|
8755
8919
|
user: "user";
|
|
8756
8920
|
system: "system";
|
|
8757
|
-
assistant: "assistant";
|
|
8758
8921
|
developer: "developer";
|
|
8922
|
+
}>;
|
|
8923
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8924
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8925
|
+
role: z.ZodEnum<{
|
|
8926
|
+
assistant: "assistant";
|
|
8927
|
+
}>;
|
|
8928
|
+
toolCalls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
8929
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8930
|
+
id: z.ZodString;
|
|
8931
|
+
name: z.ZodString;
|
|
8932
|
+
}, z.core.$strip>>>>;
|
|
8933
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8934
|
+
content: z.ZodString;
|
|
8935
|
+
role: z.ZodEnum<{
|
|
8759
8936
|
tool: "tool";
|
|
8760
8937
|
}>;
|
|
8761
|
-
|
|
8938
|
+
toolCallId: z.ZodString;
|
|
8939
|
+
}, z.core.$strip>]>>;
|
|
8762
8940
|
}, z.core.$strip>]>;
|
|
8763
8941
|
subjectHash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8942
|
+
toolChoice: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
|
|
8943
|
+
auto: "auto";
|
|
8944
|
+
none: "none";
|
|
8945
|
+
required: "required";
|
|
8946
|
+
}>, z.ZodObject<{
|
|
8947
|
+
name: z.ZodString;
|
|
8948
|
+
}, z.core.$strip>]>>>;
|
|
8949
|
+
tools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
8950
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8951
|
+
name: z.ZodString;
|
|
8952
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8953
|
+
}, z.core.$strip>>>>;
|
|
8764
8954
|
variantName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8765
8955
|
version: z.ZodNumber;
|
|
8766
8956
|
versionId: z.ZodString;
|
|
@@ -13138,13 +13328,13 @@ export declare const zTracesListTracesQuery: z.ZodObject<{
|
|
|
13138
13328
|
page: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13139
13329
|
limit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13140
13330
|
sort: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
13331
|
+
toolCalls: "toolCalls";
|
|
13141
13332
|
provider: "provider";
|
|
13142
13333
|
model: "model";
|
|
13143
13334
|
durationMs: "durationMs";
|
|
13144
13335
|
startTime: "startTime";
|
|
13145
13336
|
inputTokens: "inputTokens";
|
|
13146
13337
|
outputTokens: "outputTokens";
|
|
13147
|
-
toolCalls: "toolCalls";
|
|
13148
13338
|
costUsd: "costUsd";
|
|
13149
13339
|
}>>>;
|
|
13150
13340
|
order: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
package/dist/prompts/cache.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare function buildCacheKey(projectId: string, slug: string, labels: s
|
|
|
38
38
|
* caches as the same deterministic variant on repeat (D8); the
|
|
39
39
|
* weighted-no-subject bypass is handled in the resource, not here.
|
|
40
40
|
*/
|
|
41
|
-
export declare function buildFetchCacheKey(projectId: string, slug: string, env: string, context?: PromptContext, subject?: string, variables?: Record<string, unknown
|
|
41
|
+
export declare function buildFetchCacheKey(projectId: string, slug: string, env: string, context?: PromptContext, subject?: string, variables?: Record<string, unknown>, developerRole?: string): string;
|
|
42
42
|
/**
|
|
43
43
|
* In-memory LRU cache for ResolvedPrompt objects.
|
|
44
44
|
*
|