@meistrari/chat-nuxt 4.10.0-rc.2 → 4.10.0-rc.4

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 CHANGED
@@ -51,6 +51,13 @@ 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;
54
61
  }
55
62
  declare const _default: any;
56
63
 
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.2",
4
+ "version": "4.10.0-rc.4",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -471,7 +471,8 @@ const module$1 = defineNuxtModule({
471
471
  agentApiV5: options.agentApiV5 ?? existingChatNuxtRuntimeConfig?.agentApiV5 ?? false,
472
472
  // Explicit boolean default keeps the key in runtime config so the
473
473
  // NUXT_CHAT_NUXT_ROUTE_CLAUDE_VIA_GATEWAY env override can apply.
474
- routeClaudeViaGateway: options.routeClaudeViaGateway ?? existingChatNuxtRuntimeConfig?.routeClaudeViaGateway ?? false
474
+ routeClaudeViaGateway: options.routeClaudeViaGateway ?? existingChatNuxtRuntimeConfig?.routeClaudeViaGateway ?? false,
475
+ uiLanguage: options.uiLanguage ?? existingChatNuxtRuntimeConfig?.uiLanguage ?? false
475
476
  };
476
477
  if (hostAuthComposablePath && !rc.chatNuxt.authTokenCookie) {
477
478
  console.warn(
@@ -1,4 +1,4 @@
1
- import { AGENT_API_V5_CONFIG_KEY, PRE_WAKE_CACHE_CONFIG_KEY, CONVERSATION_V2_CONFIG_KEY, PREPARED_AGENT_RUNTIME_CONFIG_KEY, ROUTE_CLAUDE_VIA_GATEWAY_CONFIG_KEY, SECRETLESS_EXECUTION_CONFIG_KEY } from "../../types/schemas/chat/chat-config.js";
1
+ import { AGENT_API_V5_CONFIG_KEY, PRE_WAKE_CACHE_CONFIG_KEY, CONVERSATION_V2_CONFIG_KEY, PREPARED_AGENT_RUNTIME_CONFIG_KEY, ROUTE_CLAUDE_VIA_GATEWAY_CONFIG_KEY, SECRETLESS_EXECUTION_CONFIG_KEY, UI_LANGUAGE_CONFIG_KEY } from "../../types/schemas/chat/chat-config.js";
2
2
  import { createError, defineEventHandler, getHeader, getRequestURL, getRouterParam, proxyRequest } from "h3";
3
3
  import { useRuntimeConfig } from "nitropack/runtime";
4
4
  import { resolveAuthToken } from "./auth-token.js";
@@ -107,6 +107,9 @@ function buildProxyHeaders(event) {
107
107
  if (config.chatNuxt?.routeClaudeViaGateway) {
108
108
  chatConfig[ROUTE_CLAUDE_VIA_GATEWAY_CONFIG_KEY] = true;
109
109
  }
110
+ if (config.chatNuxt?.uiLanguage) {
111
+ chatConfig[UI_LANGUAGE_CONFIG_KEY] = "web";
112
+ }
110
113
  const headers = {
111
114
  "authorization": `Bearer ${token}`,
112
115
  "x-chat-client": "chat-nuxt",
@@ -1,3 +1,4 @@
1
+ import type { UiProfile } from './ui-language';
1
2
  export declare const PREPARED_AGENT_RUNTIME_CONFIG_KEY = "prepared-agent-runtime";
2
3
  export declare const SECRETLESS_EXECUTION_CONFIG_KEY = "secretless-execution";
3
4
  export declare const AGENT_API_V5_CONFIG_KEY = "agent-api-v5";
@@ -6,7 +7,10 @@ export declare const PRE_WAKE_CACHE_CONFIG_KEY = "pre-wake-cache";
6
7
  export declare const ROUTE_CLAUDE_VIA_GATEWAY_CONFIG_KEY = "route-claude-via-gateway";
7
8
  export type ChatHarness = 'claude' | 'lightweight';
8
9
  export type ChatConfig = {
9
- harness?: ChatHarness;
10
- [key: string]: boolean | ChatHarness | undefined;
10
+ 'harness'?: ChatHarness;
11
+ /** Catalogue profile of the client's surface; widgets are requested only when it is set. */
12
+ 'ui-language'?: UiProfile;
13
+ [key: string]: boolean | ChatHarness | UiProfile | undefined;
11
14
  };
12
15
  export declare function resolveChatHarness(config?: Pick<ChatConfig, 'harness'>): ChatHarness;
16
+ export declare const UI_LANGUAGE_CONFIG_KEY = "ui-language";
@@ -7,3 +7,4 @@ export const ROUTE_CLAUDE_VIA_GATEWAY_CONFIG_KEY = 'route-claude-via-gateway';
7
7
  export function resolveChatHarness(config) {
8
8
  return config?.harness === 'lightweight' ? 'lightweight' : 'claude';
9
9
  }
10
+ export const UI_LANGUAGE_CONFIG_KEY = 'ui-language';
@@ -133,6 +133,10 @@ export declare const sendMessageV2ResponseSchema: z.ZodObject<{
133
133
  id: z.ZodEnum<{
134
134
  openui: "openui";
135
135
  }>;
136
+ profile: z.ZodEnum<{
137
+ web: "web";
138
+ slack: "slack";
139
+ }>;
136
140
  libraryVersion: z.ZodOptional<z.ZodString>;
137
141
  }, z.core.$strip>>>;
138
142
  }, z.core.$strip>;
@@ -174,6 +178,10 @@ export declare const sendMessageV2ResponseSchema: z.ZodObject<{
174
178
  id: z.ZodEnum<{
175
179
  openui: "openui";
176
180
  }>;
181
+ profile: z.ZodEnum<{
182
+ web: "web";
183
+ slack: "slack";
184
+ }>;
177
185
  libraryVersion: z.ZodOptional<z.ZodString>;
178
186
  }, z.core.$strip>>>;
179
187
  }, z.core.$strip>;
@@ -117,6 +117,10 @@ export declare const messageSchema: z.ZodObject<{
117
117
  id: z.ZodEnum<{
118
118
  openui: "openui";
119
119
  }>;
120
+ profile: z.ZodEnum<{
121
+ web: "web";
122
+ slack: "slack";
123
+ }>;
120
124
  libraryVersion: z.ZodOptional<z.ZodString>;
121
125
  }, z.core.$strip>>>;
122
126
  }, z.core.$strip>;
@@ -238,6 +242,10 @@ export declare const conversationWithMessagesSchema: z.ZodObject<{
238
242
  id: z.ZodEnum<{
239
243
  openui: "openui";
240
244
  }>;
245
+ profile: z.ZodEnum<{
246
+ web: "web";
247
+ slack: "slack";
248
+ }>;
241
249
  libraryVersion: z.ZodOptional<z.ZodString>;
242
250
  }, z.core.$strip>>>;
243
251
  }, z.core.$strip>>;
@@ -160,6 +160,10 @@ export declare const sendMessageResponseSchema: z.ZodObject<{
160
160
  id: z.ZodEnum<{
161
161
  openui: "openui";
162
162
  }>;
163
+ profile: z.ZodEnum<{
164
+ web: "web";
165
+ slack: "slack";
166
+ }>;
163
167
  libraryVersion: z.ZodOptional<z.ZodString>;
164
168
  }, z.core.$strip>>>;
165
169
  }, z.core.$strip>;
