@meistrari/chat-nuxt 4.5.1-rc.5 → 4.5.1-rc.7

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.5",
4
+ "version": "4.5.1-rc.7",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -67,8 +67,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
67
67
  copyLink: () => any;
68
68
  debug: () => any;
69
69
  selectConversation: (id: string) => any;
70
- settings: () => any;
71
70
  send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
71
+ settings: () => any;
72
72
  tabChange: (tab: TopbarTab) => any;
73
73
  newConversation: (groupId?: string | null | undefined) => any;
74
74
  switchWorkspace: () => any;
@@ -88,8 +88,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
88
88
  onCopyLink?: (() => any) | undefined;
89
89
  onDebug?: (() => any) | undefined;
90
90
  onSelectConversation?: ((id: string) => any) | undefined;
91
- onSettings?: (() => any) | undefined;
92
91
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
92
+ onSettings?: (() => any) | undefined;
93
93
  "onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
94
94
  "onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
95
95
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
@@ -67,8 +67,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
67
67
  copyLink: () => any;
68
68
  debug: () => any;
69
69
  selectConversation: (id: string) => any;
70
- settings: () => any;
71
70
  send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
71
+ settings: () => any;
72
72
  tabChange: (tab: TopbarTab) => any;
73
73
  newConversation: (groupId?: string | null | undefined) => any;
74
74
  switchWorkspace: () => any;
@@ -88,8 +88,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
88
88
  onCopyLink?: (() => any) | undefined;
89
89
  onDebug?: (() => any) | undefined;
90
90
  onSelectConversation?: ((id: string) => any) | undefined;
91
- onSettings?: (() => any) | undefined;
92
91
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
92
+ onSettings?: (() => any) | undefined;
93
93
  "onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
94
94
  "onUpdate:selectedReasoningEffort"?: ((value: any) => any) | undefined;
95
95
  onTabChange?: ((tab: TopbarTab) => any) | undefined;
@@ -1,4 +1,6 @@
1
1
  import type { H3Event } from 'h3';
2
+ export declare function isEdgeHeader(name: string): boolean;
3
+ export declare const fetchWithoutEdgeHeaders: typeof fetch;
2
4
  export type ChatApiVersion = 'v1' | 'v2';
3
5
  export declare function resolveChatBasePath(basePath: string, apiVersion: ChatApiVersion): string;
4
6
  export declare function mapVaultProxyPath(path: string): string;
@@ -9,6 +9,26 @@ const CHAT_COMPAT_HEADERS = [
9
9
  "x-chat-tela-agent-branch",
10
10
  "x-chat-conversation-scope"
11
11
  ];
12
+ const EDGE_HEADER_PREFIXES = ["cf-", "x-forwarded-", "x-railway-", "x-envoy-"];
13
+ const EDGE_HEADERS = /* @__PURE__ */ new Set([
14
+ "cdn-loop",
15
+ "forwarded",
16
+ "true-client-ip",
17
+ "x-real-ip"
18
+ ]);
19
+ export function isEdgeHeader(name) {
20
+ const lowerName = name.toLowerCase();
21
+ return EDGE_HEADERS.has(lowerName) || EDGE_HEADER_PREFIXES.some((prefix) => lowerName.startsWith(prefix));
22
+ }
23
+ export const fetchWithoutEdgeHeaders = (input, init) => {
24
+ const headers = new Headers(init?.headers);
25
+ for (const name of [...headers.keys()]) {
26
+ if (isEdgeHeader(name)) {
27
+ headers.delete(name);
28
+ }
29
+ }
30
+ return fetch(input, { ...init, headers });
31
+ };
12
32
  function normalizeProxyPath(path) {
13
33
  const segments = path.split("/").map((segment) => segment.trim()).filter(Boolean);
14
34
  for (const segment of segments) {
@@ -162,6 +182,7 @@ export async function proxyChatApiRequest(event, targetPath, options = {}) {
162
182
  const headers = buildProxyHeaders(event);
163
183
  try {
164
184
  return await proxyRequest(event, targetUrl, {
185
+ fetch: fetchWithoutEdgeHeaders,
165
186
  fetchOptions: {
166
187
  redirect: "manual"
167
188
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.5.1-rc.5",
3
+ "version": "4.5.1-rc.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {