@meistrari/chat-nuxt 4.14.0-rc.3 → 4.14.0-rc.5
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/module.json +1 -1
- package/dist/runtime/types/schemas/chat/v3.d.ts +104 -0
- package/dist/runtime/types/schemas/chat/v3.js +28 -0
- package/dist/runtime/types/schemas/integrations/agent-events.d.ts +6 -0
- package/dist/runtime/types/schemas/integrations/agent-events.js +5 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -609,6 +609,7 @@ export type ChatV3SendMessage = z.infer<typeof chatV3SendMessageSchema>;
|
|
|
609
609
|
/** Text sent into a running turn; files go only with a queued message. */
|
|
610
610
|
export declare const chatV3SteerMessageSchema: z.ZodObject<{
|
|
611
611
|
text: z.ZodString;
|
|
612
|
+
turnId: z.ZodOptional<z.ZodString>;
|
|
612
613
|
}, z.core.$strict>;
|
|
613
614
|
export type ChatV3SteerMessage = z.infer<typeof chatV3SteerMessageSchema>;
|
|
614
615
|
/**
|
|
@@ -775,6 +776,10 @@ export type ChatV3Message = z.infer<typeof chatV3MessageSchema>;
|
|
|
775
776
|
export declare const chatV3MessageListQuerySchema: z.ZodObject<{
|
|
776
777
|
before: z.ZodOptional<z.ZodString>;
|
|
777
778
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
779
|
+
activity: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
|
|
780
|
+
true: "true";
|
|
781
|
+
false: "false";
|
|
782
|
+
}>>, z.ZodTransform<boolean, "true" | "false" | undefined>>;
|
|
778
783
|
}, z.core.$strict>;
|
|
779
784
|
export type ChatV3MessageListQuery = z.infer<typeof chatV3MessageListQuerySchema>;
|
|
780
785
|
/**
|
|
@@ -847,6 +852,47 @@ export declare const chatV3MessageListSchema: z.ZodObject<{
|
|
|
847
852
|
}, z.core.$strip>>;
|
|
848
853
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
849
854
|
eventCursor: z.ZodNullable<z.ZodString>;
|
|
855
|
+
activity: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
856
|
+
eventId: z.ZodString;
|
|
857
|
+
sessionId: z.ZodString;
|
|
858
|
+
type: z.ZodString;
|
|
859
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
860
|
+
messageId: z.ZodNullable<z.ZodString>;
|
|
861
|
+
toolCallId: z.ZodNullable<z.ZodString>;
|
|
862
|
+
occurredAt: z.ZodString;
|
|
863
|
+
hint: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
864
|
+
text: z.ZodNullable<z.ZodString>;
|
|
865
|
+
partIndex: z.ZodNullable<z.ZodNumber>;
|
|
866
|
+
partCount: z.ZodNullable<z.ZodNumber>;
|
|
867
|
+
payloadVaultStatus: z.ZodEnum<{
|
|
868
|
+
pending: "pending";
|
|
869
|
+
none: "none";
|
|
870
|
+
published: "published";
|
|
871
|
+
}>;
|
|
872
|
+
receipt: z.ZodOptional<z.ZodObject<{
|
|
873
|
+
eventId: z.ZodString;
|
|
874
|
+
type: z.ZodEnum<{
|
|
875
|
+
input: "input";
|
|
876
|
+
"tool-result": "tool-result";
|
|
877
|
+
"message-queue": "message-queue";
|
|
878
|
+
"message-steer": "message-steer";
|
|
879
|
+
cancel: "cancel";
|
|
880
|
+
}>;
|
|
881
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
882
|
+
sessionId: z.ZodString;
|
|
883
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
884
|
+
status: z.ZodEnum<{
|
|
885
|
+
running: "running";
|
|
886
|
+
completed: "completed";
|
|
887
|
+
failed: "failed";
|
|
888
|
+
cancelled: "cancelled";
|
|
889
|
+
queued: "queued";
|
|
890
|
+
dispatched: "dispatched";
|
|
891
|
+
received: "received";
|
|
892
|
+
uncertain: "uncertain";
|
|
893
|
+
}>;
|
|
894
|
+
}, z.core.$loose>>;
|
|
895
|
+
}, z.core.$loose>>>;
|
|
850
896
|
}, z.core.$strip>;
|
|
851
897
|
export type ChatV3MessageList = z.infer<typeof chatV3MessageListSchema>;
|
|
852
898
|
/**
|
|
@@ -915,6 +961,52 @@ export declare const chatV3ArtifactListQuerySchema: z.ZodObject<{
|
|
|
915
961
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
916
962
|
}, z.core.$strict>;
|
|
917
963
|
export type ChatV3ArtifactListQuery = z.infer<typeof chatV3ArtifactListQuerySchema>;
|
|
964
|
+
/**
|
|
965
|
+
* What the thread has cost so far, in v1's shape so the details column reads the same: the usage
|
|
966
|
+
* agent-api priced per turn, summed over the session's turns and shown in the workspace's billing
|
|
967
|
+
* (USD times its CVP, or credits). `usage` is null until a turn reports any.
|
|
968
|
+
*/
|
|
969
|
+
export declare const chatV3ThreadUsageSchema: z.ZodObject<{
|
|
970
|
+
usage: z.ZodNullable<z.ZodObject<{
|
|
971
|
+
tokens: z.ZodObject<{
|
|
972
|
+
prompt: z.ZodNumber;
|
|
973
|
+
completion: z.ZodNumber;
|
|
974
|
+
total: z.ZodNumber;
|
|
975
|
+
cacheRead: z.ZodNumber;
|
|
976
|
+
cacheCreation: z.ZodNumber;
|
|
977
|
+
}, z.core.$strip>;
|
|
978
|
+
cost: z.ZodObject<{
|
|
979
|
+
prompt: z.ZodNumber;
|
|
980
|
+
completion: z.ZodNumber;
|
|
981
|
+
total: z.ZodNumber;
|
|
982
|
+
}, z.core.$strip>;
|
|
983
|
+
duration: z.ZodNumber;
|
|
984
|
+
turns: z.ZodNumber;
|
|
985
|
+
models: z.ZodArray<z.ZodObject<{
|
|
986
|
+
model: z.ZodString;
|
|
987
|
+
inputTokens: z.ZodNumber;
|
|
988
|
+
outputTokens: z.ZodNumber;
|
|
989
|
+
cacheReadTokens: z.ZodNumber;
|
|
990
|
+
cacheCreationTokens: z.ZodNumber;
|
|
991
|
+
cost: z.ZodNumber;
|
|
992
|
+
contextWindow: z.ZodNumber;
|
|
993
|
+
webSearchRequests: z.ZodNumber;
|
|
994
|
+
}, z.core.$strip>>;
|
|
995
|
+
metrics: z.ZodObject<{
|
|
996
|
+
cacheHitRate: z.ZodNumber;
|
|
997
|
+
costPerTurn: z.ZodNumber;
|
|
998
|
+
webSearchRequests: z.ZodNumber;
|
|
999
|
+
webFetchRequests: z.ZodNumber;
|
|
1000
|
+
}, z.core.$strip>;
|
|
1001
|
+
}, z.core.$strip>>;
|
|
1002
|
+
billing: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1003
|
+
mode: z.ZodLiteral<"plan">;
|
|
1004
|
+
cvp: z.ZodDefault<z.ZodNumber>;
|
|
1005
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1006
|
+
mode: z.ZodLiteral<"credits">;
|
|
1007
|
+
}, z.core.$strip>], "mode">;
|
|
1008
|
+
}, z.core.$strip>;
|
|
1009
|
+
export type ChatV3ThreadUsage = z.infer<typeof chatV3ThreadUsageSchema>;
|
|
918
1010
|
/** The files the agent published in the thread and agent-api verified, in the order they were published. */
|
|
919
1011
|
export declare const chatV3ArtifactListSchema: z.ZodObject<{
|
|
920
1012
|
artifacts: z.ZodArray<z.ZodObject<{
|
|
@@ -965,6 +1057,18 @@ export declare const chatV3ThreadFileListSchema: z.ZodObject<{
|
|
|
965
1057
|
}, z.core.$strip>>;
|
|
966
1058
|
}, z.core.$strip>;
|
|
967
1059
|
export type ChatV3ThreadFileList = z.infer<typeof chatV3ThreadFileListSchema>;
|
|
1060
|
+
/** A file sent in the thread, by its Vault reference, to open or download as v1's `/files/resolve` does. */
|
|
1061
|
+
export declare const chatV3ResolveFileSchema: z.ZodObject<{
|
|
1062
|
+
vaultReference: z.ZodString;
|
|
1063
|
+
}, z.core.$strict>;
|
|
1064
|
+
export type ChatV3ResolveFile = z.infer<typeof chatV3ResolveFileSchema>;
|
|
1065
|
+
/** Where the browser reads a file sent in the thread: Vault's link to its bytes, with the name and type it was sent with. */
|
|
1066
|
+
export declare const chatV3ResolvedFileSchema: z.ZodObject<{
|
|
1067
|
+
url: z.ZodString;
|
|
1068
|
+
name: z.ZodString;
|
|
1069
|
+
contentType: z.ZodNullable<z.ZodString>;
|
|
1070
|
+
}, z.core.$strip>;
|
|
1071
|
+
export type ChatV3ResolvedFile = z.infer<typeof chatV3ResolvedFileSchema>;
|
|
968
1072
|
export declare const CHAT_V3_RECENT_FILES = 20;
|
|
969
1073
|
export declare const chatV3RecentFileQuerySchema: z.ZodObject<{
|
|
970
1074
|
agentId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { parseV5EventHint, v5ArtifactPageSchema, v5BranchNameSchema, v5EventIdSchema, v5HarnessSchema, v5InputNameSchema, v5Limits, v5ModelIdSchema, v5ReasoningEffortSchema, v5SessionEventSchema, v5TurnIdSchema, v5UserInputRequestSchema, v5VaultReferenceSchema } from '../integrations/agent-events';
|
|
3
|
+
import { conversationUsageResponseSchema } from './usage';
|
|
3
4
|
/**
|
|
4
5
|
* Chat API v3 (`/v3/chat`): the conversational surface over agent-api v5 events-v1.
|
|
5
6
|
* The chat-api owns the thread; agent-api owns the session and its history.
|
|
@@ -374,6 +375,8 @@ export const chatV3SendMessageSchema = z.object({
|
|
|
374
375
|
/** Text sent into a running turn; files go only with a queued message. */
|
|
375
376
|
export const chatV3SteerMessageSchema = z.object({
|
|
376
377
|
text: z.string().min(1).max(v5Limits.messageTextChars),
|
|
378
|
+
/** The running turn, when the client knows it: chat-api then skips reading the message to find it. */
|
|
379
|
+
turnId: z.string().min(1).optional(),
|
|
377
380
|
}).strict();
|
|
378
381
|
/**
|
|
379
382
|
* The answers to the agent's question, by question id: free text, or the `value` of the option
|
|
@@ -501,6 +504,11 @@ export const chatV3MessageListQuerySchema = z.object({
|
|
|
501
504
|
/** Exclusive cursor: the `nextCursor` of the previous page, which reads older messages. */
|
|
502
505
|
before: v5EventIdSchema.optional(),
|
|
503
506
|
limit: z.coerce.number().int().min(1).max(CHAT_V3_MESSAGE_PAGE.max).default(CHAT_V3_MESSAGE_PAGE.default),
|
|
507
|
+
/**
|
|
508
|
+
* `true` brings the page's activity along (`activity`): the history read already holds every
|
|
509
|
+
* event, so the steps of its messages cost no further read.
|
|
510
|
+
*/
|
|
511
|
+
activity: z.enum(['true', 'false']).optional().transform(value => value === 'true'),
|
|
504
512
|
}).strict();
|
|
505
513
|
/**
|
|
506
514
|
* The latest messages, oldest first. `eventCursor` is the last event the page was built from:
|
|
@@ -510,6 +518,12 @@ export const chatV3MessageListSchema = z.object({
|
|
|
510
518
|
messages: z.array(chatV3MessageSchema),
|
|
511
519
|
nextCursor: v5EventIdSchema.nullable(),
|
|
512
520
|
eventCursor: v5EventIdSchema.nullable(),
|
|
521
|
+
/**
|
|
522
|
+
* With `activity=true`: the steps (`step.started`, `step`) and published files
|
|
523
|
+
* (`artifact.published`) of the page's messages, oldest first, up to `eventCursor`. Usage,
|
|
524
|
+
* inputs and questions stay behind `/activity`.
|
|
525
|
+
*/
|
|
526
|
+
activity: z.array(v5SessionEventSchema).optional(),
|
|
513
527
|
});
|
|
514
528
|
/**
|
|
515
529
|
* The event types of a message's activity: what the agent did while answering it (its tools as
|
|
@@ -536,6 +550,12 @@ export const chatV3ArtifactListQuerySchema = z.object({
|
|
|
536
550
|
after: v5EventIdSchema.optional(),
|
|
537
551
|
limit: z.coerce.number().int().min(1).max(v5Limits.artifactPage.max).default(v5Limits.artifactPage.default),
|
|
538
552
|
}).strict();
|
|
553
|
+
/**
|
|
554
|
+
* What the thread has cost so far, in v1's shape so the details column reads the same: the usage
|
|
555
|
+
* agent-api priced per turn, summed over the session's turns and shown in the workspace's billing
|
|
556
|
+
* (USD times its CVP, or credits). `usage` is null until a turn reports any.
|
|
557
|
+
*/
|
|
558
|
+
export const chatV3ThreadUsageSchema = conversationUsageResponseSchema;
|
|
539
559
|
/** The files the agent published in the thread and agent-api verified, in the order they were published. */
|
|
540
560
|
export const chatV3ArtifactListSchema = v5ArtifactPageSchema;
|
|
541
561
|
/**
|
|
@@ -553,6 +573,14 @@ export const chatV3ThreadFileSchema = z.object({
|
|
|
553
573
|
createdAt: z.string().nullable(),
|
|
554
574
|
});
|
|
555
575
|
export const chatV3ThreadFileListSchema = z.object({ files: z.array(chatV3ThreadFileSchema) });
|
|
576
|
+
/** A file sent in the thread, by its Vault reference, to open or download as v1's `/files/resolve` does. */
|
|
577
|
+
export const chatV3ResolveFileSchema = z.object({ vaultReference: v5VaultReferenceSchema }).strict();
|
|
578
|
+
/** Where the browser reads a file sent in the thread: Vault's link to its bytes, with the name and type it was sent with. */
|
|
579
|
+
export const chatV3ResolvedFileSchema = z.object({
|
|
580
|
+
url: z.string().url(),
|
|
581
|
+
name: z.string(),
|
|
582
|
+
contentType: z.string().nullable(),
|
|
583
|
+
});
|
|
556
584
|
export const CHAT_V3_RECENT_FILES = 20;
|
|
557
585
|
export const chatV3RecentFileQuerySchema = z.object({ agentId: agentIdSchema }).strict();
|
|
558
586
|
/** The files the user sent lately in their threads with the agent, newest first, each once. */
|
|
@@ -1050,7 +1050,13 @@ export declare const v5TurnListSchema: z.ZodObject<{
|
|
|
1050
1050
|
createdAt: z.ZodString;
|
|
1051
1051
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
1052
1052
|
}, z.core.$loose>>;
|
|
1053
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1053
1054
|
}, z.core.$loose>;
|
|
1055
|
+
export declare const v5TurnQuerySchema: z.ZodObject<{
|
|
1056
|
+
after: z.ZodOptional<z.ZodString>;
|
|
1057
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
1058
|
+
}, z.core.$strict>;
|
|
1059
|
+
export type V5TurnQuery = z.infer<typeof v5TurnQuerySchema>;
|
|
1054
1060
|
export declare const v5ArtifactIdSchema: z.ZodString;
|
|
1055
1061
|
export declare const v5ArtifactSchema: z.ZodObject<{
|
|
1056
1062
|
artifactId: z.ZodString;
|
|
@@ -418,7 +418,11 @@ export const v5TurnSchema = z.looseObject({
|
|
|
418
418
|
createdAt: z.string(),
|
|
419
419
|
completedAt: z.string().nullable(),
|
|
420
420
|
});
|
|
421
|
-
export const v5TurnListSchema = z.looseObject({ turns: z.array(v5TurnSchema) });
|
|
421
|
+
export const v5TurnListSchema = z.looseObject({ turns: z.array(v5TurnSchema), nextCursor: z.string().min(1).nullable().optional() });
|
|
422
|
+
export const v5TurnQuerySchema = z.object({
|
|
423
|
+
after: z.string().min(1).max(200).optional(),
|
|
424
|
+
limit: z.number().int().min(1).max(500).optional(),
|
|
425
|
+
}).strict();
|
|
422
426
|
export const v5ArtifactIdSchema = z.string().regex(/^[a-f0-9]{64}$/u);
|
|
423
427
|
export const v5ArtifactSchema = z.looseObject({
|
|
424
428
|
artifactId: v5ArtifactIdSchema,
|