Repository navigation
feat(plugin-api): 接入 Core 通用工作流与原生宿主服务 - #2372
Draft
xiaoyumuxi wants to merge 2 commits into
Draft
xiaoyumuxi wants to merge 2 commits into
xiaoyumuxi wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
插件已有后端和视图入口,但缺少完成常见工作流所需的输入、预览、对比、输出、进度、系统交互及 HTTP 方法。本 PR 在 Core 完成参数、默认值、权限、预算与共享规则之后,接入 Viva 控件、原生 I/O 和资源生命周期,新增 19 个宿主方法并扩展 2 个已有方法。
例如,插件可以让用户搜索并选择条目,展示只读说明和文本差异,把执行结果追加到输出通道,并显示可取消进度;关闭工作区会取消在途调用并释放该上下文的输出、进度和状态项。
改动 / Changes
75e148091439248e5927c58790019b26de02ca87,包含 Core fix: 设置面板偶现滚轮滚动失效 #193、feat(macOS): support terminal tab docking #194,同时保留原固定版本的 [Feature] 想要支持直接终端在文件展示的界面打开的那种形式 #190 工作区 API 与尚未合入的 [Bug] Windows preview 0.3.0 编辑器持续卡顿:每键全文同步、Git blame 与 LSP 轮询 #187 插件增量更新依赖。该提交在integration/plugin-workflow-desktop分支可取,没有为接入本功能合并其他 PR。requireSaved,不自动保存脏文档。有界 HTTP 支持取消、超时、响应头/正文预算和二进制 base64;惰性复用系统代理/证书的 transport,无 Cookie jar、不自动跟随重定向,错误分类不泄漏 URL、查询参数、请求头或正文。hasChildren懒展开与cursor分页,Core 判断何时加载、何时停止,桌面保留稳定选择和展开。纯后端命令进入命令面板及已有快捷键目录,不再要求工具窗口。docs/ci-builds.md。首次上传的 Linux 图存在中文缺字,检查发现后在40cf49cc5补齐 runner 字体依赖,未修改产品字体或伪造截图。桌面涉及的多个既有文件仅承担控件、菜单、预览入口、设置区域观察和资源释放接线;共享参数校验、默认值、权限、过滤排序、分页停止规则与输出增量都在 Core。未引入具体插件业务或插件测试。
不在本 PR 范围内 / Out of scope
partial/pending;macOS 无头/组件测试不代替系统 WebView、剪贴板、外部浏览器及文件管理器的整机操作验收。类型专属:feat
多平台对齐
范围检查 / Scope checks
功能矩阵 / Feature matrix
plugin-host-editor-file-window-services.json与declarative-native-plugin-ui.json,记录两平台实现、证据与验证动作;未完成原生验收的状态保持pending。verify-platform-feature-matrix.sh与verify-platform-feature-matrix-change.sh origin/main HEAD通过,生成并核对 HTML、Markdown、CSV 和 JSON。.artifacts/生成物。插件归属 / Plugin ownership
UI 验证 / UI evidence
de251c4e3对应实现与固定 Core75e1480下运行TestVisualPluginWorkflow并检查 20 张实际 PNG:空工作台、输出与预览、真实点击后的任务菜单、只读 Diff、快速选择。主题light/dark,语言zh-Hans/en-US;窗口 1100×720 points,PNG 1952×1278。40cf49cc5;已下载检查,中文正常、明暗主题和各交互场景均实际呈现。macOS 同场景 20 张图也已在本地生成并检查。统一日志系统 / Structured logging
TestEveryLoggedEventIsAcceptedByTheKernel通过。界面文案 / i18n
逻辑归属 / Logic placement
性能与内存 / Performance and memory
设置 / Settings
N/A:没有新增设置项或移动设置页;只为已有插件设置区域接入主动刷新和分页投影。
插件契约 / Plugin contract
PINNED_CORE_REVISION升至75e1480;最终固定版本下的消费者测试通过,不依赖本地 Core 路径覆盖。sdk-e2e.mjs16 个场景及四种 SDK 测试通过;feat(macOS): support terminal tab docking #194 的相关 CI 亦通过。statusBar/setItemstatusBar/removeItemeditor/showDiffviews/refreshpreview/openMarkdownpreview/openHTMLbrowser/openExternalwindow/showQuickPickwindow/showInputBoxclipboard/readTextclipboard/writeTextworkspace/revealoutput/createoutput/appendoutput/clearoutput/showoutput/disposeprogress/createprogress/reportprogress/endnetwork/request发行包与资源 / Bundle and resources
TestInstalledResourcesStayUnchanged通过;后者在复制的安装包中运行生产工作台并比较前后哈希。docs/ci-builds.md记录截图路径、生命周期与不可跨检出复用的限制。CI artifact 保留 14 天,截图不进入安装包。无用代码与重构 / Dead code and refactoring
refactorIssue:本轮没有另行发现并引入需要登记的既有债务。验证 / Verification
所有下列桌面命令均从仓库根运行,通过
scripts/desktop/desktop-go.sh链接固定 Core。按任务要求,仅运行改动与直接影响范围,全量检查交给 CI。desktop-go.sh test ./internal/core ./internal/pluginservice ./internal/workbench ./internal/pluginview -run 'Test(EveryLoggedEventIsAcceptedByTheKernel|Workflow|BrowserOpensOnlyHTTP|SessionRefresh|WorkbenchDefaultLayout)' -count=1 -timeout=60sdesktop-go.sh test -race ./internal/pluginservice ./internal/workbench ./internal/pluginview -run 'Test(Workflow|BrowserOpensOnlyHTTP|SessionRefresh|WorkbenchDefaultLayout)' -count=1 -timeout=90sdesktop-go.sh vet ./internal/core ./internal/pluginservice ./internal/pluginview ./internal/settingswindow ./internal/workbench;设置区域与权限说明定向-racedesktop-go.sh test ./internal/pluginservice ./internal/pluginview ./internal/settingswindow ./internal/workbench -run 'Test(WorkbenchMethods|EditorActionRegistration|ViewEvent|Session|Draw|Decode|Region|EveryContractPermission|Installed.*Permission|PluginEdits|PluginOpen|HTML|Markdown|DiffTab|DiffSettings)' -count=1 -timeout=60sdesktop-go.sh test -tags dev ./internal/pluginview ./internal/settingswindow ./internal/workbench -run 'Test(Workflow|SessionRefresh|WorkbenchDefaultLayout|RegionView|EveryContractPermission|HTMLFile|Markdown|DiffTab)' -count=1 -timeout=60sdesktop-go.sh test ./internal/workbench -run '^TestInstalledResourcesStayUnchanged$' -count=1 -timeout=60sLITHE_VISUAL_OUTPUT_DIR="$PWD/.artifacts/plugin-workflow-visual" desktop-go.sh test -tags 'vivahead lithevisual' ./internal/workbench -run '^TestVisualPluginWorkflow$' -count=1 -timeout=90s.artifacts/test-stability/index.htmlverify-test-stability.sh与--base origin/mainactionlint、git diff --checkactionlint .github/workflows/desktop-ci.yml与node --test scripts/ci/desktop-ci/verify-ci-gate.test.mjs未能执行的检查和原因:
提交前确认 / Final checks
origin/main基线5ea2c1c7a创建,目标为main。