@meistrari/chat-nuxt 3.14.0-rc.0 → 3.14.0-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.d.mts +7 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -1
- package/dist/runtime/embed/components/chat-embed-inner.vue +1 -0
- package/dist/runtime/server/utils/chat-api-proxy.js +7 -3
- package/dist/runtime/types/schemas/chat/chat-config.d.ts +1 -0
- package/dist/runtime/types/schemas/chat/chat-config.js +1 -0
- package/package.json +1 -1
package/dist/module.d.mts
CHANGED
|
@@ -27,6 +27,13 @@ interface ChatNuxtModuleOptions {
|
|
|
27
27
|
* `@meistrari/auth-nuxt`.
|
|
28
28
|
*/
|
|
29
29
|
authTokenCookie?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Opt this deployment into secretless agent execution: the server proxy
|
|
32
|
+
* adds `"secretless-execution": true` to the `x-chat-config` header sent
|
|
33
|
+
* to the chat-api. Defaults to `false`; also settable per environment via
|
|
34
|
+
* `NUXT_CHAT_NUXT_SECRETLESS_EXECUTION`.
|
|
35
|
+
*/
|
|
36
|
+
secretlessExecution?: boolean;
|
|
30
37
|
}
|
|
31
38
|
declare const _default: any;
|
|
32
39
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -444,7 +444,10 @@ const module$1 = defineNuxtModule({
|
|
|
444
444
|
chatApiUrl: existingChatNuxtRuntimeConfig?.chatApiUrl || rc.chatApiUrl,
|
|
445
445
|
source: options.source || existingChatNuxtRuntimeConfig?.source,
|
|
446
446
|
clientVersion: _chatNuxtPackageVersion,
|
|
447
|
-
authTokenCookie: hostAuthComposablePath ? options.authTokenCookie || existingChatNuxtRuntimeConfig?.authTokenCookie : void 0
|
|
447
|
+
authTokenCookie: hostAuthComposablePath ? options.authTokenCookie || existingChatNuxtRuntimeConfig?.authTokenCookie : void 0,
|
|
448
|
+
// Explicit boolean default keeps the key in runtime config so the
|
|
449
|
+
// NUXT_CHAT_NUXT_SECRETLESS_EXECUTION env override can apply.
|
|
450
|
+
secretlessExecution: options.secretlessExecution ?? existingChatNuxtRuntimeConfig?.secretlessExecution ?? false
|
|
448
451
|
};
|
|
449
452
|
if (hostAuthComposablePath && !rc.chatNuxt.authTokenCookie) {
|
|
450
453
|
console.warn(
|
|
@@ -6,6 +6,7 @@ import { exportConversationToMarkdown } from "../../conversations/export";
|
|
|
6
6
|
import { CHAT_MOBILE_BREAKPOINT } from "../../shared/breakpoints";
|
|
7
7
|
import ChatMobileFilePreview from "./mobile/chat-mobile-file-preview.vue";
|
|
8
8
|
import ChatMobileShell from "./mobile/chat-mobile-shell.vue";
|
|
9
|
+
import ChatMessageInput from "../../messages/components/chat-message-input.vue";
|
|
9
10
|
import { normalizeConversationId } from "../../conversations/scope";
|
|
10
11
|
import { resolveChatFeatures } from "../feature-config";
|
|
11
12
|
import { resolveConversationCreator } from "../../conversations/creator";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PREPARED_AGENT_RUNTIME_CONFIG_KEY } from "../../types/schemas/chat/chat-config.js";
|
|
1
|
+
import { PREPARED_AGENT_RUNTIME_CONFIG_KEY, SECRETLESS_EXECUTION_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";
|
|
@@ -58,12 +58,16 @@ function buildProxyHeaders(event) {
|
|
|
58
58
|
statusMessage: "Authentication token is required"
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
+
const config = useRuntimeConfig(event);
|
|
62
|
+
const chatConfig = { [PREPARED_AGENT_RUNTIME_CONFIG_KEY]: true };
|
|
63
|
+
if (config.chatNuxt?.secretlessExecution) {
|
|
64
|
+
chatConfig[SECRETLESS_EXECUTION_CONFIG_KEY] = true;
|
|
65
|
+
}
|
|
61
66
|
const headers = {
|
|
62
67
|
"authorization": `Bearer ${token}`,
|
|
63
68
|
"x-chat-client": "chat-nuxt",
|
|
64
|
-
"x-chat-config": JSON.stringify(
|
|
69
|
+
"x-chat-config": JSON.stringify(chatConfig)
|
|
65
70
|
};
|
|
66
|
-
const config = useRuntimeConfig(event);
|
|
67
71
|
if (config.chatNuxt?.clientVersion) {
|
|
68
72
|
headers["x-chat-client-version"] = config.chatNuxt.clientVersion;
|
|
69
73
|
}
|