[提案] produced-file 打开动作可拦截 (含补丁分支与测试) #173
Electricitysheep
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
提案:produced-file 打开动作可拦截(含补丁分支)
问题
ui-deliverables的 ProducedFiles 行打开动作硬编码调用 Host opener(openFile),客户端插件无法把点击路由到自己的视图(例如在侧边栏打开而非系统查看器)。这与 README 的插件化理念("everything is a plugin")不符。方案(已实现 + 测试,补丁在分支)
routeFileOpen(interceptors, fallback, path):零依赖纯函数——第一个返回true的拦截器接管,否则回退 Host openerProducedFiles经 inject face 接收fileOpenInterceptors;文件 chip 与「在文件夹中显示」都走拦截路由registerFileOpenInterceptor(fn)供客户端插件注册(返回注销函数);fiber 销毁清空注册表(HMR 安全)补丁分支:
https://github.com/Electricitysheep/deepseek-harness/tree/feat/deliverables-file-open-interceptor(commitfd4b4d5,4 文件,+205/-5)测试
routeFileOpen单元用例 + ProducedFiles 组件用例(接管/回退/链停止/folder 路由)+ 插件注册级用例(注册/注销/fiber 销毁清空),已写入tests/produced-files.client.spec.tsxrouteFileOpen本机零依赖隔离环境 5/5 通过;组件/插件级用例依赖 dsh web 运行时(ModuleLoader),待仓库 CI后续
已知 CONTRIBUTING 说明当前不接受外部 PR——本贴供评估与后续采纳;如需调整方向(例如改为官方内置的 interceptor 服务而非模块级注册表),欢迎讨论。补丁亦可随时迁移到社区插件实现。
All reactions