@@ -201,6 +205,10 @@ export declare const sendMessageResponseSchema: z.ZodObject<{
201
205
  id: z.ZodEnum<{
202
206
  openui: "openui";
203
207
  }>;
208
+ profile: z.ZodEnum<{
209
+ web: "web";
210
+ slack: "slack";
211
+ }>;
204
212
  libraryVersion: z.ZodOptional<z.ZodString>;
205
213
  }, z.core.$strip>>>;
206
214
  }, z.core.$strip>;
@@ -245,6 +253,10 @@ export declare const messagePollResponseSchema: z.ZodObject<{
245
253
  id: z.ZodEnum<{
246
254
  openui: "openui";
247
255
  }>;
256
+ profile: z.ZodEnum<{
257
+ web: "web";
258
+ slack: "slack";
259
+ }>;
248
260
  libraryVersion: z.ZodOptional<z.ZodString>;
249
261
  }, z.core.$strip>>>;
250
262
  }, z.core.$strip>>;
@@ -1,14 +1,31 @@
1
1
  import { z } from 'zod';
2
2
  export declare const uiLanguageIds: readonly ["openui"];
3
- export declare const uiLanguageSchema: z.ZodEnum<{
4
- openui: "openui";
3
+ export declare const uiProfileIds: readonly ["web", "slack"];
4
+ export declare const uiProfileSchema: z.ZodEnum<{
5
+ web: "web";
6
+ slack: "slack";
5
7
  }>;
8
+ export type UiProfile = z.infer<typeof uiProfileSchema>;
9
+ /** What a turn asks the agent for: the widget language and the catalogue profile of the surface that renders the answer. */
10
+ export declare const uiLanguageSchema: z.ZodObject<{
11
+ id: z.ZodEnum<{
12
+ openui: "openui";
13
+ }>;
14
+ profile: z.ZodEnum<{
15
+ web: "web";
16
+ slack: "slack";
17
+ }>;
18
+ }, z.core.$strip>;
6
19
  export type UiLanguage = z.infer<typeof uiLanguageSchema>;
7
20
  /** Set on the assistant message when the turn asked the agent for widgets; the library version arrives with the result. */
8
21
  export declare const uiLanguageStampSchema: z.ZodObject<{
9
22
  id: z.ZodEnum<{
10
23
  openui: "openui";
11
24
  }>;
25
+ profile: z.ZodEnum<{
26
+ web: "web";
27
+ slack: "slack";
28
+ }>;
12
29
  libraryVersion: z.ZodOptional<z.ZodString>;
13
30
  }, z.core.$strip>;
14
31
  export type UiLanguageStamp = z.infer<typeof uiLanguageStampSchema>;
@@ -1,8 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  export const uiLanguageIds = ['openui'];
3
- export const uiLanguageSchema = z.enum(uiLanguageIds);
3
+ export const uiProfileIds = ['web', 'slack'];
4
+ export const uiProfileSchema = z.enum(uiProfileIds);
5
+ /** What a turn asks the agent for: the widget language and the catalogue profile of the surface that renders the answer. */
6
+ export const uiLanguageSchema = z.object({
7
+ id: z.enum(uiLanguageIds),
8
+ profile: uiProfileSchema,
9
+ });
4
10
  /** Set on the assistant message when the turn asked the agent for widgets; the library version arrives with the result. */
5
- export const uiLanguageStampSchema = z.object({
6
- id: uiLanguageSchema,
11
+ export const uiLanguageStampSchema = uiLanguageSchema.extend({
7
12
  libraryVersion: z.string().min(1).optional(),
8
13
  });
@@ -221,6 +221,16 @@ export declare const telaAgentSessionResultSchema: z.ZodObject<{
221
221
  content: z.ZodOptional<z.ZodString>;
222
222
  structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
223
223
  childEventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
224
+ uiLanguage: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodObject<{
225
+ id: z.ZodEnum<{
226
+ openui: "openui";
227
+ }>;
228
+ profile: z.ZodEnum<{
229
+ web: "web";
230
+ slack: "slack";
231
+ }>;
232
+ libraryVersion: z.ZodOptional<z.ZodString>;
233
+ }, z.core.$strip>>>>;
224
234
  }, z.core.$catchall<z.ZodUnknown>>;
225
235
  export declare const telaAgentDirectStreamSchema: z.ZodObject<{
226
236
  url: z.ZodString;
@@ -270,6 +280,16 @@ export declare const telaAgentSessionSchema: z.ZodObject<{
270
280
  content: z.ZodOptional<z.ZodString>;
271
281
  structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
272
282
  childEventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
283
+ uiLanguage: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodObject<{
284
+ id: z.ZodEnum<{
285
+ openui: "openui";
286
+ }>;
287
+ profile: z.ZodEnum<{
288
+ web: "web";
289
+ slack: "slack";
290
+ }>;
291
+ libraryVersion: z.ZodOptional<z.ZodString>;
292
+ }, z.core.$strip>>>>;
273
293
  }, z.core.$catchall<z.ZodUnknown>>>;
274
294
  error: z.ZodOptional<z.ZodString>;
275
295
  createdAt: z.ZodOptional<z.ZodNumber>;
@@ -364,6 +384,16 @@ export declare const telaAgentV4SessionResultEventSchema: z.ZodObject<{
364
384
  content: z.ZodOptional<z.ZodString>;
365
385
  structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
366
386
  childEventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
387
+ uiLanguage: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodObject<{
388
+ id: z.ZodEnum<{
389
+ openui: "openui";
390
+ }>;
391
+ profile: z.ZodEnum<{
392
+ web: "web";
393
+ slack: "slack";
394
+ }>;
395
+ libraryVersion: z.ZodOptional<z.ZodString>;
396
+ }, z.core.$strip>>>>;
367
397
  }, z.core.$catchall<z.ZodUnknown>>;
368
398
  nextCursor: z.ZodNullable<z.ZodNumber>;
369
399
  createdAt: z.ZodNumber;
@@ -431,6 +461,16 @@ export declare const telaAgentV4SessionStreamEventSchema: z.ZodDiscriminatedUnio
431
461
  content: z.ZodOptional<z.ZodString>;
432
462
  structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
433
463
  childEventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
464
+ uiLanguage: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodObject<{
465
+ id: z.ZodEnum<{
466
+ openui: "openui";
467
+ }>;
468
+ profile: z.ZodEnum<{
469
+ web: "web";
470
+ slack: "slack";
471
+ }>;
472
+ libraryVersion: z.ZodOptional<z.ZodString>;
473
+ }, z.core.$strip>>>>;
434
474
  }, z.core.$catchall<z.ZodUnknown>>;
435
475
  nextCursor: z.ZodNullable<z.ZodNumber>;
436
476
  createdAt: z.ZodNumber;
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { chatModelSchema } from '../chat/models';
3
+ import { uiLanguageStampSchema } from '../chat/ui-language';
3
4
  export const telaAgentAttachmentSchema = z.object({
4
5
  vaultRef: z.string().startsWith('vault://'),
5
6
  filename: z.string().min(1).max(255),
@@ -122,6 +123,8 @@ export const telaAgentSessionResultSchema = z.object({
122
123
  content: z.string().optional(),
123
124
  structuredContent: z.record(z.string(), z.unknown()).optional(),
124
125
  childEventIds: z.array(z.string()).optional(),
126
+ // The stamp only informs: one the chat-api cannot read never fails the turn.
127
+ uiLanguage: uiLanguageStampSchema.nullable().optional().catch(null),
125
128
  }).catchall(z.unknown());
126
129
  export const telaAgentDirectStreamSchema = z.object({
127
130
  url: z.string().url(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.10.0-rc.2",
3
+ "version": "4.10.0-rc.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {