diff --git a/rust/crates/plugin-rpc/src/workflow.rs b/rust/crates/plugin-rpc/src/workflow.rs index 0d61f137..d16c8b7e 100644 --- a/rust/crates/plugin-rpc/src/workflow.rs +++ b/rust/crates/plugin-rpc/src/workflow.rs @@ -390,6 +390,7 @@ fn directory_marks_valid(p: &Map) -> bool { | "testResources" | "generated" | "excluded" + | "package" ) || is_plugin_directory_type_id(role) }); let valid_color = obj @@ -870,7 +871,8 @@ mod tests { "context": context, "marks": [ {"path": "db/migrations", "role": "plugin.migrations"}, - {"path": "src/main", "role": "sources", "color": "#3b82f6"} + {"path": "src/main", "role": "sources", "color": "#3b82f6"}, + {"path": "src/main/java/com/example", "role": "package"} ] } }); @@ -886,8 +888,8 @@ mod tests { }); assert!(command(invalid_mark_path).is_err()); - // The resolver draws `module` and `package` as plain folders and refuses blank - // names and Windows drive separators, so the host must never store them. + // The resolver draws `module` as a plain folder and refuses blank names and + // Windows drive separators, so the host must never store them. for (field, value) in [("icon", json!("module")), ("name", json!(" "))] { let mut item = json!({"id":"plugin.x","name":"X","icon":"folder","color":"#0d9488"}); item[field] = value; diff --git a/rust/crates/project/src/directory_actions.rs b/rust/crates/project/src/directory_actions.rs index eec255bc..bc96bf40 100644 --- a/rust/crates/project/src/directory_actions.rs +++ b/rust/crates/project/src/directory_actions.rs @@ -1053,7 +1053,7 @@ fn style_for_role( false, ), "module" => ("folder".into(), None, false, false, None, false, false), - "package" => ("folder".into(), None, false, false, None, false, false), + "package" => ("package".into(), None, false, false, None, false, false), _ => ("folder".into(), None, false, false, None, false, false), } } diff --git a/rust/fixtures/workspace/directory-rules-v1.json b/rust/fixtures/workspace/directory-rules-v1.json index 4c4da7e3..3ef537c0 100644 --- a/rust/fixtures/workspace/directory-rules-v1.json +++ b/rust/fixtures/workspace/directory-rules-v1.json @@ -140,9 +140,10 @@ {"pluginId": "com.example.a", "path": "db/migrations", "role": "plugin.migrations"}, {"pluginId": "com.example.a", "path": "db/override", "role": "plugin.migrations"}, {"pluginId": "com.example.a", "path": "manual", "role": "excluded"}, - {"pluginId": "com.example.a", "path": "out", "role": "excluded", "color": "#ff0000"} + {"pluginId": "com.example.a", "path": "out", "role": "excluded", "color": "#ff0000"}, + {"pluginId": "com.example.a", "path": "pkg/com/example", "role": "package"} ], - "paths": ["db/migrations", "db/migrations/V1", "db/override", "manual", "out", "pkg/.cache"] + "paths": ["db/migrations", "db/migrations/V1", "db/override", "manual", "out", "pkg/.cache", "pkg/com/example"] }, "response": { "entries": { @@ -151,7 +152,8 @@ "db/override": {"role": "generated", "source": "shared", "icon": "generated", "color": "#9f7aea", "bgColor": "#9f7aea", "tintText": false, "tag": "generated", "excluded": false, "readOnlyHint": true}, "manual": {"role": "sources", "source": "user", "icon": "sources", "color": "#4e8df5", "bgColor": "#4e8df5", "tintText": false, "tag": "sources", "excluded": false, "readOnlyHint": false, "autoFallbackRole": "excluded"}, "out": {"role": "excluded", "source": "plugin", "pluginId": "com.example.a", "icon": "excluded", "color": "#ff0000", "bgColor": "#ff0000", "tintText": false, "tag": "excluded", "excluded": true, "readOnlyHint": false}, - "pkg/.cache": {"role": "plugin.cache", "source": "glob", "pluginId": "com.example.a", "icon": "archive", "color": "#64748b", "tintText": false, "excluded": true, "readOnlyHint": false} + "pkg/.cache": {"role": "plugin.cache", "source": "glob", "pluginId": "com.example.a", "icon": "archive", "color": "#64748b", "tintText": false, "excluded": true, "readOnlyHint": false}, + "pkg/com/example": {"role": "package", "source": "plugin", "pluginId": "com.example.a", "icon": "package", "tintText": false, "excluded": false, "readOnlyHint": false} }, "manualExcludedDirectories": ["out", "pkg/.cache"] } diff --git a/shared/plugins/contract/v1/README.md b/shared/plugins/contract/v1/README.md index 42cd5859..f6384d35 100644 --- a/shared/plugins/contract/v1/README.md +++ b/shared/plugins/contract/v1/README.md @@ -5419,8 +5419,8 @@ at most 64 bytes; `tag` is at most 24 bytes; `icon` is one of `folder`, A mark has a unique workspace-relative `path`: nonempty, at most 1024 bytes, `/`-separated, without a leading or trailing `/`, an empty, `.` or `..` segment, `\`, `:` or a control character. Its `role` is `plain`, `sources`, -`tests`, `resources`, `testResources`, `generated`, `excluded` or a `plugin.*` -ID, which may name a type another plugin registers; a mark whose type no live +`tests`, `resources`, `testResources`, `generated`, `excluded`, `package` or a +`plugin.*` ID, which may name a type another plugin registers; a mark whose type no live session registered displays as a plain folder. `color` is optional `#rrggbb`. The host merges every live registration below the user's own marks, colors and diff --git a/shared/plugins/reference/protocol-changelog.md b/shared/plugins/reference/protocol-changelog.md index a5270620..ca5a654e 100644 --- a/shared/plugins/reference/protocol-changelog.md +++ b/shared/plugins/reference/protocol-changelog.md @@ -22,6 +22,7 @@ | [#240](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/240)(待合入) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-45 | `agents` 0 内的补充 | 会话来源 `read` 函数增加可选请求参数 `messageIDs`:只有 `true` 时才可在消息里返回可选 `id`(1–256 个可见 ASCII 字节,来源会话内稳定,同一消息的镜像相同);省略或为 `false` 时保留旧结果形状。同时增加可选请求参数 `toolCalls`:只有 `true` 时 `tool` 消息才可带实时 `toolCall` 的详情 `toolCallID`、`status`、`toolKind`、`title`、`locations`(同一调用和它的结果共用 `toolCallID`,宿主按实时方式合并,让历史轮次和实时显示一致)。Core 的新宿主命令 `agentSessions.page` 协商该参数并按整行双向分页,两个参数都由它发送,旧 `agentSessions.read` 和标题读取不协商,回答里出现这些详情字段(包括显式 `null`)时以 `agentSessions.invalidRead` 拒绝。`agentSessions.list` 的会话新增 `generation`:文件只增长时不变,被替换或截断后重新读取时换新值;`agentSessions.page` 必须带上同一次列表的 `generation`,不一致时回答 `changed`。四语 SDK 都使用已有普通 JSON 函数处理器,无类型或版本变化;旧插件可忽略参数。没有新增宿主方法、通知、错误码或能力版本。样例见 `fixtures/agents/record-read.json` 与 `rust/fixtures/agents/record-page-v1.json`;首次实现见 Core `15c0717`;宿主发布版本尚未产生。 | | [#218](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/218)(待合入) | [@WhiteZeek](https://github.com/WhiteZeek) | API-29 | `buildSystems` 0 内的补充 | 清单 `buildSystems[].detection` 新增可选 `ignoredPaths`:最多 256 条有序的 `.gitignore` 目录规则,每条不超过 1024 个 UTF-8 字节,相对工作区根匹配,只过滤这个构建系统的候选目录。候选目录或它到工作区根之间的任一目录被忽略就不算实例,`outermost` 下被忽略的外层根下的标记文件也不会变成实例;每一层先看工作区规则,工作区的 `!` 规则可以放回;工作区根本身不参与匹配。规则无法编译或超长时整个清单以 `plugin.manifest.invalid` 拒绝,字段为 `buildSystems[i].detection.ignoredPaths[j]`。Core 命令 `build.detect` 的回答总是带 `detection.pluginIgnoredPaths`(`{pluginID, buildSystemID, displayName, patterns}`,按构建系统 ID 排序,只列胜出的声明,没有时为 `[]`),供宿主和可编辑的工作区规则分开展示。固定样例见 [`detect-plugin-ignored-paths-v1.json`](../../../rust/fixtures/build/detect-plugin-ignored-paths-v1.json)。不影响项目树、搜索和索引;没有新增宿主方法、通知、错误码或 SDK 版本。旧宿主会拒绝使用该字段的清单,插件要等包含这个改动的桌面端发布后再用。 | | [#227](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/227)(待合入) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | 市场索引 `schemaVersion` 0 内的补充 | 一个仓库发布多个插件时,每个插件的 Release 标签用自己的前缀:`<前缀>MAJOR.MINOR.PATCH`(如 `codex-v0.1.0`、`claude-code-v0.1.0`)。索引字段不变:`plugins.marketplace.validateIndex` 的输出条目新增 `releaseTagPrefix`,由 Core 从下载地址的标签派生;每个标签都拆成同一个前缀加上列出它的版本号时为该前缀,否则为 `null`。宿主用它读取插件自己的更新日志(`listReleases` 的 `tagPrefix`)。只新增 Core 输出字段,旧宿主照常读取同一份索引;没有新增宿主方法、通知、错误码、能力版本或 SDK 版本。规则见 [`marketplace.md`](domains/marketplace.md#一个仓库发布多个插件)。 | +| [#250](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/250)(待合入) | [@devin-ai-integration[bot]](https://github.com/apps/devin-ai-integration) | API-05 | `pluginAPIVersion` 0 / `litheFunctions` 0 内的修正 | `workspace/setDirectoryMarks` 接受解析器已有的内建 `package` 角色,项目树按包目录图标呈现;`workspace/setDirectoryTypes`、权限、数量上限、合并优先级和所有版本不变。四种官方 SDK 已以通用 JSON 参数暴露该方法,本 PR 无 SDK 类型或版本变化;旧 Core 会以参数无效拒绝包含 `package` 的整组标记,插件应按能力/错误降级。 | | [#228](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/228)(待合入) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | `toolDefinitions` 0 / 1 内的补充 | 多个已启用插件声明同一个工具短 ID 且规范化定义完全一致时,`toolchains.registry` 与 `toolchains.discoveryPlan` 自动聚合成一条定义,并在有多个声明插件时附带排序后的 `pluginIDs`;定义不同仍作为 `conflicts` 拒绝。不提升 `toolDefinitions` 能力版本,不新增宿主方法、通知、错误码或 SDK 版本。规则见 [`toolchains/README.md`](../contract/v1/toolchains/README.md#commands-and-envelopes)。 | ## 按协议查首次出现 @@ -119,6 +120,7 @@ | API-05 | `workspace/getFolders` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | | API-05 | `workspace/setDirectoryTypes` | 0 | 2026-11-27 | [#215](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/215) | | API-05 | `workspace/setDirectoryMarks` | 0 | 2026-11-27 | [#215](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/215) | +| API-05 | `workspace/setDirectoryMarks` | 0(接受内建 `package` role) | 待合入 | [#250](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/250) | | API-06 | `workspace/readDirectory` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) | | API-06 | `workspace/readDirectory` | 0(执行/校验补充) | 2026-11-23 | [#190](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/190) | | API-06 | `workspace/stat` | 0 | 2026-11-11 | [#17](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/17) |