Browse Source
- Added adminOnly field to CreateAgentToolInput and UpdateAgentToolInput interfaces. - Updated API endpoints to handle adminOnly field in agent tools. - Modified getEnabledToolInfos and getEnabledToolsForLlm functions to filter tools based on user role. - Enhanced the chat tools API to retrieve enabled tools considering user roles. - Updated migration journal to include new patch for adminOnly feature.feat/ai-sdk-v6-upgrade
18 changed files with 3669 additions and 1675 deletions
@ -0,0 +1,41 @@ |
|||
<script setup lang="ts"> |
|||
definePageMeta({ |
|||
layout: 'home', |
|||
}) |
|||
</script> |
|||
|
|||
<template> |
|||
<div class="home-empty"> |
|||
<BoContainer> |
|||
<div class="empty-content"> |
|||
<h1 class="welcome-title">Dash</h1> |
|||
<p class="welcome-subtitle">欢迎来到 Dash</p> |
|||
</div> |
|||
</BoContainer> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped> |
|||
.home-empty { |
|||
min-height: 60vh; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.empty-content { |
|||
text-align: center; |
|||
} |
|||
|
|||
.welcome-title { |
|||
font-size: 3rem; |
|||
font-weight: 700; |
|||
margin: 0; |
|||
} |
|||
|
|||
.welcome-subtitle { |
|||
font-size: 1.125rem; |
|||
color: var(--text-secondary, #666); |
|||
margin-top: 0.5rem; |
|||
} |
|||
</style> |
|||
Binary file not shown.
@ -0,0 +1 @@ |
|||
ALTER TABLE `agent_tools` ADD `admin_only` integer DEFAULT 0 NOT NULL; |
|||
File diff suppressed because it is too large
@ -1,6 +1,8 @@ |
|||
import { getCurrentUser } from "#server/utils/context"; |
|||
import { getEnabledToolInfos } from "#server/service/agent-tool"; |
|||
|
|||
export default defineWrappedResponseHandler(async () => { |
|||
const result = await getEnabledToolInfos(); |
|||
export default defineWrappedResponseHandler(async (event) => { |
|||
const user = await getCurrentUser(event); |
|||
const result = await getEnabledToolInfos(user?.role ?? null); |
|||
return R.success(result); |
|||
}); |
|||
|
|||
Loading…
Reference in new issue