Repository navigation
feat(run-config): 内置脚本与程序运行,运行配置改存 YAML/TOML - #85
Merged
Merged
Conversation
- 新增 Core 自带的 process.shell、process.powershell、process.batch(仅 Windows)、process.executable 运行类型:脚本文件或脚本文本、脚本参数、工作目录、环境变量、解释器路径与参数,PowerShell 默认 -ExecutionPolicy Bypass 可取消;不依赖任何插件即可运行 - 新增 runConfig.configurationTypes / editorForm / saveConfiguration / deleteConfiguration:Core 描述编辑表单(字段类型、自动值、可见条件、错误码),校验并返回要写入的文件改动 - 运行配置文件改为 .lithe/run/configurations.yaml(共享)与 local.yaml(本机);插件提供的配置存 .lithe/run/plugin/<插件 ID>.toml 与 .local.toml,记录插件 ID、作者、仓库、版本、版本要求、pluginAPIVersion 与能力 - 插件缺失、仓库不一致或版本不满足时配置标为不可用并给出原因,不影响列表;旧 JSON 在没有 YAML 时读取,首次编辑后删除 - 所有编辑命令改为返回带 baseSha256 的文件改动,由宿主按哈希一次性应用,Core 不直接写文件 - 插件清单新增可选 repository 字段(https://github.com/<作者>/<仓库>) - 标题栏动作支持 process 与 unavailable;更新契约文档、schema、fixture 与协议更新记录 Refs 1lck/Lithe-IDEA#2100
已保存的配置在工作目录消失后不再被静默丢弃,改为带 missingWorkingDirectory 可用性返回,用户可以修改或删除;生成的配置仍按构建模型隐藏。
- runConfig.resolve 在还没有生成层时返回已保存的运行;一个都没有时返回空列表,不再报 workspace_not_found, 没有任何插件的项目也能新建第一个脚本运行 - 没有生成层时不报 orphanedOverride - 保存表单时,来源为“脚本文本”且文本为空只报 text 必填,不再同时报 script 必填
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
类型
feat:Core 自带的脚本与程序运行;运行配置文件改为 YAML(内置)与 TOML(插件);插件清单
schemaVersion0 内新增可选字段repository改动
Issue 要求不装任何插件也能运行平台自带的脚本和程序,并且 Java 等插件出问题时不影响这些运行。所以这四种运行类型由 Core 自己提供,编辑表单、校验、启动计划都在 Core,宿主只负责渲染和起进程。
内置运行类型(
execution/src/configuration/process.rs、form.rs)process.shell/bin/sh;Windows 上取 shebang 的程序名,没有时bashprocess.powershellpwsh,Windows 上powershell;固定带-NoLogo -NoProfileprocess.batchcmd /d;其他平台不出现在类型列表里,已有条目被丢弃并给出unsupportedPlatform诊断process.executable-ExecutionPolicy Bypass,可以取消。extensions.process:script、text、program、interpreter、interpreterArguments、executionPolicyBypass。inlineScript {path, content},路径是宿主传来的inlineScriptBase加.sh/.ps1/.cmd,由宿主写到系统临时目录、进程退出后删除;Windows 批处理额外给出commandLine,避免cmd的引号规则改写参数。runConfig.configurationTypes:列出本平台能新建的内置类型。runConfig.editorForm:描述表单字段和当前值。text、checkbox、choice、file、multilineText、arguments、directory、environment、executable。required、placement、automatic("自动(实际值)")、options、visibleWhen、note。formVersion1)。runConfig.saveConfiguration:校验表单,返回字段错误或要写入的文件改动。required、conflict、notAllowed、tooLong、invalidCharacter、invalidPath、notFound、outsideProject、invalidName、duplicate。runConfig.deleteConfiguration:返回删除用户配置的文件改动。process(Run → run、Debug → notDebuggable)和unavailable(决定unavailable)。运行配置文件(
storage.rs、plugin_document.rs、layers.rs、merge.rs、resolve.rs、editing.rs).lithe/run/configurations.yaml.lithe/run/local.yaml.lithe/run/plugin/<插件 ID>.toml.lithe/run/plugin/<插件 ID>.local.toml[plugin]记录id、name、author、repository、version、versionRequirement(默认>=保存时的版本)、pluginAPIVersion、capabilities。作者和仓库取自清单的repository,用来区分同名插件。availability给出原因:pluginMissing、pluginRepositoryMismatch、pluginVersionUnsupported、invalidConfiguration。整个列表照常读取。legacyDocumentIgnored、invalidPluginDocument、pluginDocumentMismatch、duplicateConfiguration、tooManyPluginDocuments、unsupportedPlatform。version升为 2。updateOptions、updateToolPreferences、saveEditorChanges、createUserConfiguration、saveConfiguration、deleteConfiguration)都返回changes: [{path, baseSha256, content}],由宿主按哈希检查后一次性应用。别人在中途改过文件时,宿主能发现冲突,不会覆盖。plugins(已安装插件的 ID、名称、仓库、版本、API 版本、能力),用于判断可用性和写文件头。已保存配置不再依赖生成层(
resolve.rs、form.rs)runConfig.resolve在还没有生成层时返回已保存的运行,一个都没有时返回空列表,不再报workspace_not_found。没有任何插件、没有构建模型的项目也能列出并新建第一个脚本运行。orphanedOverride,避免团队层里覆盖自动条目的配置在模型加载前全部报孤立。availability: missingWorkingDirectory,用户可以修改或删除;生成的配置仍按构建模型隐藏。text必填,不再同时报script必填。插件清单(
plugin-manifest、plugin-model)repository,值是https://github.com/<作者>/<仓库>;格式不对时报plugin.manifest.invalid(字段repository)。repository的插件照常安装,只是 Run 文件里不记作者和仓库,也不比对仓库。契约与文档
rust/contracts/rust-core-api.md:命令表、文件分层、诊断、changes 契约、内置运行一节、createLaunchPlan的inlineScript/commandLine。rust/contracts/application-boundary.md:YAML/TOML 和哈希检查的改动。run-configuration-v2.schema.json:process.*的选项与限制。plugin-manifest.schema.json:repository字段。title-action-v1.json、editor-save.json、visibility-v1.json(噪声文件改为local.yaml)。验证
cargo test --workspace:全部通过;新增core/src/tests/run_configuration.rs3 个集成测试和 execution 各模块单测。cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings(本机和x86_64-pc-windows-msvc目标)。scripts/rust-core/verify-rust-core-comments.sh execution core plugin-manifest plugin-model core-rulesnode shared/plugins/scripts/verify-docs.mjs已知限制:在 Windows 上,裸写的
bash可能解析到 WSL 的启动器。需要 Git Bash 时,在解释器路径里填写完整路径。