@meistrari/chat-nuxt 4.10.0-rc.6 → 4.10.0-rc.8

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.10.0-rc.6",
4
+ "version": "4.10.0-rc.8",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -10,12 +10,12 @@ type __VLS_Props = {
10
10
  userImage?: string;
11
11
  };
12
12
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
- select: (id: string) => any;
14
13
  close: () => any;
14
+ select: (id: string) => any;
15
15
  newConvo: (groupId?: string | null | undefined) => any;
16
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- onSelect?: ((id: string) => any) | undefined;
18
17
  onClose?: (() => any) | undefined;
18
+ onSelect?: ((id: string) => any) | undefined;
19
19
  onNewConvo?: ((groupId?: string | null | undefined) => any) | undefined;
20
20
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
21
  declare const _default: typeof __VLS_export;
@@ -10,12 +10,12 @@ type __VLS_Props = {
10
10
  userImage?: string;
11
11
  };
12
12
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
- select: (id: string) => any;
14
13
  close: () => any;
14
+ select: (id: string) => any;
15
15
  newConvo: (groupId?: string | null | undefined) => any;
16
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- onSelect?: ((id: string) => any) | undefined;
18
17
  onClose?: (() => any) | undefined;
18
+ onSelect?: ((id: string) => any) | undefined;
19
19
  onNewConvo?: ((groupId?: string | null | undefined) => any) | undefined;
20
20
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
21
  declare const _default: typeof __VLS_export;
@@ -64,11 +64,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
64
64
  "update:selectedReasoningEffort": (value: any) => any;
