refac
This commit is contained in:
1 parent
db802e28d3
commit
951f96021a
4 files changed
+21
-6
No files matched your search
@@ -2358,7 +2358,8 @@ async def list_knowledge(
|
|||||||
) -> str:
|
) -> str:
|
||||||
"""
|
"""
|
||||||
List knowledge bases, files, and notes attached to the current model.
|
List knowledge bases, files, and notes attached to the current model.
|
||||||
Use this first to discover what knowledge is available before querying or reading files.
|
This is an inventory tool only; for questions that require content from
|
||||||
|
knowledge files, call query_knowledge_files instead.
|
||||||
Without knowledge_id: returns KB summaries (name, description, file_count)
|
Without knowledge_id: returns KB summaries (name, description, file_count)
|
||||||
plus standalone files and notes — no file listing inside KBs.
|
plus standalone files and notes — no file listing inside KBs.
|
||||||
With knowledge_id: includes paginated file listing for that specific KB.
|
With knowledge_id: includes paginated file listing for that specific KB.
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { onMount, getContext } from 'svelte';
|
import { onMount, getContext } from 'svelte';
|
||||||
import {
|
import {
|
||||||
WEBUI_NAME,
|
WEBUI_NAME,
|
||||||
|
config,
|
||||||
showSidebar,
|
showSidebar,
|
||||||
functions,
|
functions,
|
||||||
user,
|
user,
|
||||||
@@ -33,7 +34,10 @@
|
|||||||
!$user?.permissions?.workspace?.prompts
|
!$user?.permissions?.workspace?.prompts
|
||||||
) {
|
) {
|
||||||
goto('/');
|
goto('/');
|
||||||
} else if ($page.url.pathname.includes('/tools') && !$user?.permissions?.workspace?.tools) {
|
} else if (
|
||||||
|
$page.url.pathname.includes('/tools') &&
|
||||||
|
(!$config?.features?.enable_plugins || !$user?.permissions?.workspace?.tools)
|
||||||
|
) {
|
||||||
goto('/');
|
goto('/');
|
||||||
} else if ($page.url.pathname.includes('/skills') && !$user?.permissions?.workspace?.skills) {
|
} else if ($page.url.pathname.includes('/skills') && !$user?.permissions?.workspace?.skills) {
|
||||||
goto('/');
|
goto('/');
|
||||||
@@ -132,7 +136,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $user?.role === 'admin' || $user?.permissions?.workspace?.tools}
|
{#if $config?.features?.enable_plugins && ($user?.role === 'admin' || $user?.permissions?.workspace?.tools)}
|
||||||
<a
|
<a
|
||||||
draggable="false"
|
draggable="false"
|
||||||
aria-current={$page.url.pathname.includes('/workspace/tools') ? 'page' : null}
|
aria-current={$page.url.pathname.includes('/workspace/tools') ? 'page' : null}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { user } from '$lib/stores';
|
import { config, user } from '$lib/stores';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
goto('/workspace/knowledge');
|
goto('/workspace/knowledge');
|
||||||
} else if ($user?.permissions?.workspace?.prompts) {
|
} else if ($user?.permissions?.workspace?.prompts) {
|
||||||
goto('/workspace/prompts');
|
goto('/workspace/prompts');
|
||||||
} else if ($user?.permissions?.workspace?.tools) {
|
} else if ($config?.features?.enable_plugins && $user?.permissions?.workspace?.tools) {
|
||||||
goto('/workspace/tools');
|
goto('/workspace/tools');
|
||||||
} else if ($user?.permissions?.workspace?.skills) {
|
} else if ($user?.permissions?.workspace?.skills) {
|
||||||
goto('/workspace/skills');
|
goto('/workspace/skills');
|
||||||
|
|||||||
@@ -1,7 +1,17 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
import { goto } from '$app/navigation';
|
||||||
|
import { config } from '$lib/stores';
|
||||||
|
|
||||||
import Tools from '$lib/components/workspace/Tools.svelte';
|
import Tools from '$lib/components/workspace/Tools.svelte';
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
if (!$config?.features?.enable_plugins) {
|
||||||
|
goto('/workspace');
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Tools />
|
{#if $config?.features?.enable_plugins}
|
||||||
|
<Tools />
|
||||||
|
{/if}
|
||||||
Reference in new issue
Block a user