@meistrari/chat-nuxt 4.5.0-rc.1 → 4.5.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/README.md
CHANGED
|
@@ -88,7 +88,7 @@ Declared in `src/runtime/embed/types.ts`; prop, feature-flag, and event payload
|
|
|
88
88
|
| `initialConversationId` | `string \| null` | `null` | Conversation to open once on mount when `conversationId` is uncontrolled |
|
|
89
89
|
| `conversationScope` | `string \| null` | `null` | Isolate conversation history by technical scope within the current workspace and runtime. Scoped embeds only see same-scope conversations; values are trimmed, blank becomes `null`, and the server accepts 1-200 chars from `A-Z`, `a-z`, `0-9`, `.`, `_`, `:`, `/`, `-` |
|
|
90
90
|
| `defaultConversationCreatorFilter` | `'all' \| 'mine'` | `'all'` | Initial sidebar creator filter: every conversation in scope, or only the current user's |
|
|
91
|
-
| `availableModels` | `AvailableChatModels` | Workspace catalog | Optional
|
|
91
|
+
| `availableModels` | `AvailableChatModels` | Workspace catalog | Optional ordered subset of models for the active workspace. With the served catalog (lightweight harness), ids the catalog does not offer as available are dropped, and the full catalog is used when none remain; otherwise unknown ids fail at runtime. A restored unavailable selection stays visible and blocked until the user chooses an available model |
|
|
92
92
|
| `defaultModel` | `ChatModel` | Package default | Initial model for untouched drafts. Explicit selections and existing conversations take precedence; `availableModels` still limits the selection |
|
|
93
93
|
| `defaultReasoningEffort` | `ChatReasoningEffort` | Automatic (`null`) | Initial reasoning effort for untouched drafts. Explicit user choices (including automatic) take precedence |
|
|
94
94
|
| `conversationCreatorFilter` | `'all' \| 'mine'` | — | Controlled sidebar creator filter; use with `v-model:conversation-creator-filter` when the host changes it at runtime |
|
package/dist/module.json
CHANGED
|
@@ -14,7 +14,7 @@ export function useChatModelCatalog() {
|
|
|
14
14
|
const catalogKey = computed(
|
|
15
15
|
() => chatApi.withChatHeaders().headers?.["x-chat-workspace-id"] ?? "__default__"
|
|
16
16
|
);
|
|
17
|
-
const models = computed(() => catalogs.value[catalogKey.value] ?? []);
|
|
17
|
+
const models = computed(() => (catalogs.value[catalogKey.value] ?? []).filter((model) => model.status === "available"));
|
|
18
18
|
const isLoaded = computed(() => loadedCatalogs.value[catalogKey.value] ?? false);
|
|
19
19
|
const isLoading = computed(() => loadingCatalogs.value[catalogKey.value] ?? false);
|
|
20
20
|
const defaultModel = computed(
|
|
@@ -7,13 +7,16 @@ export function resolveAvailableChatModels(availableModels, catalogModels) {
|
|
|
7
7
|
throw new Error("Agent API model catalog must contain at least one model");
|
|
8
8
|
if (availableModels === void 0)
|
|
9
9
|
return [...new Set(catalog)];
|
|
10
|
+
if (catalogModels) {
|
|
11
|
+
const offeredModels = [...new Set(availableModels.filter((model) => catalog.includes(model)))];
|
|
12
|
+
return offeredModels.length ? offeredModels : [...new Set(catalog)];
|
|
13
|
+
}
|
|
10
14
|
if (availableModels.length === 0)
|
|
11
15
|
throw new Error("availableModels must contain at least one model");
|
|
12
16
|
const uniqueModels = [];
|
|
13
17
|
for (const model of availableModels) {
|
|
14
|
-
if (!catalog.includes(model))
|
|
15
|
-
throw new Error(
|
|
16
|
-
}
|
|
18
|
+
if (!catalog.includes(model))
|
|
19
|
+
throw new Error(`${model} is not a supported chat model`);
|
|
17
20
|
if (!uniqueModels.includes(model))
|
|
18
21
|
uniqueModels.push(model);
|
|
19
22
|
}
|