@meistrari/chat-nuxt 4.10.0-rc.7 → 4.10.0-rc.9
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.d.mts +0 -7
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +2 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +2 -2
- package/dist/runtime/server/utils/chat-api-proxy.js +2 -4
- package/dist/runtime/types/schemas/chat/v3.d.ts +92 -0
- package/dist/runtime/types/schemas/chat/v3.js +44 -1
- package/package.json +1 -1
package/dist/module.d.mts
CHANGED
|
@@ -51,13 +51,6 @@ interface ChatNuxtModuleOptions {
|
|
|
51
51
|
* to `false`; also settable via `NUXT_CHAT_NUXT_ROUTE_CLAUDE_VIA_GATEWAY`.
|
|
52
52
|
*/
|
|
53
53
|
routeClaudeViaGateway?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Opt this deployment into generative widgets: the server proxy adds
|
|
56
|
-
* `"ui-language": "web"` to the `x-chat-config` header, so chat-api asks the
|
|
57
|
-
* agent for OpenUI Lang widget blocks and chat-nuxt renders them. Defaults
|
|
58
|
-
* to `false`; also settable via `NUXT_CHAT_NUXT_UI_LANGUAGE`.
|
|
59
|
-
*/
|
|
60
|
-
uiLanguage?: boolean;
|
|
61
54
|
}
|
|
62
55
|
declare const _default: any;
|
|
63
56
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -473,8 +473,7 @@ const module$1 = defineNuxtModule({
|
|
|
473
473
|
agentApiV5: options.agentApiV5 ?? existingChatNuxtRuntimeConfig?.agentApiV5 ?? false,
|
|
474
474
|
// Explicit boolean default keeps the key in runtime config so the
|
|
475
475
|
// NUXT_CHAT_NUXT_ROUTE_CLAUDE_VIA_GATEWAY env override can apply.
|
|
476
|
-
routeClaudeViaGateway: options.routeClaudeViaGateway ?? existingChatNuxtRuntimeConfig?.routeClaudeViaGateway ?? false
|
|
477
|
-
uiLanguage: options.uiLanguage ?? existingChatNuxtRuntimeConfig?.uiLanguage ?? false
|
|
476
|
+
routeClaudeViaGateway: options.routeClaudeViaGateway ?? existingChatNuxtRuntimeConfig?.routeClaudeViaGateway ?? false
|
|
478
477
|
};
|
|
479
478
|
if (hostAuthComposablePath && !rc.chatNuxt.authTokenCookie) {
|
|
480
479
|
console.warn(
|
|
@@ -71,8 +71,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
71
71
|
copyLink: () => any;
|
|
72
72
|
debug: () => any;
|
|
73
73
|
selectConversation: (id: string) => any;
|
|
74
|
-
settings: () => any;
|
|
75
74
|
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
75
|
+
settings: () => any;
|
|
76
76
|
selectExecutionProfile: (profile: ChatExecutionProfile) => any;
|
|
77
77
|
tabChange: (tab: TopbarTab) => any;
|
|
78
78
|
newConversation: (groupId?: string | null | undefined) => any;
|
|
@@ -93,8 +93,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
93
93
|
onCopyLink?: (() => any) | undefined;
|
|
94
94
|
onDebug?: (() => any) | undefined;
|
|
95
95
|
onSelectConversation?: ((id: string) => any) | undefined;
|
|
96
|
-
onSettings?: (() => any) | undefined;
|
|
97
96
|
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
97
|
+
onSettings?: (() => any) | undefined;
|
|
98
98
|
onSelectExecutionProfile?: ((profile: ChatExecutionProfile) => any) | undefined;
|
|
99
99
|
"onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
|
|
100
100
|
"onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
|
|
@@ -71,8 +71,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
71
71
|
copyLink: () => any;
|
|
72
72
|
debug: () => any;
|
|
73
73
|
selectConversation: (id: string) => any;
|
|
74
|
-
settings: () => any;
|
|
75
74
|
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
75
|
+
settings: () => any;
|
|
76
76
|
selectExecutionProfile: (profile: ChatExecutionProfile) => any;
|
|
77
77
|
tabChange: (tab: TopbarTab) => any;
|
|
78
78
|
newConversation: (groupId?: string | null | undefined) => any;
|
|
@@ -93,8 +93,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
93
93
|
onCopyLink?: (() => any) | undefined;
|
|
94
94
|
onDebug?: (() => any) | undefined;
|
|
95
95
|
onSelectConversation?: ((id: string) => any) | undefined;
|
|
96
|
-
onSettings?: (() => any) | undefined;
|
|
97
96
|
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
97
|
+
onSettings?: (() => any) | undefined;
|
|
98
98
|
onSelectExecutionProfile?: ((profile: ChatExecutionProfile) => any) | undefined;
|
|
99
99
|
"onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
|
|
100
100
|
"onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
|
|
@@ -93,7 +93,8 @@ function buildProxyHeaders(event) {
|
|
|
93
93
|
const config = useRuntimeConfig(event);
|
|
94
94
|
const chatConfig = {
|
|
95
95
|
[PREPARED_AGENT_RUNTIME_CONFIG_KEY]: true,
|
|
96
|
-
[CONVERSATION_V2_CONFIG_KEY]: true
|
|
96
|
+
[CONVERSATION_V2_CONFIG_KEY]: true,
|
|
97
|
+
[UI_LANGUAGE_CONFIG_KEY]: "web"
|
|
97
98
|
};
|
|
98
99
|
if (config.chatNuxt?.secretlessExecution) {
|
|
99
100
|
chatConfig[SECRETLESS_EXECUTION_CONFIG_KEY] = true;
|
|
@@ -107,9 +108,6 @@ function buildProxyHeaders(event) {
|
|
|
107
108
|
if (config.chatNuxt?.routeClaudeViaGateway) {
|
|
108
109
|
chatConfig[ROUTE_CLAUDE_VIA_GATEWAY_CONFIG_KEY] = true;
|
|
109
110
|
}
|
|
110
|
-
if (config.chatNuxt?.uiLanguage) {
|
|
111
|
-
chatConfig[UI_LANGUAGE_CONFIG_KEY] = "web";
|
|
112
|
-
}
|
|
113
111
|
const headers = {
|
|
114
112
|
"authorization": `Bearer ${token}`,
|
|
115
113
|
"x-chat-client": "chat-nuxt",
|
|
@@ -119,3 +119,95 @@ export declare const chatV3ThreadListSchema: z.ZodObject<{
|
|
|
119
119
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
120
120
|
}, z.core.$strip>;
|
|
121
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,5 +1,5 @@
|
|
|
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
5
|
* The chat-api owns the thread; agent-api owns the session and its history.
|
|
@@ -78,3 +78,46 @@ export const chatV3ThreadListSchema = z.object({
|
|
|
78
78
|
threads: z.array(chatV3ThreadSchema),
|
|
79
79
|
nextCursor: z.string().uuid().nullable(),
|
|
80
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
|
+
});
|