@meistrari/chat-nuxt 4.5.1-rc.0 → 4.5.1-rc.2

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.5.1-rc.0",
4
+ "version": "4.5.1-rc.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -6,8 +6,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
6
6
  } & {
7
7
  create: (canvasTools: CanvasTool[]) => any;
8
8
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
9
- "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
10
9
  onCreate?: ((canvasTools: CanvasTool[]) => any) | undefined;
10
+ "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
11
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
13
13
  export default _default;
@@ -6,8 +6,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
6
6
  } & {
7
7
  create: (canvasTools: CanvasTool[]) => any;
8
8
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
9
- "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
10
9
  onCreate?: ((canvasTools: CanvasTool[]) => any) | undefined;
10
+ "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
11
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
13
13
  export default _default;
@@ -15,23 +15,23 @@ type __VLS_Props = {
15
15
  };
16
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
17
17
  delete: () => any;
18
+ openDrawer: () => any;
19
+ copyLink: () => any;
20
+ openOutdatedSettings: () => any;
18
21
  rename: () => any;
19
22
  duplicate: () => any;
20
23
  export: () => any;
21
- copyLink: () => any;
22
24
  debug: () => any;
23
- openDrawer: () => any;
24
- openOutdatedSettings: () => any;
25
25
  tabChange: (tab: TopbarTab) => any;
26
26
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
27
27
  onDelete?: (() => any) | undefined;
28
+ onOpenDrawer?: (() => any) | undefined;
29
+ onCopyLink?: (() => any) | undefined;
30
+ onOpenOutdatedSettings?: (() => any) | undefined;
28
31
  onRename?: (() => any) | undefined;
29
32
  onDuplicate?: (() => any) | undefined;
30
33
  onExport?: (() => any) | undefined;
31
- onCopyLink?: (() => any) | undefined;
32
34
  onDebug?: (() => any) | undefined;
33
- onOpenDrawer?: (() => any) | undefined;
34
- onOpenOutdatedSettings?: (() => any) | undefined;
35
35
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
36
36
  }>, {
37
37
  showDrawerButton: boolean;
@@ -15,23 +15,23 @@ type __VLS_Props = {
15
15
  };
16
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
17
17
  delete: () => any;
18
+ openDrawer: () => any;
19
+ copyLink: () => any;
20
+ openOutdatedSettings: () => any;
18
21
  rename: () => any;
19
22
  duplicate: () => any;
20
23
  export: () => any;
21
- copyLink: () => any;
22
24
  debug: () => any;
23
- openDrawer: () => any;
24
- openOutdatedSettings: () => any;
25
25
  tabChange: (tab: TopbarTab) => any;
26
26
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
27
27
  onDelete?: (() => any) | undefined;
28
+ onOpenDrawer?: (() => any) | undefined;
29
+ onCopyLink?: (() => any) | undefined;
30
+ onOpenOutdatedSettings?: (() => any) | undefined;
28
31
  onRename?: (() => any) | undefined;
29
32
  onDuplicate?: (() => any) | undefined;
30
33
  onExport?: (() => any) | undefined;
31
- onCopyLink?: (() => any) | undefined;
32
34
  onDebug?: (() => any) | undefined;
33
- onOpenDrawer?: (() => any) | undefined;
34
- onOpenOutdatedSettings?: (() => any) | undefined;
35
35
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
36
36
  }>, {
37
37
  showDrawerButton: boolean;
@@ -61,14 +61,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
61
61
  } & {
62
62
  delete: () => any;
63
63
  cancel: () => any;
64
+ settings: () => any;
65
+ send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
66
+ copyLink: () => any;
64
67
  rename: () => any;
65
68
  duplicate: () => any;
66
69
  export: () => any;
67
- copyLink: () => any;
68
70
  debug: () => any;
69
- selectConversation: (id: string) => any;
70
- settings: () => any;
71
- send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
72
71
  tabChange: (tab: TopbarTab) => any;
73
72
  newConversation: (groupId?: string | null | undefined) => any;
74
73
  switchWorkspace: () => any;
@@ -76,22 +75,22 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
76
75
  cancelEditing: () => any;
77
76
  dismissOutdatedBanner: () => any;
78
77
  saveTitle: () => any;
78
+ selectConversation: (id: string) => any;
79
79
  "update:drawerOpen": (value: boolean) => any;
80
80
  "update:editTitle": (value: string) => any;
81
81
  "update:workspaceSheetOpen": (value: boolean) => any;
82
82
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
83
83
  onDelete?: (() => any) | undefined;
84
84
  onCancel?: (() => any) | undefined;
85
- onRename?: (() => any) | undefined;
86
- onDuplicate?: (() => any) | undefined;
87
- onExport?: (() => any) | undefined;
88
- onCopyLink?: (() => any) | undefined;
89
- onDebug?: (() => any) | undefined;
90
- onSelectConversation?: ((id: string) => any) | undefined;
91
85
  onSettings?: (() => any) | undefined;
92
86
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
93
87
  "onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
94
88
  "onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
89
+ onCopyLink?: (() => any) | undefined;
90
+ onRename?: (() => any) | undefined;
91
+ onDuplicate?: (() => any) | undefined;
92
+ onExport?: (() => any) | undefined;
93
+ onDebug?: (() => any) | undefined;
95
94
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
96
95
  onNewConversation?: ((groupId?: string | null | undefined) => any) | undefined;
97
96
  onSwitchWorkspace?: (() => any) | undefined;
@@ -99,6 +98,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
99
98
  onCancelEditing?: (() => any) | undefined;
100
99
  onDismissOutdatedBanner?: (() => any) | undefined;
101
100
  onSaveTitle?: (() => any) | undefined;
101
+ onSelectConversation?: ((id: string) => any) | undefined;
102
102
  "onUpdate:drawerOpen"?: ((value: boolean) => any) | undefined;
103
103
  "onUpdate:editTitle"?: ((value: string) => any) | undefined;
104
104
  "onUpdate:workspaceSheetOpen"?: ((value: boolean) => any) | undefined;
@@ -61,14 +61,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
61
61
  } & {
62
62
  delete: () => any;
63
63
  cancel: () => any;
64
+ settings: () => any;
65
+ send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
66
+ copyLink: () => any;
64
67
  rename: () => any;
65
68
  duplicate: () => any;
66
69
  export: () => any;
67
- copyLink: () => any;
68
70
  debug: () => any;
69
- selectConversation: (id: string) => any;
70
- settings: () => any;
71
- send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
72
71
  tabChange: (tab: TopbarTab) => any;
73
72
  newConversation: (groupId?: string | null | undefined) => any;
74
73
  switchWorkspace: () => any;
@@ -76,22 +75,22 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
76
75
  cancelEditing: () => any;
77
76
  dismissOutdatedBanner: () => any;
78
77
  saveTitle: () => any;
78
+ selectConversation: (id: string) => any;
79
79
  "update:drawerOpen": (value: boolean) => any;
80
80
  "update:editTitle": (value: string) => any;
81
81
  "update:workspaceSheetOpen": (value: boolean) => any;
82
82
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
83
83
  onDelete?: (() => any) | undefined;
84
84
  onCancel?: (() => any) | undefined;
85
- onRename?: (() => any) | undefined;
86
- onDuplicate?: (() => any) | undefined;
87
- onExport?: (() => any) | undefined;
88
- onCopyLink?: (() => any) | undefined;
89
- onDebug?: (() => any) | undefined;
90
- onSelectConversation?: ((id: string) => any) | undefined;
91
85
  onSettings?: (() => any) | undefined;
92
86
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
93
87
  "onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
94
88
  "onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
89
+ onCopyLink?: (() => any) | undefined;
90
+ onRename?: (() => any) | undefined;
91
+ onDuplicate?: (() => any) | undefined;
92
+ onExport?: (() => any) | undefined;
93
+ onDebug?: (() => any) | undefined;
95
94
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
96
95
  onNewConversation?: ((groupId?: string | null | undefined) => any) | undefined;
97
96
  onSwitchWorkspace?: (() => any) | undefined;
@@ -99,6 +98,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
99
98
  onCancelEditing?: (() => any) | undefined;
100
99
  onDismissOutdatedBanner?: (() => any) | undefined;
101
100
  onSaveTitle?: (() => any) | undefined;
101
+ onSelectConversation?: ((id: string) => any) | undefined;
102
102
  "onUpdate:drawerOpen"?: ((value: boolean) => any) | undefined;
103
103
  "onUpdate:editTitle"?: ((value: string) => any) | undefined;
104
104
  "onUpdate:workspaceSheetOpen"?: ((value: boolean) => any) | undefined;
@@ -2,6 +2,7 @@ import { AGENT_API_V5_CONFIG_KEY, PRE_WAKE_CACHE_CONFIG_KEY, CONVERSATION_V2_CON
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";
5
+ import { logger } from "./logger.js";
5
6
  const CHAT_COMPAT_HEADERS = [
6
7
  "x-chat-workspace-id",
7
8
  "x-chat-tela-agent-id",
@@ -129,14 +130,63 @@ export function mapWorkspaceProxyPath(path) {
129
130
  export function prefixProxyPath(prefix, path) {
130
131
  return joinProxyPath(prefix, path);
131
132
  }
133
+ const PROXY_NETWORK_ERROR_CODES = /* @__PURE__ */ new Set([
134
+ "ECONNREFUSED",
135
+ "ECONNRESET",
136
+ "ETIMEDOUT",
137
+ "ENOTFOUND",
138
+ "EAI_AGAIN",
139
+ "EHOSTUNREACH",
140
+ "ENETUNREACH",
141
+ "UND_ERR_CONNECT_TIMEOUT",
142
+ "UND_ERR_HEADERS_TIMEOUT",
143
+ "UND_ERR_SOCKET",
144
+ "CERT_HAS_EXPIRED",
145
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
146
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
147
+ "ERR_TLS_CERT_ALTNAME_INVALID"
148
+ ]);
149
+ function networkErrorCodes(error) {
150
+ const codes = /* @__PURE__ */ new Set();
151
+ let current = error;
152
+ for (let depth = 0; depth < 6 && current instanceof Error; depth++) {
153
+ if ("code" in current && typeof current.code === "string" && PROXY_NETWORK_ERROR_CODES.has(current.code)) {
154
+ codes.add(current.code);
155
+ }
156
+ current = current.cause;
157
+ }
158
+ return [...codes];
159
+ }
132
160
  export async function proxyChatApiRequest(event, targetPath, options = {}) {
133
- return proxyRequest(event, buildTargetUrl(event, targetPath, options.apiVersion ?? "v1"), {
134
- fetchOptions: {
135
- redirect: "manual"
136
- },
137
- headers: buildProxyHeaders(event),
138
- streamRequest: true
139
- });
161
+ const targetUrl = buildTargetUrl(event, targetPath, options.apiVersion ?? "v1");
162
+ const headers = buildProxyHeaders(event);
163
+ try {
164
+ return await proxyRequest(event, targetUrl, {
165
+ fetchOptions: {
166
+ redirect: "manual"
167
+ },
168
+ headers,
169
+ streamRequest: true,
170
+ ...process.env.ENVIRONMENT === "staging" ? {
171
+ onResponse: (_event, response) => {
172
+ if (response.status >= 500) {
173
+ logger.error({
174
+ targetOrigin: new URL(targetUrl).origin,
175
+ upstreamStatus: response.status
176
+ }, "Chat API proxy upstream returned a server error");
177
+ }
178
+ }
179
+ } : {}
180
+ });
181
+ } catch (error) {
182
+ if (process.env.ENVIRONMENT === "staging") {
183
+ logger.error({
184
+ targetOrigin: new URL(targetUrl).origin,
185
+ networkErrorCodes: networkErrorCodes(error)
186
+ }, "Chat API proxy upstream request failed");
187
+ }
188
+ throw error;
189
+ }
140
190
  }
141
191
  export function defineChatApiProxyHandler(resolveTargetPath, options = {}) {
142
192
  return defineEventHandler((event) => {
@@ -56,6 +56,10 @@ export declare const telaAgentRunPayloadSchema: z.ZodObject<{
56
56
  vaultRef: z.ZodString;
57
57
  filename: z.ZodString;
58
58
  }, z.core.$strip>>>;
59
+ autoMappedFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
60
+ vaultRef: z.ZodString;
61
+ filename: z.ZodString;
62
+ }, z.core.$strip>>>;
59
63
  }, z.core.$catchall<z.ZodUnknown>>;
60
64
  export type TelaAgentRunPayload = z.infer<typeof telaAgentRunPayloadSchema>;
61
65
  export declare const telaAgentSkillSchema: z.ZodObject<{
@@ -32,6 +32,7 @@ export const telaAgentRunPayloadSchema = z.object({
32
32
  sessionId: z.string().optional(),
33
33
  inputSchema: z.array(telaAgentExecutionInputSchema).optional(),
34
34
  attachments: z.array(telaAgentAttachmentSchema).optional(),
35
+ autoMappedFiles: z.array(telaAgentAttachmentSchema).optional(),
35
36
  }).catchall(z.unknown());
36
37
  export const telaAgentSkillSchema = z.object({
37
38
  name: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.5.1-rc.0",
3
+ "version": "4.5.1-rc.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {