Repository navigation
feat(plugin-api): 实现工作区读取、搜索与监听规划(API-06/07/08) - #190
Merged
Merged
Conversation
xiaoyumuxi
marked this pull request as ready for review
November 23, 2026 19:01
This was referenced Nov 23, 2026
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 29, 2026
* docs(plugins): 协议更新记录把已合入的 PR 移进时间线并回填日期(#222) “待合入”一节的 20 条记录(含 #224)对应的 PR 都已合入 main,按 UTC 合入日期改成时间线表格行,原文逐句保留,只删去“合入日期在合并时补齐” 之类的占位句;#193 已在时间线里,删去重复的待合入条目。新增 2026-11-24、 2026-11-22 两个日期分组。 - 回填“按协议查首次出现”的市场增量索引 schemaVersion 0(#187)、 toolchainProviders 1 与 litheToolchains 1(#182),以及“宿主方法 (按 API 编号)”里 #194、#190、#183、#151 的 18 个方法日期。 - 补录改了契约却没有登记的 #177、#117、#26。 - #207 的修改人按 PR 作者改为 devin-ai-integration[bot]。 - 时间线表头和维护说明统一用“改动”;转义 #133 行内代码里的竖线, 避免表格多出一列。 * docs(plugins): 已有宿主方法加字段也在方法表补行,统一方法表写法(#222) “宿主方法(按 API 编号)”表给 5 个 PR 补了 13 行,都是给已有方法或通知加字段、改校验时漏登记的: - #151:workspace/listContexts、workspace/getContext(authority 新增 platform),functions/invoke(转发远程工作区上下文的调用) - #184:API-11 的 7 个方法(路由前严格校验参数;workspace/create 的 kind 新增 symlink 与 linkTarget) - #188:editor/registerProviders(新增 colorDecorations) - #198:editor/registerActions(actionIcons 新增 4 个导航图标 token) - #224:agents/didPrompt(有附件时带 attachments) 统一写法:方法列只写方法名,补了什么写在协议列的括号里(#193 的 openHTML、openExternal,#23、#128 的 run/start,#128 的 prepareRun);同一个方法的各行排在一起,首次记录在前。 表格说明、维护第 3 步和 API PR 提交指南第 4 步写明:给已有方法或通知加参数、返回字段或取值,或改执行、校验行为,都在索引另加一行;API 总表不加行,用途、权限或协议变了就改原来那一行。
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
插件的六个工作区宿主方法已有公共名称和授权,但桌面端缺少可复用的 Core 执行能力。本 PR 先实现本地磁盘读取、搜索和监听事件规划,平台层随后只需提供上下文、原生文件事件和订阅生命周期。
workspace.readDirectory、workspace.stat、workspace.readFile内核命令。目录按 UTF-8 名字稳定分页,单次文件读取最多 128 KiB;明确返回 UTF-8 或 base64、截断标记与已读取前缀的 SHA-256 identity,不读取编辑器的未保存内容。workspace.watchPlan、workspace.watchEvents。Core 校验监听范围,对原生事件做隐藏过滤、排序去重,并在事件丢失、上限溢出或范围无法确认时要求重新扫描。监听由桌面端原生适配器实现,无空闲轮询。workspace.findFiles、workspace.findText。复用现有匹配器、文本解码和隐藏/索引排除策略,以有界 no-follow 遍历搜索磁盘,查询绑定游标,每页及连续分页总结果最多 200 条,支持取消和 30 秒预算。lithe-platform实现持有目录句柄的逐段读取:Unix 使用openat/O_NOFOLLOW;Windows 拒绝 reparse point,并在读取期间持有禁止写入/删除共享的祖先句柄。pluginAPIVersion: 0。watchEvents不逐批记录请求里程碑,避免文件事件形成日志热点。宿主方法(行为及执行补充)
workspace/readDirectoryworkspace/statworkspace/readFileworkspace/watchworkspace/findFilesworkspace/findText范围与限制
range: null。isTruncated。验证 / Verification
以下均在 macOS 运行;命令中的 crate 选择与过滤只覆盖本次改动及直接消费者。
cargo test --manifest-path rust/Cargo.toml -p lithe-projectcargo test --manifest-path rust/Cargo.toml -p lithe-plugin-rpcworkspace_read/workspace_find_watch定向测试scoped_read定向测试cargo fmt --manifest-path rust/Cargo.toml --all --checkcargo clippy --manifest-path rust/Cargo.toml -p lithe-project -p lithe-plugin-rpc -p lithe-core --all-targets -- -D warningsscripts/rust-core/verify-rust-core-comments.sh project platform plugin-rpc corenode scripts/rust-core/verify-platform-tests.mjsnode scripts/rust-core/affected-crates.mjsnode shared/plugins/scripts/verify-docs.mjstest:typesnode shared/plugins/scripts/sdk-e2e.mjs-race测试**未执行或未完成的检查:**没有运行 Windows 原生工作流及全 workspace 测试。非编辑器整机性能基线入口已随旧客户端移除,本次未验证原生窗口/GPU/RSS 的前后基线,测试耗时不作为性能结论。旧共享契约、Core 与日志使用专用门禁已移除,缺失门禁不记为通过;现有契约 fixture、文档、注释与日志目录检查已通过。
提交前确认 / Final checks
origin/main(289af38)创建并保留独立 API 分支,不混入桌面当前依赖的 Core feat(plugin-marketplace): 验证并重建插件增量包 #187。5fa6f5875ee8a1fe5140a44e84d29dae2ce6d6fb),合入树与已验证的最终分支树一致。桌面端固定9ab2336,保留其原有 Core feat(plugin-marketplace): 验证并重建插件增量包 #187 增量更新依赖并加入本 PR;默认 pin 的 macOS 定向竞态测试已通过。