From 2783d9cab8d0dcfb41af9384266095c2e624b3f1 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Tue, 1 Sep 2026 20:04:15 +0800 Subject: [PATCH] fix(skills): count GitHub skill subtrees and polish catalog install UI Large GitHub skill folders were rejected because the installer counted the whole repo zip. Count only the SKILL.md subtree, raise the file cap, and hide uninstall while install is running. --- .env.example | 2 +- .../components/SandboxSkillsPanel.test.mjs | 9 +- .../src/components/SandboxSkillsPanel.vue | 350 +++++++++++++----- frontend/src/i18n/locales/en-US.ts | 16 +- frontend/src/i18n/locales/ko-KR.ts | 16 +- frontend/src/i18n/locales/ru-RU.ts | 16 +- frontend/src/i18n/locales/zh-CN.ts | 16 +- .../src/views/settings/SkillSettings.test.mjs | 14 + frontend/src/views/settings/SkillSettings.vue | 144 ++++--- internal/agent/skills/tenant_source.go | 4 +- .../service/tenant_skill_bundle.go | 93 +++-- .../service/tenant_skill_bundle_test.go | 47 +++ 12 files changed, 534 insertions(+), 193 deletions(-) diff --git a/.env.example b/.env.example index 408d897a..a152d401 100644 --- a/.env.example +++ b/.env.example @@ -185,7 +185,7 @@ STORAGE_TYPE=local LOCAL_STORAGE_BASE_DIR=/data/files # 本地存储路径前缀(legacy 回填用,一般留空)。 # LOCAL_STORAGE_PATH_PREFIX= -# 统一文件大小限制(MB,默认 50)。影响单文件上传、docreader gRPC 消息、frontend Nginx请求体、浏览器客户端校验。属部署期配置:Go/Nginx/docreader/浏览器四层启动时读一次,运行中改不生效,改后须同步重启四层。 +# 统一文件大小限制(MB,默认 50)。影响单文件上传、技能 zip / 来源下载、docreader gRPC 消息、frontend Nginx 请求体、浏览器客户端校验。属部署期配置:Go/Nginx/docreader/浏览器四层启动时读一次,运行中改不生效,改后须同步重启四层。 # MAX_FILE_SIZE_MB=50 # ========== B4. 对象存储 provider(按 STORAGE_TYPE 选其一)========== diff --git a/frontend/src/components/SandboxSkillsPanel.test.mjs b/frontend/src/components/SandboxSkillsPanel.test.mjs index 0453746a..839e9f88 100644 --- a/frontend/src/components/SandboxSkillsPanel.test.mjs +++ b/frontend/src/components/SandboxSkillsPanel.test.mjs @@ -14,8 +14,13 @@ test('focused skill management expands env vars and transcript without a mid-pag assert.match(source, /isBusy\(skill\) \|\| !hasEnvEdits\(skill\)/) assert.match(manageBlock, /SkillInstallTimeline/) assert.match(manageBlock, /settings\.skills\.manageUninstall/) - assert.match(manageBlock, /skill-manage__progress/) - assert.match(manageBlock, /v-if="!isBusy\(managedSkill\)"/) + assert.match(manageBlock, /skill-manage__section--danger/) + assert.match(manageBlock, /managedSkill\.status !== 'installing'/) + assert.match(manageBlock, /skill-manage__section--remove/) + assert.match(manageBlock, /askRemove/) + assert.match(manageBlock, /skillRemoveDone/) + assert.match(manageBlock, /progressStageText/) + assert.doesNotMatch(manageBlock, /t-icon name="delete"/) assert.doesNotMatch(manageBlock, /skill-manage__footer/) assert.doesNotMatch(manageBlock, /settings\.sandbox\.skillEnv\.save/) }) diff --git a/frontend/src/components/SandboxSkillsPanel.vue b/frontend/src/components/SandboxSkillsPanel.vue index ac2e95f5..2a5fb636 100644 --- a/frontend/src/components/SandboxSkillsPanel.vue +++ b/frontend/src/components/SandboxSkillsPanel.vue @@ -17,7 +17,7 @@

{{ $t('settings.sandbox.skillSourceSection') }}

-

{{ $t('settings.sandbox.skillSourceSectionHint') }}

+

{{ $t('settings.sandbox.skillSourceSectionHint', { size: MAX_FILE_SIZE_MB }) }}

{{ $t('settings.sandbox.skillUploadSection') }}

-

{{ $t('settings.sandbox.skillUploadSectionHint') }}

+

{{ $t('settings.sandbox.skillUploadSectionHint', { size: MAX_FILE_SIZE_MB }) }}

-