✨ 打包变量屏蔽正式版 agent 入口并移除 debugger 权限(bump 1.4.0)#1518
Open
CodFrm wants to merge 3 commits into
Open
Conversation
- scripts/build-config.js:isAgentEnabled(dev/beta 启用) + applyAgentManifest(正式版剥离 debugger) - rspack.config.ts / pack.js:注入 process.env.SC_ENABLE_AGENT,按版本处理 manifest 权限 - const.ts 暴露 EnableAgent,门控侧边栏 agent 菜单与 /agent/* 路由 - MainLayout/install 安装页屏蔽 Skill ZIP、SkillScript、.cat.md 等安装入口 - service_worker/script.ts 屏蔽 .skill.js/.cat.md 的 DNR/webNavigation 拦截与识别 - agent 运行时(CAT_*/AgentService)保持不变;vitest 默认 SC_ENABLE_AGENT=true
- build-config 新增 resolveAgentEnabled:env 覆盖优先,否则按版本派生 - rspack.config.ts / pack.js 改用 resolveAgentEnabled - test.yaml e2e 构建设 SC_ENABLE_AGENT=true,使正式版下 agent 用例仍可运行 - 正式版默认仍屏蔽 agent(无 env 时不变)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist / 检查清单
Description / 描述
新增打包变量
SC_ENABLE_AGENT,由版本号自动派生:开发版 / beta(版本含-)启用 agent,正式版屏蔽。同时将版本号 bump 到1.4.0(正式版)。构建 / Build
scripts/build-config.js:isAgentEnabled({isDev,isBeta})(dev/beta 启用)+applyAgentManifest()(正式版从permissions剥离debugger,其余权限不变,不改src/manifest.json源文件)。附带 7 个 BDD 单测。rspack.config.ts/scripts/pack.js:注入process.env.SC_ENABLE_AGENT定义;对dist/ext与 zip/crx 的 manifest 套用同一逻辑。入口屏蔽(正式版)/ Gated entries (stable)
/agent/*路由(Sider.tsx)MainLayout.tsx);安装页?skill=、.cat.mdURL、本地 / URL SkillScript(install/hooks.tsx、install/utils.ts).skill.js/.cat.md的 DNR 重定向、webNavigation 过滤、openInstallPageByUrl的 skill 识别(service_worker/script.ts)保持不变 / Unchanged:agent 运行时(
CAT_*GM API、SWAgentService)仍注册;仅正式版构建移除debugger权限。验证 / Verification
debugger、SW bundle 中.skill.js/.cat.md拦截规则被 swc 完全消除;const.ts编译出EnableAgent=!1debugger、拦截规则齐全;EnableAgent=!0tsc0 错、eslint0 错、单测 1994 passedScreenshots / 截图
N/A(构建 / 入口门控改动,无 UI 视觉变化)