Repository navigation
feat(cli): add launch policy and opt-in shell registration rules - #129
Merged
Merged
Conversation
xiaoyumuxi
marked this pull request as ready for review
November 20, 2026 06:56
This was referenced Nov 20, 2026
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.
Refs 1lck/Lithe-IDEA#2166
直接传入文件时,Lithe 需要进入独立文本编辑模式,并且在注册 CLI 时保留用户已有的 shell/PATH 配置。本 PR 把启动与注册的共享规则放到 Core,原生文件系统、注册表和窗口操作由桌面适配器执行。
改动
application.cli.planLaunch:解析一个有界路径参数、--、帮助和版本选项,以及托管启动器使用的--cli脱离终端标记。application.cli.openTarget:根据适配器观察到的文件/目录类型选择项目或单文件模式,并返回插件策略和单文件命令白名单。单文件允许按需终端,不允许项目、Git、运行、调试或插件服务。application.cli.editRegistration:对 zsh/bash/sh/fish 的托管配置块和 Windows 用户 PATH 执行 inspect/install/remove;保留无关内容,拒绝畸形标记,并识别完整的 Lithe 启动器所有权。lithe-platform中集中 Unix/batch 启动器转义和 Windows 路径等价规则,两个平台以数据参数测试。rust/fixtures/application/cli-v1.json;不修改插件协议或 SDK。验证
cargo test --manifest-path rust/Cargo.toml -p lithe-core-rules -p lithe-platformcargo clippy --manifest-path rust/Cargo.toml -p lithe-core-rules -p lithe-platform --all-targets --target x86_64-pc-windows-msvc -- -D warningscargo fmt --manifest-path rust/Cargo.toml --all -- --checknode scripts/rust-core/verify-platform-tests.mjsTestCLISharedFixture及受影响 CLI/单文件/终端回归、竞态测试git diff --check按用户要求仅在本地测试改动范围。受契约、fixture 和 Cargo.lock 影响,CI 的 affected-crates 会选择更大范围;本地没有运行完整 workspace。Windows 规则测试和交叉编译不代表 HKCU/PATH、环境广播、cmd/PowerShell 或 ConPTY 的原生验收;本机没有可用的 Windows 来宾。
配套宿主与合入状态
宿主配套 Draft PR:1lck/Lithe-IDEA#2225 。本 PR 已合入为
6c84d32d4b82e358b41f5a7edf78f2a0ca7a3695,宿主的PINNED_CORE_REVISION更新已单独提交为 1lck/Lithe-IDEA#2226 。合入提交与本地已测试的ea502256b6537ff6aec7dff35892452cc5e8e7af的 tree 都是9ce26046821f9a1d65dfbaef529504dc62abac78,源码内容相同。本 PR 最初以 Draft 创建,GitHub 当前记录已合入;宿主 #2225 也已被账号合入;Core pin 更新 #2226 以 Draft 提交。原生平台验收和公开 UI 截图证据的限制仍见宿主说明。
既有债务
自查发现 Core 原有的
rust/crates/core/src/tests/published_build_plugins.rs包含真实 Maven/Gradle 插件 fixture,已由现存 Issue 1lck/Lithe-IDEA#2174 跟踪。本次新增 CLI 规则和测试不依赖具体插件,也没有在本 PR 顺手改动该测试。