@meistrari/chat-nuxt 3.17.0-rc.1 → 3.17.0-rc.3

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/README.md CHANGED
@@ -59,6 +59,7 @@ Declared in `src/runtime/embed/types.ts`; prop, feature-flag, and event payload
59
59
  | `conversationCreatorFilter` | `'all' \| 'mine'` | — | Controlled sidebar creator filter; use with `v-model:conversation-creator-filter` when the host changes it at runtime |
60
60
  | `hideConversationCreatorFilter` | `boolean` | `false` | Hide the creator selector without changing the active filter |
61
61
  | `telaAgentId` | `string` | — | Use Tela agent mode for this embed |
62
+ | `telaAgentBranch` | `string` | Published version | Repository branch to use for new agent sessions |
62
63
  | `telaAgentInputs` | `TelaAgentExecutionInput[] \| null` | `undefined` | Inputs sent with each Tela agent run; hides the variables panel when non-null |
63
64
  | `workspaceSettings` | `WorkspaceSettings \| null` | `null` | Override settings from host app; not accepted in Tela agent mode |
64
65
  | `user` | `ChatActor \| null` | `null` | Override current user display info; not accepted in Tela agent mode |
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "3.17.0-rc.1",
4
+ "version": "3.17.0-rc.3",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -3,10 +3,6 @@ const props = defineProps({
3
3
  citation: { type: Object, required: true }
4
4
  });
5
5
  const faviconFailed = ref(false);
6
- const shouldLoadFavicon = ref(false);
7
- function activatePreviewAssets() {
8
- shouldLoadFavicon.value = true;
9
- }
10
6
  const accessibleLabel = computed(() => `${props.citation.sourceLabel}: ${props.citation.title}`);
11
7
  </script>
12
8
 