65
65
  } & {
66
66
  delete: () => any;
67
- cancel: () => any;
68
67
  rename: () => any;
69
68
  duplicate: () => any;
70
69
  export: () => any;
71
70
  copyLink: () => any;
71
+ cancel: () => any;
72
72
  debug: () => any;
73
73
  selectConversation: (id: string) => any;
74
74
  settings: () => any;
@@ -86,11 +86,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
86
86
  "update:workspaceSheetOpen": (value: boolean) => any;
87
87
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
88
88
  onDelete?: (() => any) | undefined;
89
- onCancel?: (() => any) | undefined;
90
89
  onRename?: (() => any) | undefined;
91
90
  onDuplicate?: (() => any) | undefined;
92
91
  onExport?: (() => any) | undefined;
93
92
  onCopyLink?: (() => any) | undefined;
93
+ onCancel?: (() => any) | undefined;
94
94
  onDebug?: (() => any) | undefined;
95
95
  onSelectConversation?: ((id: string) => any) | undefined;
96
96
  onSettings?: (() => any) | undefined;
@@ -64,11 +64,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
64
64
  "update:selectedReasoningEffort": (value: any) => any;
65
65
  } & {
66
66
  delete: () => any;
67
- cancel: () => any;
68
67
  rename: () => any;
69
68
  duplicate: () => any;
70
69
  export: () => any;
71
70
  copyLink: () => any;
71
+ cancel: () => any;
72
72
  debug: () => any;
73
73
  selectConversation: (id: string) => any;
74
74
  settings: () => any;
@@ -86,11 +86,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
86
86
  "update:workspaceSheetOpen": (value: boolean) => any;
87
87
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
88
88
  onDelete?: (() => any) | undefined;
89
- onCancel?: (() => any) | undefined;
90
89
  onRename?: (() => any) | undefined;
91
90
  onDuplicate?: (() => any) | undefined;
92
91
  onExport?: (() => any) | undefined;
93
92
  onCopyLink?: (() => any) | undefined;
93
+ onCancel?: (() => any) | undefined;
94
94
  onDebug?: (() => any) | undefined;
95
95
  onSelectConversation?: ((id: string) => any) | undefined;
96
96
  onSettings?: (() => any) | undefined;
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
3
  * Chat API v3 (`/v3/chat`): the conversational surface over agent-api v5 events-v1.
4
- * The chat-api owns the conversation; agent-api owns the session and its history.
4
+ * The chat-api owns the thread; agent-api owns the session and its history.
5
5
  */
6
6
  export declare const CHAT_V3_CONTRACT_VERSION = "events-v1";
7
- /** Where the agent of the request stands in the v5 catalog. */
7
+ /** Where the agent of the request stands in agent-api, where the agent lives. */
8
8
  export declare const chatV3AgentStatusSchema: z.ZodEnum<{
9
9
  ready: "ready";
10
10
  not_requested: "not_requested";
@@ -53,3 +53,161 @@ export declare const chatV3ConfigurationSchema: z.ZodObject<{
53
53
  }, z.core.$strip>;
54
54
  }, z.core.$strip>;
55
55
  export type ChatV3Configuration = z.infer<typeof chatV3ConfigurationSchema>;
56
+ export declare const CHAT_V3_TITLE_CHARS = 200;
57
+ export declare const CHAT_V3_CREATION_KEY_CHARS = 128;
58
+ export declare const CHAT_V3_THREAD_PAGE: {
59
+ readonly default: 30;
60
+ readonly max: 100;
61
+ };
62
+ /** A thread as the chat owns it: access and title here, history in the agent-api session. */
63
+ export declare const chatV3ThreadSchema: z.ZodObject<{
64
+ threadId: z.ZodString;
65
+ agentId: z.ZodString;
66
+ sessionId: z.ZodString;
67
+ title: z.ZodString;
68
+ createdAt: z.ZodString;
69
+ updatedAt: z.ZodString;
70
+ }, z.core.$strip>;
71
+ export type ChatV3Thread = z.infer<typeof chatV3ThreadSchema>;
72
+ /** The session behind a thread, read live from agent-api; `null` when agent-api no longer has it. */
73
+ export declare const chatV3SessionSummarySchema: z.ZodNullable<z.ZodObject<{
74
+ status: z.ZodString;
75
+ harness: z.ZodString;
76
+ model: z.ZodNullable<z.ZodString>;
77
+ reasoningEffort: z.ZodNullable<z.ZodString>;
78
+ }, z.core.$strip>>;
79
+ export declare const chatV3ThreadDetailSchema: z.ZodObject<{
80
+ threadId: z.ZodString;
81
+ agentId: z.ZodString;
82
+ sessionId: z.ZodString;
83
+ title: z.ZodString;
84
+ createdAt: z.ZodString;
85
+ updatedAt: z.ZodString;
86
+ session: z.ZodNullable<z.ZodObject<{
87
+ status: z.ZodString;
88
+ harness: z.ZodString;
89
+ model: z.ZodNullable<z.ZodString>;
90
+ reasoningEffort: z.ZodNullable<z.ZodString>;
91
+ }, z.core.$strip>>;
92
+ }, z.core.$strip>;
93
+ export type ChatV3ThreadDetail = z.infer<typeof chatV3ThreadDetailSchema>;
94
+ /** Creation also opens the agent-api session; send an `Idempotency-Key` header to retry safely. */
95
+ export declare const chatV3CreateThreadSchema: z.ZodObject<{
96
+ agentId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
97
+ title: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strict>;
99
+ export type ChatV3CreateThread = z.infer<typeof chatV3CreateThreadSchema>;
100
+ export declare const chatV3UpdateThreadSchema: z.ZodObject<{
101
+ title: z.ZodString;
102
+ }, z.core.$strict>;
103
+ export type ChatV3UpdateThread = z.infer<typeof chatV3UpdateThreadSchema>;
104
+ export declare const chatV3ThreadListQuerySchema: z.ZodObject<{
105
+ agentId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
106
+ before: z.ZodOptional<z.ZodString>;
107
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
108
+ }, z.core.$strict>;
109
+ export type ChatV3ThreadListQuery = z.infer<typeof chatV3ThreadListQuerySchema>;
110
+ export declare const chatV3ThreadListSchema: z.ZodObject<{
111
+ threads: z.ZodArray<z.ZodObject<{
112
+ threadId: z.ZodString;
113
+ agentId: z.ZodString;
114
+ sessionId: z.ZodString;
115
+ title: z.ZodString;
116
+ createdAt: z.ZodString;
117
+ updatedAt: z.ZodString;
118
+ }, z.core.$strip>>;
119
+ nextCursor: z.ZodNullable<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ export type ChatV3ThreadList = z.infer<typeof chatV3ThreadListSchema>;
122
+ export declare const CHAT_V3_MESSAGE_PAGE: {
123
+ readonly default: 30;
124
+ readonly max: 100;
125
+ };
126
+ /** A message's text; above the inline limit agent-api keeps it in Vault and the event points at it. */
127
+ export declare const chatV3SendMessageSchema: z.ZodObject<{
128
+ text: z.ZodString;
129
+ }, z.core.$strict>;
130
+ export type ChatV3SendMessage = z.infer<typeof chatV3SendMessageSchema>;
131
+ /** Cancels the running turn; the turnId comes from the message that started it. */
132
+ export declare const chatV3CancelTurnSchema: z.ZodObject<{
133
+ turnId: z.ZodString;
134
+ }, z.core.$strict>;
135
+ export type ChatV3CancelTurn = z.infer<typeof chatV3CancelTurnSchema>;
136
+ /** The answer of every write: agent-api admitted the user event. `messageId` is its v5 eventId. */
137
+ export declare const chatV3MessageReceiptSchema: z.ZodObject<{
138
+ messageId: z.ZodString;
139
+ turnId: z.ZodNullable<z.ZodString>;
140
+ status: z.ZodString;
141
+ }, z.core.$strip>;
142
+ export type ChatV3MessageReceipt = z.infer<typeof chatV3MessageReceiptSchema>;
143
+ export declare const chatV3MessageStatusSchema: z.ZodEnum<{
144
+ running: "running";
145
+ completed: "completed";
146
+ failed: "failed";
147
+ cancelled: "cancelled";
148
+ queued: "queued";
149
+ uncertain: "uncertain";
150
+ }>;
151
+ export type ChatV3MessageStatus = z.infer<typeof chatV3MessageStatusSchema>;
152
+ /**
153
+ * One message of the user and the agent's reply to it, rebuilt from the session's events on
154
+ * every read. `text` is `null` while it is only in Vault (`textInVault`); `reply` is the
155
+ * canonical text the agent stored so far, without the live drafts.
156
+ */
157
+ export declare const chatV3MessageSchema: z.ZodObject<{
158
+ messageId: z.ZodString;
159
+ turnId: z.ZodNullable<z.ZodString>;
160
+ mode: z.ZodEnum<{
161
+ queue: "queue";
162
+ steer: "steer";
163
+ answer: "answer";
164
+ }>;
165
+ status: z.ZodEnum<{
166
+ running: "running";
167
+ completed: "completed";
168
+ failed: "failed";
169
+ cancelled: "cancelled";
170
+ queued: "queued";
171
+ uncertain: "uncertain";
172
+ }>;
173
+ text: z.ZodNullable<z.ZodString>;
174
+ textInVault: z.ZodBoolean;
175
+ reply: z.ZodString;
176
+ createdAt: z.ZodString;
177
+ }, z.core.$strip>;
178
+ export type ChatV3Message = z.infer<typeof chatV3MessageSchema>;
179
+ export declare const chatV3MessageListQuerySchema: z.ZodObject<{
180
+ before: z.ZodOptional<z.ZodString>;
181
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
182
+ }, z.core.$strict>;
183
+ export type ChatV3MessageListQuery = z.infer<typeof chatV3MessageListQuerySchema>;
184
+ /**
185
+ * The latest messages, oldest first. `eventCursor` is the last event the page was built from:
186
+ * open the event stream with it as `Last-Event-ID` and nothing falls between the two.
187
+ */
188
+ export declare const chatV3MessageListSchema: z.ZodObject<{
189
+ messages: z.ZodArray<z.ZodObject<{
190
+ messageId: z.ZodString;
191
+ turnId: z.ZodNullable<z.ZodString>;
192
+ mode: z.ZodEnum<{
193
+ queue: "queue";
194
+ steer: "steer";
195
+ answer: "answer";
196
+ }>;
197
+ status: z.ZodEnum<{
198
+ running: "running";
199
+ completed: "completed";
200
+ failed: "failed";
201
+ cancelled: "cancelled";
202
+ queued: "queued";
203
+ uncertain: "uncertain";
204
+ }>;
205
+ text: z.ZodNullable<z.ZodString>;
206
+ textInVault: z.ZodBoolean;
207
+ reply: z.ZodString;
208
+ createdAt: z.ZodString;
209
+ }, z.core.$strip>>;
210
+ nextCursor: z.ZodNullable<z.ZodString>;
211
+ eventCursor: z.ZodNullable<z.ZodString>;
212
+ }, z.core.$strip>;
213
+ export type ChatV3MessageList = z.infer<typeof chatV3MessageListSchema>;
@@ -1,15 +1,15 @@
1
1
  import { z } from 'zod';
2
- import { v5HarnessSchema } from '../integrations/agent-events';
2
+ import { v5EventIdSchema, v5HarnessSchema, v5Limits, v5TurnIdSchema } from '../integrations/agent-events';
3
3
  /**
4
4
  * Chat API v3 (`/v3/chat`): the conversational surface over agent-api v5 events-v1.
5
- * The chat-api owns the conversation; agent-api owns the session and its history.
5
+ * The chat-api owns the thread; agent-api owns the session and its history.
6
6
  */
7
7
  export const CHAT_V3_CONTRACT_VERSION = 'events-v1';
8
- /** Where the agent of the request stands in the v5 catalog. */
8
+ /** Where the agent of the request stands in agent-api, where the agent lives. */
9
9
  export const chatV3AgentStatusSchema = z.enum([
10
- /** No `telaAgentId` on the request: nothing to resolve yet. */
10
+ /** No `agentId` on the request: nothing to look up yet. */
11
11
  'not_requested',
12
- /** Tela knows the agent, but the v5 catalog does not: Tela has to create it there. */
12
+ /** agent-api has no such agent in the caller's workspace. */
13
13
  'not_in_catalog',
14
14
  /** In the catalog without a publication: `POST /v5/agents/snapshots` first. */
15
15
  'not_published',
@@ -35,3 +35,89 @@ export const chatV3ConfigurationSchema = z.object({
35
35
  eventsPerRequest: z.number().int().positive(),
36
36
  }),
37
37
  });
38
+ export const CHAT_V3_TITLE_CHARS = 200;
39
+ export const CHAT_V3_CREATION_KEY_CHARS = 128;
40
+ export const CHAT_V3_THREAD_PAGE = { default: 30, max: 100 };
41
+ /**
42
+ * The agent's id in agent-api, the only one the chat uses. Lowercased, as agent-api and Postgres
43
+ * write uuids, so the same agent always compares equal.
44
+ */
45
+ const agentIdSchema = z.string().uuid().transform(id => id.toLowerCase());
46
+ /** A thread as the chat owns it: access and title here, history in the agent-api session. */
47
+ export const chatV3ThreadSchema = z.object({
48
+ threadId: z.string().uuid(),
49
+ agentId: z.string().uuid(),
50
+ sessionId: z.string().uuid(),
51
+ title: z.string(),
52
+ createdAt: z.string(),
53
+ updatedAt: z.string(),
54
+ });
55
+ /** The session behind a thread, read live from agent-api; `null` when agent-api no longer has it. */
56
+ export const chatV3SessionSummarySchema = z.object({
57
+ status: z.string(),
58
+ harness: z.string(),
59
+ model: z.string().nullable(),
60
+ reasoningEffort: z.string().nullable(),
61
+ }).nullable();
62
+ export const chatV3ThreadDetailSchema = chatV3ThreadSchema.extend({ session: chatV3SessionSummarySchema });
63
+ /** Creation also opens the agent-api session; send an `Idempotency-Key` header to retry safely. */
64
+ export const chatV3CreateThreadSchema = z.object({
65
+ agentId: agentIdSchema,
66
+ title: z.string().trim().max(CHAT_V3_TITLE_CHARS).optional(),
67
+ }).strict();
68
+ export const chatV3UpdateThreadSchema = z.object({
69
+ title: z.string().trim().max(CHAT_V3_TITLE_CHARS),
70
+ }).strict();
71
+ export const chatV3ThreadListQuerySchema = z.object({
72
+ agentId: agentIdSchema.optional(),
73
+ /** Exclusive cursor: the last `threadId` of the previous page. */
74
+ before: z.string().uuid().optional(),
75
+ limit: z.coerce.number().int().min(1).max(CHAT_V3_THREAD_PAGE.max).default(CHAT_V3_THREAD_PAGE.default),
76
+ }).strict();
77
+ export const chatV3ThreadListSchema = z.object({
78
+ threads: z.array(chatV3ThreadSchema),
79
+ nextCursor: z.string().uuid().nullable(),
80
+ });
81
+ export const CHAT_V3_MESSAGE_PAGE = { default: 30, max: 100 };
82
+ /** A message's text; above the inline limit agent-api keeps it in Vault and the event points at it. */
83
+ export const chatV3SendMessageSchema = z.object({
84
+ text: z.string().min(1).max(v5Limits.messageTextChars),
85
+ }).strict();
86
+ /** Cancels the running turn; the turnId comes from the message that started it. */
87
+ export const chatV3CancelTurnSchema = z.object({ turnId: v5TurnIdSchema }).strict();
88
+ /** The answer of every write: agent-api admitted the user event. `messageId` is its v5 eventId. */
89
+ export const chatV3MessageReceiptSchema = z.object({
90
+ messageId: v5EventIdSchema,
91
+ turnId: v5TurnIdSchema.nullable(),
92
+ status: z.string(),
93
+ });
94
+ export const chatV3MessageStatusSchema = z.enum(['queued', 'running', 'completed', 'failed', 'cancelled', 'uncertain']);
95
+ /**
96
+ * One message of the user and the agent's reply to it, rebuilt from the session's events on
97
+ * every read. `text` is `null` while it is only in Vault (`textInVault`); `reply` is the
98
+ * canonical text the agent stored so far, without the live drafts.
99
+ */
100
+ export const chatV3MessageSchema = z.object({
101
+ messageId: v5EventIdSchema,
102
+ turnId: v5TurnIdSchema.nullable(),
103
+ mode: z.enum(['queue', 'steer', 'answer']),
104
+ status: chatV3MessageStatusSchema,
105
+ text: z.string().nullable(),
106
+ textInVault: z.boolean(),
107
+ reply: z.string(),
108
+ createdAt: z.string(),
109
+ });
110
+ export const chatV3MessageListQuerySchema = z.object({
111
+ /** Exclusive cursor: the `nextCursor` of the previous page, which reads older messages. */
112
+ before: v5EventIdSchema.optional(),
113
+ limit: z.coerce.number().int().min(1).max(CHAT_V3_MESSAGE_PAGE.max).default(CHAT_V3_MESSAGE_PAGE.default),
114
+ }).strict();
115
+ /**
116
+ * The latest messages, oldest first. `eventCursor` is the last event the page was built from:
117
+ * open the event stream with it as `Last-Event-ID` and nothing falls between the two.
118
+ */
119
+ export const chatV3MessageListSchema = z.object({
120
+ messages: z.array(chatV3MessageSchema),
121
+ nextCursor: v5EventIdSchema.nullable(),
122
+ eventCursor: v5EventIdSchema.nullable(),
123
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.10.0-rc.6",
3
+ "version": "4.10.0-rc.8",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {