From de590c403146253acd308ce78162c565dcc636e5 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Wed, 29 Apr 2026 07:55:29 +0800 Subject: [PATCH] feat: add Computer Use step to onboarding wizard (sync with master) --- .../i18n/locales/en-US/features/welcome.json | 11 +++ .../i18n/locales/ru-RU/features/welcome.json | 11 +++ .../i18n/locales/zh-CN/features/welcome.json | 11 +++ dashboard/src/views/WelcomePage.vue | 76 +++++++++++++++++++ 4 files changed, 109 insertions(+) diff --git a/dashboard/src/i18n/locales/en-US/features/welcome.json b/dashboard/src/i18n/locales/en-US/features/welcome.json index 6f5a8f00d..d39f6dfbb 100644 --- a/dashboard/src/i18n/locales/en-US/features/welcome.json +++ b/dashboard/src/i18n/locales/en-US/features/welcome.json @@ -18,7 +18,18 @@ "step1Desc": "Connect AstrBot to IM platforms like QQ, Lark, Slack, Telegram, etc.", "step2Title": "Configure AI Model", "step2Desc": "Configure AI models for AstrBot.", + "step3Title": "Allow Agent to Use Computer", + "step3Desc": "Set whether the agent can access and use the current computer.", + "step3HelpTitle": "Allow Agent to Use Computer", + "step3HelpItem1": "The agent will be able to access workspace directories (each user's workspace is isolated) and use Skills to perform more complex tasks.", + "step3HelpItem2": "For AstrBot administrators, the agent is additionally allowed to execute Shell commands, Python code, and access all local directories.", + "step3HelpItem3": "For more granular permission and capability configuration, go to Config File -> General Config -> Computer Use to continue.", + "step3HelpClose": "Close", + "step3SelectLabel": "Computer Access", + "step3Allow": "Allow", + "step3Deny": "Deny", "configure": "Configure", + "save": "Save", "skip": "Skip", "pending": "Pending", "completed": "Completed", diff --git a/dashboard/src/i18n/locales/ru-RU/features/welcome.json b/dashboard/src/i18n/locales/ru-RU/features/welcome.json index 166522401..0d6d6287c 100644 --- a/dashboard/src/i18n/locales/ru-RU/features/welcome.json +++ b/dashboard/src/i18n/locales/ru-RU/features/welcome.json @@ -16,7 +16,18 @@ "step1Desc": "Подключите AstrBot к QQ, Lark, WeChat, Telegram и другим мессенджерам.", "step2Title": "Настройка AI моделей", "step2Desc": "Выберите и настройте AI провайдеров для AstrBot.", + "step3Title": "Разрешить агенту использовать компьютер", + "step3Desc": "Установите, может ли агент получать доступ к текущему компьютеру и использовать его.", + "step3HelpTitle": "Разрешить агенту использовать компьютер", + "step3HelpItem1": "Агент сможет получать доступ к рабочим каталогам и использовать Skills для выполнения более сложных задач.", + "step3HelpItem2": "Для администраторов AstrBot агенту дополнительно разрешается выполнять Shell-команды, Python-код и получать доступ ко всем локальным каталогам.", + "step3HelpItem3": "Для более детальной настройки прав и возможностей перейдите в Файл конфигурации -> Общая конфигурация -> Использование компьютера.", + "step3HelpClose": "Закрыть", + "step3SelectLabel": "Доступ к компьютеру", + "step3Allow": "Разрешить", + "step3Deny": "Запретить", "configure": "Настроить", + "save": "Сохранить", "skip": "Пропустить", "pending": "Ожидает", "completed": "Готово", diff --git a/dashboard/src/i18n/locales/zh-CN/features/welcome.json b/dashboard/src/i18n/locales/zh-CN/features/welcome.json index 7ddac7d25..8e3095132 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/welcome.json +++ b/dashboard/src/i18n/locales/zh-CN/features/welcome.json @@ -18,7 +18,18 @@ "step1Desc": "将 AstrBot 连接到 QQ、飞书、企业微信、Telegram 等 IM 平台。", "step2Title": "配置 AI 模型", "step2Desc": "为 AstrBot 配置 AI 模型。", + "step3Title": "允许 Agent 使用电脑", + "step3Desc": "设置 Agent 是否可以访问和使用当前电脑。", + "step3HelpTitle": "允许 Agent 使用电脑", + "step3HelpItem1": "Agent 将可以访问和使用工作区目录(每个用户的工作区目录相互独立)以及 Skills 来执行更多复杂任务。", + "step3HelpItem2": "对于 AstrBot 管理员,会额外允许 Agent 执行 Shell 命令、Python 代码,以及访问本机的所有目录。", + "step3HelpItem3": "如需更多细化权限与能力配置,可前往 配置文件 -> 普通配置 -> 使用电脑能力 继续设置。", + "step3HelpClose": "关闭", + "step3SelectLabel": "电脑访问权限", + "step3Allow": "允许", + "step3Deny": "不允许", "configure": "去配置", + "save": "保存", "skip": "跳过", "pending": "待处理", "completed": "已完成", diff --git a/dashboard/src/views/WelcomePage.vue b/dashboard/src/views/WelcomePage.vue index 6ca2f7b9f..89b5a6811 100644 --- a/dashboard/src/views/WelcomePage.vue +++ b/dashboard/src/views/WelcomePage.vue @@ -171,11 +171,81 @@ + + +
+
+
+ {{ tm("onboard.step3Title") }} +
+ + ? + +
+

+ {{ tm("onboard.step3Desc") }} +

+
+ +
+
+
+ + + + {{ tm("onboard.step3HelpTitle") }} + + +
    +
  1. {{ tm("onboard.step3HelpItem1") }}
  2. +
  3. {{ tm("onboard.step3HelpItem2") }}
  4. +
  5. {{ tm("onboard.step3HelpItem3") }}
  6. +
+
+ + + + {{ tm("onboard.step3HelpClose") }} + + +
+
+ @@ -316,6 +386,7 @@ interface ApiError { } type StepState = "pending" | "completed" | "skipped"; +type ComputerAccessRuntime = "local" | "none"; const { tm } = useModuleI18n("features/welcome"); const { locale, t } = useI18n(); @@ -337,6 +408,11 @@ const apiBaseUrl = ref(apiStore.apiBaseUrl || "http://127.0.0.1:6185"); const platformStepState = ref("pending"); const providerStepState = ref("pending"); +const showComputerAccessHelpDialog = ref(false); +const computerAccessStepState = ref("pending"); +const computerAccessRuntime = ref("none"); +const savedComputerAccessRuntime = ref("none"); +const savingComputerAccess = ref(false); const welcomeAnnouncementRaw = ref(null); function resolveWelcomeAnnouncement(raw: unknown, currentLocale: string) {