@@ -25,13 +21,12 @@ const accessibleLabel = computed(() => `${props.citation.sourceLabel}: ${props.c
25
21
  class="url-citation-pill"
26
22
  body-11-medium
27
23
  :aria-label="accessibleLabel"
28
- @pointerenter="activatePreviewAssets"
29
- @focus="activatePreviewAssets"
30
24
  >
31
25
  <img
32
- v-if="shouldLoadFavicon && !faviconFailed"
26
+ v-if="!faviconFailed"
33
27
  :src="citation.faviconUrl"
34
28
  alt=""
29
+ loading="lazy"
35
30
  class="url-citation-favicon"
36
31
  referrerpolicy="no-referrer"
37
32
  @error="faviconFailed = true"
@@ -44,7 +39,7 @@ const accessibleLabel = computed(() => `${props.citation.sourceLabel}: ${props.c
44
39
  <div class="url-citation-card" bg-white flex="~ col" gap-10px p-12px>
45
40
  <div flex items-center gap-7px min-w-0>
46
41
  <img
47
- v-if="shouldLoadFavicon && !faviconFailed"
42
+ v-if="!faviconFailed"
48
43
  :src="citation.faviconUrl"
49
44
  alt=""
50
45
  class="url-citation-card__favicon"
@@ -1,14 +1,12 @@
1
+ import { getDomainWithoutSuffix } from "tldts";
1
2
  const URL_CITATION_MARKER = "#citation";
2
3
  const FAVICON_PROXY_PATH = "/api/citation-favicon";
3
4
  function titleCase(value) {
4
5
  return value.replace(/[-_]+/g, " ").replace(/\b\p{L}/gu, (letter) => letter.toLocaleUpperCase());
5
6
  }
6
7
  function sourceLabelFor(hostname) {
7
- const parts = hostname.replace(/^www\./i, "").split(".");
8
- const compoundSuffix = parts.slice(-2).join(".");
9
- const suffixParts = (/* @__PURE__ */ new Set(["co.uk", "com.au", "com.br", "com.mx", "com.tr", "co.jp"])).has(compoundSuffix) ? 2 : 1;
10
- const brandIndex = Math.max(0, parts.length - suffixParts - 1);
11
- return titleCase(parts[brandIndex] || hostname);
8
+ const domainLabel = getDomainWithoutSuffix(hostname, { allowPrivateDomains: true });
9
+ return titleCase(domainLabel || hostname);
12
10
  }
13
11
  export function parseUrlCitation(href, label, markdownTitle) {
14
12
  if (!href.endsWith(URL_CITATION_MARKER))
@@ -9,6 +9,7 @@ import { provideEmbedConfig, useEmbedConfig } from "../composables/embed-config"
9
9
  import { normalizeConversationScope, normalizeTelaAgentId, resolveConversationScopeKeySegment } from "../../conversations/scope";
10
10
  import ChatEmbedInner from "./chat-embed-inner.vue";
11
11
  const props = defineProps({
12
+ telaAgentBranch: { type: [String, null], required: false },
12
13
  conversationId: { type: [String, null], required: false },
13
14
  conversationEvents: { type: [Array, null], required: false },
14
15
  composerDisabled: { type: Boolean, required: false },
@@ -44,6 +45,7 @@ const parentEmbedConfig = useEmbedConfig();
44
45
  const { activeOrganization } = useChatAuth();
45
46
  const workspaceId = computed(() => activeOrganization.value?.id?.trim() ?? "");
46
47
  const normalizedTelaAgentId = computed(() => normalizeTelaAgentId(props.telaAgentId));
48
+ const telaAgentBranch = computed(() => props.telaAgentBranch?.trim() || null);
47
49
  const normalizedConversationScope = computed(() => normalizeConversationScope(props.conversationScope));
48
50
  const hideSettings = computed(() => props.hideSettings ?? false);
49
51
  const ignoredPropsWarningKey = ref(null);
@@ -74,6 +76,7 @@ provideEmbedConfig({
74
76
  provideChatRequestContext({
75
77
  workspaceId,
76
78
  telaAgentId: normalizedTelaAgentId,
79
+ telaAgentBranch,
77
80
  conversationScope: normalizedConversationScope
78
81
  }, { syncGlobal: !parentEmbedConfig });
79
82
  if (import.meta.dev) {
@@ -109,7 +112,7 @@ provideChatMessageTerminal((payload) => {
109
112
  <template>
110
113
  <ChatEmbedInner
111
114
  v-if="workspaceId"
112
- :key="`${workspaceId}:${normalizedTelaAgentId ?? 'default-chat'}:scope:${resolveConversationScopeKeySegment(normalizedConversationScope)}`"
115
+ :key="`${workspaceId}:${normalizedTelaAgentId ?? 'default-chat'}:branch:${telaAgentBranch ?? ''}:scope:${resolveConversationScopeKeySegment(normalizedConversationScope)}`"
113
116
  :conversation-id="conversationId"
114
117
  :conversation-events="conversationEvents"
115
118
  :composer-disabled="composerDisabled"
@@ -2,6 +2,7 @@
2
2
  import { computed, ref, watch } from "vue";
3
3
  import { provideConversationCreatorFilterState } from "../../conversations/composables/conversation-creator-filter-state";
4
4
  const { hideSidebar = void 0, ...props } = defineProps({
5
+ telaAgentBranch: { type: [String, null], required: false },
5
6
  conversationId: { type: [String, null], required: false },
6
7
  conversationEvents: { type: [Array, null], required: false },
7
8
  composerDisabled: { type: Boolean, required: false },
@@ -61,6 +62,7 @@ function startWidgetConversation() {
61
62
  handleWidgetConversationIdChange(null);
62
63
  }
63
64
  const sharedEmbedProps = computed(() => ({
65
+ telaAgentBranch: props.telaAgentBranch,
64
66
  conversationId: props.conversationId,
65
67
  conversationEvents: props.conversationEvents,
66
68
  composerDisabled: props.composerDisabled,
@@ -41,6 +41,8 @@ export type ChatSidebarConfig = {
41
41
  defaultCollapsed?: boolean;
42
42
  };
43
43
  export type ChatEmbedSharedProps = {
44
+ /** Optional repository branch for new agent sessions. Omit to use the published version. */
45
+ telaAgentBranch?: string | null;
44
46
  /** Controlled conversation id. Use with `v-model:conversation-id` when the host owns active conversation state. */
45
47
  conversationId?: string | null;
46
48
  /** Controlled audit events rendered chronologically between conversation messages. */
@@ -5,6 +5,7 @@ import { resolveAuthToken } from "./auth-token.js";
5
5
  const CHAT_COMPAT_HEADERS = [
6
6
  "x-chat-workspace-id",
7
7
  "x-chat-tela-agent-id",
8
+ "x-chat-tela-agent-branch",
8
9
  "x-chat-conversation-scope"
9
10
  ];
10
11
  function normalizeProxyPath(path) {
@@ -15,6 +15,10 @@ export function useChatApi() {
15
15
  if (telaAgentId) {
16
16
  mergedHeaders["x-chat-tela-agent-id"] = telaAgentId;
17
17
  }
18
+ const telaAgentBranch = requestContext?.telaAgentBranch?.value?.trim();
19
+ if (telaAgentBranch) {
20
+ mergedHeaders["x-chat-tela-agent-branch"] = telaAgentBranch;
21
+ }
18
22
  const conversationScope = requestContext?.conversationScope.value?.trim();
19
23
  if (conversationScope) {
20
24
  mergedHeaders["x-chat-conversation-scope"] = conversationScope;
@@ -2,11 +2,13 @@ import type { MaybeRefOrGetter, Ref } from 'vue';
2
2
  export type ChatRequestContext = {
3
3
  workspaceId: Ref<string>;
4
4
  telaAgentId: Ref<string | null>;
5
+ telaAgentBranch: Ref<string | null>;
5
6
  conversationScope: Ref<string | null>;
6
7
  };
7
8
  type ChatRequestContextInput = {
8
9
  workspaceId: MaybeRefOrGetter<string | null | undefined>;
9
10
  telaAgentId?: MaybeRefOrGetter<string | null | undefined>;
11
+ telaAgentBranch?: MaybeRefOrGetter<string | null | undefined>;
10
12
  conversationScope?: MaybeRefOrGetter<string | null | undefined>;
11
13
  };
12
14
  type ProvideChatRequestContextOptions = {
@@ -8,6 +8,7 @@ function useGlobalChatRequestContextState() {
8
8
  provided: useState("chat-request-context-provided", () => false),
9
9
  workspaceId: useState("chat-request-context-workspace-id", () => ""),
10
10
  telaAgentId: useState("chat-request-context-tela-agent-id", () => null),
11
+ telaAgentBranch: useState("chat-request-context-tela-agent-branch", () => null),
11
12
  conversationScope: useState("chat-request-context-conversation-scope", () => null)
12
13
  };
13
14
  }
@@ -15,6 +16,7 @@ export function provideChatRequestContext(input, options = {}) {
15
16
  const context = {
16
17
  workspaceId: computed(() => normalizeOptionalHeaderValue(toValue(input.workspaceId)) ?? ""),
17
18
  telaAgentId: computed(() => normalizeOptionalHeaderValue(toValue(input.telaAgentId))),
19
+ telaAgentBranch: computed(() => normalizeOptionalHeaderValue(toValue(input.telaAgentBranch))),
18
20
  conversationScope: computed(() => normalizeOptionalHeaderValue(toValue(input.conversationScope)))
19
21
  };
20
22
  const globalContext = useGlobalChatRequestContextState();
@@ -23,6 +25,7 @@ export function provideChatRequestContext(input, options = {}) {
23
25
  globalContext.provided.value = true;
24
26
  globalContext.workspaceId.value = context.workspaceId.value;
25
27
  globalContext.telaAgentId.value = context.telaAgentId.value;
28
+ globalContext.telaAgentBranch.value = context.telaAgentBranch.value;
26
29
  globalContext.conversationScope.value = context.conversationScope.value;
27
30
  });
28
31
  }
@@ -38,6 +41,7 @@ export function useChatRequestContext() {
38
41
  return {
39
42
  workspaceId: computed(() => globalContext.workspaceId.value),
40
43
  telaAgentId: computed(() => globalContext.telaAgentId.value),
44
+ telaAgentBranch: computed(() => globalContext.telaAgentBranch.value),
41
45
  conversationScope: computed(() => globalContext.conversationScope.value)
42
46
  };
43
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "3.17.0-rc.1",
3
+ "version": "3.17.0-rc.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -58,6 +58,7 @@
58
58
  "pdfjs-dist": "^5.4.530",
59
59
  "posthog-js": "^1.364.2",
60
60
  "stream-diffs": "0.0.2",
61
+ "tldts": "^7.4.10",
61
62
  "virtua": "^0.42.0",
62
63
  "vue-i18n": "^11.0.0",
63
64
  "xlsx": "^0.18.5",