@meistrari/chat-nuxt 4.14.0-rc.4 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "4.14.0-rc.4",
4
+ "version": "4.14.0-rc.5",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -776,6 +776,10 @@ export type ChatV3Message = z.infer<typeof chatV3MessageSchema>;
776
776
  export declare const chatV3MessageListQuerySchema: z.ZodObject<{
777
777
  before: z.ZodOptional<z.ZodString>;
778
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>>;
779
783
  }, z.core.$strict>;
780
784
  export type ChatV3MessageListQuery = z.infer<typeof chatV3MessageListQuerySchema>;
781
785
  /**
@@ -848,6 +852,47 @@ export declare const chatV3MessageListSchema: z.ZodObject<{
848
852
  }, z.core.$strip>>;
849
853
  nextCursor: z.ZodNullable<z.ZodString>;
850
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>>>;
851
896
  }, z.core.$strip>;
852
897
  export type ChatV3MessageList = z.infer<typeof chatV3MessageListSchema>;
853
898
  /**
@@ -916,6 +961,52 @@ export declare const chatV3ArtifactListQuerySchema: z.ZodObject<{
916
961
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
917
962
  }, z.core.$strict>;
918
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>;
919
1010
  /** The files the agent published in the thread and agent-api verified, in the order they were published. */
920
1011
  export declare const chatV3ArtifactListSchema: z.ZodObject<{
921
1012
  artifacts: z.ZodArray<z.ZodObject<{
@@ -966,6 +1057,18 @@ export declare const chatV3ThreadFileListSchema: z.ZodObject<{
966
1057
  }, z.core.$strip>>;
967
1058
  }, z.core.$strip>;
968
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>;
969
1072
  export declare const CHAT_V3_RECENT_FILES = 20;
970
1073
  export declare const chatV3RecentFileQuerySchema: z.ZodObject<{
971
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.
@@ -503,6 +504,11 @@ export const chatV3MessageListQuerySchema = z.object({
503
504
  /** Exclusive cursor: the `nextCursor` of the previous page, which reads older messages. */
504
505
  before: v5EventIdSchema.optional(),
505
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'),
506
512
  }).strict();
507
513
  /**
508
514
  * The latest messages, oldest first. `eventCursor` is the last event the page was built from:
@@ -512,6 +518,12 @@ export const chatV3MessageListSchema = z.object({
512
518
  messages: z.array(chatV3MessageSchema),
513
519
  nextCursor: v5EventIdSchema.nullable(),
514
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(),
515
527
  });
516
528
  /**
517
529
  * The event types of a message's activity: what the agent did while answering it (its tools as
@@ -538,6 +550,12 @@ export const chatV3ArtifactListQuerySchema = z.object({
538
550
  after: v5EventIdSchema.optional(),
539
551
  limit: z.coerce.number().int().min(1).max(v5Limits.artifactPage.max).default(v5Limits.artifactPage.default),
540
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;
541
559
  /** The files the agent published in the thread and agent-api verified, in the order they were published. */
542
560
  export const chatV3ArtifactListSchema = v5ArtifactPageSchema;
543
561
  /**
@@ -555,6 +573,14 @@ export const chatV3ThreadFileSchema = z.object({
555
573
  createdAt: z.string().nullable(),
556
574
  });
557
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
+ });
558
584
  export const CHAT_V3_RECENT_FILES = 20;
559
585
  export const chatV3RecentFileQuerySchema = z.object({ agentId: agentIdSchema }).strict();
560
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.14.0-rc.4",
3
+ "version": "4.14.0-rc.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {