fix(core): IrisAPI 属性名与 extension-sdk 类型声明不匹配 - #28
Open
uuuiiiiooo wants to merge 1 commit into
Open
Conversation
iris-core.ts 构建 IrisAPI 对象时使用了 JS shorthand property (registerRoute, registerPanel),导致属性名为 registerRoute/registerPanel, 但 extension-sdk 的 IrisAPI 接口声明为 registerWebRoute/registerWebPanel。 由于两个方法都标记为 optional (?),TypeScript 编译期不会报错, 运行时扩展调用 api.registerWebRoute() 得到 undefined, 所有扩展的 Web 路由和面板静默注册失败。 影响范围:所有使用 registerWebRoute/registerWebPanel 的扩展 (server-ops、computer-use、cron 等)
Lianues
force-pushed
the
dev
branch
2 times, most recently
from
April 14, 2026 00:27
b8c9b1c to
da04e9a
Compare
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.
问题
iris-core.ts构建 IrisAPI 对象时使用了 JS shorthand property 语法:这导致对象属性名为
registerRoute/registerPanel,但extension-sdk中的IrisAPI接口声明为registerWebRoute/registerWebPanel。由于这两个方法标记为
optional (?),TypeScript 编译期不报错。运行时扩展调用api.registerWebRoute()得到undefined,所有扩展的 Web 路由和面板静默注册失败。影响范围
所有使用
registerWebRoute/registerWebPanel的扩展:extensions/server-ops(运维面板)extensions/computer-use(浏览器控制)extensions/cron(定时任务管理)修复
将 shorthand property 改为显式映射,使属性名匹配 SDK 类型声明:
测试要点
Web 路由和面板已注册/api/plugins/server-ops/panel确认 Dashboard 正常渲染